File: configure.ac

package info (click to toggle)
quantlib 0.3.13-2
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 11,964 kB
  • ctags: 11,071
  • sloc: cpp: 69,443; ansic: 21,483; sh: 8,860; makefile: 1,824; lisp: 86
file content (371 lines) | stat: -rw-r--r-- 14,870 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
# Process this file with autoconf to produce a configure script.
AC_INIT([QuantLib], [0.3.13],
        [quantlib-dev@lists.sourceforge.net],
        [QuantLib])
AC_PREREQ(2.50)
AC_CONFIG_SRCDIR([ql/qldefines.hpp])
AC_CONFIG_AUX_DIR([config])
AC_CONFIG_HEADERS([ql/config.hpp])
AM_INIT_AUTOMAKE([foreign])

AC_COPYRIGHT([
Copyright (C) 2004, 2005 Ferdinando Ametrano
Copyright (C) 2000, 2001, 2002, 2003 RiskMap srl
Copyright (C) 2003, 2004, 2005, 2006 StatPro Italia srl

This file is part of QuantLib, a free-software/open-source library
for financial quantitative analysts and developers - http://quantlib.org/

QuantLib is free software: you can redistribute it and/or modify it
under the terms of the QuantLib license.  You should have received a
copy of the license along with this program; if not, please email
<quantlib-dev@lists.sf.net>. The license is also available online at
<http://quantlib.org/reference/license.html>.

This program is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE.  See the license for more details.])

AC_PROG_AWK
AC_PROG_INSTALL

# Default compilation variables

AC_SUBST([CXXFLAGS],[${CXXFLAGS='-g -O2 -Wall'}])

# Help the compiler find external software

AC_ARG_WITH([boost-include],
            AC_HELP_STRING([--with-boost-include=INCLUDE_PATH],
                           [Supply the location of Boost header files]),
            [ql_boost_include_path="`cd ${withval} 2>/dev/null && pwd`"],
            [ql_boost_include_path=""])
if test [ -n "$ql_boost_include_path" ] ; then
   AC_SUBST([BOOST_INCLUDE],["-I${ql_boost_include_path}"])
   AC_SUBST([CPPFLAGS],["${CPPFLAGS} -I${ql_boost_include_path}"])
fi
AC_ARG_WITH([boost-lib],
            AC_HELP_STRING([--with-boost-lib=LIB_PATH],
                           [Supply the location of Boost libraries]),
            [ql_boost_lib_path="`cd ${withval} 2>/dev/null && pwd`"],
            [ql_boost_lib_path=""])
if test [ -n "$ql_boost_lib_path" ] ; then
   AC_SUBST([BOOST_LIB],["-L${ql_boost_lib_path}"])
   AC_SUBST([LDFLAGS],["${LDFLAGS} -L${ql_boost_lib_path}"])
fi


# Continue setup

AC_PROG_CC
AC_PROG_CXX
AC_PROG_CPP
AC_PROG_LIBTOOL

AM_CONDITIONAL(ENABLE_STATIC, test "${enable_static}" == "yes")

AC_LANG([C++])

# Check for mandatory features

QL_CHECK_CONSTANT([M_PI],[double],[cmath],
                  [3.141592653589793238462643383280],[pi])
QL_CHECK_CONSTANT([M_SQRT_2],[double],[cmath],
                  [0.7071067811865475244008443621048],[1/sqrt(2)])
QL_CHECK_CONSTANT([M_SQRTPI],[double],[cmath],
                  [1.77245385090551602792981],[sqrt(pi)])
QL_CHECK_CONSTANT([M_1_SQRTPI],[double],[cmath],
                  [0.564189583547756286948],[1/sqrt(pi)])

# Check for Boost components
QL_CHECK_BOOST
AM_CONDITIONAL(BOOST_UNIT_TEST_FOUND, test "x${BOOST_UNIT_TEST_LIB}" != "x")

