diff options
author | s_alexander <s_alexander@b956fd51-792f-4845-bead-9b4dfca2ff2c> | 2010-09-07 17:45:32 +0000 |
---|---|---|
committer | s_alexander <s_alexander@b956fd51-792f-4845-bead-9b4dfca2ff2c> | 2010-09-07 17:45:32 +0000 |
commit | d165a085eecd9f0d2e9d603de269941d1d30c620 (patch) | |
tree | ac704b1d31c4f64ffe0f12bd2e85a9c7cd743e3d | |
parent | 985ce77618c8c73c80d3fe48b122eb0bc2586629 (diff) | |
download | usdx-d165a085eecd9f0d2e9d603de269941d1d30c620.tar.gz usdx-d165a085eecd9f0d2e9d603de269941d1d30c620.tar.xz usdx-d165a085eecd9f0d2e9d603de269941d1d30c620.zip |
update configure to find libpng 1.4
git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/branches/experimental@2633 b956fd51-792f-4845-bead-9b4dfca2ff2c
Diffstat (limited to '')
-rwxr-xr-x | us_maker_edition/configure | 249 | ||||
-rw-r--r-- | us_maker_edition/configure.ac | 12 |
2 files changed, 256 insertions, 5 deletions
diff --git a/us_maker_edition/configure b/us_maker_edition/configure index 38945e6d..eb9cf0f4 100755 --- a/us_maker_edition/configure +++ b/us_maker_edition/configure @@ -607,12 +607,19 @@ libavcodec_VERSION_MINOR libavcodec_VERSION_MAJOR libavcodec_VERSION lua_LIB_NAME +libpng_VERSION_INT +libpng_VERSION_RELEASE +libpng_VERSION_MINOR +libpng_VERSION_MAJOR +libpng_VERSION DARWIN_VERSION MACOSX_VERSION MACOSX_VERSION_INT MACOSX_VERSION_RELEASE MACOSX_VERSION_MINOR MACOSX_VERSION_MAJOR +PKG_CONFIG_LIBDIR +PKG_CONFIG_PATH PKG_CONFIG RANLIB ac_ct_CXX @@ -738,6 +745,9 @@ CXX CXXFLAGS CCC PKG_CONFIG +PKG_CONFIG_PATH +PKG_CONFIG_LIBDIR +libpng_VERSION libavcodec_VERSION libavformat_VERSION libavutil_VERSION @@ -1403,6 +1413,12 @@ Some influential environment variables: CXX C++ compiler command CXXFLAGS C++ compiler flags PKG_CONFIG path to pkg-config utility + PKG_CONFIG_PATH + directories to add to pkg-config's search path + PKG_CONFIG_LIBDIR + path overriding pkg-config's built-in search path + libpng_VERSION + version of libpng, overriding pkg-config libavcodec_VERSION version of libavcodec, overriding pkg-config libavformat_VERSION @@ -4130,6 +4146,10 @@ fi # find pkg-config + + + + if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. @@ -4242,7 +4262,6 @@ $as_echo "yes" >&6; } $as_echo "no" >&6; } PKG_CONFIG="" fi - fi if [ x$PKG_CONFIG = x ]; then as_fn_error " @@ -4314,7 +4333,8 @@ fi # check for libraries # ----------------------------------------- -# libpng +# find libpng +# pkgconfig name for 1.2 is "libpng12", for 1.4 "libpng" have_lib="no" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libpng12" >&5 @@ -4360,7 +4380,7 @@ $as_echo "yes" >&6; } $as_echo "no" >&6; } # check if package is required - if test xyes = xyes -o x"$with_libpng" = xyes ; then + if test xno = xyes -o x"$with_libpng" = xyes ; then # print error message and quit err_msg=`$PKG_CONFIG --errors-to-stdout --print-errors "libpng12"` as_fn_error " @@ -4376,6 +4396,229 @@ See the pkg-config man page for more details. fi fi +if [ x$libpng_HAVE = xyes ]; then + + if test x$libpng_HAVE = xyes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking version of libpng" >&5 +$as_echo_n "checking version of libpng... " >&6; } + + + # check if variable was defined by the user + if test -z "$libpng_VERSION"; then + # if not, get it from pkg-config + if test x$libpng_HAVE = xyes; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libpng12\""; } >&5 + ($PKG_CONFIG --exists --print-errors "libpng12") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + libpng_VERSION=`$PKG_CONFIG --modversion --silence-errors "libpng12"` +else + # print error message and quit + err_msg=`$PKG_CONFIG --errors-to-stdout --print-errors "libpng12"` + as_fn_error " + +$err_msg + +If --with-libpng=nocheck is defined the environment variable +libpng_VERSION +must be set to avoid the need to call pkg-config. + +See the pkg-config man page for more details. +" "$LINENO" 5 + + +fi + fi + fi + + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: [$libpng_VERSION]" >&5 +$as_echo "[$libpng_VERSION]" >&6; } + else + libpng_VERSION="0.0.0" + fi + + version=$libpng_VERSION + + # strip leading non-numeric tokens + # (necessary for some ffmpeg-packages in ubuntu) + # example: 0d.51.1.0 -> 51.1.0 + version=`echo $version | sed 's/^[^.]*[^0-9.][^.]*\.//'` + + # replace "." and "-" with " " and ignore trailing tokens. + # 1.23.4-r2 will be splitted to [maj=1, min=23, rel=4]. + # In addition we delete everything after the first character + # which is not 0-9. + # 1.3a4-r32 will be [maj=1, min=3, rel=0]. + read major minor release ignore <<eof + `echo $version | tr '.-' ' ' | sed 's/[^0-9\ ].*//'` +eof + # Note: Do NOT indent the eof-delimiter + # We use a here-document (<<< here-strings not POSIX compatible) + + test -z $major && major=0 + test -z $minor && minor=0 + test -z $release && release=0 + + # strip preceding 0s and set unset version-parts to 0 + libpng_VERSION_MAJOR=$(($major)) + libpng_VERSION_MINOR=$(($minor)) + libpng_VERSION_RELEASE=$(($release)) + # integer representation: MMMmmmrrr (M:major,m:minor,r:release) + # can be used if pkg-config's comparison fails + libpng_VERSION_INT=$(($libpng_VERSION_MAJOR*1000000+$libpng_VERSION_MINOR*1000+$libpng_VERSION_RELEASE)) + + + + + + + +else + # check for the generic .pc file + + have_lib="no" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libpng >= 1.2" >&5 +$as_echo_n "checking for libpng >= 1.2... " >&6; } + if test x"$with_libpng" = xnocheck; then + # do not call pkg-config, use user settings + have_lib="yes" + elif test x"$with_libpng" != xno; then + # check if package exists + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libpng >= 1.2\""; } >&5 + ($PKG_CONFIG --exists --print-errors "libpng >= 1.2") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + + have_lib="yes" + libpng_LIBS=`$PKG_CONFIG --libs --silence-errors "libpng >= 1.2"` + libpng_LIBDIRS=`$PKG_CONFIG --libs-only-L --silence-errors "libpng >= 1.2"` + libpng_LIBDIRS=` + echo "$libpng_LIBDIRS" | $SED 's/^[ \t]*//' | $SED 's/[ \t]*$//' +` + # add library directories to LIBS (ignore *_LIBS for now) + if test -n "$libpng_LIBDIRS"; then + LIBS="$LIBS $libpng_LIBDIRS" + fi + +fi + fi + if test x$have_lib = xyes; then + libpng_HAVE="yes" + if test -n "$libpng_LIBDIRS"; then + # show additional lib-dirs + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes ($libpng_LIBDIRS)" >&5 +$as_echo "yes ($libpng_LIBDIRS)" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + fi + else + libpng_HAVE="no" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + + # check if package is required + if test xyes = xyes -o x"$with_libpng" = xyes ; then + # print error message and quit + err_msg=`$PKG_CONFIG --errors-to-stdout --print-errors "libpng >= 1.2"` + as_fn_error " + +$err_msg + +Alternatively, you may set --with-libpng=nocheck and the environment +variables libpng_[...] (see configure --help) +to appropriate values to avoid the need to call pkg-config. + +See the pkg-config man page for more details. +" "$LINENO" 5 + fi + fi + + + if test x$libpng_HAVE = xyes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking version of libpng" >&5 +$as_echo_n "checking version of libpng... " >&6; } + + + # check if variable was defined by the user + if test -z "$libpng_VERSION"; then + # if not, get it from pkg-config + if test x$libpng_HAVE = xyes; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libpng >= 1.2\""; } >&5 + ($PKG_CONFIG --exists --print-errors "libpng >= 1.2") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + libpng_VERSION=`$PKG_CONFIG --modversion --silence-errors "libpng >= 1.2"` +else + # print error message and quit + err_msg=`$PKG_CONFIG --errors-to-stdout --print-errors "libpng >= 1.2"` + as_fn_error " + +$err_msg + +If --with-libpng=nocheck is defined the environment variable +libpng_VERSION +must be set to avoid the need to call pkg-config. + +See the pkg-config man page for more details. +" "$LINENO" 5 + + +fi + fi + fi + + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: [$libpng_VERSION]" >&5 +$as_echo "[$libpng_VERSION]" >&6; } + else + libpng_VERSION="0.0.0" + fi + + version=$libpng_VERSION + + # strip leading non-numeric tokens + # (necessary for some ffmpeg-packages in ubuntu) + # example: 0d.51.1.0 -> 51.1.0 + version=`echo $version | sed 's/^[^.]*[^0-9.][^.]*\.//'` + + # replace "." and "-" with " " and ignore trailing tokens. + # 1.23.4-r2 will be splitted to [maj=1, min=23, rel=4]. + # In addition we delete everything after the first character + # which is not 0-9. + # 1.3a4-r32 will be [maj=1, min=3, rel=0]. + read major minor release ignore <<eof + `echo $version | tr '.-' ' ' | sed 's/[^0-9\ ].*//'` +eof + # Note: Do NOT indent the eof-delimiter + # We use a here-document (<<< here-strings not POSIX compatible) + + test -z $major && major=0 + test -z $minor && minor=0 + test -z $release && release=0 + + # strip preceding 0s and set unset version-parts to 0 + libpng_VERSION_MAJOR=$(($major)) + libpng_VERSION_MINOR=$(($minor)) + libpng_VERSION_RELEASE=$(($release)) + # integer representation: MMMmmmrrr (M:major,m:minor,r:release) + # can be used if pkg-config's comparison fails + libpng_VERSION_INT=$(($libpng_VERSION_MAJOR*1000000+$libpng_VERSION_MINOR*1000+$libpng_VERSION_RELEASE)) + + + + + + + +fi # find sdl diff --git a/us_maker_edition/configure.ac b/us_maker_edition/configure.ac index c609c460..fdd3d2cf 100644 --- a/us_maker_edition/configure.ac +++ b/us_maker_edition/configure.ac @@ -154,8 +154,16 @@ fi # check for libraries # ----------------------------------------- -# libpng -PKG_HAVE([libpng], [libpng12], yes) +# find libpng +# pkgconfig name for 1.2 is "libpng12", for 1.4 "libpng" +PKG_HAVE([libpng], [libpng12], no) +if [[ x$libpng_HAVE = xyes ]]; then + PKG_VERSION([libpng], [libpng12]) +else + # check for the generic .pc file + PKG_HAVE([libpng], [libpng >= 1.2], yes) + PKG_VERSION([libpng], [libpng >= 1.2]) +fi # find sdl PKG_HAVE([sdl], [sdl], yes) |