From bc6c0c76afac3f0614d9274dd199c30e8cbf11e4 Mon Sep 17 00:00:00 2001 From: brectanus Date: Fri, 11 Jan 2008 17:51:58 +0000 Subject: [PATCH] Add the ability to find curl for mlogc. --- apache2/build/find_curl.m4 | 57 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 apache2/build/find_curl.m4 diff --git a/apache2/build/find_curl.m4 b/apache2/build/find_curl.m4 new file mode 100644 index 00000000..668344cd --- /dev/null +++ b/apache2/build/find_curl.m4 @@ -0,0 +1,57 @@ +dnl Check for CURL Libraries +dnl CHECK_CURL(ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]) +dnl Sets: +dnl CURL_CFLAGS +dnl CURL_LIBS + +CURL_CONFIG="curl-config" +CURL_CFLAGS="" +CURL_LIBS="" + +AC_DEFUN([CHECK_CURL], +[dnl + +AC_ARG_WITH( + curl, + [AC_HELP_STRING([--with-curl=PATH],[Path to the curl prefix])], + curl_path="$withval", + :) + +dnl # Determine curl lib directory +if test -z "${curl_path}"; then + test_paths="/usr/local /usr" +else + test_paths="${curl_path}" +fi + +AC_MSG_CHECKING([for libcurl config script]) +for x in ${test_paths}; do + if test -e "${x}/bin/${CURL_CONFIG}"; then + with_curl="${x}/bin" + break + else + with_curl="" + fi +done +if test -n "${with_curl}"; then + CURL_CONFIG="${with_curl}/${CURL_CONFIG}" + AC_MSG_RESULT([${CURL_CONFIG}]) + CURL_CFLAGS="`${CURL_CONFIG} --cflags`" + CURL_LIBS="`${CURL_CONFIG} --libs`" + CFLAGS=$save_CFLAGS + LDFLAGS=$save_LDFLAGS +else + AC_MSG_RESULT([no]) +fi + +AC_SUBST(CURL_LIBS) +AC_SUBST(CURL_CFLAGS) + +if test -z "${CURL_LIBS}"; then + AC_MSG_NOTICE([*** curl library not found.]) + ifelse([$2], , AC_MSG_NOTICE([NOTE: curl library is required for building mlogc]), $2) +else + AC_MSG_NOTICE([using '${CURL_LIBS}' for curl Library]) + ifelse([$1], , , $1) +fi +])