Salome HOME
5b28f0e4eadef899e60cce44ab966b6d4eb6cfa6
[samples/atomic.git] / configure.ac
1 # Copyright (C) 2007-2013  CEA/DEN, EDF R&D, OPEN CASCADE
2 #
3 # This library is free software; you can redistribute it and/or
4 # modify it under the terms of the GNU Lesser General Public
5 # License as published by the Free Software Foundation; either
6 # version 2.1 of the License.
7 #
8 # This library is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11 # Lesser General Public License for more details.
12 #
13 # You should have received a copy of the GNU Lesser General Public
14 # License along with this library; if not, write to the Free Software
15 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
16 #
17 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 #
19
20 AC_INIT([Salome2 Project ATOMIC module], [7.1.0], [webmaster.salome@opencascade.com], [SalomeATOMIC])
21 AC_CONFIG_AUX_DIR(adm_local/unix/config_files)
22 AC_CANONICAL_HOST
23 AC_CANONICAL_TARGET
24 AM_INIT_AUTOMAKE([-Wno-portability])
25
26 XVERSION=`echo $VERSION | awk -F. '{printf("0x%02x%02x%02x",$1,$2,$3)}'`
27 AC_SUBST(XVERSION)
28 VERSION_DEV=1
29 AC_SUBST(VERSION_DEV)
30
31 # set up MODULE_NAME variable for dynamic construction of directories (resources, etc.)
32 MODULE_NAME=atomic
33 AC_SUBST(MODULE_NAME)
34
35 dnl
36 dnl Initialize source and build root directories
37 dnl
38
39 ROOT_BUILDDIR=`pwd`
40 ROOT_SRCDIR=`echo $0 | sed -e "s,[[^/]]*$,,;s,/$,,;s,^$,.,"`
41 cd $ROOT_SRCDIR
42 ROOT_SRCDIR=`pwd`
43 cd $ROOT_BUILDDIR
44
45 AC_SUBST(ROOT_SRCDIR)
46 AC_SUBST(ROOT_BUILDDIR)
47
48 echo
49 echo Source root directory : $ROOT_SRCDIR
50 echo Build  root directory : $ROOT_BUILDDIR
51 echo
52 echo
53
54 AC_CHECK_PROG(SHELL,sh)
55 AC_SUBST(SHELL)
56
57 if test -z "$AR"; then
58    AC_CHECK_PROGS(AR,ar xar,:,$PATH)
59 fi
60 AC_SUBST(AR)
61
62 dnl Export the AR macro so that it will be placed in the libtool file
63 dnl correctly.
64 export AR
65
66 echo
67 echo ---------------------------------------------
68 echo testing make
69 echo ---------------------------------------------
70 echo
71
72 AC_PROG_MAKE_SET
73 AC_PROG_INSTALL
74 AC_LOCAL_INSTALL
75 dnl 
76 dnl libtool macro check for CC, LD, NM, LN_S, RANLIB, STRIP + pour les librairies dynamiques !
77
78 AC_ENABLE_DEBUG(yes)
79 AC_DISABLE_PRODUCTION
80
81 echo ---------------------------------------------
82 echo testing libtool
83 echo ---------------------------------------------
84
85 dnl first, we set static to no!
86 dnl if we want it, use --enable-static
87 AC_ENABLE_STATIC(no)
88
89 AC_LIBTOOL_DLOPEN
90 AC_PROG_LIBTOOL
91
92 echo
93 echo ---------------------------------------------
94 echo testing C/C++
95 echo ---------------------------------------------
96 echo
97
98 cc_ok=no
99 dnl inutil car libtool
100 dnl AC_PROG_CC
101 AC_PROG_CXX
102 AC_CXX_WARNINGS
103 AC_CXX_TEMPLATE_OPTIONS
104 AC_DEPEND_FLAG
105 # AC_CC_WARNINGS([ansi])
106 cc_ok=yes
107
108 dnl Library libdl :
109 AC_CHECK_LIB(dl,dlopen)
110
111 dnl add library libm :
112 AC_CHECK_LIB(m,ceil)
113
114 dnl Library librt : for alpha/osf
115 AC_CHECK_LIB(rt,nanosleep)
116
117 dnl 
118 dnl Check if we use std iostream by default or if we must add
119 dnl a compiler directive for that
120 dnl
121
122 AC_CXX_USE_STD_IOSTREAM
123
124 dnl 
125 dnl Well we use sstream which is not in gcc pre-2.95.3
126 dnl We must test if it exists. If not, add it in include !
127 dnl
128
129 AC_CXX_HAVE_SSTREAM
130
131 dnl
132 dnl ---------------------------------------------
133 dnl testing linker
134 dnl ---------------------------------------------
135 dnl
136
137 AC_LINKER_OPTIONS
138
139 dnl
140 dnl ---------------------------------------------
141 dnl testing WITHIHM
142 dnl ---------------------------------------------
143 dnl
144
145 CHECK_WITHIHM
146
147 echo
148 echo ---------------------------------------------
149 echo testing LEX \& YACC
150 echo ---------------------------------------------
151 echo
152
153 lex_yacc_ok=no
154 AC_PROG_YACC
155 AC_PROG_LEX
156 lex_yacc_ok=yes
157
158 echo
159 echo ---------------------------------------------
160 echo testing python
161 echo ---------------------------------------------
162 echo
163
164 CHECK_PYTHON
165
166 AM_PATH_PYTHON(2.3)
167
168 echo
169 echo ---------------------------------------------
170 echo testing threads
171 echo ---------------------------------------------
172 echo
173
174 ENABLE_PTHREADS
175
176 echo
177 echo ---------------------------------------------
178 echo testing openGL
179 echo ---------------------------------------------
180 echo
181
182 CHECK_OPENGL
183
184 echo
185 echo ---------------------------------------------
186 echo testing QT
187 echo ---------------------------------------------
188 echo
189
190 CHECK_QT
191
192 echo
193 echo ---------------------------------------------
194 echo testing VTK
195 echo ---------------------------------------------
196 echo
197
198 CHECK_VTK
199
200 echo
201 echo ---------------------------------------------
202 echo testing MPI
203 echo ---------------------------------------------
204 echo
205
206 CHECK_MPI
207
208 echo
209 echo ---------------------------------------------
210 echo testing HDF5
211 echo ---------------------------------------------
212 echo
213
214 CHECK_HDF5
215
216 echo
217 echo ---------------------------------------------
218 echo Testing OpenCascade
219 echo ---------------------------------------------
220 echo
221
222 CHECK_CAS
223
224 echo
225 echo ---------------------------------------------
226 echo Testing sip
227 echo ---------------------------------------------
228 echo
229
230 CHECK_SIP
231
232
233 echo
234 echo ---------------------------------------------
235 echo Testing pyqt
236 echo ---------------------------------------------
237 echo
238
239 CHECK_PYQT
240
241 echo
242 echo ---------------------------------------------
243 echo Testing html generators
244 echo ---------------------------------------------
245 echo
246
247 CHECK_HTML_GENERATORS
248
249 echo
250 echo ---------------------------------------------
251 echo Testing Kernel
252 echo ---------------------------------------------
253 echo
254
255 CHECK_KERNEL
256
257 echo
258 echo ---------------------------------------------
259 echo Testing GUI
260 echo ---------------------------------------------
261 echo
262
263 CHECK_SALOME_GUI
264
265 echo
266 echo ---------------------------------------------
267 echo Summary
268 echo ---------------------------------------------
269 echo
270
271 echo Configure
272 variables="cc_ok lex_yacc_ok python_ok threads_ok OpenGL_ok qt_ok vtk_ok hdf5_ok occ_ok doxygen_ok graphviz_ok Kernel_ok SalomeGUI_ok"
273
274 for var in $variables
275 do
276    printf "   %10s : " `echo \$var | sed -e "s,_ok,,"`
277    eval echo \$$var
278 done
279
280 dnl We don't need to say when we re entering directories if we re using
281 dnl GNU make because make does it for us.
282 if test "X$GMAKE" = "Xyes"; then
283    AC_SUBST(SETX) SETX=":"
284 else
285    AC_SUBST(SETX) SETX="set -x"
286 fi
287
288 AC_OUTPUT_COMMANDS([ \
289         chmod +x ./bin/* \
290 ])
291
292 echo
293 echo ---------------------------------------------
294 echo generating Makefiles and configure files
295 echo ---------------------------------------------
296 echo
297
298 # This list is initiated using autoscan and must be updated manually
299 # when adding a new file <filename>.in to manage. When you execute
300 # autoscan, the Makefile list is generated in the output file configure.scan.
301 # This could be helpfull to update de configuration.
302 AC_OUTPUT([ \
303   adm_local/Makefile \
304   adm_local/unix/Makefile \
305   adm_local/unix/config_files/Makefile \
306   bin/VERSION \
307   bin/Makefile \
308   resources/Makefile \
309   resources/SalomeApp.xml \
310   src/Makefile \
311   src/ATOMICGUI/Makefile \
312   src/AtomicPy/Makefile \
313   ATOMIC_version.h \
314   Makefile \
315 ])