libtool/configure.ac

193 lines
5.6 KiB
Plaintext
Raw Normal View History

## Process this file with autoconf to create configure. -*- autoconf -*-
2004-01-05 04:45:24 +08:00
# Copyright (C) 2001 Free Software Foundation, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
# 02111-1307 USA
AC_PREREQ(2.58) ## We use AS_HELP_STRING
## Oldest automake required for bootstrap is below in AM_INIT_AUTOMAKE.
## ------------------------ ##
## Autoconf initialisation. ##
## ------------------------ ##
AC_INIT([libtool], [1.5a], [bug-libtool@gnu.org])
AC_CONFIG_HEADERS([config.h:config-h.in])
AC_CONFIG_SRCDIR([ltmain.in])
* bootstrap: Rewritten to use autoreconf. * config.guess, config.sub, mkstamp: Moved from here... * config/config.guess, config/config.sub, config/mkstamp: ...to here, respectively. * libtool.m4, ltdl.m4: Moved from here... * m4/libtool.m4, m4/ltdl.m4: ...to here, respectively. * configure.ac: Removed various acinclude.m4 hackery, as these files are no longer needed with automake 1.8. * Makefile.am: Removed various acinclude.m4 hackery, as these files are no longer needed with automake 1.8. (AUTOMAKE_OPTIONS): Require CVS automake. (CONF_SUBDIRS, CFLAGS, CPPFLAGS, LDFLAGS, LIBS, FFLAGS, FLIBS): Automake now makes a Make variable from every AC_SUBST, so these are NOP. (aclocal_macros): These files are now in their own m4 subdir. Changed all clients. (EXTRA_DIST): mkstamp has moved to the new config subdir. Changed all clients. (pkgdata_SCRIPTS): Ditto wrt config.guess and config.sub. (pkgdata_DATA): Ditto wrt ltmain.sh. * f77demo/configure.ac, libltdl/configure.ac (AM_CONFIG_HEADER): Is deprecated in favour of AC_CONFIG_HEADERS. Updated to the latter. * Makefile.am, cdemo/Makefile.am, demo/Makefile.am, depdemo/Makefile.am, f77demo/Makefile.am, mdemo/Makefile.am, mdemo2/Makefile.am, pdemo/Makefile.am, tagdemo/Makefile.am (EXTRA_DIST): Remove acinclude.m4. (ACLOCAL_AMFLAGS): Search new `m4' macro directory. * configure.ac, cdemo/configure.ac, demo/configure.ac, depdemo/configure.ac, f77demo/configure.ac, mdemo/configure.ac, mdemo2/configure.ac, pdemo/configure.ac, tagdemo/configure.ac (AC_CONFIG_AUX_DIR): Declare that config helper scripts are now kept in the new config subdir. * libltdl/configure.ac (AC_CONFIG_AUX_DIR): Removed. Defaults to `.' anyway.
2003-09-25 19:22:29 +08:00
AC_CONFIG_AUX_DIR([config])
## ------------------------ ##
## Autotest initialisation. ##
## ------------------------ ##
dnl AC_CONFIG_TESTDIR([tests])
dnl AC_CONFIG_FILES([tests/atlocal])
Refactor all the test case common code into shell functions in tests/defs, and move the various demo directories out of $top_srcdir, and into tests too. The refactoring showed up a number of inconsistencies and latent bugs, as well as fixing (I think!!) the long-standing annoyance with some of the tests giving spurious failures intermittently. While I was here, emacs kindly removed a lot of bogus whitespace and added copyright notices for us: * cdemo, demo, depdemo, f77demo, mdemo, mdemo2, pdemo, tagdemo: Moved from here... * tests/cdemo, tests/demo, tests/depdemo, tests/f77demo, tests/mdemo, tests/mdemo2, tests/pdemo, tests/tagdemo: ...to here. * tests/defs: Factor much common functionality from the test scripts into shell functions. Added a copyright notice. * tests/assign.test, tests/cdemo-conf.test, tests/cdemo-exec.test, tests/cdemo-make.test, tests/cdemo-shared.test, tests/cdemo-static.test, tests/demo-conf.test, tests/demo-deplibs.test, tests/demo-exec.test, tests/demo-inst.test, tests/demo-make.test, tests/demo-nofast.test, tests/demo-nopic.test, tests/demo-pic.test, tests/demo-shared.test, tests/demo-static.test, tests/demo-unst.test, tests/depdemo-conf.test, tests/depdemo-exec.test, tests/depdemo-inst.test, tests/depdemo-make.test, tests/depdemo-nofast.test, tests/depdemo-shared.test, tests/depdemo-static.test, tests/depdemo-unst.test, tests/f77demo-conf.test, tests/f77demo-exec.test, tests/f77demo-make.test, tests/f77demo-shared.test, tests/f77demo-static.test, tests/link-2.test, tests/link.test, tests/mdemo-conf.test, tests/mdemo-exec.test, tests/mdemo-inst.test, tests/mdemo-make.test, tests/mdemo-shared.test, tests/mdemo-static.test, tests/mdemo-unst.test, tests/mdemo2-conf.test, tests/mdemo2-exec.test, tests/mdemo2-make.test, tests/nomode.test, tests/pdemo-conf.test, tests/pdemo-exec.test, tests/pdemo-inst.test, tests/pdemo-make.test, tests/pdemo-unst.test, tests/quote.test, tests/sh.test, tests/suffix.test, tests/tagdemo-conf.test, tests/tagdemo-exec.test, tests/tagdemo-make.test, tests/tagdemo-shared.test, tests/tagdemo-static.test: Refactored to use new functions in tests/defs. Added a copyright notice. * tests/hardcode.test, noinst-link.test, tests/relink.test, tests/relink.test, tests/mdryrun.test: Ditto. Moved from here... * tests/demo-hardcode.test, demo-noinst-link.test, tests/demo-relink.test, tests/depdemo-relink.test, tests/mdemo-dryrun.test: ...to here respectively. * Makefile.am: Added a copyright notice. * tests/sh.test: Check libtoolize.in for non-portabilities too. * libtoolize.in: Fix non-portabilities found by tests/sh.test.
2003-10-15 05:45:03 +08:00
## ---------------------------------------- ##
## Display a configure time version banner. ##
## ---------------------------------------- ##
# Calculating the previous version is somewhat involved, so do it once
# here, and SUBST the result for the maintainer release rules. The
# versioning scheme we use is described here:
# http://www.gnu.org/software/libtool/contribute.html
# First we break the version number up into its constituent parts.
LT_MAJOR=`echo "AC_PACKAGE_VERSION" | sed ['s,\..*$,,g']`
LT_MINOR=`echo "AC_PACKAGE_VERSION" | sed ['s,^[0-9]*\.\([0-9]*\).*$,\1,']`
LT_MICRO=`echo "AC_PACKAGE_VERSION" | sed ['s,^[0-9]*\.[0-9]*\(\.[0-9]*\).*$,\1,']`
LT_ALPHA=`echo "AC_PACKAGE_VERSION" | sed ['s,^[0-9.]*,,']`
test "$LT_MINOR" = "AC_PACKAGE_VERSION" && LT_MINOR=0
test "$LT_MICRO" = "AC_PACKAGE_VERSION" && LT_MICRO=""
# Then we try to work out what the release before this one would have been
# numbered. The only time we come unstuck is when this is the first release
# from a stable branch (LT_MICRO=LT_ALPHA=""), so OLDVERSION is the last
# release from the old stable branch, and we don't know what version that
# was, so leave it unset so that the Makefile can complain.
case $LT_ALPHA in
[[ab]])
case $LT_MICRO in
[.[01]])
LASTRELEASE="$LT_MAJOR.$LT_MINOR" ;;
*)
LASTRELEASE="$LT_MAJOR.$LT_MINOR$LT_MICRO" ;;
esac
;;
[[cegikmoqsuwy]])
LASTRELEASE=`echo "AC_PACKAGE_VERSION" | tr 'c-y' 'b-w'` ;;
[[dfhjlnprtvxz]])
LASTRELEASE=`echo "AC_PACKAGE_VERSION" | tr 'd-z' 'b-x'` ;;
*) # No LT_ALPHA component
case $LT_MICRO in
.0)
LASTRELEASE="" ;;
.1)
LASTRELEASE="$LT_MAJOR.$LT_MINOR" ;;
.*)
lt_micro_value=`echo $LT_MICRO | sed 's,^\.,,'`
LASTRELEASE="$LT_MAJOR.$LT_MINOR.`expr $lt_micro_value - 1`" ;;
*)
LASTRELEASE="" ;;
esac
;;
esac
AC_SUBST([LASTRELEASE])
# This is a sanity check so we can see which version is used in bug reports.
# It is assumed that we only want to see the date extension for cvs libtool
# versions (i.e. "odd" letters) and not actual alpha releases.
TIMESTAMP=
case $LT_ALPHA in
[[acegikmoqsuwy]])
* bootstrap: Rewritten to use autoreconf. * config.guess, config.sub, mkstamp: Moved from here... * config/config.guess, config/config.sub, config/mkstamp: ...to here, respectively. * libtool.m4, ltdl.m4: Moved from here... * m4/libtool.m4, m4/ltdl.m4: ...to here, respectively. * configure.ac: Removed various acinclude.m4 hackery, as these files are no longer needed with automake 1.8. * Makefile.am: Removed various acinclude.m4 hackery, as these files are no longer needed with automake 1.8. (AUTOMAKE_OPTIONS): Require CVS automake. (CONF_SUBDIRS, CFLAGS, CPPFLAGS, LDFLAGS, LIBS, FFLAGS, FLIBS): Automake now makes a Make variable from every AC_SUBST, so these are NOP. (aclocal_macros): These files are now in their own m4 subdir. Changed all clients. (EXTRA_DIST): mkstamp has moved to the new config subdir. Changed all clients. (pkgdata_SCRIPTS): Ditto wrt config.guess and config.sub. (pkgdata_DATA): Ditto wrt ltmain.sh. * f77demo/configure.ac, libltdl/configure.ac (AM_CONFIG_HEADER): Is deprecated in favour of AC_CONFIG_HEADERS. Updated to the latter. * Makefile.am, cdemo/Makefile.am, demo/Makefile.am, depdemo/Makefile.am, f77demo/Makefile.am, mdemo/Makefile.am, mdemo2/Makefile.am, pdemo/Makefile.am, tagdemo/Makefile.am (EXTRA_DIST): Remove acinclude.m4. (ACLOCAL_AMFLAGS): Search new `m4' macro directory. * configure.ac, cdemo/configure.ac, demo/configure.ac, depdemo/configure.ac, f77demo/configure.ac, mdemo/configure.ac, mdemo2/configure.ac, pdemo/configure.ac, tagdemo/configure.ac (AC_CONFIG_AUX_DIR): Declare that config helper scripts are now kept in the new config subdir. * libltdl/configure.ac (AC_CONFIG_AUX_DIR): Removed. Defaults to `.' anyway.
2003-09-25 19:22:29 +08:00
TIMESTAMP=`${CONFIG_SHELL} ${ac_aux_dir}/mkstamp < ${srcdir}/ChangeLog`
AS_BOX([Configuring AC_PACKAGE_TARNAME (Build:$TIMESTAMP) AC_PACKAGE_VERSION])
echo
;;
esac
AC_SUBST([TIMESTAMP])
## ------------------------ ##
## Automake Initialisation. ##
## ------------------------ ##
dnl These are bootstrap requirements, once built, libtool may work with
dnl much older releases of autoconf and automake. See release notes.
AM_INIT_AUTOMAKE([1.7 gnits])
## ------------------------------- ##
## Libtool specific configuration. ##
## ------------------------------- ##
pkgdatadir='${datadir}'"/${PACKAGE}"
AC_SUBST([pkgdatadir]) # automake does not need this, but libtoolize does
1997-04-02 02:29:23 +08:00
aclocaldir='${datadir}/aclocal'
AC_SUBST([aclocaldir])
AC_ARG_ENABLE(ltdl-install,
[AS_HELP_STRING([--disable-ltdl-install], [do not install libltdl])])
if test x"${enable_ltdl_install+set}" != xset; then
enable_ltdl_install=yes
fi
# All subdirectories that are configured on demand, but that must be
# included in the distribution. This substitution is for tests/Makefile.am,
# so the directory names are relative to that directory.
CONF_SUBDIRS="cdemo demo depdemo f77demo mdemo mdemo2 pdemo tagdemo"
AC_SUBST([CONF_SUBDIRS])
DIST_MAKEFILE_LIST=
for dir in $CONF_SUBDIRS; do
DIST_MAKEFILE_LIST="${DIST_MAKEFILE_LIST}tests/$dir/Makefile "
done
AC_SUBST([DIST_MAKEFILE_LIST])
## ---------------- ##
## compiler checks. ##
## ---------------- ##
1997-04-02 02:29:23 +08:00
# Use the specified CC and LD
1997-04-02 03:21:43 +08:00
AC_PROG_CC
* NEWS: Updated. * THANKS: Added Rob Collins and Chuck Wilson for their cygwin work. From Robert Collins <robert.collins@itdomain.com.au>: * configure.ac (AC_EXEEXT): Needed for DOSish systems. * libtool.m4 (shlibpath_overrides_runpath) [cygwin]: Set to yes when compiling with gcc. (lt_prog_compiler_pic) [cygwin]: No longer needs the -DDLL_EXPORT hack, so we just say the pic is the default. (AC_LIBTOOL_PROG_LD_SHLIBS) [cygwin]: Extract symbols from a library normally. [cygwin]: Declare C++ compiler characterisics for g++, taking into account the new auto-import support in cygwin ld. * ltmain.in (specialdeplibs) [cygwin]: Be careful about eliminating duplicate -lgcc's from the link line. [cygwin]: Be smarter about .exe suffixes. * demo/configure.ac (AC_EXEEXT, AC_LIBTOOL_WIN32_DLL): Support DOSish systems properly. * depdemo/configure.ac (AC_EXEEXT, AC_LIBTOOL_WIN32_DLL): Ditto. * demo/Makefile.am (deplibs-check): Allow for .exe suffix. Use hell_static instead of hell.static for multi-`.' inhibited OSes. * tests/demo-exec.test: Ditto. * tests/demo-inst.test: Ditto. * demo/foo.h [cygwin]: Sanitize cygwin dll support. * demo/foo.c (_LIBFOO_COMPILATION_): No longer required. * demo/hello.c (_LIBFOO_COMPILATION_): Ditto. * depdemo/Makefile.am (bin_PROGRAMS): Use depdemo_static instead of depdemo.static for multi-`.' inhibited OSes. * tests/depdemo-exec.test: Ditto. * tests/depdemo-inst.test: Ditto. * mdemo/Makefile.am (bin_PROGRAMS): Ditto for mdemo.static. * tests/dryrun.test: Ditto. * tests/mdemo-exec.test: Ditto. * tests/mdemo-inst.test: Ditto. * tests/build-relink.test: Be careful about possible .exe suffixes. * tests/noinst-link.test: Allow for .exe suffix.
2002-03-03 11:19:55 +08:00
AC_EXEEXT
AC_PROG_LD
AC_PROG_NM
1997-07-01 12:38:32 +08:00
AC_PROG_LN_S
1997-04-02 03:21:43 +08:00
pushdef([AC_MSG_ERROR], [CXX=no])
AC_PROG_CXX
popdef([AC_MSG_ERROR])
AM_CONDITIONAL(HAVE_CXX, [test "x$CXX" != xno])
pushdef([AC_MSG_ERROR], [F77=no])
AC_PROG_F77
popdef([AC_MSG_ERROR])
if test -z "$F77"; then
F77="no"
fi
AM_CONDITIONAL(HAVE_F77, [test "x$F77" != xno])
LT_AC_PROG_GCJ
AM_CONDITIONAL(HAVE_GCJ, [test "x$GCJ" != xno])
LT_AC_PROG_RC
AM_CONDITIONAL(HAVE_RC, [test "x$RC" != xno])
## ----------------------- ##
## Libtool initialisation. ##
## ----------------------- ##
2003-10-21 23:03:57 +08:00
AC_CONFIG_FILES([config/ltmain.sh:./ltmain.in])
AC_LIBTOOL_DLOPEN
AC_LIBTOOL_WIN32_DLL
AC_PROG_LIBTOOL
AC_LIB_LTDL
## -------- ##
## Outputs. ##
## -------- ##
AC_CONFIG_FILES([Makefile libltdl/Makefile doc/Makefile tests/Makefile])
AC_OUTPUT