Salome HOME
Merge from V6_2_BR 23/12/2010
[modules/multipr.git] / configure.ac
1 #  Copyright (C) 2007-2010  CEA/DEN, EDF R&D
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 #  PLEASE DO NOT MODIFY configure.in FILE
21 #  ALL CHANGES WILL BE DISCARDED BY THE NEXT
22 #  build_configure COMMAND
23 #  CHANGES MUST BE MADE IN configure.in.base FILE
24 # Author : Marc Tajchman (CEA)
25 # Date : 28/06/2001
26 # Modified by : Patrick GOLDBRONN (CEA)
27 # Modified by : Marc Tajchman (CEA)
28 # Created from configure.in.base
29 #
30 AC_INIT([Salome2 Project MULTIPR module],[6.2.0], [webmaster.salome@opencascade.com], [SalomeMULTIPR])
31 AC_CONFIG_AUX_DIR(adm_local/unix/config_files)
32 AC_CANONICAL_HOST
33 AC_CANONICAL_TARGET
34 AM_INIT_AUTOMAKE([-Wno-portability])
35
36 XVERSION=`echo $VERSION | awk -F. '{printf("0x%02x%02x%02x",$1,$2,$3)}'`
37 AC_SUBST(XVERSION)
38
39 # set up MODULE_NAME variable for dynamic construction of directories (resources, etc.)
40 MODULE_NAME=multipr
41 AC_SUBST(MODULE_NAME)
42
43 dnl
44 dnl Initialize source and build root directories
45 dnl
46
47 ROOT_BUILDDIR=`pwd`
48 ROOT_SRCDIR=`echo $0 | sed -e "s,[[^/]]*$,,;s,/$,,;s,^$,.,"`
49 cd $ROOT_SRCDIR
50 ROOT_SRCDIR=`pwd`
51 cd $ROOT_BUILDDIR
52
53 AC_SUBST(ROOT_SRCDIR)
54 AC_SUBST(ROOT_BUILDDIR)
55
56 echo
57 echo Source root directory : $ROOT_SRCDIR
58 echo Build  root directory : $ROOT_BUILDDIR
59 echo
60 echo
61
62 AC_CHECK_PROG(SHELL,sh)
63 AC_SUBST(SHELL)
64
65 if test -z "$AR"; then
66    AC_CHECK_PROGS(AR,ar xar,:,$PATH)
67 fi
68 AC_SUBST(AR)
69
70 dnl Export the AR macro so that it will be placed in the libtool file
71 dnl correctly.
72 export AR
73
74 echo
75 echo ---------------------------------------------
76 echo testing make
77 echo ---------------------------------------------
78 echo
79
80 AC_PROG_MAKE_SET
81 AC_PROG_INSTALL
82 AC_LOCAL_INSTALL
83 dnl 
84 dnl libtool macro check for CC, LD, NM, LN_S, RANLIB, STRIP + for shared libraries
85
86 AC_ENABLE_DEBUG(yes)
87 AC_DISABLE_PRODUCTION
88
89 echo ---------------------------------------------
90 echo testing libtool
91 echo ---------------------------------------------
92
93 dnl first, we set static to no!
94 dnl if we want it, use --enable-static
95 AC_ENABLE_STATIC(no)
96
97 AC_LIBTOOL_DLOPEN
98 AC_PROG_LIBTOOL
99
100 dnl Fix up the INSTALL macro if it s a relative path. We want the
101 dnl full-path to the binary instead.
102 case "$INSTALL" in
103    *install-sh*)
104       INSTALL='\${KERNEL_ROOT_DIR}'/adm_local/unix/config_files/install-sh
105       ;;
106 esac
107
108 echo
109 echo ---------------------------------------------
110 echo testing C/C++
111 echo ---------------------------------------------
112 echo
113
114 cc_ok=no
115 dnl inutil car libtool
116 dnl AC_PROG_CC
117 AC_PROG_CXX
118 AC_CXX_WARNINGS
119 AC_CXX_TEMPLATE_OPTIONS
120 AC_DEPEND_FLAG
121 # AC_CC_WARNINGS([ansi])
122 cc_ok=yes
123
124 dnl Library libdl :
125 AC_CHECK_LIB(dl,dlopen)
126
127 dnl Library librt : for alpha/osf
128 AC_CHECK_LIB(rt,nanosleep)
129
130 dnl add library libm :
131 AC_CHECK_LIB(m,ceil)
132
133 AC_CXX_USE_STD_IOSTREAM
134 AC_CXX_HAVE_SSTREAM
135
136 dnl
137 dnl ---------------------------------------------
138 dnl testing linker
139 dnl ---------------------------------------------
140 dnl
141
142 AC_LINKER_OPTIONS
143
144 echo
145 echo ---------------------------------------------
146 echo testing threads
147 echo ---------------------------------------------
148 echo
149
150 ENABLE_PTHREADS
151
152 echo
153 echo ---------------------------------------------
154 echo testing MPI
155 echo ---------------------------------------------
156 echo
157
158 CHECK_MPI
159
160 echo
161 echo ---------------------------------------------
162 echo testing python
163 echo ---------------------------------------------
164 echo
165
166 CHECK_PYTHON
167
168 AM_PATH_PYTHON(2.3)
169
170 echo
171 echo ---------------------------------------------
172 echo Testing GUI
173 echo ---------------------------------------------
174 echo
175
176 CHECK_GUI_MODULE
177
178 gui_ok=no
179 if test "${SalomeGUI_need}" != "no" -a "${FullGUI_ok}" = "yes" ; then 
180   gui_ok=yes
181 fi
182
183 AM_CONDITIONAL(MULTIPR_ENABLE_GUI, [test "${gui_ok}" = "yes"])
184
185 if test "${SalomeGUI_need}" == "yes"; then
186   if test "${FullGUI_ok}" != "yes"; then
187     AC_MSG_WARN(For configure MULTIPR module necessary full GUI!)
188   fi
189 elif test "${SalomeGUI_need}" == "auto"; then
190   if test "${FullGUI_ok}" != "yes"; then
191     AC_MSG_WARN(Full GUI not found. Build will be done without GUI!)
192   fi
193 elif test "${SalomeGUI_need}" == "no"; then
194   echo Build without GUI option has been chosen
195 fi
196
197 if test "${gui_ok}" = "yes"; then
198         echo
199         echo ---------------------------------------------
200         echo testing QT
201         echo ---------------------------------------------
202         echo
203
204         CHECK_QT
205         
206 fi
207
208 echo
209 echo ---------------------------------------------
210 echo BOOST Library
211 echo ---------------------------------------------
212 echo
213
214 CHECK_BOOST
215
216 echo
217 echo ---------------------------------------------
218 echo Testing OpenCascade
219 echo ---------------------------------------------
220 echo
221
222 CHECK_CAS
223
224 echo
225 echo ---------------------------------------------
226 echo testing omniORB
227 echo ---------------------------------------------
228 echo
229
230 CHECK_OMNIORB
231
232 echo
233 echo ---------------------------------------------
234 echo default ORB : omniORB
235 echo ---------------------------------------------
236 echo
237
238 DEFAULT_ORB=omniORB
239 CHECK_CORBA
240
241 AC_SUBST_FILE(CORBA)
242 corba=make_$ORB
243 CORBA=adm_local/unix/$corba
244
245 echo
246 echo ---------------------------------------------
247 echo Testing Kernel
248 echo ---------------------------------------------
249 echo
250
251 CHECK_KERNEL
252
253 echo
254 echo ---------------------------------------------
255 echo Testing Med
256 echo ---------------------------------------------
257 echo
258
259 CHECK_MED
260
261 echo
262 echo ---------------------------------------------
263 echo testing HDF5
264 echo ---------------------------------------------
265 echo
266
267 CHECK_HDF5
268
269 echo
270 echo ---------------------------------------------
271 echo testing MED2
272 echo ---------------------------------------------
273 echo
274
275 CHECK_MED2
276
277 echo
278 echo ---------------------------------------------
279 echo Summary
280 echo ---------------------------------------------
281 echo
282
283 echo Configure
284 if test "${gui_ok}" = "yes"; then
285   variables="cc_ok threads_ok boost_ok python_ok omniORB_ok qt_ok Kernel_ok Med_ok hdf5_ok med2_ok gui_ok"
286 elif test "${SalomeGUI_need}" != "no"; then
287   variables="cc_ok threads_ok boost_ok python_ok omniORB_ok Kernel_ok Med_ok hdf5_ok med2_ok gui_ok"
288 else
289   variables="cc_ok threads_ok boost_ok python_ok omniORB_ok Kernel_ok Med_ok hdf5_ok med2_ok"
290 fi
291
292 for var in $variables
293 do
294    printf "   %10s : " `echo \$var | sed -e "s,_ok,,"`
295    eval echo \$$var
296 done
297
298 echo
299 echo "Default ORB   : $DEFAULT_ORB"
300 echo
301
302 dnl We don t need to say when we re entering directories if we re using
303 dnl GNU make becuase make does it for us.
304 if test "X$GMAKE" = "Xyes"; then
305    AC_SUBST(SETX) SETX=":"
306 else
307    AC_SUBST(SETX) SETX="set -x"
308 fi
309 echo
310 echo ---------------------------------------------
311 echo generating Makefiles and configure files
312 echo ---------------------------------------------
313 echo
314
315 AC_OUTPUT_COMMANDS([ \
316       chmod +x ./bin/*; \
317 ])
318
319 AC_HACK_LIBTOOL
320 AC_CONFIG_COMMANDS([hack_libtool],[
321 sed -i "s%^CC=\"\(.*\)\"%hack_libtool (){ \n\
322   $(pwd)/hack_libtool \1 \"\$[@]\" \n\
323 }\n\
324 CC=\"hack_libtool\"%g" libtool
325 sed -i "s%\(\s*\)for searchdir in \$newlib_search_path \$lib_search_path \$sys_lib_search_path \$shlib_search_path; do%\1searchdirs=\"\$newlib_search_path \$lib_search_path \$sys_lib_search_path \$shlib_search_path\"\n\1for searchdir in \$searchdirs; do%g" libtool
326 sed -i "s%\(\s*\)searchdirs=\"\$newlib_search_path \$lib_search_path \(.*\)\"%\1searchdirs=\"\$newlib_search_path \$lib_search_path\"\n\1sss_beg=\"\"\n\1sss_end=\"\2\"%g" libtool
327 sed -i "s%\(\s*\)\(for searchdir in \$searchdirs; do\)%\1for sss in \$searchdirs; do\n\1  if ! test -d \$sss; then continue; fi\n\1  ssss=\$(cd \$sss; pwd)\n\1  if test \"\$ssss\" != \"\" \&\& test -d \$ssss; then\n\1    case \$ssss in\n\1      /usr/lib | /usr/lib64 ) ;;\n\1      * ) sss_beg=\"\$sss_beg \$ssss\" ;;\n\1    esac\n\1  fi\n\1done\n\1searchdirs=\"\$sss_beg \$sss_end\"\n\1\2%g" libtool
328 ],[])
329
330 # This list is initiated using autoscan and must be updated manually
331 # when adding a new file <filename>.in to manage. When you execute
332 # autoscan, the Makefile list is generated in the output file configure.scan.
333 # This could be helpfull to update de configuration.
334 AC_OUTPUT([ \
335   adm_local/Makefile \
336   adm_local/unix/Makefile \
337   adm_local/unix/config_files/Makefile \
338   bin/VERSION \
339   bin/runAppli \
340   bin/Makefile \
341   doc/Makefile \
342   MULTIPR_version.h \
343   resources/MULTIPRCatalog.xml \
344   src/Makefile \
345   src/MULTIPR/Makefile \
346   src/MULTIPRGUI/Makefile \
347   resources/Makefile \
348   idl/Makefile \
349   Makefile \
350 ])