libtool/configure.ac

200 lines
6.4 KiB
Plaintext
Raw Normal View History

## Process this file with autoconf to create configure. -*- autoconf -*-
# Copyright (C) 2001, 2004 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 LASTRELEASE 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.
This fixes release procedure problems discovered whilst making the 1.5.2 release. * Makefile.am (cvs-dist): Because we check whether ChangeLog has been committed, this rule can't be run with uncommitted source so we can't run 'commit' and don't need to run 'make dist' a second time. Fix CVS tag as it should be "release-X" not "Release-X". (cvs_commit): New rule for the cvs-release chain that runs 'commit' (cvs-release): Depend on cvs-commit, depend on deltas instead of cvs-diff and xdelta. (cvs-diff): Removed, replaced with delta-diff. (delta-diff): Unpack and diff the old and new tarballs rather than using CVS, so we get a genuinely complete diff. (xdelta): Removed, replaced with delta-xdelta. (got-xdelta): New rule for improved reading. (delta-xdiff): Copied and cleaned up version of old xdelta rule. (deltas): Depends on delta-diff and delta-xdelta (make deltas). (cvs-news): Don't depend on timestamps, cvs-dist itself does now. (prev-tarball): This is the only place we need a LASTRELEASE check so copy the code here and remove the CHECK_RELEASE variable. (new-tarball): Check there's a new tarball (did cvs-dist work?) (FETCHFILES): Remove obsolete libltdl mentions. * README-alpha: Update CVS instructions as everything's changed on Savannah. (Release procedure): Update NEWS and ChangeLog after changing the version number (both times); Run 'make fetch' after running 'configure' (difficult to do it beforehand); Require 'commit' before 'make cvs-dist' as that checks ChangeLog is committed; 'make deltas' instead of 'cvs-diff' and 'xdelta', pass LASTRELEASE to make instead of OLDVERSION (and it's mandatory); Clean up uploading paragraph; Clearer announcement sending instruction; Removed ftp-upload@gnu.org mail as that's not necessary now; Make web page updating instructions a bit clearer; Add an instruction to update the manual for non-alphas. (Alpha release note template): Add a Subject; update CVS instructions. (Full release note template): Add a Subject; update CVS instructions. * configure.ac: Add dist-bzip2 to AM_INIT_AUTOMAKE as we talk about bz2 files in our release announcements; remove old reference to OLDVERSION.
2004-01-27 20:38:47 +08:00
AM_INIT_AUTOMAKE([1.8 gnits dist-bzip2]) ## We use auto-m4_including
dnl Make sure config.status is regenerated when the version timestamp changes
AC_SUBST([CONFIG_STATUS_DEPENDENCIES], ['$(top_builddir)/stamp-vcl'])
## ------------------------------- ##
## 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
# Other languages get automatically inferred by the all-lang option passed
# to LT_INIT below, however the Autoconf tests for C++ and Fortran 77
# sometimes call AC_MSG_ERROR and we don't want that to be an error while
# creating the libtool script, as these macros are AC_REQUIREd we can simply
# call them here and catch the errors.
pushdef([AC_MSG_ERROR], [caught_CXX_error=yes])
AC_PROG_CXX
AC_PROG_CXXCPP
popdef([AC_MSG_ERROR])
pushdef([AC_MSG_ERROR], [caught_F77_error=yes])
AC_PROG_F77
popdef([AC_MSG_ERROR])
## ----------------------- ##
## Libtool initialisation. ##
## ----------------------- ##
2003-10-21 23:03:57 +08:00
AC_CONFIG_FILES([config/ltmain.sh:./ltmain.in])
AC_CONFIG_FILES([libtoolize], [chmod a+x libtoolize])
Further sweeping changes to the user interface to libtool from `configure.ac' to allow users to better control the list of supported languages. Three LT_INIT options 'no-lang', 'all-lang' and 'auto-lang' (the default) control the initial list and others may be added with LT_LANG. * m4/libtool.m4 (_LT_CONFIG): Renamed AC_LIBTOOL_CONFIG to _LT_CONFIG which is more consistent with our own namespace and gets us further out of Autoconf's. (_LT_LIBTOOL_TAGS): Output available_tags variable based entirely on the value of _LT_TAGS. (_LT_COPYING): Call _LT_LIBTOOL_TAGS to output available tags, always append tag configuration if the tag is available. (LT_LANG): New macro to enable support for a language that accepts tag names (eg. "CXX") or human language names (eg. "C++"). (_LT_LANG): Internal support macro for above that appends the tag to _LT_TAGS and calls the appropriate config macro. (LT_INIT): Ensure that LT_LANG is not called before LT_INIT. (AC_LIBTOOL_TAGS): Removed, call LT_LANG for each language now. (_LT_AC_TAG_CHECK): Removed, _LT_LANG handles duplicate calls. (_LT_LANG_DEFAULT_CONFIG): Macro to set initial language support based on options passed to LT_INIT. (_LT_SETUP): Call _LT_LANG_DEFAULT_CONFIG. (_LT_AC_TAG_CONFIG): Removed, handled by _LT_LANG_DEFAULT_CONFIG. (_LT_AC_LANG_CXX, _LT_AC_LANG_F77, _LT_AC_LANG_GCJ): Removed, automatic language support inclusion now handled by _LT_LANG_DEFAULT_CONFIG. (AC_LIBTOOL_CXX): Obsolete macro, update to LT_LANG(C++). (AC_LIBTOOL_F77): Obsolete macro, update to LT_LANG(Fortran 77). (AC_LIBTOOL_GCJ): Obsolete macro, update to LT_LANG(Java). (AC_LIBTOOL_LANG_C_CONFIG_: Removed. (_LT_AC_LANG_C_CONFIG): Renamed to _LT_LANG_C_CONFIG, call _LT_CONFIG instead of AC_LIBTOOL_CONFIG. (_LT_SETUP): Replace call to AC_LIBTOOL_LANG_C_CONFIG with call to new _LT_LANG_C_CONFIG macro. (AC_LIBTOOL_LANG_CXX_CONFIG): Removed. (_LT_AC_LANG_CXX_CONFIG): Renamed to _LT_LANG_CXX_CONFIG, call _LT_CONFIG instead of AC_LIBTOOL_CONFIG. (AC_LIBTOOL_LANG_F77_CONFIG): Removed. (_LT_AC_LANG_F77_CONFIG): Renamed to _LT_LANG_F77_CONFIG, call _LT_CONFIG instead of AC_LIBTOOL_CONFIG. (AC_LIBTOOL_LANG_GCJ_CONFIG): Removed. (_LT_AC_LANG_GCJ_CONFIG): Renamed to _LT_LANG_GCJ_CONFIG, call _LT_CONFIG instead of AC_LIBTOOL_CONFIG. (AC_LIBTOOL_LANG_RC_CONFIG): Removed. (_LT_AC_LANG_RC_CONFIG): Renamed to _LT_LANG_RC_CONFIG, call _LT_CONFIG instead of AC_LIBTOOL_CONFIG. (LT_AC_PROG_GCJ): Renamed to LT_PROG_GCJ. (LT_AC_PROG_RC): Renamed to LT_PROG_RC. * m4/ltoptions.m4: Define new 'no-lang', 'auto-lang' and 'all-lang' options which set the default for _LT_LANG_DEFAULT_CONFIG. * m4/lt~obsolete.m4: Removed AC_LIBTOOL_CONFIG, _LT_AC_LANG_C_CONFIG, _LT_AC_LANG_GCJ_CONFIG, _LT_AC_LANG_RC_CONFIG; all of which are no long referenced in any way. * configure.ac: Enable all languages. * tests/cdemo/configure.ac, tests/demo/configure,ac, tests/depdemo/configure.ac, tests/f77demo/configure.ac, tests/mdemo/configure.ac, tests/pdemo/configure,ac, tests/tagdemo/configure.ac: Remove calls to AC_LIBTOOL_TAGS, the default 'auto-lang' mode now does the right thing. * doc/libtool.texi (The LT_INIT macro): Add documentation for new LT_INIT options and the LT_LANG macro, replacing the old documentation of AC_LIBTOOL_TAGS which is no more. * NEWS: Updated.
2004-03-22 00:05:28 +08:00
LT_INIT([dlopen win32-dll all-lang])
AC_LIB_LTDL
## --------------------------- ##
## Work out which tests to run ##
## --------------------------- ##
AM_CONDITIONAL(HAVE_CXX,
[test "X$caught_CXX_error" != "Xyes" &&
test -n "[$]_LT_AC_TAGVAR(compiler, CXX)"])
AM_CONDITIONAL(HAVE_F77,
[test "X$caught_F77_error" != "Xyes" &&
test -n "[$]_LT_AC_TAGVAR(compiler, F77)"])
AM_CONDITIONAL(HAVE_GCJ, [test -n "[$]_LT_AC_TAGVAR(compiler, GCJ)"])
AM_CONDITIONAL(HAVE_RC, [test -n "[$]_LT_AC_TAGVAR(compiler, RC)"])
## -------- ##
## Outputs. ##
## -------- ##
AC_CONFIG_FILES([Makefile libltdl/Makefile doc/Makefile tests/Makefile])
AC_OUTPUT