SF patch #584245, get python to link on OSF1 (Dec Unix)

This commit is contained in:
Neal Norwitz 2002-07-30 01:08:28 +00:00
parent cee5ca060b
commit 1169011f6f
4 changed files with 132 additions and 2 deletions

View File

@ -4604,7 +4604,7 @@ posix_mkfifo(PyObject *self, PyObject *args)
#endif #endif
#ifdef HAVE_MKNOD #if defined(HAVE_MKNOD) && defined(HAVE_MAKEDEV)
PyDoc_STRVAR(posix_mknod__doc__, PyDoc_STRVAR(posix_mknod__doc__,
"mknod(filename, [, mode=0600, major, minor])\n\n\ "mknod(filename, [, mode=0600, major, minor])\n\n\
Create a filesystem node (file, device special file or named pipe)\n\ Create a filesystem node (file, device special file or named pipe)\n\
@ -6426,7 +6426,7 @@ static PyMethodDef posix_methods[] = {
#ifdef HAVE_MKFIFO #ifdef HAVE_MKFIFO
{"mkfifo", posix_mkfifo, METH_VARARGS, posix_mkfifo__doc__}, {"mkfifo", posix_mkfifo, METH_VARARGS, posix_mkfifo__doc__},
#endif #endif
#ifdef HAVE_MKNOD #if defined(HAVE_MKNOD) && defined(HAVE_MAKEDEV)
{"mknod", posix_mknod, METH_VARARGS, posix_mknod__doc__}, {"mknod", posix_mknod, METH_VARARGS, posix_mknod__doc__},
#endif #endif
#ifdef HAVE_FTRUNCATE #ifdef HAVE_FTRUNCATE

100
configure vendored
View File

@ -4316,6 +4316,106 @@ rm -f conftest*
echo "$as_me:$LINENO: result: $was_it_defined" >&5 echo "$as_me:$LINENO: result: $was_it_defined" >&5
echo "${ECHO_T}$was_it_defined" >&6 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 # Two defines needed to enable largefile support on various platforms
# These may affect some typedefs # These may affect some typedefs

View File

@ -623,6 +623,30 @@ AC_EGREP_HEADER(clock_t, time.h, was_it_defined=yes, [
]) ])
AC_MSG_RESULT($was_it_defined) 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 # Two defines needed to enable largefile support on various platforms
# These may affect some typedefs # These may affect some typedefs
AC_DEFINE(_LARGEFILE_SOURCE, 1, AC_DEFINE(_LARGEFILE_SOURCE, 1,

View File

@ -247,6 +247,9 @@
/* Define to 1 if you have the `lstat' function. */ /* Define to 1 if you have the `lstat' function. */
#undef HAVE_LSTAT #undef HAVE_LSTAT
/* Define this if you have the makedev macro. */
#undef HAVE_MAKEDEV
/* Define to 1 if you have the `memmove' function. */ /* Define to 1 if you have the `memmove' function. */
#undef HAVE_MEMMOVE #undef HAVE_MEMMOVE
@ -766,6 +769,9 @@
/* Define to 1 if on MINIX. */ /* Define to 1 if on MINIX. */
#undef _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 /* Define to 2 if the system does not provide POSIX.1 features except with
this defined. */ this defined. */
#undef _POSIX_1_SOURCE #undef _POSIX_1_SOURCE