pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/pkgsrc-2009Q1]: pkgsrc/pkgtools/libnbcompat Pullup ticket #2736 - req...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/c85c4bee89dc
branches:  pkgsrc-2009Q1
changeset: 556770:c85c4bee89dc
user:      tron <tron%pkgsrc.org@localhost>
date:      Tue Apr 14 21:18:35 2009 +0000

description:
Pullup ticket #2736 - requested by joerg
libnbcompat: portability fix

Revisions pulled up:
- pkgtools/libnbcompat/Makefile                         1.71
- pkgtools/libnbcompat/files/configure                  1.72
- pkgtools/libnbcompat/files/configure.ac               1.73
- pkgtools/libnbcompat/files/getopt_long.c              1.11
- pkgtools/libnbcompat/files/nbcompat.h                 1.43
- pkgtools/libnbcompat/files/nbcompat/config.h.in       1.26
---
Module Name:    pkgsrc
Committed By:   joerg
Date:           Mon Apr 13 11:30:46 UTC 2009

Modified Files:
        pkgsrc/pkgtools/libnbcompat: Makefile
        pkgsrc/pkgtools/libnbcompat/files: configure configure.ac nbcompat.h
        pkgsrc/pkgtools/libnbcompat/files/nbcompat: config.h.in

Log Message:
libnbcompat-20090409:
Resort and improve getopt_long detection. Should fix issues on Interix
reported by mishka@ and QNX problems reported by Sean Boudreau.
---
Module Name:    pkgsrc
Committed By:   joerg
Date:           Tue Apr 14 17:34:42 UTC 2009

Modified Files:
        pkgsrc/pkgtools/libnbcompat/files: getopt_long.c

Log Message:
Always declare optreset.

XXX optreset should be removed here, it can't be used correctly with a
GNU getopt_long implementation without touching the environment.

diffstat:

 pkgtools/libnbcompat/Makefile                   |    4 +-
 pkgtools/libnbcompat/files/configure            |  171 +++++++++++++++--------
 pkgtools/libnbcompat/files/configure.ac         |   15 +-
 pkgtools/libnbcompat/files/getopt_long.c        |   10 +-
 pkgtools/libnbcompat/files/nbcompat.h           |    8 +-
 pkgtools/libnbcompat/files/nbcompat/config.h.in |    6 +-
 6 files changed, 133 insertions(+), 81 deletions(-)

diffs (truncated from 309 to 300 lines):

diff -r d4d956e0a96e -r c85c4bee89dc pkgtools/libnbcompat/Makefile
--- a/pkgtools/libnbcompat/Makefile     Tue Apr 14 21:12:04 2009 +0000
+++ b/pkgtools/libnbcompat/Makefile     Tue Apr 14 21:18:35 2009 +0000
@@ -1,11 +1,11 @@
-# $NetBSD: Makefile,v 1.70 2009/03/22 22:33:13 joerg Exp $
+# $NetBSD: Makefile,v 1.70.2.1 2009/04/14 21:18:35 tron 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 -r d4d956e0a96e -r c85c4bee89dc pkgtools/libnbcompat/files/configure
--- a/pkgtools/libnbcompat/files/configure      Tue Apr 14 21:12:04 2009 +0000
+++ b/pkgtools/libnbcompat/files/configure      Tue Apr 14 21:18:35 2009 +0000
@@ -6056,71 +6056,124 @@
   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
-  $as_echo_n "(cached) " >&6
-else
-
-               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>
-int
-main ()
-{
-  struct option X; ;
-  ;
-  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
-   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
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-
-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
+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>
+
+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>
+
+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
+  :
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       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
+
+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 -r d4d956e0a96e -r c85c4bee89dc pkgtools/libnbcompat/files/configure.ac
--- a/pkgtools/libnbcompat/files/configure.ac   Tue Apr 14 21:12:04 2009 +0000
+++ b/pkgtools/libnbcompat/files/configure.ac   Tue Apr 14 21:18:35 2009 +0000
@@ -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.72.2.1 2009/04/14 21:18:35 tron 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
diff -r d4d956e0a96e -r c85c4bee89dc pkgtools/libnbcompat/files/getopt_long.c
--- a/pkgtools/libnbcompat/files/getopt_long.c  Tue Apr 14 21:12:04 2009 +0000
+++ b/pkgtools/libnbcompat/files/getopt_long.c  Tue Apr 14 21:18:35 2009 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: getopt_long.c,v 1.10 2009/03/22 22:33:13 joerg Exp $   */
+/*     $NetBSD: getopt_long.c,v 1.10.2.1 2009/04/14 21:18:35 tron Exp $        */
 
 /*-
  * Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
 
 #include <nbcompat.h>
 #include <nbcompat/cdefs.h>
-__RCSID("$NetBSD: getopt_long.c,v 1.10 2009/03/22 22:33:13 joerg Exp $");
+__RCSID("$NetBSD: getopt_long.c,v 1.10.2.1 2009/04/14 21:18:35 tron Exp $");
 
 #if 0
 #include "namespace.h"
@@ -66,10 +66,10 @@
 int    opterr = 1;             /* if error message should be printed */
 int    optind = 1;             /* index into parent argv vector */
 int    optopt = '?';           /* character checked for validity */
+char    *optarg;               /* argument associated with option */
+#endif
+#if !HAVE_DECL_OPTRESET
 int    optreset;               /* reset getopt */
-char    *optarg;               /* argument associated with option */
-#elif HAVE_NBTOOL_CONFIG_H && !HAVE_DECL_OPTRESET
-int optreset;
 #endif
 
 #if 0
diff -r d4d956e0a96e -r c85c4bee89dc pkgtools/libnbcompat/files/nbcompat.h
--- a/pkgtools/libnbcompat/files/nbcompat.h     Tue Apr 14 21:12:04 2009 +0000
+++ b/pkgtools/libnbcompat/files/nbcompat.h     Tue Apr 14 21:18:35 2009 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: nbcompat.h,v 1.42 2008/10/19 21:02:07 joerg Exp $      */
+/*     $NetBSD: nbcompat.h,v 1.42.4.1 2009/04/14 21:18:35 tron 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 -r d4d956e0a96e -r c85c4bee89dc pkgtools/libnbcompat/files/nbcompat/config.h.in
--- a/pkgtools/libnbcompat/files/nbcompat/config.h.in   Tue Apr 14 21:12:04 2009 +0000
+++ b/pkgtools/libnbcompat/files/nbcompat/config.h.in   Tue Apr 14 21:18:35 2009 +0000
@@ -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 @@



Home | Main Index | Thread Index | Old Index