]> SALOME platform Git repositories - modules/gui.git/blob - configure.ac
Salome HOME
Update from BR_V5_DEV 13Feb2009
[modules/gui.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 # Author : Marc Tajchman (CEA)
23 # Date : 28/06/2001
24 # Modified by : Patrick GOLDBRONN (CEA)
25 # Modified by : Marc Tajchman (CEA)
26 # Modified by : Mikhail PONIKAROV (OCN) - autotools usage
27 #
28 AC_INIT([Salome2 Project GUI module], [5.1.0], [webmaster.salome@opencascade.com], [SalomeGUI])
29 AC_CONFIG_AUX_DIR(salome_adm/unix/config_files)
30 AC_CANONICAL_HOST
31 AC_CANONICAL_TARGET
32 AM_INIT_AUTOMAKE
33
34 XVERSION=`echo $VERSION | awk -F. '{printf("0x%02x%02x%02x",$1,$2,$3)}'`
35 AC_SUBST(XVERSION)
36
37 # set up MODULE_NAME variable for dynamic construction of directories (resources, etc.)
38 MODULE_NAME=gui
39 AC_SUBST(MODULE_NAME)
40
41 echo
42 echo ---------------------------------------------
43 echo Initialize source and build root directories
44 echo ---------------------------------------------
45 echo
46
47 ########################################################################
48 # Check --disable-corba-gen and other --disable-* options
49
50 if test "x${enable_corba_gen}" != "xno" ; then
51     GUI_DISABLE_CORBA="no"
52 else 
53     GUI_DISABLE_CORBA="yes"
54 fi
55
56 if test "x${enable_pyConsole}" != "xno" ; then
57     DISABLE_PYCONSOLE="no"
58 else 
59     DISABLE_PYCONSOLE="yes"
60 fi
61
62 if test "x${enable_glViewer}" != "xno" ; then
63     DISABLE_GLVIEWER="no"
64 else 
65     DISABLE_GLVIEWER="yes"
66 fi
67
68 if test "x${enable_plot2dViewer}" != "xno" ; then
69     DISABLE_PLOT2DVIEWER="no"
70 else 
71     DISABLE_PLOT2DVIEWER="yes"
72 fi
73
74 if test "x${enable_supervGraphViewer}" != "xno" ; then
75     DISABLE_SUPERVGRAPHVIEWER="no"
76 else 
77     DISABLE_SUPERVGRAPHVIEWER="yes"
78 fi
79
80 if test "x${enable_occViewer}" != "xno" ; then
81     DISABLE_OCCVIEWER="no"
82 else 
83     DISABLE_OCCVIEWER="yes"
84 fi
85
86 if test "x${enable_vtkViewer}" != "xno" ; then
87     DISABLE_VTKVIEWER="no"
88 else 
89     DISABLE_VTKVIEWER="yes"
90 fi
91
92 if test "x${enable_salomeObject}" != "xno" ; then
93     DISABLE_SALOMEOBJECT="no"
94 else 
95     DISABLE_SALOMEOBJECT="yes"
96 fi
97
98 if test "x${enable_qxGraphViewer}" != "xno" ; then
99     DISABLE_QXGRAPHVIEWER="no"
100 else 
101     DISABLE_QXGRAPHVIEWER="yes"
102 fi
103 dnl THIS IS A TEMPORARY SOLUTION BECAUSE QXGRAPH NOT YET PORTING TO QT4
104 dnl AFTER PORTING QXGARPH TO QT4 THE STRING BELOW HAVE TO BE REMOVED
105 DISABLE_QXGRAPHVIEWER="yes"
106
107 dnl
108 dnl Initialize source and build root directories
109 dnl
110
111 ROOT_BUILDDIR=`pwd`
112 ROOT_SRCDIR=`echo $0 | sed -e "s,[[^/]]*$,,;s,/$,,;s,^$,.,"`
113 cd $ROOT_SRCDIR
114 ROOT_SRCDIR=`pwd`
115 cd $ROOT_BUILDDIR
116
117 AC_SUBST(ROOT_SRCDIR)
118 AC_SUBST(ROOT_BUILDDIR)
119
120 echo
121 echo Source root directory : $ROOT_SRCDIR
122 echo Build  root directory : $ROOT_BUILDDIR
123 echo
124 echo
125
126 if test -z "$AR"; then
127    AC_CHECK_PROGS(AR,ar xar,:,$PATH)
128 fi
129 AC_SUBST(AR)
130
131 dnl Export the AR macro so that it will be placed in the libtool file
132 dnl correctly.
133 export AR
134
135 echo
136 echo ---------------------------------------------
137 echo testing make
138 echo ---------------------------------------------
139 echo
140
141 AC_PROG_MAKE_SET
142 AC_PROG_INSTALL
143 dnl
144 dnl libtool macro check for CC, LD, NM, LN_S, RANLIB, STRIP + pour les librairies dynamiques !
145
146 echo
147 echo ---------------------------------------------
148 echo Coniguring production
149 echo ---------------------------------------------
150 echo
151 AC_ENABLE_DEBUG(yes)
152 AC_DISABLE_PRODUCTION
153
154 echo ---------------------------------------------
155 echo testing libtool
156 echo ---------------------------------------------
157
158 dnl first, we set static to no!
159 dnl if we want it, use --enable-static
160 AC_ENABLE_STATIC(no)
161
162 AC_LIBTOOL_DLOPEN
163 AC_PROG_LIBTOOL
164
165 dnl Fix up the INSTALL macro if it s a relative path. We want the
166 dnl full-path to the binary instead.
167 case "$INSTALL" in
168    *install-sh*)
169       INSTALL='\${ROOT_BUILDDIR}'/salome_adm/unix/config_files/install-sh
170       ;;
171 esac
172
173 echo
174 echo ---------------------------------------------
175 echo testing C/C++
176 echo ---------------------------------------------
177 echo
178
179 cc_ok=no
180 dnl inutil car libtool
181 dnl AC_PROG_CC
182 AC_PROG_CXX
183 AC_CXX_WARNINGS
184 AC_CXX_TEMPLATE_OPTIONS
185 AC_DEPEND_FLAG
186 # AC_CC_WARNINGS([ansi])
187 cc_ok=yes
188
189 dnl Library libdl :
190 AC_CHECK_LIB(dl,dlopen)
191
192 dnl add library libm :
193 AC_CHECK_LIB(m,ceil)
194
195 dnl
196 dnl Well we use sstream which is not in gcc pre-2.95.3
197 dnl We must test if it exists. If not, add it in include !
198 dnl
199
200 AC_CXX_HAVE_SSTREAM
201
202 dnl
203 dnl ---------------------------------------------
204 dnl testing MPICH
205 dnl ---------------------------------------------
206 dnl
207
208 CHECK_MPICH
209
210 echo
211 echo ---------------------------------------------
212 echo testing LEX \& YACC
213 echo ---------------------------------------------
214 echo
215
216 lex_yacc_ok=no
217 AC_PROG_YACC
218 AC_PROG_LEX
219 lex_yacc_ok=yes
220
221 echo
222 echo ---------------------------------------------
223 echo testing python
224 echo ---------------------------------------------
225 echo
226
227 CHECK_PYTHON
228
229 dnl echo
230 dnl echo ---------------------------------------------
231 dnl echo testing java
232 dnl echo ---------------------------------------------
233 dnl echo
234
235 dnl CHECK_JAVA
236
237 echo
238 echo ---------------------------------------------
239 echo Testing Disable Corba
240 echo ---------------------------------------------
241 echo
242
243 CHECK_DISABLE_CORBA
244 echo "GUI_DISABLE_CORBA = "$GUI_DISABLE_CORBA
245
246 if test "x${GUI_DISABLE_CORBA}" != "xyes" ; then
247
248 echo
249 echo ---------------------------------------------
250 echo testing swig
251 echo ---------------------------------------------
252 echo
253
254 AM_PATH_PYTHON(2.3)
255 CHECK_SWIG
256 fi
257
258 echo
259 echo ---------------------------------------------
260 echo testing threads
261 echo ---------------------------------------------
262 echo
263
264 ENABLE_PTHREADS
265
266 if test "x${GUI_DISABLE_CORBA}" != "xyes" ; then
267 echo
268 echo ---------------------------------------------
269 echo testing omniORB
270 echo ---------------------------------------------
271 echo
272
273 CHECK_OMNIORB
274
275 dnl echo
276 dnl echo ---------------------------------------------
277 dnl echo testing mico
278 dnl echo ---------------------------------------------
279 dnl echo
280
281 dnl CHECK_MICO
282
283 echo
284 echo ---------------------------------------------
285 echo default ORB : omniORB
286 echo ---------------------------------------------
287 echo
288
289 DEFAULT_ORB=omniORB
290
291 echo
292 echo ---------------------------------------------
293 echo testing Corba
294 echo ---------------------------------------------
295 echo
296
297 CHECK_CORBA
298
299 AC_SUBST_FILE(CORBA)
300 corba=make_$ORB
301 CORBA=adm_local/unix/$corba
302
303 fi
304 echo
305 echo ---------------------------------------------
306 echo testing openGL
307 echo ---------------------------------------------
308 echo
309
310 CHECK_OPENGL
311
312 echo
313 echo ---------------------------------------------
314 echo testing QT
315 echo ---------------------------------------------
316 echo
317
318 CHECK_QT
319
320 echo
321 echo ---------------------------------------------
322 echo testing VTK
323 echo ---------------------------------------------
324 echo
325
326 CHECK_VTK
327
328 echo
329 echo ---------------------------------------------
330 echo testing HDF5
331 echo ---------------------------------------------
332 echo
333
334 CHECK_HDF5
335
336 echo
337 echo ---------------------------------------------
338 echo BOOST Library
339 echo ---------------------------------------------
340 echo
341
342 CHECK_BOOST
343
344 echo
345 echo ---------------------------------------------
346 echo Testing OpenCascade
347 echo ---------------------------------------------
348 echo
349
350 CHECK_CAS
351
352 echo
353 echo ---------------------------------------------
354 echo Testing sip
355 echo ---------------------------------------------
356 echo
357
358 CHECK_SIP
359
360 echo
361 echo ---------------------------------------------
362 echo Testing pyqt
363 echo ---------------------------------------------
364 echo
365
366 CHECK_PYQT
367
368 echo
369 echo ---------------------------------------------
370 echo Testing qwt
371 echo ---------------------------------------------
372 echo
373
374 CHECK_QWT
375
376 CHECK_TESTRECORDER
377
378 echo
379 echo ---------------------------------------------
380 echo Testing PyConsole
381 echo ---------------------------------------------
382 echo
383
384 CHECK_PYCONSOLE
385 echo "DISABLE_PYCONSOLE = "$DISABLE_PYCONSOLE
386
387 echo
388 echo ---------------------------------------------
389 echo Testing GlViewer
390 echo ---------------------------------------------
391 echo
392
393 CHECK_GLVIEWER
394 echo "DISABLE_GLVIEWER = "$DISABLE_GLVIEWER
395
396 echo
397 echo ---------------------------------------------
398 echo Testing Plot2dViewer
399 echo ---------------------------------------------
400 echo
401
402 CHECK_PLOT2DVIEWER
403 echo "DISABLE_PLOT2DVIEWER = "$DISABLE_PLOT2DVIEWER
404
405 echo
406 echo ---------------------------------------------
407 echo Testing SupervGraphViewer
408 echo ---------------------------------------------
409 echo
410
411 CHECK_SUPERVGRAPHVIEWER
412 echo "DISABLE_SUPERVGRAPHVIEWER = "$DISABLE_SUPERVGRAPHVIEWER
413
414 echo
415 echo ---------------------------------------------
416 echo Testing OCCViewer
417 echo ---------------------------------------------
418 echo
419
420 CHECK_OCCVIEWER
421 echo "DISABLE_OCCVIEWER = "$DISABLE_OCCVIEWER
422
423 echo
424 echo ---------------------------------------------
425 echo Testing VTKViewer
426 echo ---------------------------------------------
427 echo
428
429 CHECK_VTKVIEWER
430 echo "DISABLE_VTKVIEWER = "$DISABLE_VTKVIEWER
431
432 echo
433 echo ---------------------------------------------
434 echo Testing SalomeObject
435 echo ---------------------------------------------
436 echo
437
438 CHECK_SALOMEOBJECT
439 echo "DISABLE_SALOMEOBJECT = "$DISABLE_SALOMEOBJECT
440
441 echo
442 echo ---------------------------------------------
443 echo Testing QxGraphViewer
444 echo ---------------------------------------------
445 echo
446
447 CHECK_QXGRAPHVIEWER
448 echo "DISABLE_QXGRAPHVIEWER = "$DISABLE_QXGRAPHVIEWER
449
450 if test "x${GUI_DISABLE_CORBA}" != "xyes" ; then
451   if test "x${DISABLE_PYCONSOLE}" == "xyes" ; then
452     echo "failed : for full configuration of GUI module necessary enable PyConsole !"
453     exit
454   fi
455   if test "x${DISABLE_GLVIEWER}" == "xyes" ; then
456     echo "failed : for full configuration of GUI module necessary enable GlViewer !"
457     exit
458   fi
459   if test "x${DISABLE_PLOT2DVIEWER}" == "xyes" ; then
460     echo "failed : for full configuration of GUI module necessary enable Plot2dViewer !"
461     exit
462   fi
463   if test "x${DISABLE_SUPERVGRAPHVIEWER}" == "xyes" ; then
464     echo "failed : for full configuration of GUI module necessary enable SupervGraphViewer !"
465     exit
466   fi
467   if test "x${DISABLE_OCCVIEWER}" == "xyes" ; then
468     echo "failed : for full configuration of GUI module necessary enable OCCViewer !"
469     exit
470   fi
471   if test "x${DISABLE_VTKVIEWER}" == "xyes" ; then
472     echo "failed : for full configuration of GUI module necessary enable VTKViewer !"
473     exit
474   fi
475   if test "x${DISABLE_SALOMEOBJECT}" == "xyes" ; then
476     echo "failed : for full configuration of GUI module necessary enable SalomeObject !"
477     exit
478   fi
479   dnl THIS IS A TEMPORARY SOLUTION BECAUSE QXGRAPH NOT YET PORTING TO QT4
480   dnl AFTER PORTING QXGARPH TO QT4 THE FOLLOWING CHECK HAVE TO BE UNCOMMENTED
481   dnl if test "x${DISABLE_QXGRAPHVIEWER}" == "xyes" ; then
482   dnl   echo "failed : for full configuration of GUI module necessary enable QxGraphViewer !"
483   dnl   exit
484   dnl fi
485 fi
486
487 echo
488 echo ---------------------------------------------
489 echo Testing html generators
490 echo ---------------------------------------------
491 echo
492
493 CHECK_HTML_GENERATORS
494
495 echo
496 echo ---------------------------------------------
497 echo Testing Kernel
498 echo ---------------------------------------------
499 echo
500 CHECK_KERNEL
501
502 echo
503 echo ---------------------------------------------
504 echo Testing CPPUNIT only required for unit testing
505 echo ---------------------------------------------
506 echo
507
508 CHECK_CPPUNIT
509
510 echo
511 echo ---------------------------------------------
512 echo Testing libxml2
513 echo ---------------------------------------------
514 echo
515
516 CHECK_LIBXML
517
518 echo
519 echo ---------------------------------------------
520 echo Summary
521 echo ---------------------------------------------
522 echo
523
524 if test "$GUI_DISABLE_CORBA" == "yes"; then
525    echo "Configure (without Corba)"
526 else
527    echo Configure
528 fi
529
530
531 if test "$GUI_DISABLE_CORBA" != "yes"; then
532 variables="cc_ok lex_yacc_ok python_ok swig_ok threads_ok OpenGL_ok qt_ok vtk_ok hdf5_ok
533 omniORB_ok boost_ok occ_ok sip_ok pyqt_ok qwt_ok doxygen_ok graphviz_ok libxml_ok Kernel_ok"
534 else
535 variables="cc_ok lex_yacc_ok python_ok threads_ok OpenGL_ok qt_ok vtk_ok hdf5_ok boost_ok
536 occ_ok sip_ok pyqt_ok qwt_ok doxygen_ok graphviz_ok Kernel_ok"
537 fi
538
539 for var in $variables
540 do
541    printf "   %10s : " `echo \$var | sed -e "s,_ok,,"`
542    eval echo \$$var
543 done
544
545 echo "---Optional:"
546 variables="cppunit_ok TestRecorder_ok"
547
548 for var in $variables
549 do
550    eval toto=\$$var
551    if test x$toto != "x"; then
552      printf "   %10s : " `echo \$var | sed -e "s,_ok,,"`
553      eval echo \$$var
554    fi
555 done
556
557 if test "$GUI_DISABLE_CORBA" != "yes"; then
558 echo
559 echo "Default ORB   : $DEFAULT_ORB"
560 echo
561 fi
562
563 dnl We don t need to say when we re entering directories if we re using
564 dnl GNU make becuase make does it for us.
565 if test "X$GMAKE" = "Xyes"; then
566    AC_SUBST(SETX) SETX=":"
567 else
568    AC_SUBST(SETX) SETX="set -x"
569 fi
570
571 AM_CONDITIONAL(GUI_ENABLE_CORBA, [test "$GUI_DISABLE_CORBA" = no])
572 AM_CONDITIONAL(ENABLE_PYCONSOLE, [test "$DISABLE_PYCONSOLE" = no])
573 AM_CONDITIONAL(ENABLE_GLVIEWER, [test "$DISABLE_GLVIEWER" = no])
574 AM_CONDITIONAL(ENABLE_PLOT2DVIEWER, [test "$DISABLE_PLOT2DVIEWER" = no])
575 AM_CONDITIONAL(ENABLE_SUPERVGRAPHVIEWER, [test "$DISABLE_SUPERVGRAPHVIEWER" = no])
576 AM_CONDITIONAL(ENABLE_OCCVIEWER, [test "$DISABLE_OCCVIEWER" = no])
577 AM_CONDITIONAL(ENABLE_VTKVIEWER, [test "$DISABLE_VTKVIEWER" = no])
578 AM_CONDITIONAL(ENABLE_SALOMEOBJECT, [test "$DISABLE_SALOMEOBJECT" = no])
579 AM_CONDITIONAL(ENABLE_QXGRAPHVIEWER, [test "$DISABLE_QXGRAPHVIEWER" = no])
580 AM_CONDITIONAL(ENABLE_TESTRECORDER, [test "$ENABLE_TESTRECORDER" = yes])
581
582 echo
583 echo ---------------------------------------------
584 echo generating Makefiles and configure files
585 echo ---------------------------------------------
586 echo
587
588 #AC_OUTPUT_COMMANDS([ \
589 #  chmod +x ./bin/*; \
590 #  chmod +x ./bin/salome/*; \
591 #])
592
593 # This list is initiated using autoscan and must be updated manually
594 # when adding a new file <filename>.in to manage. When you execute
595 # autoscan, the Makefile list is generated in the output file configure.scan.
596 # This could be helpfull to update de configuration.
597 AC_OUTPUT([ \
598   ./salome_adm/unix/SALOMEconfig.h \
599   ./adm_local/Makefile \
600   ./adm_local/cmake_files/Makefile \
601   ./adm_local/unix/Makefile \
602   ./adm_local/unix/config_files/Makefile \
603   ./bin/VERSION \
604   ./bin/Makefile \
605   ./GUI_version.h \
606   ./doc/Makefile \
607   ./doc/salome/Makefile \
608   ./doc/salome/gui/Makefile \
609   ./doc/salome/gui/doxyfile \
610   ./doc/salome/tui/Makefile \
611   ./doc/salome/tui/doxyfile \
612   ./src/Makefile \
613   ./src/CASCatch/Makefile \
614   ./src/Qtx/Makefile \
615   ./src/Style/Makefile \
616   ./src/DDS/Makefile \
617   ./src/QDS/Makefile \
618   ./src/SUIT/Makefile \
619   ./src/STD/Makefile \
620   ./src/CAF/Makefile \
621   ./src/CAM/Makefile \
622   ./src/SUITApp/Makefile \
623   ./src/LogWindow/Makefile \
624   ./src/ObjBrowser/Makefile \
625   ./src/Prs/Makefile \
626   ./src/OBJECT/Makefile \
627   ./src/GLViewer/Makefile \
628   ./src/VTKViewer/Makefile \
629   ./src/SVTK/Makefile \
630   ./src/OCCViewer/Makefile \
631   ./src/SOCC/Makefile \
632   ./src/PyInterp/Makefile \
633   ./src/PyConsole/Makefile \
634   ./src/Plot2d/Makefile \
635   ./src/SPlot2d/Makefile \
636   ./src/SUPERVGraph/Makefile \
637   ./src/QxGraph/Makefile \
638   ./src/QxScene/Makefile \
639   ./src/LightApp/Makefile \
640   ./src/ResExporter/Makefile \
641   ./src/TOOLSGUI/Makefile \
642   ./src/Event/Makefile \
643   ./src/Session/Makefile \
644   ./src/SalomeApp/Makefile \
645   ./src/SalomeApp/Test/Makefile \
646   ./src/SALOME_SWIG/Makefile \
647   ./src/SALOME_SWIG/supervisionexample.py \
648   ./src/SALOME_SWIG/supervisiongeomexample.py \
649   ./src/SALOME_PY/Makefile \
650   ./src/SALOME_PYQT/Makefile \
651   ./src/SALOME_PYQT/SALOME_PYQT_GUI/Makefile \
652   ./src/SALOME_PYQT/SalomePyQt/Makefile \
653   ./resources/Makefile \
654   ./idl/Makefile \
655   Makefile
656 ])