# Check for optional features
QL_CHECK_LONG_LONG

# Check for Emacs
AM_PATH_LISPDIR
AM_CONDITIONAL(EMACS_FOUND, test "${EMACS}" != "no")

# Check for tools needed for building documentation
AC_PATH_PROG([DOXYGEN], [doxygen])
AC_PATH_PROG([SED], [sed])
AC_PATH_PROG([LATEX], [latex])
AC_PATH_PROG([PDFLATEX], [pdflatex])
AC_PATH_PROG([MAKEINDEX], [makeindex])
AC_PATH_PROG([DVIPS], [dvips])


# site configuration

# AC_ARG_WITH([real],
#             AC_HELP_STRING([--with-real=type],
#                            [The given type will be used for floating-point
#                             calculations.
#                             In case this option is not invoked, double
#                             will be used.]),
#             [AC_DEFINE_UNQUOTED([QL_REAL],[$withval],
#                                 [Define this as the type to be used for
#                                  floating-point calculations.])],
#             [AC_DEFINE_UNQUOTED([QL_REAL],[double],
#                                 [Define this as the type to be used for
#                                  floating-point calculations.])])

# AC_ARG_WITH([integer],
#             AC_HELP_STRING([--with-integer=type],
#                            [The given type will be used for integer
#                             calculations. At least an int is required.
#                             In case this option is not invoked, int
#                             will be used.]),
#             [AC_DEFINE_UNQUOTED([QL_INTEGER],[$withval],
#                                 [Define this as the type to be used for
#                                  integer calculations. At least an int
#                                  is required.])],
#             [AC_DEFINE_UNQUOTED([QL_INTEGER],[int],
#                                 [Define this as the type to be used for
#                                  integer calculations. At least an int
#                                  is required.])])

# AC_ARG_WITH([big-integer],
#             AC_HELP_STRING([--with-big-integer=type],
#                            [The given type will be used for large integer
#                             calculations. At least 4 bytes are required.
#                             In case this option is not invoked, long
#                             will be used.]),
#             [AC_DEFINE_UNQUOTED([QL_BIG_INTEGER],[$withval],
#                                 [Define this as the type to be used for
#                                  large integer calculations. At least
#                                  4 bytes are required.])],
#             [AC_DEFINE_UNQUOTED([QL_BIG_INTEGER],[long],
#                                 [Define this as the type to be used for
#                                  large integer calculations. At least
#                                  4 bytes are required.])])


AC_ARG_ENABLE([error-lines],
              AC_HELP_STRING([--enable-error-lines],
                             [If enabled, file and line information is
                              added to the error messages thrown by
                              the library.]),
              [ql_error_lines=$enableval],
              [ql_error_lines=no])
AC_MSG_CHECKING([whether to add file and line information to errors])
if test "$ql_error_lines" = "yes" ; then
   AC_DEFINE([QL_ERROR_LINES],[1],
             [Define this if error messages should include file and line
              information.])
fi
AC_MSG_RESULT([$ql_error_lines])

AC_ARG_ENABLE([error-functions],
              AC_HELP_STRING([--enable-error-functions],
                             [If enabled, current function information
                              is added to the error messages thrown by
                              the library.]),
              [ql_error_functions=$enableval],
              [ql_error_functions=no])
AC_MSG_CHECKING([whether to add function information to errors])
if test "$ql_error_functions" = "yes" ; then
   AC_DEFINE([QL_ERROR_FUNCTIONS],[1],
             [Define this if error messages should include current function
              information.])
fi
AC_MSG_RESULT([$ql_error_functions])

AC_ARG_ENABLE([tracing],
              AC_HELP_STRING([--enable-tracing],
                             [If enabled, tracing messages might be emitted
                              by the library depending on run-time
                              settings. Enabling this option can degrade
                              performance.]),
              [ql_tracing=$enableval],
              [ql_tracing=no])
