Imported Upstream version 3.2.0
[debian/amanda] / config / amanda / libs.m4
index e22038f5eb94e288f8525568277340ca9a029de6..6e27add4cc9fa5e15e9a3a7f148210bdc284224f 100644 (file)
@@ -100,26 +100,45 @@ AC_DEFUN([AMANDA_CHECK_NET_LIBS], [
 #   "out of the box" on more boxes.
 #
 AC_DEFUN([AMANDA_CHECK_GLIB], [
-    # search for pkg-config, which the glib configuration uses, adding a few
-    # system-specific search paths.
-    AC_PATH_PROG(PKG_CONFIG, pkg-config, [], $LOCSYSPATH:/opt/csw/bin:/usr/local/bin:/opt/local/bin)
-
-    case "$host" in
-       sparc-sun-solaris2.8) # Solaris 8
-           # give the linker a runtime search path; pkg-config doesn't supply this.
-           # Users could also specify this with LD_LIBRARY_PATH to both ./configure
-           # and make.  Adding this support here makes straight './configure; make'
-           # "just work" on Solaris 8
-           if test -n "$PKG_CONFIG"; then
-               glib_R_flag=`$PKG_CONFIG glib-2.0 --libs-only-L 2>/dev/null | sed -e 's/-L/-R/g'`
-               LDFLAGS="$LDFLAGS $glib_R_flag"
-           fi
-           ;;
-    esac
+    AC_ARG_VAR(GLIB_CFLAGS, [CFLAGS to build with glib; disables use of pkg-config])
+    AC_ARG_VAR(GLIB_LIBS, [libraries to build with glib; disables use of pkg-config])
+    AC_ARG_VAR(GLIB_GENMARSHAL, [genmarshal binary to use with glib; disables use of pkg-config])
+    AC_ARG_VAR(GOBJECT_QUERY, [gobject_query binary to use with glib; disables use of pkg-config])
+    AC_ARG_VAR(GLIB_MKENUMS, [mkenums binary to use with glib; disables use of pkg-config])
+
+    # if any of the precious variables are set, disable the pkg-config run
+    explicit_glib=no
+    test x"$GLIB_CFLAGS" = x"" || explicit_glib=yes
+    test x"$GLIB_LIBS" = x"" || explicit_glib=yes
+    test x"$GLIB_GENMARSHAL" = x"" || explicit_glib=yes
+    test x"$GOBJECT_QUERY" = x"" || explicit_glib=yes
+    test x"$GLIB_MKENUMS" = x"" || explicit_glib=yes
+
+    if test x"$explicit_glib" = x"no"; then
+       # search for pkg-config, which the glib configuration uses, adding a few
+       # system-specific search paths.
+       AC_PATH_PROG(PKG_CONFIG, pkg-config, [], $LOCSYSPATH:/opt/csw/bin:/usr/local/bin:/opt/local/bin)
+
+       case "$host" in
+           sparc-sun-solaris2.8) # Solaris 8
+               # give the linker a runtime search path; pkg-config doesn't supply this.
+               # Users could also specify this with LD_LIBRARY_PATH to both ./configure
+               # and make.  Adding this support here makes straight './configure; make'
+               # "just work" on Solaris 8
+               if test -n "$PKG_CONFIG"; then
+                   glib_R_flag=`$PKG_CONFIG glib-2.0 --libs-only-L 2>/dev/null | sed -e 's/-L/-R/g'`
+                   LDFLAGS="$LDFLAGS $glib_R_flag"
+               fi
+               ;;
+       esac
+
+       AM_PATH_GLIB_2_0(2.2.0,,[
+           AC_MSG_ERROR(glib not found or too old; See http://wiki.zmanda.com/index.php/Installation for help)
+       ], gmodule gobject gthread)
+    else
+       AC_MSG_ERROR(explicit glib)
+    fi
 
-    AM_PATH_GLIB_2_0(2.2.0,,[
-       AC_MSG_ERROR(glib not found or too old; See http://wiki.zmanda.com/index.php/Installation for help)
-    ], gmodule gobject gthread)
     # GLIB_CPPFLAGS is not set by autoconf, yet GLIB_CFLAGS contains what GLIB_CPPFLAGS should contain.
     AMANDA_ADD_CPPFLAGS($GLIB_CFLAGS)
     AMANDA_ADD_LIBS($GLIB_LIBS)