]> gcc.gnu.org Git - gcc.git/blobdiff - libio/configure.in
configure.in: Create compatibility code in bits/libc-lock.h file.
[gcc.git] / libio / configure.in
index d6359382bcfc96f5f839055973e72da5c23648ae..2fc3a962afaa14c07aa44b86fd0b1614db5183c4 100644 (file)
@@ -16,12 +16,9 @@ frags=
 
 case "${target}" in
   *-hpux*)       frags=hpux.mt ;;
-  *-linux*)      
-       echo "WARNING:  The I/O implementation in FSF libg++ 2.8.x is not"
-       echo "  compatible with Linux libc through 5.2.x."
-       echo "  See libg++/README for more information."
-       echo "  YOU ARE ON YOUR OWN!"
-                frags=linux.mt ;;
+  *-linux-gnulibc1)
+                frags=linuxlibc1.mt ;;
+  *-linux-gnu)   frags="linux.mt mtsafe.mt" ;;
   *-sco3.2v[45]*)   frags=sco4.mt ;;
   *-isc*)        frags=isc.mt ;;
   *-netware*)    frags=netware.mt ;;
@@ -39,10 +36,37 @@ if [ "${shared}" = "yes" ]; then
   case "${target}" in
     hppa*-*)    frags="${frags} ../../config/mh-papic" ;;
     i[3456]86-*) frags="${frags} ../../config/mh-x86pic" ;;
+    alpha-*-linux*)
+                frags="${frags} ../../config/mh-elfalphapic" ;;
     *)          frags="${frags} ../../config/mh-${target_cpu}pic" ;;
   esac
 fi
 
+# Make a link for the correct stdio-lock.h file.
+case "${target}" in
+  *-linux-gnu)
+    # We have a correct file in glibc but the libioP.h file is written
+    # with glibc 2.1 in mind which has the internals headers in special
+    # directory while glibc 2.0 has them in /usr/include.  Create a wrapper
+    # if necessary.
+    (echo "#include <bits/libc-lock.h>" | ${CC-cc} -E -) >/dev/null 2>&1 ||
+      {
+       rm -fr bits
+        mkdir bits
+        echo "#include <libc-lock.h>" > bits/libc-lock.h
+       echo 'asm (".weak _pthread_cleanup_pop_restore");' >> bits/libc-lock.h
+       echo 'asm (".weak _pthread_cleanup_push_defer");' >> bits/libc-lock.h
+
+        echo "#include <stdio-lock.h>" > bits/stdio-lock.h
+      }
+    ;;
+  *)
+    rm -fr bits
+    mkdir bits
+    ln -s ${srcdir}/include/empty.h bits/stdio-lock.h
+    ;;
+esac
+
 for frag in ${frags}; do
   frag=${srcdir}/config/$frag
   if [ -f ${frag} ]; then
@@ -57,7 +81,7 @@ ${moveifchange} temp.mt target-mkfrag
 
 LIBDIR=yes
 TO_TOPDIR=../
-ALL='$(_G_CONFIG_H) libio.a iostream.list'
+ALL='$(_G_CONFIG_H) libio.a libiostream.a iostream.list'
 XCINCLUDES='-I. -I$(srcdir)'
 XCXXINCLUDES='-I. -I$(srcdir)'
 MOSTLYCLEAN='*.o pic stamp-picdir core iostream.list'
This page took 0.027284 seconds and 5 git commands to generate.