X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=libiberty%2Fconfigure.ac;h=3380819ab3a7c350d24727ca2727656ace138d87;hb=173373c6f6388171d1d62a217fae90a052395be2;hp=9f1ff04938ec28cf81e69b0990e0c3831684e2f9;hpb=62b06a9e17aacab20187632db20a98c4f2fe7f49;p=deliverable%2Fbinutils-gdb.git diff --git a/libiberty/configure.ac b/libiberty/configure.ac index 9f1ff04938..3380819ab3 100644 --- a/libiberty/configure.ac +++ b/libiberty/configure.ac @@ -128,6 +128,31 @@ if test $cross_compiling = no && test $multilib = yes \ cross_compiling=maybe fi +# We may wish to install the target headers somewhere. +AC_MSG_CHECKING([whether to install libiberty headers and static library]) +dnl install-libiberty is disabled by default + +AC_ARG_ENABLE(install-libiberty, +[ --enable-install-libiberty Install headers and library for end users], +enable_install_libiberty=$enableval, +enable_install_libiberty=no)dnl + +# 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 +AC_MSG_RESULT($enable_install_libiberty) +AC_MSG_NOTICE([target_header_dir = $target_header_dir]) + GCC_NO_EXECUTABLES AC_PROG_CC AC_SYS_LARGEFILE @@ -191,6 +216,8 @@ if [[ -n "${frag}" ]]; then frag=${libiberty_topdir}/libiberty/config/$frag fi +GCC_PICFLAG + # If they didn't specify --enable-shared, don't generate shared libs. case "${enable_shared}" in yes) shared=yes ;; @@ -198,30 +225,23 @@ 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 AC_SUBST(PICFLAG) +NOASANFLAG= +case " ${CFLAGS} " in + *\ -fsanitize=address\ *) NOASANFLAG=-fno-sanitize=address ;; +esac +AC_SUBST(NOASANFLAG) + echo "# Warning: this fragment is automatically generated" > temp-frag if [[ -n "${frag}" ]] && [[ -f "${frag}" ]]; then @@ -339,6 +359,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" @@ -358,10 +379,10 @@ funcs="$funcs setproctitle" vars="sys_errlist sys_nerr sys_siglist" -checkfuncs="__fsetlocking canonicalize_file_name dup3 getrusage getsysinfo \ - gettimeofday on_exit psignal pstat_getdynamic pstat_getstatic realpath \ - sbrk spawnve spawnvpe strerror strsignal sysconf sysctl sysmp table \ - times wait3 wait4" +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. @@ -371,16 +392,16 @@ if test "x" = "y"; then 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 spawnve spawnvpe \ + sbrk setenv setproctitle setrlimit sigsetmask snprintf spawnve spawnvpe \ stpcpy stpncpy strcasecmp strchr strdup \ - strerror strncasecmp strndup strrchr strsignal strstr strtod strtol \ - strtoul strverscmp sysconf sysctl sysmp \ + strerror strncasecmp strndup strnlen strrchr strsignal strstr strtod \ + strtol strtoul strverscmp sysconf sysctl sysmp \ table times tmpnam \ vasprintf vfprintf vprintf vsprintf \ wait3 wait4 waitpid) @@ -396,7 +417,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 @@ -459,13 +479,14 @@ if test -n "${with_target_subdir}"; then AC_LIBOBJ([stpcpy]) AC_LIBOBJ([stpncpy]) AC_LIBOBJ([strndup]) + AC_LIBOBJ([strnlen]) AC_LIBOBJ([strverscmp]) AC_LIBOBJ([vasprintf]) AC_LIBOBJ([waitpid]) 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'` @@ -507,27 +528,6 @@ if test -n "${with_target_subdir}"; then esac - # We may wish to install the target headers somewhere. - AC_ARG_ENABLE(install-libiberty, - [ --enable-install-libiberty Install headers for end users], - enable_install_libiberty=$enableval, - enable_install_libiberty=no)dnl - - # 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.