source: trunk/configure.in @ 1217

Last change on this file since 1217 was 1206, checked in by dkearney, 16 years ago

moving about.tcl to about.in.
moving simsim.tcl to simsim.in.
adding xmldiff, a script to give you teh text differences between two xml files.
reorganized simsim's flags, comparison of xmlfiles works, still need to check creating random inputs for driver files.
adding -nosim flag to rerun to avoid simulations while rerunning a run file. this flag should stay set until we get the "load and continue simulating" functionality working.
adding xmldiff to configure and makefiles

File size: 14.3 KB
Line 
1AC_INIT([Rappture], [1.1], [rappture@nanohub.org])
2AC_CONFIG_AUX_DIR(cf)
3
4#------------------------------------------------------------------------
5# Handle the --prefix=... option
6#------------------------------------------------------------------------
7
8if test "${prefix}" = "NONE"; then
9    prefix=/usr/local
10fi
11if test "${exec_prefix}" = "NONE"; then
12    exec_prefix=$prefix
13fi
14
15if test "${libdir}" != "${prefix}/lib"; then
16    LIB_SEARCH_DIRS="-L${prefix}/lib -L${libdir}"
17else
18    LIB_SEARCH_DIRS="-L${libdir}"
19fi
20
21AC_SUBST(LIB_SEARCH_DIRS)
22
23AC_PROG_INSTALL
24AC_PROG_MAKE_SET
25
26# Check for C, C++, and FORTRAN
27AC_PROG_CC
28AC_PROG_CXX
29# Avoid g95
30AC_PROG_INSTALL
31AC_PROG_RANLIB
32AC_PROG_LN_S
33AC_PROG_MKDIR_P
34
35AC_PROG_F77([g77 gfortran f77 fort77 f90 xlf xlf90 fl32])
36
37AC_LANG_C
38
39AC_HEADER_STDC
40AC_CHECK_FUNC(atol,,AC_MSG_ERROR(oops! no atol ?!?))
41
42AC_LANG_CPLUSPLUS
43
44AC_CHECK_LIB(stdc++, main,,AC_MSG_ERROR(librappture requires libstdc++))
45AC_CHECK_HEADERS(stack,,AC_MSG_WARN(STL classes missing ?))
46AC_CHECK_HEADERS(string,,AC_MSG_WARN(STL classes missing ?))
47AC_CHECK_HEADERS(list,,AC_MSG_WARN(STL classes missing ?))
48AC_CHECK_HEADERS(vector,,AC_MSG_WARN(STL classes missing ?))
49
50
51SC_CONFIG_CFLAGS
52
53make_command=""
54for m in "$MAKE" make gmake gnumake ; do
55  if test "x${m}" != "x" ; then
56    if  ( sh -c "$m --version" 2>/dev/null | grep GNU >/dev/null ) ; then
57      make_command=$m; break;
58    fi
59  fi
60done
61if test "x${make_command}" = "x" ; then
62  AC_ERROR([Requires GNU make. You can specify a version with \$MAKE])
63fi
64AC_SUBST(MAKE, ${make_command})
65
66AC_ARG_ENABLE(
67    [gui],
68    [AS_HELP_STRING([--enable-gui], [build code related to the graphical user interface @<:@default=yes@:>@])],
69    [],
70    [enable_gui=yes])
71
72ENABLE_GUI=
73if test "$enable_gui" != "no" ; then
74    ENABLE_GUI="yes"
75fi
76AC_SUBST(ENABLE_GUI)
77
78with_tclsh="check"
79AC_ARG_WITH(
80    [tclsh],
81    [AS_HELP_STRING([--with-tclsh[=DIR]],
82        [location of tclsh @<:@default=check@:>@])],
83    [],
84    [with_tclsh=check])
85
86TCLSH=
87if test "$with_tclsh" != "no" ; then
88    AC_MSG_CHECKING([for tclsh])
89    if test -x "$with_tclsh/bin/tclsh"
90    then
91        echo Found tclsh in $with_tclsh/bin/tclsh
92        TCLSH="$with_tclsh/bin/tclsh"
93    else
94        if test -x "$with_tclsh"
95        then
96            echo Found tclsh in $with_tclsh
97            TCLSH="$with_tclsh"
98        else
99            AC_PATH_PROG(TCLSH, tclsh)
100        fi
101    fi
102fi
103AC_MSG_RESULT([${TCLSH}])
104AC_SUBST(TCLSH)
105
106
107AC_ARG_WITH(
108    [matlab],
109    [AS_HELP_STRING([--with-matlab[=DIR]],
110        [location of matlab and mex compiler @<:@default=check@:>@])],
111    [with_matlab=$withval],
112    [with_matlab=yes])
113
114MCC=""
115MEX=""
116MEX_ARCH=""
117MEXEXT=""
118MATLAB=
119if test "$with_matlab" != "no" ; then
120  if test "$with_matlab" = "yes" ; then
121    AC_PATH_PROG(MATLAB, matlab)
122  else
123    AC_PATH_PROG(MATLAB, matlab, [${with_matlab}/bin:${with_matlab}])
124  fi
125fi
126
127if test "x$MATLAB" != "x" ; then
128  # Found matlab.  May be a symlink to the real binary.  Run "matlab -e"
129  # to tell where matlab is installed.
130
131  matlab_bindir=`${MATLAB} -e | grep "MATLAB=" | sed s/MATLAB=//`/bin
132
133  # Now see if we can find "mex" or "mexext" there.
134  AC_PATH_PROG(MEX, mex, [${matlab_bindir}/mex])
135  AC_PATH_PROG(MEXEXT, mexext, [${matlab_bindir}/mexext])
136
137  # Run "mexext" to get the expected module extension for this platform.
138  AC_MSG_CHECKING([for mex extension])
139  if test "x$MEXEXT" != "x" ; then
140    MEXEXT=`$MEXEXT`
141  else
142    MEXEXT="mexglx"
143  fi
144  AC_MSG_RESULT([$MEXEXT])
145  AC_PATH_PROG(MCC, mcc, [${matlab_bindir}])
146  AC_MSG_CHECKING([for mcc extension])
147fi
148
149AC_SUBST(MCC)
150AC_SUBST(MEX)
151AC_SUBST(MATLAB)
152AC_SUBST(MEX_ARCH)
153AC_SUBST(MEXEXT)
154
155AC_ARG_WITH(
156    [octave],
157    [AS_HELP_STRING([--with-octave[=DIR]],
158        [location of octave compiler MKOCTFILE @<:@default=check@:>@])],
159    [with_octave=$withval],
160    [with_octave=yes])
161
162MKOCTFILE=
163if test "$with_octave" != "no" ; then
164  if test "$with_octave" = "yes" ; then
165    AC_PATH_PROG(MKOCTFILE, mkoctfile)
166  else
167    AC_PATH_PROG(MKOCTFILE, mkoctfile,
168        [${with_octave}/bin/mkoctfile:${with_octave}])
169  fi
170fi
171AC_SUBST(MKOCTFILE)
172
173
174AC_ARG_WITH(
175    [perl],
176    [AS_HELP_STRING([--with-perl[=DIR]], [location of perl @<:@default=check@:>@])],
177    [],
178    [with_perl=check])
179
180PERL=
181PERL_INCLUDES=
182PERL_ARCHLIB=
183PERL_ARCHLIBEXP=
184PERL_VERSION=
185PERL_VENDORLIB=
186PERL_PRIVLIB=
187PERL_CPPFLAGS=
188PERL_CCFlAGS=
189PERL_VERSION_RV=
190PERL_LIBSPEC=
191if test "$with_perl" != "no" ; then
192  AC_MSG_CHECKING([for perl])
193  if test "$with_perl" != "yes" ; then
194    AC_PATH_PROG(PERL, perl, [$with_perl/bin:$with_perl])
195  else
196    AC_PATH_PROG(PERL, perl)
197  fi
198  if test "x${PERL}" != "x" ; then
199    PERL_ARCHLIB=`${PERL} -MConfig -e 'print $Config{archlib}'`
200    PERL_VERSION=`${PERL} -MConfig -e 'print $Config{version}'`
201    PERL_CCFLAGS=`${PERL} -MConfig -e 'print $Config{ccflags}'`
202    PERL_CPPFLAGS=`${PERL} -MConfig -e 'print $Config{cppflags}'`
203    PERL_VENDORLIB=`${PERL} -MConfig -e 'print $Config{vendorlib}'`
204    PERL_PRIVLIB=`${PERL} -MConfig -e 'print $Config{privlib}'`
205    PERL_INSTALLARCHLIB=`${PERL} -MConfig -e 'print $Config{installarchlib}'`
206    PERL_ARCHLIBEXP=`${PERL} -MConfig -e 'print $Config{archlibexp}'`
207    PERL_VERSION_RV=`echo ${PERL_VERSION} | cut -d'.' -f1-2`
208    echo perllib="${PERL_ARCHLIBEXP}/CORE/libperl${SHLIB_SUFFIX}"
209
210    # libperl may or may not be installed.  Check for its existence.
211    if test -f "${PERL_ARCHLIBEXP}/CORE/libperl${SHLIB_SUFFIX}" ; then
212      PERL_LIBSPEC="-L${PERL_ARCHLIBEXP}/CORE -lperl"
213    fi
214  fi
215fi
216AC_MSG_RESULT([${PERL}])
217AC_SUBST(PERL)
218AC_SUBST(PERL_INCLUDES)
219AC_SUBST(PERL_ARCHLIB)
220AC_SUBST(PERL_ARCHLIBEXP)
221AC_SUBST(PERL_VERSION)
222AC_SUBST(PERL_CCFLAGS)
223AC_SUBST(PERL_CPPFLAGS)
224AC_SUBST(PERL_VENDORLIB)
225AC_SUBST(PERL_PRIVLIB)
226AC_SUBST(PERL_INSTALLARCHLIB)
227AC_SUBST(PERL_VERSION_RV)
228AC_SUBST(PERL_LIBSPEC)
229
230PYTHON=""
231PYTHON_CFLAGS=""
232PYTHON_CPPFLAGS=""
233HAVE_PYTHON_DISTUTILS=""
234PYTHON_INCLUDES=""
235PYTHON_LDFLAGS=""
236PYTHON_LIB=""
237PYTHON_LIBDIR=""
238PYTHON_SITE_DIR=""
239PYTHON_SITE_PACKAGES=""
240PYTHON_VERSION=""
241pythondir=""
242
243AC_ARG_WITH([python],
244    [AS_HELP_STRING([--with-python[=DIR]],[location of python @<:@default=check@:>@])],
245    [],
246    [with_python=check])
247
248if test "$with_python" != "no" ; then
249  AC_MSG_CHECKING([for python])
250  if test -x "$with_python/bin/python"; then
251    echo Found python in $with_python/bin/python
252    PYTHON="$with_python/bin/python"
253  elif test -x "$with_python"; then
254    echo Found python in $with_python
255    PYTHON="$with_python"
256  else
257    AC_PATH_PROG(PYTHON, python python2.5 python2.4 python2.3 python2.2 python2.1 python2.0 python1.6 python1.5)
258  fi
259  if test "x${PYTHON}" != "x"; then
260    PYTHON_VERSION=`$PYTHON -c "import sys; print sys.version[[0:3]]"`
261    echo Using python version $PYTHON_VERSION
262  fi
263  if test "x${PYTHON_VERSION}" != "x"; then
264    if test -r $with_python/include/python$PYTHON_VERSION/Python.h -a \
265     -d $with_python/lib/python$PYTHON_VERSION/site-packages; then
266      PYTHON_INCLUDES=$with_python/include/python$PYTHON_VERSION
267      PYTHON_SITE_PACKAGES=$with_python/lib/python$PYTHON_VERSION/site-packages
268    else
269      if test -r $prefix/include/python$PYTHON_VERSION/Python.h; then
270        PYTHON_INCLUDES='$(prefix)/include/python$(PYTHON_VERSION)'
271        PYTHON_SITE_PACKAGES='$(libdir)/python$(PYTHON_VERSION)/site-packages'
272      else
273        if test -r /usr/include/python$PYTHON_VERSION/Python.h; then
274          PYTHON_INCLUDES=/usr/include/python$PYTHON_VERSION
275          PYTHON_SITE_PACKAGES='$(libdir)/python$(PYTHON_VERSION)/site-packages'
276        else
277          echo could not find python$PYTHON_VERSION/Python.h
278        fi
279      fi
280      if test ! -d "$PYTHON_SITE_PACKAGES"; then
281        PYTHON_SITE_PACKAGES=`$PYTHON -c "from distutils import sysconfig; print sysconfig.get_python_lib()"`
282      fi
283    fi
284  fi
285  if test "x$with_python" != "x" ;  then
286    pythondir='$(PYTHON_SITE_PACKAGES)'
287  else
288    pythondir='$(libdir)/python${PYTHON_VERSION}/site-packages'
289  fi
290
291  AC_MSG_CHECKING([for python distutils])
292  ${PYTHON} -c "from distutils.core import setup; setup(name='test')" \
293        build build_ext 2>&1 > /dev/null
294  if test $? = 0 ; then
295    HAVE_PYTHON_DISTUTILS="yes"
296  else
297    HAVE_PYTHON_DISTUTILS="no"
298  fi
299  AC_MSG_RESULT([$HAVE_PYTHON_DISTUTILS])
300
301  if test "${HAVE_PYTHON_DISTUTILS}" = "yes"; then
302    #
303    # Check for Python include path
304    #
305    AC_MSG_CHECKING([for Python include path])
306    if test "x${PYTHON_CPPFLAGS}" = "x"; then
307      incdir_path=`${PYTHON} -c "import distutils.sysconfig; \
308       print distutils.sysconfig.get_python_inc();"`
309      if test -n "${incdir}"; then
310        python_path="-I${incdir}"
311      fi
312      PYTHON_CPPFLAGS=$python_path
313    fi
314    AC_MSG_RESULT([$PYTHON_CPPFLAGS])
315    AC_SUBST([PYTHON_CPPFLAGS])
316    #
317    # python distutils found, get settings from python directly
318    #
319    AC_MSG_CHECKING([location of site-packages])
320    PYTHON_SITE_DIR="`${PYTHON} -c 'from distutils import sysconfig; print sysconfig.get_python_lib(0);'`"
321
322    PYTHON_CFLAGS="`$PYTHON -c 'from distutils import sysconfig; flags = [[\"-I\" + sysconfig.get_python_inc(0), \"-I\" + sysconfig.get_python_inc(1), \" \".join(sysconfig.get_config_var(\"CFLAGS\").split())]]; print \" \".join(flags);'`"
323    PYTHON_LDFLAGS="`$PYTHON -c 'from distutils import sysconfig; libs = sysconfig.get_config_var(\"LIBS\").split() + sysconfig.get_config_var(\"SYSLIBS\").split(); libs.append(\"-lpython\"+sysconfig.get_config_var(\"VERSION\")); print \" \".join(libs);'`"
324    PYTHON_LIB="`$PYTHON -c 'from distutils import sysconfig; print \"python\" + sysconfig.get_config_var(\"VERSION\");'`"
325    PYTHON_LIBDIR="`$PYTHON -c 'from distutils import sysconfig; print sysconfig.get_config_var(\"LIBDIR\");'`"
326  fi
327fi 
328AC_SUBST(pythondir)
329
330AC_SUBST(PYTHON)
331AC_SUBST(PYTHON_VERSION)
332AC_SUBST(PYTHON_INCLUDES)
333AC_SUBST(PYTHON_SITE_PACKAGES)
334AC_SUBST(HAVE_PYTHON_DISTUTILS)
335
336rappture_with_ruby="yes"
337
338RUBY=""
339RUBY_DEV_PKG="no"
340
341AC_ARG_WITH(ruby,
342  AS_HELP_STRING([--with-ruby=PATH], [absolute path to ruby executable]),
343  [rappture_with_ruby=$with_val])
344if test "${rappture_with_ruby}" != "no" ; then
345  if test "${rappture_with_ruby}" = "yes" ; then
346    AC_PATH_PROG(RUBY, ruby)
347  else
348    AC_PATH_PROG(RUBY, ruby,
349      [${rappture_with_ruby}/bin/ruby:${rappture_with_ruby}])
350  fi
351fi
352AC_SUBST(RUBY)
353
354RUBY_VERSION_RV=
355RUBY_PLATFORM=
356if test "x${RUBY}" != "x" ; then
357  AX_PROG_RUBY_VERSION
358  RUBY_VERSION_RV=`echo ${RUBY_VERSION} | cut -d'.' -f1-2`
359  RUBY_PLATFORM=`ruby -e 'puts RUBY_PLATFORM'`
360  ac_mkmf_result=`${RUBY} -r mkmf -e ";" 2>&1`
361  if test -z "$ac_mkmf_result"; then
362    HAVE_RUBY_DEVEL="yes"
363    AX_RUBY_DEV_FLAGS([${RUBY}])
364  fi
365fi
366AC_SUBST(HAVE_RUBY_DEVEL)
367AC_SUBST(RUBY_VERSION_RV)
368AC_SUBST(RUBY_PLATFORM)
369
370RP_BASE=`pwd`
371AC_SUBST(RP_BASE)
372
373SC_ENABLE_SHARED
374
375#--------------------------------------------------------------------
376# This macro figures out what flags to use with the compiler/linker
377# when building shared/static debug/optimized objects.  This information
378# is all taken from the tclConfig.sh file.
379#--------------------------------------------------------------------
380
381AC_SUBST(CFLAGS_DEBUG)
382AC_SUBST(CFLAGS_OPTIMIZE)
383AC_SUBST(STLIB_LD)
384AC_SUBST(SHLIB_LD)
385AC_SUBST(SHLIB_CFLAGS)
386AC_SUBST(SHLIB_LDFLAGS)
387AC_SUBST(SHLIB_SUFFIX)
388
389if test -f "${exec_prefix}/lib/tclConfig.sh" ; then
390  . ${exec_prefix}/lib/tclConfig.sh
391fi
392if test -f "${exec_prefix}/lib/tclConfig.sh" ; then
393  . ${exec_prefix}/lib/tkConfig.sh     
394fi
395AC_SUBST(TCL_VERSION)
396AC_SUBST(TK_VERSION)
397
398#--------------------------------------------------------------------
399# Set the default compiler switches based on the --enable-symbols
400# option.
401#--------------------------------------------------------------------
402
403SC_ENABLE_SYMBOLS
404
405if test "${SHARED_BUILD}" = "1" ; then
406    CFLAGS='${CFLAGS_DEFAULT} ${CFLAGS_WARNING} ${SHLIB_CFLAGS}'
407else
408    CFLAGS='${CFLAGS_DEFAULT} ${CFLAGS_WARNING}'
409fi
410
411ac_configure_args="--disable-threads --enable-shared"
412AC_CONFIG_SUBDIRS( [packages/optimizer/src] )
413
414dnl read Makefile.in and write Makefile
415AC_OUTPUT( [
416    Makefile
417    packages/Makefile
418    src/Makefile
419    src/core/Makefile
420    src/core2/Makefile
421    src/objects/Makefile
422    gui/Makefile
423    gui/apps/Makefile
424    gui/apps/about
425    gui/apps/rappture
426    gui/apps/rappture-csh.env
427    gui/apps/rappture.env
428    gui/apps/rerun
429    gui/apps/simsim
430    gui/apps/xmldiff
431    gui/pkgIndex.tcl
432    gui/scripts/Makefile
433    lang/Makefile
434    lang/perl/Makefile
435    lang/perl/Makefile.PL
436    lang/python/Makefile
437    lang/python/setup.py
438    lang/matlab/Makefile
439    lang/octave/Makefile
440    lang/ruby/Makefile
441    lang/ruby/build.rb
442    lang/tcl/Makefile
443    lang/tcl/pkgIndex.tcl
444    lang/tcl/src/Makefile
445    lang/tcl/scripts/Makefile
446    lang/tcl/tests/Makefile
447    lib/Makefile
448    examples/3D/Makefile
449    examples/Makefile
450    examples/app-fermi/2.0/Makefile
451    examples/app-fermi/Makefile
452    examples/app-fermi/cee/Makefile
453    examples/app-fermi/fortran/Makefile
454    examples/app-fermi/matlab/Makefile
455    examples/app-fermi/octave/Makefile
456    examples/app-fermi/perl/Makefile
457    examples/app-fermi/python/Makefile
458    examples/app-fermi/ruby/Makefile
459    examples/app-fermi/tcl/Makefile
460    examples/app-fermi/wrapper/Makefile
461    examples/app-fermi/wrapper/cee/Makefile
462    examples/app-fermi/wrapper/python/Makefile
463    examples/app-fermi/wrapper/tcl/Makefile
464    examples/c-example/Makefile
465    examples/canvas/Makefile
466    examples/demo.bash
467    examples/graph/Makefile
468    examples/objects/Makefile
469    examples/objects/dxWriter/Makefile
470    examples/objects/floatBuffer/Makefile
471    examples/zoo/Makefile
472    examples/zoo/binary/Makefile
473    examples/zoo/boolean/Makefile
474    examples/zoo/choice/Makefile
475    examples/zoo/cloud/Makefile
476    examples/zoo/cloud/matlab/Makefile
477    examples/zoo/curve/Makefile
478    examples/zoo/enable/Makefile
479    examples/zoo/field/Makefile
480    examples/zoo/group/Makefile
481    examples/zoo/image/Makefile
482    examples/zoo/image/docs/Makefile
483    examples/zoo/image/examples/Makefile
484    examples/zoo/integer/Makefile
485    examples/zoo/integer2/Makefile
486    examples/zoo/loader/Makefile
487    examples/zoo/loader/examples/Makefile
488    examples/zoo/log/Makefile
489    examples/zoo/note/Makefile
490    examples/zoo/note/docs/Makefile
491    examples/zoo/number/Makefile
492    examples/zoo/number2/Makefile
493    examples/zoo/phase/Makefile
494    examples/zoo/sequence/Makefile
495    examples/zoo/sequence/examples/Makefile
496    examples/zoo/string/Makefile
497    examples/zoo/structure/Makefile
498    examples/zoo/structure/examples/Makefile
499    examples/zoo/table/Makefile
500    test/Makefile
501    test/src/Makefile
502])
Note: See TracBrowser for help on using the repository browser.