* configure.in: Only check for <sys/procfs.h> on a native system,
authorIan Lance Taylor <ian@airs.com>
Fri, 8 Sep 1995 15:50:29 +0000 (15:50 +0000)
committerIan Lance Taylor <ian@airs.com>
Fri, 8 Sep 1995 15:50:29 +0000 (15:50 +0000)
and make sure it defines prstatus_t.
* configure: Rebuild.

bfd/ChangeLog
bfd/configure
bfd/configure.in

index c9e0c12b8ecac3d79f20ad280dbfdd38d68ca819..d22a4e002d8c0355b09b26296cfddb38f165eebb 100644 (file)
@@ -1,3 +1,9 @@
+Fri Sep  8 11:47:24 1995  Ian Lance Taylor  <ian@cygnus.com>
+
+       * configure.in: Only check for <sys/procfs.h> on a native system,
+       and make sure it defines prstatus_t.
+       * configure: Rebuild.
+
 Thu Sep  7 12:48:01 1995  Ian Lance Taylor  <ian@cygnus.com>
 
        * sunos.c (sunos_write_dynamic_symbol): Correct m68k abort test.
index f54e1be8f02d1e63380aa89c96b27fe5a83f352b..4459986c34a2610ac89685c0ddf4d6bfa53fb056 100755 (executable)
@@ -801,7 +801,7 @@ else
 fi
 done
 
-for ac_hdr in fcntl.h sys/file.h sys/procfs.h
+for ac_hdr in fcntl.h sys/file.h
 do
 ac_safe=`echo "$ac_hdr" | tr './\055' '___'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
@@ -1170,6 +1170,42 @@ EOF
   rs6000-core.o)       COREFLAG="$COREFLAG -DAIX_CORE" ;;
   trad-core.o)         COREFLAG="$COREFLAG -DTRAD_CORE" ;;
   esac
+
+  # The ELF code uses the native <sys/procfs.h> to handle core files.
+  # Define HAVE_SYS_PROCFS_H if the file exists and defines
+  # prstatus_t.
+  echo $ac_n "checking for sys/procfs.h""... $ac_c" 1>&6
+  if eval "test \"`echo '$''{'bfd_cv_header_sys_procfs_h'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftest.$ac_ext <<EOF
+#line 1183 "configure"
+#include "confdefs.h"
+#include <sys/procfs.h>
+int main() { return 0; }
+int t() {
+prstatus_t t;
+; return 0; }
+EOF
+if eval $ac_compile; then
+  rm -rf conftest*
+  bfd_cv_header_sys_procfs_h=yes
+else
+  rm -rf conftest*
+  bfd_cv_header_sys_procfs_h=no
+fi
+rm -f conftest*
+
+fi
+
+  echo "$ac_t""$bfd_cv_header_sys_procfs_h" 1>&6
+  if test $bfd_cv_header_sys_procfs_h = yes; then
+    cat >> confdefs.h <<\EOF
+#define HAVE_SYS_PROCFS_H 1
+EOF
+
+  fi
+
 fi
 
 
index daeb682a3bb56a5793b3074b8715531587c0f6a9..5808c962fac6d292fb7157affbbc181ca5f27a11 100644 (file)
@@ -53,7 +53,7 @@ AC_SUBST(HOST_64BIT_LONG)
 BFD_CC_FOR_BUILD
 
 AC_CHECK_HEADERS(stddef.h string.h strings.h stdlib.h time.h unistd.h)
-AC_CHECK_HEADERS(fcntl.h sys/file.h sys/procfs.h)
+AC_CHECK_HEADERS(fcntl.h sys/file.h)
 AC_CHECK_FUNCS(fcntl)
 
 BFD_BINARY_FOPEN
@@ -237,6 +237,20 @@ changequote([,])dnl
   rs6000-core.o)       COREFLAG="$COREFLAG -DAIX_CORE" ;;
   trad-core.o)         COREFLAG="$COREFLAG -DTRAD_CORE" ;;
   esac
+
+  # The ELF code uses the native <sys/procfs.h> to handle core files.
+  # Define HAVE_SYS_PROCFS_H if the file exists and defines
+  # prstatus_t.
+  AC_MSG_CHECKING([for sys/procfs.h])
+  AC_CACHE_VAL(bfd_cv_header_sys_procfs_h,
+  [AC_TRY_COMPILE([#include <sys/procfs.h>],
+  [prstatus_t t;],
+  bfd_cv_header_sys_procfs_h=yes, bfd_cv_header_sys_procfs_h=no)])
+  AC_MSG_RESULT($bfd_cv_header_sys_procfs_h)
+  if test $bfd_cv_header_sys_procfs_h = yes; then
+    AC_DEFINE(HAVE_SYS_PROCFS_H)
+  fi
+
 fi
 AC_SUBST(COREFILE)
 AC_SUBST(COREFLAG)