Salome HOME
400431c9e2b7af4ce84b7b8697d2989ad577f79e
[tools/tutorial.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([Salome2 Project ATOMIC module], [0.3.0], [webmaster.salome@opencascade.com], [SalomeATOMIC])
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=atomic
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 openGL
179 echo ---------------------------------------------
180 echo
181
182 CHECK_OPENGL
183
184 echo
185 echo ---------------------------------------------
186 echo testing QT
187 echo ---------------------------------------------
188 echo
189
190 CHECK_QT
191
192 echo
193 echo ---------------------------------------------
194 echo testing VTK
195 echo ---------------------------------------------
196 echo
197
198 CHECK_VTK
199
200 echo
201 echo ---------------------------------------------
202 echo testing HDF5
203 echo ---------------------------------------------
204 echo
205
206 CHECK_HDF5
207
208 echo
209 echo ---------------------------------------------
210 echo Testing OpenCascade
211 echo ---------------------------------------------
212 echo
213
214 CHECK_CAS
215
216 echo
217 echo ---------------------------------------------
218 echo Testing html generators
219 echo ---------------------------------------------
220 echo
221
222 CHECK_HTML_GENERATORS
223
224 echo
225 echo ---------------------------------------------
226 echo Testing gd library
227 echo ---------------------------------------------
228 echo
229
230 CHECK_GDLIB
231
232 echo
233 echo ---------------------------------------------
234 echo Testing Kernel
235 echo ---------------------------------------------
236 echo
237
238 CHECK_KERNEL
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 Summary
251 echo ---------------------------------------------
252 echo
253
254 echo Configure
255 variables="cc_ok lex_yacc_ok python_ok threads_ok OpenGL_ok qt_ok vtk_ok hdf5_ok occ_ok doxygen_ok graphviz_ok gd_ok Kernel_ok SalomeGUI_ok"
256
257 for var in $variables
258 do
259    printf "   %10s : " `echo \$var | sed -e "s,_ok,,"`
260    eval echo \$$var
261 done
262
263 dnl We don't need to say when we re entering directories if we re using
264 dnl GNU make because make does it for us.
265 if test "X$GMAKE" = "Xyes"; then
266    AC_SUBST(SETX) SETX=":"
267 else
268    AC_SUBST(SETX) SETX="set -x"
269 fi
270
271 AC_OUTPUT_COMMANDS([ \
272         chmod +x ./bin/* \
273 ])
274
275 echo
276 echo ---------------------------------------------
277 echo generating Makefiles and configure files
278 echo ---------------------------------------------
279 echo
280
281 # This list is initiated using autoscan and must be updated manually
282 # when adding a new file <filename>.in to manage. When you execute
283 # autoscan, the Makefile list is generated in the output file configure.scan.
284 # This could be helpfull to update de configuration.
285 AC_OUTPUT([ \
286   adm_local/Makefile \
287   adm_local/unix/Makefile \
288   adm_local/unix/config_files/Makefile \
289   bin/VERSION \
290   bin/Makefile \
291   resources/Makefile \
292   src/Makefile \
293   src/ATOMICGUI/Makefile \
294   ATOMIC_version.h \
295   Makefile \
296 ])