X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=libiberty%2Fconfigure;h=7bde9b38f19e3ddf13ad78f1964be3ac8c6b8f5b;hb=db434ba03edb5491d48415069d6116b5037e6fa1;hp=7ff7792440e50a504c765498e77eac9bc8bd69a9;hpb=9711ae4d9fb353051cbce8d4f72ce25bdf988f74;p=deliverable%2Fbinutils-gdb.git diff --git a/libiberty/configure b/libiberty/configure index 7ff7792440..7bde9b38f1 100755 --- a/libiberty/configure +++ b/libiberty/configure @@ -675,8 +675,8 @@ with_cross_host with_newlib enable_maintainer_mode enable_multilib -enable_largefile enable_install_libiberty +enable_largefile ' ac_precious_vars='build_alias host_alias @@ -1303,8 +1303,8 @@ Optional Features: enable make rules and dependencies not useful (and sometimes confusing) to the casual installer --enable-multilib build many library versions (default) + --enable-install-libiberty Install headers and library for end users --disable-largefile omit support for large files - --enable-install-libiberty Install headers for end users Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] @@ -1844,41 +1844,41 @@ else fi cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ +/* Define $2 to an innocuous variant, in case declares $2. + For example, HP-UX 11i declares gettimeofday. */ +#define $2 innocuous_$2 + /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $2 (); below. Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. Under hpux, - including includes and causes problems - checking for functions defined therein. */ -#if defined (__STDC__) && !defined (_HPUX_SOURCE) + exists even on freestanding compilers. */ + +#ifdef __STDC__ # include #else # include #endif -/* Override any gcc2 internal prototype to avoid an error. */ + +#undef $2 + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" -{ #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char $2 (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ -#if defined (__stub_$2) || defined (__stub___$2) +#if defined __stub_$2 || defined __stub___$2 choke me -#else -char (*f) () = $2; -#endif -#ifdef __cplusplus -} #endif int main () { -return f != $2; +return $2 (); ; return 0; } @@ -2784,6 +2784,35 @@ if test $cross_compiling = no && test $multilib = yes \ cross_compiling=maybe fi +# We may wish to install the target headers somewhere. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to install libiberty headers and static library" >&5 +$as_echo_n "checking whether to install libiberty headers and static library... " >&6; } + +# Check whether --enable-install-libiberty was given. +if test "${enable_install_libiberty+set}" = set; then : + enableval=$enable_install_libiberty; enable_install_libiberty=$enableval +else + enable_install_libiberty=no +fi + +# Option parsed, now set things appropriately. +case x"$enable_install_libiberty" in + xyes|x) + target_header_dir=libiberty + ;; + xno) + target_header_dir= + ;; + *) + # This could be sanity-checked in various ways... + target_header_dir="${enable_install_libiberty}" + ;; +esac +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_install_libiberty" >&5 +$as_echo "$enable_install_libiberty" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: target_header_dir = $target_header_dir" >&5 +$as_echo "$as_me: target_header_dir = $target_header_dir" >&6;} + ac_ext=c ac_cpp='$CPP $CPPFLAGS' @@ -3920,8 +3949,14 @@ ac_c_preproc_warn_flag=yes ac_libiberty_warn_cflags= save_CFLAGS="$CFLAGS" -for option in -W -Wall -Wwrite-strings -Wc++-compat \ +for real_option in -W -Wall -Wwrite-strings -Wc++-compat \ -Wstrict-prototypes; do + # Do the check with the no- prefix removed since gcc silently + # accepts any -Wno-* option on purpose + case $real_option in + -Wno-*) option=-W`expr x$real_option : 'x-Wno-\(.*\)'` ;; + *) option=$real_option ;; + esac as_acx_Woption=`$as_echo "acx_cv_prog_cc_warning_$option" | $as_tr_sh` { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports $option" >&5 @@ -3953,11 +3988,13 @@ eval ac_res=\$$as_acx_Woption { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } if test `eval 'as_val=${'$as_acx_Woption'};$as_echo "$as_val"'` = yes; then : - ac_libiberty_warn_cflags="$ac_libiberty_warn_cflags${ac_libiberty_warn_cflags:+ }$option" + ac_libiberty_warn_cflags="$ac_libiberty_warn_cflags${ac_libiberty_warn_cflags:+ }$real_option" fi done CFLAGS="$save_CFLAGS" +# Do the check with the no- prefix removed from the warning options +# since gcc silently accepts any -Wno-* option on purpose if test "$GCC" = yes; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -pedantic " >&5 $as_echo_n "checking whether $CC supports -pedantic ... " >&6; } @@ -4840,6 +4877,82 @@ if [ -n "${frag}" ]; then frag=${libiberty_topdir}/libiberty/config/$frag fi + + + + +case "${host}" in + # PIC is the default on some targets or must not be used. + *-*-darwin*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + PICFLAG=-fno-common + ;; + alpha*-dec-osf5*) + # PIC is the default. + ;; + hppa*64*-*-hpux*) + # PIC is the default for 64-bit PA HP-UX. + ;; + i[34567]86-*-cygwin* | x86_64-*-cygwin*) + ;; + i[34567]86-*-mingw* | x86_64-*-mingw*) + ;; + i[34567]86-*-interix[3-9]*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. + ;; + i[34567]86-*-nto-qnx*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + PICFLAG='-fPIC -shared' + ;; + i[34567]86-pc-msdosdjgpp*) + # DJGPP does not support shared libraries at all. + ;; + ia64*-*-hpux*) + # On IA64 HP-UX, PIC is the default but the pic flag + # sets the default TLS model and affects inlining. + PICFLAG=-fPIC + ;; + mips-sgi-irix6*) + # PIC is the default. + ;; + rs6000-ibm-aix* | powerpc-ibm-aix*) + # All AIX code is PIC. + ;; + + # Some targets support both -fPIC and -fpic, but prefer the latter. + # FIXME: Why? + i[34567]86-*-* | x86_64-*-*) + PICFLAG=-fpic + ;; + # FIXME: Override -fPIC default in libgcc only? + sh-*-linux* | sh[2346lbe]*-*-linux*) + PICFLAG=-fpic + ;; + # FIXME: Simplify to sh*-*-netbsd*? + sh-*-netbsdelf* | shl*-*-netbsdelf* | sh5-*-netbsd* | sh5l*-*-netbsd* | \ + sh64-*-netbsd* | sh64l*-*-netbsd*) + PICFLAG=-fpic + ;; + # Default to -fPIC unless specified otherwise. + *) + PICFLAG=-fPIC + ;; +esac + +# If the user explicitly uses -fpic/-fPIC, keep that. +case "${CFLAGS}" in + *-fpic*) + PICFLAG=-fpic + ;; + *-fPIC*) + PICFLAG=-fPIC + ;; +esac + + # If they didn't specify --enable-shared, don't generate shared libs. case "${enable_shared}" in yes) shared=yes ;; @@ -4847,27 +4960,14 @@ case "${enable_shared}" in "") shared=no ;; *) shared=yes ;; esac -if [ "${shared}" = "yes" ]; then - case "${host}" in - *-*-cygwin*) ;; - alpha*-*-linux*) PICFLAG=-fPIC ;; - arm*-*-*) PICFLAG=-fPIC ;; - hppa*-*-*) PICFLAG=-fPIC ;; - i370-*-*) PICFLAG=-fPIC ;; - ia64-*-*) PICFLAG=-fpic ;; - i[34567]86-*-* | x86_64-*-*) - PICFLAG=-fpic ;; - m68k-*-*) PICFLAG=-fpic ;; - mips*-*-linux*) PICFLAG=-fPIC ;; - powerpc*-*-aix*) ;; - powerpc*-*-*) PICFLAG=-fPIC ;; - sparc*-*-*) case "${CFLAGS}" in - *-fpic* ) PICFLAG=-fpic ;; - * ) PICFLAG=-fPIC ;; - esac ;; - s390*-*-*) PICFLAG=-fpic ;; - sh*-*-*) PICFLAG=-fPIC ;; - esac + +# ...unless --enable-host-shared was passed from top-level config: +if [ "${enable_host_shared}" = "yes" ]; then + shared=yes +fi + +if [ "${shared}" != "yes" ]; then + PICFLAG= fi @@ -4895,7 +4995,7 @@ host_makefile_frag=${frag} # It's OK to check for header files. Although the compiler may not be # able to link anything, it had better be able to at least compile # something. -for ac_header in sys/file.h sys/param.h limits.h stdlib.h malloc.h string.h unistd.h strings.h sys/time.h time.h sys/resource.h sys/stat.h sys/mman.h fcntl.h alloca.h sys/pstat.h sys/sysmp.h sys/sysinfo.h machine/hal_sysinfo.h sys/table.h sys/sysctl.h sys/systemcfg.h stdint.h stdio_ext.h +for ac_header in sys/file.h sys/param.h limits.h stdlib.h malloc.h string.h unistd.h strings.h sys/time.h time.h sys/resource.h sys/stat.h sys/mman.h fcntl.h alloca.h sys/pstat.h sys/sysmp.h sys/sysinfo.h machine/hal_sysinfo.h sys/table.h sys/sysctl.h sys/systemcfg.h stdint.h stdio_ext.h process.h sys/prctl.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_preproc "$LINENO" "$ac_header" "$as_ac_Header" @@ -5203,6 +5303,17 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi +ac_fn_c_check_type "$LINENO" "ssize_t" "ac_cv_type_ssize_t" "$ac_includes_default" +if test "x$ac_cv_type_ssize_t" = x""yes; then : + +else + +cat >>confdefs.h <<_ACEOF +#define ssize_t int +_ACEOF + +fi + # Given the above check, we always have uintptr_t or a fallback # definition. So define HAVE_UINTPTR_T in case any imported code @@ -5263,6 +5374,7 @@ funcs="$funcs strchr" funcs="$funcs strdup" funcs="$funcs strncasecmp" funcs="$funcs strndup" +funcs="$funcs strnlen" funcs="$funcs strrchr" funcs="$funcs strstr" funcs="$funcs strtod" @@ -5282,9 +5394,10 @@ funcs="$funcs setproctitle" vars="sys_errlist sys_nerr sys_siglist" -checkfuncs="getrusage on_exit psignal strerror strsignal sysconf times sbrk gettimeofday" -checkfuncs="$checkfuncs realpath canonicalize_file_name pstat_getstatic pstat_getdynamic sysmp" -checkfuncs="$checkfuncs getsysinfo table sysctl wait3 wait4 __fsetlocking" +checkfuncs="__fsetlocking canonicalize_file_name dup3 getrlimit getrusage \ + getsysinfo gettimeofday on_exit psignal pstat_getdynamic pstat_getstatic \ + realpath setrlimit sbrk spawnve spawnvpe strerror strsignal sysconf sysctl \ + sysmp table times wait3 wait4" # These are neither executed nor required, but they help keep # autoheader happy without adding a bunch of text to acconfig.h. @@ -5292,17 +5405,18 @@ if test "x" = "y"; then for ac_func in asprintf atexit \ basename bcmp bcopy bsearch bzero \ calloc canonicalize_file_name clock \ + dup3 \ ffs __fsetlocking \ - getcwd getpagesize getrusage getsysinfo gettimeofday \ + getcwd getpagesize getrlimit getrusage getsysinfo gettimeofday \ index insque \ memchr memcmp memcpy memmem memmove memset mkstemps \ on_exit \ psignal pstat_getdynamic pstat_getstatic putenv \ random realpath rename rindex \ - sbrk setenv setproctitle sigsetmask snprintf stpcpy stpncpy strcasecmp strchr \ - strdup \ - strerror strncasecmp strndup strrchr strsignal strstr strtod strtol \ - strtoul strverscmp sysconf sysctl sysmp \ + sbrk setenv setproctitle setrlimit sigsetmask snprintf spawnve spawnvpe \ + stpcpy stpncpy strcasecmp strchr strdup \ + strerror strncasecmp strndup strnlen strrchr strsignal strstr strtod \ + strtol strtoul strverscmp sysconf sysctl sysmp \ table times tmpnam \ vasprintf vfprintf vprintf vsprintf \ wait3 wait4 waitpid @@ -5396,7 +5510,6 @@ fi setobjs= CHECK= -target_header_dir= if test -n "${with_target_subdir}"; then # We are being configured as a target library. AC_REPLACE_FUNCS @@ -5583,6 +5696,12 @@ esac ;; esac + case " $LIBOBJS " in + *" strnlen.$ac_objext "* ) ;; + *) LIBOBJS="$LIBOBJS strnlen.$ac_objext" + ;; +esac + case " $LIBOBJS " in *" strverscmp.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS strverscmp.$ac_objext" @@ -5604,7 +5723,7 @@ esac for f in $funcs; do case "$f" in - asprintf | basename | bcmp | bcopy | bzero | clock | ffs | getpagesize | index | insque | mempcpy | mkstemps | random | rindex | sigsetmask | stpcpy | stpncpy | strdup | strndup | strverscmp | vasprintf | waitpid) + asprintf | basename | bcmp | bcopy | bzero | clock | ffs | getpagesize | index | insque | mempcpy | mkstemps | random | rindex | sigsetmask | stpcpy | stpncpy | strdup | strndup | strnlen | strverscmp | vasprintf | waitpid) ;; *) n=HAVE_`echo $f | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` @@ -5673,29 +5792,6 @@ _ACEOF esac - # We may wish to install the target headers somewhere. - # Check whether --enable-install-libiberty was given. -if test "${enable_install_libiberty+set}" = set; then : - enableval=$enable_install_libiberty; enable_install_libiberty=$enableval -else - enable_install_libiberty=no -fi - - # Option parsed, now set things appropriately. - case x"$enable_install_libiberty" in - xyes|x) - target_header_dir=libiberty - ;; - xno) - target_header_dir= - ;; - *) - # This could be sanity-checked in various ways... - target_header_dir="${enable_install_libiberty}" - ;; - esac - - else # Not a target library, so we set things up to run the test suite. @@ -5706,33 +5802,6 @@ fi -# check for prctl PR_SET_NAME -if test "$cross_compiling" = yes; then : - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error "cannot run test program while cross compiling -See \`config.log' for more details." "$LINENO" 5; } -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -#include -int main() -{ - return (prctl(PR_SET_NAME, "foo") == 0) ? 0 : 1; -} - -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - -$as_echo "#define HAVE_PRCTL_SET_NAME 1" >>confdefs.h - -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - - case "${host}" in *-*-cygwin* | *-*-mingw*) $as_echo "#define HAVE_SYS_ERRLIST 1" >>confdefs.h @@ -6769,7 +6838,7 @@ if test "${ac_cv_func_strncmp_works+set}" = set; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : - ac_cv_func_strncmp_works=no + ac_cv_func_strncmp_works=yes else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */