]> SALOME platform Git repositories - modules/homard.git/blob - configure.ac
Salome HOME
90e8b1692641a893a5da6646f19c93daa02b2152
[modules/homard.git] / configure.ac
1 #  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
2 #
3 #  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 #  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5 #
6 #  This library is free software; you can redistribute it and/or
7 #  modify it under the terms of the GNU Lesser General Public
8 #  License as published by the Free Software Foundation; either
9 #  version 2.1 of the License.
10 #
11 #  This library is distributed in the hope that it will be useful,
12 #  but WITHOUT ANY WARRANTY; without even the implied warranty of
13 #  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14 #  Lesser General Public License for more details.
15 #
16 #  You should have received a copy of the GNU Lesser General Public
17 #  License along with this library; if not, write to the Free Software
18 #  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
19 #
20 #  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 #
22 # Author : Marc Tajchman (CEA)
23 # Date : 28/06/2001
24 # Modified by : Patrick GOLDBRONN (CEA)
25 # Modified by : Marc Tajchman (CEA)
26 # Modified by : Alexander BORODIN (OCN) - autotools usage
27 # Created from configure.in.base
28 #
29 AC_INIT([Salome2 Project HOMARD module], [5.1.0], [webmaster.salome@opencascade.com], [SalomeHOMARD])
30 AC_CONFIG_AUX_DIR(salome_adm/unix/config_files)
31 AC_CANONICAL_HOST
32 AC_CANONICAL_TARGET
33 AM_INIT_AUTOMAKE([-Wno-portability])
34
35 XVERSION=`echo $VERSION | awk -F. '{printf("0x%02x%02x%02x",$1,$2,$3)}'`
36 AC_SUBST(XVERSION)
37
38 # set up MODULE_NAME variable for dynamic construction of directories (resources, etc.)
39 MODULE_NAME=homard
40 AC_SUBST(MODULE_NAME)
41
42 echo
43 echo ---------------------------------------------
44 echo Initialize source and build root directories
45 echo ---------------------------------------------
46 echo
47
48 dnl
49 dnl Initialize source and build root directories
50 dnl
51
52 ROOT_BUILDDIR=`pwd`
53 ROOT_SRCDIR=`echo $0 | sed -e "s,[[^/]]*$,,;s,/$,,;s,^$,.,"`
54 cd $ROOT_SRCDIR
55 ROOT_SRCDIR=`pwd`
56 cd $ROOT_BUILDDIR
57
58 AC_SUBST(ROOT_SRCDIR)
59 AC_SUBST(ROOT_BUILDDIR)
60
61 echo
62 echo Source root directory : $ROOT_SRCDIR
63 echo Build  root directory : $ROOT_BUILDDIR
64 echo
65 echo
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 dnl
85 dnl libtool macro check for CC, LD, NM, LN_S, RANLIB, STRIP + pour les librairies dynamiques !
86
87 echo
88 echo ---------------------------------------------
89 echo Coniguring production
90 echo ---------------------------------------------
91 echo
92 AC_ENABLE_DEBUG(yes)
93 AC_DISABLE_PRODUCTION
94
95 echo ---------------------------------------------
96 echo testing libtool
97 echo ---------------------------------------------
98
99 dnl first, we set static to no!
100 dnl if we want it, use --enable-static
101 AC_ENABLE_STATIC(no)
102
103 AC_LIBTOOL_DLOPEN
104 AC_PROG_LIBTOOL
105
106 dnl Fix up the INSTALL macro if it s a relative path. We want the
107 dnl full-path to the binary instead.
108 case "$INSTALL" in
109    *install-sh*)
110       INSTALL='\${ROOT_BUILDDIR}'/salome_adm/unix/config_files/install-sh
111       ;;
112 esac
113
114 echo
115 echo ---------------------------------------------
116 echo testing C/C++
117 echo ---------------------------------------------
118 echo
119
120 cc_ok=no
121 dnl inutil car libtool
122 dnl AC_PROG_CC
123 AC_PROG_CXX
124 AC_CXX_WARNINGS
125 AC_CXX_TEMPLATE_OPTIONS
126 AC_DEPEND_FLAG
127 # AC_CC_WARNINGS([ansi])
128 cc_ok=yes
129
130 echo
131 echo ---------------------------------------------
132 echo testing Fortran
133 echo ---------------------------------------------
134 echo
135
136 fortran_ok=no
137 AC_PROG_F77
138 AC_F77_LIBRARY_LDFLAGS
139 AC_PROG_FC
140 AC_FC_LIBRARY_LDFLAGS
141 if test "X$FC" != "X" ; then
142    fortran_ok=yes
143    F77=$FC
144 fi
145
146 dnl AM_CONDITIONAL( USE_GFORTRAN, [test "$F77" = "gfortran"])
147
148 echo
149
150 dnl Library libdl :
151 AC_CHECK_LIB(dl,dlopen)
152
153 dnl add library libm :
154 AC_CHECK_LIB(m,ceil)
155
156 dnl
157 dnl Well we use sstream which is not in gcc pre-2.95.3
158 dnl We must test if it exists. If not, add it in include !
159 dnl
160
161 AC_CXX_HAVE_SSTREAM
162
163 echo
164 echo ---------------------------------------------
165 echo testing python
166 echo ---------------------------------------------
167 echo
168
169 CHECK_PYTHON
170
171 echo
172 echo ---------------------------------------------
173 echo testing swig
174 echo ---------------------------------------------
175 echo
176
177 AM_PATH_PYTHON(2.3)
178 CHECK_SWIG
179
180 echo
181 echo ---------------------------------------------
182 echo testing threads
183 echo ---------------------------------------------
184 echo
185
186 ENABLE_PTHREADS
187
188 HOMARD_WITH_GUI=yes
189
190 AM_CONDITIONAL(HOMARD_ENABLE_GUI, [test "${HOMARD_WITH_GUI}" = "yes"])
191
192 if test "x${GUI_DISABLE_CORBA}" != "xyes" ; then
193     echo
194     echo ---------------------------------------------
195     echo testing omniORB
196     echo ---------------------------------------------
197     echo
198
199     CHECK_OMNIORB
200
201     echo
202     echo ---------------------------------------------
203     echo default ORB : omniORB
204     echo ---------------------------------------------
205     echo
206
207     DEFAULT_ORB=omniORB
208
209     echo
210     echo ---------------------------------------------
211     echo testing Corba
212     echo ---------------------------------------------
213     echo
214
215     CHECK_CORBA
216
217     AC_SUBST_FILE(CORBA)
218     corba=make_$ORB
219     CORBA=adm_local/unix/$corba
220
221 fi
222
223 if test "${HOMARD_WITH_GUI}" = "yes"; then
224     echo
225     echo ---------------------------------------------
226     echo testing openGL
227     echo ---------------------------------------------
228     echo
229
230     CHECK_OPENGL
231
232     echo
233     echo ---------------------------------------------
234     echo testing QT
235     echo ---------------------------------------------
236     echo
237
238     CHECK_QT
239
240     echo
241     echo ---------------------------------------------
242     echo Testing GUI
243     echo ---------------------------------------------
244     echo
245
246     CHECK_SALOME_GUI
247
248     echo
249     echo ---------------------------------------------
250     echo Testing full GUI
251     echo ---------------------------------------------
252     echo
253
254     CHECK_CORBA_IN_GUI
255     if test "x${CORBA_IN_GUI}" != "xyes"; then
256       echo "failed : For configure HOMARD module necessary full GUI !"
257       exit
258     fi
259 fi
260
261 echo
262 echo ---------------------------------------------
263 echo testing HDF5
264 echo ---------------------------------------------
265 echo
266
267 CHECK_HDF5
268
269 echo
270 echo ---------------------------------------------
271 echo Testing OpenCascade
272 echo ---------------------------------------------
273 echo
274
275 CHECK_CAS
276
277
278 echo
279 echo ---------------------------------------------
280 echo Testing Kernel
281 echo ---------------------------------------------
282 echo
283
284 CHECK_KERNEL
285 CHECK_MPI
286
287 echo
288 echo ---------------------------------------------
289 echo Testing Med
290 echo ---------------------------------------------
291 echo
292
293 CHECK_MED2
294
295
296 echo
297 echo ---------------------------------------------
298 echo Testing Med Module
299 echo ---------------------------------------------
300 echo
301
302 CHECK_MED
303
304 echo
305 echo ---------------------------------------------
306 echo Testing Smesh
307 echo ---------------------------------------------
308 echo
309
310 CHECK_SMESH
311
312
313 echo
314 echo ---------------------------------------------
315 echo Testing sphinx
316 echo ---------------------------------------------
317 echo
318
319 CHECK_SPHINX
320
321
322 echo
323 echo ---------------------------------------------
324 echo Summary
325 echo ---------------------------------------------
326 echo
327
328 echo Configure
329 if test "${HOMARD_WITH_GUI}" = "yes"; then
330 variables="cc_ok fortran_ok   python_ok swig_ok threads_ok OpenGL_ok qt_ok  hdf5_ok omniORB_ok Kernel_ok med2_ok SalomeGUI_ok Med_ok SMesh_ok  sphinx_ok"
331 fi
332
333 if test "${HOMARD_WITH_GUI}" = "no"; then
334 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"
335 fi
336
337 for var in $variables
338 do
339    printf "   %10s : " `echo \$var | sed -e "s,_ok,,"`
340    eval echo \$$var
341 done
342
343 echo
344 echo "Default ORB   : $DEFAULT_ORB"
345 echo
346
347 dnl We don t need to say when we re entering directories if we re using
348 dnl GNU make becuase make does it for us.
349 if test "X$GMAKE" = "Xyes"; then
350    AC_SUBST(SETX) SETX=":"
351 else
352    AC_SUBST(SETX) SETX="set -x"
353 fi
354
355 dnl AM_CONDITIONAL(GUI_ENABLE_CORBA, [test "$GUI_DISABLE_CORBA" = no])
356 dnl AM_CONDITIONAL(ENABLE_PYCONSOLE, [test "$DISABLE_PYCONSOLE" = no])
357 dnl AM_CONDITIONAL(ENABLE_GLVIEWER, [test "$DISABLE_GLVIEWER" = no])
358 dnl AM_CONDITIONAL(ENABLE_PLOT2DVIEWER, [test "$DISABLE_PLOT2DVIEWER" = no])
359 dnl AM_CONDITIONAL(ENABLE_SUPERVGRAPHVIEWER, [test "$DISABLE_SUPERVGRAPHVIEWER" = no])
360 dnl AM_CONDITIONAL(ENABLE_OCCVIEWER, [test "$DISABLE_OCCVIEWER" = no])
361 dnl AM_CONDITIONAL(ENABLE_VTKVIEWER, [test "$DISABLE_VTKVIEWER" = no])
362 dnl AM_CONDITIONAL(ENABLE_SALOMEOBJECT, [test "$DISABLE_SALOMEOBJECT" = no])
363
364 echo
365 echo ---------------------------------------------
366 echo generating Makefiles and configure files
367 echo ---------------------------------------------
368 echo
369
370 #AC_OUTPUT_COMMANDS([ \
371 #  chmod +x ./bin/*; \
372 #  chmod +x ./bin/salome/*; \
373 #])
374
375 # This list is initiated using autoscan and must be updated manually
376 # when adding a new file <filename>.in to manage. When you execute
377 # autoscan, the Makefile list is generated in the output file configure.scan.
378 # This could be helpfull to update de configuration.
379 AC_OUTPUT([ \
380         salome_adm/unix/SALOMEconfig.h \
381         Makefile \
382         idl/Makefile \
383         doc/Makefile \
384         src/Makefile \
385         src/HOMARD_I/Makefile \
386         src/HOMARD/Makefile \
387         src/HOMARDGUI/Makefile \
388         src/HOMARD_SWIG/Makefile \
389         resources/Makefile \
390         tests/Makefile \
391 ])