Salome HOME
ce8a18a24b66d9550e14080c5090be4707794bdf
[samples/atomsolv.git] / configure.ac
1 #  Copyright (C) 2007-2010  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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
21
22 AC_INIT([Salome5 Project ATOMSOLV module], [0.3.0], [webmaster.salome@opencascade.com], [SalomeATOMSOLV])
23 AC_CONFIG_AUX_DIR(adm_local/unix/config_files)
24 AC_CANONICAL_HOST
25 AC_CANONICAL_TARGET
26 AM_INIT_AUTOMAKE([-Wno-portability])
27
28 XVERSION=`echo $VERSION | awk -F. '{printf("0x%02x%02x%02x",$1,$2,$3)}'`
29 AC_SUBST(XVERSION)
30
31 # set up MODULE_NAME variable for dynamic construction of directories (resources, etc.)
32 MODULE_NAME=atomsolv
33 AC_SUBST(MODULE_NAME)
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 Testing Qt
207 echo ---------------------------------------------
208 echo
209
210 CHECK_QT
211
212 echo
213 echo ---------------------------------------------
214 echo Testing OpenCascade
215 echo ---------------------------------------------
216 echo
217
218 CHECK_CAS
219
220 echo
221 echo ---------------------------------------------
222 echo Testing VTK
223 echo ---------------------------------------------
224 echo
225
226 CHECK_VTK
227
228 echo
229 echo ---------------------------------------------
230 echo Testing Kernel
231 echo ---------------------------------------------
232 echo
233
234 CHECK_KERNEL
235
236 echo
237 echo ---------------------------------------------
238 echo Testing GUI
239 echo ---------------------------------------------
240 echo
241
242 CHECK_SALOME_GUI
243
244 echo
245 echo ---------------------------------------------
246 echo Testing ATOMGEN
247 echo ---------------------------------------------
248 echo
249
250 CHECK_ATOMGEN
251
252 echo
253 echo ---------------------------------------------
254 echo Summary
255 echo ---------------------------------------------
256 echo
257
258 echo Configure
259 variables="cc_ok lex_yacc_ok python_ok threads_ok omniORB_ok qt_ok occ_ok vtk_ok Kernel_ok SalomeGUI_ok ATOMGEN_ok"
260
261 for var in $variables
262 do
263    printf "   %10s : " `echo \$var | sed -e "s,_ok,,"`
264    eval echo \$$var
265 done
266
267 dnl We don't need to say when we re entering directories if we re using
268 dnl GNU make because make does it for us.
269 if test "X$GMAKE" = "Xyes"; then
270    AC_SUBST(SETX) SETX=":"
271 else
272    AC_SUBST(SETX) SETX="set -x"
273 fi
274
275 AC_OUTPUT_COMMANDS([ \
276         chmod +x ./bin/* \
277 ])
278
279 echo
280 echo ---------------------------------------------
281 echo generating Makefiles and configure files
282 echo ---------------------------------------------
283 echo
284
285 # This list is initiated using autoscan and must be updated manually
286 # when adding a new file <filename>.in to manage. When you execute
287 # autoscan, the Makefile list is generated in the output file configure.scan.
288 # This could be helpfull to update de configuration.
289 AC_OUTPUT([ \
290   adm_local/Makefile \
291   adm_local/unix/Makefile \
292   adm_local/unix/config_files/Makefile \
293   bin/VERSION \
294   bin/runAppli \
295   bin/Makefile \
296   idl/Makefile \
297   resources/Makefile \
298   src/Makefile \
299   src/ATOMSOLV/Makefile \
300   src/ATOMSOLVGUI/Makefile \
301   ATOMSOLV_version.h \
302   Makefile \
303 ])