Salome HOME
Initial version
[plugins/ghs3dplugin.git] / aclocal.m4
1 # aclocal.m4 generated automatically by aclocal 1.6.3 -*- Autoconf -*-
2
3 # Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002
4 # Free Software Foundation, Inc.
5 # This file is free software; the Free Software Foundation
6 # gives unlimited permission to copy and/or distribute it,
7 # with or without modifications, as long as this notice is preserved.
8
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY, to the extent permitted by law; without
11 # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
12 # PARTICULAR PURPOSE.
13
14 dnl  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
15 dnl  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
16 dnl 
17 dnl  This library is free software; you can redistribute it and/or 
18 dnl  modify it under the terms of the GNU Lesser General Public 
19 dnl  License as published by the Free Software Foundation; either 
20 dnl  version 2.1 of the License. 
21 dnl 
22 dnl  This library is distributed in the hope that it will be useful, 
23 dnl  but WITHOUT ANY WARRANTY; without even the implied warranty of 
24 dnl  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
25 dnl  Lesser General Public License for more details. 
26 dnl 
27 dnl  You should have received a copy of the GNU Lesser General Public 
28 dnl  License along with this library; if not, write to the Free Software 
29 dnl  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
30 dnl 
31 dnl  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org 
32 dnl
33 dnl
34 dnl
35 dnl define macros :
36 dnl AC_ENABLE_PRODUCTION AC_DISABLE_PRODUCTION
37 dnl and 
38 dnl AC_ENABLE_DEBUG AC_DISABLE_DEBUG
39 dnl
40 dnl version $Id$
41 dnl author Patrick GOLDBRONN
42 dnl
43  
44 # AC_ENABLE_PRODUCTION
45 AC_DEFUN(AC_ENABLE_PRODUCTION, [dnl
46 define([AC_ENABLE_PRODUCTION_DEFAULT], ifelse($1, no, no, yes))dnl
47 AC_ARG_ENABLE(production,
48 changequote(<<, >>)dnl
49 <<  --enable-production[=PKGS]  build without debug information [default=>>AC_ENABLE_PRODUCTION_DEFAULT],
50 changequote([, ])dnl
51 [p=${PACKAGE-default}
52 case "$enableval" in
53 yes) enable_production=yes ;;
54 no) enable_production=no ;;
55 *)
56   enable_production=no
57   # Look at the argument we got.  We use all the common list separators.
58   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
59   for pkg in $enableval; do
60     if test "X$pkg" = "X$p"; then
61       enable_production=yes
62     fi
63   done
64   IFS="$ac_save_ifs"
65   ;;
66 esac],
67 enable_production=AC_ENABLE_PRODUCTION_DEFAULT)dnl
68
69 if test "X$enable_production" = "Xyes"; then
70   CFLAGS="$CFLAGS -O"
71   CXXFLAGS="$CXXFLAGS -O -Wno-deprecated "
72 fi
73 ])
74
75 # AC_DISABLE_PRODUCTION - set the default flag to --disable-production
76 AC_DEFUN(AC_DISABLE_PRODUCTION, [AC_ENABLE_PRODUCTION(no)])
77
78 # AC_ENABLE_DEBUG
79 AC_DEFUN(AC_ENABLE_DEBUG, [dnl
80 define([AC_ENABLE_DEBUG_DEFAULT], ifelse($1, no, no, yes))dnl
81 AC_ARG_ENABLE(debug,
82 changequote(<<, >>)dnl
83 <<  --enable-debug[=PKGS]  build without debug information [default=>>AC_ENABLE_DEBUG_DEFAULT],
84 changequote([, ])dnl
85 [p=${PACKAGE-default}
86 case "$enableval" in
87 yes) enable_debug=yes ;;
88 no) enable_debug=no ;;
89 *)
90   enable_debug=no
91   # Look at the argument we got.  We use all the common list separators.
92   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
93   for pkg in $enableval; do
94     if test "X$pkg" = "X$p"; then
95       enable_debug=yes
96     fi
97   done
98   IFS="$ac_save_ifs"
99   ;;
100 esac],
101 enable_debug=AC_ENABLE_DEBUG_DEFAULT)dnl
102
103 if test "X$enable_debug" = "Xyes"; then
104   CFLAGS="$CFLAGS -g -D_DEBUG_ "
105   CXXFLAGS="$CXXFLAGS -g -D_DEBUG_ -Wno-deprecated "
106 fi
107 ])
108
109 # AC_DISABLE_DEBUG - set the default flag to --disable-debug
110 AC_DEFUN(AC_DISABLE_DEBUG, [AC_ENABLE_DEBUG(no)])
111
112
113
114 # serial 40 AC_PROG_LIBTOOL
115 AC_DEFUN(AC_PROG_LIBTOOL,
116 [AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
117
118 # Save cache, so that ltconfig can load it
119 AC_CACHE_SAVE
120
121 # Actually configure libtool.  ac_aux_dir is where install-sh is found.
122 CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
123 LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \
124 LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" \
125 DLLTOOL="$DLLTOOL" AS="$AS" OBJDUMP="$OBJDUMP" \
126 ${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \
127 $libtool_flags $ac_aux_dir/ltmain.sh $lt_target \
128 || AC_MSG_ERROR([libtool configure failed])
129
130 # Reload cache, that may have been modified by ltconfig
131 AC_CACHE_LOAD
132
133 # This can be used to rebuild libtool when needed
134 LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh"
135
136 # Always use our own libtool.
137 LIBTOOL='$(SHELL) $(top_builddir)/libtool'
138 AC_SUBST(LIBTOOL)dnl
139
140 # Redirect the config.log output again, so that the ltconfig log is not
141 # clobbered by the next message.
142 exec 5>>./config.log
143 ])
144
145 AC_DEFUN(AC_LIBTOOL_SETUP,
146 [AC_PREREQ(2.13)dnl
147 AC_REQUIRE([AC_ENABLE_SHARED])dnl
148 AC_REQUIRE([AC_ENABLE_STATIC])dnl
149 AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
150 AC_REQUIRE([AC_CANONICAL_HOST])dnl
151 AC_REQUIRE([AC_CANONICAL_BUILD])dnl
152 AC_REQUIRE([AC_PROG_RANLIB])dnl
153 AC_REQUIRE([AC_PROG_CC])dnl
154 AC_REQUIRE([AC_PROG_LD])dnl
155 AC_REQUIRE([AC_PROG_NM])dnl
156 AC_REQUIRE([AC_PROG_LN_S])dnl
157 dnl
158
159 case "$target" in
160 NONE) lt_target="$host" ;;
161 *) lt_target="$target" ;;
162 esac
163
164 # Check for any special flags to pass to ltconfig.
165 #
166 # the following will cause an existing older ltconfig to fail, so
167 # we ignore this at the expense of the cache file... Checking this 
168 # will just take longer ... bummer!
169 #libtool_flags="--cache-file=$cache_file"
170 #
171 test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
172 test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
173 test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install"
174 test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
175 test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
176 ifdef([AC_PROVIDE_AC_LIBTOOL_DLOPEN],
177 [libtool_flags="$libtool_flags --enable-dlopen"])
178 ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
179 [libtool_flags="$libtool_flags --enable-win32-dll"])
180 AC_ARG_ENABLE(libtool-lock,
181   [  --disable-libtool-lock  avoid locking (might break parallel builds)])
182 test "x$enable_libtool_lock" = xno && libtool_flags="$libtool_flags --disable-lock"
183 test x"$silent" = xyes && libtool_flags="$libtool_flags --silent"
184
185 # Some flags need to be propagated to the compiler or linker for good
186 # libtool support.
187 case "$lt_target" in
188 *-*-irix6*)
189   # Find out which ABI we are using.
190   echo '[#]line __oline__ "configure"' > conftest.$ac_ext
191   if AC_TRY_EVAL(ac_compile); then
192     case "`/usr/bin/file conftest.o`" in
193     *32-bit*)
194       LD="${LD-ld} -32"
195       ;;
196     *N32*)
197       LD="${LD-ld} -n32"
198       ;;
199     *64-bit*)
200       LD="${LD-ld} -64"
201       ;;
202     esac
203   fi
204   rm -rf conftest*
205   ;;
206
207 *-*-sco3.2v5*)
208   # On SCO OpenServer 5, we need -belf to get full-featured binaries.
209   SAVE_CFLAGS="$CFLAGS"
210   CFLAGS="$CFLAGS -belf"
211   AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
212     [AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])])
213   if test x"$lt_cv_cc_needs_belf" != x"yes"; then
214     # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
215     CFLAGS="$SAVE_CFLAGS"
216   fi
217   ;;
218
219 ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
220 [*-*-cygwin* | *-*-mingw*)
221   AC_CHECK_TOOL(DLLTOOL, dlltool, false)
222   AC_CHECK_TOOL(AS, as, false)
223   AC_CHECK_TOOL(OBJDUMP, objdump, false)
224   ;;
225 ])
226 esac
227 ])
228
229 # AC_LIBTOOL_DLOPEN - enable checks for dlopen support
230 AC_DEFUN(AC_LIBTOOL_DLOPEN, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])])
231
232 # AC_LIBTOOL_WIN32_DLL - declare package support for building win32 dll's
233 AC_DEFUN(AC_LIBTOOL_WIN32_DLL, [AC_BEFORE([$0], [AC_LIBTOOL_SETUP])])
234
235 # AC_ENABLE_SHARED - implement the --enable-shared flag
236 # Usage: AC_ENABLE_SHARED[(DEFAULT)]
237 #   Where DEFAULT is either `yes' or `no'.  If omitted, it defaults to
238 #   `yes'.
239 AC_DEFUN(AC_ENABLE_SHARED, [dnl
240 define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
241 AC_ARG_ENABLE(shared,
242 changequote(<<, >>)dnl
243 <<  --enable-shared[=PKGS]  build shared libraries [default=>>AC_ENABLE_SHARED_DEFAULT],
244 changequote([, ])dnl
245 [p=${PACKAGE-default}
246 case "$enableval" in
247 yes) enable_shared=yes ;;
248 no) enable_shared=no ;;
249 *)
250   enable_shared=no
251   # Look at the argument we got.  We use all the common list separators.
252   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
253   for pkg in $enableval; do
254     if test "X$pkg" = "X$p"; then
255       enable_shared=yes
256     fi
257   done
258   IFS="$ac_save_ifs"
259   ;;
260 esac],
261 enable_shared=AC_ENABLE_SHARED_DEFAULT)dnl
262 ])
263
264 # AC_DISABLE_SHARED - set the default shared flag to --disable-shared
265 AC_DEFUN(AC_DISABLE_SHARED, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
266 AC_ENABLE_SHARED(no)])
267
268 # AC_ENABLE_STATIC - implement the --enable-static flag
269 # Usage: AC_ENABLE_STATIC[(DEFAULT)]
270 #   Where DEFAULT is either `yes' or `no'.  If omitted, it defaults to
271 #   `yes'.
272 AC_DEFUN(AC_ENABLE_STATIC, [dnl
273 define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
274 AC_ARG_ENABLE(static,
275 changequote(<<, >>)dnl
276 <<  --enable-static[=PKGS]  build static libraries [default=>>AC_ENABLE_STATIC_DEFAULT],
277 changequote([, ])dnl
278 [p=${PACKAGE-default}
279 case "$enableval" in
280 yes) enable_static=yes ;;
281 no) enable_static=no ;;
282 *)
283   enable_static=no
284   # Look at the argument we got.  We use all the common list separators.
285   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
286   for pkg in $enableval; do
287     if test "X$pkg" = "X$p"; then
288       enable_static=yes
289     fi
290   done
291   IFS="$ac_save_ifs"
292   ;;
293 esac],
294 enable_static=AC_ENABLE_STATIC_DEFAULT)dnl
295 ])
296
297 # AC_DISABLE_STATIC - set the default static flag to --disable-static
298 AC_DEFUN(AC_DISABLE_STATIC, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
299 AC_ENABLE_STATIC(no)])
300
301
302 # AC_ENABLE_FAST_INSTALL - implement the --enable-fast-install flag
303 # Usage: AC_ENABLE_FAST_INSTALL[(DEFAULT)]
304 #   Where DEFAULT is either `yes' or `no'.  If omitted, it defaults to
305 #   `yes'.
306 AC_DEFUN(AC_ENABLE_FAST_INSTALL, [dnl
307 define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
308 AC_ARG_ENABLE(fast-install,
309 changequote(<<, >>)dnl
310 <<  --enable-fast-install[=PKGS]  optimize for fast installation [default=>>AC_ENABLE_FAST_INSTALL_DEFAULT],
311 changequote([, ])dnl
312 [p=${PACKAGE-default}
313 case "$enableval" in
314 yes) enable_fast_install=yes ;;
315 no) enable_fast_install=no ;;
316 *)
317   enable_fast_install=no
318   # Look at the argument we got.  We use all the common list separators.
319   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
320   for pkg in $enableval; do
321     if test "X$pkg" = "X$p"; then
322       enable_fast_install=yes
323     fi
324   done
325   IFS="$ac_save_ifs"
326   ;;
327 esac],
328 enable_fast_install=AC_ENABLE_FAST_INSTALL_DEFAULT)dnl
329 ])
330
331 # AC_ENABLE_FAST_INSTALL - set the default to --disable-fast-install
332 AC_DEFUN(AC_DISABLE_FAST_INSTALL, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
333 AC_ENABLE_FAST_INSTALL(no)])
334
335 # AC_PROG_LD - find the path to the GNU or non-GNU linker
336 AC_DEFUN(AC_PROG_LD,
337 [AC_ARG_WITH(gnu-ld,
338 [  --with-gnu-ld           assume the C compiler uses GNU ld [default=no]],
339 test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
340 AC_REQUIRE([AC_PROG_CC])dnl
341 AC_REQUIRE([AC_CANONICAL_HOST])dnl
342 AC_REQUIRE([AC_CANONICAL_BUILD])dnl
343 ac_prog=ld
344 if test "$ac_cv_prog_gcc" = yes; then
345   # Check if gcc -print-prog-name=ld gives a path.
346   AC_MSG_CHECKING([for ld used by GCC])
347   ac_prog=`($CC -print-prog-name=ld) 2>&5`
348   case "$ac_prog" in
349     # Accept absolute paths.
350 changequote(,)dnl
351     [\\/]* | [A-Za-z]:[\\/]*)
352       re_direlt='/[^/][^/]*/\.\./'
353 changequote([,])dnl
354       # Canonicalize the path of ld
355       ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
356       while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
357         ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
358       done
359       test -z "$LD" && LD="$ac_prog"
360       ;;
361   "")
362     # If it fails, then pretend we aren't using GCC.
363     ac_prog=ld
364     ;;
365   *)
366     # If it is relative, then search for the first ld in PATH.
367     with_gnu_ld=unknown
368     ;;
369   esac
370 elif test "$with_gnu_ld" = yes; then
371   AC_MSG_CHECKING([for GNU ld])
372 else
373   AC_MSG_CHECKING([for non-GNU ld])
374 fi
375 AC_CACHE_VAL(ac_cv_path_LD,
376 [if test -z "$LD"; then
377   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
378   for ac_dir in $PATH; do
379     test -z "$ac_dir" && ac_dir=.
380     if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
381       ac_cv_path_LD="$ac_dir/$ac_prog"
382       # Check to see if the program is GNU ld.  I'd rather use --version,
383       # but apparently some GNU ld's only accept -v.
384       # Break only if it was the GNU/non-GNU ld that we prefer.
385       if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
386         test "$with_gnu_ld" != no && break
387       else
388         test "$with_gnu_ld" != yes && break
389       fi
390     fi
391   done
392   IFS="$ac_save_ifs"
393 else
394   ac_cv_path_LD="$LD" # Let the user override the test with a path.
395 fi])
396 LD="$ac_cv_path_LD"
397 if test -n "$LD"; then
398   AC_MSG_RESULT($LD)
399 else
400   AC_MSG_RESULT(no)
401 fi
402 test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
403 AC_PROG_LD_GNU
404 ])
405
406 AC_DEFUN(AC_PROG_LD_GNU,
407 [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], ac_cv_prog_gnu_ld,
408 [# I'd rather use --version here, but apparently some GNU ld's only accept -v.
409 if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
410   ac_cv_prog_gnu_ld=yes
411 else
412   ac_cv_prog_gnu_ld=no
413 fi])
414 ])
415
416 # AC_PROG_NM - find the path to a BSD-compatible name lister
417 AC_DEFUN(AC_PROG_NM,
418 [AC_MSG_CHECKING([for BSD-compatible nm])
419 AC_CACHE_VAL(ac_cv_path_NM,
420 [if test -n "$NM"; then
421   # Let the user override the test.
422   ac_cv_path_NM="$NM"
423 else
424   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
425   for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
426     test -z "$ac_dir" && ac_dir=.
427     if test -f $ac_dir/nm || test -f $ac_dir/nm$ac_exeext ; then
428       # Check to see if the nm accepts a BSD-compat flag.
429       # Adding the `sed 1q' prevents false positives on HP-UX, which says:
430       #   nm: unknown option "B" ignored
431       if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
432         ac_cv_path_NM="$ac_dir/nm -B"
433         break
434       elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
435         ac_cv_path_NM="$ac_dir/nm -p"
436         break
437       else
438         ac_cv_path_NM=${ac_cv_path_NM="$ac_dir/nm"} # keep the first match, but
439         continue # so that we can try to find one that supports BSD flags
440       fi
441     fi
442   done
443   IFS="$ac_save_ifs"
444   test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
445 fi])
446 NM="$ac_cv_path_NM"
447 AC_MSG_RESULT([$NM])
448 ])
449
450 # AC_CHECK_LIBM - check for math library
451 AC_DEFUN(AC_CHECK_LIBM,
452 [AC_REQUIRE([AC_CANONICAL_HOST])dnl
453 LIBM=
454 case "$lt_target" in
455 *-*-beos* | *-*-cygwin*)
456   # These system don't have libm
457   ;;
458 *-ncr-sysv4.3*)
459   AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
460   AC_CHECK_LIB(m, main, LIBM="$LIBM -lm")
461   ;;
462 *)
463   AC_CHECK_LIB(m, main, LIBM="-lm")
464   ;;
465 esac
466 ])
467
468 # AC_LIBLTDL_CONVENIENCE[(dir)] - sets LIBLTDL to the link flags for
469 # the libltdl convenience library and INCLTDL to the include flags for
470 # the libltdl header and adds --enable-ltdl-convenience to the
471 # configure arguments.  Note that LIBLTDL and INCLTDL are not
472 # AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called.  If DIR is not
473 # provided, it is assumed to be `libltdl'.  LIBLTDL will be prefixed
474 # with '${top_builddir}/' and INCLTDL will be prefixed with
475 # '${top_srcdir}/' (note the single quotes!).  If your package is not
476 # flat and you're not using automake, define top_builddir and
477 # top_srcdir appropriately in the Makefiles.
478 AC_DEFUN(AC_LIBLTDL_CONVENIENCE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
479   case "$enable_ltdl_convenience" in
480   no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
481   "") enable_ltdl_convenience=yes
482       ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
483   esac
484   LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la
485   INCLTDL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
486 ])
487
488 # AC_LIBLTDL_INSTALLABLE[(dir)] - sets LIBLTDL to the link flags for
489 # the libltdl installable library and INCLTDL to the include flags for
490 # the libltdl header and adds --enable-ltdl-install to the configure
491 # arguments.  Note that LIBLTDL and INCLTDL are not AC_SUBSTed, nor is
492 # AC_CONFIG_SUBDIRS called.  If DIR is not provided and an installed
493 # libltdl is not found, it is assumed to be `libltdl'.  LIBLTDL will
494 # be prefixed with '${top_builddir}/' and INCLTDL will be prefixed
495 # with '${top_srcdir}/' (note the single quotes!).  If your package is
496 # not flat and you're not using automake, define top_builddir and
497 # top_srcdir appropriately in the Makefiles.
498 # In the future, this macro may have to be called after AC_PROG_LIBTOOL.
499 AC_DEFUN(AC_LIBLTDL_INSTALLABLE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
500   AC_CHECK_LIB(ltdl, main,
501   [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no],
502   [if test x"$enable_ltdl_install" = xno; then
503      AC_MSG_WARN([libltdl not installed, but installation disabled])
504    else
505      enable_ltdl_install=yes
506    fi
507   ])
508   if test x"$enable_ltdl_install" = x"yes"; then
509     ac_configure_args="$ac_configure_args --enable-ltdl-install"
510     LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la
511     INCLTDL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
512   else
513     ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
514     LIBLTDL="-lltdl"
515     INCLTDL=
516   fi
517 ])
518
519 dnl old names
520 AC_DEFUN(AM_PROG_LIBTOOL, [indir([AC_PROG_LIBTOOL])])dnl
521 AC_DEFUN(AM_ENABLE_SHARED, [indir([AC_ENABLE_SHARED], $@)])dnl
522 AC_DEFUN(AM_ENABLE_STATIC, [indir([AC_ENABLE_STATIC], $@)])dnl
523 AC_DEFUN(AM_DISABLE_SHARED, [indir([AC_DISABLE_SHARED], $@)])dnl
524 AC_DEFUN(AM_DISABLE_STATIC, [indir([AC_DISABLE_STATIC], $@)])dnl
525 AC_DEFUN(AM_PROG_LD, [indir([AC_PROG_LD])])dnl
526 AC_DEFUN(AM_PROG_NM, [indir([AC_PROG_NM])])dnl
527
528 dnl This is just to silence aclocal about the macro not being used
529 ifelse([AC_DISABLE_FAST_INSTALL])dnl
530
531 dnl  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
532 dnl  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
533 dnl 
534 dnl  This library is free software; you can redistribute it and/or 
535 dnl  modify it under the terms of the GNU Lesser General Public 
536 dnl  License as published by the Free Software Foundation; either 
537 dnl  version 2.1 of the License. 
538 dnl 
539 dnl  This library is distributed in the hope that it will be useful, 
540 dnl  but WITHOUT ANY WARRANTY; without even the implied warranty of 
541 dnl  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
542 dnl  Lesser General Public License for more details. 
543 dnl 
544 dnl  You should have received a copy of the GNU Lesser General Public 
545 dnl  License along with this library; if not, write to the Free Software 
546 dnl  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
547 dnl 
548 dnl  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org 
549 dnl
550 dnl
551 dnl
552 dnl @synopsis AC_C_DEPEND_FLAG
553 dnl
554 dnl define C_DEPEND_FLAG
555 dnl define CXX_DEPEND_FLAG
556 dnl
557 dnl @version $Id$
558 dnl @author Marc Tajchman
559 dnl
560 AC_DEFUN(AC_DEPEND_FLAG,
561 [AC_CACHE_CHECK(which flag for dependency information generation,
562 ac_cv_depend_flag,
563 [AC_LANG_SAVE
564  AC_LANG_C
565  echo "conftest.o: conftest.c" > conftest.verif
566  echo "int  main() { return 0; }" > conftest.c
567
568  C_DEPEND_FLAG=
569  for ac_C_DEPEND_FLAG in -xM -MM -M ; do
570
571     rm -f conftest.d conftest.err
572     ${CC-cc} ${ac_C_DEPEND_FLAG} -c conftest.c 1> conftest.d 2> conftest.err
573     if test -f conftest.u ; then
574        mv conftest.u conftest.d
575     fi
576
577     rm -f conftest
578     diff -b -B conftest.d conftest.verif > conftest
579     if test ! -s conftest ; then
580        C_DEPEND_FLAG=${ac_C_DEPEND_FLAG}
581        break
582     fi
583  done
584
585 dnl use gcc option -MG : asume unknown file will be construct later
586  rm -f conftest.d conftest.err
587  ${CC-cc} ${C_DEPEND_FLAG} -MG -c conftest.c 1> conftest.d 2> conftest.err
588  if test -f conftest.u ; then
589     mv conftest.u conftest.d
590  fi
591  rm -f conftest
592  diff -b -B conftest.d conftest.verif > conftest
593  if test ! -s conftest ; then
594     C_DEPEND_FLAG=${C_DEPEND_FLAG}" -MG"
595  fi
596
597  rm -f conftest*
598  if test "x${C_DEPEND_FLAG}" = "x" ; then
599     echo "cannot determine flag (C language)"
600     exit
601  fi
602
603  echo -n " C : " ${C_DEPEND_FLAG}
604
605  AC_LANG_CPLUSPLUS
606  echo "conftest.o: conftest.cxx" > conftest.verif
607  echo "int  main() { return 0; }" > conftest.cxx
608
609  CXX_DEPEND_FLAG=
610  for ac_CXX_DEPEND_FLAG in -xM -MM -M ; do
611
612     rm -f conftest.d conftest.err
613     ${CXX-c++} ${ac_CXX_DEPEND_FLAG} -c conftest.cxx 1> conftest.d 2> conftest.err
614     if test -f conftest.u ; then
615        mv conftest.u conftest.d
616     fi
617
618     rm -f conftest
619     diff -b -B conftest.d conftest.verif > conftest
620     if test ! -s conftest ; then
621        CXX_DEPEND_FLAG=${ac_CXX_DEPEND_FLAG}
622        break
623     fi
624  done
625
626 dnl use g++ option -MG : asume unknown file will be construct later
627  rm -f conftest.d conftest.err
628  ${CXX-c++} ${CXX_DEPEND_FLAG} -MG -c conftest.cxx 1> conftest.d 2> conftest.err
629  if test -f conftest.u ; then
630     mv conftest.u conftest.d
631  fi
632  rm -f conftest
633  diff -b -B conftest.d conftest.verif > conftest
634  if test ! -s conftest ; then
635     CXX_DEPEND_FLAG=${CXX_DEPEND_FLAG}" -MG"
636  fi
637
638
639  rm -f conftest*
640  if test "x${CXX_DEPEND_FLAG}" = "x" ; then
641     echo "cannot determine flag (C++ language)"
642     exit
643  fi
644
645  echo -n " C++ : " ${CXX_DEPEND_FLAG}
646  AC_LANG_RESTORE
647
648  AC_SUBST(C_DEPEND_FLAG)
649  AC_SUBST(CXX_DEPEND_FLAG)
650 ])
651 ])
652
653 dnl  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
654 dnl  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
655 dnl 
656 dnl  This library is free software; you can redistribute it and/or 
657 dnl  modify it under the terms of the GNU Lesser General Public 
658 dnl  License as published by the Free Software Foundation; either 
659 dnl  version 2.1 of the License. 
660 dnl 
661 dnl  This library is distributed in the hope that it will be useful, 
662 dnl  but WITHOUT ANY WARRANTY; without even the implied warranty of 
663 dnl  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
664 dnl  Lesser General Public License for more details. 
665 dnl 
666 dnl  You should have received a copy of the GNU Lesser General Public 
667 dnl  License along with this library; if not, write to the Free Software 
668 dnl  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
669 dnl 
670 dnl  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org 
671 dnl
672 dnl
673 dnl
674 dnl @synopsis AC_CXX_HAVE_SSTREAM
675 dnl
676 dnl If the C++ library has a working stringstream, define HAVE_SSTREAM.
677 dnl
678 dnl @author Ben Stanley
679 dnl @version $Id$
680 dnl
681 dnl modified by Marc Tajchman (CEA) - 10/10/2002
682 dnl
683 AC_DEFUN([AC_CXX_HAVE_SSTREAM],
684 [AC_CACHE_CHECK(whether the compiler has stringstream,
685 HAVE_SSTREAM,
686 [AC_REQUIRE([AC_CXX_NAMESPACES])
687  AC_LANG_SAVE
688  AC_LANG_CPLUSPLUS
689  AC_TRY_COMPILE([#include <sstream>
690 #ifdef HAVE_NAMESPACES
691 using namespace std;
692 #endif],[stringstream message; message << "Hello"; return 0;],
693  HAVE_SSTREAM=yes, HAVE_SSTREAM=no)
694  AC_LANG_RESTORE
695 ])
696 AC_SUBST(HAVE_SSTREAM)
697 ])
698
699 dnl  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
700 dnl  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
701 dnl 
702 dnl  This library is free software; you can redistribute it and/or 
703 dnl  modify it under the terms of the GNU Lesser General Public 
704 dnl  License as published by the Free Software Foundation; either 
705 dnl  version 2.1 of the License. 
706 dnl 
707 dnl  This library is distributed in the hope that it will be useful, 
708 dnl  but WITHOUT ANY WARRANTY; without even the implied warranty of 
709 dnl  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
710 dnl  Lesser General Public License for more details. 
711 dnl 
712 dnl  You should have received a copy of the GNU Lesser General Public 
713 dnl  License along with this library; if not, write to the Free Software 
714 dnl  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
715 dnl 
716 dnl  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org 
717 dnl
718 dnl
719 dnl
720 dnl @synopsis AC_CXX_NAMESPACES
721 dnl
722 dnl If the compiler can prevent names clashes using namespaces, define
723 dnl HAVE_NAMESPACES.
724 dnl
725 dnl @version $Id$
726 dnl @author Luc Maisonobe
727 dnl
728 AC_DEFUN(AC_CXX_NAMESPACES,
729 [AC_CACHE_CHECK(whether the compiler implements namespaces,
730 ac_cv_cxx_namespaces,
731 [AC_LANG_SAVE
732  AC_LANG_CPLUSPLUS
733  AC_TRY_COMPILE([namespace Outer { namespace Inner { int i = 0; }}],
734                 [using namespace Outer::Inner; return i;],
735  ac_cv_cxx_namespaces=yes, ac_cv_cxx_namespaces=no)
736  AC_LANG_RESTORE
737 ])
738 if test "$ac_cv_cxx_namespaces" = yes; then
739   AC_DEFINE(HAVE_NAMESPACES,,[define if the compiler implements namespaces])
740 fi
741 ])
742
743 dnl  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
744 dnl  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
745 dnl 
746 dnl  This library is free software; you can redistribute it and/or 
747 dnl  modify it under the terms of the GNU Lesser General Public 
748 dnl  License as published by the Free Software Foundation; either 
749 dnl  version 2.1 of the License. 
750 dnl 
751 dnl  This library is distributed in the hope that it will be useful, 
752 dnl  but WITHOUT ANY WARRANTY; without even the implied warranty of 
753 dnl  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
754 dnl  Lesser General Public License for more details. 
755 dnl 
756 dnl  You should have received a copy of the GNU Lesser General Public 
757 dnl  License along with this library; if not, write to the Free Software 
758 dnl  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
759 dnl 
760 dnl  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org 
761 dnl
762 dnl
763 dnl
764 AC_DEFUN([CHECK_BOOST],[
765
766 AC_CHECKING(for BOOST Library)
767
768 AC_LANG_SAVE
769 AC_LANG_CPLUSPLUS
770
771 AC_SUBST(BOOST_CPPFLAGS)
772 BOOST_CPPFLAGS=""
773 boost_ok=no
774
775 if test -z ${BOOSTDIR}; then
776   AC_MSG_WARN(You must provide BOOSTDIR variable)
777 else
778   AC_MSG_RESULT(\$BOOSTDIR = ${BOOSTDIR})
779   AC_CHECKING(for boost/shared_ptr.hpp header file)
780   dnl BOOST headers
781   CPPFLAGS_old="${CPPFLAGS}"
782   BOOST_CPPFLAGS="-ftemplate-depth-32 -I${BOOSTDIR}"
783   CPPFLAGS="${CPPFLAGS} ${BOOST_CPPFLAGS}"
784
785   AC_CHECK_HEADER(boost/shared_ptr.hpp,boost_ok=yes,boost_ok=no)
786
787   CPPFLAGS="${CPPFLAGS_old}"
788   boost_ok=yes
789 fi
790
791 AC_LANG_RESTORE
792
793 ])dnl
794
795
796
797 dnl  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
798 dnl  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
799 dnl 
800 dnl  This library is free software; you can redistribute it and/or 
801 dnl  modify it under the terms of the GNU Lesser General Public 
802 dnl  License as published by the Free Software Foundation; either 
803 dnl  version 2.1 of the License. 
804 dnl 
805 dnl  This library is distributed in the hope that it will be useful, 
806 dnl  but WITHOUT ANY WARRANTY; without even the implied warranty of 
807 dnl  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
808 dnl  Lesser General Public License for more details. 
809 dnl 
810 dnl  You should have received a copy of the GNU Lesser General Public 
811 dnl  License along with this library; if not, write to the Free Software 
812 dnl  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
813 dnl 
814 dnl  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org 
815 dnl
816 dnl
817 dnl
818
819 AC_DEFUN([CHECK_MPICH],[
820
821 AC_REQUIRE([AC_PROG_CC])dnl
822
823 AC_ARG_WITH(mpich,
824             --with-mpich=DIR root directory path of MPICH installation,
825             WITHMPICH="yes",WITHMPICH="no")
826
827 MPICH_INCLUDES=""
828 MPICH_LIBS=""
829 if test "$WITHMPICH" = yes; then
830
831   echo
832   echo ---------------------------------------------
833   echo testing mpich
834   echo ---------------------------------------------
835   echo
836   MPICH_HOME=$withval
837
838   if test "$MPICH_HOME"; then
839     MPICH_INCLUDES="-I$MPICH_HOME/include"
840     MPICH_LIBS="-L$MPICH_HOME/lib"
841   fi
842
843   CPPFLAGS_old="$CPPFLAGS"
844   CPPFLAGS="$MPICH_INCLUDES $CPPFLAGS"
845   AC_CHECK_HEADER(mpi.h,WITHMPICH="yes",WITHMPICH="no")
846   CPPFLAGS="$CPPFLAGS_old"
847
848   if test "$WITHMPICH" = "yes";then
849     LDFLAGS_old="$LDFLAGS"
850     LDFLAGS="$MPICH_LIBS $LDFLAGS"
851     AC_CHECK_LIB(mpich,MPI_Init,
852                AC_CHECK_LIB(pmpich, PMPI_Init,WITHMPICH="yes",WITHMPICH="no"),
853                WITHMPICH="no")
854     LDFLAGS="$LDFLAGS_old"
855   fi
856
857   MPICH_LIBS="$MPICH_LIBS -lpmpich -lmpich"
858
859 fi
860 AC_SUBST(MPICH_INCLUDES)
861 AC_SUBST(MPICH_LIBS)
862 AC_SUBST(WITHMPICH)
863
864 ])dnl
865
866 dnl  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
867 dnl  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
868 dnl 
869 dnl  This library is free software; you can redistribute it and/or 
870 dnl  modify it under the terms of the GNU Lesser General Public 
871 dnl  License as published by the Free Software Foundation; either 
872 dnl  version 2.1 of the License. 
873 dnl 
874 dnl  This library is distributed in the hope that it will be useful, 
875 dnl  but WITHOUT ANY WARRANTY; without even the implied warranty of 
876 dnl  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
877 dnl  Lesser General Public License for more details. 
878 dnl 
879 dnl  You should have received a copy of the GNU Lesser General Public 
880 dnl  License along with this library; if not, write to the Free Software 
881 dnl  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
882 dnl 
883 dnl  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org 
884 dnl
885 dnl
886 dnl
887
888 dnl CHECK_PYTHON([module, classes])
889 dnl
890 dnl Adds support for distributing Python modules or classes.
891 dnl Python library files distributed as a `module' are installed
892 dnl under PYTHON_SITE_PACKAGE (eg, ./python1.5/site-package/package-name)
893 dnl while those distributed as `classes' are installed under PYTHON_SITE
894 dnl (eg, ./python1.5/site-packages).  The default is to install as
895 dnl a `module'.
896
897 AC_DEFUN(CHECK_PYTHON,
898  [
899   AC_ARG_WITH(python,
900    [  --with-python=DIR root directory path of python installation ],
901    [PYTHON="$withval/bin/python"
902     AC_MSG_RESULT("select python distribution in $withval")
903    ], [
904     AC_PATH_PROG(PYTHON, python)
905     ])
906   
907   AC_CHECKING([local Python configuration])
908   PYTHON_PREFIX=`echo $PYTHON | sed -e "s,[[^/]]*$,,;s,/$,,;s,^$,.,"`
909   PYTHON_PREFIX=`echo $PYTHON_PREFIX | sed -e "s,[[^/]]*$,,;s,/$,,;s,^$,.,"`
910   PYTHONHOME=$PYTHON_PREFIX
911
912   AC_SUBST(PYTHON_PREFIX)
913   AC_SUBST(PYTHONHOME)
914
915   changequote(<<, >>)dnl
916   PYTHON_VERSION=`$PYTHON -c "import sys; print sys.version[:3]"`
917   changequote([, ])dnl
918   AC_SUBST(PYTHON_VERSION)
919
920   PY_MAKEFILE=$PYTHON_PREFIX/lib/python$PYTHON_VERSION/config/Makefile
921   if test ! -f "$PY_MAKEFILE"; then
922      AC_MSG_ERROR([*** Couldn't find ${PY_MAKEFILE}.  Maybe you are
923 *** missing the development portion of the python installation])
924   fi
925
926   AC_SUBST(PYTHON_INCLUDES)
927   AC_SUBST(PYTHON_LIBS)
928
929   PYTHON_INCLUDES=-I$PYTHON_PREFIX/include/python$PYTHON_VERSION
930   PYTHON_LIBS="-L${PYTHON_PREFIX}/lib/python${PYTHON_VERSION}/config -lpython${PYTHON_VERSION}"
931   PYTHON_LIB=$PYTHON_LIBS
932   PYTHON_LIBA=$PYTHON_PREFIX/lib/python$PYTHON_VERSION/config/libpython$PYTHON_VERSION.a
933
934   dnl At times (like when building shared libraries) you may want
935   dnl to know which OS Python thinks this is.
936
937   AC_SUBST(PYTHON_PLATFORM)
938   PYTHON_PLATFORM=`$PYTHON -c "import sys; print sys.platform"`
939
940   AC_SUBST(PYTHON_SITE)
941   AC_ARG_WITH(python-site,
942 [  --with-python-site=DIR          Use DIR for installing platform independent
943                                   Python site-packages],
944
945 dnl modification : by default, we install python script in salome root tree
946
947 dnl [PYTHON_SITE="$withval"
948 dnl python_site_given=yes],
949 dnl [PYTHON_SITE=$PYTHON_PREFIX"/lib/python"$PYTHON_VERSION/site-packages
950 dnl python_site_given=no])
951
952 [PYTHON_SITE="$withval"
953 python_site_given=yes],
954 [PYTHON_SITE=$prefix"/lib/python"$PYTHON_VERSION/site-packages
955 python_site_given=no])
956
957   AC_SUBST(PYTHON_SITE_PACKAGE)
958   PYTHON_SITE_PACKAGE=$PYTHON_SITE/$PACKAGE
959
960
961   dnl Get PYTHON_SITE from --with-python-site-exec or from
962   dnl --with-python-site or from running Python
963
964   AC_SUBST(PYTHON_SITE_EXEC)
965   AC_ARG_WITH(python-site-exec,
966 [  --with-python-site-exec=DIR     Use DIR for installing platform dependent
967                                   Python site-packages],
968 [PYTHON_SITE_EXEC="$withval"],
969 [if test "$python_site_given" = yes; then
970   PYTHON_SITE_EXEC=$PYTHON_SITE
971 else
972   PYTHON_SITE_EXEC=$PYTHON_EXEC_PREFIX"/lib/python"$PYTHON_VERSION/site-packages
973 fi])
974
975   dnl Set up the install directory
976   ifelse($1, classes,
977 [PYTHON_SITE_INSTALL=$PYTHON_SITE],
978 [PYTHON_SITE_INSTALL=$PYTHON_SITE_PACKAGE])
979   AC_SUBST(PYTHON_SITE_INSTALL)
980
981   dnl Also lets automake think PYTHON means something.
982
983   pythondir=$PYTHON_PREFIX"/lib/python"$PYTHON_VERSION/
984   AC_SUBST(pythondir)
985
986  AC_MSG_CHECKING([if we need libdb])
987  PY_NEEDOPENDB=`nm $PYTHON_LIBA | grep dbopen | grep U`
988   if test "x$PY_NEEDOPENDB" != "x"; then
989      PYTHON_LIBS="$PYTHON_LIBS -ldb"
990      AC_MSG_RESULT(yes)
991   else
992      AC_MSG_RESULT(no)
993   fi
994
995  AC_MSG_CHECKING([if we need libdl])
996   PY_NEEDOPENDL=`nm $PYTHON_LIBA | grep dlopen | grep U`
997   if test "x$PY_NEEDOPENDL" != "x"; then
998      PYTHON_LIBS="$PYTHON_LIBS -ldl"
999      AC_MSG_RESULT(yes)
1000   else
1001      AC_MSG_RESULT(no)
1002   fi
1003
1004  AC_MSG_CHECKING([if we need libutil])
1005   PY_NEEDOPENPTY=`nm $PYTHON_LIBA | grep openpty | grep U`
1006   if test "x$PY_NEEDOPENPTY" != "x"; then
1007      PYTHON_LIBS="$PYTHON_LIBS -lutil"
1008      AC_MSG_RESULT(yes)
1009   else
1010      AC_MSG_RESULT(no)
1011   fi
1012
1013  AC_MSG_CHECKING([if we need tcltk])
1014   PY_NEEDTCLTK=`nm $PYTHON_LIBA | grep Tcl_Init | grep U`
1015   if test "x$PY_NEEDTCLTK" != "x"; then
1016      PYTHON_LIBS="$PYTHON_LIBS -ltcl -ltk"
1017      AC_MSG_RESULT(yes)
1018   else
1019      AC_MSG_RESULT(no)
1020   fi
1021
1022   python_ok=yes
1023   AC_MSG_RESULT(looks good)])
1024
1025 dnl  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
1026 dnl  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
1027 dnl 
1028 dnl  This library is free software; you can redistribute it and/or 
1029 dnl  modify it under the terms of the GNU Lesser General Public 
1030 dnl  License as published by the Free Software Foundation; either 
1031 dnl  version 2.1 of the License. 
1032 dnl 
1033 dnl  This library is distributed in the hope that it will be useful, 
1034 dnl  but WITHOUT ANY WARRANTY; without even the implied warranty of 
1035 dnl  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
1036 dnl  Lesser General Public License for more details. 
1037 dnl 
1038 dnl  You should have received a copy of the GNU Lesser General Public 
1039 dnl  License along with this library; if not, write to the Free Software 
1040 dnl  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
1041 dnl 
1042 dnl  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org 
1043 dnl
1044 dnl
1045 dnl
1046
1047 AC_DEFUN([CHECK_SWIG],[
1048 AC_REQUIRE([CHECK_PYTHON])dnl
1049
1050 swig_ok=yes
1051
1052 AC_ARG_WITH(swig,
1053     [  --with-swig=EXEC swig executable ],
1054     [SWIG="$withval"
1055       AC_MSG_RESULT("select $withval as swig executable")
1056     ], [
1057       AC_PATH_PROG(SWIG, swig)
1058     ])
1059
1060 if test "x$SWIG" = "x"
1061 then
1062     swig_ok=no
1063     AC_MSG_RESULT(swig not in PATH variable)
1064 fi
1065
1066 if  test "x$swig_ok" = "xyes"
1067 then
1068    AC_MSG_CHECKING(python wrapper generation with swig)
1069    cat > conftest.h << EOF
1070 int f(double);
1071 EOF
1072
1073    $SWIG -module conftest -python conftest.h >/dev/null 2>&1
1074    if test -f conftest_wrap.c
1075    then
1076       SWIG_FLAGS="-c++ -python -shadow"
1077    else
1078       swig_ok=no  
1079    fi
1080    rm -f conftest*
1081    AC_MSG_RESULT($swig_ok) 
1082 fi
1083
1084 AC_SUBST(SWIG_FLAGS)
1085 AC_SUBST(SWIG)
1086
1087 AC_MSG_RESULT(for swig: $swig_ok)
1088
1089 ])dnl
1090 dnl
1091
1092 dnl  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
1093 dnl  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
1094 dnl 
1095 dnl  This library is free software; you can redistribute it and/or 
1096 dnl  modify it under the terms of the GNU Lesser General Public 
1097 dnl  License as published by the Free Software Foundation; either 
1098 dnl  version 2.1 of the License. 
1099 dnl 
1100 dnl  This library is distributed in the hope that it will be useful, 
1101 dnl  but WITHOUT ANY WARRANTY; without even the implied warranty of 
1102 dnl  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
1103 dnl  Lesser General Public License for more details. 
1104 dnl 
1105 dnl  You should have received a copy of the GNU Lesser General Public 
1106 dnl  License along with this library; if not, write to the Free Software 
1107 dnl  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
1108 dnl 
1109 dnl  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org 
1110 dnl
1111 dnl
1112 dnl
1113 dnl@synopsis ENABLE_PTHREADS
1114 dnl
1115 dnl modify CFLAGS, CXXFLAGS and LIBS for compiling pthread-based programs.
1116 dnl
1117 dnl@author  (C) Ruslan Shevchenko <Ruslan@Shevchenko.Kiev.UA>, 1998, 2000
1118 dnl@id  $Id$
1119 dnl
1120 dnl
1121 AC_DEFUN([ENABLE_PTHREADS],[
1122 AC_REQUIRE([CHECK_PTHREADS])
1123
1124 if test -z "$enable_pthreads_done"
1125 then
1126  CFLAGS="$CFLAGS $CFLAGS_PTHREADS"
1127  CXXFLAGS="$CXXFLAGS $CXXFLAGS_PTHREADS"
1128  LIBS="$LIBS $LIBS_PTHREADS"
1129 fi
1130 enable_pthreads_done=yes
1131 ])dnl
1132 dnl
1133
1134 dnl  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
1135 dnl  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
1136 dnl 
1137 dnl  This library is free software; you can redistribute it and/or 
1138 dnl  modify it under the terms of the GNU Lesser General Public 
1139 dnl  License as published by the Free Software Foundation; either 
1140 dnl  version 2.1 of the License. 
1141 dnl 
1142 dnl  This library is distributed in the hope that it will be useful, 
1143 dnl  but WITHOUT ANY WARRANTY; without even the implied warranty of 
1144 dnl  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
1145 dnl  Lesser General Public License for more details. 
1146 dnl 
1147 dnl  You should have received a copy of the GNU Lesser General Public 
1148 dnl  License along with this library; if not, write to the Free Software 
1149 dnl  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
1150 dnl 
1151 dnl  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org 
1152 dnl
1153 dnl
1154 dnl
1155 #@synonpsis CHECK_PTHREADS
1156 dnl  check for pthreads system interfaces.
1157 dnl  set CFLAGS_PTHREADS,  CXXFLAGS_PTHREADS and LIBS_PTHREADS to
1158 dnl  flags to compiler flags for multithread program compilation (if exists),
1159 dnl  and library, if one required.
1160 dnl
1161 dnl@author   (C) Ruslan Shevchenko <Ruslan@Shevchenko.Kiev.UA>, 1998
1162 dnl@id $Id$
1163 dnl ----------------------------------------------------------------
1164 dnl CHECK_PTHREADS
1165 AC_DEFUN(CHECK_PTHREADS,[
1166 AC_REQUIRE([AC_CANONICAL_SYSTEM])dnl
1167 AC_CHECK_HEADER(pthread.h,AC_DEFINE(HAVE_PTHREAD_H))
1168 AC_CHECK_LIB(posix4,nanosleep, LIBS_PTHREADS="-lposix4",LIBS_PTHREADS="")
1169 AC_CHECK_LIB(pthread,pthread_mutex_lock, 
1170              LIBS_PTHREADS="-lpthread $LIBS_PTHREADS")
1171 AC_MSG_CHECKING([parameters for using pthreads])
1172 case $build_os in
1173   freebsd*)
1174     CFLAGS_PTHREADS="-pthread"
1175     CXXFLAGS_PTHREADS="-pthread"
1176     ;;
1177   *)
1178     ;;
1179 esac
1180 AC_MSG_RESULT(["flags: $CFLAGS_PTHREADS\;libs: $LIBS_PTHREADS"])
1181 threads_ok=yes
1182 ])dnl
1183 dnl
1184 dnl
1185
1186
1187 AC_DEFUN([CHECK_OMNIORB],[
1188 AC_REQUIRE([AC_PROG_CC])dnl
1189 AC_REQUIRE([AC_PROG_CXX])dnl
1190 AC_REQUIRE([AC_PROG_CPP])dnl
1191 AC_REQUIRE([AC_PROG_CXXCPP])dnl
1192
1193 AC_CHECKING(for omniORB)
1194 omniORB_ok=yes
1195
1196 if test "x$PYTHON" = "x" 
1197 then
1198   CHECK_PYTHON
1199 fi
1200
1201 AC_LANG_SAVE
1202 AC_LANG_CPLUSPLUS
1203
1204 AC_PATH_PROG(OMNIORB_IDL, omniidl)
1205 if test "xOMNIORB_IDL" = "x"
1206 then
1207   omniORB_ok=no
1208   AC_MSG_RESULT(omniORB binaries not in PATH variable)
1209 else
1210   omniORB_ok=yes
1211 fi
1212
1213 if  test "x$omniORB_ok" = "xyes"
1214 then
1215   AC_SUBST(OMNIORB_IDL)
1216
1217   OMNIORB_BIN=`echo ${OMNIORB_IDL} | sed -e "s,[[^/]]*$,,;s,/$,,;s,^$,.,"`
1218   OMNIORB_LIB=`echo ${OMNIORB_BIN} | sed -e "s,bin,lib,"`
1219
1220   OMNIORB_ROOT=`echo ${OMNIORB_BIN}  | sed -e "s,[[^/]]*$,,;s,/$,,;s,^$,.,"`
1221   OMNIORB_ROOT=`echo ${OMNIORB_ROOT} | sed -e "s,[[^/]]*$,,;s,/$,,;s,^$,.,"`
1222   AC_SUBST(OMNIORB_ROOT)
1223
1224   OMNIORB_INCLUDES="-I$OMNIORB_ROOT/include -I$OMNIORB_ROOT/include/omniORB3 -I$OMNIORB_ROOT/include/COS"
1225 dnl  OMNIORB_INCLUDES="-I$OMNIORB_ROOT/include -I$OMNIORB_ROOT/include/omniORB4 -I$OMNIORB_ROOT/include/COS"
1226   AC_SUBST(OMNIORB_INCLUDES)
1227
1228   ENABLE_PTHREADS
1229
1230   OMNIORB_CXXFLAGS=
1231   case $build_cpu in
1232     sparc*)
1233       AC_DEFINE(__sparc__)
1234       OMNIORB_CXXFLAGS="$OMNIORB_CXXFLAGS -D__sparc__"
1235       ;;
1236    *86*)
1237       AC_DEFINE(__x86__)
1238       OMNIORB_CXXFLAGS="$OMNIORB_CXXFLAGS -D__x86__"
1239       ;;
1240   esac
1241   case $build_os in
1242     solaris*)
1243       AC_DEFINE(__sunos__)
1244       __OSVERSION__=5
1245       AC_DEFINE(__OSVERSION__)
1246       OMNIORB_CXXFLAGS="$OMNIORB_CXXFLAGS -D__sunos__"
1247       ;;
1248    linux*)
1249       AC_DEFINE(__linux__)
1250       __OSVERSION__=2
1251       AC_DEFINE(__OSVERSION__)
1252       OMNIORB_CXXFLAGS="$OMNIORB_CXXFLAGS -D__linux__"
1253       ;;
1254   esac
1255   AC_SUBST(OMNIORB_CXXFLAGS)
1256
1257   CPPFLAGS_old=$CPPFLAGS
1258   CPPFLAGS="$CPPFLAGS $OMNIORB_CXXFLAGS $OMNIORB_INCLUDES"
1259
1260   AC_LANG_CPLUSPLUS
1261   AC_CHECK_HEADER(CORBA.h,omniORB_ok="yes",omniORB_ok="no")
1262
1263   CPPFLAGS=$CPPFLAGS_old
1264
1265 fi
1266
1267 dnl omniORB_ok=yes
1268
1269 if test "x$omniORB_ok" = "xyes" 
1270 then
1271   OMNIORB_LDFLAGS="-L$OMNIORB_LIB"
1272
1273   LIBS_old=$LIBS
1274   LIBS="$LIBS $OMNIORB_LDFLAGS -lomnithread"
1275
1276   CXXFLAGS_old=$CXXFLAGS
1277   CXXFLAGS="$CXXFLAGS $OMNIORB_CXXFLAGS $OMNIORB_INCLUDES"
1278
1279   AC_MSG_CHECKING(whether we can link with omnithreads)
1280   AC_CACHE_VAL(salome_cv_lib_omnithreads,[
1281     AC_TRY_LINK(
1282 #include <omnithread.h>
1283 ,   omni_mutex my_mutex,
1284     eval "salome_cv_lib_omnithreads=yes",eval "salome_cv_lib_omnithreads=no")
1285   ])
1286
1287   omniORB_ok="$salome_cv_lib_omnithreads"
1288   if  test "x$omniORB_ok" = "xno"
1289   then
1290     AC_MSG_RESULT(omnithreads not found)
1291   else
1292     AC_MSG_RESULT(yes)
1293   fi
1294
1295   LIBS=$LIBS_old
1296   CXXFLAGS=$CXXFLAGS_old
1297 fi
1298
1299
1300 dnl omniORB_ok=yes
1301 if test "x$omniORB_ok" = "xyes" 
1302 then
1303
1304   AC_CHECK_LIB(socket,socket, LIBS="-lsocket $LIBS",,)
1305   AC_CHECK_LIB(nsl,gethostbyname, LIBS="-lnsl $LIBS",,)
1306
1307   LIBS_old=$LIBS
1308   OMNIORB_LIBS="$OMNIORB_LDFLAGS -lomniORB3 -ltcpwrapGK -lomniDynamic3 -lomnithread -lCOS3 -lCOSDynamic3"
1309 dnl  OMNIORB_LIBS="$OMNIORB_LDFLAGS -lomniORB4 -lomniDynamic4 -lomnithread -lCOS4 -lCOSDynamic4"
1310   AC_SUBST(OMNIORB_LIBS)
1311
1312   LIBS="$OMNIORB_LIBS $LIBS"
1313   CXXFLAGS_old=$CXXFLAGS
1314   CXXFLAGS="$CXXFLAGS $OMNIORB_CXXFLAGS $OMNIORB_INCLUDES"
1315
1316   AC_MSG_CHECKING(whether we can link with omniORB3)
1317   AC_CACHE_VAL(salome_cv_lib_omniorb3,[
1318     AC_TRY_LINK(
1319 #include <CORBA.h>
1320 ,   CORBA::ORB_var orb,
1321     eval "salome_cv_lib_omniorb3=yes",eval "salome_cv_lib_omniorb3=no")
1322   ])
1323   omniORB_ok="$salome_cv_lib_omniorb3"
1324
1325   omniORB_ok=yes
1326   if test "x$omniORB_ok" = "xno" 
1327   then
1328     AC_MSG_RESULT(omniORB library linking failed)
1329     omniORB_ok=no
1330   else
1331     AC_MSG_RESULT(yes)
1332   fi
1333   LIBS="$LIBS_old"
1334   CXXFLAGS=$CXXFLAGS_old
1335 fi
1336
1337
1338 if test "x$omniORB_ok" = "xyes" 
1339 then
1340
1341   OMNIORB_IDLCXXFLAGS="-I$OMNIORB_ROOT/idl"
1342   OMNIORB_IDLPYFLAGS="-bpython -I$OMNIORB_ROOT/idl"
1343   AC_SUBST(OMNIORB_IDLCXXFLAGS)
1344   AC_SUBST(OMNIORB_IDLPYFLAGS)
1345
1346   OMNIORB_IDL_CLN_H=.hh
1347   OMNIORB_IDL_CLN_CXX=SK.cc
1348   OMNIORB_IDL_CLN_OBJ=SK.o 
1349   AC_SUBST(OMNIORB_IDL_CLN_H)
1350   AC_SUBST(OMNIORB_IDL_CLN_CXX)
1351   AC_SUBST(OMNIORB_IDL_CLN_OBJ)
1352
1353   OMNIORB_IDL_SRV_H=.hh
1354   OMNIORB_IDL_SRV_CXX=SK.cc
1355   OMNIORB_IDL_SRV_OBJ=SK.o
1356   AC_SUBST(OMNIORB_IDL_SRV_H)
1357   AC_SUBST(OMNIORB_IDL_SRV_CXX)
1358   AC_SUBST(OMNIORB_IDL_SRV_OBJ)
1359
1360   OMNIORB_IDL_TIE_H=
1361   OMNIORB_IDL_TIE_CXX=
1362   AC_SUBST(OMNIORB_IDL_TIE_H)
1363   AC_SUBST(OMNIORB_IDL_TIE_CXX)
1364   
1365   AC_DEFINE(OMNIORB)
1366
1367   CORBA_HAVE_POA=1
1368   AC_DEFINE(CORBA_HAVE_POA)
1369
1370   CORBA_ORB_INIT_HAVE_3_ARGS=1
1371   AC_DEFINE(CORBA_ORB_INIT_HAVE_3_ARGS)
1372   CORBA_ORB_INIT_THIRD_ARG='"omniORB3"'
1373   AC_DEFINE(CORBA_ORB_INIT_THIRD_ARG, "omniORB3")
1374
1375 fi
1376
1377 omniORBpy_ok=no
1378 if  test "x$omniORB_ok" = "xyes"
1379 then
1380   AC_MSG_CHECKING(omniORBpy (CORBA.py file available))
1381   if test -f ${OMNIORB_ROOT}/lib/python/CORBA.py
1382   then
1383     omniORBpy_ok=yes
1384     PYTHONPATH=${OMNIORB_ROOT}/lib/python:${OMNIORB_LIB}:${PYTHON_PREFIX}/lib/python${PYTHON_VERSION}:${PYTHONPATH}
1385     AC_SUBST(PYTHONPATH)
1386     AC_MSG_RESULT(yes)
1387   fi
1388 fi
1389
1390 AC_LANG_RESTORE
1391
1392 AC_MSG_RESULT(for omniORBpy: $omniORBpy_ok)
1393 AC_MSG_RESULT(for omniORB: $omniORB_ok)
1394
1395 # Save cache
1396 AC_CACHE_SAVE
1397
1398 ])dnl
1399 dnl
1400
1401 #  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
1402 #  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
1403
1404 #  This library is free software; you can redistribute it and/or 
1405 #  modify it under the terms of the GNU Lesser General Public 
1406 #  License as published by the Free Software Foundation; either 
1407 #  version 2.1 of the License. 
1408
1409 #  This library is distributed in the hope that it will be useful, 
1410 #  but WITHOUT ANY WARRANTY; without even the implied warranty of 
1411 #  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
1412 #  Lesser General Public License for more details. 
1413
1414 #  You should have received a copy of the GNU Lesser General Public 
1415 #  License along with this library; if not, write to the Free Software 
1416 #  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
1417
1418 #  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org 
1419 #
1420 #
1421 AC_DEFUN([CHECK_CORBA],[
1422
1423 if test x"$DEFAULT_ORB" = x"omniORB"
1424 then
1425
1426   #  Contient le nom de l'ORB
1427   ORB=omniorb
1428
1429   AC_MSG_RESULT(default orb : omniORB)
1430   IDL=$OMNIORB_IDL
1431   AC_SUBST(IDL)
1432
1433   CORBA_ROOT=$OMNIORB_ROOT
1434   CORBA_INCLUDES=$OMNIORB_INCLUDES
1435   CORBA_CXXFLAGS=$OMNIORB_CXXFLAGS
1436   CORBA_LIBS=$OMNIORB_LIBS
1437   IDLCXXFLAGS=$OMNIORB_IDLCXXFLAGS
1438   IDLPYFLAGS=$OMNIORB_IDLPYFLAGS
1439
1440   AC_SUBST(CORBA_ROOT)
1441   AC_SUBST(CORBA_INCLUDES)
1442   AC_SUBST(CORBA_CXXFLAGS)
1443   AC_SUBST(CORBA_LIBS)
1444   AC_SUBST(IDLCXXFLAGS)
1445   AC_SUBST(IDLPYFLAGS)
1446
1447   IDL_CLN_H=$OMNIORB_IDL_CLN_H
1448   IDL_CLN_CXX=$OMNIORB_IDL_CLN_CXX
1449   IDL_CLN_OBJ=$OMNIORB_IDL_CLN_OBJ
1450
1451   AC_SUBST(IDL_CLN_H)
1452   AC_SUBST(IDL_CLN_CXX)
1453   AC_SUBST(IDL_CLN_OBJ)
1454
1455   IDL_SRV_H=$OMNIORB_IDL_SRV_H
1456   IDL_SRV_CXX=$OMNIORB_IDL_SRV_CXX
1457   IDL_SRV_OBJ=$OMNIORB_IDL_SRV_OBJ
1458
1459   AC_SUBST(IDL_SRV_H)
1460   AC_SUBST(IDL_SRV_CXX)
1461   AC_SUBST(IDL_SRV_OBJ)
1462
1463 else
1464     AC_MSG_RESULT($DEFAULT_ORB unknown orb)
1465
1466 fi
1467
1468 ])dnl
1469 dnl
1470
1471 dnl  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
1472 dnl  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
1473 dnl 
1474 dnl  This library is free software; you can redistribute it and/or 
1475 dnl  modify it under the terms of the GNU Lesser General Public 
1476 dnl  License as published by the Free Software Foundation; either 
1477 dnl  version 2.1 of the License. 
1478 dnl 
1479 dnl  This library is distributed in the hope that it will be useful, 
1480 dnl  but WITHOUT ANY WARRANTY; without even the implied warranty of 
1481 dnl  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
1482 dnl  Lesser General Public License for more details. 
1483 dnl 
1484 dnl  You should have received a copy of the GNU Lesser General Public 
1485 dnl  License along with this library; if not, write to the Free Software 
1486 dnl  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
1487 dnl 
1488 dnl  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org 
1489 dnl
1490 dnl
1491 dnl
1492 AC_DEFUN([CHECK_OPENGL],[
1493 AC_REQUIRE([AC_PROG_CC])dnl
1494 AC_REQUIRE([AC_PROG_CPP])dnl
1495 AC_ARG_WITH(opengl,
1496    [  --with-opengl=DIR root directory path of OpenGL installation ],
1497    [
1498       opengl_dir="$withval"
1499       local_opengl=yes
1500     ], [
1501       dirs="/usr/lib /usr/local/lib /opt/graphics/OpenGL/lib /usr/openwin/lib /usr/X11R6/lib"
1502     ])dnl
1503
1504 AC_CHECKING(for OpenGL)
1505
1506 AC_SUBST(OGL_INCLUDES)
1507 AC_SUBST(OGL_LIBS)
1508
1509 OGL_INCLUDES=""
1510 OGL_LIBS=""
1511
1512 OpenGL_ok=no
1513
1514 dnl openGL headers
1515
1516 # by default
1517
1518 if test "x$local_opengl" = "xyes" ; then
1519    if test -f "${opengl_dir}/include/GL/gl.h" ; then
1520       OpenGL_ok=yes
1521       OGL_INCLUDES="-I${opengl_dir}/include"
1522       OGL_LIBS="-L${opengl_dir}/lib"
1523       AC_MSG_RESULT(select OpenGL distribution in ${opengl_dir})
1524    else
1525       AC_MSG_RESULT(no gl.h header file in ${opengl_dir}/include/GL)
1526    fi
1527 fi
1528
1529 if  test "x$OpenGL_ok" = "xno"
1530 then
1531   AC_CHECK_HEADERS(GL/gl.h, [OpenGL_ok=yes])
1532 fi
1533
1534 if  test "x$OpenGL_ok" = "xno"
1535 then
1536 # under SunOS ?
1537   AC_CHECK_HEADERS(/usr/openwin/share/include/GL/glxmd.h,
1538                   [OpenGL_ok=yes]
1539                   OGL_INCLUDES="-I/usr/openwin/share/include/")
1540 fi
1541
1542 if  test "x$OpenGL_ok" = "xno"
1543 then
1544 # under IRIX ?
1545   AC_CHECK_HEADERS(/opt/graphics/OpenGL/include/GL/glxmd.h,
1546                   [OpenGL_ok=yes]
1547                   OGL_INCLUDES="-I/opt/graphics/OpenGL/include")
1548 fi
1549 if  test "x$OpenGL_ok" = "xno"
1550 then
1551 # some linux OpenGL servers hide the includes in /usr/X11R6/include/GL
1552   AC_CHECK_HEADERS(/usr/X11R6/include/GL/gl.h,
1553                   [OpenGL_ok=yes]
1554                   OGL_INCLUDES="-I/usr/X11R6/include")
1555 fi
1556
1557 if  test "x$OpenGL_ok" = "xyes"
1558 then
1559   AC_CHECKING(for OpenGL library)
1560   OpenGL_ok=no
1561   for i in $dirs; do
1562     if test -r "$i/libGL.so"; then
1563 dnl      AC_MSG_RESULT(in $i)
1564       OGL_LIBS="-L$i"
1565       break
1566     fi
1567 # under IRIX ?
1568     if test -r "$i/libGL.sl"; then
1569 dnl      AC_MSG_RESULT(in $i)
1570       OGL_LIBS="-L$i"
1571       break
1572     fi
1573   done
1574   LDFLAGS_old="$LDFLAGS"
1575   LDFLAGS="$LDFLAGS $OGL_LIBS"
1576   AC_CHECK_LIB(GL,glBegin,OpenGL_ok=yes,OpenGL_ok=no)
1577   LDFLAGS="$LDFLAGS_old"
1578 fi
1579
1580 if test "x$OpenGL_ok" = "xyes" ; then
1581   OGL_LIBS="$OGL_LIBS -lGL"
1582 fi
1583
1584
1585 OpenGLU_ok=no
1586 LDFLAGS_old="$LDFLAGS"
1587 LDFLAGS="$LDFLAGS $OGL_LIBS"
1588 AC_CHECK_LIB(GLU,gluBeginSurface,OpenGLU_ok=yes,OpenGLU_ok=no)
1589 LDFLAGS="$LDFLAGS_old"
1590
1591 if test "x$OpenGLU_ok" = "xyes" ; then
1592   OGL_LIBS="$OGL_LIBS -lGLU"
1593 fi
1594
1595 # Save cache
1596 AC_CACHE_SAVE
1597
1598 ])dnl
1599
1600 dnl  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
1601 dnl  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
1602 dnl 
1603 dnl  This library is free software; you can redistribute it and/or 
1604 dnl  modify it under the terms of the GNU Lesser General Public 
1605 dnl  License as published by the Free Software Foundation; either 
1606 dnl  version 2.1 of the License. 
1607 dnl 
1608 dnl  This library is distributed in the hope that it will be useful, 
1609 dnl  but WITHOUT ANY WARRANTY; without even the implied warranty of 
1610 dnl  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
1611 dnl  Lesser General Public License for more details. 
1612 dnl 
1613 dnl  You should have received a copy of the GNU Lesser General Public 
1614 dnl  License along with this library; if not, write to the Free Software 
1615 dnl  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
1616 dnl 
1617 dnl  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org 
1618 dnl
1619 dnl
1620 dnl
1621
1622 AC_DEFUN([CHECK_QT],[
1623 AC_REQUIRE([AC_PROG_CC])dnl
1624 AC_REQUIRE([AC_PROG_CXX])dnl
1625 AC_REQUIRE([AC_PROG_CPP])dnl
1626 AC_REQUIRE([AC_PROG_CXXCPP])dnl
1627 AC_REQUIRE([CHECK_OPENGL])dnl
1628
1629 AC_CHECKING(for QT)
1630 qt_ok=yes
1631
1632 AC_LANG_SAVE
1633 AC_LANG_CPLUSPLUS
1634
1635 if test "x$QTDIR" = "x"
1636 then
1637    AC_MSG_RESULT(please define QTDIR variable)
1638    qt_ok=no
1639 fi
1640
1641 if  test "x$qt_ok" = "xyes"
1642 then
1643   if test -f ${QTDIR}/bin/moc
1644   then
1645     MOC=${QTDIR}/bin/moc
1646   else
1647     AC_PATH_PROG(MOC, moc)
1648   fi
1649   if test "x$MOC" = "x"
1650   then
1651     qt_ok=no
1652     AC_MSG_RESULT(moc qt-compiler not in PATH variable)
1653   else
1654     qt_ok=yes
1655     AC_MSG_RESULT(moc found)
1656   fi
1657 fi
1658
1659 if  test "x$qt_ok" = "xyes"
1660 then
1661   if test -f ${QTDIR}/bin/uic
1662   then
1663     UIC=${QTDIR}/bin/uic
1664   else
1665     AC_PATH_PROG(UIC, uic)
1666   fi
1667   if test "x$UIC" = "x"
1668   then
1669     qt_ok=no
1670     AC_MSG_RESULT(uic qt-interface compiler not in PATH variable)
1671   else
1672     qt_ok=yes
1673     AC_MSG_RESULT(uic found)
1674   fi
1675 fi
1676
1677 AC_SUBST(QTDIR)
1678 QT_ROOT=$QTDIR
1679
1680 if  test "x$qt_ok" = "xyes"
1681 then
1682   AC_MSG_CHECKING(include of qt headers)
1683
1684   CPPFLAGS_old=$CPPFLAGS
1685   CPPFLAGS="$CPPFLAGS -I$QTDIR/include"
1686
1687   AC_LANG_CPLUSPLUS
1688   AC_CHECK_HEADER(qaction.h,qt_ok=yes ,qt_ok=no)
1689
1690   CPPFLAGS=$CPPFLAGS_old
1691
1692   if  test "x$qt_ok" = "xno"
1693   then
1694     AC_MSG_RESULT(qt headers not found, or too old qt version, in $QTDIR/include)
1695     AC_MSG_RESULT(QTDIR environment variable may be wrong)
1696   else
1697     AC_MSG_RESULT(yes)
1698        QT_INCLUDES="-I${QT_ROOT}/include -DQT_THREAD_SUPPORT"
1699     QT_MT_INCLUDES="-I${QT_ROOT}/include -DQT_THREAD_SUPPORT"
1700   fi
1701 fi
1702
1703 if  test "x$qt_ok" = "xyes"
1704 then
1705   AC_MSG_CHECKING(linking qt library)
1706   LIBS_old=$LIBS
1707   LIBS="$LIBS -L$QTDIR/lib -lqt-mt $OGL_LIBS"
1708
1709   CXXFLAGS_old=$CXXFLAGS
1710   CXXFLAGS="$CXXFLAGS -I$QTDIR/include"
1711
1712   AC_CACHE_VAL(salome_cv_lib_qt,[
1713     AC_TRY_LINK(
1714 #include <qapplication.h>
1715 ,   int n;
1716     char **s;
1717     QApplication a(n, s);
1718     a.exec();,
1719     eval "salome_cv_lib_qt=yes",eval "salome_cv_lib_qt=no")
1720   ])
1721   qt_ok="$salome_cv_lib_qt"
1722
1723   if  test "x$qt_ok" = "xno"
1724   then
1725     AC_MSG_RESULT(unable to link with qt library)
1726     AC_MSG_RESULT(QTDIR environment variable may be wrong)
1727   else
1728     AC_MSG_RESULT(yes)
1729        QT_LIBS="-L$QTDIR/lib -lqt-mt"
1730     QT_MT_LIBS="-L$QTDIR/lib -lqt-mt"
1731   fi
1732
1733   LIBS=$LIBS_old
1734   CXXFLAGS=$CXXFLAGS_old
1735
1736 fi
1737
1738 AC_SUBST(MOC)
1739 AC_SUBST(UIC)
1740
1741 AC_SUBST(QT_ROOT)
1742 AC_SUBST(QT_INCLUDES)
1743 AC_SUBST(QT_LIBS)
1744 AC_SUBST(QT_MT_LIBS)
1745
1746 AC_LANG_RESTORE
1747
1748 AC_MSG_RESULT(for qt: $qt_ok)
1749
1750 # Save cache
1751 AC_CACHE_SAVE
1752
1753 ])dnl
1754 dnl
1755
1756 dnl  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
1757 dnl  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
1758 dnl 
1759 dnl  This library is free software; you can redistribute it and/or 
1760 dnl  modify it under the terms of the GNU Lesser General Public 
1761 dnl  License as published by the Free Software Foundation; either 
1762 dnl  version 2.1 of the License. 
1763 dnl 
1764 dnl  This library is distributed in the hope that it will be useful, 
1765 dnl  but WITHOUT ANY WARRANTY; without even the implied warranty of 
1766 dnl  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
1767 dnl  Lesser General Public License for more details. 
1768 dnl 
1769 dnl  You should have received a copy of the GNU Lesser General Public 
1770 dnl  License along with this library; if not, write to the Free Software 
1771 dnl  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
1772 dnl 
1773 dnl  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org 
1774 dnl
1775 dnl
1776 dnl
1777
1778 AC_DEFUN([CHECK_VTK],[
1779 AC_REQUIRE([AC_PROG_CC])dnl
1780 AC_REQUIRE([AC_PROG_CXX])dnl
1781 AC_REQUIRE([AC_PROG_CPP])dnl
1782 AC_REQUIRE([AC_PROG_CXXCPP])dnl
1783
1784 AC_CHECKING(for VTK)
1785
1786 AC_LANG_SAVE
1787 AC_LANG_CPLUSPLUS
1788
1789 AC_SUBST(VTK_INCLUDES)
1790 AC_SUBST(VTK_LIBS)
1791 AC_SUBST(VTKPY_MODULES)
1792
1793 VTK_INCLUDES=""
1794 VTK_LIBS=""
1795 VTKPY_MODULES=""
1796
1797 vtk_ok=no
1798
1799 AC_PATH_X
1800
1801 if test "x$OpenGL_ok" != "xyes"
1802 then
1803    AC_MSG_WARN(vtk needs OpenGL correct configuration, check configure output)
1804 fi
1805
1806
1807 LOCAL_INCLUDES="$OGL_INCLUDES"
1808 LOCAL_LIBS="-lvtkCommon -lvtkGraphics -lvtkImaging -lvtkFiltering -lvtkIO -lvtkRendering -lvtkHybrid $OGL_LIBS -L$x_libraries -lX11 -lXt"
1809 TRY_LINK_LIBS="-lvtkCommon $OGL_LIBS -L$x_libraries -lX11 -lXt"
1810
1811 if test -z $VTKHOME
1812 then 
1813    AC_MSG_WARN(undefined VTKHOME variable which specify where vtk was compiled)
1814 else
1815    LOCAL_INCLUDES="-I$VTKHOME/include/vtk $LOCAL_INCLUDES"
1816    LOCAL_LIBS="-L$VTKHOME/lib/vtk $LOCAL_LIBS"
1817    TRY_LINK_LIBS="-L$VTKHOME/lib/vtk $TRY_LINK_LIBS"
1818 fi
1819
1820 dnl vtk headers
1821 CPPFLAGS_old="$CPPFLAGS"
1822 CPPFLAGS="$CPPFLAGS $LOCAL_INCLUDES -Wno-deprecated"
1823
1824 AC_CHECK_HEADER(vtkPlane.h,vtk_ok="yes",vtk_ok="no")
1825
1826  CPPFLAGS="$CPPFLAGS_old"
1827
1828  if  test "x$vtk_ok" = "xyes"
1829  then
1830    VTK_INCLUDES="$LOCAL_INCLUDES"
1831
1832  dnl vtk libraries
1833
1834    AC_MSG_CHECKING(linking VTK library)
1835
1836   LIBS_old="$LIBS"
1837 #  LIBS="$LIBS $TRY_LINK_LIBS"
1838   LIBS="$LIBS $LOCAL_LIBS"
1839   CPPFLAGS_old="$CPPFLAGS"
1840   CPPFLAGS="$CPPFLAGS $VTK_INCLUDES -Wno-deprecated"
1841
1842  dnl  VTKPY_MODULES="$VTKHOME/python"
1843
1844    AC_CACHE_VAL(salome_cv_lib_vtk,[
1845      AC_TRY_LINK(
1846 #include "vtkPlane.h"
1847 ,   vtkPlane *p = vtkPlane::New();,
1848     eval "salome_cv_lib_vtk=yes",eval "salome_cv_lib_vtk=no")
1849   ])
1850   vtk_ok="$salome_cv_lib_vtk"
1851   LIBS="$LIBS_old"
1852   CPPFLAGS="$CPPFLAGS_old"
1853
1854 fi
1855
1856 if  test "x$vtk_ok" = "xno"
1857 then
1858   AC_MSG_RESULT("no")
1859   AC_MSG_WARN(unable to link with vtk library)
1860 else
1861   AC_MSG_RESULT("yes")
1862   VTK_LIBS="$LOCAL_LIBS"
1863   VTK_MT_LIBS="$LOCAL_LIBS"
1864 fi
1865
1866 AC_MSG_RESULT("for vtk: $vtk_ok")
1867
1868 AC_LANG_RESTORE
1869
1870 # Save cache
1871 AC_CACHE_SAVE
1872
1873 ])dnl
1874
1875
1876
1877 #  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
1878 #  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
1879
1880 #  This library is free software; you can redistribute it and/or 
1881 #  modify it under the terms of the GNU Lesser General Public 
1882 #  License as published by the Free Software Foundation; either 
1883 #  version 2.1 of the License. 
1884
1885 #  This library is distributed in the hope that it will be useful, 
1886 #  but WITHOUT ANY WARRANTY; without even the implied warranty of 
1887 #  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
1888 #  Lesser General Public License for more details. 
1889
1890 #  You should have received a copy of the GNU Lesser General Public 
1891 #  License along with this library; if not, write to the Free Software 
1892 #  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
1893
1894 #  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org 
1895 #
1896 #
1897 AC_DEFUN([CHECK_HDF5],[
1898 AC_REQUIRE([AC_PROG_CC])dnl
1899 AC_REQUIRE([AC_PROG_CPP])dnl
1900
1901 AC_CHECKING(for HDF5)
1902
1903 AC_ARG_WITH(hdf5,
1904     [  --with-hdf5=DIR                 root directory path to hdf5 installation ],
1905     [HDF5HOME="$withval"
1906       AC_MSG_RESULT("select $withval as path to hdf5")
1907     ])
1908
1909 AC_SUBST(HDF5_INCLUDES)
1910 AC_SUBST(HDF5_LIBS)
1911 AC_SUBST(HDF5_MT_LIBS)
1912
1913 HDF5_INCLUDES=""
1914 HDF5_LIBS=""
1915 HDF5_MT_LIBS=""
1916
1917 hdf5_ok=no
1918
1919 LOCAL_INCLUDES=""
1920 LOCAL_LIBS=""
1921
1922 if test -z $HDF5HOME
1923 then
1924    AC_MSG_WARN(undefined HDF5HOME variable which specify hdf5 installation directory)
1925 else
1926    LOCAL_INCLUDES="-I$HDF5HOME/include"
1927    LOCAL_LIBS="-L$HDF5HOME/lib"
1928 fi
1929
1930 dnl hdf5 headers
1931
1932 CPPFLAGS_old="$CPPFLAGS"
1933 CPPFLAGS="$CPPFLAGS $LOCAL_INCLUDES"
1934 AC_CHECK_HEADER(hdf5.h,hdf5_ok=yes ,hdf5_ok=no)
1935 CPPFLAGS="$CPPFLAGS_old"
1936
1937
1938 if  test "x$hdf5_ok" = "xyes"
1939 then
1940
1941 dnl hdf5 library
1942
1943   LIBS_old="$LIBS"
1944   LIBS="$LIBS $LOCAL_LIBS"
1945   AC_CHECK_LIB(hdf5,H5open,hdf5_ok=yes,hdf5_ok=no)
1946   LIBS="$LIBS_old"
1947
1948 fi
1949
1950 if  test "x$hdf5_ok" = "xyes"
1951 then
1952   HDF5_INCLUDES="$LOCAL_INCLUDES"
1953   HDF5_LIBS="$LOCAL_LIBS -lhdf5"
1954   HDF5_MT_LIBS="$LOCAL_LIBS -lhdf5"
1955 fi
1956
1957 AC_MSG_RESULT(for hdf5: $hdf5_ok)
1958
1959 ])dnl
1960
1961 dnl  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
1962 dnl  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
1963 dnl 
1964 dnl  This library is free software; you can redistribute it and/or 
1965 dnl  modify it under the terms of the GNU Lesser General Public 
1966 dnl  License as published by the Free Software Foundation; either 
1967 dnl  version 2.1 of the License. 
1968 dnl 
1969 dnl  This library is distributed in the hope that it will be useful, 
1970 dnl  but WITHOUT ANY WARRANTY; without even the implied warranty of 
1971 dnl  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
1972 dnl  Lesser General Public License for more details. 
1973 dnl 
1974 dnl  You should have received a copy of the GNU Lesser General Public 
1975 dnl  License along with this library; if not, write to the Free Software 
1976 dnl  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
1977 dnl 
1978 dnl  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org 
1979 dnl
1980 dnl
1981 dnl
1982
1983 AC_DEFUN([CHECK_MED2],[
1984 AC_REQUIRE([AC_PROG_CC])dnl
1985 AC_REQUIRE([AC_PROG_CPP])dnl
1986 AC_REQUIRE([CHECK_HDF5])dnl
1987
1988 AC_CHECKING(for MED2)
1989
1990 AC_ARG_WITH(med2,
1991     [  --with-med2=DIR                 root directory path to med2 installation ],
1992     [MED2HOME="$withval"
1993       AC_MSG_RESULT("select $withval as path to med2")
1994     ])
1995
1996 AC_SUBST(MED2_INCLUDES)
1997 AC_SUBST(MED2_LIBS)
1998 AC_SUBST(MED2_MT_LIBS)
1999
2000 MED2_INCLUDES=""
2001 MED2_LIBS=""
2002 MED2_MT_LIBS=""
2003
2004 med2_ok=no
2005
2006 LOCAL_INCLUDES="$HDF5_INCLUDES"
2007 LOCAL_LIBS="-lmed $HDF5_LIBS"
2008
2009 if test -z $MED2HOME
2010 then
2011    AC_MSG_WARN(undefined MED2HOME variable which specify med2 installation directory)
2012 else
2013    LOCAL_INCLUDES="$LOCAL_INCLUDES -I$MED2HOME/include"
2014    LOCAL_LIBS="-L$MED2HOME/lib $LOCAL_LIBS"
2015 fi
2016
2017 dnl check med2 header
2018
2019 CPPFLAGS_old="$CPPFLAGS"
2020 dnl we must test system : linux = -DPCLINUX
2021 CPPFLAGS="$CPPFLAGS -DPCLINUX $LOCAL_INCLUDES"
2022 AC_CHECK_HEADER(med.h,med2_ok=yes ,med2_ok=no)
2023 CPPFLAGS="$CPPFLAGS_old"
2024
2025 if  test "x$med2_ok" = "xyes"
2026 then
2027
2028 dnl check med2 library
2029
2030   LIBS_old="$LIBS"
2031   LIBS="$LIBS $LOCAL_LIBS"
2032   AC_CHECK_LIB(med,MEDouvrir,med2_ok=yes,med2_ok=no)
2033   LIBS="$LIBS_old"
2034
2035 fi
2036
2037 if  test "x$med2_ok" = "xyes"
2038 then
2039   MED2_INCLUDES="-DPCLINUX $LOCAL_INCLUDES"
2040   MED2_LIBS="$LOCAL_LIBS"
2041   MED2_MT_LIBS="$LOCAL_LIBS"
2042 fi
2043
2044 AC_MSG_RESULT(for med2: $med2_ok)
2045
2046 ])dnl
2047
2048 dnl  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
2049 dnl  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
2050 dnl 
2051 dnl  This library is free software; you can redistribute it and/or 
2052 dnl  modify it under the terms of the GNU Lesser General Public 
2053 dnl  License as published by the Free Software Foundation; either 
2054 dnl  version 2.1 of the License. 
2055 dnl 
2056 dnl  This library is distributed in the hope that it will be useful, 
2057 dnl  but WITHOUT ANY WARRANTY; without even the implied warranty of 
2058 dnl  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
2059 dnl  Lesser General Public License for more details. 
2060 dnl 
2061 dnl  You should have received a copy of the GNU Lesser General Public 
2062 dnl  License along with this library; if not, write to the Free Software 
2063 dnl  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
2064 dnl 
2065 dnl  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org 
2066 dnl
2067 dnl
2068 dnl
2069 AC_DEFUN([CHECK_CAS],[
2070 AC_REQUIRE([AC_PROG_CXX])dnl
2071 AC_REQUIRE([AC_PROG_CXXCPP])dnl
2072
2073 AC_CHECKING(for OpenCascade)
2074
2075 AC_LANG_SAVE
2076 AC_LANG_CPLUSPLUS
2077
2078 AC_SUBST(CAS_CPPFLAGS)
2079 AC_SUBST(CAS_CXXFLAGS)
2080 AC_SUBST(CAS_KERNEL)
2081 AC_SUBST(CAS_VIEWER)
2082 AC_SUBST(CAS_MODELER)
2083 AC_SUBST(CAS_OCAF)
2084 AC_SUBST(CAS_DATAEXCHANGE)
2085 AC_SUBST(CAS_LDFLAGS)
2086
2087 AC_SUBST(CAS_LDPATH)
2088
2089 CAS_CPPFLAGS=""
2090 CAS_CXXFLAGS=""
2091 CAS_LDFLAGS=""
2092 occ_ok=no
2093
2094 dnl libraries directory location
2095 case $host_os in
2096    linux*)
2097       casdir=Linux
2098       ;;
2099    freebsd*)
2100       casdir=Linux
2101       ;;
2102    irix5.*)
2103       casdir=Linux
2104       ;;
2105    irix6.*)
2106       casdir=Linux
2107       ;;
2108    osf4.*)
2109       casdir=Linux
2110       ;;
2111    solaris2.*)
2112       casdir=Linux
2113       ;;
2114    *)
2115       casdir=Linux
2116       ;;
2117 esac
2118
2119 dnl were is OCC ?
2120 if test -z $CASROOT; then
2121   AC_MSG_WARN(You must provide CASROOT variable : see OCC installation manual)
2122 else
2123   occ_ok=yes
2124   OCC_VERSION_MAJOR=0
2125   ff=$CASROOT/inc/Standard_Version.hxx
2126   if test -f $ff ; then
2127     grep "define OCC_VERSION_MAJOR" $ff > /dev/null
2128     if test $? = 0 ; then
2129       OCC_VERSION_MAJOR=`grep "define OCC_VERSION_MAJOR" $ff | awk '{i=3 ; print $i}'`
2130     fi
2131   fi
2132 fi
2133
2134 if test "x$occ_ok" = "xyes"; then
2135
2136 dnl cascade headers
2137
2138   CPPFLAGS_old="$CPPFLAGS"
2139   CPPFLAGS="$CPPFLAGS -DLIN -DLINTEL -DCSFDB -DNO_CXX_EXCEPTION -DNo_exception -DHAVE_CONFIG_H -DHAVE_LIMITS_H -I$CASROOT/inc -Wno-deprecated -DHAVE_WOK_CONFIG_H"
2140   CXXFLAGS_old="$CXXFLAGS"
2141   CXXFLAGS="$CXXFLAGS -funsigned-char"
2142
2143   AC_CHECK_HEADER(Standard_Type.hxx,occ_ok=yes ,occ_ok=no)
2144
2145   CPPFLAGS="$CPPFLAGS_old"
2146   CXXFLAGS="$CXXFLAGS_old"
2147 fi
2148
2149 if test "x$occ_ok" = xyes ; then
2150
2151   CAS_CPPFLAGS="-DOCC_VERSION_MAJOR=$OCC_VERSION_MAJOR -DLIN -DLINTEL -DCSFDB -DNO_CXX_EXCEPTION -DNo_exception -DHAVE_CONFIG_H -DHAVE_LIMITS_H -I$CASROOT/inc -DHAVE_WOK_CONFIG_H"
2152   CAS_CXXFLAGS="-funsigned-char"
2153
2154   AC_MSG_CHECKING(for OpenCascade libraries)
2155
2156   CPPFLAGS_old="$CPPFLAGS"
2157   CPPFLAGS="$CPPFLAGS $CAS_CPPFLAGS -Wno-deprecated"
2158   CXXFLAGS_old="$CXXFLAGS"
2159   CXXFLAGS="$CXXFLAGS $CAS_CXXFLAGS"
2160   LIBS_old="$LIBS"
2161   LIBS="$LIBS -L$CASROOT/$casdir/lib -lTKernel"
2162   AC_CACHE_VAL(salome_cv_lib_occ,[
2163     AC_TRY_LINK(
2164 using namespace std;
2165 #include <Standard_Type.hxx>
2166 ,   size_t size;
2167     const Standard_CString aName="toto";
2168     Standard_Type myST(aName) ; 
2169     myST.Find(aName);,
2170     eval "salome_cv_lib_occ=yes",eval "salome_cv_lib_occ=no")
2171   ])
2172   occ_ok="$salome_cv_lib_occ"
2173
2174   CPPFLAGS="$CPPFLAGS_old"
2175   CXXFLAGS="$CXXFLAGS_old"
2176   LIBS="$LIBS_old"
2177 fi
2178
2179 if test "x$occ_ok" = xno ; then
2180   AC_MSG_RESULT(no)
2181   AC_MSG_WARN(Opencascade libraries not found)
2182 else
2183   AC_MSG_RESULT(yes)
2184   CAS_LDPATH="-L$CASROOT/$casdir/lib "
2185   CAS_KERNEL="$CAS_LDPATH -lTKernel -lTKMath"
2186   CAS_OCAF="$CAS_LDPATH -lPTKernel -lTKCAF -lFWOSPlugin -lTKPShape -lTKPCAF -lTKStdSchema -lTKShapeSchema -lPAppStdPlugin -lTKPAppStd -lTKCDF"
2187 dnl  CAS_VIEWER="-L$CASROOT/$casdir/lib -lTKOpenGl -lTKV3d -lTKV2d -lTKService"
2188   CAS_VIEWER="$CAS_LDPATH -lTKOpenGl -lTKV3d -lTKService"
2189 #  CAS_MODELER="-L$CASROOT/$casdir/lib -lTKG2d -lTKG3d -lTKGeomBase -lTKBRep -lTKGeomAlgo -lTKTopAlgo -lTKPrim -lTKBool -lTKHLR -lTKFillet -lTKFeat -lTKOffset"
2190   CAS_MODELER="$CAS_LDPATH -lTKG2d -lTKG3d -lTKGeomBase -lTKBRep -lTKGeomAlgo -lTKTopAlgo -lTKPrim -lTKBool -lTKHLR -lTKFillet -lTKOffset"
2191 dnl  CAS_DATAEXCHANGE="-L$CASROOT/$casdir/lib -lTKXSBase -lTKIGES -lTKSTEP -lTKShHealing -lTKShHealingStd -lTKSTL -lTKVRML "
2192   CAS_DATAEXCHANGE="$CAS_LDPATH -lTKXSBase -lTKIGES -lTKSTEP -lTKShHealing -lTKShHealingStd"
2193   CAS_LDFLAGS="$CAS_KERNEL $CAS_OCAF $CAS_VIEWER $CAS_MODELER $CAS_DATAEXCHANGE"  
2194   
2195   
2196 fi
2197
2198 AC_LANG_RESTORE
2199
2200 ])dnl
2201
2202
2203
2204 dnl Copyright (C) 2003  CEA/DEN, EDF R&D
2205
2206 AC_DEFUN([CHECK_HTML_GENERATORS],[
2207
2208 #AC_CHECKING(for html generators)
2209 AC_CHECKING(for doxygen)
2210
2211 doxygen_ok=yes
2212
2213 dnl were is doxygen ?
2214
2215 AC_PATH_PROG(DOXYGEN,doxygen) 
2216         
2217 if test "x$DOXYGEN" = "x"
2218 then
2219   doxygen_ok=no
2220   AC_MSG_RESULT(no)
2221   AC_MSG_WARN(doxygen not found)
2222 else
2223   dnl AC_SUBST(DOXYGEN)
2224   AC_MSG_RESULT(yes)
2225 fi
2226
2227 AC_CHECKING(for graphviz)
2228
2229 graphviz_ok=yes
2230
2231 dnl were is graphviz ?
2232
2233 AC_PATH_PROG(DOT,dot) 
2234         
2235 if test "x$DOT" = "x" ; then
2236   graphviz_ok=no
2237   AC_MSG_RESULT(no)
2238   AC_MSG_WARN(graphviz not found)
2239 else
2240   AC_MSG_RESULT(yes)
2241 fi
2242
2243 ])dnl
2244 dnl
2245
2246 # Check availability of Salome's KERNEL binary distribution
2247 #
2248 # Author : Jerome Roy (CEA, 2003)
2249 #
2250
2251 AC_DEFUN([CHECK_KERNEL],[
2252
2253 AC_CHECKING(for Kernel)
2254
2255 Kernel_ok=no
2256
2257 AC_ARG_WITH(kernel,
2258             [  --with-kernel=DIR               root directory path of KERNEL build or installation],
2259             KERNEL_DIR="$withval",KERNEL_DIR="")
2260
2261 if test "x$KERNEL_DIR" == "x" ; then
2262
2263 # no --with-kernel-dir option used
2264
2265    if test "x$KERNEL_ROOT_DIR" != "x" ; then
2266
2267     # KERNEL_ROOT_DIR environment variable defined
2268       KERNEL_DIR=$KERNEL_ROOT_DIR
2269
2270    else
2271
2272     # search Kernel binaries in PATH variable
2273       AC_PATH_PROG(TEMP, runSalome)
2274       if test "x$TEMP" != "x" ; then
2275          KERNEL_BIN_DIR=`dirname $TEMP`
2276          KERNEL_DIR=`dirname $KERNEL_BIN_DIR`
2277       fi
2278       
2279    fi
2280
2281 fi
2282
2283 if test -f ${KERNEL_DIR}/bin/salome/runSalome ; then
2284    Kernel_ok=yes
2285    AC_MSG_RESULT(Using Kernel module distribution in ${KERNEL_DIR})
2286
2287    if test "x$KERNEL_ROOT_DIR" == "x" ; then
2288       KERNEL_ROOT_DIR=${KERNEL_DIR}
2289    fi
2290    if test "x$KERNEL_SITE_DIR" == "x" ; then
2291       KERNEL_SITE_DIR=${KERNEL_ROOT_DIR}
2292    fi
2293    AC_SUBST(KERNEL_ROOT_DIR)
2294    AC_SUBST(KERNEL_SITE_DIR)
2295
2296 else
2297    AC_MSG_WARN("Cannot find compiled Kernel module distribution")
2298 fi
2299
2300 AC_MSG_RESULT(for Kernel: $Kernel_ok)
2301  
2302 ])dnl
2303  
2304
2305 # Check availability of Geom binary distribution
2306 #
2307 # Author : Nicolas REJNERI (OPEN CASCADE, 2003)
2308 #
2309
2310 AC_DEFUN([CHECK_GEOM],[
2311
2312 AC_CHECKING(for Geom)
2313
2314 Geom_ok=no
2315
2316 AC_ARG_WITH(geom,
2317             [  --with-geom=DIR root directory path of GEOM installation ],
2318             GEOM_DIR="$withval",GEOM_DIR="")
2319
2320 if test "x$GEOM_DIR" == "x" ; then
2321
2322 # no --with-geom-dir option used
2323
2324    if test "x$GEOM_ROOT_DIR" != "x" ; then
2325
2326     # GEOM_ROOT_DIR environment variable defined
2327       GEOM_DIR=$GEOM_ROOT_DIR
2328
2329    else
2330
2331     # search Geom binaries in PATH variable
2332       AC_PATH_PROG(TEMP, libGEOM_Swig.py)
2333       if test "x$TEMP" != "x" ; then
2334          GEOM_BIN_DIR=`dirname $TEMP`
2335          GEOM_DIR=`dirname $GEOM_BIN_DIR`
2336       fi
2337       
2338    fi
2339
2340 fi
2341
2342 if test -f ${GEOM_DIR}/bin/salome/libGEOM_Swig.py ; then
2343    Geom_ok=yes
2344    AC_MSG_RESULT(Using Geom module distribution in ${GEOM_DIR})
2345
2346    if test "x$GEOM_ROOT_DIR" == "x" ; then
2347       GEOM_ROOT_DIR=${GEOM_DIR}
2348    fi
2349    AC_SUBST(GEOM_ROOT_DIR)
2350
2351 else
2352    AC_MSG_WARN("Cannot find compiled Geom module distribution")
2353 fi
2354
2355 AC_MSG_RESULT(for Geom: $Geom_ok)
2356  
2357 ])dnl
2358  
2359
2360 # Check availability of SMesh binary distribution
2361 #
2362 # Author : Nicolas REJNERI (OPEN CASCADE, 2003)
2363 #
2364
2365 AC_DEFUN([CHECK_SMESH],[
2366
2367 AC_CHECKING(for SMesh)
2368
2369 SMesh_ok=no
2370
2371 AC_ARG_WITH(smesh,
2372             [  --with-smesh=DIR root directory path of SMESH installation ],
2373             SMESH_DIR="$withval",SMESH_DIR="")
2374
2375 if test "x$SMESH_DIR" == "x" ; then
2376
2377 # no --with-smesh option used
2378
2379    if test "x$SMESH_ROOT_DIR" != "x" ; then
2380
2381     # SMESH_ROOT_DIR environment variable defined
2382       SMESH_DIR=$SMESH_ROOT_DIR
2383
2384    else
2385
2386     # search SMESH binaries in PATH variable
2387       AC_PATH_PROG(TEMP, libSMESH_Swig.py)
2388       if test "x$TEMP" != "x" ; then
2389          SMESH_BIN_DIR=`dirname $TEMP`
2390          SMESH_DIR=`dirname $SMESH_BIN_DIR`
2391       fi
2392       
2393    fi
2394
2395 fi
2396
2397 if test -f ${SMESH_DIR}/bin/salome/libSMESH_Swig.py ; then
2398    SMesh_ok=yes
2399    AC_MSG_RESULT(Using SMesh module distribution in ${SMESH_DIR})
2400
2401    if test "x$SMESH_ROOT_DIR" == "x" ; then
2402       SMESH_ROOT_DIR=${SMESH_DIR}
2403    fi
2404    AC_SUBST(SMESH_ROOT_DIR)
2405
2406 else
2407    AC_MSG_WARN("Cannot find compiled SMesh module distribution")
2408 fi
2409
2410 AC_MSG_RESULT(for SMesh: $SMesh_ok)
2411  
2412 ])dnl
2413  
2414
2415 AC_DEFUN([CHECK_GHS3D],[
2416
2417 AC_REQUIRE([AC_PROG_CXX])dnl
2418 AC_REQUIRE([AC_PROG_CXXCPP])dnl
2419
2420 AC_CHECKING(for GHS3D executable)
2421
2422 AC_LANG_SAVE
2423
2424 AC_ARG_WITH(ghs3d,
2425             [  --with-ghs3d=DIR root directory path of GHS33D installation],
2426             GHS3D_HOME=$withval,GHS3D_HOME="")
2427
2428 GHS3D_ok=yes
2429 GHS3D_HOME="/dn05/salome/GHS3D/"
2430 GHS3D="/misc/dn05/salome/GHS3D/ghs3d3.1-1/bin/Linux/ghs3dV3.1-1"
2431
2432 #if test "x$GHS3D_HOME" == "x" ; then
2433 #
2434 #   if test "x$GHS3DHOME" != "x" ; then
2435 #
2436 #    # GHS3DHOME environment variable defined
2437 #      GHS3D_HOME=$GHS3DHOME
2438 #
2439 #   fi
2440 #fi
2441
2442
2443   if test "x$GHS3D_ok" == xno ; then
2444     AC_MSG_RESULT(no)
2445     AC_MSG_WARN(GHS3D libraries not found or not properly installed)
2446   else
2447     AC_MSG_RESULT(yes)
2448   fi
2449 #fi
2450
2451 ])dnl
2452