diff options
author | Paolo Bonzini <bonzini@gcc.gnu.org> | 2004-06-15 14:47:55 +0000 |
---|---|---|
committer | Paolo Bonzini <bonzini@gcc.gnu.org> | 2004-06-15 14:47:55 +0000 |
commit | 076e544330cef5b05f16bc351b9d87ea6a931b95 (patch) | |
tree | 90a4bda9945bf02622559eb76c352f54cafe8627 /libmudflap/configure.ac | |
parent | 659e82ad0fff564050e3363172ef52a9a948a27f (diff) | |
download | gcc-076e544330cef5b05f16bc351b9d87ea6a931b95.zip gcc-076e544330cef5b05f16bc351b9d87ea6a931b95.tar.gz gcc-076e544330cef5b05f16bc351b9d87ea6a931b95.tar.bz2 |
configure.ac: New name of configure.in.
libmudflap/ChangeLog:
2005-06-15 Paolo Bonzini <bonzini@gnu.org>
* configure.ac: New name of configure.in. Update
AC_INIT, AC_CONFIG_SRCDIR, AC_CONFIG_HEADERS, AC_CONFIG_FILES,
AC_OUTPUT, AM_INIT_AUTOMAKE to the preferred style for
Autoconf 2.5x and Automake 1.7 or later.
* configure.in: Remove.
* configure: Regenerate.
* Makefile.am: Remove useless multilib rules.
* Makefile.in: Regenerate.
libstdc++-v3/ChangeLog:
2005-06-15 Paolo Bonzini <bonzini@gnu.org>
* acinclude.m4: Remove useless multilib configury.
* Makefile.am: Remove useless multilib rules.
* aclocal.m4: Regenerate.
* Makefile.in: Regenerate.
* configure.ac: Use AM_ENABLE_MULTILIB.
* configure: Regenerate.
zlib/ChangeLog.gcj:
2005-06-15 Paolo Bonzini <bonzini@gnu.org>
* Makefile.am: Remove useless multilib rules.
* configure.ac: Rewrite multilib support to use
features of recent automakes.
* aclocal.m4: Regenerate with Automake 1.8.5.
* Makefile.in: Regenerate with Automake 1.8.5.
* configure: Regenerate.
libffi/ChangeLog:
2005-06-15 Paolo Bonzini <bonzini@gnu.org>
* Makefile.am: Remove useless multilib rules.
* Makefile.in: Regenerate.
* aclocal.m4: Regenerate with automake 1.8.5.
* configure.ac: Remove useless multilib configury.
* configure: Regenerate.
From-SVN: r83184
Diffstat (limited to 'libmudflap/configure.ac')
-rw-r--r-- | libmudflap/configure.ac | 240 |
1 files changed, 240 insertions, 0 deletions
diff --git a/libmudflap/configure.ac b/libmudflap/configure.ac new file mode 100644 index 0000000..3e33db6 --- /dev/null +++ b/libmudflap/configure.ac @@ -0,0 +1,240 @@ +# Process this file with autoconf to produce a configure script, like so: +# aclocal && autoconf && autoheader && automake + +AC_PREREQ(2.59) +AC_INIT(libmudflap, 1.0) +AC_CONFIG_SRCDIR(mf-runtime.c) +AC_CANONICAL_SYSTEM + +AM_INIT_AUTOMAKE + +# For libtool versioning info, format is CURRENT:REVISION:AGE +libtool_VERSION=1:0:0 +AC_SUBST(libtool_VERSION) + +AC_MSG_CHECKING([for --enable-version-specific-runtime-libs]) +AC_ARG_ENABLE(version-specific-runtime-libs, +[ --enable-version-specific-runtime-libs Specify that runtime libraries should be installed in a compiler-specific directory ], +[case "$enableval" in + yes) version_specific_libs=yes ;; + no) version_specific_libs=no ;; + *) AC_MSG_ERROR([Unknown argument to enable/disable version-specific libs]);; + esac], +[version_specific_libs=no]) +AC_MSG_RESULT($version_specific_libs) + +AM_MAINTAINER_MODE +AC_EXEEXT + +AM_ENABLE_MULTILIB(, ..) + +target_alias=${target_alias-$target} +AC_SUBST(target_alias) + +AC_CONFIG_HEADERS(config.h) + +AC_LANG_C +# The same as in boehm-gc and libstdc++. Have to borrow it from there. +# We must force CC to /not/ be precious variables; otherwise +# the wrong, non-multilib-adjusted value will be used in multilibs. +# As a side effect, we have to subst CFLAGS ourselves. + +m4_rename([_AC_ARG_VAR_PRECIOUS],[real_PRECIOUS]) +m4_define([_AC_ARG_VAR_PRECIOUS],[]) +AC_PROG_CC +m4_rename([real_PRECIOUS],[_AC_ARG_VAR_PRECIOUS]) + +AC_SUBST(CFLAGS) + +if test "x$GCC" != "xyes"; then + AC_MSG_ERROR([libmudflap must be built with GCC]) +fi +AC_PROG_CPP + +# Some hosts don't have dlsym(RTLD_NEXT, "symbol") for use in +# symbol interposition. We disable shared libraries for these. +AC_MSG_CHECKING([whether dlsym(RTLD_NEXT,...) is available]) +AC_TRY_COMPILE([ +#define _GNU_SOURCE +#include <dlfcn.h> +], +[void *foo = dlsym (RTLD_NEXT, "exit");], +[AC_MSG_RESULT(yes)], +[AC_MSG_RESULT(no) +enable_shared=no]) + +AC_CHECK_HEADERS(stdint.h execinfo.h signal.h dlfcn.h \ + netdb.h sys/ipc.h sys/sem.h sys/shm.h sys/wait.h sys/socket.h ctype.h) +AC_CHECK_FUNCS(backtrace backtrace_symbols gettimeofday signal) + +dnl Check for 64-bit stdio calls related to Large File Support +AC_CHECK_FUNCS(fopen64 fseeko64 ftello64 stat64) + +dnl Check for nonstandard functions +AC_CHECK_FUNCS(strnlen memrchr strncpy memmem sethostname) + +dnl Check for glibc ctype functions +AC_CHECK_FUNCS(__ctype_b_loc __ctype_tolower_loc __ctype_toupper_loc) + +AC_TRY_COMPILE([#include <sys/types.h> +#include <sys/ipc.h> +#include <sys/sem.h>],[union semun foo;], [mf_have_semun=1], [mf_have_semun=0]) +if test $mf_have_semun = 1 +then + AC_DEFINE(HAVE_UNION_SEMUN, 1, [union semun defined in sys/ipc.h or sys/sem.h]) +fi + + +AC_MSG_CHECKING([for socklen_t in sys/socket.h]) +AC_TRY_COMPILE([#define _POSIX_PII_SOCKET +#include <sys/types.h> +#include <sys/socket.h>], [socklen_t x = 5;], + [AC_DEFINE(HAVE_SOCKLEN_T, 1, [Define it socklen_t typedef is in sys/socket.h.]) + AC_MSG_RESULT(yes)], + [AC_MSG_RESULT(no)]) + +AC_LIBTOOL_DLOPEN +AM_PROG_LIBTOOL +AC_SUBST(enable_shared) +AC_SUBST(enable_static) + +AC_CHECK_HEADER(stdint.h, [MF_HAVE_STDINT_H=1], [MF_HAVE_STDINT_H=0]) +AC_SUBST(MF_HAVE_STDINT_H) +if test $MF_HAVE_STDINT_H = 1 +then + MF_HAVE_UINTPTR_T=1 +else + AC_TRY_COMPILE([#include <sys/types.h>], [uintptr_t k = 0;], + [MF_HAVE_UINTPTR_T=1], [MF_HAVE_UINTPTR_T=0]) +fi +AC_SUBST(MF_HAVE_UINTPTR_T) + +if test ! -d pth +then + # libmudflapth objects are built in this subdirectory + mkdir pth +fi + +pthread_create_version='""' +AC_CHECK_HEADER(pthread.h,[ +AC_DEFINE_UNQUOTED(HAVE_PTHREAD_H, 1, [define if you have <pthread.h>]) +ac_have_pthread_h=yes +],[ +ac_have_pthread_h= +]) +AM_CONDITIONAL(LIBMUDFLAPTH, [test "x$ac_have_pthread_h" != "x"]) +if test "x$ac_have_pthread_h" != "x" +then + build_libmudflapth=1 +else + build_libmudflapth=0 +fi +AC_SUBST(build_libmudflapth) + +AC_CHECK_LIB(dl, dlsym) + +# Process the option "--enable-version-specific-runtime-libs" +gcc_version_trigger=${srcdir}/../gcc/version.c +gcc_version_full=`grep version_string ${gcc_version_trigger} | sed -e 's/.*\"\([[^ \"]]*\)[[ \"]].*/\1/'` +gcc_version=`echo ${gcc_version_full} | sed -e 's/\([^ ]*\) .*/\1/'` +AC_SUBST(gcc_version) + +# Calculate toolexeclibdir +# Also toolexecdir, though it's only used in toolexeclibdir +case ${version_specific_libs} in + yes) + # Need the gcc compiler version to know where to install libraries + # and header files if --enable-version-specific-runtime-libs option + # is selected. + toolexecdir='$(libdir)/gcc/$(target_alias)' + toolexeclibdir='$(toolexecdir)/'${gcc_version}'$(MULTISUBDIR)' + ;; + no) + if test -n "$with_cross_host" && + test x"$with_cross_host" != x"no"; then + # Install a library built with a cross compiler in tooldir, not libdir. + toolexecdir='$(exec_prefix)/$(target_alias)' + toolexeclibdir='$(toolexecdir)/lib' + else + toolexecdir='$(libdir)/gcc-lib/$(target_alias)' + toolexeclibdir='$(libdir)' + fi + multi_os_directory=`$CC -print-multi-os-directory` + case $multi_os_directory in + .) ;; # Avoid trailing /. + *) toolexeclibdir=$toolexeclibdir/$multi_os_directory ;; + esac + ;; +esac +AC_SUBST(toolexecdir) +AC_SUBST(toolexeclibdir) + +if test "x$enable_shared" = "xyes" && test "x$ac_have_pthread_h" != "x"; then + # NB: don't check for -lpthread here, because then it would be + # added to LIBS. For the thread-unaware libmudflap.la, we don't + # want it there. + + # glibc-related hacks. dlsym() may pick the wrong version of + # interposed functions like pthread_create on modern glibc. + # We need to find the proper symbol version string, and use + # the nonstandard dlvsym(). + AC_CHECK_FUNCS(dlvsym) + AC_CHECK_TOOL(NM, nm) + if test "x$ac_cv_have_dlvsym" != "x"; then + # Try compiling a simple pthreads program. Find the shared libraries it + # ends up with. Then use "nm" on those libraries to extract the + # default symbol versioning suffix ("@@"), if any. But that's tricky. + # Rather, run nm on the resulting executable. Unfortunately, autoconf + # doesn't appear to have a macro that builds a test executable for + # subsequent analysis ... so we do it by hand here. + cat >> conftest.c << EOF +#include <pthread.h> +int main () { void *p = (void *) & pthread_create; return (int) p; } +EOF + oldLIBS="$LIBS" + LIBS="$LIBS -lpthread" + pthread_create_version="\"\"" + AC_MSG_CHECKING(pthread_create symbol version) + if eval $ac_link 2>&5 && test -s conftest${ac_exeext}; then + version=`$NM conftest${ac_exeect} | grep 'pthread_create@@' | sed -e 's/^.*@@//'` + if test "x$version" != "x"; then + pthread_create_version="\"$version\"" + fi + fi + AC_MSG_RESULT($pthread_create_version) + LIBS="$oldLIBS" + fi +fi +AC_DEFINE_UNQUOTED(PTHREAD_CREATE_VERSION, $pthread_create_version, [pthread_create symbol version]) + + +# Figure out whether the compiler supports "-ffunction-sections -fdata-sections", +# similarly to how libstdc++ does it +ac_test_CFLAGS="${CFLAGS+set}" +ac_save_CFLAGS="$CFLAGS" + +# Check for -ffunction-sections -fdata-sections +AC_MSG_CHECKING([for gcc that supports -ffunction-sections -fdata-sections]) +CFLAGS='-Werror -ffunction-sections -fdata-sections' +AC_TRY_COMPILE(, [int foo;], [ac_fdsections=yes], [ac_fdsections=no]) +if test "$ac_test_CFLAGS" = set; then + CFLAGS="$ac_save_CFLAGS" +else + # this is the suspicious part + CFLAGS="" +fi +if test x"$ac_fdsections" = x"yes"; then + SECTION_FLAGS='-ffunction-sections -fdata-sections' +fi +AC_MSG_RESULT($ac_fdsections) +AC_SUBST(SECTION_FLAGS) + + +if test ${multilib} = yes; then + multilib_arg="--enable-multilib" +else + multilib_arg= +fi + +AC_CONFIG_FILES([Makefile testsuite/Makefile testsuite/mfconfig.exp mf-runtime.h]) +AC_OUTPUT |