-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathconfigure.ac
327 lines (251 loc) · 10.3 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
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
# Process this file with autoconf to produce a configure script
#-------------------------------------------------------------------------------
# This file is part of code_saturne, a general-purpose CFD tool.
#
# Copyright (C) 1998-2024 EDF S.A.
#
# This program is free software; you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free Software
# Foundation; either version 2 of the License, or (at your option) any later
# version.
#
# 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 GNU General Public License for more
# details.
#
# You should have received a copy of the GNU General Public License along with
# this program; if not, write to the Free Software Foundation, Inc., 51 Franklin
# Street, Fifth Floor, Boston, MA 02110-1301, USA.
#-------------------------------------------------------------------------------
#------------------------------------------------------------------------------
# Initialization
#------------------------------------------------------------------------------
m4_define([cs_licence_c_comment],
[/*
This file is part of code_saturne, a general-purpose CFD tool.
Copyright (C) 1998-2024 EDF S.A.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
Foundation; either version 2 of the License, or (at your option) any later
version.
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 GNU General Public License for more
details.
You should have received a copy of the GNU General Public License along with
this program; if not, write to the Free Software Foundation, Inc., 51 Franklin
Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/])
# Note: proper determination of the version string requires the parent NEWS file
# to be maintained properly (as it should be anyways).
m4_define([salome_cfd_major_version], [8])
m4_define([salome_cfd_minor_version], [0])
m4_define([salome_cfd_release_version], [0])
m4_define([salome_cfd_version_extra], [])
m4_define([salome_cfd_version_string],
[salome_cfd_major_version.salome_cfd_minor_version.salome_cfd_release_version@&t@salome_cfd_version_extra])
AC_INIT([salome_cfd],[salome_cfd_version_string],[saturne-support@edf.fr],[],[https://code-saturne.org])
AC_CONFIG_SRCDIR([cfd_study/src/CFDSTUDY/CFDSTUDY.py])
# Use the config directory for libtool stuff ...
AC_CONFIG_AUX_DIR(build-aux)
AC_CONFIG_MACRO_DIR(m4)
AC_CANONICAL_TARGET
AC_CONFIG_HEADERS([salome_cfd_config.h])
# Initialize automake with the following options:
# - foreign, so as to handle the absence of ChangeLog (automatically generated)
# - tar-pax, so as to handle long lines (> 99 characters) in tar archives
# Warnings can be activated at bootstrap with 'autoreconf -vi --warnings=all'
AM_INIT_AUTOMAKE([foreign tar-pax subdir-objects])
# Enable maintainer mode by default for a developer checkout
AS_IF([test -d ${srcdir}/../.git],
[AM_MAINTAINER_MODE([enable])],
[AM_MAINTAINER_MODE([disable])])
# Enable silent rules with "./configure --enable-silent-rules" or "make V=0"
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES])
#------------------------------------------------------------------------------
# Checks for Python support.
#------------------------------------------------------------------------------
#AC_ARG_VAR([PYTHON], [the Python interpreter])
AM_PATH_PYTHON(["3.4"])
# Check for compilers
#----------------------------------
AC_PROG_CC
AC_PROG_CXX
AC_PROG_INSTALL
AC_PROG_LN_S
AM_PROG_CC_C_O
AC_PROG_SED
if test "x$CC" = "x" ; then
AC_MSG_FAILURE([cannot find C compiler])
fi
# Needed to use Microsoft archiver lib.exe
# It copies the ar-lib script, similar to the compile script
#m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
# Debug or production compilation mode (debug by default) ?
AC_ARG_ENABLE(debug,
[AS_HELP_STRING([--enable-debug], [enable debugging (reduces optimization)])],
[
case "${enableval}" in
yes) debug=yes ;;
no) debug=no ;;
*) AC_MSG_ERROR([bad value ${enableval} for --enable-debug]) ;;
esac
],
[ debug=no ]
)
AC_SUBST(debug)
# Preprocessor flags for debugging purposes
if test "x$debug" = "xyes"; then
CPPFLAGS="${CPPFLAGS} -DDEBUG"
else
CPPFLAGS="${CPPFLAGS} -DNDEBUG"
fi
# We may only turn on processing for libtool now that the basic compiler
# and linker flags are set (to avoid issues with linkers with different
# modes such as 32 and 64 bit which may be modified by compiler or
# linker flags).
# Initialize libtool.
m4_pushdef([salome_cfd_lt_init_args], [disable-static, no-pic])
LT_INIT([disable-static])
#------------------------------------------------------------------------------
# Checks for typedefs, structures, and compiler characteristics.
#------------------------------------------------------------------------------
AC_C_CONST
AC_C_INLINE
AC_TYPE_SIZE_T
AC_TYPE_PID_T
AC_HEADER_STDBOOL
#------------------------------------------------------------------------------
# Check for salome features.
#------------------------------------------------------------------------------
SALOME_CFD_AC_SALOME_ENV
SALOME_CFD_AC_TEST_SALOME
#------------------------------------------------------------------------------
# Checks for PyQt support.
#------------------------------------------------------------------------------
# Test for PyQt5
salome_cfd_have_gui_qt5=no
if test "x$salome_cfd_have_gui" = "xyes" ; then
AC_MSG_CHECKING([for PyQt5 version >= 5.0])
prog="[import sys, string
try: import PyQt5
except ImportError: sys.exit(1)
from PyQt5.QtCore import *
if list(map(int, QT_VERSION_STR.split('.'))) < [5,0,0]: sys.exit(1)
if list(map(int, PYQT_VERSION_STR.split('.'))) < [5,0,0]: sys.exit(1)
sys.exit(0)]"
${PYTHON} -c "${prog}"
retval=$?
if test $retval -ne 0 ; then
AC_MSG_RESULT([no])
salome_cfd_have_gui=no
else
AC_MSG_RESULT([yes])
salome_cfd_have_gui=yes
salome_cfd_have_gui_qt5=yes
fi
fi
# Test for PyQt5 developer tools
if test "x$salome_cfd_have_gui_qt5" = "xyes" ; then
# Try to find PyQt5 tools through Python interpreter
prog="[import os, sys
from PyQt5.QtCore import QCoreApplication
app = QCoreApplication([])
path = app.applicationDirPath()
sys.stdout.write(path)]"
PYPATH=`${PYTHON} -c "${prog}"`
AC_ARG_VAR([PYUIC5], [PyQt5 user interfaces compiler])
AC_ARG_VAR([PYRCC5], [PyQt5 resources compiler])
AC_ARG_VAR([LRELEASE], [Qt message files generator])
if test "x$PYUIC5" = "x" ; then
AC_PATH_PROG([PYUIC5], [pyuic5], [$CMDPYUIC5], [${PYPATH}:$PATH])
fi
if test "x$PYRCC5" = "x" ; then
AC_PATH_PROG([PYRCC5], [pyrcc5], [], [${PYPATH}:$PATH])
fi
if test "x$LRELEASE" = "x" ; then
AC_PATH_PROGS([LRELEASE], [lrelease-qt5 lrelease])
fi
if test "x$PYUIC5" = "x" -o "x$PYRCC5" = "x" -o "x$LRELEASE" = "x"; then
AC_MSG_FAILURE([cannot find PyQt5 dev tools, Graphical User Interface cannot be installed])
salome_cfd_have_gui=no
fi
fi
#------------------------------------------------------------------------------
# Checks for Qt tools.
#------------------------------------------------------------------------------
AM_CONDITIONAL(HAVE_GUI, [test "x$salome_cfd_have_gui" = "xyes"])
AC_SUBST(salome_cfd_have_gui)
AM_CONDITIONAL(HAVE_QT5, [test "x$salome_cfd_have_gui_qt5" = "xyes"])
AC_SUBST(salome_cfd_have_gui_qt5)
#------------------------------------------------------------------------------
# Checks for documentation tools
#------------------------------------------------------------------------------
salome_cfd_have_sphinx=yes
AC_ARG_VAR([SPHINXBUILD], [Sphinx documentation tool])
dnl where is sphinx ?
AC_PATH_PROG(SPHINXBUILD, sphinx-build)
if test "x$SPHINXBUILD" = "x"; then
AC_MSG_WARN(sphinx-build not found)
salome_cfd_have_sphinx=no
fi
AM_CONDITIONAL(HAVE_SPHINX, [test $salome_cfd_have_sphinx = yes])
AC_SUBST(salome_cfd_have_sphinx)
#------------------------------------------------------------------------------
# Checks for code_saturne path
#------------------------------------------------------------------------------
AC_ARG_VAR([CS_ROOT_DIR], [specify code_saturne root directory])
if test "x$CS_ROOT_DIR" != "x" ; then
if test ! -d "$CS_ROOT_DIR" ; then
AC_MSG_WARN([directory specified by CS_ROOT_DIR does not exist])
fi
fi
#------------------------------------------------------------------------------
# Do we want to install files in salome/extra_env.d
#------------------------------------------------------------------------------
cfd_study_env_id=""
AC_ARG_WITH(env_id,
[AS_HELP_STRING([--with-env-id=id],
[install for salome/extra.env.d/<id>_s_cfd_study.*])],
[if test "x$withval" != "x"; then
cfd_study_env_id=$withval
fi],
[])
AC_SUBST(cfd_study_env_id)
#------------------------------------------------------------------------------
# Pass compiler options to automake file
#------------------------------------------------------------------------------
AC_SUBST(CPPFLAGS)
AC_SUBST(CFLAGS)
AC_SUBST(CXXFLAGS)
AC_SUBST(LDFLAGS)
AC_SUBST(LIBS)
#------------------------------------------------------------------------------
# Output
#------------------------------------------------------------------------------
# Main configuration
AC_CONFIG_FILES([Makefile
cfd_study/Makefile
cfd_study/doc/Makefile
cfd_study/idl/Makefile
cfd_study/resources/Makefile
cfd_study/src/Makefile
cfd_study/src/CFDSTUDY/Makefile
cfd_study/src/CFDSTUDYGUI/Makefile
cfd_study/src/CFDSTUDYOTURNS/Makefile])
#------------------------------------------------------------------------------
AC_OUTPUT
#------------------------------------------------------------------------------
echo
echo "Configuration options:"
echo " use debugging code: "$debug""
echo " SALOME KERNEL support: "$salome_cfd_have_kernel""
echo " SALOME GUI support: "$salome_cfd_have_gui""
echo
echo "The package has been configured. Type:"
echo " make"
echo " make install"
echo
echo "To generate and install the salome CFD extensions"
echo