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