1 dnl Check for APR Libraries
2 dnl CHECK_APR(ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND])
20 [AC_HELP_STRING([--with-apr=PATH],[Path to apr prefix or config script])],
21 [test_paths="${with_apr}"],
22 [test_paths="/usr/local/libapr /usr/local/apr /usr/local /opt/libapr /opt/apr /opt /usr"])
24 AC_MSG_CHECKING([for libapr config script])
26 for x in ${test_paths}; do
27 dnl # Determine if the script was specified and use it directly
28 if test ! -d "$x" -a -e "$x"; then
34 dnl # Try known config script names/locations
35 for APR_CONFIG in apr-1-mt-config apr-1-config apr-config-1 apr-mt-config-1 apr-mt-config apr-config; do
36 if test -e "${x}/bin/${APR_CONFIG}"; then
39 elif test -e "${x}/${APR_CONFIG}"; then
46 if test -n "$apr_path"; then
51 if test -n "${apr_path}"; then
52 if test "${apr_path}" != "no"; then
53 APR_CONFIG="${apr_path}/${APR_CONFIG}"
55 AC_MSG_RESULT([${APR_CONFIG}])
56 APR_CFLAGS="`${APR_CONFIG} --includes --cppflags --cflags`"
57 if test "$verbose_output" -eq 1; then AC_MSG_NOTICE(apr CFLAGS: $APR_CFLAGS); fi
58 APR_LDFLAGS="`${APR_CONFIG} --ldflags`"
59 if test "$verbose_output" -eq 1; then AC_MSG_NOTICE(apr LDFLAGS: $APR_LDFLAGS); fi
60 APR_LIBS="`${APR_CONFIG} --libs`"
61 if test "$verbose_output" -eq 1; then AC_MSG_NOTICE(apr LIBS: $APR_LIBS); fi
62 APR_LINK_LD="`${APR_CONFIG} --link-ld`"
63 if test "$verbose_output" -eq 1; then AC_MSG_NOTICE(apr LINK_LD: $APR_LINK_LD); fi
75 if test -z "${APR_LIBS}"; then
76 AC_MSG_NOTICE([*** apr library not found.])
77 ifelse([$2], , AC_MSG_ERROR([apr library is required]), $2)
79 AC_MSG_NOTICE([using '${APR_LIBS}' for apr Library])