On Fri, Apr 28, 2006 at 09:05:02PM -0700, Russ Allbery wrote: > Bob Rossi <bob_rossi@xxxxxxx> writes: > > > I would like to have my package create a single static library and a > > single program by default. > > > However, if the user does --enable-tcl-extension, then I would like to > > create a shared library using libtool. > > > Can I do something in configure.in that says > > if .. > > AM_LIBTOOL > > fi; > > > or is this invalid? > > Here's what I do for INN. It seems to work well enough. I then use > @LIBTOOLCC@ and @LIBTOOLLD@ (well, a variable set to that) before the > actual compile and link commands where appropriate in Makefiles. > > > dnl A few tests need to happen before any of the libtool tests in order to > dnl avoid error messages. We therefore lift them up to the top of the file. > AC_PROG_CC > AC_AIX > AC_ISC_POSIX > AC_CANONICAL_HOST > > dnl Check to see if the user wants to use libtool. We only invoke the libtool > dnl setup macros if they do. Keep this call together with the libtool setup > dnl so that the arguments to configure will be together in configure --help. > inn_use_libtool=no > AC_ARG_ENABLE(libtool, > [ --enable-libtool Use libtool for lib generation [default=no]], > if test "$enableval" = yes ; then > inn_use_libtool=yes > fi) > if test x"$inn_use_libtool" = xyes ; then > AC_PROG_LIBTOOL > EXTLIB='la' > EXTOBJ='lo' > LIBTOOL='$(top)/libtool' > LIBTOOLCC='$(top)/libtool --mode=compile' > LIBTOOLLD='$(top)/libtool --mode=link' > else > EXTLIB='a' > EXTOBJ='o' > LIBTOOL='' > LIBTOOLCC='' > LIBTOOLLD='' > AC_SUBST(LIBTOOL) > fi > AC_SUBST(EXTLIB) > AC_SUBST(EXTOBJ) > AC_SUBST(LIBTOOLCC) > AC_SUBST(LIBTOOLLD) > > -- > Russ Allbery (rra@xxxxxxxxxxxx) <http://www.eyrie.org/~eagle/> Thanks Russ, This is really helpful. Bob Rossi _______________________________________________ Autoconf mailing list Autoconf@xxxxxxx http://lists.gnu.org/mailman/listinfo/autoconf