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
This commit is contained in:
Manish Singh
1998-07-17 08:32:02 +00:00
parent 9ed940918b
commit 5b6c995136
4 changed files with 175 additions and 48 deletions

View File

@ -1,3 +1,10 @@
Fri Jul 17 01:28:30 PDT 1998 Manish Singh <yosh@gimp.org>
* 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 <yosh@gimp.org> Thu Jul 16 16:20:47 PDT 1998 Manish Singh <yosh@gimp.org>
* gimptool.in: Added --cflags-noui and --libs-noui flags and * gimptool.in: Added --cflags-noui and --libs-noui flags and

14
gimp.m4
View File

@ -38,6 +38,16 @@ AC_ARG_ENABLE(gimptest, [ --disable-gimptest Do not try to compile and ru
else else
GIMP_CFLAGS=`$GIMPTOOL $gimptool_args --cflags` GIMP_CFLAGS=`$GIMPTOOL $gimptool_args --cflags`
GIMP_LIBS=`$GIMPTOOL $gimptool_args --libs` 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 | \ gimptool_major_version=`$GIMPTOOL $gimptool_args --version | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
gimptool_minor_version=`$GIMPTOOL $gimptool_args --version | \ gimptool_minor_version=`$GIMPTOOL $gimptool_args --version | \
@ -144,9 +154,13 @@ int main ()
fi fi
GIMP_CFLAGS="" GIMP_CFLAGS=""
GIMP_LIBS="" GIMP_LIBS=""
GIMP_CFLAGS_NOUI=""
GIMP_LIBS_NOUI=""
ifelse([$3], , :, [$3]) ifelse([$3], , :, [$3])
fi fi
AC_SUBST(GIMP_CFLAGS) AC_SUBST(GIMP_CFLAGS)
AC_SUBST(GIMP_LIBS) AC_SUBST(GIMP_LIBS)
AC_SUBST(GIMP_CFLAGS_NOUI)
AC_SUBST(GIMP_LIBS_NOUI)
rm -f conf.gimptest rm -f conf.gimptest
]) ])

View File

@ -6,8 +6,48 @@ exec_prefix_set=no
plug_in_dir=@gimpplugindir@ plug_in_dir=@gimpplugindir@
data_dir=@gimpdatadir@ data_dir=@gimpdatadir@
usage="\ 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]" {
cat <<EOF
Usage: gimptool [OPTION]...
General options:
--help print this message
--quiet, --silent don't echo build commands
--version print the version of GIMP associated with this script
-n, --just-print, --dry-run, --recon
don't actually run any commands; just print them
Developer options:
--cflags print the compiler flags that are necessary to
compile a plug-in
--libs print the linker flags that are necessary to link a
plug-in
--prefix=PREFIX use PREFIX instead of the installation prefix that
GIMP was built when computing the output for --cflags
and --libs
--exec-prefix=PREFIX use PREFIX instead of the installation exec prefix
that GIMP was built when computing the output for
--cflags and --libs
The --cflags and --libs options can be appended with -noui to get appropriate
settings for plug-ins which do not use GTK+.
User options:
--build plug-in.c build a plug-in from a source file
--install plug-in.c same as --build, but installs the built
plug-in as well
--install-bin plug-in install a compiled plug-in
--install-script script.scm install a script-fu script
The --install options can be prefixed with --install-admin instead to install
a plug-in or script in the site directory instead of a user directory.
For plug-ins which do not use GTK+, the --build and --install options can be
appended with --noui for appropriate settings.
EOF
exit $1
}
noarg="\ noarg="\
Error: Need a plug-in source file to build" Error: Need a plug-in source file to build"
@ -15,9 +55,11 @@ Error: Need a plug-in source file to build"
notfound="\ notfound="\
Error: Couldn't find source file to build" Error: Couldn't find source file to build"
quiet=no
donothing=no
if test $# -eq 0; then if test $# -eq 0; then
echo "${usage}" 1>&2 usage 1
exit 1
fi fi
if test x${GTK_CONFIG+set} != xset ; then if test x${GTK_CONFIG+set} != xset ; then
@ -47,6 +89,19 @@ while test $# -gt 0; do
esac esac
case $1 in 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=*)
prefix=$optarg prefix=$optarg
if test $exec_prefix_set = no ; then if test $exec_prefix_set = no ; then
@ -63,9 +118,6 @@ while test $# -gt 0; do
--exec-prefix) --exec-prefix)
echo $exec_prefix echo $exec_prefix
;; ;;
--version)
echo @GIMP_VERSION@
;;
--cflags | --cflags-noui) --cflags | --cflags-noui)
case $1 in case $1 in
--cflags) --cflags)
@ -140,51 +192,52 @@ while test $# -gt 0; do
if test "x$1" != "x"; then if test "x$1" != "x"; then
if test -r "$1"; then if test -r "$1"; then
cmd="$install_cmd $1 $install_dir/$1" cmd="$install_cmd $1 $install_dir/$1"
echo $cmd test $quiet = "yes" || echo $cmd
exec $cmd test $donothing = "yes" || exec $cmd
else else
echo "${notfound}" 1>&2 echo "${notfound}" 1>&2
echo "${usage}" 1>&2
exit 1 exit 1
fi fi
else else
echo "${noarg}" 1>&2 echo "${noarg}" 1>&2
echo "${usage}" 1>&2
exit 1 exit 1
fi fi
;; ;;
--build | --install | --install-admin) --build | --install | --install-admin \
| --build-noui | --install-noui | --install-admin-noui)
case $1 in case $1 in
--build) --build | --build-noui)
install_dir=. ;; install_dir=. ;;
--install) --install | --install-noui)
install_dir="$HOME/@gimpdir@/plug-ins" ;; install_dir="$HOME/@gimpdir@/plug-ins" ;;
--install-admin) --install-admin | --install-admin-noui)
install_dir="$plug_in_dir/plug-ins" ;; install_dir="$plug_in_dir/plug-ins" ;;
esac esac
if test @includedir@ != /usr/include ; then noui=`echo $1 | sed 's/^.*\(noui\)$/\1/'`
includes=-I@includedir@ 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 fi
shift shift
if test "x$1" != "x"; then if test "x$1" != "x"; then
if test -r "$1"; then if test -r "$1"; then
cmd="$cc $cflags `$0 --cflags` -o $install_dir/`echo $1|sed 's/\.[^\.]*$//'` $1 `$0 --libs`" cmd="$cc $cflags $gimp_cflags -o $install_dir/`echo $1 | sed 's/\.[^\.]*$//'` $1 $gimp_libs"
echo $cmd test $quiet = "yes" || echo $cmd
exec $cmd test $donothing = "yes" || exec $cmd
else else
echo "${notfound}" 1>&2 echo "${notfound}" 1>&2
echo "${usage}" 1>&2
exit 1 exit 1
fi fi
else else
echo "${noarg}" 1>&2 echo "${noarg}" 1>&2
echo "${usage}" 1>&2
exit 1 exit 1
fi fi
;; ;;
*) *)
echo "${usage}" 1>&2 usage 1
exit 1
;; ;;
esac esac
shift shift

View File

@ -6,8 +6,48 @@ exec_prefix_set=no
plug_in_dir=@gimpplugindir@ plug_in_dir=@gimpplugindir@
data_dir=@gimpdatadir@ data_dir=@gimpdatadir@
usage="\ 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]" {
cat <<EOF
Usage: gimptool [OPTION]...
General options:
--help print this message
--quiet, --silent don't echo build commands
--version print the version of GIMP associated with this script
-n, --just-print, --dry-run, --recon
don't actually run any commands; just print them
Developer options:
--cflags print the compiler flags that are necessary to
compile a plug-in
--libs print the linker flags that are necessary to link a
plug-in
--prefix=PREFIX use PREFIX instead of the installation prefix that
GIMP was built when computing the output for --cflags
and --libs
--exec-prefix=PREFIX use PREFIX instead of the installation exec prefix
that GIMP was built when computing the output for
--cflags and --libs
The --cflags and --libs options can be appended with -noui to get appropriate
settings for plug-ins which do not use GTK+.
User options:
--build plug-in.c build a plug-in from a source file
--install plug-in.c same as --build, but installs the built
plug-in as well
--install-bin plug-in install a compiled plug-in
--install-script script.scm install a script-fu script
The --install options can be prefixed with --install-admin instead to install
a plug-in or script in the site directory instead of a user directory.
For plug-ins which do not use GTK+, the --build and --install options can be
appended with --noui for appropriate settings.
EOF
exit $1
}
noarg="\ noarg="\
Error: Need a plug-in source file to build" Error: Need a plug-in source file to build"
@ -15,9 +55,11 @@ Error: Need a plug-in source file to build"
notfound="\ notfound="\
Error: Couldn't find source file to build" Error: Couldn't find source file to build"
quiet=no
donothing=no
if test $# -eq 0; then if test $# -eq 0; then
echo "${usage}" 1>&2 usage 1
exit 1
fi fi
if test x${GTK_CONFIG+set} != xset ; then if test x${GTK_CONFIG+set} != xset ; then
@ -47,6 +89,19 @@ while test $# -gt 0; do
esac esac
case $1 in 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=*)
prefix=$optarg prefix=$optarg
if test $exec_prefix_set = no ; then if test $exec_prefix_set = no ; then
@ -63,9 +118,6 @@ while test $# -gt 0; do
--exec-prefix) --exec-prefix)
echo $exec_prefix echo $exec_prefix
;; ;;
--version)
echo @GIMP_VERSION@
;;
--cflags | --cflags-noui) --cflags | --cflags-noui)
case $1 in case $1 in
--cflags) --cflags)
@ -140,51 +192,52 @@ while test $# -gt 0; do
if test "x$1" != "x"; then if test "x$1" != "x"; then
if test -r "$1"; then if test -r "$1"; then
cmd="$install_cmd $1 $install_dir/$1" cmd="$install_cmd $1 $install_dir/$1"
echo $cmd test $quiet = "yes" || echo $cmd
exec $cmd test $donothing = "yes" || exec $cmd
else else
echo "${notfound}" 1>&2 echo "${notfound}" 1>&2
echo "${usage}" 1>&2
exit 1 exit 1
fi fi
else else
echo "${noarg}" 1>&2 echo "${noarg}" 1>&2
echo "${usage}" 1>&2
exit 1 exit 1
fi fi
;; ;;
--build | --install | --install-admin) --build | --install | --install-admin \
| --build-noui | --install-noui | --install-admin-noui)
case $1 in case $1 in
--build) --build | --build-noui)
install_dir=. ;; install_dir=. ;;
--install) --install | --install-noui)
install_dir="$HOME/@gimpdir@/plug-ins" ;; install_dir="$HOME/@gimpdir@/plug-ins" ;;
--install-admin) --install-admin | --install-admin-noui)
install_dir="$plug_in_dir/plug-ins" ;; install_dir="$plug_in_dir/plug-ins" ;;
esac esac
if test @includedir@ != /usr/include ; then noui=`echo $1 | sed 's/^.*\(noui\)$/\1/'`
includes=-I@includedir@ 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 fi
shift shift
if test "x$1" != "x"; then if test "x$1" != "x"; then
if test -r "$1"; then if test -r "$1"; then
cmd="$cc $cflags `$0 --cflags` -o $install_dir/`echo $1|sed 's/\.[^\.]*$//'` $1 `$0 --libs`" cmd="$cc $cflags $gimp_cflags -o $install_dir/`echo $1 | sed 's/\.[^\.]*$//'` $1 $gimp_libs"
echo $cmd test $quiet = "yes" || echo $cmd
exec $cmd test $donothing = "yes" || exec $cmd
else else
echo "${notfound}" 1>&2 echo "${notfound}" 1>&2
echo "${usage}" 1>&2
exit 1 exit 1
fi fi
else else
echo "${noarg}" 1>&2 echo "${noarg}" 1>&2
echo "${usage}" 1>&2
exit 1 exit 1
fi fi
;; ;;
*) *)
echo "${usage}" 1>&2 usage 1
exit 1
;; ;;
esac esac
shift shift