From 5b6c9951364cf5d6df6e7ec3f02b4fb27eece31e Mon Sep 17 00:00:00 2001 From: Manish Singh Date: Fri, 17 Jul 1998 08:32:02 +0000 Subject: [PATCH] Made usage printout more verbose, added --quiet and -n options * gimptool.in: Made usage printout more verbose, added --quiet and -n options * gimp.m4: set NOUI stuff if available -Yosh --- ChangeLog | 7 ++++ gimp.m4 | 14 +++++++ gimptool-1.2.in | 101 ++++++++++++++++++++++++++++++++++++------------ gimptool.in | 101 ++++++++++++++++++++++++++++++++++++------------ 4 files changed, 175 insertions(+), 48 deletions(-) diff --git a/ChangeLog b/ChangeLog index 1f23a415fb..1d3cf4ccb9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +Fri Jul 17 01:28:30 PDT 1998 Manish Singh + + * gimptool.in: Made usage printout more verbose, added + --quiet and -n options + + * gimp.m4: set NOUI stuff if available + Thu Jul 16 16:20:47 PDT 1998 Manish Singh * gimptool.in: Added --cflags-noui and --libs-noui flags and diff --git a/gimp.m4 b/gimp.m4 index 0201ff3de5..fd0fe39fce 100644 --- a/gimp.m4 +++ b/gimp.m4 @@ -38,6 +38,16 @@ AC_ARG_ENABLE(gimptest, [ --disable-gimptest Do not try to compile and ru else GIMP_CFLAGS=`$GIMPTOOL $gimptool_args --cflags` GIMP_LIBS=`$GIMPTOOL $gimptool_args --libs` + + GIMP_CFLAGS_NOUI=`$GIMPTOOL $gimptool_args --cflags-noui` + noui_test=`echo $GIMP_CFLAGS_NOUI | sed 's/^\(Usage\).*/\1/'` + if test "$noui_test" = "Usage" ; then + GIMP_CFLAGS_NOUI=$GIMP_CFLAGS + GIMP_LIBS_NOUI=$GIMP_LIBS + else + GIMP_LIBS_NOUI=`$GIMPTOOL $gimptool_args --libs-noui` + fi + gimptool_major_version=`$GIMPTOOL $gimptool_args --version | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` gimptool_minor_version=`$GIMPTOOL $gimptool_args --version | \ @@ -144,9 +154,13 @@ int main () fi GIMP_CFLAGS="" GIMP_LIBS="" + GIMP_CFLAGS_NOUI="" + GIMP_LIBS_NOUI="" ifelse([$3], , :, [$3]) fi AC_SUBST(GIMP_CFLAGS) AC_SUBST(GIMP_LIBS) + AC_SUBST(GIMP_CFLAGS_NOUI) + AC_SUBST(GIMP_LIBS_NOUI) rm -f conf.gimptest ]) diff --git a/gimptool-1.2.in b/gimptool-1.2.in index 3897798d07..bba7d016b9 100644 --- a/gimptool-1.2.in +++ b/gimptool-1.2.in @@ -6,8 +6,48 @@ exec_prefix_set=no plug_in_dir=@gimpplugindir@ data_dir=@gimpdatadir@ -usage="\ -Usage: gimptool [--prefix[=DIR]] [--exec-prefix[=DIR]] [--version] [--libs] [--libs-noui] [--cflags] [--cflags-noui] [--build plug-in.c] [--install plug-in.c] [--install-admin plug-in.c] [--install-bin plug-in] [--install-admin-bin plug-in] [--install-script script.scm] [--install-admin-script script.scm]" +usage() +{ + cat <&2 - exit 1 + usage 1 fi if test x${GTK_CONFIG+set} != xset ; then @@ -47,6 +89,19 @@ while test $# -gt 0; do esac case $1 in + --version) + echo @GIMP_VERSION@ + exit 0 + ;; + --help) + usage 0 + ;; + --quiet | --silent) + quiet=yes + ;; + -n | --just-print | --dry-run | --recon) + donothing=yes + ;; --prefix=*) prefix=$optarg if test $exec_prefix_set = no ; then @@ -63,9 +118,6 @@ while test $# -gt 0; do --exec-prefix) echo $exec_prefix ;; - --version) - echo @GIMP_VERSION@ - ;; --cflags | --cflags-noui) case $1 in --cflags) @@ -140,51 +192,52 @@ while test $# -gt 0; do if test "x$1" != "x"; then if test -r "$1"; then cmd="$install_cmd $1 $install_dir/$1" - echo $cmd - exec $cmd + test $quiet = "yes" || echo $cmd + test $donothing = "yes" || exec $cmd else echo "${notfound}" 1>&2 - echo "${usage}" 1>&2 exit 1 fi else echo "${noarg}" 1>&2 - echo "${usage}" 1>&2 exit 1 fi ;; - --build | --install | --install-admin) + --build | --install | --install-admin \ + | --build-noui | --install-noui | --install-admin-noui) case $1 in - --build) + --build | --build-noui) install_dir=. ;; - --install) + --install | --install-noui) install_dir="$HOME/@gimpdir@/plug-ins" ;; - --install-admin) + --install-admin | --install-admin-noui) install_dir="$plug_in_dir/plug-ins" ;; esac - if test @includedir@ != /usr/include ; then - includes=-I@includedir@ + noui=`echo $1 | sed 's/^.*\(noui\)$/\1/'` + if test "$noui" = "noui" ; then + gimp_cflags=`$0 --cflags-noui` + gimp_libs=`$0 --libs-noui` + else + gimp_cflags=`$0 --cflags` + gimp_libs=`$0 --libs` fi shift if test "x$1" != "x"; then if test -r "$1"; then - cmd="$cc $cflags `$0 --cflags` -o $install_dir/`echo $1|sed 's/\.[^\.]*$//'` $1 `$0 --libs`" - echo $cmd - exec $cmd + cmd="$cc $cflags $gimp_cflags -o $install_dir/`echo $1 | sed 's/\.[^\.]*$//'` $1 $gimp_libs" + test $quiet = "yes" || echo $cmd + test $donothing = "yes" || exec $cmd else echo "${notfound}" 1>&2 - echo "${usage}" 1>&2 exit 1 fi else echo "${noarg}" 1>&2 - echo "${usage}" 1>&2 exit 1 fi ;; *) - echo "${usage}" 1>&2 - exit 1 + usage 1 ;; esac shift diff --git a/gimptool.in b/gimptool.in index 3897798d07..bba7d016b9 100644 --- a/gimptool.in +++ b/gimptool.in @@ -6,8 +6,48 @@ exec_prefix_set=no plug_in_dir=@gimpplugindir@ data_dir=@gimpdatadir@ -usage="\ -Usage: gimptool [--prefix[=DIR]] [--exec-prefix[=DIR]] [--version] [--libs] [--libs-noui] [--cflags] [--cflags-noui] [--build plug-in.c] [--install plug-in.c] [--install-admin plug-in.c] [--install-bin plug-in] [--install-admin-bin plug-in] [--install-script script.scm] [--install-admin-script script.scm]" +usage() +{ + cat <&2 - exit 1 + usage 1 fi if test x${GTK_CONFIG+set} != xset ; then @@ -47,6 +89,19 @@ while test $# -gt 0; do esac case $1 in + --version) + echo @GIMP_VERSION@ + exit 0 + ;; + --help) + usage 0 + ;; + --quiet | --silent) + quiet=yes + ;; + -n | --just-print | --dry-run | --recon) + donothing=yes + ;; --prefix=*) prefix=$optarg if test $exec_prefix_set = no ; then @@ -63,9 +118,6 @@ while test $# -gt 0; do --exec-prefix) echo $exec_prefix ;; - --version) - echo @GIMP_VERSION@ - ;; --cflags | --cflags-noui) case $1 in --cflags) @@ -140,51 +192,52 @@ while test $# -gt 0; do if test "x$1" != "x"; then if test -r "$1"; then cmd="$install_cmd $1 $install_dir/$1" - echo $cmd - exec $cmd + test $quiet = "yes" || echo $cmd + test $donothing = "yes" || exec $cmd else echo "${notfound}" 1>&2 - echo "${usage}" 1>&2 exit 1 fi else echo "${noarg}" 1>&2 - echo "${usage}" 1>&2 exit 1 fi ;; - --build | --install | --install-admin) + --build | --install | --install-admin \ + | --build-noui | --install-noui | --install-admin-noui) case $1 in - --build) + --build | --build-noui) install_dir=. ;; - --install) + --install | --install-noui) install_dir="$HOME/@gimpdir@/plug-ins" ;; - --install-admin) + --install-admin | --install-admin-noui) install_dir="$plug_in_dir/plug-ins" ;; esac - if test @includedir@ != /usr/include ; then - includes=-I@includedir@ + noui=`echo $1 | sed 's/^.*\(noui\)$/\1/'` + if test "$noui" = "noui" ; then + gimp_cflags=`$0 --cflags-noui` + gimp_libs=`$0 --libs-noui` + else + gimp_cflags=`$0 --cflags` + gimp_libs=`$0 --libs` fi shift if test "x$1" != "x"; then if test -r "$1"; then - cmd="$cc $cflags `$0 --cflags` -o $install_dir/`echo $1|sed 's/\.[^\.]*$//'` $1 `$0 --libs`" - echo $cmd - exec $cmd + cmd="$cc $cflags $gimp_cflags -o $install_dir/`echo $1 | sed 's/\.[^\.]*$//'` $1 $gimp_libs" + test $quiet = "yes" || echo $cmd + test $donothing = "yes" || exec $cmd else echo "${notfound}" 1>&2 - echo "${usage}" 1>&2 exit 1 fi else echo "${noarg}" 1>&2 - echo "${usage}" 1>&2 exit 1 fi ;; *) - echo "${usage}" 1>&2 - exit 1 + usage 1 ;; esac shift