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 unified 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,21 +1,21 @@ @@ -1,21 +1,21 @@
1# $NetBSD: Makefile,v 1.70 2009/03/22 22:33:13 joerg Exp $ 1# $NetBSD: Makefile,v 1.71 2009/04/13 11:30:46 joerg Exp $
2# 2#
3# NOTE: If you update this package, it is *mandatory* that you update 3# NOTE: If you update this package, it is *mandatory* that you update
4# pkgsrc/pkgtools/libnbcompat/files/README to reflect the actual 4# pkgsrc/pkgtools/libnbcompat/files/README to reflect the actual
5# list of tested and supported platforms. 5# list of tested and supported platforms.
6# 6#
7 7
8DISTNAME= libnbcompat-20090322 8DISTNAME= libnbcompat-20090413
9CATEGORIES= pkgtools devel 9CATEGORIES= pkgtools devel
10MASTER_SITES= # empty 10MASTER_SITES= # empty
11DISTFILES= # empty 11DISTFILES= # empty
12 12
13MAINTAINER= grant@NetBSD.org 13MAINTAINER= grant@NetBSD.org
14HOMEPAGE= http://www.NetBSD.org/ 14HOMEPAGE= http://www.NetBSD.org/
15COMMENT= Portable NetBSD compatibility library 15COMMENT= Portable NetBSD compatibility library
16 16
17PKG_DESTDIR_SUPPORT= user-destdir 17PKG_DESTDIR_SUPPORT= user-destdir
18 18
19GNU_CONFIGURE= yes 19GNU_CONFIGURE= yes
20MAKE_ENV+= LIBMODE=${LIBMODE} 20MAKE_ENV+= LIBMODE=${LIBMODE}
21 21

