diff options
author | grant <grant@pkgsrc.org> | 2003-12-08 14:52:02 +0000 |
---|---|---|
committer | grant <grant@pkgsrc.org> | 2003-12-08 14:52:02 +0000 |
commit | 00580c0095981103219877587281ec86f6d949cb (patch) | |
tree | 4d7a36eecf9e979b892c77aa4fdf6c1e0baef9a6 /pkgtools | |
parent | 6d0d4cf65c399aca06b122e72bd9f45a56821f54 (diff) | |
download | pkgsrc-00580c0095981103219877587281ec86f6d949cb.tar.gz |
always use local glob.[ch] if GLOB_NOMATCH or GLOB_ABORTED aren't
defined.
Diffstat (limited to 'pkgtools')
-rwxr-xr-x | pkgtools/libnbcompat/files/configure | 67 | ||||
-rw-r--r-- | pkgtools/libnbcompat/files/configure.ac | 18 | ||||
-rw-r--r-- | pkgtools/libnbcompat/files/nbcompat.h | 8 | ||||
-rw-r--r-- | pkgtools/libnbcompat/files/nbcompat/config.h.in | 3 |
4 files changed, 94 insertions, 2 deletions
diff --git a/pkgtools/libnbcompat/files/configure b/pkgtools/libnbcompat/files/configure index edd151d7408..dccad66214c 100755 --- a/pkgtools/libnbcompat/files/configure +++ b/pkgtools/libnbcompat/files/configure @@ -8080,6 +8080,73 @@ _ACEOF LIBOBJS="$LIBOBJS statfs.$ac_objext" fi +pkg_use_nbcompat_glob=yes + + echo "$as_me:$LINENO: checking if GLOB_NOMATCH and GLOB_ABORTED are defined in glob.h" >&5 +echo $ECHO_N "checking if GLOB_NOMATCH and GLOB_ABORTED are defined in glob.h... $ECHO_C" >&6 +if test "${pkg_cv_GLOB_NOMATCH_ABORTED+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 <glob.h> +int +main () +{ + int f = GLOB_NOMATCH + GLOB_ABORTED ; + ; + 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_GLOB_NOMATCH_ABORTED=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + pkg_cv_GLOB_NOMATCH_ABORTED=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext + +fi +echo "$as_me:$LINENO: result: $pkg_cv_GLOB_NOMATCH_ABORTED" >&5 +echo "${ECHO_T}$pkg_cv_GLOB_NOMATCH_ABORTED" >&6 + if test "x$pkg_cv_GLOB_NOMATCH_ABORTED" = "xyes"; then + pkg_use_nbcompat_glob=no + else + + : + fi + + +if test $pkg_use_nbcompat_glob = yes; then + cat >>confdefs.h <<\_ACEOF +#define HAVE_NBCOMPAT_GLOB 1 +_ACEOF + + + + LIBOBJS="$LIBOBJS glob.$ac_objext" +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 a323e80e0f5..582b7cb861b 100644 --- a/pkgtools/libnbcompat/files/configure.ac +++ b/pkgtools/libnbcompat/files/configure.ac @@ -1,4 +1,4 @@ -dnl $NetBSD: configure.ac,v 1.31 2003/12/05 15:43:10 erh Exp $ +dnl $NetBSD: configure.ac,v 1.32 2003/12/08 14:52:02 grant Exp $ dnl Process this file with autoconf to produce a configure script. AC_PREREQ(2.52) @@ -216,6 +216,22 @@ if test $pkg_use_nbcompat_statfs = yes; then AC_LIBOBJ(statfs) fi +pkg_use_nbcompat_glob=yes +AC_MSG_TRY_COMPILE([if GLOB_NOMATCH and GLOB_ABORTED are defined in glob.h], + pkg_cv_GLOB_NOMATCH_ABORTED, + [ #include <glob.h> ], + [ int f = GLOB_NOMATCH + GLOB_ABORTED ], + [ pkg_use_nbcompat_glob=no ]) + +if test $pkg_use_nbcompat_glob = yes; then + AC_DEFINE(HAVE_NBCOMPAT_GLOB, 1) + AH_TEMPLATE([HAVE_NBCOMPAT_GLOB], [ + Define to 1 if the `glob' function is built into the library. + ]) + AC_LIBOBJ(glob) +fi + + if test $ac_cv_type_long_long = yes -a $ac_cv_sizeof_off_t -ge 8; then dnl We assume that if sprintf() supports %lld or %qd, diff --git a/pkgtools/libnbcompat/files/nbcompat.h b/pkgtools/libnbcompat/files/nbcompat.h index 8c2e97d4a88..14910c29aff 100644 --- a/pkgtools/libnbcompat/files/nbcompat.h +++ b/pkgtools/libnbcompat/files/nbcompat.h @@ -1,4 +1,4 @@ -/* $NetBSD: nbcompat.h,v 1.27 2003/12/05 15:41:06 erh Exp $ */ +/* $NetBSD: nbcompat.h,v 1.28 2003/12/08 14:52:02 grant Exp $ */ /*- * Copyright (c) 2003 The NetBSD Foundation, Inc. @@ -225,6 +225,12 @@ struct { \ # include <nbcompat/err.h> #endif +#if HAVE_NBCOMPAT_GLOB +# if HAVE_GLOB_H +# undef HAVE_GLOB_H +# endif +#endif + #if HAVE_GLOB_H # include <glob.h> #else diff --git a/pkgtools/libnbcompat/files/nbcompat/config.h.in b/pkgtools/libnbcompat/files/nbcompat/config.h.in index f629586ca04..82d37406025 100644 --- a/pkgtools/libnbcompat/files/nbcompat/config.h.in +++ b/pkgtools/libnbcompat/files/nbcompat/config.h.in @@ -158,6 +158,9 @@ /* 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 + /* Define to 1 if the `MD5Init' function is built into the library. */ #undef HAVE_NBCOMPAT_MD5INIT |