[Zlib-devel] zlib-1.2.4 build failure on NetBSD 5.0.2 IA-32

Mark Adler madler at alumni.caltech.edu
Sat Mar 20 17:24:36 EDT 2010


On Mar 20, 2010, at 11:50 AM, Vincent Torri wrote:
> i would suggest that you look at the configure script of ffmpeg [1] or geexbox [2].

Vincent,

Thanks.  I copied their trick to run a better shell, and patched configure thusly (this includes a previous patch as well):

--- ../zlib-1.2.4/configure	2010-03-12 07:06:14.000000000 -0800
+++ configure	2010-03-20 13:50:15.000000000 -0700
@@ -13,6 +13,24 @@
 # If you have problems, try without defining CC and CFLAGS before reporting
 # an error.
 
+# make sure we are running under a compatible shell (stolen from ffmpeg and libnfo)
+if test "0$ZLIB_CONFIGURE_EXEC" -lt 1; then
+  unset foo
+  (: ${foo%%bar}) 2>/dev/null && ! (: ${foo?}) 2>/dev/null
+  if test "$?" -ne 0; then
+    ZLIB_CONFIGURE_EXEC=1
+    export ZLIB_CONFIGURE_EXEC
+    type "bash" > /dev/null 2>&1 && exec bash "$0" "$@"
+    type "ksh" > /dev/null 2>&1 && exec ksh "$0" "$@"
+    if test -x /usr/xpg4/bin/sh; then
+      exec /usr/xpg4/bin/sh "$0" "$@"
+    fi
+#    echo "No compatible shell script interpreter found."
+#    exit 1
+# we could give up here, but go ahead and give their old sh a try
+  fi
+fi
+
 STATICLIB=libz.a
 LDFLAGS="${LDFLAGS} -L. ${STATICLIB}"
 VER=`sed -n -e '/VERSION "/s/.*"\(.*\)".*/\1/p' < zlib.h`
@@ -43,11 +61,11 @@
       echo '  configure [--zprefix] [--prefix=PREFIX]  [--eprefix=EXPREFIX]'
       echo '    [--static] [--64] [--libdir=LIBDIR] [--includedir=INCLUDEDIR]'
         exit 0 ;;
-    -p*=* | --prefix=*) prefix=`echo $1 | sed 's/[-a-z_]*=//'`; shift ;;
-    -e*=* | --eprefix=*) exec_prefix=`echo $1 | sed 's/[-a-z_]*=//'`; shift ;;
-    -l*=* | --libdir=*) libdir=`echo $1 | sed 's/[-a-z_]*=//'`; shift ;;
-    -i*=* | --includedir=*) includedir=`echo $1 | sed 's/[-a-z_]*=//'`;shift ;;
-    -u*=* | --uname=*) uname=`echo $1 | sed 's/[-a-z_]*=//'`;shift ;;
+    -p*=* | --prefix=*) prefix=`echo $1 | sed 's/.*=//'`; shift ;;
+    -e*=* | --eprefix=*) exec_prefix=`echo $1 | sed 's/.*=//'`; shift ;;
+    -l*=* | --libdir=*) libdir=`echo $1 | sed 's/.*=//'`; shift ;;
+    -i*=* | --includedir=*) includedir=`echo $1 | sed 's/.*=//'`;shift ;;
+    -u*=* | --uname=*) uname=`echo $1 | sed 's/.*=//'`;shift ;;
     -p* | --prefix) prefix="$2"; shift; shift ;;
     -e* | --eprefix) exec_prefix="$2"; shift; shift ;;
     -l* | --libdir) libdir="$2"; shift; shift ;;

Nelson: please try this patch and see if it works on the NetBSD system.  Thanks.

Mark






More information about the Zlib-devel mailing list