AC_MSG_CHECKING([whether to enable tracing])
if test "$ql_tracing" = "yes" ; then
   AC_DEFINE([QL_ENABLE_TRACING],[1],
             [Define this if tracing messages should allowed (whether they
              are actually emitted will depend on run-time settings.)])
fi
AC_MSG_RESULT([$ql_tracing])

AC_MSG_CHECKING([whether to enable indexed coupons])
AC_ARG_ENABLE([indexed-coupons],
              AC_HELP_STRING([--enable-indexed-coupons],
                             [If enabled, indexed coupons (see the
                              documentation) are used in floating legs.
                              If disabled (the default,) par coupons
                              are used.]),
              [ql_indexed_coupon=$enableval],
              [ql_indexed_coupon=no])
if test "$ql_indexed_coupon" = "yes" ; then
   AC_DEFINE([QL_USE_INDEXED_COUPON],[1],
             [Define this to use indexed coupons instead of par coupons in
              floating legs.])
fi
AC_MSG_RESULT([$ql_indexed_coupon])

AC_MSG_CHECKING([whether to enable negative rates])
AC_ARG_ENABLE([negative-rates],
              AC_HELP_STRING([--enable-negative-rates],
                             [If enabled, negative yield rates are allowed
                              in a few places where they are currently
                              forbidden. It is still not clear whether
                              this is safe.]),
              [ql_negative_rates=$enableval],
              [ql_negative_rates=no])
if test "$ql_negative_rates" = "yes" ; then
   AC_DEFINE([QL_NEGATIVE_RATES],[1],
             [Define this if negative yield rates should be allowed.
              This might not be safe.])
fi
AC_MSG_RESULT([$ql_negative_rates])

AC_MSG_CHECKING([whether to enable extra safety checks])
AC_ARG_ENABLE([extra-safety-checks],
              AC_HELP_STRING([--enable-extra-safety-checks],
                             [If enabled, extra run-time checks are added
                              to a few functions. This can prevent their
                              inlining and degrade performance.]),
              [ql_belt_and_braces=$enableval],
              [ql_belt_and_braces=no])
if test "$ql_belt_and_braces" = "yes" ; then
   AC_DEFINE([QL_EXTRA_SAFETY_CHECKS],[1],
             [Define this if extra safety checks should be performed.
              This can degrade performance.])
fi
AC_MSG_RESULT([$ql_belt_and_braces])

AC_MSG_CHECKING([whether to enable early payments])
AC_ARG_ENABLE([early-payments],
              AC_HELP_STRING([--enable-early-payments],
                             [If enabled (the default,) payments are
                              considered to be settled at the beginning
                              of the day. Therefore, payments occurring
                              at today's date are not included in the NPV
                              of an instrument.]),
              [ql_early_payments=$enableval],
              [ql_early_payments=yes])
if test "$ql_early_payments" = "no" ; then
   AC_DEFINE([QL_TODAYS_PAYMENTS],[1],
             [Define this if payments occurring today should enter the NPV
              of an instrument.])
fi
AC_MSG_RESULT([$ql_early_payments])

AC_MSG_CHECKING([whether to enable deprecated code])
AC_ARG_ENABLE([deprecated-code],
              AC_HELP_STRING([--enable-deprecated-code],
                             [If enabled (the default,) deprecated code
                              will be included in the library.]),
              [ql_use_deprecated_code=$enableval],
              [ql_use_deprecated_code=yes])
if test "$ql_use_deprecated_code" = "no" ; then
   AC_DEFINE([QL_DISABLE_DEPRECATED],[1],
             [Define this if you want to disable deprecated code.])
fi
AC_MSG_RESULT([$ql_use_deprecated_code])

