Skip to content

Instantly share code, notes, and snippets.

@jk
Created May 16, 2018 21:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jk/3108ede93dcebaecfce1010e9cc58bd7 to your computer and use it in GitHub Desktop.
Save jk/3108ede93dcebaecfce1010e9cc58bd7 to your computer and use it in GitHub Desktop.
diff -ur pngquant-2.9.0/configure pngquant-2.9.0.fixed/configure
--- pngquant-2.9.0/configure 2017-03-06 09:37:30.000000000 +0100
+++ pngquant-2.9.0.fixed/configure 2017-03-07 09:57:20.246012152 +0100
@@ -48,6 +48,7 @@
help "--with-cocoa/--without-cocoa use Cocoa framework to read images"
fi
help "--with-libpng=<dir> search for libpng in directory"
+ help "--with-zlib=<dir> search for zlib in directory"
echo
help "CC=<compiler> use given compiler command"
help "CFLAGS=<flags> pass options to the compiler"
@@ -97,6 +98,9 @@
--with-libpng=*)
LIBPNG_DIR=${i#*=}
;;
+ --with-zlib=*)
+ ZLIB_DIR=${i#*=}
+ ;;
--prefix=*)
PREFIX=${i#*=}
;;
@@ -238,6 +242,19 @@
echo "${MAJ}${MIN}"
}
+# returns full zlib.h version string
+zlibh_string() {
+ echo "$(grep -m1 "define ZLIB_VERSION" "$1" | \
+ grep -Eo '"[^"]+"' | grep -Eo '[^"]+')"
+}
+
+# returns major minor version numbers from png.h
+zlibh_majmin() {
+ local MAJ=$(grep -m1 "define ZLIB_VER_MAJOR" "$1" | grep -Eo "[0-9]+")
+ local MIN=$(grep -m1 "define ZLIB_VER_MINOR" "$1" | grep -Eo "[0-9]+")
+ echo "${MAJ}${MIN}"
+}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment