Salome HOME
86fc9ff5dbac9f8dc0c9a41e83122329eea629e7
[modules/gui.git] / configure.in.base
1 #
2 #  PLEASE DO NOT MODIFY configure.in FILE
3 #
4 #  ALL CHANGES WILL BE DISCARDED BY THE NEXT
5 #  build_configure COMMAND
6 #
7 #  CHANGES MUST BE MADE IN configure.in.base FILE
8 #
9 #
10 # Author : Marc Tajchman (CEA)
11 # Date : 28/06/2001
12 # Modified by : Patrick GOLDBRONN (CEA)
13 # Modified by : Marc Tajchman (CEA)
14 #
15 # Created from configure.in.base
16 #
17
18
19 AC_INIT(src)
20 AC_CONFIG_AUX_DIR(${KERNEL_ROOT_DIR}/salome_adm/unix/config_files)
21 AC_CANONICAL_HOST
22
23 PACKAGE=salome
24 AC_SUBST(PACKAGE)
25
26 VERSION=0.0.1
27 AC_SUBST(VERSION)
28
29 ########################################################################
30 # Check --disable-corba option
31
32 GUI_DISABLE_CORBA="no"
33 DISABLE_PYCONSOLE="no"
34 DISABLE_GLVIEWER="no"
35 DISABLE_PLOT2DVIEWER="no"
36 DISABLE_SUPERVGRAPHVIEWER="no"
37 DISABLE_OCCVIEWER="no"
38 DISABLE_VTKVIEWER="no"
39 DISABLE_SALOMEOBJECT="no"
40
41 for option
42 do
43   case $option in
44       -disable-corba=yes | --disable-corba=yes | -disable-corba | --disable-corba)
45           GUI_DISABLE_CORBA="yes";;
46       -disable-pyConsole=yes | --disable-pyConsole=yes | -disable-pyConsole | --disable-pyConsole)
47           DISABLE_PYCONSOLE="yes";;
48       -disable-glViewer=yes | --disable-glViewer=yes | -disable-glViewer | --disable-glViewer)
49           DISABLE_GLVIEWER="yes";;
50       -disable-plot2dViewer=yes | --disable-plot2dViewer=yes | -disable-plot2dViewer | --disable-plot2dViewer)
51           DISABLE_PLOT2DVIEWER="yes";;
52       -disable-supervGraphViewer=yes | --disable-supervGraphViewer=yes | \
53       -disable-supervGraphViewer | --disable-supervGraphViewer)
54           DISABLE_SUPERVGRAPHVIEWER="yes";;
55       -disable-occViewer=yes | --disable-occViewer=yes | -disable-occViewer | --disable-occViewer)
56           DISABLE_OCCVIEWER="yes";;
57       -disable-vtkViewer=yes | --disable-vtkViewer=yes | -disable-vtkViewer | --disable-vtkViewer)
58           DISABLE_VTKVIEWER="yes";;
59       -disable-salomeObject=yes | --disable-salomeObject=yes | -disable-salomeObject | --disable-salomeObject)
60           DISABLE_SALOMEOBJECT="yes";;
61   esac
62 done
63
64 dnl
65 dnl Initialize source and build root directories
66 dnl
67
68 ROOT_BUILDDIR=`pwd`
69 ROOT_SRCDIR=`echo $0 | sed -e "s,[[^/]]*$,,;s,/$,,;s,^$,.,"`
70 cd $ROOT_SRCDIR
71 ROOT_SRCDIR=`pwd`
72 cd $ROOT_BUILDDIR
73
74 AC_SUBST(ROOT_SRCDIR)
75 AC_SUBST(ROOT_BUILDDIR)
76
77 echo
78 echo Source root directory : $ROOT_SRCDIR
79 echo Build  root directory : $ROOT_BUILDDIR
80 echo
81 echo
82
83 if test -z "$AR"; then
84    AC_CHECK_PROGS(AR,ar xar,:,$PATH)
85 fi
86 AC_SUBST(AR)
87
88 dnl Export the AR macro so that it will be placed in the libtool file
89 dnl correctly.
90 export AR
91
92 echo
93 echo ---------------------------------------------
94 echo testing make
95 echo ---------------------------------------------
96 echo
97
98 AC_PROG_MAKE_SET
99 AC_PROG_INSTALL
100 dnl 
101 dnl libtool macro check for CC, LD, NM, LN_S, RANLIB, STRIP + pour les librairies dynamiques !
102
103 AC_ENABLE_DEBUG(yes)
104 AC_DISABLE_PRODUCTION
105
106 echo ---------------------------------------------
107 echo testing libtool
108 echo ---------------------------------------------
109
110 dnl first, we set static to no!
111 dnl if we want it, use --enable-static
112 AC_ENABLE_STATIC(no)
113
114 AC_LIBTOOL_DLOPEN
115 AC_PROG_LIBTOOL
116
117 dnl Fix up the INSTALL macro if it s a relative path. We want the
118 dnl full-path to the binary instead.
119 case "$INSTALL" in
120    *install-sh*)
121       INSTALL='\${KERNEL_ROOT_DIR}'/salome_adm/unix/config_files/install-sh
122       ;;
123 esac
124
125 echo
126 echo ---------------------------------------------
127 echo testing C/C++
128 echo ---------------------------------------------
129 echo
130
131 cc_ok=no
132 dnl inutil car libtool
133 dnl AC_PROG_CC
134 AC_PROG_CXX
135 AC_CXX_WARNINGS
136 AC_CXX_TEMPLATE_OPTIONS
137 AC_DEPEND_FLAG
138 # AC_CC_WARNINGS([ansi])
139 cc_ok=yes
140
141 dnl Library libdl :
142 AC_CHECK_LIB(dl,dlopen)
143
144 dnl add library libm :
145 AC_CHECK_LIB(m,ceil)
146
147 dnl 
148 dnl Well we use sstream which is not in gcc pre-2.95.3
149 dnl We must test if it exists. If not, add it in include !
150 dnl
151
152 AC_CXX_HAVE_SSTREAM
153
154 dnl
155 dnl ---------------------------------------------
156 dnl testing MPICH
157 dnl ---------------------------------------------
158 dnl
159
160 CHECK_MPICH
161
162 echo
163 echo ---------------------------------------------
164 echo testing LEX \& YACC
165 echo ---------------------------------------------
166 echo
167
168 lex_yacc_ok=no
169 AC_PROG_YACC
170 AC_PROG_LEX
171 lex_yacc_ok=yes
172
173 echo
174 echo ---------------------------------------------
175 echo testing python
176 echo ---------------------------------------------
177 echo
178
179 CHECK_PYTHON
180
181 dnl echo
182 dnl echo ---------------------------------------------
183 dnl echo testing java
184 dnl echo ---------------------------------------------
185 dnl echo
186
187 dnl CHECK_JAVA
188
189 echo
190 echo ---------------------------------------------
191 echo Testing Disable Corba
192 echo ---------------------------------------------
193 echo
194
195 CHECK_DISABLE_CORBA
196 echo "GUI_DISABLE_CORBA = "$GUI_DISABLE_CORBA
197
198 if test "x${GUI_DISABLE_CORBA}" != "xyes" ; then
199
200 echo
201 echo ---------------------------------------------
202 echo testing swig
203 echo ---------------------------------------------
204 echo
205
206 CHECK_SWIG
207 fi
208
209 echo
210 echo ---------------------------------------------
211 echo testing threads
212 echo ---------------------------------------------
213 echo
214
215 ENABLE_PTHREADS
216
217 if test "x${GUI_DISABLE_CORBA}" != "xyes" ; then
218 echo
219 echo ---------------------------------------------
220 echo testing omniORB
221 echo ---------------------------------------------
222 echo
223
224 CHECK_OMNIORB
225
226 dnl echo
227 dnl echo ---------------------------------------------
228 dnl echo testing mico
229 dnl echo ---------------------------------------------
230 dnl echo
231
232 dnl CHECK_MICO
233
234 echo
235 echo ---------------------------------------------
236 echo default ORB : omniORB
237 echo ---------------------------------------------
238 echo
239
240 DEFAULT_ORB=omniORB
241
242 echo
243 echo ---------------------------------------------
244 echo testing Corba
245 echo ---------------------------------------------
246 echo
247
248 CHECK_CORBA
249
250 AC_SUBST_FILE(CORBA)
251 corba=make_$ORB
252 CORBA=adm_local/unix/$corba
253
254 fi
255 echo
256 echo ---------------------------------------------
257 echo testing openGL
258 echo ---------------------------------------------
259 echo
260
261 CHECK_OPENGL
262
263 echo
264 echo ---------------------------------------------
265 echo testing QT
266 echo ---------------------------------------------
267 echo
268
269 CHECK_QT
270
271 echo
272 echo ---------------------------------------------
273 echo testing msg2qm
274 echo ---------------------------------------------
275 echo
276
277 CHECK_MSG2QM
278
279 echo
280 echo ---------------------------------------------
281 echo testing VTK
282 echo ---------------------------------------------
283 echo
284
285 CHECK_VTK
286
287 echo
288 echo ---------------------------------------------
289 echo testing HDF5
290 echo ---------------------------------------------
291 echo
292
293 CHECK_HDF5
294
295 echo
296 echo ---------------------------------------------
297 echo BOOST Library
298 echo ---------------------------------------------
299 echo
300
301 CHECK_BOOST
302
303 echo
304 echo ---------------------------------------------
305 echo Testing OpenCascade
306 echo ---------------------------------------------
307 echo
308
309 CHECK_CAS
310
311 echo
312 echo ---------------------------------------------
313 echo Testing sip
314 echo ---------------------------------------------
315 echo
316
317 CHECK_SIP
318
319 echo
320 echo ---------------------------------------------
321 echo Testing pyqt
322 echo ---------------------------------------------
323 echo
324
325 CHECK_PYQT
326
327 echo
328 echo ---------------------------------------------
329 echo Testing qwt
330 echo ---------------------------------------------
331 echo
332
333 CHECK_QWT 
334
335 echo
336 echo ---------------------------------------------
337 echo Testing PyConsole
338 echo ---------------------------------------------
339 echo
340
341 CHECK_PYCONSOLE
342 echo "DISABLE_PYCONSOLE = "$DISABLE_PYCONSOLE
343
344 echo
345 echo ---------------------------------------------
346 echo Testing GlViewer
347 echo ---------------------------------------------
348 echo
349
350 CHECK_GLVIEWER
351 echo "DISABLE_GLVIEWER = "$DISABLE_GLVIEWER
352
353 echo
354 echo ---------------------------------------------
355 echo Testing Plot2dViewer
356 echo ---------------------------------------------
357 echo
358
359 CHECK_PLOT2DVIEWER
360 echo "DISABLE_PLOT2DVIEWER = "$DISABLE_PLOT2DVIEWER
361
362 echo
363 echo ---------------------------------------------
364 echo Testing SupervGraphViewer
365 echo ---------------------------------------------
366 echo
367
368 CHECK_SUPERVGRAPHVIEWER
369 echo "DISABLE_SUPERVGRAPHVIEWER = "$DISABLE_SUPERVGRAPHVIEWER
370
371 echo
372 echo ---------------------------------------------
373 echo Testing OCCViewer
374 echo ---------------------------------------------
375 echo
376
377 CHECK_OCCVIEWER
378 echo "DISABLE_OCCVIEWER = "$DISABLE_OCCVIEWER
379
380 echo
381 echo ---------------------------------------------
382 echo Testing VTKViewer
383 echo ---------------------------------------------
384 echo
385
386 CHECK_VTKVIEWER
387 echo "DISABLE_VTKVIEWER = "$DISABLE_VTKVIEWER
388
389 echo
390 echo ---------------------------------------------
391 echo Testing SalomeObject
392 echo ---------------------------------------------
393 echo
394
395 CHECK_SALOMEOBJECT
396 echo "DISABLE_SALOMEOBJECT = "$DISABLE_SALOMEOBJECT
397
398 if test "x${GUI_DISABLE_CORBA}" != "xyes" ; then
399   if test "x${DISABLE_PYCONSOLE}" == "xyes" ; then
400     echo "failed : for full configuration of GUI module necessary enable PyConsole !"
401     exit
402   fi
403   if test "x${DISABLE_GLVIEWER}" == "xyes" ; then
404     echo "failed : for full configuration of GUI module necessary enable GlViewer !"
405     exit
406   fi
407   if test "x${DISABLE_PLOT2DVIEWER}" == "xyes" ; then
408     echo "failed : for full configuration of GUI module necessary enable Plot2dViewer !"
409     exit
410   fi
411   if test "x${DISABLE_SUPERVGRAPHVIEWER}" == "xyes" ; then
412     echo "failed : for full configuration of GUI module necessary enable SupervGraphViewer !"
413     exit
414   fi
415   if test "x${DISABLE_OCCVIEWER}" == "xyes" ; then
416     echo "failed : for full configuration of GUI module necessary enable OCCViewer !"
417     exit
418   fi
419   if test "x${DISABLE_VTKVIEWER}" == "xyes" ; then
420     echo "failed : for full configuration of GUI module necessary enable VTKViewer !"
421     exit
422   fi
423   if test "x${DISABLE_SALOMEOBJECT}" == "xyes" ; then
424     echo "failed : for full configuration of GUI module necessary enable SalomeObject !"
425     exit
426   fi
427 fi
428
429 echo
430 echo ---------------------------------------------
431 echo Testing html generators
432 echo ---------------------------------------------
433 echo 
434
435 CHECK_HTML_GENERATORS
436
437 if test "$GUI_DISABLE_CORBA" == "no"; then 
438   echo
439   echo ---------------------------------------------
440   echo Testing Kernel
441   echo ---------------------------------------------
442   echo
443   CHECK_KERNEL
444 fi
445
446 echo
447 echo ---------------------------------------------
448 echo Testing CPPUNIT only required for unit testing
449 echo ---------------------------------------------
450 echo
451
452 CHECK_CPPUNIT
453
454 echo
455 echo ---------------------------------------------
456 echo Summary
457 echo ---------------------------------------------
458 echo
459
460 if test "$GUI_DISABLE_CORBA" == "yes"; then 
461    echo "Configure (without Corba)"
462 else
463    echo Configure
464 fi
465
466
467 if test "$GUI_DISABLE_CORBA" != "yes"; then 
468 variables="cc_ok lex_yacc_ok python_ok swig_ok threads_ok OpenGL_ok qt_ok msg2qm_ok vtk_ok hdf5_ok omniORB_ok boost_ok occ_ok sip_ok pyqt_ok qwt_ok doxygen_ok graphviz_ok Kernel_ok"
469 else
470 variables="cc_ok lex_yacc_ok python_ok threads_ok OpenGL_ok qt_ok msg2qm_ok vtk_ok hdf5_ok boost_ok occ_ok sip_ok pyqt_ok qwt_ok doxygen_ok graphviz_ok Kernel_ok"
471 fi
472
473 for var in $variables
474 do
475    printf "   %10s : " `echo \$var | sed -e "s,_ok,,"`
476    eval echo \$$var
477 done
478
479 echo "---Optional:"
480 variables="cppunit_ok"
481  
482 for var in $variables
483 do
484    eval toto=\$$var
485    if test x$toto != "x"; then
486      printf "   %10s : " `echo \$var | sed -e "s,_ok,,"`
487      eval echo \$$var
488    fi
489 done
490
491 if test "$GUI_DISABLE_CORBA" != "yes"; then 
492 echo
493 echo "Default ORB   : $DEFAULT_ORB"
494 echo
495 fi
496 dnl generals files which could be included in every makefile
497
498 AC_SUBST_FILE(COMMENCE) COMMENCE=adm_local/unix/make_commence
499 AC_SUBST_FILE(CONCLUDE) CONCLUDE=adm_local/unix/make_conclude
500 AC_SUBST_FILE(MODULE) MODULE=salome_adm/unix/make_module
501
502 dnl les dependences
503 AC_SUBST_FILE(DEPEND) DEPEND=salome_adm/unix/depend
504
505 dnl We don t need to say when we re entering directories if we re using
506 dnl GNU make becuase make does it for us.
507 if test "X$GMAKE" = "Xyes"; then
508    AC_SUBST(SETX) SETX=":"
509 else
510    AC_SUBST(SETX) SETX="set -x"
511 fi
512
513 # make other build directories
514 if test "$GUI_DISABLE_CORBA" == "yes"; then 
515   dir_variables="salome_adm adm_local doc bin/salome include/salome lib${LIB_LOCATION_SUFFIX}/salome share/salome/resources idl"
516 else
517   dir_variables="salome_adm adm_local doc bin/salome include/salome lib${LIB_LOCATION_SUFFIX}/salome share/salome/resources"
518 fi
519
520 for rep in $dir_variables
521 do
522 #   if test ! -d $rep ; then
523 #      eval mkdir $rep
524 #   fi
525     $INSTALL -d $rep
526 done
527
528 echo 
529 echo ---------------------------------------------
530 echo copying resource files, shell scripts, and 
531 echo xml files
532 echo ---------------------------------------------
533 echo
534
535
536 dnl copy resources directories
537
538 #for i in `find $ROOT_SRCDIR -name 'resources' -print`
539 #do
540 #  local_res=`echo $i | sed -e "s,$ROOT_SRCDIR,.,"`
541 #  local_res_dir=`echo $local_res | sed -e "s,[[^/]]*$,,;s,/$,,;s,^$,.,"`
542 #  mkdir -p $local_res_dir
543 #  cd $local_res_dir
544 #  ln -fs $i
545 #  echo $local_res
546 #  cd $ROOT_BUILDDIR
547 #done
548
549 dnl copy shells and utilities contained in the bin directory
550 dnl excluding .in files (treated in AC-OUTPUT below) and CVS 
551 dnl directory
552
553 mkdir -p bin/salome
554 cd bin/salome
555
556 for i in $ROOT_SRCDIR/bin/*
557 do
558   local_bin=`echo $i | sed -e "s,$ROOT_SRCDIR,.,"`
559   case "$local_bin" in
560         *.in | *~)                    ;;
561         ./bin/CVS | ./bin/salome)                    ;;
562         *) $INSTALL $i . ; echo $local_bin ;;
563   esac
564 done
565 cd $ROOT_BUILDDIR
566
567 AC_SUBST_FILE(ENVSCRIPT) ENVSCRIPT=salome_adm/unix/envScript
568
569 dnl copy xml files to the build tree (lib directory)
570 dnl pourquoi ????
571
572 #cd lib
573 #for i in `find $ROOT_SRCDIR -name "*.xml" -print`
574 #do
575 #  ln -fs $i
576 #  echo `echo $i | sed -e "s,$ROOT_SRCDIR,.,"`
577 #done
578 #cd $ROOT_BUILDDIR
579
580
581 echo
582 echo ---------------------------------------------
583 echo generating Makefiles and configure files
584 echo ---------------------------------------------
585 echo
586
587 AC_OUTPUT_COMMANDS([ \
588         chmod +x ./bin/* \
589 ])
590
591 ## do not delete this line