]> granicus.if.org Git - python/commitdiff
SF patch #584245, get python to link on OSF1 (Dec Unix)
authorNeal Norwitz <nnorwitz@gmail.com>
Tue, 30 Jul 2002 01:08:28 +0000 (01:08 +0000)
committerNeal Norwitz <nnorwitz@gmail.com>
Tue, 30 Jul 2002 01:08:28 +0000 (01:08 +0000)
Modules/posixmodule.c
configure
configure.in
pyconfig.h.in

index 61000673f4240b8a0383a9843b623769a6c62554..e5d11789046179a108e7ade23baebb3a021ac576 100644 (file)
@@ -4604,7 +4604,7 @@ posix_mkfifo(PyObject *self, PyObject *args)
 #endif
 
 
-#ifdef HAVE_MKNOD
+#if defined(HAVE_MKNOD) && defined(HAVE_MAKEDEV)
 PyDoc_STRVAR(posix_mknod__doc__,
 "mknod(filename, [, mode=0600, major, minor])\n\n\
 Create a filesystem node (file, device special file or named pipe)\n\
@@ -6426,7 +6426,7 @@ static PyMethodDef posix_methods[] = {
 #ifdef HAVE_MKFIFO
        {"mkfifo",      posix_mkfifo, METH_VARARGS, posix_mkfifo__doc__},
 #endif
-#ifdef HAVE_MKNOD
+#if defined(HAVE_MKNOD) && defined(HAVE_MAKEDEV)
        {"mknod",       posix_mknod, METH_VARARGS, posix_mknod__doc__},
 #endif
 #ifdef HAVE_FTRUNCATE
index 9024bcb718f1d480240195c815e46a06760c9221..fdc2508e81b98a87d24a86e617817d89c1c6a199 100755 (executable)
--- a/configure
+++ b/configure
@@ -4316,6 +4316,106 @@ rm -f conftest*
 echo "$as_me:$LINENO: result: $was_it_defined" >&5
 echo "${ECHO_T}$was_it_defined" >&6
 
+# Check whether using makedev requires defining _OSF_SOURCE
+echo "$as_me:$LINENO: checking for makedev" >&5
+echo $ECHO_N "checking for makedev... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+#include "confdefs.h"
+ #include <sys/types.h>
+#ifdef F77_DUMMY_MAIN
+#  ifdef __cplusplus
+     extern "C"
+#  endif
+   int F77_DUMMY_MAIN() { return 1; }
+#endif
+int
+main ()
+{
+ makedev(0, 0)
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_has_makedev=yes
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_has_makedev=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+if test "$ac_cv_has_makedev" = "no"; then
+    # we didn't link, try if _OSF_SOURCE will allow us to link
+    cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+#include "confdefs.h"
+
+    #define _OSF_SOURCE 1
+    #include <sys/types.h>
+
+#ifdef F77_DUMMY_MAIN
+#  ifdef __cplusplus
+     extern "C"
+#  endif
+   int F77_DUMMY_MAIN() { return 1; }
+#endif
+int
+main ()
+{
+ makedev(0, 0)
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_has_makedev=yes
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_has_makedev=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+    if test "$ac_cv_has_makedev" = "yes"; then
+
+cat >>confdefs.h <<\_ACEOF
+#define _OSF_SOURCE 1
+_ACEOF
+
+    fi
+fi
+echo "$as_me:$LINENO: result: $ac_cv_has_makedev" >&5
+echo "${ECHO_T}$ac_cv_has_makedev" >&6
+if test "$ac_cv_has_makedev" = "yes"; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_MAKEDEV 1
+_ACEOF
+
+fi
+
 # Two defines needed to enable largefile support on various platforms
 # These may affect some typedefs
 
index 88a285f48716781e0a16d100ac2e753d0d992d53..7e82ca55f8d86b9ff43570ffa8436d656b8a6e0f 100644 (file)
@@ -623,6 +623,30 @@ AC_EGREP_HEADER(clock_t, time.h, was_it_defined=yes, [
 ])
 AC_MSG_RESULT($was_it_defined)
 
+# Check whether using makedev requires defining _OSF_SOURCE
+AC_MSG_CHECKING(for makedev)
+AC_TRY_LINK([ #include <sys/types.h> ],
+           [ makedev(0, 0) ],
+           ac_cv_has_makedev=yes,
+           ac_cv_has_makedev=no)
+if test "$ac_cv_has_makedev" = "no"; then
+    # we didn't link, try if _OSF_SOURCE will allow us to link
+    AC_TRY_LINK([
+    #define _OSF_SOURCE 1
+    #include <sys/types.h>
+    ],
+    [ makedev(0, 0) ],
+    ac_cv_has_makedev=yes,
+    ac_cv_has_makedev=no)
+    if test "$ac_cv_has_makedev" = "yes"; then
+        AC_DEFINE(_OSF_SOURCE, 1, [Define _OSF_SOURCE to get the makedev macro.])
+    fi
+fi
+AC_MSG_RESULT($ac_cv_has_makedev)
+if test "$ac_cv_has_makedev" = "yes"; then
+    AC_DEFINE(HAVE_MAKEDEV, 1, [Define this if you have the makedev macro.])
+fi
+
 # Two defines needed to enable largefile support on various platforms
 # These may affect some typedefs
 AC_DEFINE(_LARGEFILE_SOURCE, 1, 
index 05a355b06bfcebcd3d32981a76c150e2cce537e5..74625f21528eb3371f00e023c4d889ad48906b0a 100644 (file)
 /* Define to 1 if you have the `lstat' function. */
 #undef HAVE_LSTAT
 
+/* Define this if you have the makedev macro. */
+#undef HAVE_MAKEDEV
+
 /* Define to 1 if you have the `memmove' function. */
 #undef HAVE_MEMMOVE
 
 /* Define to 1 if on MINIX. */
 #undef _MINIX
 
+/* Define _OSF_SOURCE to get the makedev macro. */
+#undef _OSF_SOURCE
+
 /* Define to 2 if the system does not provide POSIX.1 features except with
    this defined. */
 #undef _POSIX_1_SOURCE