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