Salome HOME
Merge from BR_V5_DEV 17Feb09
[samples/pycalculator.git] / configure.ac
1 #  Copyright (C) 2007-2008  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.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 #
22 #  PLEASE DO NOT MODIFY configure.in FILE
23 #  ALL CHANGES WILL BE DISCARDED BY THE NEXT
24 #  build_configure COMMAND
25 #  CHANGES MUST BE MADE IN configure.in.base FILE
26 # Author : Marc Tajchman (CEA)
27 # Date : 28/06/2001
28 # Modified by : Patrick GOLDBRONN (CEA)
29 # Modified by : Marc Tajchman (CEA)
30 # Created from configure.in.base
31 #
32 AC_INIT([Salome2 Project PYCALCULATOR module], [5.1.0], [webmaster.salome@opencascade.com], [SalomePYCALCULATOR])
33 AC_CONFIG_AUX_DIR(salome_adm/unix/config_files)
34 AC_CANONICAL_HOST
35 AC_CANONICAL_TARGET
36 AM_INIT_AUTOMAKE
37
38 XVERSION=`echo $VERSION | awk -F. '{printf("0x%02x%02x%02x",$1,$2,$3)}'`
39 AC_SUBST(XVERSION)
40
41 # set up MODULE_NAME variable for dynamic construction of directories (resources, etc.)
42 MODULE_NAME=pycalculator
43 AC_SUBST(MODULE_NAME)
44
45 dnl
46 dnl Initialize source and build root directories
47 dnl
48
49 ROOT_BUILDDIR=`pwd`
50 ROOT_SRCDIR=`echo $0 | sed -e "s,[[^/]]*$,,;s,/$,,;s,^$,.,"`
51 cd $ROOT_SRCDIR
52 ROOT_SRCDIR=`pwd`
53 cd $ROOT_BUILDDIR
54
55 AC_SUBST(ROOT_SRCDIR)
56 AC_SUBST(ROOT_BUILDDIR)
57
58 echo
59 echo Source root directory : $ROOT_SRCDIR
60 echo Build  root directory : $ROOT_BUILDDIR
61 echo
62 echo
63
64 AC_CHECK_PROG(SHELL,sh)
65 AC_SUBST(SHELL)
66
67 if test -z "$AR"; then
68    AC_CHECK_PROGS(AR,ar xar,:,$PATH)
69 fi
70 AC_SUBST(AR)
71
72 dnl Export the AR macro so that it will be placed in the libtool file
73 dnl correctly.
74 export AR
75
76 echo
77 echo ---------------------------------------------
78 echo testing make
79 echo ---------------------------------------------
80 echo
81
82 AC_PROG_MAKE_SET
83 AC_PROG_INSTALL
84 dnl 
85 dnl libtool macro check for CC, LD, NM, LN_S, RANLIB, STRIP + pour les librairies dynamiques !
86
87 AC_ENABLE_DEBUG(yes)
88 AC_DISABLE_PRODUCTION
89
90 echo ---------------------------------------------
91 echo testing libtool
92 echo ---------------------------------------------
93
94 dnl first, we set static to no!
95 dnl if we want it, use --enable-static
96 AC_ENABLE_STATIC(no)
97
98 AC_LIBTOOL_DLOPEN
99 AC_PROG_LIBTOOL
100
101 dnl Fix up the INSTALL macro if it s a relative path. We want the
102 dnl full-path to the binary instead.
103 case "$INSTALL" in
104    *install-sh*)
105       INSTALL='\${KERNEL_ROOT_DIR}'/salome_adm/unix/config_files/install-sh
106       ;;
107 esac
108
109 echo
110 echo ---------------------------------------------
111 echo testing C/C++
112 echo ---------------------------------------------
113 echo
114
115 cc_ok=no
116 dnl inutil car libtool
117 dnl AC_PROG_CC
118 AC_PROG_CXX
119 AC_DEPEND_FLAG
120 # AC_CC_WARNINGS([ansi])
121 cc_ok=yes
122
123 dnl Library libdl :
124 AC_CHECK_LIB(dl,dlopen)
125
126 dnl add library libm :
127 AC_CHECK_LIB(m,ceil)
128
129 dnl 
130 dnl Well we use sstream which is not in gcc pre-2.95.3
131 dnl We must test if it exists. If not, add it in include !
132 dnl
133
134 AC_CXX_HAVE_SSTREAM
135
136 dnl
137 dnl ---------------------------------------------
138 dnl testing MPICH
139 dnl ---------------------------------------------
140 dnl
141
142 CHECK_MPICH
143
144 echo
145 echo ---------------------------------------------
146 echo testing LEX \& YACC
147 echo ---------------------------------------------
148 echo
149
150 lex_yacc_ok=no
151 AC_PROG_YACC
152 AC_PROG_LEX
153 lex_yacc_ok=yes
154
155 echo
156 echo ---------------------------------------------
157 echo testing python
158 echo ---------------------------------------------
159 echo
160
161 CHECK_PYTHON
162
163 AM_PATH_PYTHON(2.3)
164
165 dnl echo
166 dnl echo ---------------------------------------------
167 dnl echo testing java
168 dnl echo ---------------------------------------------
169 dnl echo
170
171 dnl CHECK_JAVA
172
173 echo
174 echo ---------------------------------------------
175 echo testing threads
176 echo ---------------------------------------------
177 echo
178
179 ENABLE_PTHREADS
180
181 echo
182 echo ---------------------------------------------
183 echo testing omniORB
184 echo ---------------------------------------------
185 echo
186
187 CHECK_OMNIORB
188
189 dnl echo
190 dnl echo ---------------------------------------------
191 dnl echo testing mico
192 dnl echo ---------------------------------------------
193 dnl echo
194
195 dnl CHECK_MICO
196
197 echo
198 echo ---------------------------------------------
199 echo default ORB : omniORB
200 echo ---------------------------------------------
201 echo
202
203 DEFAULT_ORB=omniORB
204 CHECK_CORBA
205
206 AC_SUBST_FILE(CORBA)
207 corba=make_$ORB
208 CORBA=adm_local/unix/$corba
209
210 CHECK_HTML_GENERATORS
211
212 echo
213 echo ---------------------------------------------
214 echo Testing Kernel
215 echo ---------------------------------------------
216 echo
217
218 CHECK_KERNEL
219
220 echo
221 echo ---------------------------------------------
222 echo testing MED module
223 echo ---------------------------------------------
224 echo
225
226 CHECK_MED
227
228
229 echo
230 echo ---------------------------------------------
231 echo Testing html generators
232 echo ---------------------------------------------
233 echo
234
235 CHECK_HTML_GENERATORS
236
237 echo
238 echo ---------------------------------------------
239 echo Summary
240 echo ---------------------------------------------
241 echo
242
243 echo Configure
244 variables="cc_ok lex_yacc_ok python_ok threads_ok omniORB_ok Kernel_ok Med_ok"
245
246 for var in $variables
247 do
248    printf "   %10s : " `echo \$var | sed -e "s,_ok,,"`
249    eval echo \$$var
250 done
251
252 echo "---Optional:"
253 variables="mpi_ok cppunit_ok openpbs_ok lsf_ok doxygen_ok graphviz_ok"
254  
255 for var in $variables
256 do
257    eval toto=\$$var
258    if test x$toto != "x"; then
259      printf "   %10s : " `echo \$var | sed -e "s,_ok,,"`
260      eval echo \$$var
261    fi
262 done
263
264 echo
265 echo "Default ORB   : $DEFAULT_ORB"
266 echo
267
268 dnl We don t need to say when we re entering directories if we re using
269 dnl GNU make becuase make does it for us.
270 if test "X$GMAKE" = "Xyes"; then
271    AC_SUBST(SETX) SETX=":"
272 else
273    AC_SUBST(SETX) SETX="set -x"
274 fi
275 echo
276 echo ---------------------------------------------
277 echo generating Makefiles and configure files
278 echo ---------------------------------------------
279 echo
280
281 AC_OUTPUT_COMMANDS([ \
282       chmod +x ./bin/*; \
283 ])
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   ./salome_adm/unix/SALOMEconfig.h \
291   ./adm_local/Makefile \
292   ./adm_local/unix/Makefile \
293   ./adm_local/unix/config_files/Makefile \
294   ./bin/VERSION \
295   ./bin/Makefile \
296   ./doc/Makefile \
297   ./doc/salome/Makefile \
298   ./doc/salome/tui/Makefile \
299   ./doc/salome/tui/doxyfile \
300   ./src/Makefile \
301   ./src/PYCALCULATOR/Makefile \
302   ./resources/Makefile \
303   ./resources/PYCALCULATORCatalog.xml \
304   ./idl/Makefile \
305   Makefile \
306 ])