Mon Apr 13 11:30:46 2009 UTC ()
libnbcompat-20090409:
Resort and improve getopt_long detection. Should fix issues on Interix
reported by mishka@ and QNX problems reported by Sean Boudreau.


(joerg)
diff -r1.70 -r1.71 pkgsrc/pkgtools/libnbcompat/Makefile
diff -r1.71 -r1.72 pkgsrc/pkgtools/libnbcompat/files/configure
diff -r1.72 -r1.73 pkgsrc/pkgtools/libnbcompat/files/configure.ac
diff -r1.42 -r1.43 pkgsrc/pkgtools/libnbcompat/files/nbcompat.h
diff -r1.25 -r1.26 pkgsrc/pkgtools/libnbcompat/files/nbcompat/config.h.in

cvs diff -r1.70 -r1.71 pkgsrc/pkgtools/libnbcompat/Makefile (expand / switch to context diff)
--- pkgsrc/pkgtools/libnbcompat/Makefile 2009/03/22 22:33:13 1.70
+++ pkgsrc/pkgtools/libnbcompat/Makefile 2009/04/13 11:30:46 1.71
@@ -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

cvs diff -r1.71 -r1.72 pkgsrc/pkgtools/libnbcompat/files/configure (expand / switch to context diff)
--- pkgsrc/pkgtools/libnbcompat/files/configure 2009/03/22 22:33:13 1.71
+++ pkgsrc/pkgtools/libnbcompat/files/configure 2009/04/13 11:30:46 1.72
@@ -6056,25 +6056,60 @@
   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 @@
 	 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

cvs diff -r1.72 -r1.73 pkgsrc/pkgtools/libnbcompat/files/configure.ac (expand / switch to context diff)
--- pkgsrc/pkgtools/libnbcompat/files/configure.ac 2009/03/22 22:33:13 1.72
+++ pkgsrc/pkgtools/libnbcompat/files/configure.ac 2009/04/13 11:30:46 1.73
@@ -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_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

cvs diff -r1.42 -r1.43 pkgsrc/pkgtools/libnbcompat/files/nbcompat.h (expand / switch to context diff)
--- pkgsrc/pkgtools/libnbcompat/files/nbcompat.h 2008/10/19 21:02:07 1.42
+++ pkgsrc/pkgtools/libnbcompat/files/nbcompat.h 2009/04/13 11:30:46 1.43
@@ -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

cvs diff -r1.25 -r1.26 pkgsrc/pkgtools/libnbcompat/files/nbcompat/config.h.in (expand / switch to context diff)
--- pkgsrc/pkgtools/libnbcompat/files/nbcompat/config.h.in 2009/02/09 20:35:22 1.25
+++ pkgsrc/pkgtools/libnbcompat/files/nbcompat/config.h.in 2009/04/13 11:30:46 1.26
@@ -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
 
@@ -368,6 +365,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