On Wed, May 9, 2012 at 6:37 PM, jaimin jetly <
jaimin...@gmail.com> wrote:
> Ant is specific to my project which I use to configure+make my project
> and the project uses Json-c. I was thinking if I could download and
> configure+make Json-c (stable) through my ant build.xml. Ant would
> simply use configure+make commands.
>
> make n configure in build.xml:
>
> <target name="compile" >
> <exec executable="autoreconf" dir="${basedir}"
> searchpath="yes" failonerror="yes">
> <arg value="-if"/>
> </exec>
>
> <exec executable="${basedir}/configure" dir="${basedir}"
> failonerror="yes">
> </exec>
>
> <exec executable="make" failonerror="true"/>
> </target>
Well, sure something like that will probably work, but it's a bit
unusual to be constantly building a library that is external to your
project. At the very least you'll need to be sure to include a "make
install" command to install the binaries (and perform the final
link!), and a --prefix option to configure so the build doesn't try to
install things to a location that you don't have permissions to write
to.
However, I highly recommend building json-c ahead of time and
installing it normally (i.e. system wide) if you can. If you can't,
then things get tricky, especially if you're working in a
heterogeneous environment (e.g. building on NetBSD one day, Linux the
next, etc...). I've had reasonable results using architecture
specific artifacts stored in a Maven repository using the nar plugin,
but using Maven would be a pretty big change from ant.
eric