--- gimp-2.2.11/gimptool-2.0.in.gimptool 2006-01-10 13:12:28.000000000 +0100 +++ gimp-2.2.11/gimptool-2.0.in 2006-04-20 14:45:18.000000000 +0200 @@ -91,54 +91,60 @@ usage 1 fi -if test x${PKG_CONFIG+set} != xset ; then - PKG_CONFIG=pkg-config -fi +__gimptool_init__=0 +init() { + if [ "$__gimptool_init__" -eq 0 ]; then + if test x${PKG_CONFIG+set} != xset ; then + PKG_CONFIG=pkg-config + fi -if $PKG_CONFIG --atleast-pkgconfig-version 0.7 ; then - gtk_cflags=`$PKG_CONFIG --cflags gtk+-2.0` - gtk_libs=`$PKG_CONFIG --libs gtk+-2.0` - glib_cflags=`$PKG_CONFIG --cflags glib-2.0` - glib_libs=`$PKG_CONFIG --libs glib-2.0` -else - echo "*** pkg-config not found or too old; using paths from gimp compilation." 1>&2 - gtk_cflags='@GTK_CFLAGS@' - gtk_libs='@GTK_LIBS@' - glib_cflags='@GLIB_CFLAGS@' - glib_libs='@GLIB_LIBS@' -fi + if $PKG_CONFIG --atleast-pkgconfig-version 0.7 ; then + gtk_cflags=`$PKG_CONFIG --cflags gtk+-2.0` + gtk_libs=`$PKG_CONFIG --libs gtk+-2.0` + glib_cflags=`$PKG_CONFIG --cflags glib-2.0` + glib_libs=`$PKG_CONFIG --libs glib-2.0` + else + echo "*** pkg-config not found or too old; using paths from gimp compilation." 1>&2 + gtk_cflags='@GTK_CFLAGS@' + gtk_libs='@GTK_LIBS@' + glib_cflags='@GLIB_CFLAGS@' + glib_libs='@GLIB_LIBS@' + fi -if test x${INSTALL+set} != xset ; then - INSTALL='@INSTALL@' - if test "$INSTALL" = "./install-sh -c"; then - mydirname=`echo $0 | sed -e 's#\(.*\)/[^/].*$#\1#'` - INSTALL="$mydirname/gimpinstall" - fi -fi + if test x${INSTALL+set} != xset ; then + INSTALL='@INSTALL@' + if test "$INSTALL" = "./install-sh -c"; then + mydirname=`echo $0 | sed -e 's#\(.*\)/[^/].*$#\1#'` + INSTALL="$mydirname/gimpinstall" + fi + fi -if test x${CC+set} != xset ; then - cc='@CC@' -else - cc="$CC" -fi + if test x${CC+set} != xset ; then + cc='@CC@' + else + cc="$CC" + fi -if test x${CFLAGS+set} != xset ; then - cflags='@CFLAGS@' -else - cflags="$CFLAGS" -fi + if test x${CFLAGS+set} != xset ; then + cflags='@CFLAGS@' + else + cflags="$CFLAGS" + fi -if test x${LDFLAGS+set} != xset ; then - ldflags='@LDFLAGS@' -else - ldflags="$LDFLAGS" -fi + if test x${LDFLAGS+set} != xset ; then + ldflags='@LDFLAGS@' + else + ldflags="$LDFLAGS" + fi -if test x${LIBS+set} != xset ; then - libs="" -else - libs="$LIBS" -fi + if test x${LIBS+set} != xset ; then + libs="" + else + libs="$LIBS" + fi + __gimptool_init__=1 + fi +} while test $# -gt 0; do case "$1" in @@ -174,9 +180,17 @@ exec_prefix_set=yes ;; --exec-prefix) + init echo $exec_prefix ;; --*dir) + case "$1" in + --gimp*dir) + ;; + *) + init + ;; + esac dirname=\$`echo $1 | sed -e 's,^--,,'` dirname=`eval echo $dirname` test -z "$dirname" && exit 1 @@ -184,6 +198,7 @@ exit 0 ;; --cflags | --cflags-noui | --cflags-nogimpui) + init case $1 in --cflags | --cflags-nogimpui) my_gtk_cflags=$gtk_cflags ;; @@ -194,6 +209,7 @@ echo $includes $my_gtk_cflags ;; --libs | --libs-nogimpui) + init my_gtk_libs= libdirs=-L@libdir@ for i in $gtk_libs ; do @@ -213,6 +229,7 @@ esac ;; --libs-noui) + init echo -L@libdir@ -lgimp-@GIMP_API_VERSION@ -lgimpcolor-@GIMP_API_VERSION@ -lgimpmath-@GIMP_API_VERSION@ -lgimpbase-@GIMP_API_VERSION@ $glib_libs $rt_libs ;; --install-bin | --install-admin-bin \ @@ -220,6 +237,7 @@ | --install-script | --install-admin-script \ | --uninstall-bin | --uninstall-admin-bin \ | --uninstall-script | --uninstall-admin-script ) + init case $1 in --*install-bin) install_cmd="@INSTALL_PROGRAM@" @@ -292,6 +310,7 @@ | --install-nogimpui-strip | --install-admin-nogimpui-strip \ | --build-noui | --install-noui | --install-admin-noui \ | --build-noui-strip | --install-noui-strip | --install-admin-noui-strip) + init opt=`echo $1 | sed 's/-strip$//'` if test "x$opt" != "x$1" ; then cflags=`echo $cflags | sed -e 's/-g //g' -e 's/ -g//g'`