Subject: Re: Procedure for adding binary kit for Darwin 7.0?
To: Michael Wolfson <michael@nosflow.com>
From: Hiramatsu Yoshifumi <hiramatu@boreas.dti.ne.jp>
List: tech-pkg
Date: 11/06/2003 02:01:02
--Apple-Mail-3--449850864
Content-Transfer-Encoding: 7bit
Content-Type: text/plain;
	charset=US-ASCII;
	delsp=yes;
	format=flowed

Please apply attached diff to pkgtools/libnbcompat/files.

It fixes this problem on my MacOS X 10.3, but I'm not sure this  
configure.ac is correctly written.

On 2003/11/04, at 10:31, Michael Wolfson wrote:

> Hmmm.  I can't do that until I apparently get textproc/libxslt and  
> textproc/docbook-website working.  And I can't do that either.
>
> Turns out that even though I just built othersrc/bootstrap-pkgsrc from  
> today's sources, I still need to build a more current set of pkg  
> tools:
>
> [...]
> ===> Building for pkg_install-20031003
> gcc -pipe -DHAVE_CONFIG_H -DDEF_LOG_DIR=\"/usr/pkg/pkgdb\"  
> -DTAR_CMD=\"/usr/pkg/
> /bin/tar\" -DFTP_CMD=\"/usr/pkg//bin/ftp\" -no-cpp-precomp -I. -I. -O2  
> -I/Volume
> s/NetBSD/usr/src/pkgsrc/pkgtools/pkg_install/work/libnbcompat -c exec.c
> gcc -pipe -DHAVE_CONFIG_H -DDEF_LOG_DIR=\"/usr/pkg/pkgdb\"  
> -DTAR_CMD=\"/usr/pkg/
> /bin/tar\" -DFTP_CMD=\"/usr/pkg//bin/ftp\" -no-cpp-precomp -I. -I. -O2  
> -I/Volume
> s/NetBSD/usr/src/pkgsrc/pkgtools/pkg_install/work/libnbcompat -c  
> fexec.c
> gcc -pipe -DHAVE_CONFIG_H -DDEF_LOG_DIR=\"/usr/pkg/pkgdb\"  
> -DTAR_CMD=\"/usr/pkg/
> /bin/tar\" -DFTP_CMD=\"/usr/pkg//bin/ftp\" -no-cpp-precomp -I. -I. -O2  
> -I/Volume
> s/NetBSD/usr/src/pkgsrc/pkgtools/pkg_install/work/libnbcompat -c file.c
> file.c: In function `remove_files':
> file.c:555: error: `GLOB_NOMATCH' undeclared (first use in this  
> function)
> file.c:555: error: (Each undeclared identifier is reported only once
> file.c:555: error: for each function it appears in.)
> file.c:558: error: `GLOB_ABORTED' undeclared (first use in this  
> function)
> *** Error code 1
>
> Stop.
> bmake: stopped in  
> /Volumes/NetBSD/usr/src/pkgsrc/pkgtools/pkg_install/work/pkg_install 
> -20031003/lib
> *** Error code 1
>
> Any ideas?
>
>   -- MW
>
-- 
// Hiramatsu Yoshifumi
// hiramatu@boreas.dti.ne.jp

--Apple-Mail-3--449850864
Content-Transfer-Encoding: 7bit
Content-Type: application/octet-stream;
	x-unix-mode=0644;
	name="files.diff"
Content-Disposition: attachment;
	filename=files.diff

Only in files: autom4te.cache
diff -bur files.orig/configure files/configure
--- files.orig/configure	Thu Nov  6 00:54:10 2003
+++ files/configure	Thu Nov  6 00:51:28 2003
@@ -3167,9 +3167,8 @@
 
 
 
-
 for ac_header in arpa/nameser.h assert.h bind/bitypes.h dirent.h err.h \
-	errno.h fcntl.h fts.h glob.h inttypes.h libutil.h limits.h \
+	errno.h fcntl.h fts.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 \
@@ -3318,6 +3317,215 @@
 
 done
 
+
+pkg_use_nbcompat_glob=yes
+
+for ac_header in glob.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 GLOB_NOMATCH in glob.h" >&5
+echo $ECHO_N "checking for GLOB_NOMATCH in glob.h... $ECHO_C" >&6
+if test "${pkg_cv_have_glob+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 ()
+{
+  GLOB_NOMATCH; ;
+  ;
+  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_glob=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ pkg_cv_have_glob=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+
+fi
+echo "$as_me:$LINENO: result: $pkg_cv_have_glob" >&5
+echo "${ECHO_T}$pkg_cv_have_glob" >&6
+	if test "x$pkg_cv_have_glob" = "xyes"; then
+		pkg_use_nbcompat_glob=no
+	else
+		pkg_use_nbcompat_glob=yes
+		:
+	fi
+
+
+fi
+
+done
+
+
+if test $pkg_use_nbcompat_glob = yes; then
+        cat >>confdefs.h <<\_ACEOF
+#define USE_LIBNBCOMPAT_GLOB 1
+_ACEOF
+
+	LIBOBJS="$LIBOBJS glob.$ac_objext"
+
+
+fi
 
 
 
diff -bur files.orig/configure.ac files/configure.ac
--- files.orig/configure.ac	Thu Nov  6 00:54:10 2003
+++ files/configure.ac	Thu Nov  6 00:51:28 2003
@@ -33,7 +33,7 @@
 AC_HEADER_TIME
 
 AC_CHECK_HEADERS([arpa/nameser.h assert.h bind/bitypes.h dirent.h err.h \
-	errno.h fcntl.h fts.h glob.h inttypes.h libutil.h limits.h \
+	errno.h fcntl.h fts.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,6 +42,24 @@
 	sys/stat.h sys/statfs.h sys/statvfs.h sys/vfs.h sys/types.h \
 	sys/vfs.h termcap.h termios.h time.h tzfile.h unistd.h util.h \
 	utmp.h])
+
+pkg_use_nbcompat_glob=yes
+AC_CHECK_HEADERS([glob.h], [
+	AC_MSG_TRY_COMPILE([for GLOB_NOMATCH in glob.h], pkg_cv_have_glob,
+		[ #include <glob.h> ],
+		[ GLOB_NOMATCH; ],
+		pkg_use_nbcompat_glob=no,
+		pkg_use_nbcompat_glob=yes,
+	)
+])
+
+if test $pkg_use_nbcompat_glob = yes; then
+        AC_DEFINE(USE_LIBNBCOMPAT_GLOB)
+	AC_LIBOBJ(glob)
+        AH_TEMPLATE([USE_LIBNBCOMPAT_GLOB], [
+		Define to 1 if your glob.h doesn't define GLOB_NOMATCH
+        ])
+fi
 
 AC_CHECK_HEADERS([md5.h rmd160.h sha1.h])
 
diff -bur files.orig/nbcompat/config.h.in files/nbcompat/config.h.in
--- files.orig/nbcompat/config.h.in	Thu Nov  6 00:54:09 2003
+++ files/nbcompat/config.h.in	Thu Nov  6 00:51:28 2003
@@ -70,6 +70,9 @@
 /* Define to 1 if you have the `gid_from_group' function. */
 #undef HAVE_GID_FROM_GROUP
 
+/* Define to 1 if glob.h doesn't define GLOB_NOMATCH. */
+#undef USE_LIBNBCOMPAT_GLOB
+
 /* Define to 1 if you have the `glob' function. */
 #undef HAVE_GLOB
 
diff -bur files.orig/nbcompat.h files/nbcompat.h
--- files.orig/nbcompat.h	Thu Nov  6 00:54:10 2003
+++ files/nbcompat.h	Thu Nov  6 00:51:28 2003
@@ -225,6 +225,12 @@
 # include <nbcompat/err.h>
 #endif
 
+#if USE_LIBNBCOMPAT_GLOB
+# if HAVE_GLOB_H
+#  undef HAVE_GLOB_H
+# endif
+#endif
+
 #if HAVE_GLOB_H
 # include <glob.h>
 #else

--Apple-Mail-3--449850864--