-
Notifications
You must be signed in to change notification settings - Fork 282
/
configure.ac
171 lines (147 loc) · 6.09 KB
/
configure.ac
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
# Process this file with autoconf to produce a configure script.
AC_INIT([QuantLib-SWIG], [1.36-dev],
[quantlib-dev@lists.sourceforge.net],
[QuantLib-SWIG])
AC_PREREQ(2.50)
AC_CONFIG_AUX_DIR([config])
AM_INIT_AUTOMAKE([foreign])
AC_COPYRIGHT([Copyright (C) 2005, 2006, 2007, 2008 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/license.shtml>.
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.])
# check target
AC_MSG_CHECKING([system])
target=`uname`
AC_MSG_RESULT([$target])
# check compiler
AC_LANG([C++])
QL_CHECK_CXXFLAGS
# check for QuantLib
AC_MSG_CHECKING([for QuantLib])
ql_version=`quantlib-config --version`
AC_MSG_RESULT([$ql_version])
# check for tools
AC_PATH_PROG([SWIG], [swig])
if test "x$SWIG" != x; then
SWIG_VERSION=`swig -version 2>&1|grep Version|cut -d" " -f3`
SWIG_MAJOR=${SWIG_VERSION%%.*}
if test ${SWIG_MAJOR} = "2"; then
AC_MSG_WARN([You have SWIG $SWIG_VERSION installed, but at least SWIG 3.0.1 is recommended. Some features may not work. ])
#SWIG=
fi
fi
AC_PATH_PROG([PYTHON], [python3 python])
AM_CONDITIONAL(HAVE_PYTHON, test "x${PYTHON}" != "x")
AC_ARG_ENABLE([python],
AS_HELP_STRING([--disable-python],
[If disabled, the Python module
will not be built]),
[build_python=$enableval],
[build_python=yes])
AM_CONDITIONAL(BUILD_PYTHON, test "$build_python" != "no")
AC_PATH_PROGS([DOTNET], [dotnet])
AM_CONDITIONAL(HAVE_DOTNET, test "x${DOTNET}" != "x")
AC_ARG_ENABLE([csharp],
AS_HELP_STRING([--disable-csharp],
[If disabled, the C# module
will not be built]),
[build_dotnet=$enableval],
[build_dotnet=yes])
AM_CONDITIONAL(BUILD_DOTNET, test "$build_dotnet" != "no")
AC_PATH_PROG([R], [R])
AM_CONDITIONAL(HAVE_R, test "x${R}" != "x")
AC_ARG_ENABLE([r],
AS_HELP_STRING([--disable-r],
[If disabled, the R module
will not be built]),
[build_r=$enableval],
[build_r=yes])
AM_CONDITIONAL(BUILD_R, test "$build_r" != "no")
# sanitized version for stricter R checks
AC_SUBST([PACKAGE_VERSION_FOR_R],["${PACKAGE_VERSION%-*}"])
AC_PATH_PROG([JAVAC], [javac])
AC_PATH_PROG([JAR], [jar])
AC_PATH_PROG([JAVA], [java])
AM_CONDITIONAL(HAVE_JAVA, test "x${JAVAC}" != "x" && test "x${JAR}" != "x")
AC_ARG_ENABLE([java],
AS_HELP_STRING([--disable-java],
[If disabled, the Java module
will not be built]),
[build_java=$enableval],
[build_java=yes])
AM_CONDITIONAL(BUILD_JAVA, test "$build_java" != "no")
AC_ARG_ENABLE([java-autoload],
AS_HELP_STRING([--disable-java-autoload],
[If disabled, the Java JNI shared library
will not be automatically loaded]),
[java_autoload=$enableval],
[java_autoload=yes])
AM_CONDITIONAL(JAVA_AUTOLOAD, test "$java_autoload" != "no")
AC_ARG_ENABLE([java-finalizer],
AS_HELP_STRING([--disable-java-finalizer],
[If disabled, the finalizers
will not be generated. Be careful.]),
[java_finalizer=$enableval],
[java_finalizer=yes])
AM_CONDITIONAL(JAVA_FINALIZER, test "$java_finalizer" != "no")
AC_ARG_ENABLE([java-autocloseable],
AS_HELP_STRING([--enable-java-autocloseable],
[If enabled, the java Objects will implement AutoCloseable]),
[java_autocloseable=$enableval],
[java_autocloseable=no])
AM_CONDITIONAL(JAVA_AUTOCLOSEABLE, test "$java_autocloseable" != "no")
AC_ARG_WITH([jdk-include],
AS_HELP_STRING([--with-jdk-include=INCLUDE_PATH],
[Supply the location of JDK header files]),
[ql_jdk_include_path="`cd ${withval} 2>/dev/null && pwd`"],
[ql_jdk_include_path=""])
if test [ -n "$ql_jdk_include_path" ] ; then
AC_SUBST([JDK_INCLUDE],["-I${ql_jdk_include_path}"])
fi
AC_ARG_WITH([jdk-system-include],
AS_HELP_STRING([--with-jdk-system-include=INCLUDE_PATH],
[Supply the location of system-dependent JDK header files]),
[ql_jdk_sys_include_path="`cd ${withval} 2>/dev/null && pwd`"],
[ql_jdk_sys_include_path=""])
if test [ -n "$ql_jdk_sys_include_path" ] ; then
AC_SUBST([JDK_SYSTEM_INCLUDE],["-I${ql_jdk_sys_include_path}"])
fi
AC_PATH_PROG([SCALAC], [scalac])
AC_PATH_PROG([SCALA], [scala])
AM_CONDITIONAL(HAVE_SCALA, test "x${SCALAC}" != "x" && test "x${JAR}" != "x")
AC_ARG_ENABLE([scala],
AS_HELP_STRING([--disable-scala],
[If disabled, the scala examples
will not be built]),
[build_scala=$enableval],
[build_scala=yes])
AM_CONDITIONAL(BUILD_SCALA, test "$build_scala" != "no")
# flags
case "$target" in
Darwin)
AC_SUBST([SHARED_LIB],[${SHARED_LIB='-dynamiclib'}])
AC_SUBST([SHARED_LIB_EXTENSION],[${SHARED_LIB_EXTENSION='dylib'}])
AC_SUBST([JNILIB_EXTENSION],[${JNILIB_EXTENSION='jnilib'}]) ;;
*)
AC_SUBST([SHARED_LIB],[${SHARED_LIB='-shared'}])
AC_SUBST([SHARED_LIB_EXTENSION],[${SHARED_LIB_EXTENSION='so'}])
AC_SUBST([JNILIB_EXTENSION],[${JNILIB_EXTENSION='so'}]) ;;
esac
# done, output the configured files
AC_CONFIG_FILES([
Makefile
CSharp/Makefile
Java/Makefile
Python/Makefile
Python/setup.py
R/Makefile
R/DESCRIPTION
Scala/Makefile])
AC_OUTPUT