[Scons-users] Issues Generating Java Classes from a Swig Interface (.i) under Scons

Bill Deegan bill at baddogconsulting.com
Sun Oct 11 18:13:38 EDT 2015


Can you provide an example SCons + .i file which reproduces this problem?
(something simple I can run on my machine)

On Sun, Oct 11, 2015 at 2:10 PM, Bailey Stephen via Scons-users <
scons-users at scons.org> wrote:

> When I attempt to run scons (2.3.0) to build a class from a SWIG interface
> file, scons fails to pick up all the generated files, either as being in
> the sourcepath, or to be included in the build (even with classpath set).
> Instead only two java files are attempted to be compiled, both of which
> fail because they are derived from other classes.
>
> loc_env = env.Clone()
> loc_env['JAVACLASSPATH']= ['build/$TARGET_ARCH/$TARGET_OS/.../java']
> swig_j = loc_env.Java(target='.', source=['source_java.i']) #1#swig_j = loc_env.Jar(target='.', source=['source_java.i']) #2
>
> Both #1, and #2 fail to produce a result. #2 shows an error message that
> the source has not been accepted, and is a blank string, which I can
> accept, even with example code suggesting it should work.
> For #1 The root cause seems to be in Scons/Tool/swig.py def
> _find_modules(src):, which has a regex to match all modules generated,
> but fails to account for any raw enums or other artefacts from wrapping up
> C code. When I had a hand-rolled makefile the classpath
> For reference, The javac build instruction for #1 is:
>
> javac -classpath build/x86_64/linux/.../java -d build/x86_64/linux/.../java/ -sourcepath build/x86_64/linux/.../java build/x86_64/linux/release/.../source.java build/x86_64/linux/release/.../sourceJNI.java
>
> (This does not contain the additional files for the accessors, enums,
> structs, etc. that are generated by SWIG, and so javac fails.)
> Is this a known bug (As part of SCONS' handling of 1->N mappings)? Is it a
> flaw in the Scons Parsing of .i files? or is it a more fundamental issue?
> Best Regards,
> Steve
>
> _______________________________________________
> Scons-users mailing list
> Scons-users at scons.org
> https://pairlist4.pair.net/mailman/listinfo/scons-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist4.pair.net/pipermail/scons-users/attachments/20151011/ff8d6d2c/attachment-0001.html>


More information about the Scons-users mailing list