source: trunk/configure.in @ 1125

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

fix of 64bit matlab extensions

File size: 13.5 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(MATLAB, matlab)
120  else
121    AC_PATH_PROG(MATLAB, matlab, [${with_matlab}/bin:${with_matlab}])
122  fi
123fi
124
125if test "x$MATLAB" != "x" ; then
126  matlab_bindir=AS_DIRNAME(${MATLAB})
127  AC_PATH_PROG(MEX, mex, [${matlab_bindir}])
128  AC_PATH_PROG(MEXEXT, mexext, [${matlab_bindir}])
129  AC_MSG_CHECKING([for mex extension])
130  if test "x$MEXEXT" != "x" ; then
131    mexext=`$MEXEXT`
132  else
133    mexext="mexglx"
134  fi
135  AC_MSG_RESULT([$mexext])
136  MEXEXT=$mexext
137fi
138
139AC_SUBST(MEX)
140AC_SUBST(MATLAB)
141AC_SUBST(MEX_ARCH)
142AC_SUBST(MEXEXT)
143
144AC_ARG_WITH(
145    [octave],
146    [AS_HELP_STRING([--with-octave[=DIR]],
147        [location of octave compiler MKOCTFILE @<:@default=check@:>@])],
148    [with_octave=$withval],
149    [with_octave=yes])
150
151MKOCTFILE=
152if test "$with_octave" != "no" ; then
153  if test "$with_octave" = "yes" ; then
154    AC_PATH_PROG(MKOCTFILE, mkoctfile)
155  else
156    AC_PATH_PROG(MKOCTFILE, mkoctfile,
157        [${with_octave}/bin/mkoctfile:${with_octave}])
158  fi
159fi
160AC_SUBST(MKOCTFILE)
161
162
163AC_ARG_WITH(
164    [perl],
165    [AS_HELP_STRING([--with-perl[=DIR]], [location of perl @<:@default=check@:>@])],
166    [],
167    [with_perl=check])
168
169PERL=
170PERL_INCLUDES=
171PERL_ARCHLIB=
172PERL_ARCHLIBEXP=
173PERL_VERSION=
174PERL_VENDORLIB=
175PERL_PRIVLIB=
176PERL_CPPFLAGS=
177PERL_CCFlAGS=
178PERL_VERSION_RV=
179if test "$with_perl" != "no" ; then
180    AC_MSG_CHECKING([for perl])
181    if test "$with_perl" != "yes" ; then
182      AC_PATH_PROG(PERL, perl, [$with_perl/bin:$with_perl])
183    else
184      AC_PATH_PROG(PERL, perl)
185    fi
186    if test "x${PERL}" != "x" ; then
187      PERL_ARCHLIB=`${PERL} -MConfig -e 'print $Config{archlib}'`
188      PERL_VERSION=`${PERL} -MConfig -e 'print $Config{version}'`
189      PERL_CCFLAGS=`${PERL} -MConfig -e 'print $Config{ccflags}'`
190      PERL_CPPFLAGS=`${PERL} -MConfig -e 'print $Config{cppflags}'`
191      PERL_VENDORLIB=`${PERL} -MConfig -e 'print $Config{vendorlib}'`
192      PERL_PRIVLIB=`${PERL} -MConfig -e 'print $Config{privlib}'`
193      PERL_INSTALLARCHLIB=`${PERL} -MConfig -e 'print $Config{installarchlib}'`
194      PERL_ARCHLIBEXP=`${PERL} -MConfig -e 'print $Config{archlibexp}'`
195      PERL_VERSION_RV=`echo ${PERL_VERSION} | cut -d'.' -f1-2`
196    fi
197fi
198AC_MSG_RESULT([${PERL}])
199AC_SUBST(PERL)
200AC_SUBST(PERL_INCLUDES)
201AC_SUBST(PERL_ARCHLIB)
202AC_SUBST(PERL_ARCHLIBEXP)
203AC_SUBST(PERL_VERSION)
204AC_SUBST(PERL_CCFLAGS)
205AC_SUBST(PERL_CPPFLAGS)
206AC_SUBST(PERL_VENDORLIB)
207AC_SUBST(PERL_PRIVLIB)
208AC_SUBST(PERL_INSTALLARCHLIB)
209AC_SUBST(PERL_VERSION_RV)
210
211PYTHON=""
212PYTHON_CFLAGS=""
213PYTHON_CPPFLAGS=""
214HAVE_PYTHON_DISTUTILS=""
215PYTHON_INCLUDES=""
216PYTHON_LDFLAGS=""
217PYTHON_LIB=""
218PYTHON_LIBDIR=""
219PYTHON_SITE_DIR=""
220PYTHON_SITE_PACKAGES=""
221PYTHON_VERSION=""
222pythondir=""
223
224AC_ARG_WITH([python],
225    [AS_HELP_STRING([--with-python[=DIR]],[location of python @<:@default=check@:>@])],
226    [],
227    [with_python=check])
228
229if test "$with_python" != "no" ; then
230  AC_MSG_CHECKING([for python])
231  if test -x "$with_python/bin/python"; then
232    echo Found python in $with_python/bin/python
233    PYTHON="$with_python/bin/python"
234  elif test -x "$with_python"; then
235    echo Found python in $with_python
236    PYTHON="$with_python"
237  else
238    AC_PATH_PROG(PYTHON, python python2.5 python2.4 python2.3 python2.2 python2.1 python2.0 python1.6 python1.5)
239  fi
240  if test "x${PYTHON}" != "x"; then
241    PYTHON_VERSION=`$PYTHON -c "import sys; print sys.version[[0:3]]"`
242    echo Using python version $PYTHON_VERSION
243  fi
244  if test "x${PYTHON_VERSION}" != "x"; then
245    if test -r $with_python/include/python$PYTHON_VERSION/Python.h -a \
246     -d $with_python/lib/python$PYTHON_VERSION/site-packages; then
247      PYTHON_INCLUDES=$with_python/include/python$PYTHON_VERSION
248      PYTHON_SITE_PACKAGES=$with_python/lib/python$PYTHON_VERSION/site-packages
249    else
250      if test -r $prefix/include/python$PYTHON_VERSION/Python.h; then
251        PYTHON_INCLUDES='$(prefix)/include/python$(PYTHON_VERSION)'
252        PYTHON_SITE_PACKAGES='$(libdir)/python$(PYTHON_VERSION)/site-packages'
253      else
254        if test -r /usr/include/python$PYTHON_VERSION/Python.h; then
255          PYTHON_INCLUDES=/usr/include/python$PYTHON_VERSION
256          PYTHON_SITE_PACKAGES='$(libdir)/python$(PYTHON_VERSION)/site-packages'
257        else
258          echo could not find python$PYTHON_VERSION/Python.h
259        fi
260      fi
261      if test ! -d "$PYTHON_SITE_PACKAGES"; then
262        PYTHON_SITE_PACKAGES=`$PYTHON -c "from distutils import sysconfig; print sysconfig.get_python_lib()"`
263      fi
264    fi
265  fi
266  if test "x$with_python" != "x" ;  then
267    pythondir='$(PYTHON_SITE_PACKAGES)'
268  else
269    pythondir='$(libdir)/python${PYTHON_VERSION}/site-packages'
270  fi
271
272  AC_MSG_CHECKING([for python distutils])
273  ${PYTHON} -c "from distutils.core import setup; setup(name='test')" \
274        build build_ext 2>&1 > /dev/null
275  if test $? = 0 ; then
276    HAVE_PYTHON_DISTUTILS="yes"
277  else
278    HAVE_PYTHON_DISTUTILS="no"
279  fi
280  AC_MSG_RESULT([$HAVE_PYTHON_DISTUTILS])
281
282  if test "${HAVE_PYTHON_DISTUTILS}" = "yes"; then
283    #
284    # Check for Python include path
285    #
286    AC_MSG_CHECKING([for Python include path])
287    if test "x${PYTHON_CPPFLAGS}" = "x"; then
288      incdir_path=`${PYTHON} -c "import distutils.sysconfig; \
289       print distutils.sysconfig.get_python_inc();"`
290      if test -n "${incdir}"; then
291        python_path="-I${incdir}"
292      fi
293      PYTHON_CPPFLAGS=$python_path
294    fi
295    AC_MSG_RESULT([$PYTHON_CPPFLAGS])
296    AC_SUBST([PYTHON_CPPFLAGS])
297    #
298    # python distutils found, get settings from python directly
299    #
300    AC_MSG_CHECKING([location of site-packages])
301    PYTHON_SITE_DIR="`${PYTHON} -c 'from distutils import sysconfig; print sysconfig.get_python_lib(0);'`"
302
303    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);'`"
304    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);'`"
305    PYTHON_LIB="`$PYTHON -c 'from distutils import sysconfig; print \"python\" + sysconfig.get_config_var(\"VERSION\");'`"
306    PYTHON_LIBDIR="`$PYTHON -c 'from distutils import sysconfig; print sysconfig.get_config_var(\"LIBDIR\");'`"
307  fi
308fi 
309AC_SUBST(pythondir)
310
311AC_SUBST(PYTHON)
312AC_SUBST(PYTHON_VERSION)
313AC_SUBST(PYTHON_INCLUDES)
314AC_SUBST(PYTHON_SITE_PACKAGES)
315AC_SUBST(HAVE_PYTHON_DISTUTILS)
316
317rappture_with_ruby="yes"
318
319RUBY=""
320RUBY_DEV_PKG="no"
321
322AC_ARG_WITH(ruby,
323  AS_HELP_STRING([--with-ruby=PATH], [absolute path to ruby executable]),
324  [rappture_with_ruby=$with_val])
325if test "${rappture_with_ruby}" != "no" ; then
326  if test "${rappture_with_ruby}" = "yes" ; then
327    AC_PATH_PROG(RUBY, ruby)
328  else
329    AC_PATH_PROG(RUBY, ruby,
330      [${rappture_with_ruby}/bin/ruby:${rappture_with_ruby}])
331  fi
332fi
333AC_SUBST(RUBY)
334
335RUBY_VERSION_RV=
336RUBY_PLATFORM=
337if test "x${RUBY}" != "x" ; then
338  AX_PROG_RUBY_VERSION
339  RUBY_VERSION_RV=`echo ${RUBY_VERSION} | cut -d'.' -f1-2`
340  RUBY_PLATFORM=`ruby -e 'puts RUBY_PLATFORM'`
341  ac_mkmf_result=`${RUBY} -r mkmf -e ";" 2>&1`
342  if test -z "$ac_mkmf_result"; then
343    HAVE_RUBY_DEVEL="yes"
344    AX_RUBY_DEV_FLAGS([${RUBY}])
345  fi
346fi
347AC_SUBST(HAVE_RUBY_DEVEL)
348AC_SUBST(RUBY_VERSION_RV)
349AC_SUBST(RUBY_PLATFORM)
350
351RP_BASE=`pwd`
352AC_SUBST(RP_BASE)
353
354SC_ENABLE_SHARED
355
356#--------------------------------------------------------------------
357# This macro figures out what flags to use with the compiler/linker
358# when building shared/static debug/optimized objects.  This information
359# is all taken from the tclConfig.sh file.
360#--------------------------------------------------------------------
361
362AC_SUBST(CFLAGS_DEBUG)
363AC_SUBST(CFLAGS_OPTIMIZE)
364AC_SUBST(STLIB_LD)
365AC_SUBST(SHLIB_LD)
366AC_SUBST(SHLIB_CFLAGS)
367AC_SUBST(SHLIB_LDFLAGS)
368AC_SUBST(SHLIB_SUFFIX)
369
370. ${exec_prefix}/lib/tclConfig.sh
371. ${exec_prefix}/lib/tkConfig.sh
372AC_SUBST(TCL_VERSION)
373AC_SUBST(TK_VERSION)
374
375#--------------------------------------------------------------------
376# Set the default compiler switches based on the --enable-symbols
377# option.
378#--------------------------------------------------------------------
379
380SC_ENABLE_SYMBOLS
381
382if test "${SHARED_BUILD}" = "1" ; then
383    CFLAGS='${CFLAGS_DEFAULT} ${CFLAGS_WARNING} ${SHLIB_CFLAGS}'
384else
385    CFLAGS='${CFLAGS_DEFAULT} ${CFLAGS_WARNING}'
386fi
387
388ac_configure_args="--disable-threads --enable-shared"
389AC_CONFIG_SUBDIRS( [packages/optimizer/src] )
390
391dnl read Makefile.in and write Makefile
392AC_OUTPUT( [
393    Makefile
394    packages/Makefile
395    src/Makefile
396    src/core/Makefile
397    src/core2/Makefile
398    src/objects/Makefile
399    gui/Makefile
400    gui/apps/Makefile
401    gui/apps/about
402    gui/apps/rappture
403    gui/apps/rappture.env
404    gui/apps/simsim
405    gui/pkgIndex.tcl
406    gui/scripts/Makefile
407    lang/Makefile
408    lang/perl/Makefile
409    lang/perl/Makefile.PL
410    lang/python/Makefile
411    lang/python/setup.py
412    lang/matlab/Makefile
413    lang/octave/Makefile
414    lang/ruby/Makefile
415    lang/ruby/build.rb
416    lang/tcl/Makefile
417    lang/tcl/pkgIndex.tcl
418    lang/tcl/src/Makefile
419    lang/tcl/scripts/Makefile
420    lang/tcl/tests/Makefile
421    lib/Makefile
422    examples/3D/Makefile
423    examples/Makefile
424    examples/app-fermi/2.0/Makefile
425    examples/app-fermi/Makefile
426    examples/app-fermi/cee/Makefile
427    examples/app-fermi/fortran/Makefile
428    examples/app-fermi/matlab/Makefile
429    examples/app-fermi/octave/Makefile
430    examples/app-fermi/perl/Makefile
431    examples/app-fermi/python/Makefile
432    examples/app-fermi/ruby/Makefile
433    examples/app-fermi/tcl/Makefile
434    examples/app-fermi/wrapper/Makefile
435    examples/app-fermi/wrapper/cee/Makefile
436    examples/app-fermi/wrapper/python/Makefile
437    examples/app-fermi/wrapper/tcl/Makefile
438    examples/c-example/Makefile
439    examples/canvas/Makefile
440    examples/demo.bash
441    examples/graph/Makefile
442    examples/objects/Makefile
443    examples/objects/dxWriter/Makefile
444    examples/objects/floatBuffer/Makefile
445    examples/zoo/Makefile
446    examples/zoo/binary/Makefile
447    examples/zoo/boolean/Makefile
448    examples/zoo/choice/Makefile
449    examples/zoo/cloud/Makefile
450    examples/zoo/cloud/matlab/Makefile
451    examples/zoo/curve/Makefile
452    examples/zoo/enable/Makefile
453    examples/zoo/field/Makefile
454    examples/zoo/group/Makefile
455    examples/zoo/image/Makefile
456    examples/zoo/image/docs/Makefile
457    examples/zoo/image/examples/Makefile
458    examples/zoo/integer/Makefile
459    examples/zoo/integer2/Makefile
460    examples/zoo/loader/Makefile
461    examples/zoo/loader/examples/Makefile
462    examples/zoo/log/Makefile
463    examples/zoo/note/Makefile
464    examples/zoo/note/docs/Makefile
465    examples/zoo/number/Makefile
466    examples/zoo/number2/Makefile
467    examples/zoo/phase/Makefile
468    examples/zoo/sequence/Makefile
469    examples/zoo/sequence/examples/Makefile
470    examples/zoo/string/Makefile
471    examples/zoo/structure/Makefile
472    examples/zoo/structure/examples/Makefile
473    examples/zoo/table/Makefile
474    test/Makefile
475    test/src/Makefile
476])
Note: See TracBrowser for help on using the repository browser.