AC_MSG_CHECKING([whether to enable sessions])
AC_ARG_ENABLE([sessions],
              AC_HELP_STRING([--enable-sessions],
                             [If enabled, singletons will return different
                              instances for different sessions. You will
                              have to provide and link with the library
                              a sessionId() function in namespace QuantLib,
                              returning a different session id for each
                              session.]),
              [ql_use_sessions=$enableval],
              [ql_use_sessions=no])
if test "$ql_use_sessions" = "yes" ; then
   AC_DEFINE([QL_ENABLE_SESSIONS],[1],
             [Define this if you want to enable sessions.])
fi
AC_MSG_RESULT([$ql_use_sessions])

AC_MSG_CHECKING([whether to install examples])
AC_ARG_ENABLE([examples],
              AC_HELP_STRING([--enable-examples],
                             [If enabled, examples are built and installed
                              when "make" and "make install" are invoked.
                              If disabled (the default) they are built
                              with "make examples" and not installed.]),
              [ql_install_examples=$enableval],
              [ql_install_examples=no])
AM_CONDITIONAL(AUTO_EXAMPLES, test "$ql_install_examples" != "no")
AC_MSG_RESULT([$ql_install_examples])


# manual configurations for specific hosts
case $host in
  powerpc-apple-darwin*)
    AC_DEFINE([QL_PATCH_DARWIN],[1],
              [Define if running on a Mac OS X machine.])
    ;;
  sparc-sun-solaris*)
    AC_DEFINE([QL_PATCH_SOLARIS],[1],
              [Define if running on a Sun Solaris machine.])
    ;;
esac


# done, output the configured files
AC_CONFIG_FILES([
    Makefile
    config/Makefile
    ql/Makefile
    ql/Calendars/Makefile
    ql/CashFlows/Makefile
    ql/Currencies/Makefile
    ql/DayCounters/Makefile
    ql/FiniteDifferences/Makefile
    ql/Indexes/Makefile
    ql/Instruments/Makefile
    ql/Lattices/Makefile
    ql/Math/Makefile
    ql/MonteCarlo/Makefile
    ql/Optimization/Makefile
    ql/Patterns/Makefile
    ql/Pricers/Makefile
    ql/PricingEngines/Makefile
    ql/PricingEngines/Asian/Makefile
    ql/PricingEngines/Barrier/Makefile
    ql/PricingEngines/Basket/Makefile
    ql/PricingEngines/CapFloor/Makefile
    ql/PricingEngines/Cliquet/Makefile
    ql/PricingEngines/Forward/Makefile
    ql/PricingEngines/Hybrid/Makefile
    ql/PricingEngines/Lookback/Makefile
    ql/PricingEngines/Quanto/Makefile
    ql/PricingEngines/Swaption/Makefile
    ql/PricingEngines/Vanilla/Makefile
    ql/Processes/Makefile
    ql/RandomNumbers/Makefile
    ql/ShortRateModels/Makefile
    ql/ShortRateModels/CalibrationHelpers/Makefile
    ql/ShortRateModels/OneFactorModels/Makefile
    ql/ShortRateModels/TwoFactorModels/Makefile
    ql/ShortRateModels/LiborMarketModels/Makefile
    ql/Solvers1D/Makefile
    ql/TermStructures/Makefile
    ql/Utilities/Makefile
    ql/Volatilities/Makefile
    ql/VolatilityModels/Makefile
    functions/Makefile
    functions/ql/Makefile
    functions/ql/Functions/Makefile
    man/Makefile
    Docs/Makefile
    Examples/Makefile
    Examples/BermudanSwaption/Makefile
    Examples/ConvertibleBonds/Makefile
    Examples/DiscreteHedging/Makefile
    Examples/EquityOption/Makefile
    Examples/FRA/Makefile
    Examples/Replication/Makefile
    Examples/Repo/Makefile
    Examples/Swap/Makefile
    test-suite/Makefile])
AC_CONFIG_FILES([quantlib-config],[chmod +x quantlib-config])
AC_CONFIG_FILES([QuantLib.spec])
AC_OUTPUT