From f1a3198058766851b4539d08f6010e3879c3a047 Mon Sep 17 00:00:00 2001 From: Patrick Ohly Date: Sun, 17 Aug 2008 09:26:34 +0000 Subject: [PATCH] fixed libcurl link error with --enable-shared git-svn-id: https://zeitsenke.de/svn/SyncEvolution/trunk@731 15ad00c4-1369-45f4-8270-35d70d36bdcd --- configure-pre.in | 34 ++++++++++++++++++++++++++++++++++ src/core/Makefile.am | 2 +- 2 files changed, 35 insertions(+), 1 deletion(-) diff --git a/configure-pre.in b/configure-pre.in index 1648d0d2..91a69760 100644 --- a/configure-pre.in +++ b/configure-pre.in @@ -100,6 +100,40 @@ FUNAMBOL_LIB=$PWD/src/client-api.build/src/libfunambol.la AC_SUBST(CLEAN_CLIENT_SRC) +case $target in +*apple-darwin*) use_mac_ta="yes" ;; +*) use_libcurl="yes" ;; +esac + +# Check for libcurl now instead of during make. +# Strictly speaking, building libfunambol takes +# care of that, but because we build it in a +# slightly unusual way (build libfunambol.a with +# -fPIC, include just the required object files +# in libsyncevolution) libtool doesn't pick up +# that dependency and we have to add libcurl to +# out link flags ourselves. +AC_MSG_CHECKING([for libcurl]) +if TRANSPORT_LDFLAGS=`sh -c 'curl-config --libs' 2>&AS_MESSAGE_LOG_FD` && \ + TRANSPORT_CFLAGS=`sh -c 'curl-config --cflags' 2>&AS_MESSAGE_LOG_FD`; then + AC_MSG_RESULT([found]) +else + AC_MSG_RESULT([missing]) + # FIXME: hard-coded check for Mac (same as in libfunambol) + case $target in + *apple-darwin*) TRANSPORT_LDFLAGS="-framework CoreServices" ;; + *) AC_MSG_ERROR([libcurl is required, check that its development package is installed and curl-config is in your PATH]) ;; + esac +fi +AC_SUBST(TRANSPORT_LDFLAGS) +AC_SUBST(TRANSPORT_CFLAGS) + +if test "x$use_mac_ta" = "xyes"; then + CURL_LDFLAGS="-framework CoreServices" + AC_SUBST(CURL_LDFLAGS) +fi + + if test ! "$FUNAMBOL"; then if test "$FUNAMBOLSRC"; then # make a copy of the sources, remove it during maintainer-clean and distclean diff --git a/src/core/Makefile.am b/src/core/Makefile.am index 9ae5fb46..5859b308 100644 --- a/src/core/Makefile.am +++ b/src/core/Makefile.am @@ -66,7 +66,7 @@ CORE_SOURCES = \ $(VOCL_SOURCES) libsyncevolution_la_SOURCES = $(CORE_SOURCES) -libsyncevolution_la_LIBADD = @FUNAMBOL_LIBS@ @EPACKAGE_LIBS@ @GLIB_LIBS@ @LIBS@ +libsyncevolution_la_LIBADD = @FUNAMBOL_LIBS@ @TRANSPORT_LDFLAGS@ @EPACKAGE_LIBS@ @GLIB_LIBS@ @LIBS@ libsyncevolution_la_CXXFLAGS = $(SYNCEVOLUTION_CXXFLAGS) # include boost in distribution