summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorElliot Lee <sopwith@src.gnome.org>1999-11-17 00:47:21 +0000
committerElliot Lee <sopwith@src.gnome.org>1999-11-17 00:47:21 +0000
commitbb9e58b78bf7e02677b89f85cd141f99f72978b6 (patch)
tree724016a2fb9595104162063344f12fb879633a83
parentc90391575a9e4825579f79d274e7d4a70bde5e06 (diff)
downloadgnome-common-bb9e58b78bf7e02677b89f85cd141f99f72978b6.tar.gz
Attempt to fix the .m4 files PROPERLY (ahem ahem, a certain doofus didn't
Attempt to fix the .m4 files PROPERLY (ahem ahem, a certain doofus didn't do a good job the first time around. :) Now, just one gnome.m4 file is installed. Also get rid of gnorba and replace with OAF in appropriate places. svn path=/trunk/; revision=996
-rw-r--r--hack-macros/gnome.m4119
1 files changed, 119 insertions, 0 deletions
diff --git a/hack-macros/gnome.m4 b/hack-macros/gnome.m4
new file mode 100644
index 0000000..3866eb5
--- /dev/null
+++ b/hack-macros/gnome.m4
@@ -0,0 +1,119 @@
+AC_DEFUN(AM_PATH_GNOME,
+[dnl
+dnl Get the cflags and libraries from the gnome-config script
+dnl
+AC_ARG_WITH(gnome-prefix,[ --with-gnome-prefix=PFX Prefix where GNOME is installed (optional)],
+ gnome_config_prefix="$withval", gnome_config_prefix="")
+AC_ARG_WITH(gnome-exec-prefix,[ --with-gnome-exec-prefix=PFX Exec prefix where GNOME is installed (optional)],
+ gnome_config_exec_prefix="$withval", gnome_config_exec_prefix="")
+AC_ARG_ENABLE(gnometest, [ --disable-gnometest Do not try to compile and run a test GNOME program],
+ , enable_gnometest=yes)
+
+ if test x$gnome_config_exec_prefix != x ; then
+ gnome_config_args="$gnome_config_args --exec-prefix=$gnome_config_exec_prefix"
+ if test x${GNOME_CONFIG+set} != xset ; then
+ GNOME_CONFIG=$gnome_config_exec_prefix/bin/gnome-config
+ fi
+ fi
+ if test x$gnome_config_prefix != x ; then
+ gnome_config_args="$gnome_config_args --prefix=$gnome_config_prefix"
+ if test x${GNOME_CONFIG+set} != xset ; then
+ GNOME_CONFIG=$gnome_config_prefix/bin/gnome-config
+ fi
+ fi
+
+ AC_PATH_PROG(GNOME_CONFIG, gnome-config, no)
+ min_gnome_version=ifelse([$1], , 1.1.0, $1)
+
+ AC_MSG_CHECKING(for GNOME - version >= $min_gnome_version)
+ no_gnome=""
+ if test "$GNOME_CONFIG" = "no" ; then
+ no_gnome=yes
+ else
+ GNOME_CFLAGS="`$GNOME_CONFIG $gnome_config_args --cflags gnome`"
+ GNOME_LIBS="`$GNOME_CONFIG $gnome_config_args --libs gnome`"
+ GNOMEUI_CFLAGS="`$GNOME_CONFIG $gnome_config_args --cflags gnomeui`"
+ GNOMEUI_LIBS="`$GNOME_CONFIG $gnome_config_args --libs gnomeui`"
+
+ gnome_config_major_version=`$GNOME_CONFIG $gnome_config_args --version | \
+ sed 's/[^0-9]*\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\1/'`
+ gnome_config_minor_version=`$GNOME_CONFIG $gnome_config_args --version | \
+ sed 's/[^0-9]*\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\2/'`
+ gnome_config_micro_version=`$GNOME_CONFIG $gnome_config_args --version | \
+ sed 's/[^0-9]*\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\3/'`
+ needed_major_version=`echo $min_gnome_version | \
+ sed 's/[^0-9]*\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\1/'`
+ needed_minor_version=`echo $min_gnome_version | \
+ sed 's/[^0-9]*\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\2/'`
+ needed_micro_version=`echo $min_gnome_version | \
+ sed 's/[^0-9]*\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\3/'`
+
+ if test $gnome_config_major_version -lt $needed_major_version; then
+ ifelse([$3], , :, [$3])
+ no_gnome=yes
+ elif test $gnome_config_major_version = $needed_major_version; then
+ if test -n "$needed_minor_version" -a $gnome_config_minor_version -lt $needed_minor_version; then
+ ifelse([$3], , :, [$3])
+ no_gnome=yes
+ elif test -n "$needed_minor_version" -a $gnome_config_minor_version = $needed_minor_version; then
+ if test -n "$needed_micro_version" -a $gnome_config_micro_version -lt $needed_micro_version; then
+ ifelse([$3], , :, [$3])
+ no_gnome=yes
+ fi
+ fi
+ fi
+ fi
+ AC_SUBST(GNOME_CFLAGS)
+ AC_SUBST(GNOME_LIBS)
+ AC_SUBST(GNOMEUI_CFLAGS)
+ AC_SUBST(GNOMEUI_LIBS)
+
+ if test "x$no_gnome" = x ; then
+ AC_MSG_RESULT(yes)
+ ifelse([$2], , :, [$2])
+ else
+ AC_MSG_RESULT(no)
+ if test "$GNOME_CONFIG" = "no" ; then
+ echo "*** The gnome-config script installed by GNOME could not be found"
+ echo "*** If GNOME was installed in PREFIX, make sure PREFIX/bin is in"
+ echo "*** your path, or set the GNOME_CONFIG environment variable to the"
+ echo "*** full path to gnome-config."
+ else
+ fi
+ GNOME_CFLAGS=""
+ GNOME_LIBS=""
+ ifelse([$3], , :, [$3])
+ fi
+
+ tmp_gnome_libdir=`$GNOME_CONFIG $gnome_config_args --libdir`
+ for module in $4; do
+ if test -f $tmp_gnome_libdir/$module'Conf'.sh; then
+ tmp_bsnom=`echo $module | tr a-z A-Z`
+ eval $tmp_bsnom'_CFLAGS'=\"`$GNOME_CONFIG $gnome_config_args --cflags $module`\"
+ eval $tmp_bsnom'_LIBS'=\"`$GNOME_CONFIG $gnome_config_args --libs $module`\"
+ elif test "$module" eq zvt; then
+ ZVT_LIBS="`$GNOME_CONFIG $gnome_config_args --libs zvt`"
+ AC_SUBST(ZVT_LIBS)
+ elif test "$module" eq gtk; then
+ GTK_CFLAGS="`$GNOME_CONFIG $gnome_config_args --cflags gtk`"
+ GTK_LIBS="`$GNOME_CONFIG $gnome_config_args --libs gtk`"
+ AC_SUBST(GTK_CFLAGS)
+ AC_SUBST(GTK_LIBS)
+ elif test "$module" eq "glib"; then
+ GLIB_CFLAGS="`$GNOME_CONFIG $gnome_config_args --cflags glib`"
+ GLIB_LIBS="`$GNOME_CONFIG $gnome_config_args --libs glib`"
+ AC_SUBST(GLIB_CFLAGS)
+ AC_SUBST(GLIB_LIBS)
+ elif test "$module" eq "oaf"; then
+ OAF_CFLAGS="`$GNOME_CONFIG $gnome_config_args --cflags oaf`"
+ OAF_LIBS="`$GNOME_CONFIG $gnome_config_args --libs oaf`"
+ AC_SUBST(OAF_CFLAGS)
+ AC_SUBST(OAF_LIBS)
+ else
+ echo "*** $module library is not installed"
+ ifelse([$3], , :, [$3])
+ fi
+ done
+
+ rm -f conf.gnometest
+])