source: trunk/configure.in @ 1111

Last change on this file since 1111 was 1111, checked in by gah, 16 years ago

nanovis/heightmap update

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