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