Salome HOME
0020832: EDF 1359 SMESH : Automatic meshing of boundary layers
[plugins/ghs3dplugin.git] / configure.ac
1 #  Copyright (C) 2004-2010  CEA/DEN, EDF R&D
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 GHS3DPLUGIN module],[6.2.0], [webmaster.salome@opencascade.com], [SalomeGHS3DPLUGIN])
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=ghs3dplugin
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 -c"
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_CXX_WARNINGS
119 AC_CXX_TEMPLATE_OPTIONS
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 Library librt : for alpha/osf
128 AC_CHECK_LIB(rt,nanosleep)
129
130 dnl add library libm :
131 AC_CHECK_LIB(m,ceil)
132
133 dnl 
134 dnl Well we use sstream which is not in gcc pre-2.95.3
135 dnl We must test if it exists. If not, add it in include !
136 dnl
137
138 AC_CXX_HAVE_SSTREAM
139
140 dnl
141 dnl ---------------------------------------------
142 dnl testing MPICH
143 dnl ---------------------------------------------
144 dnl
145
146 dnl CHECK_MPICH
147
148 echo
149 echo ---------------------------------------------
150 echo testing MPI
151 echo ---------------------------------------------
152 echo
153
154 CHECK_MPI
155
156 echo
157 echo ---------------------------------------------
158 echo testing LEX \& YACC
159 echo ---------------------------------------------
160 echo
161
162 lex_yacc_ok=no
163 AC_PROG_YACC
164 AC_PROG_LEX
165 lex_yacc_ok=yes
166
167 echo
168 echo ---------------------------------------------
169 echo testing python
170 echo ---------------------------------------------
171 echo
172
173 CHECK_PYTHON
174
175 AM_PATH_PYTHON(2.3)
176
177 dnl echo
178 dnl echo ---------------------------------------------
179 dnl echo testing java
180 dnl echo ---------------------------------------------
181 dnl echo
182
183 dnl CHECK_JAVA
184
185 echo
186 echo ---------------------------------------------
187 echo testing swig
188 echo ---------------------------------------------
189 echo
190
191 CHECK_SWIG
192
193 echo
194 echo ---------------------------------------------
195 echo testing threads
196 echo ---------------------------------------------
197 echo
198
199 ENABLE_PTHREADS
200
201 echo
202 echo ---------------------------------------------
203 echo testing omniORB
204 echo ---------------------------------------------
205 echo
206
207 CHECK_OMNIORB
208
209 dnl echo
210 dnl echo ---------------------------------------------
211 dnl echo testing mico
212 dnl echo ---------------------------------------------
213 dnl echo
214
215 dnl CHECK_MICO
216
217 echo
218 echo ---------------------------------------------
219 echo default ORB : omniORB
220 echo ---------------------------------------------
221 echo
222
223 DEFAULT_ORB=omniORB
224 CHECK_CORBA
225
226 AC_SUBST_FILE(CORBA)
227 corba=make_$ORB
228 CORBA=adm_local/unix/$corba
229
230 echo
231 echo ---------------------------------------------
232 echo Testing GUI
233 echo ---------------------------------------------
234 echo
235
236 CHECK_GUI_MODULE
237
238 gui_ok=no
239 if test "${SalomeGUI_need}" != "no" -a "${FullGUI_ok}" = "yes" ; then 
240   gui_ok=yes
241 fi
242
243 AM_CONDITIONAL(GHS3DPLUGIN_ENABLE_GUI, [test "${gui_ok}" = "yes"])
244
245 if test "${SalomeGUI_need}" == "yes"; then
246   if test "${FullGUI_ok}" != "yes"; then
247     AC_MSG_WARN(For configure GHS3DPLUGIN module necessary full GUI!)
248   fi
249 elif test "${SalomeGUI_need}" == "auto"; then
250   if test "${FullGUI_ok}" != "yes"; then
251     AC_MSG_WARN(Full GUI not found. Build will be done without GUI!)
252   fi
253 elif test "${SalomeGUI_need}" == "no"; then
254   echo Build without GUI option has been chosen
255 fi
256
257 if test "${gui_ok}" = "yes"; then
258
259     echo
260     echo ---------------------------------------------
261     echo testing openGL
262     echo ---------------------------------------------
263     echo
264
265     CHECK_OPENGL
266
267     echo
268     echo ---------------------------------------------
269     echo testing QT
270     echo ---------------------------------------------
271     echo
272
273     CHECK_QT
274 fi
275
276 echo
277 echo ---------------------------------------------
278 echo testing VTK
279 echo ---------------------------------------------
280 echo
281
282 CHECK_VTK
283
284 echo
285 echo ---------------------------------------------
286 echo Testing HDF5
287 echo ---------------------------------------------
288 echo
289
290 CHECK_HDF5
291
292 echo
293 echo ---------------------------------------------
294 echo BOOST Library
295 echo ---------------------------------------------
296 echo
297
298 CHECK_BOOST
299
300 echo
301 echo ---------------------------------------------
302 echo Testing OpenCascade
303 echo ---------------------------------------------
304 echo
305
306 CHECK_CAS
307
308 echo
309 echo ---------------------------------------------
310 echo Testing html generators
311 echo ---------------------------------------------
312 echo
313
314 CHECK_HTML_GENERATORS
315
316 echo
317 echo ---------------------------------------------
318 echo Testing Kernel
319 echo ---------------------------------------------
320 echo
321
322 CHECK_KERNEL
323
324 echo
325 echo ---------------------------------------------
326 echo Testing Geom
327 echo ---------------------------------------------
328 echo
329
330 CHECK_GEOM
331
332 echo
333 echo ---------------------------------------------
334 echo Testing Med
335 echo ---------------------------------------------
336 echo
337
338 CHECK_MED
339
340 echo
341 echo ---------------------------------------------
342 echo Testing SMesh
343 echo ---------------------------------------------
344 echo
345
346 CHECK_SMESH
347
348 echo
349 echo ---------------------------------------------
350 echo Testing GHS3D
351 echo ---------------------------------------------
352 echo
353
354 CHECK_GHS3D
355
356 echo
357 echo ---------------------------------------------
358 echo Summary
359 echo ---------------------------------------------
360 echo
361
362 echo Configure
363 if test "${gui_ok}" = "yes"; then
364   variables="cc_ok boost_ok threads_ok omniORB_ok occ_ok doxygen_ok Kernel_ok gui_ok Geom_ok Med_ok SMesh_ok GHS3D_ok OpenGL_ok qt_ok vtk_ok"
365 elif test "${SalomeGUI_need}" != "no"; then
366   variables="cc_ok boost_ok threads_ok omniORB_ok occ_ok doxygen_ok Kernel_ok gui_ok Geom_ok Med_ok SMesh_ok GHS3D_ok vtk_ok"
367 else
368   variables="cc_ok boost_ok threads_ok omniORB_ok occ_ok doxygen_ok Kernel_ok Geom_ok Med_ok SMesh_ok GHS3D_ok vtk_ok"
369 fi
370
371 for var in $variables
372 do
373    printf "   %10s : " `echo \$var | sed -e "s,_ok,,"`
374    eval echo \$$var
375 done
376
377 echo
378 echo "Default ORB   : $DEFAULT_ORB"
379 echo
380
381 dnl We don t need to say when we re entering directories if we re using
382 dnl GNU make becuase make does it for us.
383 if test "X$GMAKE" = "Xyes"; then
384    AC_SUBST(SETX) SETX=":"
385 else
386    AC_SUBST(SETX) SETX="set -x"
387 fi
388 echo
389 echo ---------------------------------------------
390 echo generating Makefiles and configure files
391 echo ---------------------------------------------
392 echo
393
394 AC_OUTPUT_COMMANDS([ \
395       chmod +x ./bin/*; \
396 ])
397
398 AC_HACK_LIBTOOL
399 AC_CONFIG_COMMANDS([hack_libtool],[
400 sed -i "s%^CC=\"\(.*\)\"%hack_libtool (){ \n\
401   $(pwd)/hack_libtool \1 \"\$[@]\" \n\
402 }\n\
403 CC=\"hack_libtool\"%g" libtool
404 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
405 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
406 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
407 ],[])
408
409 # This list is initiated using autoscan and must be updated manually
410 # when adding a new file <filename>.in to manage. When you execute
411 # autoscan, the Makefile list is generated in the output file configure.scan.
412 # This could be helpfull to update de configuration.
413 AC_OUTPUT([ \
414   adm_local/Makefile \
415   adm_local/unix/Makefile \
416   adm_local/unix/config_files/Makefile \
417   bin/VERSION \
418   bin/Makefile \
419   GHS3DPLUGIN_version.h \
420   src/Makefile \
421   src/GUI/Makefile \
422   resources/Makefile \
423   idl/Makefile \
424   Makefile \
425 ])