Salome HOME
Merge from V6_main 28/02/2013
[modules/gui.git] / configure.ac
1 # Copyright (C) 2007-2012  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
23 # Author : Marc Tajchman (CEA)
24 # Date : 28/06/2001
25 # Modified by : Patrick GOLDBRONN (CEA)
26 # Modified by : Marc Tajchman (CEA)
27 # Modified by : Mikhail PONIKAROV (OCN) - autotools usage
28 #
29 AC_INIT([Salome2 Project GUI module], [7.0.0], [webmaster.salome@opencascade.com], [SalomeGUI])
30 AC_CONFIG_AUX_DIR(adm_local/unix/config_files)
31 AC_CANONICAL_HOST
32 AC_CANONICAL_TARGET
33 AM_INIT_AUTOMAKE([-Wno-portability])
34
35 XVERSION=`echo $VERSION | awk -F. '{printf("0x%02x%02x%02x",$1,$2,$3)}'`
36 AC_SUBST(XVERSION)
37 VERSION_DEV=1
38 AC_SUBST(VERSION_DEV)
39
40 # set up MODULE_NAME variable for dynamic construction of directories (resources, etc.)
41 MODULE_NAME=gui
42 AC_SUBST(MODULE_NAME)
43
44 echo
45 echo ---------------------------------------------
46 echo Initialize source and build root directories
47 echo ---------------------------------------------
48 echo
49
50 ########################################################################
51 # Check --disable-corba-gen and other --disable-* options
52
53 if test "x${enable_corba_gen}" != "xno" ; then
54     GUI_DISABLE_CORBA="no"
55 else 
56     GUI_DISABLE_CORBA="yes"
57 fi
58
59 if test "x${enable_pyConsole}" != "xno" ; then
60     DISABLE_PYCONSOLE="no"
61 else 
62     DISABLE_PYCONSOLE="yes"
63 fi
64
65 if test "x${enable_glViewer}" != "xno" ; then
66     DISABLE_GLVIEWER="no"
67 else 
68     DISABLE_GLVIEWER="yes"
69 fi
70
71 if test "x${enable_plot2dViewer}" != "xno" ; then
72     DISABLE_PLOT2DVIEWER="no"
73 else 
74     DISABLE_PLOT2DVIEWER="yes"
75 fi
76
77 if test "x${enable_supervGraphViewer}" != "xno" ; then
78     DISABLE_SUPERVGRAPHVIEWER="no"
79 else 
80     DISABLE_SUPERVGRAPHVIEWER="yes"
81 fi
82
83 if test "x${enable_occViewer}" != "xno" ; then
84     DISABLE_OCCVIEWER="no"
85 else 
86     DISABLE_OCCVIEWER="yes"
87 fi
88
89 if test "x${enable_vtkViewer}" != "xno" ; then
90     DISABLE_VTKVIEWER="no"
91 else 
92     DISABLE_VTKVIEWER="yes"
93 fi
94
95 if test "x${enable_salomeObject}" != "xno" ; then
96     DISABLE_SALOMEOBJECT="no"
97 else 
98     DISABLE_SALOMEOBJECT="yes"
99 fi
100
101 if test "x${enable_qxGraphViewer}" != "xno" ; then
102     DISABLE_QXGRAPHVIEWER="no"
103 else 
104     DISABLE_QXGRAPHVIEWER="yes"
105 fi
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 AC_LOCAL_INSTALL
144 dnl
145 dnl libtool macro check for CC, LD, NM, LN_S, RANLIB, STRIP + pour les librairies dynamiques !
146
147 echo
148 echo ---------------------------------------------
149 echo Coniguring production
150 echo ---------------------------------------------
151 echo
152 AC_ENABLE_DEBUG(yes)
153 AC_DISABLE_PRODUCTION
154
155 echo ---------------------------------------------
156 echo testing libtool
157 echo ---------------------------------------------
158
159 dnl first, we set static to no!
160 dnl if we want it, use --enable-static
161 AC_ENABLE_STATIC(no)
162
163 AC_LIBTOOL_DLOPEN
164 AC_PROG_LIBTOOL
165
166 dnl Fix up the INSTALL macro if it s a relative path. We want the
167 dnl full-path to the binary instead.
168 case "$INSTALL" in
169    *install-sh*)
170       INSTALL='\${ROOT_BUILDDIR}'/adm_local/unix/config_files/install-sh
171       ;;
172 esac
173
174 echo
175 echo ---------------------------------------------
176 echo testing C/C++
177 echo ---------------------------------------------
178 echo
179
180 cc_ok=no
181 dnl inutil car libtool
182 dnl AC_PROG_CC
183 AC_PROG_CXX
184 AC_CXX_WARNINGS
185 AC_CXX_TEMPLATE_OPTIONS
186 AC_DEPEND_FLAG
187 # AC_CC_WARNINGS([ansi])
188 cc_ok=yes
189
190 dnl Library libdl :
191 AC_CHECK_LIB(dl,dlopen)
192
193 dnl add library libm :
194 AC_CHECK_LIB(m,ceil)
195
196 dnl
197 dnl Well we use sstream which is not in gcc pre-2.95.3
198 dnl We must test if it exists. If not, add it in include !
199 dnl
200
201 AC_CXX_HAVE_SSTREAM
202
203 echo
204 echo ---------------------------------------------
205 echo testing MPI
206 echo ---------------------------------------------
207 echo
208
209 CHECK_MPI
210
211
212 echo
213 echo ---------------------------------------------
214 echo testing LEX \& YACC
215 echo ---------------------------------------------
216 echo
217
218 lex_yacc_ok=no
219 AC_PROG_YACC
220 AC_PROG_LEX
221 lex_yacc_ok=yes
222
223 echo
224 echo ---------------------------------------------
225 echo testing python
226 echo ---------------------------------------------
227 echo
228
229 CHECK_PYTHON
230
231 echo
232 echo ---------------------------------------------
233 echo testing swig
234 echo ---------------------------------------------
235 echo
236
237 AM_PATH_PYTHON(2.3)
238 CHECK_SWIG
239
240
241 dnl echo
242 dnl echo ---------------------------------------------
243 dnl echo testing java
244 dnl echo ---------------------------------------------
245 dnl echo
246
247 dnl CHECK_JAVA
248
249 echo
250 echo ---------------------------------------------
251 echo Testing Disable Corba
252 echo ---------------------------------------------
253 echo
254
255 CHECK_DISABLE_CORBA
256 echo "GUI_DISABLE_CORBA = "$GUI_DISABLE_CORBA
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   if test "x${DISABLE_QXGRAPHVIEWER}" == "xyes" ; then
480     echo "failed : for full configuration of GUI module necessary enable QxGraphViewer !"
481     exit
482   fi
483 fi
484
485 echo
486 echo ---------------------------------------------
487 echo Testing html generators
488 echo ---------------------------------------------
489 echo
490
491 CHECK_HTML_GENERATORS
492
493 echo
494 echo ---------------------------------------------
495 echo Testing Kernel
496 echo ---------------------------------------------
497 echo
498 CHECK_KERNEL
499
500 echo
501 echo ---------------------------------------------
502 echo Testing CPPUNIT only required for unit testing
503 echo ---------------------------------------------
504 echo
505
506 CHECK_CPPUNIT
507
508 echo
509 echo ---------------------------------------------
510 echo Testing libxml2
511 echo ---------------------------------------------
512 echo
513
514 CHECK_LIBXML
515
516 echo
517 echo ---------------------------------------------
518 echo Summary
519 echo ---------------------------------------------
520 echo
521
522 if test "$GUI_DISABLE_CORBA" == "yes"; then
523    echo "Configure (without Corba)"
524 else
525    echo Configure
526 fi
527
528
529 if test "$GUI_DISABLE_CORBA" != "yes"; then
530 variables="cc_ok lex_yacc_ok python_ok swig_ok threads_ok OpenGL_ok qt_ok vtk_ok hdf5_ok
531 omniORB_ok boost_ok occ_ok sip_ok pyqt_ok qwt_ok doxygen_ok graphviz_ok libxml_ok Kernel_ok"
532 else
533 variables="cc_ok lex_yacc_ok python_ok threads_ok OpenGL_ok qt_ok vtk_ok hdf5_ok boost_ok
534 occ_ok sip_ok pyqt_ok qwt_ok doxygen_ok graphviz_ok Kernel_ok "
535 fi
536
537 for var in $variables
538 do
539    printf "   %10s : " `echo \$var | sed -e "s,_ok,,"`
540    eval echo \$$var
541 done
542
543 echo "---Optional:"
544 variables="cppunit_ok TestRecorder_ok"
545
546 for var in $variables
547 do
548    eval toto=\$$var
549    if test x$toto != "x"; then
550      printf "   %10s : " `echo \$var | sed -e "s,_ok,,"`
551      eval echo \$$var
552    fi
553 done
554
555 if test "$GUI_DISABLE_CORBA" != "yes"; then
556 echo
557 echo "Default ORB   : $DEFAULT_ORB"
558 echo
559 fi
560
561 dnl We don t need to say when we re entering directories if we re using
562 dnl GNU make becuase make does it for us.
563 if test "X$GMAKE" = "Xyes"; then
564    AC_SUBST(SETX) SETX=":"
565 else
566    AC_SUBST(SETX) SETX="set -x"
567 fi
568
569 AM_CONDITIONAL(GUI_ENABLE_CORBA, [test "$GUI_DISABLE_CORBA" = no])
570 AM_CONDITIONAL(ENABLE_PYCONSOLE, [test "$DISABLE_PYCONSOLE" = no])
571 AM_CONDITIONAL(ENABLE_GLVIEWER, [test "$DISABLE_GLVIEWER" = no])
572 AM_CONDITIONAL(ENABLE_PLOT2DVIEWER, [test "$DISABLE_PLOT2DVIEWER" = no])
573 AM_CONDITIONAL(ENABLE_SUPERVGRAPHVIEWER, [test "$DISABLE_SUPERVGRAPHVIEWER" = no])
574 AM_CONDITIONAL(ENABLE_OCCVIEWER, [test "$DISABLE_OCCVIEWER" = no])
575 AM_CONDITIONAL(ENABLE_VTKVIEWER, [test "$DISABLE_VTKVIEWER" = no])
576 AM_CONDITIONAL(ENABLE_SALOMEOBJECT, [test "$DISABLE_SALOMEOBJECT" = no])
577 AM_CONDITIONAL(ENABLE_QXGRAPHVIEWER, [test "$DISABLE_QXGRAPHVIEWER" = no])
578 AM_CONDITIONAL(ENABLE_TESTRECORDER, [test "$ENABLE_TESTRECORDER" = yes])
579
580 if test "$DISABLE_PYCONSOLE" = "no" ; then
581   AC_DEFINE(SUIT_ENABLE_PYTHON)
582 fi
583
584 dnl Build with GUI observers feature
585 AC_DEFINE(WITH_SALOMEDS_OBSERVER)
586
587 echo
588 echo ---------------------------------------------
589 echo generating Makefiles and configure files
590 echo ---------------------------------------------
591 echo
592
593 #AC_OUTPUT_COMMANDS([ \
594 #  chmod +x ./bin/*; \
595 #  chmod +x ./bin/salome/*; \
596 #])
597
598 AC_HACK_LIBTOOL
599 AC_CONFIG_COMMANDS([hack_libtool],[
600 sed -i "s%^CC=\"\(.*\)\"%hack_libtool (){ \n\
601   $(pwd)/hack_libtool \1 \"\$[@]\" \n\
602 }\n\
603 CC=\"hack_libtool\"%g" libtool
604 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
605 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
606 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
607 ],[])
608
609 # This list is initiated using autoscan and must be updated manually
610 # when adding a new file <filename>.in to manage. When you execute
611 # autoscan, the Makefile list is generated in the output file configure.scan.
612 # This could be helpfull to update de configuration.
613 AC_OUTPUT([ \
614   adm_local/Makefile \
615   adm_local/cmake_files/Makefile \
616   adm_local/cmake_files/deprecated/Makefile \
617   adm_local/unix/Makefile \
618   adm_local/unix/config_files/Makefile \
619   bin/VERSION \
620   bin/Makefile \
621   GUI_version.h \
622   doc/Makefile \
623   doc/salome/Makefile \
624   doc/salome/gui/Makefile \
625   doc/salome/gui/doxyfile \
626   doc/salome/gui/static/header.html \
627   doc/salome/tui/Makefile \
628   doc/salome/tui/doxyfile \
629   doc/salome/tui/static/header.html \
630   src/Makefile \
631   src/CASCatch/Makefile \
632   src/Qtx/Makefile \
633   src/Style/Makefile \
634   src/DDS/Makefile \
635   src/QDS/Makefile \
636   src/SUIT/Makefile \
637   src/STD/Makefile \
638   src/CAF/Makefile \
639   src/CAM/Makefile \
640   src/SUITApp/Makefile \
641   src/LogWindow/Makefile \
642   src/ObjBrowser/Makefile \
643   src/Prs/Makefile \
644   src/OBJECT/Makefile \
645   src/ViewerTools/Makefile \
646   src/GLViewer/Makefile \
647   src/VTKViewer/Makefile \
648   src/SVTK/Makefile \
649   src/OCCViewer/Makefile \
650   src/SOCC/Makefile \
651   src/PyInterp/Makefile \
652   src/PyConsole/Makefile \
653   src/Plot2d/Makefile \
654   src/SPlot2d/Makefile \
655   src/SUPERVGraph/Makefile \
656   src/QxGraph/Makefile \
657   src/QxScene/Makefile \
658   src/LightApp/Makefile \
659   src/ResExporter/Makefile \
660   src/TOOLSGUI/Makefile \
661   src/Event/Makefile \
662   src/OpenGLUtils/Makefile \
663   src/Session/Makefile \
664   src/SalomeApp/Makefile \
665   src/SalomeApp/Test/Makefile \
666   src/SalomeApp/pluginsdemo/Makefile \
667   src/GuiHelpers/Makefile \
668   src/TreeData/Makefile \
669   src/TreeData/Test/Makefile \
670   src/SALOME_SWIG/Makefile \
671   src/SALOME_SWIG/supervisionexample.py \
672   src/SALOME_SWIG/supervisiongeomexample.py \
673   src/SALOME_PY/Makefile \
674   src/SALOME_PYQT/Makefile \
675   src/SALOME_PYQT/SALOME_PYQT_GUI/Makefile \
676   src/SALOME_PYQT/SALOME_PYQT_GUILight/Makefile \
677   src/SALOME_PYQT/SalomePyQt/Makefile \
678   src/GUI_PY/Makefile \
679   resources/Makefile \
680   idl/Makefile \
681   tools/Makefile \
682   tools/dlgfactory/Makefile \
683   tools/vtkEDFOverloads/Makefile \
684   Makefile
685 ])