Salome HOME
Merge from V6_main 01/04/2013
[modules/hexablock.git] / configure.ac
1 # Copyright (C) 2009-2013  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 AC_INIT([Salome6 Project HEXABLOCK module],[7.1.0], [webmaster.salome@opencascade.com], [SalomeHEXABLOCK])
21 AC_CONFIG_AUX_DIR(adm_local/unix/config_files)
22 AC_CANONICAL_HOST
23 AC_CANONICAL_TARGET
24 AM_INIT_AUTOMAKE([-Wno-portability])
25
26 SHORT_VERSION=`echo $VERSION | awk -F. '{printf("%d.%d",$1,$2)}'`
27 AC_SUBST(SHORT_VERSION)
28 XVERSION=`echo $VERSION | awk -F. '{printf("0x%02x%02x%02x",$1,$2,$3)}'`
29 AC_SUBST(XVERSION)
30 VERSION_DEV=1
31 AC_SUBST(VERSION_DEV)
32
33 # set up MODULE_NAME variable for dynamic construction of directories (resources, etc.)
34 MODULE_NAME=hexablock
35 AC_SUBST(MODULE_NAME)
36
37 dnl
38 dnl Initialize source and build root directories
39 dnl
40
41 ROOT_BUILDDIR=`pwd`
42 ROOT_SRCDIR=`echo $0 | sed -e "s,[[^/]]*$,,;s,/$,,;s,^$,.,"`
43 cd $ROOT_SRCDIR
44 ROOT_SRCDIR=`pwd`
45 cd $ROOT_BUILDDIR
46
47 AC_SUBST(ROOT_SRCDIR)
48 AC_SUBST(ROOT_BUILDDIR)
49
50 echo
51 echo Source root directory : $ROOT_SRCDIR
52 echo Build  root directory : $ROOT_BUILDDIR
53 echo
54 echo
55
56 AC_CHECK_PROG(SHELL,sh)
57 AC_SUBST(SHELL)
58
59 if test -z "$AR"; then
60    AC_CHECK_PROGS(AR,ar xar,:,$PATH)
61 fi
62 AC_SUBST(AR)
63
64 dnl Export the AR macro so that it will be placed in the libtool file
65 dnl correctly.
66 export AR
67
68 echo
69 echo ---------------------------------------------
70 echo testing make
71 echo ---------------------------------------------
72 echo
73
74 AC_PROG_MAKE_SET
75 AC_PROG_INSTALL
76 dnl 
77 dnl libtool macro check for CC, LD, NM, LN_S, RANLIB, STRIP + for shared libraries
78
79 AC_ENABLE_DEBUG(yes)
80 AC_DISABLE_PRODUCTION
81
82 echo ---------------------------------------------
83 echo testing libtool
84 echo ---------------------------------------------
85
86 dnl first, we set static to no!
87 dnl if we want it, use --enable-static
88 AC_ENABLE_STATIC(no)
89
90 AC_LIBTOOL_DLOPEN
91 AC_PROG_LIBTOOL
92
93 dnl Fix up the INSTALL macro if it s a relative path. We want the
94 dnl full-path to the binary instead.
95 case "$INSTALL" in
96    *install-sh*)
97       INSTALL='\${KERNEL_ROOT_DIR}'/salome_adm/unix/config_files/install-sh
98       ;;
99 esac
100
101 echo
102 echo ---------------------------------------------
103 echo testing C/C++
104 echo ---------------------------------------------
105 echo
106
107 cc_ok=no
108 dnl inutil car libtool
109 dnl AC_PROG_CC
110 AC_PROG_CXX
111 AC_CXX_WARNINGS
112 AC_CXX_TEMPLATE_OPTIONS
113 AC_DEPEND_FLAG
114 # AC_CC_WARNINGS([ansi])
115 cc_ok=yes
116
117 dnl Library libdl :
118 AC_CHECK_LIB(dl,dlopen)
119
120 dnl Library librt : for alpha/osf
121 AC_CHECK_LIB(rt,nanosleep)
122
123 dnl add library libm :
124 AC_CHECK_LIB(m,ceil)
125
126 AC_CXX_USE_STD_IOSTREAM
127 AC_CXX_HAVE_SSTREAM
128
129 dnl
130 dnl ---------------------------------------------
131 dnl testing linker
132 dnl ---------------------------------------------
133 dnl
134
135 AC_LINKER_OPTIONS
136
137 echo
138 echo ---------------------------------------------
139 echo testing threads
140 echo ---------------------------------------------
141 echo
142
143 ENABLE_PTHREADS
144
145 echo
146 echo ---------------------------------------------
147 echo testing python
148 echo ---------------------------------------------
149 echo
150
151 CHECK_PYTHON
152
153 AM_PATH_PYTHON(2.3)
154
155 echo
156 echo ---------------------------------------------
157 echo testing QT
158 echo ---------------------------------------------
159 echo
160
161 CHECK_QT
162
163
164
165
166
167
168
169 echo
170 echo ---------------------------------------------
171 echo BOOST Library
172 echo ---------------------------------------------
173 echo
174
175 CHECK_BOOST
176
177 echo
178 echo ---------------------------------------------
179 echo Testing OpenCascade
180 echo ---------------------------------------------
181 echo
182
183 CHECK_CAS
184
185 echo
186 echo ---------------------------------------------
187 echo testing omniORB
188 echo ---------------------------------------------
189 echo
190
191 CHECK_OMNIORB
192
193 echo
194 echo ---------------------------------------------
195 echo default ORB : omniORB
196 echo ---------------------------------------------
197 echo
198
199 DEFAULT_ORB=omniORB
200 CHECK_CORBA
201
202 AC_SUBST_FILE(CORBA)
203 corba=make_$ORB
204 CORBA=adm_local/unix/$corba
205
206
207
208 echo
209 echo ----------------------------------------------
210 echo testing CPPUNIT only required for unit testing
211 echo ----------------------------------------------
212 echo
213 CHECK_CPPUNIT
214
215
216
217 echo
218 echo ----------------------------------------------
219 echo testing Sphinx
220 echo ----------------------------------------------
221 echo
222
223 CHECK_SPHINX
224
225
226
227 echo
228 echo ---------------------------------------------
229 echo Testing Kernel
230 echo ---------------------------------------------
231 echo
232
233 CHECK_KERNEL
234
235
236
237 echo
238 echo ---------------------------------------------
239 echo Testing GUI
240 echo ---------------------------------------------
241 echo
242
243 CHECK_SALOME_GUI
244
245
246
247 echo
248 echo ---------------------------------------------
249 echo Testing Geom
250 echo ---------------------------------------------
251 echo
252
253 CHECK_GEOM
254
255
256 echo
257 echo ---------------------------------------------
258 echo Testing full GUI
259 echo ---------------------------------------------
260 echo
261
262 CHECK_CORBA_IN_GUI
263 if test "x${CORBA_IN_GUI}" != "xyes"; then
264   echo "failed : For configure HEXABLOCK module necessary full GUI !"
265   exit
266 fi
267
268
269
270
271 echo
272 echo ---------------------------------------------
273 echo Testing LIBXML
274 echo ---------------------------------------------
275 echo
276 AC_CHECK_LIBXML
277
278
279 echo
280 echo ---------------------------------------------
281 echo Testing QT4
282 echo ---------------------------------------------
283 echo
284 I2_CHECK_QT4
285
286
287
288 echo
289 echo ---------------------------------------------
290 echo testing VTK
291 echo ---------------------------------------------
292 echo
293 CHECK_VTK
294
295
296 echo
297 echo ---------------------------------------------
298 echo Summary
299 echo ---------------------------------------------
300 echo
301
302 echo Configure
303 variables="cc_ok threads_ok boost_ok python_ok omniORB_ok qt_ok occ_ok sphinx_ok vtk_ok Kernel_ok SalomeGUI_ok Geom_ok"
304
305 for var in $variables
306 do
307    printf "   %10s : " `echo \$var | sed -e "s,_ok,,"`
308    eval echo \$$var
309 done
310
311 echo
312 echo "Default ORB   : $DEFAULT_ORB"
313 echo
314
315 dnl AM_CONDITIONAL(ENABLE_VTKVIEWER, [test "$DISABLE_VTKVIEWER" = no])
316 dnl We don t need to say when we re entering directories if we re using
317 dnl GNU make becuase make does it for us.
318 if test "X$GMAKE" = "Xyes"; then
319    AC_SUBST(SETX) SETX=":"
320 else
321    AC_SUBST(SETX) SETX="set -x"
322 fi
323 echo
324 echo ---------------------------------------------
325 echo generating Makefiles and configure files
326 echo ---------------------------------------------
327 echo
328
329 AC_OUTPUT_COMMANDS([ \
330       chmod +x ./bin/*; \
331 ])
332
333
334
335 AM_CONDITIONAL(WINDOWS, [ test ])
336
337 # This list is initiated using autoscan and must be updated manually
338 # when adding a new file <filename>.in to manage. When you execute
339 # autoscan, the Makefile list is generated in the output file configure.scan.
340 #
341 # This could be helpfull to update de configuration.
342 AC_OUTPUT([ \
343   salome_adm/unix/SALOMEconfig.h \
344   adm_local/Makefile \
345   adm_local/unix/Makefile \
346   adm_local/unix/config_files/Makefile \
347   bin/VERSION \
348   bin/runAppli \
349   bin/Makefile \
350   doc/Makefile \
351   doc/conf.py \
352   HEXABLOCK_version.h \
353   src/Makefile \
354   src/HEXABLOCKGUI/Makefile \
355   src/HEXABLOCKGUI/MyDlgRef/Makefile \
356   src/HEXABLOCKGUI/resources/HEXABLOCKCatalog.xml \
357   src/HEXABLOCKGUI/resources/SalomeApp.xml \
358   src/HEXABLOCK/Makefile \
359   src/HEXABLOCK_I/Makefile \
360   src/TEST_CPP/Makefile \
361   src/TEST_PY/Makefile \
362   idl/Makefile \
363   Makefile \
364 ])