Commit b1446447 authored by Owen Taylor's avatar Owen Taylor Committed by Owen Taylor

Added flags --prefix[=dir] and --exec-prefix[=DIR] which allow querying

Fri Apr  3 18:33:47 1998  Owen Taylor  <owt1@cornell.edu>

	* gtk-config.in: Added flags --prefix[=dir] and
	--exec-prefix[=DIR] which allow querying and overriding the
	configured-in prefix and exec-prefix.

	* gtk.m4: Added configure flags --with-gtk-prefix=
	and --with-gtk-exec-prefix= to set the --prefix and
	--exec-prefix argumetns to gtk.m4
parent 308adaa6
Fri Apr 3 18:33:47 1998 Owen Taylor <owt1@cornell.edu>
* gtk-config.in: Added flags --prefix[=dir] and
--exec-prefix[=DIR] which allow querying and overriding the
configured-in prefix and exec-prefix.
* gtk.m4: Added configure flags --with-gtk-prefix=
and --with-gtk-exec-prefix= to set the --prefix and
--exec-prefix argumetns to gtk.m4
Fri Apr 3 17:14:55 1998 Owen Taylor <owt1@cornell.edu>
* glib/testglib.c: Removed literal german from strings
to appease SGI compiler.
* gdk/gdk.c: More extensive debugging output
* gtk/gtkalignment.c gtk/gtkbutton.c gtk/gtkcheckbutton.c
......
Fri Apr 3 18:33:47 1998 Owen Taylor <owt1@cornell.edu>
* gtk-config.in: Added flags --prefix[=dir] and
--exec-prefix[=DIR] which allow querying and overriding the
configured-in prefix and exec-prefix.
* gtk.m4: Added configure flags --with-gtk-prefix=
and --with-gtk-exec-prefix= to set the --prefix and
--exec-prefix argumetns to gtk.m4
Fri Apr 3 17:14:55 1998 Owen Taylor <owt1@cornell.edu>
* glib/testglib.c: Removed literal german from strings
to appease SGI compiler.
* gdk/gdk.c: More extensive debugging output
* gtk/gtkalignment.c gtk/gtkbutton.c gtk/gtkcheckbutton.c
......
Fri Apr 3 18:33:47 1998 Owen Taylor <owt1@cornell.edu>
* gtk-config.in: Added flags --prefix[=dir] and
--exec-prefix[=DIR] which allow querying and overriding the
configured-in prefix and exec-prefix.
* gtk.m4: Added configure flags --with-gtk-prefix=
and --with-gtk-exec-prefix= to set the --prefix and
--exec-prefix argumetns to gtk.m4
Fri Apr 3 17:14:55 1998 Owen Taylor <owt1@cornell.edu>
* glib/testglib.c: Removed literal german from strings
to appease SGI compiler.
* gdk/gdk.c: More extensive debugging output
* gtk/gtkalignment.c gtk/gtkbutton.c gtk/gtkcheckbutton.c
......
Fri Apr 3 18:33:47 1998 Owen Taylor <owt1@cornell.edu>
* gtk-config.in: Added flags --prefix[=dir] and
--exec-prefix[=DIR] which allow querying and overriding the
configured-in prefix and exec-prefix.
* gtk.m4: Added configure flags --with-gtk-prefix=
and --with-gtk-exec-prefix= to set the --prefix and
--exec-prefix argumetns to gtk.m4
Fri Apr 3 17:14:55 1998 Owen Taylor <owt1@cornell.edu>
* glib/testglib.c: Removed literal german from strings
to appease SGI compiler.
* gdk/gdk.c: More extensive debugging output
* gtk/gtkalignment.c gtk/gtkbutton.c gtk/gtkcheckbutton.c
......
Fri Apr 3 18:33:47 1998 Owen Taylor <owt1@cornell.edu>
* gtk-config.in: Added flags --prefix[=dir] and
--exec-prefix[=DIR] which allow querying and overriding the
configured-in prefix and exec-prefix.
* gtk.m4: Added configure flags --with-gtk-prefix=
and --with-gtk-exec-prefix= to set the --prefix and
--exec-prefix argumetns to gtk.m4
Fri Apr 3 17:14:55 1998 Owen Taylor <owt1@cornell.edu>
* glib/testglib.c: Removed literal german from strings
to appease SGI compiler.
* gdk/gdk.c: More extensive debugging output
* gtk/gtkalignment.c gtk/gtkbutton.c gtk/gtkcheckbutton.c
......
Fri Apr 3 18:33:47 1998 Owen Taylor <owt1@cornell.edu>
* gtk-config.in: Added flags --prefix[=dir] and
--exec-prefix[=DIR] which allow querying and overriding the
configured-in prefix and exec-prefix.
* gtk.m4: Added configure flags --with-gtk-prefix=
and --with-gtk-exec-prefix= to set the --prefix and
--exec-prefix argumetns to gtk.m4
Fri Apr 3 17:14:55 1998 Owen Taylor <owt1@cornell.edu>
* glib/testglib.c: Removed literal german from strings
to appease SGI compiler.
* gdk/gdk.c: More extensive debugging output
* gtk/gtkalignment.c gtk/gtkbutton.c gtk/gtkcheckbutton.c
......
Fri Apr 3 18:33:47 1998 Owen Taylor <owt1@cornell.edu>
* gtk-config.in: Added flags --prefix[=dir] and
--exec-prefix[=DIR] which allow querying and overriding the
configured-in prefix and exec-prefix.
* gtk.m4: Added configure flags --with-gtk-prefix=
and --with-gtk-exec-prefix= to set the --prefix and
--exec-prefix argumetns to gtk.m4
Fri Apr 3 17:14:55 1998 Owen Taylor <owt1@cornell.edu>
* glib/testglib.c: Removed literal german from strings
to appease SGI compiler.
* gdk/gdk.c: More extensive debugging output
* gtk/gtkalignment.c gtk/gtkbutton.c gtk/gtkcheckbutton.c
......
......@@ -16,17 +16,27 @@ $exec_prefix/bin):
Invoking gtk-config
-------------------
gtk-config can be invoked in one of three forms:
gtk-config takes the following flags:
gtk-config --version
--version
Prints out the version of GTK installed
gtk-config --cflags
--cflags
Prints '-I' flags pointing to the installed header files.
gtk-config --libs
--libs
Prints out the linker flags necessary to link a program against GTK
--prefix[=PREFIX]
If PREFIX is specified, overrides the configured value of $prefix.
(And of exec-prefix, unless --exec-prefix is also specified)
Otherwise, prints out the configured value of $prefix
--exec-prefix[=PREFIX]
If PREFIX is specified, overrides the configured value of $exec_prefix.
Otherwise, prints out the configured value of $exec_prefix
Example of using gtk-config
---------------------------
......@@ -88,6 +98,24 @@ the configure script.
Notes:
* The directory where the GTK libraries are installed needs
to be found by your system's dynamic linker.
This is generally done by
editing /etc/ld.so.conf and running ldconfig
Or by:
setting the environment variable LD_LIBRARY_PATH,
or, as a last resort,
Giving a -R or -rpath flag (depending on your linker) when
running configure, for instance:
LDFLAGS=-R/usr/home/owen/lib ./configure
* You can also specify a gtk-config not in your path by
setting the GTK_CONFIG environment variable to the
name of the executable
......@@ -96,9 +124,16 @@ Notes:
you will need either need to modify gtk-config script
manually to point to the new location or rebuild GTK.
[ As a future enhancement AM_PATH_GTK should support options
to override the default locations found in gtk-config ]
Advanced note:
* configure flags
--with-gtk-prefix=PREFIX
--with-gtk-exec-prefix=PREFIX
are provided to override the prefix and exec-prefix that were stored
in the gtk-config shell script by GTK's configure. You are generally
better off configuring GTK with the right path to begin with.
Example of a package using AM_PATH_GTK
--------------------------------------
......
......@@ -2,28 +2,55 @@
prefix=@prefix@
exec_prefix=@exec_prefix@
libdir=@libdir@
exec_prefix_set=no
usage="\
Usage: gtk-config [--version] [--libs] [--cflags]"
Usage: gtk-config [--prefix[=DIR]] [--exec-prefix[=DIR]] [--version] [--libs] [--cflags]"
if test $# -ne 1 ; then
echo "${usage}" 1>&2
exit 1
if test $# -eq 0; then
echo "${usage}" 1>&2
exit 1
fi
case $1 in
--version)
echo @GTK_VERSION@
;;
--cflags)
echo -I$libdir/glib/include -I@includedir@ @x_cflags@
;;
--libs)
echo -L@libdir@ @x_ldflags@ -lgtk -lgdk -lglib @x_libs@ -lm
;;
*)
echo "${usage}" 1>&2
exit 1
;;
esac
while test $# -gt 0; do
case "$1" in
-*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
*) optarg= ;;
esac
case $1 in
--prefix=*)
prefix=$optarg
if test $exec_prefix_set = no ; then
exec_prefix=$optarg
fi
;;
--prefix)
echo $prefix
;;
--exec-prefix=*)
exec_prefix=$optarg
exec_prefix_set=yes
;;
--exec-prefix)
echo $exec_prefix
;;
--version)
echo @GTK_VERSION@
;;
--cflags)
libdir=@libdir@
echo -I$libdir/glib/include -I@includedir@ @x_cflags@
;;
--libs)
libdir=@libdir@
echo -L@libdir@ @x_ldflags@ -lgtk -lgdk -lglib @x_libs@ -lm
;;
*)
echo "${usage}" 1>&2
exit 1
;;
esac
shift
done
......@@ -8,13 +8,31 @@ AC_DEFUN(AM_PATH_GTK,
[dnl
dnl Get the cflags and libraries from the gtk-config script
dnl
AC_ARG_WITH(gtk-prefix,[ --with-gtk-prefix=PFX Prefix where GTK is installed (optional)],
gtk_config_prefix="$withval", gtk_config_prefix="")
AC_ARG_WITH(gtk-exec-prefix,[ --with-gtk-exec-prefix=PFX Exec prefix where GTK is installed (optional)],
gtk_config_exec_prefix="$withval", gtk_config_exec_prefix="")
if test x$gtk_config_exec_prefix != x ; then
gtk_config_args="$gtk_config_args --exec-prefix=$gtk_config_exec_prefix"
if test x${GTK_CONFIG+set} != xset ; then
GTK_CONFIG=$gtk_config_exec_prefix/bin/gtk-config
fi
fi
if test x$gtk_config_prefix != x ; then
gtk_config_args="$gtk_config_args --prefix=$gtk_config_prefix"
if test x${GTK_CONFIG+set} != xset ; then
GTK_CONFIG=$gtk_config_prefix/bin/gtk-config
fi
fi
AC_PATH_PROG(GTK_CONFIG, gtk-config, no)
min_gtk_version=ifelse([$1], ,0.99.7,$1)
AC_MSG_CHECKING(for GTK - version >= $min_gtk_version)
no_gtk=""
if test "$GTK_CONFIG" != "no" ; then
GTK_CFLAGS=`$GTK_CONFIG --cflags`
GTK_LIBS=`$GTK_CONFIG --libs`
GTK_CFLAGS=`$GTK_CONFIG $gtk_config_args --cflags`
GTK_LIBS=`$GTK_CONFIG $gtk_config_args --libs`
ac_save_CFLAGS="$CFLAGS"
ac_save_LIBS="$LIBS"
CFLAGS="$CFLAGS $GTK_CFLAGS"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment