Re-arranged tests such that "--without-gnome" is fully supported. Not only
authorJeff Garzik <jgarzik@src.gnome.org>
Mon, 30 Nov 1998 08:03:20 +0000 (08:03 +0000)
committerJeff Garzik <jgarzik@src.gnome.org>
Mon, 30 Nov 1998 08:03:20 +0000 (08:03 +0000)
        * gnome.m4: Re-arranged tests such that "--without-gnome" is
        fully supported.  Not only is the logic now correct, programs
        can test "want_gnome=yes/no" for the results of this arg.

svn path=/trunk/; revision=489

macros/ChangeLog
macros/gnome.m4

index 9249337..758a71d 100644 (file)
@@ -1,3 +1,9 @@
+1998-11-30  Jeff Garzik  <jgarzik@pobox.com>
+
+       * gnome.m4: Re-arranged tests such that "--without-gnome" is
+       fully supported.  Not only is the logic now correct, programs
+       can test "want_gnome=yes/no" for the results of this arg.
+
 1998-11-27  Martin Baulig  <martin@home-of-linux.org>
 
        * gnome-libgtop-check.m4: All parts of GNOME will now require
index 4575a24..331a190 100644 (file)
@@ -14,37 +14,6 @@ AC_DEFUN([GNOME_INIT_HOOK],
        AC_SUBST(GNOME_LIBDIR)
        AC_SUBST(GNOME_INCLUDEDIR)
 
-       AC_PATH_PROG(GNOME_CONFIG,gnome-config,no)
-       if test "$GNOME_CONFIG" = "no"; then
-         no_gnome_config="yes"
-       else
-         AC_MSG_CHECKING(if $GNOME_CONFIG works)
-         if $GNOME_CONFIG --libs-only-l gnome >/dev/null 2>&1; then
-           AC_MSG_RESULT(yes)
-           GNOME_GNORBA_HOOK([],$2)
-           GNOME_LIBS="`$GNOME_CONFIG --libs-only-l gnome`"
-           GNOMEUI_LIBS="`$GNOME_CONFIG --libs-only-l gnomeui`"
-           GNOMEGNORBA_LIBS="`$GNOME_CONFIG --libs-only-l gnorba gnomeui`"
-           GTKXMHTML_LIBS="`$GNOME_CONFIG --libs-only-l gtkxmhtml`"
-           GNOME_LIBDIR="`$GNOME_CONFIG --libs-only-L gnorba gnomeui`"
-           GNOME_INCLUDEDIR="`$GNOME_CONFIG --cflags gnorba gnomeui`"
-            $1
-         else
-           AC_MSG_RESULT(no)
-           no_gnome_config="yes"
-          fi
-        fi
-
-       if test x$exec_prefix = xNONE; then
-           if test x$prefix = xNONE; then
-               gnome_prefix=$ac_default_prefix/lib
-           else
-               gnome_prefix=$prefix/lib
-           fi
-       else
-           gnome_prefix=`eval echo \`echo $libdir\``
-       fi
-       
        AC_ARG_WITH(gnome-includes,
        [  --with-gnome-includes   Specify location of GNOME headers],[
        CFLAGS="$CFLAGS -I$withval"
@@ -57,31 +26,73 @@ AC_DEFUN([GNOME_INIT_HOOK],
        ])
 
        AC_ARG_WITH(gnome,
-       [  --with-gnome            Specify prefix for GNOME files],[
-       if test x$withval = xyes; then
-           dnl Note that an empty true branch is not valid sh syntax.
-           ifelse([$1], [], :, [$1])
-        else
-           LDFLAGS="$LDFLAGS -L$withval/lib"
-           CFLAGS="$CFLAGS -I$withval/include"
-           gnome_prefix=$withval/lib
-       fi
-       ])
+       [  --with-gnome            Specify prefix for GNOME files],
+               if test x$withval = xyes; then
+                       want_gnome=yes
+                       dnl Note that an empty true branch is not
+                       dnl valid sh syntax.
+                       ifelse([$1], [], :, [$1])
+               else
+                       if test "x$withval" = xno; then
+                               want_gnome=no
+                       else
+                               want_gnome=yes
+                               LDFLAGS="$LDFLAGS -L$withval/lib"
+                               CFLAGS="$CFLAGS -I$withval/include"
+                               gnome_prefix=$withval/lib
+                       fi
+               fi,
+               want_gnome=yes)
+
+       if test "x$want_gnome" = xyes; then
 
-       if test "$no_gnome_config" = "yes"; then
-          AC_MSG_CHECKING(for gnomeConf.sh file in $gnome_prefix)
-         if test -f $gnome_prefix/gnomeConf.sh; then
-           AC_MSG_RESULT(found)
-           echo "loading gnome configuration from $gnome_prefix/gnomeConf.sh"
-           . $gnome_prefix/gnomeConf.sh
-           $1
-         else
-           AC_MSG_RESULT(not found)
-           if test x$2 = xfail; then
-             AC_MSG_ERROR(Could not find the gnomeConf.sh file that is generated by gnome-libs install)
-           fi
-         fi
-        fi
+           AC_PATH_PROG(GNOME_CONFIG,gnome-config,no)
+           if test "$GNOME_CONFIG" = "no"; then
+             no_gnome_config="yes"
+           else
+             AC_MSG_CHECKING(if $GNOME_CONFIG works)
+             if $GNOME_CONFIG --libs-only-l gnome >/dev/null 2>&1; then
+               AC_MSG_RESULT(yes)
+               GNOME_GNORBA_HOOK([],$2)
+               GNOME_LIBS="`$GNOME_CONFIG --libs-only-l gnome`"
+               GNOMEUI_LIBS="`$GNOME_CONFIG --libs-only-l gnomeui`"
+               GNOMEGNORBA_LIBS="`$GNOME_CONFIG --libs-only-l gnorba gnomeui`"
+               GTKXMHTML_LIBS="`$GNOME_CONFIG --libs-only-l gtkxmhtml`"
+               GNOME_LIBDIR="`$GNOME_CONFIG --libs-only-L gnorba gnomeui`"
+               GNOME_INCLUDEDIR="`$GNOME_CONFIG --cflags gnorba gnomeui`"
+                $1
+             else
+               AC_MSG_RESULT(no)
+               no_gnome_config="yes"
+              fi
+            fi
+
+           if test x$exec_prefix = xNONE; then
+               if test x$prefix = xNONE; then
+                   gnome_prefix=$ac_default_prefix/lib
+               else
+                   gnome_prefix=$prefix/lib
+               fi
+           else
+               gnome_prefix=`eval echo \`echo $libdir\``
+           fi
+       
+           if test "$no_gnome_config" = "yes"; then
+              AC_MSG_CHECKING(for gnomeConf.sh file in $gnome_prefix)
+             if test -f $gnome_prefix/gnomeConf.sh; then
+               AC_MSG_RESULT(found)
+               echo "loading gnome configuration from" \
+                    "$gnome_prefix/gnomeConf.sh"
+               . $gnome_prefix/gnomeConf.sh
+               $1
+             else
+               AC_MSG_RESULT(not found)
+               if test x$2 = xfail; then
+                 AC_MSG_ERROR(Could not find the gnomeConf.sh file that is generated by gnome-libs install)
+               fi
+             fi
+            fi
+       fi
 ])
 
 AC_DEFUN([GNOME_INIT],[