dcsimg
Compiling C and Java
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   David_Clark
Posted On:   Monday, November 5, 2001 05:18 AM

Hi, I am looking to use Ant to compile C/C++ code and Java code within the same project. This is because the Java code is going to be using jni to use the C code as a library. So, wanted to be able to build from top down and build the whole lot in one go - like make could probably be forced to do. Is there any documentation about using Ant to build non-java code (cos I've looked and can't find any)? Am I going to have to just use the tag to get gcc to compile the C code? Or, am I going to have to write my own bit of java to call the gcc? Help much appreciated. David. (working on Linux and Solaris)    More>>

Hi,


I am looking to use Ant to compile C/C++ code and Java code within the same project. This is because the Java code is going to be using jni to use the C code as a library.

So, wanted to be able to build from top down and build the whole lot in one go - like make could probably be forced to do.


Is there any documentation about using Ant to build non-java code (cos I've looked and can't find any)?
Am I going to have to just use the tag to get gcc to compile the C code?
Or, am I going to have to write my own bit of java to call the gcc?


Help much appreciated.

David.

(working on Linux and Solaris)

   <<Less

Re: Compiling C and Java

Posted By:   Erik_Hatcher  
Posted On:   Monday, November 5, 2001 05:07 PM

'ing to gcc or make (or even nmake) is actually an excellent way to go for C/C++ code compilation. Ant currently does not have builtin C/C++ compilation capability (although some folks have made some progress with it, see the ant-dev e-mail list archives for more details).


Also, to generate JNI headers give the (an optional Ant task) a try.

About | Sitemap | Contact