Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Avoiding recursive make install

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?

like image 969
Jes Avatar asked Sep 22 '16 19:09

Jes


1 Answers

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 a3rd-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:

  • create a build_dep.sh
  • this may download and/or unpack and configure and make the 3rd-party stuff
  • your configure script (if you have this) would check if these are existing and working, if not: search the system directories instead.

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"

like image 187
Simon Sobisch Avatar answered Oct 05 '22 04:10

Simon Sobisch