source: trunk/configure.in @ 563

Last change on this file since 563 was 563, checked in by dkearney, 14 years ago

small adjustments to gauge.tcl to fix errors in number and units recognition.
adjusted configure.in and makefiles to allow user to specify the architecture
they would like to use for compiling matlab bindings. also adjusted the main
makefile not to try to compile bindings for languages it cannot find on the system.

File size: 6.1 KB
Line 
1AC_INIT(rappture, 1.1, rappture@nanohub.org)
2
3VERSION=0.0.1
4
5#------------------------------------------------------------------------
6# Handle the --prefix=... option
7#------------------------------------------------------------------------
8
9if test "${prefix}" = "NONE"; then
10    prefix=/usr/local
11fi
12if test "${exec_prefix}" = "NONE"; then
13    exec_prefix=$prefix
14fi
15
16# AC_PROG_INSTALL
17AC_PROG_MAKE_SET
18
19dnl find and test the C compiler
20AC_PROG_CC
21AC_LANG_C
22
23AC_HEADER_STDC
24AC_CHECK_FUNC(atol,,AC_MSG_ERROR(oops! no atol ?!?))
25
26AC_PROG_CXX
27AC_LANG_CPLUSPLUS
28
29AC_CHECK_LIB(stdc++, main,,AC_MSG_ERROR(librappture requires libstdc++))
30AC_CHECK_HEADERS(stack,,AC_MSG_WARN(STL classes missing ?))
31AC_CHECK_HEADERS(string,,AC_MSG_WARN(STL classes missing ?))
32AC_CHECK_HEADERS(list,,AC_MSG_WARN(STL classes missing ?))
33AC_CHECK_HEADERS(vector,,AC_MSG_WARN(STL classes missing ?))
34
35AC_PROG_F77([f77 fort77 g77 f90 xlf xlf90 fl32])
36
37AC_ARG_WITH(matlab, [  --with-matlab[=DIR]         Build Matlab bindings if MEX compiler is found])
38AC_ARG_WITH(matlab_arch, [  --with-matlab-arch[=ARCH]         Build Matlab bindings for ARCH architecture])
39dnl AC_CHECK_PROG(MEX, mex, mex, false)
40MEX=
41MEX_ARCH=
42if test "$with_matlab" != "no" ; then
43    dnl WITH_MATLAB = "yes"
44    if test -x "$with_matlab/bin/mex"
45    then
46        echo Found matlab in $with_matlab/bin/mex
47        MEX="$with_matlab/bin/mex"
48    else
49        if test -x "$with_matlab"
50        then
51            echo Found mex in $with_matlab
52            MEX="$with_matlab"
53        else
54            AC_PATH_PROG(MEX, mex)
55        fi
56    fi
57fi
58if test "x$with_matlab_arch" != "x" ; then
59    MEX_ARCH="-arch=$with_matlab_arch"
60fi
61dnl AC_CHECK_PROG(MEX, mex, mex, false)
62dnl AM_CONDITIONAL(WITH_MATLAB, test x$MEX != x)
63
64AC_ARG_WITH(octave, [  --with-octave[=DIR]         Build Octave bindings if MKOCTFILE compiler is found])
65dnl AC_CHECK_PROG(MKOCTFILE, mkoctfile, mkoctfile, false)
66MKOCTFILE=
67if test "$with_octave" != "no" ; then
68    if test -x "$with_octave/bin/mkoctfile"
69    then
70        echo Found octave in $with_octave/bin/mkoctfile
71        MKOCTFILE="$with_octave/bin/mkoctfile"
72    else
73        if test -x "$with_octave"
74        then
75            echo Found mkoctfile in $with_octave
76            MKOCTFILE="$with_octave"
77        else
78            AC_PATH_PROG(MKOCTFILE, mkoctfile)
79        fi
80    fi
81fi
82dnl AM_CONDITIONAL(WITH_OCTAVE, test x$MKOCTFILE != x)
83
84
85dnl perl and python check borrowed from
86dnl http://www.opensource.apple.com/darwinsource/Current/libxslt-8.1/libxslt/configure.in
87dnl
88dnl Perl is just needed for generating some data for XSLtmark
89dnl
90
91AC_ARG_WITH(perl, [  --with-perl[=DIR]         Build Perl bindings if found])
92dnl AC_CHECK_PROG(PERL, perl, perl, false)
93dnl AM_CONDITIONAL(WITH_PERL, test "$PERL" != "false")
94PERL=
95PERL_INCLUDES=
96if test "$with_perl" != "no" ; then
97    if test -x "$with_perl/bin/perl"
98    then
99        echo Found perl in $with_perl/bin/perl
100        PERL="$with_perl/bin/perl"
101    else
102        if test -x "$with_perl"
103        then
104            echo Found perl in $with_perl
105            PERL="$with_perl"
106        else
107            AC_PATH_PROG(PERL, perl)
108        fi
109    fi
110fi
111dnl AM_CONDITIONAL(WITH_PERL, test x$PERL != x)
112
113dnl
114dnl check for python
115dnl
116
117PYTHON=
118PYTHON_VERSION=
119PYTHON_INCLUDES=
120PYTHON_SITE_PACKAGES=
121pythondir=
122AC_ARG_WITH(python, [  --with-python[=DIR]       Build Python bindings if found])
123if test "$with_python" != "no" ; then
124    if test -x "$with_python/bin/python"
125    then
126        echo Found python in $with_python/bin/python
127        PYTHON="$with_python/bin/python"
128    else
129        if test -x "$with_python"
130        then
131            echo Found python in $with_python
132            PYTHON="$with_python"
133        else
134            AC_PATH_PROG(PYTHON, python python2.4 python2.3 python2.2 python2.1 python2.0 python1.6 python1.5)
135        fi
136    fi
137    if test "$PYTHON" != ""
138    then
139        PYTHON_VERSION=`$PYTHON -c "import sys; print sys.version[[0:3]]"`
140        echo Using python version $PYTHON_VERSION
141    fi
142    if test "$PYTHON_VERSION" != ""
143    then
144    if test -r $with_python/include/python$PYTHON_VERSION/Python.h -a \
145       -d $with_python/lib/python$PYTHON_VERSION/site-packages
146    then
147        PYTHON_INCLUDES=$with_python/include/python$PYTHON_VERSION
148        PYTHON_SITE_PACKAGES=$with_python/lib/python$PYTHON_VERSION/site-packages
149    else
150        if test -r $prefix/include/python$PYTHON_VERSION/Python.h
151        then
152            PYTHON_INCLUDES='$(prefix)/include/python$(PYTHON_VERSION)'
153            PYTHON_SITE_PACKAGES='$(libdir)/python$(PYTHON_VERSION)/site-packages'
154        else
155            if test -r /usr/include/python$PYTHON_VERSION/Python.h
156            then
157                PYTHON_INCLUDES=/usr/include/python$PYTHON_VERSION
158                PYTHON_SITE_PACKAGES='$(libdir)/python$(PYTHON_VERSION)/site-packages'
159            else
160                echo could not find python$PYTHON_VERSION/Python.h
161            fi
162        fi
163        if test ! -d "$PYTHON_SITE_PACKAGES"
164        then
165            PYTHON_SITE_PACKAGES=`$PYTHON -c "from distutils import sysconfig; print sysconfig.get_python_lib()"`
166        fi
167    fi
168    fi
169    if test "$with_python" != ""
170    then
171        pythondir='$(PYTHON_SITE_PACKAGES)'
172    else
173        pythondir='$(libdir)/python${PYTHON_VERSION}/site-packages'
174    fi
175fi
176dnl AM_CONDITIONAL(WITH_PYTHON, test x$PYTHON != x)
177
178AC_SUBST(pythondir)
179dnl AC_SUBST(PYTHON_SUBDIR)
180
181AC_SUBST(MEX)
182AC_SUBST(MEX_ARCH)
183AC_SUBST(MKOCTFILE)
184AC_SUBST(PERL)
185AC_SUBST(PERL_INCLUDES)
186AC_SUBST(PYTHON)
187AC_SUBST(PYTHON_VERSION)
188AC_SUBST(PYTHON_INCLUDES)
189AC_SUBST(PYTHON_SITE_PACKAGES)
190
191AC_SUBST(VERSION)
192
193RP_BASE=`pwd`
194AC_SUBST(RP_BASE)
195
196AC_CONFIG_SUBDIRS( gui )
197AC_CONFIG_SUBDIRS( src/tcl )
198
199dnl read Makefile.in and write Makefile
200AC_OUTPUT(  Makefile \
201            examples/demo.bash
202            examples/app-fermi/cee/Makefile \
203            examples/app-fermi/fortran/Makefile \
204            examples/app-fermi/wrapper/cee/Makefile \
205            examples/c-example/Makefile \
206            perl/Makefile.PL \
207            python/setup.py \
208            src/Makefile \
209            src/matlab/Makefile \
210            src/octave/Makefile \
211            test/Makefile \
212            gui/apps/rappture   )
Note: See TracBrowser for help on using the repository browser.