source: trunk/configure.in @ 708

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

updateing build system for rappture and language bindings.
librappture now includes a static version of libscew.
this means librappture needs to be linked directly against libexpat.
removed references to libscew from language bindings' makefiles.
corrected matlab and octave makefiles to only compile when dependencies are updated.
added --libdir flag so you can install platform dependent files into lib64 on 64-bit systems.
adjusted the rappture.env file to add lib64 directories to search paths incase they exist.

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