Salome HOME
24d6c54beda5d510ae5b89a8335882c580bd76e1
[samples/sierpinsky.git] / configure.ac
1 # Copyright (C) 2005-2011  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 #  PLEASE DO NOT MODIFY configure.in FILE
21 #  ALL CHANGES WILL BE DISCARDED BY THE NEXT
22 #  build_configure COMMAND
23 #  CHANGES MUST BE MADE IN configure.in.base FILE
24 # Author : Marc Tajchman (CEA)
25 # Date : 28/06/2001
26 # Modified by : Patrick GOLDBRONN (CEA)
27 # Modified by : Marc Tajchman (CEA)
28 # Created from configure.in.base
29 #
30 AC_INIT([Salome2 Project SIERPINSKY module],[6.3.0], [webmaster.salome@opencascade.com], [SalomeSIERPINSKY])
31 AC_CONFIG_AUX_DIR(adm_local/unix/config_files)
32 AC_CANONICAL_HOST
33 AC_CANONICAL_TARGET
34 AM_INIT_AUTOMAKE([-Wno-portability])
35
36 XVERSION=`echo $VERSION | awk -F. '{printf("0x%02x%02x%02x",$1,$2,$3)}'`
37 AC_SUBST(XVERSION)
38
39 # set up MODULE_NAME variable for dynamic construction of directories (resources, etc.)
40 MODULE_NAME=sierpinsky
41 AC_SUBST(MODULE_NAME)
42
43 dnl
44 dnl Initialize source and build root directories
45 dnl
46
47 ROOT_BUILDDIR=`pwd`
48 ROOT_SRCDIR=`echo $0 | sed -e "s,[[^/]]*$,,;s,/$,,;s,^$,.,"`
49 cd $ROOT_SRCDIR
50 ROOT_SRCDIR=`pwd`
51 cd $ROOT_BUILDDIR
52
53 AC_SUBST(ROOT_SRCDIR)
54 AC_SUBST(ROOT_BUILDDIR)
55
56 echo
57 echo Source root directory : $ROOT_SRCDIR
58 echo Build  root directory : $ROOT_BUILDDIR
59 echo
60 echo
61
62 AC_CHECK_PROG(SHELL,sh)
63 AC_SUBST(SHELL)
64
65 if test -z "$AR"; then
66    AC_CHECK_PROGS(AR,ar xar,:,$PATH)
67 fi
68 AC_SUBST(AR)
69
70 dnl Export the AR macro so that it will be placed in the libtool file
71 dnl correctly.
72 export AR
73
74 echo
75 echo ---------------------------------------------
76 echo testing make
77 echo ---------------------------------------------
78 echo
79
80 AC_PROG_MAKE_SET
81 AC_PROG_INSTALL
82 AC_LOCAL_INSTALL
83 dnl 
84 dnl libtool macro check for CC, LD, NM, LN_S, RANLIB, STRIP + pour les librairies dynamiques !
85
86 AC_ENABLE_DEBUG(yes)
87 AC_DISABLE_PRODUCTION
88
89 echo ---------------------------------------------
90 echo testing libtool
91 echo ---------------------------------------------
92
93 dnl first, we set static to no!
94 dnl if we want it, use --enable-static
95 AC_ENABLE_STATIC(no)
96
97 AC_LIBTOOL_DLOPEN
98 AC_PROG_LIBTOOL
99
100 dnl Fix up the INSTALL macro if it s a relative path. We want the
101 dnl full-path to the binary instead.
102 case "$INSTALL" in
103    *install-sh*)
104       INSTALL='\${KERNEL_ROOT_DIR}'/adm_local/unix/config_files/install-sh
105       ;;
106 esac
107
108 echo
109 echo ---------------------------------------------
110 echo testing C/C++
111 echo ---------------------------------------------
112 echo
113
114 cc_ok=no
115 dnl inutil car libtool
116 dnl AC_PROG_CC
117 AC_PROG_CXX
118 AC_DEPEND_FLAG
119 # AC_CC_WARNINGS([ansi])
120 cc_ok=yes
121
122 dnl Library libdl :
123 AC_CHECK_LIB(dl,dlopen)
124
125 dnl add library libm :
126 AC_CHECK_LIB(m,ceil)
127
128 dnl 
129 dnl Well we use sstream which is not in gcc pre-2.95.3
130 dnl We must test if it exists. If not, add it in include !
131 dnl
132
133 AC_CXX_HAVE_SSTREAM
134
135 dnl
136 dnl ---------------------------------------------
137 dnl testing MPI
138 dnl ---------------------------------------------
139 dnl
140
141 dnl CHECK_MPICH
142 CHECK_MPI
143
144 echo
145 echo ---------------------------------------------
146 echo testing LEX \& YACC
147 echo ---------------------------------------------
148 echo
149
150 lex_yacc_ok=no
151 AC_PROG_YACC
152 AC_PROG_LEX
153 lex_yacc_ok=yes
154
155 echo
156 echo ---------------------------------------------
157 echo testing python
158 echo ---------------------------------------------
159 echo
160
161 CHECK_PYTHON
162
163 AM_PATH_PYTHON(2.3)
164
165 dnl echo
166 dnl echo ---------------------------------------------
167 dnl echo testing java
168 dnl echo ---------------------------------------------
169 dnl echo
170
171 dnl CHECK_JAVA
172
173 echo
174 echo ---------------------------------------------
175 echo testing swig
176 echo ---------------------------------------------
177 echo
178
179 CHECK_SWIG
180
181 echo
182 echo ---------------------------------------------
183 echo testing threads
184 echo ---------------------------------------------
185 echo
186
187 ENABLE_PTHREADS
188
189 echo
190 echo ---------------------------------------------
191 echo testing omniORB
192 echo ---------------------------------------------
193 echo
194
195 CHECK_OMNIORB
196
197 dnl echo
198 dnl echo ---------------------------------------------
199 dnl echo testing mico
200 dnl echo ---------------------------------------------
201 dnl echo
202
203 dnl CHECK_MICO
204
205 echo
206 echo ---------------------------------------------
207 echo default ORB : omniORB
208 echo ---------------------------------------------
209 echo
210
211 DEFAULT_ORB=omniORB
212 CHECK_CORBA
213
214 AC_SUBST_FILE(CORBA)
215 corba=make_$ORB
216 CORBA=adm_local/unix/$corba
217
218 echo
219 echo ---------------------------------------------
220 echo testing openGL
221 echo ---------------------------------------------
222 echo
223
224 CHECK_OPENGL
225
226 echo
227 echo ---------------------------------------------
228 echo testing QT
229 echo ---------------------------------------------
230 echo
231
232 CHECK_QT
233
234 echo
235 echo ---------------------------------------------
236 echo testing VTK
237 echo ---------------------------------------------
238 echo
239
240 CHECK_VTK
241
242 echo
243 echo ---------------------------------------------
244 echo testing HDF5
245 echo ---------------------------------------------
246 echo
247
248 CHECK_HDF5
249
250 echo
251 echo ---------------------------------------------
252 echo BOOST Library
253 echo ---------------------------------------------
254 echo
255
256 CHECK_BOOST
257
258 echo
259 echo ---------------------------------------------
260 echo testing MED2
261 echo ---------------------------------------------
262 echo
263
264 CHECK_MED2
265
266 echo
267 echo ---------------------------------------------
268 echo Testing OpenCascade
269 echo ---------------------------------------------
270 echo
271
272 CHECK_CAS
273
274 echo
275 echo ---------------------------------------------
276 echo Testing html generators
277 echo ---------------------------------------------
278 echo
279
280 CHECK_HTML_GENERATORS
281
282 echo
283 echo ---------------------------------------------
284 echo Testing gd library
285 echo ---------------------------------------------
286 echo
287
288 CHECK_GDLIB
289
290 echo
291 echo ---------------------------------------------
292 echo Testing GUI
293 echo ---------------------------------------------
294 echo
295
296 CHECK_SALOME_GUI
297
298 echo
299 echo ---------------------------------------------
300 echo Testing full GUI
301 echo ---------------------------------------------
302 echo
303
304 CHECK_CORBA_IN_GUI
305 if test "x${CORBA_IN_GUI}" != "xyes"; then
306   echo "failed : For configure COMPONENT module necessary full GUI !"
307   exit
308 fi
309
310 echo
311 echo ---------------------------------------------
312 echo Testing Kernel
313 echo ---------------------------------------------
314 echo
315
316 CHECK_KERNEL
317
318 echo
319 echo ---------------------------------------------
320 echo Testing Med
321 echo ---------------------------------------------
322 echo
323
324 CHECK_MED
325
326 echo
327 echo ---------------------------------------------
328 echo testing MED2
329 echo ---------------------------------------------
330 echo
331
332 CHECK_MED2
333
334 echo
335 echo ---------------------------------------------
336 echo Testing Visu
337 echo ---------------------------------------------
338 echo
339
340 CHECK_VISU
341
342 echo
343 echo ---------------------------------------------
344 echo Testing Randomizer
345 echo ---------------------------------------------
346 echo
347
348 CHECK_RANDOMIZER
349
350 echo
351 echo ---------------------------------------------
352 echo Summary
353 echo ---------------------------------------------
354 echo
355
356 echo Configure
357 variables="cc_ok boost_ok lex_yacc_ok python_ok swig_ok threads_ok
358 OpenGL_ok qt_ok vtk_ok hdf5_ok med2_ok omniORB_ok occ_ok doxygen_ok graphviz_ok gd_ok Kernel_ok Med_ok Visu_ok Randomizer_ok"
359
360 for var in $variables
361 do
362    printf "   %10s : " `echo \$var | sed -e "s,_ok,,"`
363    eval echo \$$var
364 done
365
366 echo
367 echo "Default ORB   : $DEFAULT_ORB"
368 echo
369
370 dnl We don t need to say when we re entering directories if we re using
371 dnl GNU make becuase make does it for us.
372 if test "X$GMAKE" = "Xyes"; then
373    AC_SUBST(SETX) SETX=":"
374 else
375    AC_SUBST(SETX) SETX="set -x"
376 fi
377 echo
378 echo ---------------------------------------------
379 echo generating Makefiles and configure files
380 echo ---------------------------------------------
381 echo
382
383 AC_OUTPUT_COMMANDS([ \
384       chmod +x ./bin/*; \
385 ])
386
387 AC_HACK_LIBTOOL
388 AC_CONFIG_COMMANDS([hack_libtool],[
389 sed -i "s%^CC=\"\(.*\)\"%hack_libtool (){ \n\
390   $(pwd)/hack_libtool \1 \"\$[@]\" \n\
391 }\n\
392 CC=\"hack_libtool\"%g" libtool
393 sed -i "s%\(\s*\)for searchdir in \$newlib_search_path \$lib_search_path \$sys_lib_search_path \$shlib_search_path; do%\1searchdirs=\"\$newlib_search_path \$lib_search_path \$sys_lib_search_path \$shlib_search_path\"\n\1for searchdir in \$searchdirs; do%g" libtool
394 sed -i "s%\(\s*\)searchdirs=\"\$newlib_search_path \$lib_search_path \(.*\)\"%\1searchdirs=\"\$newlib_search_path \$lib_search_path\"\n\1sss_beg=\"\"\n\1sss_end=\"\2\"%g" libtool
395 sed -i "s%\(\s*\)\(for searchdir in \$searchdirs; do\)%\1for sss in \$searchdirs; do\n\1  if ! test -d \$sss; then continue; fi\n\1  ssss=\$(cd \$sss; pwd)\n\1  if test \"\$ssss\" != \"\" \&\& test -d \$ssss; then\n\1    case \$ssss in\n\1      /usr/lib | /usr/lib64 ) ;;\n\1      * ) sss_beg=\"\$sss_beg \$ssss\" ;;\n\1    esac\n\1  fi\n\1done\n\1searchdirs=\"\$sss_beg \$sss_end\"\n\1\2%g" libtool
396 ],[])
397
398 # This list is initiated using autoscan and must be updated manually
399 # when adding a new file <filename>.in to manage. When you execute
400 # autoscan, the Makefile list is generated in the output file configure.scan.
401 # This could be helpfull to update de configuration.
402 AC_OUTPUT([ \
403   adm_local/Makefile \
404   adm_local/unix/Makefile \
405   adm_local/unix/config_files/Makefile \
406   bin/VERSION \
407   bin/Makefile \
408   src/Makefile \
409   src/Sierpinsky/Makefile \
410   src/SierpinskyGUI/Makefile \
411   resources/Makefile \
412   resources/SIERPINSKYCatalog.xml \
413   idl/Makefile \
414   SIERPINSKY_version.h \
415   Makefile \
416 ])