Salome HOME
Merge from V6_main 01/04/2013
[samples/atomsolv.git] / configure.ac
1 # Copyright (C) 2007-2013  CEA/DEN, EDF R&D, OPEN CASCADE
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([Salome2 Project ATOMSOLV module], [7.1.0], [webmaster.salome@opencascade.com], [SalomeATOMSOLV])
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 XVERSION=`echo $VERSION | awk -F. '{printf("0x%02x%02x%02x",$1,$2,$3)}'`
27 AC_SUBST(XVERSION)
28
29 # set up MODULE_NAME variable for dynamic construction of directories (resources, etc.)
30 MODULE_NAME=atomsolv
31 AC_SUBST(MODULE_NAME)
32 VERSION_DEV=1
33 AC_SUBST(VERSION_DEV)
34
35 dnl
36 dnl Initialize source and build root directories
37 dnl
38
39 ROOT_BUILDDIR=`pwd`
40 ROOT_SRCDIR=`echo $0 | sed -e "s,[[^/]]*$,,;s,/$,,;s,^$,.,"`
41 cd $ROOT_SRCDIR
42 ROOT_SRCDIR=`pwd`
43 cd $ROOT_BUILDDIR
44
45 AC_SUBST(ROOT_SRCDIR)
46 AC_SUBST(ROOT_BUILDDIR)
47
48 echo
49 echo Source root directory : $ROOT_SRCDIR
50 echo Build  root directory : $ROOT_BUILDDIR
51 echo
52 echo
53
54 AC_CHECK_PROG(SHELL,sh)
55 AC_SUBST(SHELL)
56
57 if test -z "$AR"; then
58    AC_CHECK_PROGS(AR,ar xar,:,$PATH)
59 fi
60 AC_SUBST(AR)
61
62 dnl Export the AR macro so that it will be placed in the libtool file
63 dnl correctly.
64 export AR
65
66 echo
67 echo ---------------------------------------------
68 echo testing make
69 echo ---------------------------------------------
70 echo
71
72 AC_PROG_MAKE_SET
73 AC_PROG_INSTALL
74 AC_LOCAL_INSTALL
75 dnl 
76 dnl libtool macro check for CC, LD, NM, LN_S, RANLIB, STRIP + pour les librairies dynamiques !
77
78 AC_ENABLE_DEBUG(yes)
79 AC_DISABLE_PRODUCTION
80
81 echo ---------------------------------------------
82 echo testing libtool
83 echo ---------------------------------------------
84
85 dnl first, we set static to no!
86 dnl if we want it, use --enable-static
87 AC_ENABLE_STATIC(no)
88
89 AC_LIBTOOL_DLOPEN
90 AC_PROG_LIBTOOL
91
92 echo
93 echo ---------------------------------------------
94 echo testing C/C++
95 echo ---------------------------------------------
96 echo
97
98 cc_ok=no
99 dnl inutil car libtool
100 dnl AC_PROG_CC
101 AC_PROG_CXX
102 AC_CXX_WARNINGS
103 AC_CXX_TEMPLATE_OPTIONS
104 AC_DEPEND_FLAG
105 # AC_CC_WARNINGS([ansi])
106 cc_ok=yes
107
108 dnl Library libdl :
109 AC_CHECK_LIB(dl,dlopen)
110
111 dnl add library libm :
112 AC_CHECK_LIB(m,ceil)
113
114 dnl Library librt : for alpha/osf
115 AC_CHECK_LIB(rt,nanosleep)
116
117 dnl 
118 dnl Check if we use std iostream by default or if we must add
119 dnl a compiler directive for that
120 dnl
121
122 AC_CXX_USE_STD_IOSTREAM
123
124 dnl 
125 dnl Well we use sstream which is not in gcc pre-2.95.3
126 dnl We must test if it exists. If not, add it in include !
127 dnl
128
129 AC_CXX_HAVE_SSTREAM
130
131 dnl
132 dnl ---------------------------------------------
133 dnl testing linker
134 dnl ---------------------------------------------
135 dnl
136
137 AC_LINKER_OPTIONS
138
139 dnl
140 dnl ---------------------------------------------
141 dnl testing WITHIHM
142 dnl ---------------------------------------------
143 dnl
144
145 CHECK_WITHIHM
146
147 echo
148 echo ---------------------------------------------
149 echo testing LEX \& YACC
150 echo ---------------------------------------------
151 echo
152
153 lex_yacc_ok=no
154 AC_PROG_YACC
155 AC_PROG_LEX
156 lex_yacc_ok=yes
157
158 echo
159 echo ---------------------------------------------
160 echo testing python
161 echo ---------------------------------------------
162 echo
163
164 CHECK_PYTHON
165
166 AM_PATH_PYTHON(2.3)
167
168 echo
169 echo ---------------------------------------------
170 echo testing threads
171 echo ---------------------------------------------
172 echo
173
174 ENABLE_PTHREADS
175
176 echo
177 echo ---------------------------------------------
178 echo testing omniORB
179 echo ---------------------------------------------
180 echo
181
182 CHECK_OMNIORB
183
184 echo
185 echo ---------------------------------------------
186 echo default ORB : omniORB
187 echo ---------------------------------------------
188 echo
189
190 DEFAULT_ORB=omniORB
191
192 echo
193 echo ---------------------------------------------
194 echo testing Corba
195 echo ---------------------------------------------
196 echo
197
198 CHECK_CORBA
199
200 AC_SUBST_FILE(CORBA)
201 corba=make_$ORB
202 CORBA=adm_local/unix/$corba
203
204 echo
205 echo ---------------------------------------------
206 echo BOOST Library
207 echo ---------------------------------------------
208 echo
209
210 CHECK_BOOST
211
212 echo
213 echo ---------------------------------------------
214 echo Testing Qt
215 echo ---------------------------------------------
216 echo
217
218 CHECK_QT
219
220 echo
221 echo ---------------------------------------------
222 echo Testing OpenCascade
223 echo ---------------------------------------------
224 echo
225
226 CHECK_CAS
227
228 echo
229 echo ---------------------------------------------
230 echo Testing VTK
231 echo ---------------------------------------------
232 echo
233
234 CHECK_VTK
235
236 echo
237 echo ---------------------------------------------
238 echo Testing Kernel
239 echo ---------------------------------------------
240 echo
241
242 CHECK_KERNEL
243
244 echo
245 echo ---------------------------------------------
246 echo Testing GUI
247 echo ---------------------------------------------
248 echo
249
250 CHECK_SALOME_GUI
251
252 echo
253 echo ---------------------------------------------
254 echo Testing ATOMGEN
255 echo ---------------------------------------------
256 echo
257
258 CHECK_ATOMGEN
259
260 echo
261 echo ---------------------------------------------
262 echo Summary
263 echo ---------------------------------------------
264 echo
265
266 echo Configure
267 variables="cc_ok lex_yacc_ok python_ok threads_ok omniORB_ok boost_ok qt_ok occ_ok vtk_ok Kernel_ok SalomeGUI_ok ATOMGEN_ok"
268
269 for var in $variables
270 do
271    printf "   %10s : " `echo \$var | sed -e "s,_ok,,"`
272    eval echo \$$var
273 done
274
275 dnl We don't need to say when we re entering directories if we re using
276 dnl GNU make because make does it for us.
277 if test "X$GMAKE" = "Xyes"; then
278    AC_SUBST(SETX) SETX=":"
279 else
280    AC_SUBST(SETX) SETX="set -x"
281 fi
282
283 AC_OUTPUT_COMMANDS([ \
284         chmod +x ./bin/* \
285 ])
286
287 echo
288 echo ---------------------------------------------
289 echo generating Makefiles and configure files
290 echo ---------------------------------------------
291 echo
292
293 # This list is initiated using autoscan and must be updated manually
294 # when adding a new file <filename>.in to manage. When you execute
295 # autoscan, the Makefile list is generated in the output file configure.scan.
296 # This could be helpfull to update de configuration.
297 AC_OUTPUT([ \
298   adm_local/Makefile \
299   adm_local/unix/Makefile \
300   adm_local/unix/config_files/Makefile \
301   bin/VERSION \
302   bin/runAppli \
303   bin/Makefile \
304   idl/Makefile \
305   resources/Makefile \
306   resources/SalomeApp.xml \
307   src/Makefile \
308   src/ATOMSOLV/Makefile \
309   src/ATOMSOLVGUI/Makefile \
310   ATOMSOLV_version.h \
311   Makefile \
312 ])