diff options
author | grant <grant@pkgsrc.org> | 2003-03-31 05:34:35 +0000 |
---|---|---|
committer | grant <grant@pkgsrc.org> | 2003-03-31 05:34:35 +0000 |
commit | a17d644a294e8fc61374e42ab0ae009b305666cd (patch) | |
tree | e94983d5f9002fc45a1813139f6fb46a234308bb | |
parent | 9b2e1cde617ca95bc369459526472393becfdf6a (diff) | |
download | pkgsrc-a17d644a294e8fc61374e42ab0ae009b305666cd.tar.gz |
test for fparseln in libutil.
-rw-r--r-- | pkgtools/libnbcompat/files/Makefile.in | 4 | ||||
-rw-r--r-- | pkgtools/libnbcompat/files/config.h.in | 5 | ||||
-rwxr-xr-x | pkgtools/libnbcompat/files/configure | 157 | ||||
-rw-r--r-- | pkgtools/libnbcompat/files/configure.ac | 12 |
4 files changed, 169 insertions, 9 deletions
diff --git a/pkgtools/libnbcompat/files/Makefile.in b/pkgtools/libnbcompat/files/Makefile.in index 3e16dd7b5ec..a69e5e7f2ae 100644 --- a/pkgtools/libnbcompat/files/Makefile.in +++ b/pkgtools/libnbcompat/files/Makefile.in @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.in,v 1.1.1.1 2003/03/31 05:02:20 grant Exp $ +# $NetBSD: Makefile.in,v 1.2 2003/03/31 05:34:35 grant Exp $ # srcdir = @srcdir@ @@ -22,7 +22,7 @@ OBJS = @LIBOBJS@ \ md5c.o md5hl.o rmd160.o rmd160hl.o sha1.o sha1hl.o \ sha2.o sha2hl.o unvis.o vis.o setmode.o __fts13.o \ getid.o misc.o pack_dev.o spec.o stat_flags.o \ - fparseln.o pwcache.o + pwcache.o LINK= = $(CCLD) $(CFLAGS) $(LDFLAGS) -o $@ COMPILE = $(CC) $(CPPFLAGS) $(CFLAGS) diff --git a/pkgtools/libnbcompat/files/config.h.in b/pkgtools/libnbcompat/files/config.h.in index fde9e60c492..6e304cc0753 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.1.1.1 2003/03/31 05:02:20 grant Exp $ */ +/* $Id: config.h.in,v 1.2 2003/03/31 05:34:35 grant Exp $ */ /* Define if *printf() uses %qd to print `long long' (otherwise uses %lld) */ #undef HAVE_PRINTF_QD @@ -108,6 +108,9 @@ /* Define to 1 if you have the `lchown' function. */ #undef HAVE_LCHOWN +/* Define to 1 if you have the `util' library (-lutil). */ +#undef HAVE_LIBUTIL + /* Define to 1 if you have the <libutil.h> header file. */ #undef HAVE_LIBUTIL_H diff --git a/pkgtools/libnbcompat/files/configure b/pkgtools/libnbcompat/files/configure index 21357d6c649..5b023827f29 100755 --- a/pkgtools/libnbcompat/files/configure +++ b/pkgtools/libnbcompat/files/configure @@ -2483,6 +2483,71 @@ AUTOHEADER=${AUTOHEADER-"$srcdir/missing --run autoheader"} + +echo "$as_me:$LINENO: checking for fparseln in -lutil" >&5 +echo $ECHO_N "checking for fparseln in -lutil... $ECHO_C" >&6 +if test "${ac_cv_lib_util_fparseln+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lutil $LIBS" +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. */ + +/* 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 fparseln (); +int +main () +{ +fparseln (); + ; + 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 + ac_cv_lib_util_fparseln=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_util_fparseln=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_util_fparseln" >&5 +echo "${ECHO_T}$ac_cv_lib_util_fparseln" >&6 +if test $ac_cv_lib_util_fparseln = yes; then + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBUTIL 1 +_ACEOF + + LIBS="-lutil $LIBS" + +fi + + ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -5666,8 +5731,7 @@ done - -for ac_func in err fgetln fparseln fseeko getenv glob inet_ntop \ +for ac_func in err fgetln fseeko getenv glob inet_ntop \ inet_pton lchflags lchmod lchown lutimes mkstemp setenv \ setprogname sl_init snprintf strdup strerror strlcat \ strlcpy strptime strsep strtoll timegm usleep @@ -6426,6 +6490,95 @@ _ACEOF fi fi +if test $ac_cv_lib_util_fparseln != yes; then + +for ac_func in fparseln +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 + +else + LIBOBJS="$LIBOBJS $ac_func.$ac_objext" +fi +done + + +fi if test $ac_cv_type_long_long = yes -a $ac_cv_sizeof_off_t -ge 8; then diff --git a/pkgtools/libnbcompat/files/configure.ac b/pkgtools/libnbcompat/files/configure.ac index 55b19da1ce0..260f0aa0083 100644 --- a/pkgtools/libnbcompat/files/configure.ac +++ b/pkgtools/libnbcompat/files/configure.ac @@ -23,6 +23,10 @@ AC_SUBST(AUTOCONF) AUTOHEADER=${AUTOHEADER-"$srcdir/missing --run autoheader"} AC_SUBST(AUTOHEADER) +dnl Checks for libraries. +dnl +AC_CHECK_LIB(util, fparseln) + dnl Checks for header files. AC_HEADER_STDC AC_CHECK_HEADERS([sys/endian.h sys/file.h sys/mkdev.h sys/param.h]) @@ -63,7 +67,7 @@ AC_FUNC_MALLOC AC_FUNC_STRERROR_R AC_FUNC_VPRINTF -AC_REPLACE_FUNCS([err fgetln fparseln fseeko getenv glob inet_ntop \ +AC_REPLACE_FUNCS([err fgetln fseeko getenv glob inet_ntop \ inet_pton lchflags lchmod lchown lutimes mkstemp setenv \ setprogname sl_init snprintf strdup strerror strlcat \ strlcpy strptime strsep strtoll timegm usleep]) @@ -82,9 +86,9 @@ AC_CHECK_FUNCS([getpassphrase getpgrp memmove poll select]) if test $ac_cv_func_getpgrp = yes; then AC_FUNC_GETPGRP fi -dnl if test $ac_cv_lib_util_fparseln != yes; then -dnl AC_REPLACE_FUNCS([fparseln]) -dnl fi +if test $ac_cv_lib_util_fparseln != yes; then + AC_REPLACE_FUNCS([fparseln]) +fi if test $ac_cv_type_long_long = yes -a $ac_cv_sizeof_off_t -ge 8; then |