diff options
author | grant <grant@pkgsrc.org> | 2003-07-15 05:33:04 +0000 |
---|---|---|
committer | grant <grant@pkgsrc.org> | 2003-07-15 05:33:04 +0000 |
commit | 8c13cfdcce6d49832fa1b1f87e01dc85cd9973d0 (patch) | |
tree | 2c2cb7127d3d4947a857ada1410526cebd38b17f /pkgtools | |
parent | d6973cf4416343e0ac24ba1a1af0af5a4ede2315 (diff) | |
download | pkgsrc-8c13cfdcce6d49832fa1b1f87e01dc85cd9973d0.tar.gz |
fix getopt_long() test to avoid overriding it.
Diffstat (limited to 'pkgtools')
-rw-r--r-- | pkgtools/libnbcompat/files/acconfig.h | 7 | ||||
-rw-r--r-- | pkgtools/libnbcompat/files/config.h.in | 10 | ||||
-rwxr-xr-x | pkgtools/libnbcompat/files/configure | 222 | ||||
-rw-r--r-- | pkgtools/libnbcompat/files/configure.ac | 11 | ||||
-rw-r--r-- | pkgtools/libnbcompat/files/getopt_long.c | 6 |
5 files changed, 241 insertions, 15 deletions
diff --git a/pkgtools/libnbcompat/files/acconfig.h b/pkgtools/libnbcompat/files/acconfig.h index 7adfd66a3e9..8259d71926c 100644 --- a/pkgtools/libnbcompat/files/acconfig.h +++ b/pkgtools/libnbcompat/files/acconfig.h @@ -1,4 +1,4 @@ -/* $Id: acconfig.h,v 1.1.1.1 2003/03/31 05:02:22 grant Exp $ */ +/* $Id: acconfig.h,v 1.2 2003/07/15 05:33:04 grant Exp $ */ /* Define if *printf() uses %qd to print `long long' (otherwise uses %lld) */ #undef HAVE_PRINTF_QD @@ -6,3 +6,8 @@ /* Define if `long long' is supported and sizeof(off_t) >= 8 */ #undef HAVE_QUAD_SUPPORT +/* Define if optarg is declared in <stdlib.h> or <unistd.h> */ +#undef HAVE_OPTARG_D + +/* Define if optind is declared in <stdlib.h> or <unistd.h> */ +#undef HAVE_OPTIND_D diff --git a/pkgtools/libnbcompat/files/config.h.in b/pkgtools/libnbcompat/files/config.h.in index 1e04e43d93d..12c7fa1dd25 100644 --- a/pkgtools/libnbcompat/files/config.h.in +++ b/pkgtools/libnbcompat/files/config.h.in @@ -1,5 +1,5 @@ /* config.h.in. Generated from configure.ac by autoheader. */ -/* $Id: config.h.in,v 1.6 2003/06/23 11:33:08 grant Exp $ */ +/* $Id: config.h.in,v 1.7 2003/07/15 05:33:04 grant Exp $ */ /* Define if *printf() uses %qd to print `long long' (otherwise uses %lld) */ #undef HAVE_PRINTF_QD @@ -7,6 +7,11 @@ /* Define if `long long' is supported and sizeof(off_t) >= 8 */ #undef HAVE_QUAD_SUPPORT +/* Define if optarg is declared in <stdlib.h> or <unistd.h> */ +#undef HAVE_OPTARG_D + +/* Define if optind is declared in <stdlib.h> or <unistd.h> */ +#undef HAVE_OPTIND_D /* Define to 1 if the `getpgrp' function requires zero arguments. */ #undef GETPGRP_VOID @@ -66,6 +71,9 @@ /* Define to 1 if you have the `getmode' function. */ #undef HAVE_GETMODE +/* Define to 1 if you have the `getopt_long' function. */ +#undef HAVE_GETOPT_LONG + /* Define to 1 if you have the `getpassphrase' function. */ #undef HAVE_GETPASSPHRASE diff --git a/pkgtools/libnbcompat/files/configure b/pkgtools/libnbcompat/files/configure index 273c3714262..dfe41bd2748 100755 --- a/pkgtools/libnbcompat/files/configure +++ b/pkgtools/libnbcompat/files/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.57 for libnbcompat 20030622. +# Generated by GNU Autoconf 2.57 for libnbcompat 20030715. # # Report bugs to <grant@NetBSD.org>. # @@ -268,8 +268,8 @@ SHELL=${CONFIG_SHELL-/bin/sh} # Identity of this package. PACKAGE_NAME='libnbcompat' PACKAGE_TARNAME='libnbcompat' -PACKAGE_VERSION='20030622' -PACKAGE_STRING='libnbcompat 20030622' +PACKAGE_VERSION='20030715' +PACKAGE_STRING='libnbcompat 20030715' PACKAGE_BUGREPORT='grant@NetBSD.org' ac_unique_file="bits.c" @@ -779,7 +779,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures libnbcompat 20030622 to adapt to many kinds of systems. +\`configure' configures libnbcompat 20030715 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -845,7 +845,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of libnbcompat 20030622:";; + short | recursive ) echo "Configuration of libnbcompat 20030715:";; esac cat <<\_ACEOF @@ -924,7 +924,7 @@ fi test -n "$ac_init_help" && exit 0 if $ac_init_version; then cat <<\_ACEOF -libnbcompat configure 20030622 +libnbcompat configure 20030715 generated by GNU Autoconf 2.57 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002 @@ -939,7 +939,7 @@ cat >&5 <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by libnbcompat $as_me 20030622, which was +It was created by libnbcompat $as_me 20030715, which was generated by GNU Autoconf 2.57. Invocation command line was $ $0 $@ @@ -6522,6 +6522,90 @@ fi done +for ac_func in getopt_long +do +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 +if eval "test \"\${$as_ac_var+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. + Prefer <limits.h> to <assert.h> if __STDC__ is defined, since + <limits.h> exists even on freestanding compilers. */ +#ifdef __STDC__ +# include <limits.h> +#else +# include <assert.h> +#endif +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +{ +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +choke me +#else +char (*f) () = $ac_func; +#endif +#ifdef __cplusplus +} +#endif + +int +main () +{ +return f != $ac_func; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$as_ac_var=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +eval "$as_ac_var=no" +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + + if test $ac_cv_func_getpgrp = yes; then echo "$as_me:$LINENO: checking whether getpgrp requires zero arguments" >&5 echo $ECHO_N "checking whether getpgrp requires zero arguments... $ECHO_C" >&6 @@ -6994,6 +7078,126 @@ echo "${ECHO_T}$pkg_cv_have_vis_white" >&6 fi + echo "$as_me:$LINENO: checking for optarg declaration" >&5 +echo $ECHO_N "checking for optarg declaration... $ECHO_C" >&6 +if test "${ftp_cv_HAVE_OPTARG_D+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#include <stdlib.h> +#include <unistd.h> +int +main () +{ + char *X = optarg ; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ftp_cv_HAVE_OPTARG_D=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ftp_cv_HAVE_OPTARG_D=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext + +fi +echo "$as_me:$LINENO: result: $ftp_cv_HAVE_OPTARG_D" >&5 +echo "${ECHO_T}$ftp_cv_HAVE_OPTARG_D" >&6 + if test "x$ftp_cv_HAVE_OPTARG_D" = "xyes"; then + : + else + cat >>confdefs.h <<\_ACEOF +#define HAVE_OPTARG_D 1 +_ACEOF + + : + fi + + + + echo "$as_me:$LINENO: checking for optind declaration" >&5 +echo $ECHO_N "checking for optind declaration... $ECHO_C" >&6 +if test "${ftp_cv_HAVE_OPTIND_D+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#include <stdlib.h> +#include <unistd.h> +int +main () +{ + int X = optind ; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ftp_cv_HAVE_OPTIND_D=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ftp_cv_HAVE_OPTIND_D=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext + +fi +echo "$as_me:$LINENO: result: $ftp_cv_HAVE_OPTIND_D" >&5 +echo "${ECHO_T}$ftp_cv_HAVE_OPTIND_D" >&6 + if test "x$ftp_cv_HAVE_OPTIND_D" = "xyes"; then + : cat >>confdefs.h <<\_ACEOF +#define HAVE_OPTIND_D 1 +_ACEOF + + else + + : + fi + + + ac_config_files="$ac_config_files Makefile" @@ -7358,7 +7562,7 @@ _ASBOX } >&5 cat >&5 <<_CSEOF -This file was extended by libnbcompat $as_me 20030622, which was +This file was extended by libnbcompat $as_me 20030715, which was generated by GNU Autoconf 2.57. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -7418,7 +7622,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ -libnbcompat config.status 20030622 +libnbcompat config.status 20030715 configured by $0, generated by GNU Autoconf 2.57, with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" diff --git a/pkgtools/libnbcompat/files/configure.ac b/pkgtools/libnbcompat/files/configure.ac index 4dc68d53be2..a88f7870085 100644 --- a/pkgtools/libnbcompat/files/configure.ac +++ b/pkgtools/libnbcompat/files/configure.ac @@ -1,6 +1,6 @@ dnl Process this file with autoconf to produce a configure script. AC_PREREQ(2.52) -AC_INIT([libnbcompat], [20030622], [grant@NetBSD.org]) +AC_INIT([libnbcompat], [20030715], [grant@NetBSD.org]) AC_CONFIG_SRCDIR([bits.c]) AC_CONFIG_HEADER(config.h) AC_ARG_PROGRAM @@ -84,6 +84,7 @@ AC_CHECK_FUNCS([gid_from_group group_from_gid pwcache_groupdb pwcache_userdb \ AC_CHECK_FUNCS([strunvis strvis strsvis]) AC_CHECK_FUNCS([getpassphrase getpgrp memmove poll select]) +AC_CHECK_FUNCS([getopt_long]) if test $ac_cv_func_getpgrp = yes; then AC_FUNC_GETPGRP @@ -153,6 +154,14 @@ if test $ac_cv_header_vis_h = yes; then ac_cv_header_vis_h=no ) fi +AC_MSG_TRY_COMPILE(for optarg declaration, ftp_cv_HAVE_OPTARG_D, [ +#include <stdlib.h> +#include <unistd.h> ], [ char *X = optarg ], [:], [AC_DEFINE(HAVE_OPTARG_D, 1)]) + +AC_MSG_TRY_COMPILE(for optind declaration, ftp_cv_HAVE_OPTIND_D, [ +#include <stdlib.h> +#include <unistd.h> ], [ int X = optind ], [:] [AC_DEFINE(HAVE_OPTIND_D, 1)]) + AH_BOTTOM([ #ifndef HAVE___ATTRIBUTE__ diff --git a/pkgtools/libnbcompat/files/getopt_long.c b/pkgtools/libnbcompat/files/getopt_long.c index a26d680d839..cd0f4c2ea4b 100644 --- a/pkgtools/libnbcompat/files/getopt_long.c +++ b/pkgtools/libnbcompat/files/getopt_long.c @@ -1,4 +1,4 @@ -/* $NetBSD: getopt_long.c,v 1.1 2003/06/23 11:33:11 grant Exp $ */ +/* $NetBSD: getopt_long.c,v 1.2 2003/07/15 05:33:05 grant Exp $ */ /*- * Copyright (c) 2000 The NetBSD Foundation, Inc. @@ -41,7 +41,7 @@ #endif #if defined(LIBC_SCCS) && !defined(lint) -__RCSID("$NetBSD: getopt_long.c,v 1.1 2003/06/23 11:33:11 grant Exp $"); +__RCSID("$NetBSD: getopt_long.c,v 1.2 2003/07/15 05:33:05 grant Exp $"); #endif /* LIBC_SCCS and not lint */ /* #include "namespace.h" */ @@ -61,7 +61,7 @@ __RCSID("$NetBSD: getopt_long.c,v 1.1 2003/06/23 11:33:11 grant Exp $"); #define _DIAGASSERT(cond) assert(cond) #endif -#if HAVE_CONFIG_H && !HAVE_GETOPT_LONG && !HAVE_DECL_OPTIND +#if HAVE_CONFIG_H && !HAVE_GETOPT_LONG && !HAVE_OPTIND_D #define REPLACE_GETOPT #endif |