Imported Upstream version 3.3.1
[debian/amanda] / config / amanda / libs.m4
index 1cee766753bca0f603fef60bca5ddb450506dcb9..b853132c657509f0c382b9774ecba9c593426998 100644 (file)
@@ -98,13 +98,14 @@ AC_DEFUN([AMANDA_CHECK_NET_LIBS], [
 #   "out of the box" on more boxes.
 #
 AC_DEFUN([AMANDA_CHECK_GLIB], [
-    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
+    AC_ARG_VAR(GLIB_CFLAGS, [CFLAGS to build with glib; disables use of pkg-config; must specify all GLIB_ vars])
+    AC_ARG_VAR(GLIB_LIBS, [libraries to build with glib; disables use of pkg-config; must specify all GLIB_vars])
+    AC_ARG_VAR(GLIB_GENMARSHAL, [genmarshal binary to use with glib; disables use of pkg-config; must specify all GLIB_ vars])
+    AC_ARG_VAR(GOBJECT_QUERY, [gobject_query binary to use with glib; disables use of pkg-config; must specify all GLIB_ vars])
+    AC_ARG_VAR(GLIB_MKENUMS, [mkenums binary to use with glib; disables use of pkg-config; must specify all GLIB_ vars])
+
+    # if any of the precious variables are set, disable the pkg-config run.
+    # Further, if any is specified, all must be specified.
     explicit_glib=no
     test x"$GLIB_CFLAGS" = x"" || explicit_glib=yes
     test x"$GLIB_LIBS" = x"" || explicit_glib=yes
@@ -134,7 +135,16 @@ AC_DEFUN([AMANDA_CHECK_GLIB], [
            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)
+        # Confirm that all GLIB_ variables are set
+        if test ! x"$GLIB_CFLAGS" = x"" && \
+           test ! x"$GLIB_LIBS" = x"" && \
+           test ! x"$GLIB_GENMARSHAL" = x"" && \
+           test ! x"$GOBJECT_QUERY" = x"" && \
+           test ! x"$GLIB_MKENUMS" = x""; then
+            :
+        else
+            AC_MSG_ERROR(Not all precious glib variables were set.)
+        fi
     fi
 
     # GLIB_CPPFLAGS is not set by autoconf, yet GLIB_CFLAGS contains what GLIB_CPPFLAGS should contain.
@@ -296,7 +306,7 @@ AC_DEFUN([LIBCURL_CHECK_CONFIG],
            _libcurl_save_libs=$LIBS
            LIBS="$LIBCURL $LIBS"
 
-           AC_LINK_IFELSE(AC_LANG_PROGRAM([#include <curl/curl.h>],[
+           AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <curl/curl.h>]],[[
 /* Try and use a few common options to force a failure if we are
    missing symbols or can't link. */
 int x;
@@ -307,7 +317,7 @@ x=CURLOPT_FILE;
 x=CURLOPT_ERRORBUFFER;
 x=CURLOPT_STDERR;
 x=CURLOPT_VERBOSE;
-]),libcurl_cv_lib_curl_usable=yes,libcurl_cv_lib_curl_usable=no)
+]])],[libcurl_cv_lib_curl_usable=yes],[libcurl_cv_lib_curl_usable=no])
 
            CPPFLAGS=$_libcurl_save_cppflags
            LIBS=$_libcurl_save_libs