File: configure.in

package info (click to toggle)
libofx 1%3A0.9.4-2.1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 8,020 kB
  • sloc: sh: 10,143; cpp: 6,212; ansic: 2,459; makefile: 212; xml: 61
file content (380 lines) | stat: -rw-r--r-- 11,615 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
## -*-m4-*-

dnl Process this file with autoconf to produce a configure script.

# FILE:
# configure.in
#
# FUNCTION:
# implements checks for a variety of system-specific functions

AC_INIT(inc/libofx.h.in)
AM_CONFIG_HEADER(config.h)
AC_CONFIG_AUX_DIR(config)
AC_CONFIG_MACRO_DIR(m4)
AC_PROG_CC
AC_PROG_CXX

m4_include([libcurl.m4])

LIBOFX_MAJOR_VERSION=0
LIBOFX_MINOR_VERSION=9
LIBOFX_MICRO_VERSION=4
# this number is just incremented for every major change in CVS, also across
# releases to emulate the Revision variable of SVN (which isn't available
# with CVS)
LIBOFX_BUILD_VERSION=0
LIBOFX_TAG_VERSION="stable"

case "$LIBOFX_TAG_VERSION" in
  cvs|svn|git)
     LIBOFX_VERSION_RELEASE_STRING="$LIBOFX_MAJOR_VERSION.$LIBOFX_MINOR_VERSION.$LIBOFX_MICRO_VERSION.r${LIBOFX_BUILD_VERSION}"
     ;;
  stable)
     LIBOFX_VERSION_RELEASE_STRING="$LIBOFX_MAJOR_VERSION.$LIBOFX_MINOR_VERSION.$LIBOFX_MICRO_VERSION"
     ;;
  *)
     LIBOFX_VERSION_RELEASE_STRING="$LIBOFX_MAJOR_VERSION.$LIBOFX_MINOR_VERSION.$LIBOFX_MICRO_VERSION"
     
     # add TAG
     LIBOFX_VERSION_RELEASE_STRING="${LIBOFX_VERSION_RELEASE_STRING}${GWENHYWFAR_VERSION_TAG}"
     ;;
esac


LIBOFX_VERSION=$LIBOFX_MAJOR_VERSION.$LIBOFX_MINOR_VERSION.$LIBOFX_MICRO_VERSION

AC_SUBST(LIBOFX_MAJOR_VERSION)
AC_SUBST(LIBOFX_MINOR_VERSION)
AC_SUBST(LIBOFX_MICRO_VERSION)
AC_SUBST(LIBOFX_BUILD_VERSION)
AC_SUBST(LIBOFX_VERSION_RELEASE_STRING)
AC_SUBST(LIBOFX_VERSION)
AM_INIT_AUTOMAKE(libofx,$LIBOFX_VERSION_RELEASE_STRING)

LIBOFX_SO_CURRENT=4
LIBOFX_SO_REVISION=2
LIBOFX_SO_AGE=0
LIBOFX_SO_EFFECTIVE="`echo \$(($LIBOFX_SO_CURRENT-$LIBOFX_SO_AGE))`"
AC_SUBST(LIBOFX_SO_CURRENT)
AC_SUBST(LIBOFX_SO_REVISION)
AC_SUBST(LIBOFX_SO_AGE)

#AM_MAINTAINER_MODE

AC_PROG_INSTALL

AC_PROG_LIBTOOL
AC_LIBTOOL_DLOPEN
AC_LIBTOOL_WIN32_DLL
AC_LIBTOOL_RC

AC_ISC_POSIX
AC_C_BIGENDIAN
AC_PROG_MAKE_SET
AC_HEADER_STDC

AQ_CHECK_OS


AC_ARG_WITH(opensp-includes, 
[  --with-opensp-includes=PATH     specify where to look for OpenSP includes  
                                  - default is /usr/include/OpenSP)],
			OPENSPINCLUDES="$with_opensp_includes",
			OPENSPINCLUDES="" )

AC_ARG_WITH(opensp-libs, 
[  --with-opensp-libs=PATH         specify where to look for libosp 
                                  - default is /usr/lib],
			OPENSPLIBPATH="$with_opensp_libs",
			OPENSPLIBPATH="/usr/lib")
			
			echo $OPENSPLIBPATH
