You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by am...@apache.org on 2014/04/28 11:27:27 UTC

svn commit: r1590579 - /xerces/c/trunk/m4/xerces_curl_prefix.m4

Author: amassari
Date: Mon Apr 28 09:27:27 2014
New Revision: 1590579

URL: http://svn.apache.org/r1590579
Log:
Use LIBS variable instead of LDFLAGS to specify the location of cURL (XERCESC-2028). Patch by Zane U. Ji

Modified:
    xerces/c/trunk/m4/xerces_curl_prefix.m4

Modified: xerces/c/trunk/m4/xerces_curl_prefix.m4
URL: http://svn.apache.org/viewvc/xerces/c/trunk/m4/xerces_curl_prefix.m4?rev=1590579&r1=1590578&r2=1590579&view=diff
==============================================================================
--- xerces/c/trunk/m4/xerces_curl_prefix.m4 (original)
+++ xerces/c/trunk/m4/xerces_curl_prefix.m4 Mon Apr 28 09:27:27 2014
@@ -14,10 +14,10 @@ AC_DEFUN([XERCES_CURL_PREFIX],
 	AC_ARG_WITH([curl],
 		[AS_HELP_STRING([--with-curl[[[[=DIR]]]]],[Specify location of libcurl])],
 		[
-                  if test x"$with_curl" = x"yes"; then
-                    with_curl=
-                  fi
-                ],
+			if test x"$with_curl" = x"yes"; then
+				with_curl=
+			fi
+		],
 		[with_curl=])
 
 	# Determine if curl is available
@@ -26,49 +26,49 @@ AC_DEFUN([XERCES_CURL_PREFIX],
 		xerces_cv_curl_present=no
 		if test x"$with_curl" != x"no"; then
 
-                  # See if we were given a prefix.
-                  #
-		  if test -n "$with_curl"; then
-                    AC_PATH_PROG([curl_config], [curl-config],[],[$with_curl/bin])
-                  else
-                    AC_PATH_PROG([curl_config], [curl-config],[])
-                  fi
-
-                  if test -n "$curl_config"; then
-                    curl_flags=`$curl_config --cflags`
-		    curl_libs=`$curl_config --libs`
-                  else
-                    if test -n "$with_curl"; then
-                      curl_flags="-I$with_curl/include"
-     		      curl_libs="-L$with_curl/lib -lcurl"
-                    else
-                      # Default compiler paths.
-                      #
-                      curl_flags=
-     		      curl_libs=-lcurl
-                    fi
-                  fi
-
-                  # Check that the headers exist and can be compiled.
-                  #
-                  orig_cppflags=$CPPFLAGS
-                  if test -n "$curl_flags"; then
-		    CPPFLAGS="$curl_flags $CPPFLAGS"
-                  fi
-                  AC_CHECK_HEADER([curl/curl.h], [xerces_cv_curl_present=yes])
-		  CPPFLAGS=$orig_cppflags
-
-                  if test x"$xerces_cv_curl_present" != x"no"; then
-
-                    # Check that the library can be linked.
-                    #
-                    AC_MSG_CHECKING([for curl_multi_init in -lcurl])
+		# See if we were given a prefix.
+		#
+		if test -n "$with_curl"; then
+			AC_PATH_PROG([curl_config], [curl-config],[],[$with_curl/bin])
+		else
+			AC_PATH_PROG([curl_config], [curl-config],[])
+		fi
+
+		if test -n "$curl_config"; then
+			curl_flags=`$curl_config --cflags`
+			curl_libs=`$curl_config --libs`
+		else
+			if test -n "$with_curl"; then
+				curl_flags="-I$with_curl/include"
+				curl_libs="-L$with_curl/lib -lcurl"
+			else
+				# Default compiler paths.
+				#
+				curl_flags=
+				curl_libs=-lcurl
+			fi
+		fi
+
+		# Check that the headers exist and can be compiled.
+		#
+		orig_cppflags=$CPPFLAGS
+		if test -n "$curl_flags"; then
+			CPPFLAGS="$curl_flags $CPPFLAGS"
+		fi
+		AC_CHECK_HEADER([curl/curl.h], [xerces_cv_curl_present=yes])
+		CPPFLAGS=$orig_cppflags
+
+		if test x"$xerces_cv_curl_present" != x"no"; then
+
+			# Check that the library can be linked.
+			#
+			AC_MSG_CHECKING([for curl_multi_init in -lcurl])
 
-		    orig_ldflags=$LDFLAGS
-		    LDFLAGS="$curl_libs $LDFLAGS"
+			orig_libs=$LIBS
+			LIBS="$curl_libs $LIBS"
 
-                    AC_LINK_IFELSE(
-		    AC_LANG_SOURCE[[
+			AC_LINK_IFELSE(
+				AC_LANG_SOURCE[[
                     #include <curl/curl.h>
                     #include <curl/multi.h>
                     #include <curl/easy.h>
@@ -78,21 +78,21 @@ AC_DEFUN([XERCES_CURL_PREFIX],
                       curl_multi_init();
                       return 0;
                     }
-		    ]],
-		    [], [xerces_cv_curl_present=no])
+				]],
+				[], [xerces_cv_curl_present=no])
 
-		    LDFLAGS=$orig_ldflags
+			LIBS=$orig_libs
 
-                    if test x"$xerces_cv_curl_present" != x"no"; then
-		      AC_MSG_RESULT([yes])
-                    else
-                      AC_MSG_RESULT([no])
-                    fi
-                  fi
+			if test x"$xerces_cv_curl_present" != x"no"; then
+				AC_MSG_RESULT([yes])
+			else
+				AC_MSG_RESULT([no])
+			fi
 		fi
+	fi
 	])
 
-        AC_CACHE_VAL([xerces_cv_curl_flags], [xerces_cv_curl_flags=$curl_flags])
+	AC_CACHE_VAL([xerces_cv_curl_flags], [xerces_cv_curl_flags=$curl_flags])
 	AC_CACHE_VAL([xerces_cv_curl_libs], [xerces_cv_curl_libs=$curl_libs])
 
 	AC_SUBST([CURL_PRESENT], [$xerces_cv_curl_present])



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@xerces.apache.org
For additional commands, e-mail: commits-help@xerces.apache.org