Salome HOME
correct make distcheck procedure
[modules/multipr.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 MULTIPR module],[5.1.3], [webmaster.salome@opencascade.com], [SalomeMULTIPR])
33 AC_CONFIG_AUX_DIR(adm_local/unix/config_files)
34 AC_CANONICAL_HOST
35 AC_CANONICAL_TARGET
36 AM_INIT_AUTOMAKE([-Wno-portability])
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=multipr
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 AC_LOCAL_INSTALL
85 dnl 
86 dnl libtool macro check for CC, LD, NM, LN_S, RANLIB, STRIP + for shared libraries
87
88 AC_ENABLE_DEBUG(yes)
89 AC_DISABLE_PRODUCTION
90
91 echo ---------------------------------------------
92 echo testing libtool
93 echo ---------------------------------------------
94
95 dnl first, we set static to no!
96 dnl if we want it, use --enable-static
97 AC_ENABLE_STATIC(no)
98
99 AC_LIBTOOL_DLOPEN
100 AC_PROG_LIBTOOL
101
102 dnl Fix up the INSTALL macro if it s a relative path. We want the
103 dnl full-path to the binary instead.
104 case "$INSTALL" in
105    *install-sh*)
106       INSTALL='\${KERNEL_ROOT_DIR}'/adm_local/unix/config_files/install-sh
107       ;;
108 esac
109
110 echo
111 echo ---------------------------------------------
112 echo testing C/C++
113 echo ---------------------------------------------
114 echo
115
116 cc_ok=no
117 dnl inutil car libtool
118 dnl AC_PROG_CC
119 AC_PROG_CXX
120 AC_CXX_WARNINGS
121 AC_CXX_TEMPLATE_OPTIONS
122 AC_DEPEND_FLAG
123 # AC_CC_WARNINGS([ansi])
124 cc_ok=yes
125
126 dnl Library libdl :
127 AC_CHECK_LIB(dl,dlopen)
128
129 dnl Library librt : for alpha/osf
130 AC_CHECK_LIB(rt,nanosleep)
131
132 dnl add library libm :
133 AC_CHECK_LIB(m,ceil)
134
135 AC_CXX_USE_STD_IOSTREAM
136 AC_CXX_HAVE_SSTREAM
137
138 dnl
139 dnl ---------------------------------------------
140 dnl testing linker
141 dnl ---------------------------------------------
142 dnl
143
144 AC_LINKER_OPTIONS
145
146 echo
147 echo ---------------------------------------------
148 echo testing threads
149 echo ---------------------------------------------
150 echo
151
152 ENABLE_PTHREADS
153
154 echo
155 echo ---------------------------------------------
156 echo testing python
157 echo ---------------------------------------------
158 echo
159
160 CHECK_PYTHON
161
162 AM_PATH_PYTHON(2.3)
163
164 echo
165 echo ---------------------------------------------
166 echo Testing GUI
167 echo ---------------------------------------------
168 echo
169
170 CHECK_GUI_MODULE
171
172 gui_ok=no
173 if test "${SalomeGUI_need}" != "no" -a "${FullGUI_ok}" = "yes" ; then 
174   gui_ok=yes
175 fi
176
177 AM_CONDITIONAL(MULTIPR_ENABLE_GUI, [test "${gui_ok}" = "yes"])
178
179 if test "${SalomeGUI_need}" == "yes"; then
180   if test "${FullGUI_ok}" != "yes"; then
181     AC_MSG_WARN(For configure MULTIPR module necessary full GUI!)
182   fi
183 elif test "${SalomeGUI_need}" == "auto"; then
184   if test "${FullGUI_ok}" != "yes"; then
185     AC_MSG_WARN(Full GUI not found. Build will be done without GUI!)
186   fi
187 elif test "${SalomeGUI_need}" == "no"; then
188   echo Build without GUI option has been chosen
189 fi
190
191 if test "${gui_ok}" = "yes"; then
192         echo
193         echo ---------------------------------------------
194         echo testing QT
195         echo ---------------------------------------------
196         echo
197
198         CHECK_QT
199         
200 fi
201
202 echo
203 echo ---------------------------------------------
204 echo BOOST Library
205 echo ---------------------------------------------
206 echo
207
208 CHECK_BOOST
209
210 echo
211 echo ---------------------------------------------
212 echo Testing OpenCascade
213 echo ---------------------------------------------
214 echo
215
216 CHECK_CAS
217
218 echo
219 echo ---------------------------------------------
220 echo testing omniORB
221 echo ---------------------------------------------
222 echo
223
224 CHECK_OMNIORB
225
226 echo
227 echo ---------------------------------------------
228 echo default ORB : omniORB
229 echo ---------------------------------------------
230 echo
231
232 DEFAULT_ORB=omniORB
233 CHECK_CORBA
234
235 AC_SUBST_FILE(CORBA)
236 corba=make_$ORB
237 CORBA=adm_local/unix/$corba
238
239 echo
240 echo ---------------------------------------------
241 echo Testing Kernel
242 echo ---------------------------------------------
243 echo
244
245 CHECK_KERNEL
246
247 echo
248 echo ---------------------------------------------
249 echo Testing Med
250 echo ---------------------------------------------
251 echo
252
253 CHECK_MED
254
255 echo
256 echo ---------------------------------------------
257 echo testing HDF5
258 echo ---------------------------------------------
259 echo
260
261 CHECK_HDF5
262
263 echo
264 echo ---------------------------------------------
265 echo testing MED2
266 echo ---------------------------------------------
267 echo
268
269 CHECK_MED2
270
271 echo
272 echo ---------------------------------------------
273 echo Summary
274 echo ---------------------------------------------
275 echo
276
277 echo Configure
278 if test "${gui_ok}" = "yes"; then
279   variables="cc_ok threads_ok boost_ok python_ok omniORB_ok qt_ok Kernel_ok Med_ok hdf5_ok med2_ok gui_ok"
280 elif test "${SalomeGUI_need}" != "no"; then
281   variables="cc_ok threads_ok boost_ok python_ok omniORB_ok Kernel_ok Med_ok hdf5_ok med2_ok gui_ok"
282 else
283   variables="cc_ok threads_ok boost_ok python_ok omniORB_ok Kernel_ok Med_ok hdf5_ok med2_ok"
284 fi
285
286 for var in $variables
287 do
288    printf "   %10s : " `echo \$var | sed -e "s,_ok,,"`
289    eval echo \$$var
290 done
291
292 echo
293 echo "Default ORB   : $DEFAULT_ORB"
294 echo
295
296 dnl We don t need to say when we re entering directories if we re using
297 dnl GNU make becuase make does it for us.
298 if test "X$GMAKE" = "Xyes"; then
299    AC_SUBST(SETX) SETX=":"
300 else
301    AC_SUBST(SETX) SETX="set -x"
302 fi
303 echo
304 echo ---------------------------------------------
305 echo generating Makefiles and configure files
306 echo ---------------------------------------------
307 echo
308
309 AC_OUTPUT_COMMANDS([ \
310       chmod +x ./bin/*; \
311 ])
312
313 # This list is initiated using autoscan and must be updated manually
314 # when adding a new file <filename>.in to manage. When you execute
315 # autoscan, the Makefile list is generated in the output file configure.scan.
316 # This could be helpfull to update de configuration.
317 AC_OUTPUT([ \
318   adm_local/Makefile \
319   adm_local/unix/Makefile \
320   adm_local/unix/config_files/Makefile \
321   bin/VERSION \
322   bin/runAppli \
323   bin/Makefile \
324   doc/Makefile \
325   MULTIPR_version.h \
326   resources/MULTIPRCatalog.xml \
327   src/Makefile \
328   src/MULTIPR/Makefile \
329   src/MULTIPRGUI/Makefile \
330   resources/Makefile \
331   idl/Makefile \
332   Makefile \
333 ])