X-Git-Url: http://git.sourceforge.jp/view?a=blobdiff_plain;f=libmudflap%2Fconfigure.ac;h=a22be278d32c8b1193bbf4067a45585191428158;hb=71229c285b11fd4024e7eaa1eb710abfd7989e2b;hp=ab294cd63bf3d8b4b1e25d149c01932232c45be5;hpb=685e82eedcf00861523dec8b86a6230432fc23ae;p=pf3gnuchains%2Fgcc-fork.git diff --git a/libmudflap/configure.ac b/libmudflap/configure.ac index ab294cd63bf..a22be278d32 100644 --- a/libmudflap/configure.ac +++ b/libmudflap/configure.ac @@ -1,17 +1,14 @@ # Process this file with autoconf to produce a configure script, like so: -# aclocal && autoconf && autoheader && automake +# aclocal -I .. -I ../config && autoconf && autoheader && automake AC_PREREQ(2.59) AC_INIT(libmudflap, 1.0) AC_CONFIG_SRCDIR(mf-runtime.c) AC_CANONICAL_SYSTEM +ACX_NONCANONICAL_TARGET 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 ], @@ -28,7 +25,7 @@ AC_EXEEXT AM_ENABLE_MULTILIB(, ..) -target_alias=${target_alias-$target} +target_alias=${target_alias-$host_alias} AC_SUBST(target_alias) AC_CONFIG_HEADERS(config.h) @@ -63,18 +60,22 @@ AC_TRY_COMPILE([ [AC_MSG_RESULT(no) enable_shared=no]) -AC_CHECK_HEADERS(stdint.h execinfo.h signal.h dlfcn.h dirent.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) +AC_CHECK_HEADERS(stdint.h execinfo.h signal.h dlfcn.h dirent.h pwd.h grp.h \ + netdb.h sys/ipc.h sys/sem.h sys/shm.h sys/wait.h ctype.h mntent.h \ + sys/socket.h netinet/in.h arpa/inet.h dlfcn.h sys/mman.h) -dnl Check for nonstandard functions +AC_CHECK_FUNCS(backtrace backtrace_symbols gettimeofday signal) +AC_CHECK_FUNCS(fopen64 fseeko64 ftello64 stat64 freopen64) +AC_CHECK_FUNCS(setbuf setbuffer setlinebuf setvbuf) 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_CHECK_FUNCS(getlogin cuserid getpwnam getpwuid getpwent getgrnam getgrgid getgrent) +AC_CHECK_FUNCS(getlogin_r getpwnam_r getpwuid_r getgrnam_r getgrgid_r) +AC_CHECK_FUNCS(getservent getservbyname getservbyport getaddrinfo gai_strerror) +AC_CHECK_FUNCS(getprotoent getprotobyname getprotobynumber) +AC_CHECK_FUNCS(getmntent setmntent addmntent) +AC_CHECK_FUNCS(inet_ntoa mmap munmap) +AC_CHECK_FUNCS(__libc_freeres) AC_TRY_COMPILE([#include #include @@ -115,15 +116,28 @@ then mkdir pth fi -pthread_create_version='""' -AC_CHECK_HEADER(pthread.h,[ -AC_DEFINE_UNQUOTED(HAVE_PTHREAD_H, 1, [define if you have ]) -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" +AC_CHECK_HEADERS(pthread.h) + +AC_MSG_CHECKING([for thread model used by GCC]) +target_thread_file=`$CC -v 2>&1 | sed -n 's/^Thread model: //p'` +AC_MSG_RESULT([$target_thread_file]) + +# We only support posix threads, or no threads at all. +posix_threads= +case ${target_thread_file} in + posix) + posix_threads=yes + ;; + single) + ;; + *) + echo "${target_thread_file} is an unsupported thread package" 1>&2 + exit 1 + ;; +esac + +AM_CONDITIONAL(LIBMUDFLAPTH, [test "x$posix_threads" != "x"]) +if test "x$posix_threads" != "x" then build_libmudflapth=1 else @@ -133,12 +147,6 @@ 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 @@ -147,7 +155,7 @@ case ${version_specific_libs} in # and header files if --enable-version-specific-runtime-libs option # is selected. toolexecdir='$(libdir)/gcc/$(target_alias)' - toolexeclibdir='$(toolexecdir)/'${gcc_version}'$(MULTISUBDIR)' + toolexeclibdir='$(toolexecdir)/$(gcc_version)$(MULTISUBDIR)' ;; no) if test -n "$with_cross_host" && @@ -169,7 +177,11 @@ esac AC_SUBST(toolexecdir) AC_SUBST(toolexeclibdir) -if test "x$enable_shared" = "xyes" && test "x$ac_have_pthread_h" != "x"; then +includedir=${toolexecdir}/include +AC_SUBST(includedir) + +pthread_create_version='""' +if test "x$enable_shared" = "xyes" && test "x$posix_threads" != "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. @@ -230,11 +242,29 @@ AC_MSG_RESULT($ac_fdsections) AC_SUBST(SECTION_FLAGS) +# Check for the name of the symbol used for the entry point. +AC_CACHE_CHECK([for the name of the symbol used for the entry point], + [mudflap_cv_entry_point], [ +for name in _start __start unknown; do + AC_LINK_IFELSE([AC_LANG_PROGRAM([extern char $name@<:@@:>@;], [$name@<:@0@:>@ = 0;])], + [break]) +done +mudflap_cv_entry_point="$name"]) +if test "$mudflap_cv_entry_point" = unknown; then + AC_MSG_ERROR([none of the known symbol names works]) +fi +AC_DEFINE_UNQUOTED([ENTRY_POINT], [$mudflap_cv_entry_point], + [Define to the name of the symbol used for the entry point.]) + + 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]) +# See if we support thread-local storage. +GCC_CHECK_TLS + +AC_CONFIG_FILES([Makefile testsuite/Makefile testsuite/mfconfig.exp]) AC_OUTPUT