summaryrefslogtreecommitdiff
path: root/pkgtools
diff options
context:
space:
mode:
authorjoerg <joerg@pkgsrc.org>2009-04-13 11:30:46 +0000
committerjoerg <joerg@pkgsrc.org>2009-04-13 11:30:46 +0000
commitf149e75ff04fcd967b53769828fc503ee26e7f72 (patch)
tree2e41ef0b72485e83cf34a284b6d06e28ecb16e3b /pkgtools
parent718f1d71e6f62255bb65fbafc7dbf28de57d27c9 (diff)
downloadpkgsrc-f149e75ff04fcd967b53769828fc503ee26e7f72.tar.gz
libnbcompat-20090409:
Resort and improve getopt_long detection. Should fix issues on Interix reported by mishka@ and QNX problems reported by Sean Boudreau.
Diffstat (limited to 'pkgtools')
-rw-r--r--pkgtools/libnbcompat/Makefile4
-rwxr-xr-xpkgtools/libnbcompat/files/configure87
-rw-r--r--pkgtools/libnbcompat/files/configure.ac15
-rw-r--r--pkgtools/libnbcompat/files/nbcompat.h8
-rw-r--r--pkgtools/libnbcompat/files/nbcompat/config.h.in6
5 files changed, 86 insertions, 34 deletions
diff --git a/pkgtools/libnbcompat/Makefile b/pkgtools/libnbcompat/Makefile
index b0085b00b66..3d05351d18d 100644
--- a/pkgtools/libnbcompat/Makefile
+++ b/pkgtools/libnbcompat/Makefile
@@ -1,11 +1,11 @@
-# $NetBSD: Makefile,v 1.70 2009/03/22 22:33:13 joerg Exp $
+# $NetBSD: Makefile,v 1.71 2009/04/13 11:30:46 joerg Exp $
#
# NOTE: If you update this package, it is *mandatory* that you update
# pkgsrc/pkgtools/libnbcompat/files/README to reflect the actual
# list of tested and supported platforms.
#
-DISTNAME= libnbcompat-20090322
+DISTNAME= libnbcompat-20090413
CATEGORIES= pkgtools devel
MASTER_SITES= # empty
DISTFILES= # empty
diff --git a/pkgtools/libnbcompat/files/configure b/pkgtools/libnbcompat/files/configure
index 78f85c32715..d2663fc410f 100755
--- a/pkgtools/libnbcompat/files/configure
+++ b/pkgtools/libnbcompat/files/configure
@@ -6056,25 +6056,60 @@ as_val=`eval 'as_val=${'$as_ac_Header'}
cat >>confdefs.h <<_ACEOF
#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
_ACEOF
-
-
- { $as_echo "$as_me:$LINENO: checking for struct option" >&5
+ { $as_echo "$as_me:$LINENO: checking for struct option" >&5
$as_echo_n "checking for struct option... " >&6; }
-if test "${pkg_cv_have_struct_option+set}" = set; then
+if test "${ac_cv_type_struct_option+set}" = set; then
$as_echo_n "(cached) " >&6
else
+ ac_cv_type_struct_option=no
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <getopt.h>
- cat >conftest.$ac_ext <<_ACEOF
+int
+main ()
+{
+if (sizeof (struct option))
+ return 0;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
- #include <getopt.h>
+#include <getopt.h>
+
int
main ()
{
- struct option X; ;
+if (sizeof ((struct option)))
+ return 0;
;
return 0;
}
@@ -6097,30 +6132,48 @@ $as_echo "$ac_try_echo") >&5
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
- pkg_cv_have_struct_option=yes
+ :
else
$as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
- pkg_cv_have_struct_option=no
+ ac_cv_type_struct_option=yes
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
fi
-{ $as_echo "$as_me:$LINENO: result: $pkg_cv_have_struct_option" >&5
-$as_echo "$pkg_cv_have_struct_option" >&6; }
- if test "x$pkg_cv_have_struct_option" = "xyes"; then
- :
- else
- case " $LIBOBJS " in
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_struct_option" >&5
+$as_echo "$ac_cv_type_struct_option" >&6; }
+if test "x$ac_cv_type_struct_option" = x""yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_OPTION 1
+_ACEOF
+
+:
+else
+ case " $LIBOBJS " in
*" getopt_long.$ac_objext "* ) ;;
*) LIBOBJS="$LIBOBJS getopt_long.$ac_objext"
;;
esac
- :
- fi
+fi
+
+else
+ case " $LIBOBJS " in
+ *" getopt_long.$ac_objext "* ) ;;
+ *) LIBOBJS="$LIBOBJS getopt_long.$ac_objext"
+ ;;
+esac
fi
diff --git a/pkgtools/libnbcompat/files/configure.ac b/pkgtools/libnbcompat/files/configure.ac
index f6ddf8dfe1b..30568e12f59 100644
--- a/pkgtools/libnbcompat/files/configure.ac
+++ b/pkgtools/libnbcompat/files/configure.ac
@@ -1,4 +1,4 @@
-dnl $NetBSD: configure.ac,v 1.72 2009/03/22 22:33:13 joerg Exp $
+dnl $NetBSD: configure.ac,v 1.73 2009/04/13 11:30:46 joerg Exp $
dnl Process this file with autoconf to produce a configure script.
AC_PREREQ(2.52)
@@ -148,12 +148,13 @@ AC_CHECK_DECLS([optind, optreset], [:], [:], [
])
-AC_CHECK_HEADERS([getopt.h], [
- AC_MSG_TRY_COMPILE([for struct option], pkg_cv_have_struct_option,
- [ #include <getopt.h> ], [ struct option X; ],
- [:],
- [AC_LIBOBJ(getopt_long)])
-])
+AC_CHECK_HEADERS([getopt.h],
+ [ AC_CHECK_TYPES([struct option],
+ [:],
+ [ AC_LIBOBJ(getopt_long)],
+ [#include <getopt.h>])],
+ [ AC_LIBOBJ(getopt_long)]
+)
if test "$enable_bsd_getopt" = yes; then
if test "$ac_cv_have_decl_optreset" = no; then
diff --git a/pkgtools/libnbcompat/files/nbcompat.h b/pkgtools/libnbcompat/files/nbcompat.h
index b9fdc734d0c..c763221ad6d 100644
--- a/pkgtools/libnbcompat/files/nbcompat.h
+++ b/pkgtools/libnbcompat/files/nbcompat.h
@@ -1,4 +1,4 @@
-/* $NetBSD: nbcompat.h,v 1.42 2008/10/19 21:02:07 joerg Exp $ */
+/* $NetBSD: nbcompat.h,v 1.43 2009/04/13 11:30:46 joerg Exp $ */
/*-
* Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -128,9 +128,7 @@
# include <nbcompat/vis.h>
#endif
-#if HAVE_NBCOMPAT_GETOPT_LONG
-# if HAVE_GETOPT_H
-# undef HAVE_GETOPT_H
-# endif
+#if !HAVE_GETOPT_H || !HAVE_STRUCT_OPTION
+# undef HAVE_GETOPT_H
# include <nbcompat/getopt.h>
#endif
diff --git a/pkgtools/libnbcompat/files/nbcompat/config.h.in b/pkgtools/libnbcompat/files/nbcompat/config.h.in
index f34fc457a67..d7845ce074c 100644
--- a/pkgtools/libnbcompat/files/nbcompat/config.h.in
+++ b/pkgtools/libnbcompat/files/nbcompat/config.h.in
@@ -206,9 +206,6 @@
/* Define to 1 if the `fts_*' functions are built into the library. */
#undef HAVE_NBCOMPAT_FTS
-/* Define to 1 if the `getopt_long' function is built into the library. */
-#undef HAVE_NBCOMPAT_GETOPT_LONG
-
/* Define to 1 if the `glob' function is built into the library. */
#undef HAVE_NBCOMPAT_GLOB
@@ -369,6 +366,9 @@
/* Define to 1 if the system has the type `struct in6_addr'. */
#undef HAVE_STRUCT_IN6_ADDR
+/* Define to 1 if the system has the type `struct option'. */
+#undef HAVE_STRUCT_OPTION
+
/* Define to 1 if the system has the type `struct sockaddr_in6'. */
#undef HAVE_STRUCT_SOCKADDR_IN6