Skip to content

Commit b3aabb4

Browse files
committed
Update configure.ac to configure for Windows.
1 parent 38f682c commit b3aabb4

File tree

1 file changed

+21
-3
lines changed

1 file changed

+21
-3
lines changed

configure.ac

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@ fi
6868

6969
AC_SUBST([DLOPEN_LIBS], [$lt_cv_dlopen_libs])
7070

71-
7271
AC_MSG_CHECKING([for kernel type ($host_os)])
7372
case $host_os in
7473
*aix*)
@@ -99,10 +98,15 @@ case $host_os in
9998
AC_DEFINE([KERNEL_SOLARIS], [1], [True if program is to be compiled for a Solaris kernel])
10099
ac_system="Solaris"
101100
;;
101+
*mingw32*)
102+
AC_DEFINE([KERNEL_WIN32], [1], [True if program is to be compiled for a Windows kernel])
103+
ac_system="Windows"
104+
;;
102105
*)
103106
ac_system="unknown"
104107
;;
105108
esac
109+
106110
AC_MSG_RESULT([$ac_system])
107111

108112
AM_CONDITIONAL([BUILD_AIX], [test "x$ac_system" = "xAIX"])
@@ -111,6 +115,7 @@ AM_CONDITIONAL([BUILD_FREEBSD], [test "x$ac_system" = "xFreeBSD"])
111115
AM_CONDITIONAL([BUILD_LINUX], [test "x$ac_system" = "xLinux"])
112116
AM_CONDITIONAL([BUILD_OPENBSD], [test "x$ac_system" = "xOpenBSD"])
113117
AM_CONDITIONAL([BUILD_SOLARIS], [test "x$ac_system" = "xSolaris"])
118+
AM_CONDITIONAL([BUILD_WIN32], [test "x$ac_system" = "xWindows"])
114119

115120
if test "x$ac_system" = "xSolaris"; then
116121
AC_DEFINE([_POSIX_PTHREAD_SEMANTICS], [1], [Define to enforce POSIX thread semantics under Solaris.])
@@ -745,6 +750,7 @@ AC_CHECK_FUNCS_ONCE([ \
745750
getaddrinfo \
746751
getgrnam_r \
747752
getnameinfo \
753+
getpwnam \
748754
getpwnam_r \
749755
gettimeofday \
750756
if_indextoname \
@@ -851,11 +857,17 @@ AC_CHECK_FUNCS([socket],
851857
[
852858
AC_CHECK_LIB([socket], [socket],
853859
[socket_needs_socket="yes"],
854-
[AC_MSG_ERROR([cannot find socket() in libsocket])]
860+
[
861+
AC_CHECK_LIB(gnu, rpl_socket,
862+
[socket_needs_gnulib="yes"],
863+
[AC_MSG_ERROR([cannot find socket() in libsocket])]
864+
)
865+
]
855866
)
856867
]
857868
)
858869
AM_CONDITIONAL([BUILD_WITH_LIBSOCKET], [test "x$socket_needs_socket" = "xyes"])
870+
AM_CONDITIONAL([BUILD_WITH_GNULIB], [test "x$socket_needs_gnulib" = "xyes"])
859871

860872
clock_gettime_needs_posix4="no"
861873
AC_CHECK_FUNCS([clock_gettime],
@@ -891,7 +903,12 @@ AC_CHECK_FUNCS([nanosleep], [],
891903
[
892904
AC_CHECK_LIB([posix4], [nanosleep],
893905
[nanosleep_needs_posix4="yes"],
894-
[AC_MSG_ERROR([cannot find nanosleep])]
906+
[
907+
AC_CHECK_FUNCS([rpl_nanosleep],
908+
[nanosleep_needs_gnulib="yes"],
909+
[AC_MSG_ERROR([cannot find nanosleep])]
910+
)
911+
]
895912
)
896913
]
897914
)
@@ -7093,3 +7110,4 @@ if test "x$dependency_warning" = "xyes"; then
70937110
fi
70947111
70957112
# vim: set fdm=marker sw=2 sts=2 ts=2 et :
7113+

0 commit comments

Comments
 (0)