libofx 0.8.0 problem with CURL

Derek Atkins <[email protected]> Thu, 8 Dec 2005 19:35:43 -0500
Newsgroups gmane.comp.finance.libofx.devel
Message-ID <[email protected]>
Hi,

The libofx build system requires curl-devel, but doesn't do
anything with it other than check the version.  It doesn't
verify that you can build against curl (and if you can't
because, e.g. you don't have curl-devel installed) configure
still completes and the build bombs out.  The build system
also makes assumptions about what libraries are required for
curl and where they are located on the system (/usr).

The enclosed patch fixes the second problem, but not the first.
It actually uses curl-config to obtain the compile and link
flags.

This patch is against 0.8.0, not CVS.

-derek

-- 
       Derek Atkins, SB '93 MIT EE, SM '95 MIT Media Laboratory
       Member, MIT Student Information Processing Board  (SIPB)
       URL: http://web.mit.edu/warlord/    PP-ASEL-IA     N1NWH
       [email protected]                        PGP key available
ofx.diff (text/x-patch, 974 B)
--- configure.in~	2005-07-29 15:47:28.000000000 -0400
+++ configure.in	2005-12-08 19:20:36.864785249 -0500
@@ -269,6 +269,10 @@
    if test x$ok != x0; then
      my_cv_curl_vers="$ver"
      AC_MSG_RESULT([$my_cv_curl_vers])
+     CURL_INCS=`curl-config --cflags`
+     CURL_LIBS=`curl-config --libs`
+     AC_SUBST(CURL_INCS)
+     AC_SUBST(CURL_LIBS)
    else
      AC_MSG_RESULT(FAILED)
      AC_MSG_WARN([$ver is too old. Need version $check or higher.])
--- ofxconnect/Makefile.am~	2005-07-31 14:34:30.962878972 -0400
+++ ofxconnect/Makefile.am	2005-12-08 19:21:05.185036049 -0500
@@ -1,9 +1,9 @@
 bin_PROGRAMS = ofxconnect
-ofxconnect_LDADD = $(top_builddir)/lib/libofx.la -L/usr/lib -lcurl -lz -lssl -lcrypto -ldl
+ofxconnect_LDADD = $(top_builddir)/lib/libofx.la $(CURL_LIBS)
 ofxconnect_SOURCES = cmdline.h cmdline.c ofxconnect.cpp 
 
 AM_CPPFLAGS = \
-	-I${top_srcdir}/inc
+	-I${top_srcdir}/inc $(CURL_INCS)
 
 if USE_GENGETOPT 
 CLEANFILES = cmdline.c cmdline.h