From 8e7b08c0ac3e73eb7f3a38e84af0bb6c9c97efa9 Mon Sep 17 00:00:00 2001 From: Derek Atkins Date: Wed, 30 Oct 2002 17:50:39 +0000 Subject: [PATCH] * configure.in -- improved libofx configure support. Add --with-ofx-prefix so users can define where to look for libofx. * import-export/ofx/Makefile.am -- use new configure glue git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@7424 57a11ea4-9604-0410-9ed3-97b8803252fd --- ChangeLog | 5 +++++ configure.in | 37 +++++++++++++++++++++++++++++++ src/import-export/ofx/Makefile.am | 6 ----- 3 files changed, 42 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4029f1082a..4df1636612 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2002-10-30 Derek Atkins + * configure.in -- improved libofx configure support. Add --with-ofx-prefix + so users can define where to look for libofx. + * import-export/ofx/Makefile.am -- use new configure glue + 2002-10-28 Christian Stimming * intl-scm/xgettext.scm: Add the file name of scheme files to diff --git a/configure.in b/configure.in index f2d0f4d615..f97de6783c 100644 --- a/configure.in +++ b/configure.in @@ -443,8 +443,45 @@ AC_SUBST(RPC_DIR) AC_ARG_ENABLE( ofx, [ --enable-ofx compile with ofx support (needs LibOFX)], OFX_DIR=ofx) +if test x${OFX_DIR} = xofx ; +then + AC_ARG_WITH( ofx-prefix, + [ --with-ofx-prefix=DIR specify where to look for libOFX], + OFXPREFIX="$with_ofx_prefix" ) + if test x${OFXPREFIX} != x ; then + LIBOFX_LIBS="-L${OFXPREFIX}/lib" + LIBOFX_CFLAGS="-I${OFXPREFIX}/include" + fi + LIBOFX_LIBS="${LIBOFX_LIBS} -lofx -lstdc++" + + AC_MSG_CHECKING(for libofx/libofx.h) + save_CPPFLAGS="${CPPFLAGS}" + CPPFLAGS="${CPPFLAGS} ${LIBOFX_CFLAGS}" + AC_TRY_CPP( [#include ], AC_MSG_RESULT(yes), + [ AC_MSG_ERROR([cannot find libofx header, needed for OFX support.]) ] ) + + AC_MSG_CHECKING(for libofx) + save_LIBS="${LIBS}" + LIBS="${LIBS} ${LIBOFX_LIBS}" + AC_TRY_LINK( [ + void ofx_proc_security_cb(void) {} + void ofx_proc_transaction_cb(void) {} + void ofx_proc_statement_cb(void) {} + void ofx_proc_status_cb(void) {} + void ofx_proc_account_cb(void) {} + ], [ + ofx_proc_file(); + ], AC_MSG_RESULT(yes), + [ AC_MSG_ERROR([cannot find libofx library, needed for OFX support.]) ] ) + + LIBS="${save_LIBS}" + CPPFLAGS="${save_CPPFLAGS}" + AC_SUBST(LIBOFX_CFLAGS) + AC_SUBST(LIBOFX_LIBS) +fi AC_SUBST(OFX_DIR) + ### -------------------------------------------------------------------------- ### HBCI AC_ARG_ENABLE( hbci, diff --git a/src/import-export/ofx/Makefile.am b/src/import-export/ofx/Makefile.am index 2bd44a6ec8..6a34b0bc9c 100644 --- a/src/import-export/ofx/Makefile.am +++ b/src/import-export/ofx/Makefile.am @@ -1,11 +1,5 @@ SUBDIRS = . test -# FIXME: this ought to be a configure option -LIBOFX_PREFIX = /usr/local - -LIBOFX_LIBS = -L${LIBOFX_PREFIX}/lib -lofx -lstdc++ -LIBOFX_CFLAGS = -I${LIBOFX_PREFIX}/include - pkglib_LTLIBRARIES=libgncmod-ofx.la libgncmod_ofx_la_SOURCES = \