]> SALOME platform Git repositories - samples/calculator.git/blob - configure.ac
Salome HOME
Merge from BR_V5_DEV 17Feb09
[samples/calculator.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 #  PLEASE DO NOT MODIFY configure.in FILE
23 #  ALL CHANGES WILL BE DISCARDED BY THE NEXT
24 #  build_configure COMMAND
25 #  CHANGES MUST BE MADE IN configure.in.base FILE
26 # Author : Marc Tajchman (CEA)
27 # Date : 28/06/2001
28 # Modified by : Patrick GOLDBRONN (CEA)
29 # Modified by : Marc Tajchman (CEA)
30 #
31 AC_INIT([Salome2 Project CALCULATOR module], [5.1.0], [webmaster.salome@opencascade.com], [SalomeCALCULATOR])
32 AC_CONFIG_AUX_DIR(salome_adm/unix/config_files)
33 AC_CANONICAL_HOST
34 AC_CANONICAL_TARGET
35 AM_INIT_AUTOMAKE
36
37 XVERSION=`echo $VERSION | awk -F. '{printf("0x%02x%02x%02x",$1,$2,$3)}'`
38 AC_SUBST(XVERSION)
39
40 # set up MODULE_NAME variable for dynamic construction of directories (resources, etc.)
41 MODULE_NAME=calculator
42 AC_SUBST(MODULE_NAME)
43
44 dnl
45 dnl Initialize source and build root directories
46 dnl
47
48 ROOT_BUILDDIR=`pwd`
49 ROOT_SRCDIR=`echo $0 | sed -e "s,[[^/]]*$,,;s,/$,,;s,^$,.,"`
50 cd $ROOT_SRCDIR
51 ROOT_SRCDIR=`pwd`
52 cd $ROOT_BUILDDIR
53
54 AC_SUBST(ROOT_SRCDIR)
55 AC_SUBST(ROOT_BUILDDIR)
56
57 echo
58 echo Source root directory : $ROOT_SRCDIR
59 echo Build  root directory : $ROOT_BUILDDIR
60 echo
61 echo
62
63 AC_CHECK_PROG(SHELL,sh)
64 AC_SUBST(SHELL)
65
66 if test -z "$AR"; then
67    AC_CHECK_PROGS(AR,ar xar,:,$PATH)
68 fi
69 AC_SUBST(AR)
70
71 dnl Export the AR macro so that it will be placed in the libtool file
72 dnl correctly.
73 export AR
74
75 echo
76 echo ---------------------------------------------
77 echo testing make
78 echo ---------------------------------------------
79 echo
80
81 AC_PROG_MAKE_SET
82 AC_PROG_INSTALL
83 dnl 
84 dnl libtool macro check for CC, LD, NM, LN_S, RANLIB, STRIP + for shared libraries
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='\${ROOT_BUILDDIR}'/salome_adm/unix/config_files/install-sh
105      #;;
106      case $host_os in
107        osf*)
108          INSTALL="${AUX_CONFIG_DIR}/install-sh -c"
109          ;;
110        *)
111          INSTALL='\${AUX_CONFIG_DIR}'/install-sh
112          ;;
113      esac
114 esac
115
116 echo
117 echo ---------------------------------------------
118 echo testing C/C++
119 echo ---------------------------------------------
120 echo
121
122 cc_ok=no
123 dnl inutil car libtool
124 dnl AC_PROG_CC
125 AC_PROG_CXX
126 AC_CXX_WARNINGS
127 AC_CXX_TEMPLATE_OPTIONS
128 AC_DEPEND_FLAG
129 # AC_CC_WARNINGS([ansi])
130 cc_ok=yes
131
132 dnl Library libdl :
133 AC_CHECK_LIB(dl,dlopen)
134
135 dnl Library librt : for alpha/osf
136 AC_CHECK_LIB(rt,nanosleep)
137
138 dnl add library libm :
139 AC_CHECK_LIB(m,ceil)
140
141 dnl 
142 dnl Check if we use std iostream by default or if we must add
143 dnl a compiler directive for that
144 dnl
145
146 AC_CXX_USE_STD_IOSTREAM
147
148 dnl 
149 dnl Well we use sstream which is not in gcc pre-2.95.3
150 dnl We must test if it exists. If not, add it in include !
151 dnl
152
153 AC_CXX_HAVE_SSTREAM
154 #AM_CONDITIONAL(MED_ENABLE_SSTREAM, [test "$HAVE_SSTREAM" = yes])
155
156 dnl
157 dnl ---------------------------------------------
158 dnl testing linker
159 dnl ---------------------------------------------
160 dnl
161
162 AC_LINKER_OPTIONS
163
164 echo
165 echo ---------------------------------------------
166 echo testing threads
167 echo ---------------------------------------------
168 echo
169
170 ENABLE_PTHREADS
171
172 echo
173 echo ---------------------------------------------
174 echo testing python
175 echo ---------------------------------------------
176 echo
177
178 CHECK_PYTHON
179
180 echo
181 echo ---------------------------------------------
182 echo testing swig
183 echo ---------------------------------------------
184 echo
185
186 AM_PATH_PYTHON(2.3)
187 CHECK_SWIG
188 #AM_CONDITIONAL(MED_SWIG_1_3_21, [test "$SWIG_VERSION" = 1.3.21])
189
190 echo
191 echo ---------------------------------------------
192 echo testing HDF5
193 echo ---------------------------------------------
194 echo
195
196 CHECK_HDF5
197
198 echo
199 echo ---------------------------------------------
200 echo BOOST Library
201 echo ---------------------------------------------
202 echo
203
204 CHECK_BOOST
205
206 echo
207 echo ---------------------------------------------
208 echo testing MED2
209 echo ---------------------------------------------
210 echo
211
212 CHECK_MED2
213
214 echo
215 echo ---------------------------------------------
216 echo testing omniORB
217 echo ---------------------------------------------
218 echo
219
220 CHECK_OMNIORB
221
222 echo
223 echo ---------------------------------------------
224 echo default ORB : omniORB
225 echo ---------------------------------------------
226 echo
227
228 DEFAULT_ORB=omniORB
229 CHECK_CORBA
230
231 AC_SUBST_FILE(CORBA)
232 corba=make_$ORB
233 CORBA=adm_local/unix/$corba
234
235 echo
236 echo ---------------------------------------------
237 echo Testing OpenCascade
238 echo ---------------------------------------------
239 echo
240
241 CHECK_CAS
242
243 echo
244 echo ---------------------------------------------
245 echo testing MED
246 echo ---------------------------------------------
247 echo
248
249 CHECK_MED
250
251 dnl For the sake of $MACHINE needed for MED Wrapper
252 AC_DEPEND_FLAG
253
254
255 CALCULATOR_WITH_GUI=no
256
257 AM_CONDITIONAL(CALCULATOR_ENABLE_GUI, [test "${CALCULATOR_WITH_GUI}" = "yes"])
258
259 if test "${CALCULATOR_WITH_GUI}" = "yes"; then
260     echo
261     echo ---------------------------------------------
262     echo Testing GUI
263     echo ---------------------------------------------
264     echo
265
266     CHECK_SALOME_GUI
267
268     echo
269     echo ---------------------------------------------
270     echo Testing full GUI
271     echo ---------------------------------------------
272     echo
273
274     CHECK_CORBA_IN_GUI
275     if test "x${CORBA_IN_GUI}" != "xyes"; then
276       echo "failed : For configure CALCULATOR module necessary full GUI !"
277       exit
278     fi
279
280 fi
281
282 echo
283 echo ---------------------------------------------
284 echo Testing Kernel
285 echo ---------------------------------------------
286 echo
287
288 CHECK_KERNEL
289
290 echo
291 echo ---------------------------------------------
292 echo Summary
293 echo ---------------------------------------------
294 echo
295
296 echo Configure
297 variables="python_ok omniORB_ok Kernel_ok"
298
299 for var in $variables
300 do
301    printf "   %10s : " `echo \$var | sed -e "s,_ok,,"`
302    eval echo \$$var
303 done
304
305 echo
306 echo "Default ORB   : $DEFAULT_ORB"
307 echo
308
309 dnl We don t need to say when we re entering directories if we re using
310 dnl GNU make becuase make does it for us.
311 if test "X$GMAKE" = "Xyes"; then
312    AC_SUBST(SETX) SETX=":"
313 else
314    AC_SUBST(SETX) SETX="set -x"
315 fi
316
317 echo
318 echo ---------------------------------------------
319 echo generating Makefiles and configure files
320 echo ---------------------------------------------
321 echo
322
323 AC_OUTPUT_COMMANDS([ \
324       chmod +x ./bin/*; \
325 ])
326
327 # This list is initiated using autoscan and must be updated manually
328 # when adding a new file <filename>.in to manage. When you execute
329 # autoscan, the Makefile list is generated in the output file configure.scan.
330 # This could be helpfull to update de configuration.
331 AC_OUTPUT([ \
332   ./salome_adm/unix/SALOMEconfig.h \
333   ./adm_local/Makefile \
334   ./adm_local/unix/Makefile \
335   ./adm_local/unix/config_files/Makefile \
336   ./bin/VERSION \
337   ./bin/runAppli \
338   ./bin/Makefile \
339   ./doc/Makefile \
340   ./CALCULATOR_version.h \
341   ./src/Makefile \
342   ./src/CALCULATOR/Makefile \
343   ./resources/Makefile \
344   ./resources/CALCULATORCatalog.xml \
345   ./idl/Makefile \
346   Makefile \
347 ])
348
349 dnl To avoid recompiling half of the sources because of SALOMEconfig.h recreating
350 touch -d 01Jan2007 ./salome_adm/unix/SALOMEconfig.h