OSDN Git Service

gcc/
[pf3gnuchains/gcc-fork.git] / libiberty / configure.ac
index 8212378..ff0ae6a 100644 (file)
@@ -130,10 +130,12 @@ fi
 
 GCC_NO_EXECUTABLES
 AC_PROG_CC
+AC_SYS_LARGEFILE
 AC_PROG_CPP_WERROR
 
-ACX_PROG_CC_WARNING_OPTS([-W -Wall -pedantic -Wwrite-strings -Wc++-compat \
+ACX_PROG_CC_WARNING_OPTS([-W -Wall -Wwrite-strings -Wc++-compat \
                          -Wstrict-prototypes], [ac_libiberty_warn_cflags])
+ACX_PROG_CC_WARNING_ALMOST_PEDANTIC([], [ac_libiberty_warn_cflags])
 
 AC_PROG_CC_C_O
 # autoconf is lame and doesn't give us any substitution variable for this.
@@ -186,9 +188,7 @@ case "${host}" in
 esac
 
 if [[ -n "${frag}" ]]; then
-  frags=${libiberty_topdir}/libiberty/config/$frag
-else
-  frags=
+  frag=${libiberty_topdir}/libiberty/config/$frag
 fi
 
 # If they didn't specify --enable-shared, don't generate shared libs.
@@ -199,34 +199,35 @@ case "${enable_shared}" in
   *) shared=yes ;;
 esac
 if [[ "${shared}" = "yes" ]]; then
-  frag=
   case "${host}" in
     *-*-cygwin*)       ;;
-    alpha*-*-linux*)   frag=mh-elfalphapic ;;
-    arm*-*-*)          frag=mh-armpic ;;
-    hppa*-*-*)         frag=mh-papic ;;
+    alpha*-*-linux*)   PICFLAG=-fPIC ;;
+    arm*-*-*)          PICFLAG=-fPIC ;;
+    hppa*-*-*)         PICFLAG=-fPIC ;;
+    i370-*-*)          PICFLAG=-fPIC ;;
+    ia64-*-*)          PICFLAG=-fpic ;;
     i[[34567]]86-*-* | x86_64-*-*)
-                       frag=mh-x86pic ;;
+                       PICFLAG=-fpic ;;
+    m68k-*-*)          PICFLAG=-fpic ;;
+    mips*-*-linux)     PICFLAG=-fPIC ;;
     powerpc*-*-aix*)   ;;
-    powerpc*-*-*)      frag=mh-ppcpic ;;
-    sparc*-*-*)                frag=mh-sparcpic ;;
-    s390*-*-*)         frag=mh-s390pic ;;
-    *)                 frag=mh-${host_cpu}pic ;;
+    powerpc*-*-*)      PICFLAG=-fPIC ;;
+    sparc*-*-*)                case "${CFLAGS}" in
+                         *-fpic* ) PICFLAG=-fpic ;;
+                         * ) PICFLAG=-fPIC ;;
+                       esac ;;
+    s390*-*-*)         PICFLAG=-fpic ;;
   esac
-  if [[ -n "${frag}" ]]; then
-    frags="${frags} ${libiberty_topdir}/config/${frag}"
-  fi
 fi
+AC_SUBST(PICFLAG)
 
 echo "# Warning: this fragment is automatically generated" > temp-frag
 
-for frag in ${frags}; do
-  if [[ -f ${frag} ]]; then
-    echo "Appending ${frag} to xhost-mkfrag"
-    echo "# Following fragment copied from ${frag}" >> temp-frag
-    cat ${frag} >> temp-frag
-  fi
-done
+if [[ -n "${frag}" ]] && [[ -f "${frag}" ]]; then
+  echo "Appending ${frag} to xhost-mkfrag"
+  echo "# Following fragment copied from ${frag}" >> temp-frag
+  cat ${frag} >> temp-frag
+fi
 
 # record if we want to build shared libs.
 if [[ "${shared}" = "yes" ]]; then
@@ -548,7 +549,7 @@ if test -z "${setobjs}"; then
 
   *-*-msdosdjgpp)
     for f in atexit basename bcmp bcopy bsearch bzero calloc clock ffs \
-             getcwd getpagesize getrusage gettimeofday gettimeofday \
+             getcwd getpagesize getrusage gettimeofday \
              index insque memchr memcmp memcpy memmove memset psignal \
              putenv random rename rindex sbrk setenv stpcpy strcasecmp \
              strchr strdup strerror strncasecmp strrchr strstr strtod \