Question

I'm using autoconf to generate a configure shell script based on an configure.ac input file.

By default, the generated configure script supports the option --enable-shared , which has default value "yes". I.e., ./configure --help | grep enable-shared

--enable-shared[=PKGS]  build shared libraries [default=yes]

This seems to be a standard option that is always included in configure scripts. But, is there a way to have the configure shell script generated such that its default value for --enable-shared is no ? I presume this requires me either to put some special AC_ARG_??? statements in my configure.ac file, or, provide command line options to autoconf.

Thanks

Était-ce utile?

La solution

Fortunately, this is as easy as providing an option to a libtool macro...

In configure.ac, it's a good idea to check if your libtool installation is recent enough - the current stable release being 2.4.2 :

LT_PREREQ([2.4.2]) # not 'technically' required, but good practice.

Followed by setting the relevant option in the LT_INIT macro:

LT_INIT([disable-shared])

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top