for d in /usr/include/OpenSP /usr/local/include/OpenSP /usr/include/sp/generic /usr/local/include/sp/generic; do
    if test "x$OPENSPINCLUDES" = x; then
	save_CPPFLAGS="$CPPFLAGS"
	CPPFLAGS="$CPPFLAGS -I$d"
	AC_MSG_CHECKING(for ParserEventGenerator.h in $d)
	AC_TRY_CPP([#include <ParserEventGeneratorKit.h>],
	[ AC_MSG_RESULT(yes); OPENSPINCLUDES=$d ], [ AC_MSG_RESULT(no) ])
	CPPFLAGS="$save_CPPFLAGS"
    fi
done

##Detect if OpenSP was compiled with SP_MULTI_BYTE, and put the result in config.h
##

#if 0
##This test works for me, but breaks for most distro because the config.h installed isn't really the one that was used to compile OpenSP
## So --with-opensp-multibyte is now the default.
AC_DEFUN([CHECK_SP_MULTI_BYTE],
 [
AC_CACHE_VAL(ox_sp_multibyte,
   [
 for d in $OPENSPINCLUDES/config.h $OPENSPINCLUDES/../config.h $OPENSPINCLUDES/../include/config.h ; do
    if test "x$OPENSPCONFIG_H" = x; then
	save_CPPFLAGS="$CPPFLAGS"
	CPPFLAGS="$CPPFLAGS -DOPENSPCONFIG_H=\"$d\""
	AC_MSG_CHECKING(for OpenSP's config.h in $d)
	AC_TRY_CPP([#include OPENSPCONFIG_H],
	[ AC_MSG_RESULT(yes); OPENSPCONFIG_H=$d ], [ AC_MSG_RESULT(no) ])
	CPPFLAGS="$save_CPPFLAGS"
    fi
 done
 if test "x$OPENSPCONFIG_H" = x; then
	AC_MSG_ERROR([OpenSP's config.h not found])
 fi
AC_MSG_CHECKING(for if OpenSP's was compiled with SP_MULTI_BYTE)
    ox_sp_multibyte=`sed 's/^#.*SP_MULTI_BYTE[ \t]*\([01]\)/\1/;t;d' < \
            $OPENSPCONFIG_H`])
     if test x"$ox_sp_multibyte" != x ;then
         AC_DEFINE_UNQUOTED(SP_MULTI_BYTE, $ox_sp_multibyte, [SP_MULTI_BYTE value from when OpenSP was compiled])
		 AC_MSG_RESULT(yes)
     else
AC_MSG_RESULT(no)
    fi
 ])
#endif

 AC_ARG_WITH(no-opensp-multibyte, 	
[  --with-no-opensp-multibyte     Force libofx to compile with the assumption that OpenSP was NOT compiled with SP_MULTI_BYTE defined],
		,
			AC_DEFINE(SP_MULTI_BYTE, 1, [SP_MULTI_BYTE value from when OpenSP was compiled])	 )
			
##if test x"$SP_MULTI_BYTE" == x ;then
##CHECK_SP_MULTI_BYTE
##fi

ac_save_CPPFLAGS="$CPPFLAGS"
if test "x$OPENSPINCLUDES" != x ; then
  CPPFLAGS="-I$OPENSPINCLUDES $CPPFLAGS"
fi
AC_LANG_CPLUSPLUS 
AC_CHECK_HEADERS([ParserEventGeneratorKit.h SGMLApplication.h EventGenerator.h], 
				[] , 
				[ AC_MSG_ERROR([OpenSP includes not found]) ], 
				[] )
				
OPENSPLIBS="-L$OPENSPLIBPATH -losp"
ac_save_LIBS="$LIBS"
LIBS="$OPENSPLIBS $LIBS"

AC_MSG_CHECKING([for libosp])
##dnl This is code from the opensp documentation, I modified it a little
##dnl It is really just a link test rather than a run test, it does nothing
AC_LANG_CPLUSPLUS 
	AC_TRY_RUN([
		#include "ParserEventGeneratorKit.h"
		using namespace std;
		class OutlineApplication : public SGMLApplication {
		public:
		  OutlineApplication() { }
		  void startElement(const StartElementEvent &event) {
		  }
		  void endElement(const EndElementEvent &) { }

		};
		int main(int argc, char **argv)
		{
		  ParserEventGeneratorKit parserKit;
		  EventGenerator *egp = parserKit.makeEventGenerator(argc - 1, argv + 1);
		  OutlineApplication app;
		}
	],
	[AC_MSG_RESULT([yes])],
	[AC_MSG_RESULT([no])
	AC_MSG_ERROR([unable to link a test program, is OpenSP installed?])],
	[AC_MSG_RESULT([unknown, assumed OK])])
				
CPPFLAGS="$ac_save_CPPFLAGS"
LIBS="$ac_save_LIBS"		

 
# check for doxygen, mostly stolen from http://log4cpp.sourceforge.net/
# ----------------------------------------------------------------------------
AC_DEFUN([BB_ENABLE_DOXYGEN],
[
AC_ARG_ENABLE(doxygen, [  --enable-doxygen        enable documentation generation with doxygen (auto)])
AC_ARG_ENABLE(dot, [  --enable-dot            use 'dot' to generate graphs in doxygen (auto)])              
AC_ARG_ENABLE(html-docs, [  --enable-html-docs      enable HTML generation with doxygen (yes)], [], [ enable_html_docs=yes])              
AC_ARG_ENABLE(latex-docs, [  --enable-latex-docs     enable LaTeX documentation generation with doxygen (no)], [], [ enable_latex_docs=no])              
if test "x$enable_doxygen" = xno; then
        enable_doc=no
else 
        AC_PATH_PROG(DOXYGEN, doxygen, , $PATH)
        if test x$DOXYGEN = x; then
                if test "x$enable_doxygen" = xyes; then
                        AC_MSG_ERROR([could not find doxygen])
                fi
                enable_doc=no
        else
                enable_doc=yes
                AC_PATH_PROG(DOT, dot, , $PATH)
        fi
fi
AM_CONDITIONAL(DOC, test x$enable_doc = xyes)

if test x$DOT = x; then
        if test "x$enable_dot" = xyes; then
                AC_MSG_ERROR([could not find dot])
        fi
        enable_dot=no
else
        enable_dot=yes
fi
AM_CONDITIONAL(ENABLE_DOXYGEN, test x$enable_doc = xtrue)
AC_SUBST(enable_dot)
AC_SUBST(enable_html_docs)
AC_SUBST(enable_latex_docs)
])

# check for doxygen
# ----------------------------------------------------------------------------
BB_ENABLE_DOXYGEN

# Check if getopt_long is available
# ----------------------------------------------------------------------------
dnl Available from the GNU Autoconf Macro Archive at:
dnl http://www.gnu.org/software/ac-archive/htmldoc/adl_func_getopt_long.html
dnl
AC_DEFUN([adl_FUNC_GETOPT_LONG],
 [AC_PREREQ(2.49)dnl
  # clean out junk possibly left behind by a previous configuration
  rm -f lib/getopt.h
  # Check for getopt_long support
  AC_CHECK_HEADERS([getopt.h])
  AC_CHECK_FUNCS([getopt_long],,
   [# FreeBSD has a gnugetopt library for this
    AC_CHECK_LIB([gnugetopt],[getopt_long],[AC_DEFINE([HAVE_GETOPT_LONG])],
     [# use the GNU replacement
      AC_LIBOBJ(getopt)
      AC_LIBOBJ(getopt1)
      AC_CONFIG_LINKS([lib/getopt.h:lib/gnugetopt.h])])])])

dnl check for getopt in standard library
adl_FUNC_GETOPT_LONG
AM_CONDITIONAL(NO_GETOPTLONG, test "$ac_cv_func_getopt_long" = no  )

# gengetopt command line parser generation
AC_ARG_ENABLE(gengetopt,
        AS_HELP_STRING(--disable-gengetopt,Disable rebuilding of command line parser with gengetopt),
[case "${enableval}" in
  yes) gengetopt=yes ;;
  no)  gengetopt=no ;;
  *) AC_MSG_ERROR([bad value ${enableval} for --disable-gengetopt]) ;;
esac],[gengetopt=yes])

if test x$gengetopt = xyes ; then
   AC_CHECK_PROG(have_gengetopt, gengetopt, yes, no)

   if test x$have_gengetopt = xno ; then
     AC_MSG_WARN([*** Not rebuilding command line parser as gengetopt is not found ***])
     gengetopt=no
   fi
fi

AM_CONDITIONAL(USE_GENGETOPT, test "x$gengetopt" = xyes)

# check for curl
# ----------------------------------------------------------------------------

LIBCURL_CHECK_CONFIG([yes],[7.9.7], [libcurl_available=yes],  [libcurl_available=no])
if  test "$libcurl_available" = no; then
	AC_MSG_WARN([libcurl is not available. ofxconnect (Direct connect samples) will NOT be built.])
fi

PKG_CHECK_MODULES(LIBXMLPP,libxml++-2.6 >= 2.6,
	[
	AC_DEFINE(HAVE_LIBXMLPP, 1, [Defined if libxml++ is available])
	have_libxmlpp=yes],
        [AC_MSG_WARN([libxml++ 2.6 is not available. ofxconnect (Direct connect samples) will NOT be built.])
	have_libxmlpp=no])

#PKG_CHECK_MODULES(QT,qt-mt >= 3.2,
#	[AC_DEFINE(HAVE_QT, 1, [Defined if Qt Gui is available])],
#        [AC_MSG_WARN([Qt is not available. Some experimental direct connect samples will not be fully functional.])])

build_ofxconnect=no
if test "$libcurl_available" = yes; then
	if test "$have_libxmlpp" = yes; then
		build_ofxconnect=yes
	fi
fi
AM_CONDITIONAL([BUILD_OFXCONNECT], [test "$build_ofxconnect" = yes])

# check for iconv
# ----------------------------------------------------------------------------

AC_ARG_WITH(iconv,
[  --with-iconv[[=DIR]]      add ICONV support (on)])

WITH_ICONV=0
if test "$with_iconv" = "no" ; then
    echo Disabling ICONV support
else
    if test "$with_iconv" != "yes" -a "$with_iconv" != "" ; then
	CPPFLAGS="${CPPFLAGS} -I$with_iconv/include"
	# Export this since our headers include iconv.h
	XML_INCLUDEDIR="${XML_INCLUDEDIR} -I$with_iconv/include"
	ICONV_LIBS="-L$with_iconv/lib"
    fi

    AC_CHECK_HEADER(iconv.h,
	AC_MSG_CHECKING(for iconv)
	AC_TRY_LINK([#include <stdlib.h>
#include <iconv.h>],[
iconv_t cd = iconv_open ("","");
iconv (cd, NULL, NULL, NULL, NULL);],[
	    AC_MSG_RESULT(yes)
	    WITH_ICONV=1],[
	    AC_MSG_RESULT(no)
	    AC_MSG_CHECKING(for iconv in -liconv)

	    _ldflags="${LDFLAGS}"
	    _libs="${LIBS}"
	    LDFLAGS="${LDFLAGS} ${ICONV_LIBS}"
	    LIBS="${LIBS} -liconv"

	    AC_TRY_LINK([#include <stdlib.h>
#include <iconv.h>],[
iconv_t cd = iconv_open ("","");
iconv (cd, NULL, NULL, NULL, NULL);],[
		AC_MSG_RESULT(yes)
		WITH_ICONV=1
		ICONV_LIBS="${ICONV_LIBS} -liconv"
		LIBS="${_libs}"
		LDFLAGS="${_ldflags}"],[
		AC_MSG_RESULT(no)
		LIBS="${_libs}"
		LDFLAGS="${_ldflags}"])]))
fi
AC_DEFINE_UNQUOTED(HAVE_ICONV, $WITH_ICONV, [Defined if libxml++ is available])

AC_SUBST(WITH_ICONV)
AC_SUBST(ICONV_LIBS)
AC_SUBST(ofxconnect)
AC_SUBST(OPENSPINCLUDES)
AC_SUBST(OPENSPLIBS)
AC_SUBST(LIBXMLPP_CFLAGS)
AC_SUBST(LIBXMLPP_LIBS)
AC_SUBST(QT_CFLAGS)
AC_SUBST(QT_CFLAGS)

LIBOFX_DTD_DIR='${datadir}/libofx/dtd'
AC_SUBST(LIBOFX_DTD_DIR)

	AC_CONFIG_FILES([Makefile])
AC_OUTPUT( 		
	   		libofx.spec
			libofx.pc
			libofx.lsm
			m4/Makefile
			lib/Makefile
			inc/Makefile
			inc/libofx.h
			dtd/Makefile
			doc/Makefile
			ofx2qif/Makefile
			ofxdump/Makefile
			ofxconnect/Makefile
			)