I am building a project using autotool
. Basically the project depends on several 3rd-party projects which are also managed by autotool
.
my_project/
my_project/3rd-party/
To enable recursive build, I add AC_CONFIG_SUBDIRS
macros in my configure.ac:
AC_CONFIG_SUBDIRS([3rd-party/gtest-1.7.0])
AC_CONFIG_SUBDIRS([3rd-party/libstatgrab-0.91])
AC_CONFIG_SUBDIRS([3rd-party/leveldb-1.2.0])
This gives me a convenience of recursive build, link, and clean. However, I do not want to install all these 3rd-party libraries but my own project when I hit make install
. Is there anyway for me to get rid of this particular recursion?
I don't think you can simply remove this single one if you don't change any makefile in the 3rd-pardy directories (which you could even do from the main Makefile, just rename the target via sed
[dirty hack]).
I guess you internal call configure in the 3rd-party directories, don't you? If yes you may set the prefix
(or data-prefix
and exec-prefix) different. It may be a good idea in any case to create a
3rd-party-build` directory and both build the 3rd-party stuff there and change the install prefix to use this.
You didn't asked for it but the "solution" is different: remove the 3rd-party stuff from your main makefile:
build_dep.sh
This both solves the problem and allows to use the libraries/tools if they exist already and gives the user the option to use a different version while keeping the simple "you can have it all from the main directories and don't need to get/build the dependencies on your own"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With