summaryrefslogtreecommitdiff
path: root/pkgtools/libnbcompat
diff options
context:
space:
mode:
authorgrant <grant>2004-04-23 11:42:46 +0000
committergrant <grant>2004-04-23 11:42:46 +0000
commitc3ee799e37a575b15ad9dd9a0fb389524f4c1b1b (patch)
treea54590bbe381e57f0f92ab8f02823b4aef174ed9 /pkgtools/libnbcompat
parentff21644557e8128c6a06eb9252c2bc001d3f18df (diff)
downloadpkgsrc-c3ee799e37a575b15ad9dd9a0fb389524f4c1b1b.tar.gz
make sure we define HAVE_POLL if a usable poll() implementation is
found, and re-arrange the test a little for clarity. fixes build on (at least) FreeBSD 5.x.
Diffstat (limited to 'pkgtools/libnbcompat')
-rwxr-xr-xpkgtools/libnbcompat/files/configure52
-rw-r--r--pkgtools/libnbcompat/files/configure.ac27
-rw-r--r--pkgtools/libnbcompat/files/nbcompat/config.h.in3
3 files changed, 49 insertions, 33 deletions
diff --git a/pkgtools/libnbcompat/files/configure b/pkgtools/libnbcompat/files/configure
index a98f923b6e7..8561005c190 100755
--- a/pkgtools/libnbcompat/files/configure
+++ b/pkgtools/libnbcompat/files/configure
@@ -8460,20 +8460,7 @@ if test $ac_cv_header_poll_h = no && test $ac_cv_header_sys_poll_h = no; then
fi
if test $pkg_use_nbcompat_poll = yes; then
- cat >>confdefs.h <<\_ACEOF
-#define HAVE_NBCOMPAT_POLL 1
-_ACEOF
-
-
-
- case $LIBOBJS in
- "poll.$ac_objext" | \
- *" poll.$ac_objext" | \
- "poll.$ac_objext "* | \
- *" poll.$ac_objext "* ) ;;
- *) LIBOBJS="$LIBOBJS poll.$ac_objext" ;;
-esac
-
+ pkg_cv_POLL_NATIVE=no
else
echo "$as_me:$LINENO: checking for poll" >&5
echo $ECHO_N "checking for poll... $ECHO_C" >&6
@@ -8570,7 +8557,7 @@ if test $ac_cv_func_poll = yes; then
echo "$as_me:$LINENO: checking if poll() is implemented natively" >&5
echo $ECHO_N "checking if poll() is implemented natively... $ECHO_C" >&6
-if test "${pkg_cv_POLL_COMPAT+set}" = set; then
+if test "${pkg_cv_POLL_NATIVE+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
@@ -8620,22 +8607,39 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
- pkg_cv_POLL_COMPAT=yes
+ pkg_cv_POLL_NATIVE=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
- pkg_cv_POLL_COMPAT=no
+ pkg_cv_POLL_NATIVE=no
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
-echo "$as_me:$LINENO: result: $pkg_cv_POLL_COMPAT" >&5
-echo "${ECHO_T}$pkg_cv_POLL_COMPAT" >&6
- if test "x$pkg_cv_POLL_COMPAT" = "xyes"; then
+echo "$as_me:$LINENO: result: $pkg_cv_POLL_NATIVE" >&5
+echo "${ECHO_T}$pkg_cv_POLL_NATIVE" >&6
+ if test "x$pkg_cv_POLL_NATIVE" = "xyes"; then
:
else
- case $LIBOBJS in
+ :
+ :
+ fi
+
+
+fi
+
+fi
+
+if test $pkg_cv_POLL_NATIVE = yes; then
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_POLL 1
+_ACEOF
+
+
+
+else
+ case $LIBOBJS in
"poll.$ac_objext" | \
*" poll.$ac_objext" | \
"poll.$ac_objext "* | \
@@ -8643,11 +8647,11 @@ echo "${ECHO_T}$pkg_cv_POLL_COMPAT" >&6
*) LIBOBJS="$LIBOBJS poll.$ac_objext" ;;
esac
- :
- fi
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_NBCOMPAT_POLL 1
+_ACEOF
-fi
fi
diff --git a/pkgtools/libnbcompat/files/configure.ac b/pkgtools/libnbcompat/files/configure.ac
index 0b7c3b4b707..cf48d4bbafb 100644
--- a/pkgtools/libnbcompat/files/configure.ac
+++ b/pkgtools/libnbcompat/files/configure.ac
@@ -1,4 +1,4 @@
-dnl $NetBSD: configure.ac,v 1.42 2004/04/20 12:13:05 grant Exp $
+dnl $NetBSD: configure.ac,v 1.43 2004/04/23 11:42:46 grant Exp $
dnl Process this file with autoconf to produce a configure script.
AC_PREREQ(2.52)
@@ -194,15 +194,11 @@ if test $ac_cv_header_poll_h = no && test $ac_cv_header_sys_poll_h = no; then
fi
if test $pkg_use_nbcompat_poll = yes; then
- AC_DEFINE(HAVE_NBCOMPAT_POLL, 1)
- AH_TEMPLATE([HAVE_NBCOMPAT_POLL], [
- Define to 1 if the `poll' function is built into the library.
- ])
- AC_LIBOBJ(poll)
+ pkg_cv_POLL_NATIVE=no
else
AC_CHECK_FUNC(poll, [
AC_MSG_TRY_COMPILE([if poll() is implemented natively],
- pkg_cv_POLL_COMPAT,
+ pkg_cv_POLL_NATIVE,
[ #if HAVE_POLL_H
#include <poll.h>
#endif
@@ -214,8 +210,21 @@ else
#error "poll() is emulated"
#endif
],
- [:], [AC_LIBOBJ(poll)])
-])
+ [:], [:])
+ ])
+fi
+
+if test $pkg_cv_POLL_NATIVE = yes; then
+ AC_DEFINE(HAVE_POLL, 1)
+ AH_TEMPLATE([HAVE_POLL], [
+ Define to 1 if you have the `poll' function.
+ ])
+else
+ AC_LIBOBJ(poll)
+ AC_DEFINE(HAVE_NBCOMPAT_POLL, 1)
+ AH_TEMPLATE([HAVE_NBCOMPAT_POLL], [
+ Define to 1 if the `poll' function is built into the library.
+ ])
fi
AC_CHECK_FUNCS([strunvis strvis strsvis])
diff --git a/pkgtools/libnbcompat/files/nbcompat/config.h.in b/pkgtools/libnbcompat/files/nbcompat/config.h.in
index 90888591a6f..d4ca0165305 100644
--- a/pkgtools/libnbcompat/files/nbcompat/config.h.in
+++ b/pkgtools/libnbcompat/files/nbcompat/config.h.in
@@ -185,6 +185,9 @@
/* Define to 1 if you have the <paths.h> header file. */
#undef HAVE_PATHS_H
+/* Define to 1 if you have the `poll' function. */
+#undef HAVE_POLL
+
/* Define to 1 if you have the <poll.h> header file. */
#undef HAVE_POLL_H