diff options
author | jlam <jlam@pkgsrc.org> | 2003-09-06 06:13:46 +0000 |
---|---|---|
committer | jlam <jlam@pkgsrc.org> | 2003-09-06 06:13:46 +0000 |
commit | d722e66da46be7f892e7fd38fbe3b39de9403598 (patch) | |
tree | 19910ed9434856d2f1f58ee4ef35995196b1d993 /pkgtools | |
parent | 6a2c9d8555c16631472688839cdb237c44c85d1b (diff) | |
download | pkgsrc-d722e66da46be7f892e7fd38fbe3b39de9403598.tar.gz |
Ensure that struct option is defined properly before accepting that having
getopt.h implies having getopt_long. Also Fix checks for setmode, pwcache,
and vis so that if any of a list of functions is missing, then use the
nbcompat versions.
Diffstat (limited to 'pkgtools')
-rw-r--r-- | pkgtools/libnbcompat/Makefile | 4 | ||||
-rwxr-xr-x | pkgtools/libnbcompat/files/configure | 572 | ||||
-rw-r--r-- | pkgtools/libnbcompat/files/configure.ac | 55 | ||||
-rw-r--r-- | pkgtools/libnbcompat/files/nbcompat.h | 6 | ||||
-rw-r--r-- | pkgtools/libnbcompat/files/nbcompat/nbconfig.h.in | 6 |
5 files changed, 565 insertions, 78 deletions
diff --git a/pkgtools/libnbcompat/Makefile b/pkgtools/libnbcompat/Makefile index bd4d1b71115..26ef3d9960a 100644 --- a/pkgtools/libnbcompat/Makefile +++ b/pkgtools/libnbcompat/Makefile @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.22 2003/09/06 01:39:29 jlam Exp $ +# $NetBSD: Makefile,v 1.23 2003/09/06 06:13:46 jlam Exp $ # DISTNAME= libnbcompat-20030830 @@ -10,6 +10,8 @@ MAINTAINER= grant@NetBSD.org HOMEPAGE= http://www.NetBSD.org/ COMMENT= Portable NetBSD compatibility library +PKG_INSTALLATION_TYPES= overwrite pkgviews + NO_TOOLS= # defined NO_BUILDLINK= # defined NO_PKGTOOLS_REQD_CHECK= # defined diff --git a/pkgtools/libnbcompat/files/configure b/pkgtools/libnbcompat/files/configure index a5690cb84b5..d1f4256e532 100755 --- a/pkgtools/libnbcompat/files/configure +++ b/pkgtools/libnbcompat/files/configure @@ -3167,9 +3167,8 @@ done - for ac_header in arpa/nameser.h assert.h bind/bitypes.h dirent.h err.h \ - errno.h fcntl.h fts.h getopt.h glob.h inttypes.h libutil.h limits.h \ + errno.h fcntl.h fts.h glob.h inttypes.h libutil.h limits.h \ machine/endian.h memory.h ndir.h netdb.h netinet/in6_machtypes.h \ paths.h poll.h pwd.h stdint.h stdlib.h stringlist.h strings.h \ string.h sys/bitypes.h sys/byteorder.h sys/cdefs.h sys/dir.h \ @@ -3463,19 +3462,231 @@ fi done +pkg_use_nbcompat_getopt_long=yes + +for ac_header in getopt.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 +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. */ +$ac_includes_default +#include <$ac_header> +_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 + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_header_compiler=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 + +# Is the header present? +echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 +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 <$ac_header> +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc in + yes:no ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + ( + cat <<\_ASBOX +## ------------------------------------ ## +## Report this to bug-autoconf@gnu.org. ## +## ------------------------------------ ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; + no:yes ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + ( + cat <<\_ASBOX +## ------------------------------------ ## +## Report this to bug-autoconf@gnu.org. ## +## ------------------------------------ ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + eval "$as_ac_Header=$ac_header_preproc" +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 + +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + + + echo "$as_me:$LINENO: checking for struct option" >&5 +echo $ECHO_N "checking for struct option... $ECHO_C" >&6 +if test "${pkg_cv_have_struct_option+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 <getopt.h> +int +main () +{ + struct option X ; + ; + 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 + pkg_cv_have_struct_option=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + pkg_cv_have_struct_option=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext + +fi +echo "$as_me:$LINENO: result: $pkg_cv_have_struct_option" >&5 +echo "${ECHO_T}$pkg_cv_have_struct_option" >&6 + if test "x$pkg_cv_have_struct_option" = "xyes"; then + pkg_use_nbcompat_getopt_long=no + else + pkg_use_nbcompat_getopt_long=yes + : + fi + + +fi + +done + +if test $pkg_use_nbcompat_getopt_long = yes; then + cat >>confdefs.h <<\_ACEOF +#define HAVE_NBCOMPAT_GETOPT_LONG 1 +_ACEOF + + + + LIBOBJS="$LIBOBJS getopt_long.$ac_objext" +fi + pkg_use_nbcompat_vis=yes -if test "${ac_cv_header_vis_h+set}" = set; then - echo "$as_me:$LINENO: checking for vis.h" >&5 -echo $ECHO_N "checking for vis.h... $ECHO_C" >&6 -if test "${ac_cv_header_vis_h+set}" = set; then + +for ac_header in vis.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi -echo "$as_me:$LINENO: result: $ac_cv_header_vis_h" >&5 -echo "${ECHO_T}$ac_cv_header_vis_h" >&6 +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else # Is the header compilable? -echo "$as_me:$LINENO: checking vis.h usability" >&5 -echo $ECHO_N "checking vis.h usability... $ECHO_C" >&6 +echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ @@ -3484,7 +3695,7 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default -#include <vis.h> +#include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 @@ -3510,8 +3721,8 @@ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? -echo "$as_me:$LINENO: checking vis.h presence" >&5 -echo $ECHO_N "checking vis.h presence... $ECHO_C" >&6 +echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ @@ -3519,7 +3730,7 @@ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include <vis.h> +#include <$ac_header> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 @@ -3552,10 +3763,10 @@ echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc in yes:no ) - { echo "$as_me:$LINENO: WARNING: vis.h: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: vis.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: vis.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: vis.h: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} ( cat <<\_ASBOX ## ------------------------------------ ## @@ -3566,12 +3777,12 @@ _ASBOX sed "s/^/$as_me: WARNING: /" >&2 ;; no:yes ) - { echo "$as_me:$LINENO: WARNING: vis.h: present but cannot be compiled" >&5 -echo "$as_me: WARNING: vis.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: vis.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: vis.h: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: vis.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: vis.h: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} ( cat <<\_ASBOX ## ------------------------------------ ## @@ -3582,18 +3793,21 @@ _ASBOX sed "s/^/$as_me: WARNING: /" >&2 ;; esac -echo "$as_me:$LINENO: checking for vis.h" >&5 -echo $ECHO_N "checking for vis.h... $ECHO_C" >&6 -if test "${ac_cv_header_vis_h+set}" = set; then +echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_cv_header_vis_h=$ac_header_preproc + eval "$as_ac_Header=$ac_header_preproc" fi -echo "$as_me:$LINENO: result: $ac_cv_header_vis_h" >&5 -echo "${ECHO_T}$ac_cv_header_vis_h" >&6 +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 fi -if test $ac_cv_header_vis_h = yes; then +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF echo "$as_me:$LINENO: checking for VIS_WHITE in vis.h" >&5 @@ -3609,10 +3823,8 @@ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ - - #include <sys/types.h> - #include <vis.h> - + #include <sys/types.h> + #include <vis.h> int main () { @@ -3646,22 +3858,16 @@ fi echo "$as_me:$LINENO: result: $pkg_cv_have_vis_white" >&5 echo "${ECHO_T}$pkg_cv_have_vis_white" >&6 if test "x$pkg_cv_have_vis_white" = "xyes"; then - - cat >>confdefs.h <<\_ACEOF -#define HAVE_VIS_H 1 -_ACEOF - - - - - else pkg_use_nbcompat_vis=no + else + pkg_use_nbcompat_vis=yes : fi fi +done @@ -5906,11 +6112,10 @@ done - -for ac_func in err fgetln fparseln fseeko getenv getopt_long glob \ - inet_ntop inet_pton isblank lchflags lchmod lchown lutimes mkstemp \ - mkdtemp poll setenv setprogname snprintf strdup strerror strlcat \ - strlcpy strmode strptime strsep strtoll timegm usleep +for ac_func in err fgetln fparseln fseeko getenv glob inet_ntop \ + inet_pton isblank lchflags lchmod lchown lutimes mkstemp mkdtemp \ + poll setenv setprogname snprintf strdup strerror strlcat strlcpy \ + strmode strptime strsep strtoll timegm usleep do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_func" >&5 @@ -6253,9 +6458,94 @@ 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 + + + +for ac_func in getmode setmode +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 pkg_use_nbcompat_setmode=no else - pkg_use_nbcompat_setmode=yes + pkg_use_nbcompat_setmode=yes; break fi done @@ -6350,14 +6640,104 @@ 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 + + + + + + + +for ac_func in gid_from_group group_from_gid pwcache_groupdb pwcache_userdb \ + uid_from_user user_from_uid +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 pkg_use_nbcompat_pwcache=no else - pkg_use_nbcompat_pwcache=yes + pkg_use_nbcompat_pwcache=yes; break fi done -if test $pkg_use_nbcompat_setmode = yes; then +if test $pkg_use_nbcompat_pwcache = yes; then LIBOBJS="$LIBOBJS pwcache.$ac_objext" fi @@ -6766,9 +7146,95 @@ 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 + + + + +for ac_func in strunvis strvis strsvis +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 pkg_use_nbcompat_vis=no else - pkg_use_nbcompat_vis=yes + pkg_use_nbcompat_vis=yes; break fi done diff --git a/pkgtools/libnbcompat/files/configure.ac b/pkgtools/libnbcompat/files/configure.ac index f6232b486dd..ba85ebab24d 100644 --- a/pkgtools/libnbcompat/files/configure.ac +++ b/pkgtools/libnbcompat/files/configure.ac @@ -31,7 +31,7 @@ AC_HEADER_STDC AC_HEADER_TIME AC_CHECK_HEADERS([arpa/nameser.h assert.h bind/bitypes.h dirent.h err.h \ - errno.h fcntl.h fts.h getopt.h glob.h inttypes.h libutil.h limits.h \ + errno.h fcntl.h fts.h glob.h inttypes.h libutil.h limits.h \ machine/endian.h memory.h ndir.h netdb.h netinet/in6_machtypes.h \ paths.h poll.h pwd.h stdint.h stdlib.h stringlist.h strings.h \ string.h sys/bitypes.h sys/byteorder.h sys/cdefs.h sys/dir.h \ @@ -42,21 +42,32 @@ AC_CHECK_HEADERS([arpa/nameser.h assert.h bind/bitypes.h dirent.h err.h \ AC_CHECK_HEADERS([md5.h rmd160.h sha1.h]) +pkg_use_nbcompat_getopt_long=yes +AC_CHECK_HEADERS([getopt.h], [ + AC_MSG_TRY_COMPILE([for struct option], pkg_cv_have_struct_option, + [ #include <getopt.h> ], [ struct option X ], + [ pkg_use_nbcompat_getopt_long=no ], + [ pkg_use_nbcompat_getopt_long=yes ]) +]) +if test $pkg_use_nbcompat_getopt_long = yes; then + AC_DEFINE(HAVE_NBCOMPAT_GETOPT_LONG) + AH_TEMPLATE([HAVE_NBCOMPAT_GETOPT_LONG], [ + Define to 1 if the `getopt_long' function is built into the + library. + ]) + AC_LIBOBJ(getopt_long) +fi + dnl Check that this vis.h has *vis()-related functions because Solaris' dnl vis.h doesn't. Also, only consider the header found if it defines dnl all of the functions that we need. dnl pkg_use_nbcompat_vis=yes -AC_CHECK_HEADER(vis.h, [ - AC_MSG_TRY_COMPILE([for VIS_WHITE in vis.h], pkg_cv_have_vis_white, [ - #include <sys/types.h> - #include <vis.h> - ], [ int X = VIS_WHITE ], [ - AC_DEFINE(HAVE_VIS_H) - AH_TEMPLATE([HAVE_VIS_H], [ - Define to 1 if you have the <vis.h> header file. - ]) - ], [ pkg_use_nbcompat_vis=no ]) +AC_CHECK_HEADERS([vis.h], [ + AC_MSG_TRY_COMPILE([for VIS_WHITE in vis.h], pkg_cv_have_vis_white, + [ #include <sys/types.h> + #include <vis.h> ], [ int X = VIS_WHITE ], + [ pkg_use_nbcompat_vis=no], [ pkg_use_nbcompat_vis=yes ]) ]) dnl Checks for typedefs, structures, and compiler characteristics. @@ -84,25 +95,30 @@ AC_FUNC_MALLOC AC_FUNC_STRERROR_R AC_FUNC_VPRINTF -AC_REPLACE_FUNCS([err fgetln fparseln fseeko getenv getopt_long glob \ - inet_ntop inet_pton isblank lchflags lchmod lchown lutimes mkstemp \ - mkdtemp poll setenv setprogname snprintf strdup strerror strlcat \ - strlcpy strmode strptime strsep strtoll timegm usleep]) +AC_REPLACE_FUNCS([err fgetln fparseln fseeko getenv glob inet_ntop \ + inet_pton isblank lchflags lchmod lchown lutimes mkstemp mkdtemp \ + poll setenv setprogname snprintf strdup strerror strlcat strlcpy \ + strmode strptime strsep strtoll timegm usleep]) AC_CHECK_FUNCS([setgroupent setgrent setpassent setpwent]) AC_CHECK_FUNCS([bcopy bzero memset memcpy setlocale]) +AC_CHECK_FUNCS([getmode setmode]) AC_CHECK_FUNCS([getmode setmode], - [pkg_use_nbcompat_setmode=no], [pkg_use_nbcompat_setmode=yes]) + [pkg_use_nbcompat_setmode=no], + [pkg_use_nbcompat_setmode=yes; break]) if test $pkg_use_nbcompat_setmode = yes; then AC_LIBOBJ(setmode) fi AC_CHECK_FUNCS([gid_from_group group_from_gid pwcache_groupdb pwcache_userdb \ + uid_from_user user_from_uid]) +AC_CHECK_FUNCS([gid_from_group group_from_gid pwcache_groupdb pwcache_userdb \ uid_from_user user_from_uid], - [pkg_use_nbcompat_pwcache=no], [pkg_use_nbcompat_pwcache=yes]) + [pkg_use_nbcompat_pwcache=no], + [pkg_use_nbcompat_pwcache=yes; break]) -if test $pkg_use_nbcompat_setmode = yes; then +if test $pkg_use_nbcompat_pwcache = yes; then AC_LIBOBJ(pwcache) fi @@ -121,9 +137,10 @@ AC_CHECK_FUNC(SHA1File, [:], [ AC_LIBOBJ(sha1hl) ]) +AC_CHECK_FUNCS([strunvis strvis strsvis]) AC_CHECK_FUNCS([strunvis strvis strsvis], [pkg_use_nbcompat_vis=no], - [pkg_use_nbcompat_vis=yes]) + [pkg_use_nbcompat_vis=yes; break]) if test $pkg_use_nbcompat_vis = yes; then AC_DEFINE(HAVE_NBCOMPAT_VIS) diff --git a/pkgtools/libnbcompat/files/nbcompat.h b/pkgtools/libnbcompat/files/nbcompat.h index d810fc8e62a..5ecd9fee8b0 100644 --- a/pkgtools/libnbcompat/files/nbcompat.h +++ b/pkgtools/libnbcompat/files/nbcompat.h @@ -1,4 +1,4 @@ -/* $NetBSD: nbcompat.h,v 1.16 2003/09/06 01:35:08 jlam Exp $ */ +/* $NetBSD: nbcompat.h,v 1.17 2003/09/06 06:13:48 jlam Exp $ */ /*- * Copyright (c) 2003 The NetBSD Foundation, Inc. @@ -352,7 +352,9 @@ void tputs(const char *, int, int (*)(int)); #if HAVE_GETOPT_H # include <getopt.h> -#else +#endif + +#if HAVE_NBCOMPAT_GETOPT_LONG # include <nbcompat/getopt.h> #endif diff --git a/pkgtools/libnbcompat/files/nbcompat/nbconfig.h.in b/pkgtools/libnbcompat/files/nbcompat/nbconfig.h.in index 689f81bfb97..aa0dc8fa207 100644 --- a/pkgtools/libnbcompat/files/nbcompat/nbconfig.h.in +++ b/pkgtools/libnbcompat/files/nbcompat/nbconfig.h.in @@ -61,9 +61,6 @@ /* Define to 1 if you have the <getopt.h> header file. */ #undef HAVE_GETOPT_H -/* 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 @@ -158,6 +155,9 @@ /* Define to 1 if you have the `mkstemp' function. */ #undef HAVE_MKSTEMP +/* Define to 1 if the `getopt_long' function is built into the library. */ +#undef HAVE_NBCOMPAT_GETOPT_LONG + /* Define to 1 if the `statfs' function is built into the library. */ #undef HAVE_NBCOMPAT_STATFS |