cvs diff -r1.71 -r1.72 pkgsrc/pkgtools/libnbcompat/files/configure (expand / switch to unified 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
@@ -6046,91 +6046,144 @@ else @@ -6046,91 +6046,144 @@ else
6046fi 6046fi
6047ac_res=`eval 'as_val=${'$as_ac_Header'} 6047ac_res=`eval 'as_val=${'$as_ac_Header'}
6048 $as_echo "$as_val"'` 6048 $as_echo "$as_val"'`
6049 { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 6049 { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
6050$as_echo "$ac_res" >&6; } 6050$as_echo "$ac_res" >&6; }
6051 6051
6052fi 6052fi
6053as_val=`eval 'as_val=${'$as_ac_Header'} 6053as_val=`eval 'as_val=${'$as_ac_Header'}
6054 $as_echo "$as_val"'` 6054 $as_echo "$as_val"'`
6055 if test "x$as_val" = x""yes; then 6055 if test "x$as_val" = x""yes; then
6056 cat >>confdefs.h <<_ACEOF 6056 cat >>confdefs.h <<_ACEOF
6057#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 6057#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
6058_ACEOF 6058_ACEOF
6059 6059 { $as_echo "$as_me:$LINENO: checking for struct option" >&5
6060 
6061 { $as_echo "$as_me:$LINENO: checking for struct option" >&5 
6062$as_echo_n "checking for struct option... " >&6; } 6060$as_echo_n "checking for struct option... " >&6; }
6063if test "${pkg_cv_have_struct_option+set}" = set; then 6061if test "${ac_cv_type_struct_option+set}" = set; then
6064 $as_echo_n "(cached) " >&6 6062 $as_echo_n "(cached) " >&6
6065else 6063else
 6064 ac_cv_type_struct_option=no
 6065cat >conftest.$ac_ext <<_ACEOF
 6066/* confdefs.h. */
 6067_ACEOF
 6068cat confdefs.h >>conftest.$ac_ext
 6069cat >>conftest.$ac_ext <<_ACEOF
 6070/* end confdefs.h. */
 6071#include <getopt.h>
6066 6072
6067 cat >conftest.$ac_ext <<_ACEOF 6073int
 6074main ()
 6075{
 6076if (sizeof (struct option))
 6077 return 0;
 6078 ;
 6079 return 0;
 6080}
 6081_ACEOF
 6082rm -f conftest.$ac_objext
 6083if { (ac_try="$ac_compile"
 6084case "(($ac_try" in
 6085 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
 6086 *) ac_try_echo=$ac_try;;
 6087esac
 6088eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
 6089$as_echo "$ac_try_echo") >&5
 6090 (eval "$ac_compile") 2>conftest.er1
 6091 ac_status=$?
 6092 grep -v '^ *+' conftest.er1 >conftest.err
 6093 rm -f conftest.er1
 6094 cat conftest.err >&5
 6095 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
 6096 (exit $ac_status); } && {
 6097 test -z "$ac_c_werror_flag" ||
 6098 test ! -s conftest.err
 6099 } && test -s conftest.$ac_objext; then
 6100 cat >conftest.$ac_ext <<_ACEOF
6068/* confdefs.h. */ 6101/* confdefs.h. */
6069_ACEOF 6102_ACEOF
6070cat confdefs.h >>conftest.$ac_ext 6103cat confdefs.h >>conftest.$ac_ext
6071cat >>conftest.$ac_ext <<_ACEOF 6104cat >>conftest.$ac_ext <<_ACEOF
6072/* end confdefs.h. */ 6105/* end confdefs.h. */
6073 #include <getopt.h> 6106#include <getopt.h>
 6107
6074int 6108int
6075main () 6109main ()
6076{ 6110{
6077 struct option X; ; 6111if (sizeof ((struct option)))
 6112 return 0;
6078 ; 6113 ;
6079 return 0; 6114 return 0;
6080} 6115}
6081_ACEOF 6116_ACEOF
6082rm -f conftest.$ac_objext 6117rm -f conftest.$ac_objext
6083if { (ac_try="$ac_compile" 6118if { (ac_try="$ac_compile"
6084case "(($ac_try" in 6119case "(($ac_try" in
6085 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; 6120 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
6086 *) ac_try_echo=$ac_try;; 6121 *) ac_try_echo=$ac_try;;
6087esac 6122esac
6088eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" 6123eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
6089$as_echo "$ac_try_echo") >&5 6124$as_echo "$ac_try_echo") >&5
6090 (eval "$ac_compile") 2>conftest.er1 6125 (eval "$ac_compile") 2>conftest.er1
6091 ac_status=$? 6126 ac_status=$?
6092 grep -v '^ *+' conftest.er1 >conftest.err 6127 grep -v '^ *+' conftest.er1 >conftest.err
6093 rm -f conftest.er1 6128 rm -f conftest.er1
6094 cat conftest.err >&5 6129 cat conftest.err >&5
6095 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 6130 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
6096 (exit $ac_status); } && { 6131 (exit $ac_status); } && {
6097 test -z "$ac_c_werror_flag" || 6132 test -z "$ac_c_werror_flag" ||
6098 test ! -s conftest.err 6133 test ! -s conftest.err
6099 } && test -s conftest.$ac_objext; then 6134 } && test -s conftest.$ac_objext; then
6100 pkg_cv_have_struct_option=yes 6135 :
6101else 6136else
6102 $as_echo "$as_me: failed program was:" >&5 6137 $as_echo "$as_me: failed program was:" >&5
6103sed 's/^/| /' conftest.$ac_ext >&5 6138sed 's/^/| /' conftest.$ac_ext >&5
6104 6139
6105 pkg_cv_have_struct_option=no 6140 ac_cv_type_struct_option=yes
6106fi 6141fi
6107 6142
6108rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext 6143rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 6144else
 6145 $as_echo "$as_me: failed program was:" >&5
 6146sed 's/^/| /' conftest.$ac_ext >&5
 6147
6109 6148
6110fi 6149fi
6111{ $as_echo "$as_me:$LINENO: result: $pkg_cv_have_struct_option" >&5 6150
6112$as_echo "$pkg_cv_have_struct_option" >&6; } 6151rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
6113 if test "x$pkg_cv_have_struct_option" = "xyes"; then 6152fi
6114 : 6153{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_struct_option" >&5
6115 else 6154$as_echo "$ac_cv_type_struct_option" >&6; }
6116 case " $LIBOBJS " in 6155if test "x$ac_cv_type_struct_option" = x""yes; then
 6156
 6157cat >>confdefs.h <<_ACEOF
 6158#define HAVE_STRUCT_OPTION 1
 6159_ACEOF
 6160
 6161:
 6162else
 6163 case " $LIBOBJS " in
6117 *" getopt_long.$ac_objext "* ) ;; 6164 *" getopt_long.$ac_objext "* ) ;;
6118 *) LIBOBJS="$LIBOBJS getopt_long.$ac_objext" 6165 *) LIBOBJS="$LIBOBJS getopt_long.$ac_objext"
6119 ;; 6166 ;;
6120esac 6167esac
6121 6168
6122 : 6169fi
6123 fi 6170
 6171else
 6172 case " $LIBOBJS " in
 6173 *" getopt_long.$ac_objext "* ) ;;
 6174 *) LIBOBJS="$LIBOBJS getopt_long.$ac_objext"
 6175 ;;
 6176esac
6124 6177
6125 6178
6126fi 6179fi
6127 6180
6128done 6181done
6129 6182
6130 6183
6131if test "$enable_bsd_getopt" = yes; then 6184if test "$enable_bsd_getopt" = yes; then
6132 if test "$ac_cv_have_decl_optreset" = no; then 6185 if test "$ac_cv_have_decl_optreset" = no; then
6133 case " $LIBOBJS " in 6186 case " $LIBOBJS " in
6134 *" getopt.$ac_objext "* ) ;; 6187 *" getopt.$ac_objext "* ) ;;
6135 *) LIBOBJS="$LIBOBJS getopt.$ac_objext" 6188 *) LIBOBJS="$LIBOBJS getopt.$ac_objext"
6136 ;; 6189 ;;

cvs diff -r1.72 -r1.73 pkgsrc/pkgtools/libnbcompat/files/configure.ac (expand / switch to unified 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,14 +1,14 @@ @@ -1,14 +1,14 @@
1dnl $NetBSD: configure.ac,v 1.72 2009/03/22 22:33:13 joerg Exp $ 1dnl $NetBSD: configure.ac,v 1.73 2009/04/13 11:30:46 joerg Exp $
2 2
3dnl Process this file with autoconf to produce a configure script. 3dnl Process this file with autoconf to produce a configure script.
4AC_PREREQ(2.52) 4AC_PREREQ(2.52)
5AC_INIT([libnbcompat], [20080519], [grant@NetBSD.org]) 5AC_INIT([libnbcompat], [20080519], [grant@NetBSD.org])
6AC_CONFIG_HEADER(nbcompat/config.h) 6AC_CONFIG_HEADER(nbcompat/config.h)
7AC_ARG_PROGRAM 7AC_ARG_PROGRAM
8 8
9AC_CANONICAL_HOST 9AC_CANONICAL_HOST
10CANONICAL_HOST=$host 10CANONICAL_HOST=$host
11AC_SUBST(CANONICAL_HOST) 11AC_SUBST(CANONICAL_HOST)
12AC_SUBST(INCLUDES) 12AC_SUBST(INCLUDES)
13 13
14# Checks for programs. 14# Checks for programs.
@@ -138,32 +138,33 @@ AC_SUBST(WITH_DB, $enable_db) @@ -138,32 +138,33 @@ AC_SUBST(WITH_DB, $enable_db)
138AC_CHECK_FUNCS(issetugid) 138AC_CHECK_FUNCS(issetugid)
139 139
140AC_ARG_ENABLE([bsd-getopt], 140AC_ARG_ENABLE([bsd-getopt],
141 [AS_HELP_STRING([--enable-bsd-getopt], 141 [AS_HELP_STRING([--enable-bsd-getopt],
142 [force use of BSDish getopt implementation])]) 142 [force use of BSDish getopt implementation])])
143 143
144AC_CHECK_DECLS([optind, optreset], [:], [:], [ 144AC_CHECK_DECLS([optind, optreset], [:], [:], [
145 #include <stdio.h> 145 #include <stdio.h>
146 #include <stdlib.h> 146 #include <stdlib.h>
147 #include <unistd.h> 147 #include <unistd.h>
148]) 148])
149 149
150 150
151AC_CHECK_HEADERS([getopt.h], [ 151AC_CHECK_HEADERS([getopt.h],
152 AC_MSG_TRY_COMPILE([for struct option], pkg_cv_have_struct_option, 152 [ AC_CHECK_TYPES([struct option],
153 [ #include <getopt.h> ], [ struct option X; ], 153 [:],
154 [:], 154 [ AC_LIBOBJ(getopt_long)],
155 [AC_LIBOBJ(getopt_long)]) 155 [#include <getopt.h>])],
156]) 156 [ AC_LIBOBJ(getopt_long)]
 157)
157 158
158if test "$enable_bsd_getopt" = yes; then 159if test "$enable_bsd_getopt" = yes; then
159 if test "$ac_cv_have_decl_optreset" = no; then 160 if test "$ac_cv_have_decl_optreset" = no; then
160 AC_LIBOBJ(getopt) 161 AC_LIBOBJ(getopt)
161 fi 162 fi
162fi 163fi
163 164
164dnl Check that this vis.h has *vis()-related functions because Solaris' 165dnl Check that this vis.h has *vis()-related functions because Solaris'
165dnl vis.h doesn't. Also, only consider the header found if it defines 166dnl vis.h doesn't. Also, only consider the header found if it defines
166dnl all of the functions that we need. 167dnl all of the functions that we need.
167dnl 168dnl
168pkg_use_nbcompat_vis=yes 169pkg_use_nbcompat_vis=yes
169AC_CHECK_HEADERS([vis.h], [ 170AC_CHECK_HEADERS([vis.h], [

cvs diff -r1.42 -r1.43 pkgsrc/pkgtools/libnbcompat/files/nbcompat.h (expand / switch to unified 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,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: nbcompat.h,v 1.42 2008/10/19 21:02:07 joerg Exp $ */ 1/* $NetBSD: nbcompat.h,v 1.43 2009/04/13 11:30:46 joerg Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 2003 The NetBSD Foundation, Inc. 4 * Copyright (c) 2003 The NetBSD Foundation, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * Redistribution and use in source and binary forms, with or without 7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions 8 * modification, are permitted provided that the following conditions
9 * are met: 9 * are met:
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer. 11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright 12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the 13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution. 14 * documentation and/or other materials provided with the distribution.
@@ -118,19 +118,17 @@ @@ -118,19 +118,17 @@
118#if HAVE_NBCOMPAT_SHA1 118#if HAVE_NBCOMPAT_SHA1
119# if HAVE_SHA1_H 119# if HAVE_SHA1_H
120# undef HAVE_SHA1_H 120# undef HAVE_SHA1_H
121# endif 121# endif
122#endif 122#endif
123 123
124#if HAVE_NBCOMPAT_VIS 124#if HAVE_NBCOMPAT_VIS
125# if HAVE_VIS_H 125# if HAVE_VIS_H
126# undef HAVE_VIS_H 126# undef HAVE_VIS_H
127# endif 127# endif
128# include <nbcompat/vis.h> 128# include <nbcompat/vis.h>
129#endif 129#endif
130 130
131#if HAVE_NBCOMPAT_GETOPT_LONG 131#if !HAVE_GETOPT_H || !HAVE_STRUCT_OPTION
132# if HAVE_GETOPT_H 132# undef HAVE_GETOPT_H
133# undef HAVE_GETOPT_H 
134# endif 
135# include <nbcompat/getopt.h> 133# include <nbcompat/getopt.h>
136#endif 134#endif

cvs diff -r1.25 -r1.26 pkgsrc/pkgtools/libnbcompat/files/nbcompat/config.h.in (expand / switch to unified 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
@@ -196,29 +196,26 @@ @@ -196,29 +196,26 @@
196 196
197/* Define to 1 if you have the `memset' function. */ 197/* Define to 1 if you have the `memset' function. */
198#undef HAVE_MEMSET 198#undef HAVE_MEMSET
199 199
200/* Define to 1 if you have the `mkdtemp' function. */ 200/* Define to 1 if you have the `mkdtemp' function. */
201#undef HAVE_MKDTEMP 201#undef HAVE_MKDTEMP
202 202
203/* Define to 1 if you have the `mkstemp' function. */ 203/* Define to 1 if you have the `mkstemp' function. */
204#undef HAVE_MKSTEMP 204#undef HAVE_MKSTEMP
205 205
206/* Define to 1 if the `fts_*' functions are built into the library. */ 206/* Define to 1 if the `fts_*' functions are built into the library. */
207#undef HAVE_NBCOMPAT_FTS 207#undef HAVE_NBCOMPAT_FTS
208 208
209/* Define to 1 if the `getopt_long' function is built into the library. */ 
210#undef HAVE_NBCOMPAT_GETOPT_LONG 
211 
212/* Define to 1 if the `glob' function is built into the library. */ 209/* Define to 1 if the `glob' function is built into the library. */
213#undef HAVE_NBCOMPAT_GLOB 210#undef HAVE_NBCOMPAT_GLOB
214 211
215/* Define to 1 if the `MD5*' functions are built into the library. */ 212/* Define to 1 if the `MD5*' functions are built into the library. */
216#undef HAVE_NBCOMPAT_MD5 213#undef HAVE_NBCOMPAT_MD5
217 214
218/* Define to 1 if the `MD5Init' function is built into the library. */ 215/* Define to 1 if the `MD5Init' function is built into the library. */
219#undef HAVE_NBCOMPAT_MD5INIT 216#undef HAVE_NBCOMPAT_MD5INIT
220 217
221/* Define to 1 if the `poll' function is built into the library. */ 218/* Define to 1 if the `poll' function is built into the library. */
222#undef HAVE_NBCOMPAT_POLL 219#undef HAVE_NBCOMPAT_POLL
223 220
224/* Define to 1 if the `queue' macros are supplied by the library. */ 221/* Define to 1 if the `queue' macros are supplied by the library. */
@@ -359,26 +356,29 @@ @@ -359,26 +356,29 @@
359 356
360/* Define to 1 if you have the `strtoll' function. */ 357/* Define to 1 if you have the `strtoll' function. */
361#undef HAVE_STRTOLL 358#undef HAVE_STRTOLL
362 359
363/* Define to 1 if the system has the type `struct addrinfo'. */ 360/* Define to 1 if the system has the type `struct addrinfo'. */
364#undef HAVE_STRUCT_ADDRINFO 361#undef HAVE_STRUCT_ADDRINFO
365 362
366/* Define to 1 if `d_namlen' is member of `struct dirent'. */ 363/* Define to 1 if `d_namlen' is member of `struct dirent'. */
367#undef HAVE_STRUCT_DIRENT_D_NAMLEN 364#undef HAVE_STRUCT_DIRENT_D_NAMLEN
368 365
369/* Define to 1 if the system has the type `struct in6_addr'. */ 366/* Define to 1 if the system has the type `struct in6_addr'. */
370#undef HAVE_STRUCT_IN6_ADDR 367#undef HAVE_STRUCT_IN6_ADDR
371 368
 369/* Define to 1 if the system has the type `struct option'. */
 370#undef HAVE_STRUCT_OPTION
 371
372/* Define to 1 if the system has the type `struct sockaddr_in6'. */ 372/* Define to 1 if the system has the type `struct sockaddr_in6'. */
373#undef HAVE_STRUCT_SOCKADDR_IN6 373#undef HAVE_STRUCT_SOCKADDR_IN6
374 374
375/* Define to 1 if the system has the type `struct sockaddr_storage'. */ 375/* Define to 1 if the system has the type `struct sockaddr_storage'. */
376#undef HAVE_STRUCT_SOCKADDR_STORAGE 376#undef HAVE_STRUCT_SOCKADDR_STORAGE
377 377
378/* Define to 1 if `f_flags' is member of `struct statfs'. */ 378/* Define to 1 if `f_flags' is member of `struct statfs'. */
379#undef HAVE_STRUCT_STATFS_F_FLAGS 379#undef HAVE_STRUCT_STATFS_F_FLAGS
380 380
381/* Define to 1 if `f_fsize' is member of `struct statfs'. */ 381/* Define to 1 if `f_fsize' is member of `struct statfs'. */
382#undef HAVE_STRUCT_STATFS_F_FSIZE 382#undef HAVE_STRUCT_STATFS_F_FSIZE
383 383
384/* Define to 1 if `f_iosize' is member of `struct statfs'. */ 384/* Define to 1 if `f_iosize' is member of `struct statfs'. */