source: trunk/configure.in @ 632

Last change on this file since 632 was 632, checked in by dkearney, 18 years ago

changing rappture script to source the rappture.env file
added option to simsim allowing user to specify the value for named elements on the command line
added simsim rappture.env to configure script and makefile

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 AM_CONDITIONAL(WITH_MATLAB, test x$MEX != x)
62
63AC_ARG_WITH(octave, [  --with-octave[=DIR]         Build Octave bindings if MKOCTFILE compiler is found])
64dnl AC_CHECK_PROG(MKOCTFILE, mkoctfile, mkoctfile, false)
65MKOCTFILE=
66if test "$with_octave" != "no" ; then
67    if test -x "$with_octave/bin/mkoctfile"
68    then
69        echo Found octave in $with_octave/bin/mkoctfile
70        MKOCTFILE="$with_octave/bin/mkoctfile"
71    else
72        if test -x "$with_octave"
73        then
74            echo Found mkoctfile in $with_octave
75            MKOCTFILE="$with_octave"
76        else
77            AC_PATH_PROG(MKOCTFILE, mkoctfile)
78        fi
79    fi
80fi
81dnl AM_CONDITIONAL(WITH_OCTAVE, test x$MKOCTFILE != x)
82
83
84dnl perl and python check borrowed from
85dnl http://www.opensource.apple.com/darwinsource/Current/libxslt-8.1/libxslt/configure.in
86dnl
87dnl Perl is just needed for generating some data for XSLtmark
88dnl
89
90AC_ARG_WITH(perl, [  --with-perl[=DIR]         Build Perl bindings if found])
91dnl AC_CHECK_PROG(PERL, perl, perl, false)
92dnl AM_CONDITIONAL(WITH_PERL, test "$PERL" != "false")
93PERL=
94PERL_INCLUDES=
95if test "$with_perl" != "no" ; then
96    if test -x "$with_perl/bin/perl"
97    then
98        echo Found perl in $with_perl/bin/perl
99        PERL="$with_perl/bin/perl"
100    else
101        if test -x "$with_perl"
102        then
103            echo Found perl in $with_perl
104            PERL="$with_perl"
105        else
106            AC_PATH_PROG(PERL, perl)
107        fi
108    fi
109fi
110dnl AM_CONDITIONAL(WITH_PERL, test x$PERL != x)
111
112dnl
113dnl check for python
114dnl
115
116PYTHON=
117PYTHON_VERSION=
118PYTHON_INCLUDES=
119PYTHON_SITE_PACKAGES=
120pythondir=
121AC_ARG_WITH(python, [  --with-python[=DIR]       Build Python bindings if found])
122if test "$with_python" != "no" ; then
123    if test -x "$with_python/bin/python"
124    then
125        echo Found python in $with_python/bin/python
126        PYTHON="$with_python/bin/python"
127    else
128        if test -x "$with_python"
129        then
130            echo Found python in $with_python
131            PYTHON="$with_python"
132        else
133            AC_PATH_PROG(PYTHON, python python2.4 python2.3 python2.2 python2.1 python2.0 python1.6 python1.5)
134        fi
135    fi
136    if test "$PYTHON" != ""
137    then
138        PYTHON_VERSION=`$PYTHON -c "import sys; print sys.version[[0:3]]"`
139        echo Using python version $PYTHON_VERSION
140    fi
141    if test "$PYTHON_VERSION" != ""
142    then
143    if test -r $with_python/include/python$PYTHON_VERSION/Python.h -a \
144       -d $with_python/lib/python$PYTHON_VERSION/site-packages
145    then
146        PYTHON_INCLUDES=$with_python/include/python$PYTHON_VERSION
147        PYTHON_SITE_PACKAGES=$with_python/lib/python$PYTHON_VERSION/site-packages
148    else
149        if test -r $prefix/include/python$PYTHON_VERSION/Python.h
150        then
151            PYTHON_INCLUDES='$(prefix)/include/python$(PYTHON_VERSION)'
152            PYTHON_SITE_PACKAGES='$(libdir)/python$(PYTHON_VERSION)/site-packages'
153        else
154            if test -r /usr/include/python$PYTHON_VERSION/Python.h
155            then
156                PYTHON_INCLUDES=/usr/include/python$PYTHON_VERSION
157                PYTHON_SITE_PACKAGES='$(libdir)/python$(PYTHON_VERSION)/site-packages'
158            else
159                echo could not find python$PYTHON_VERSION/Python.h
160            fi
161        fi
162        if test ! -d "$PYTHON_SITE_PACKAGES"
163        then
164            PYTHON_SITE_PACKAGES=`$PYTHON -c "from distutils import sysconfig; print sysconfig.get_python_lib()"`
165        fi
166    fi
167    fi
168    if test "$with_python" != ""
169    then
170        pythondir='$(PYTHON_SITE_PACKAGES)'
171    else
172        pythondir='$(libdir)/python${PYTHON_VERSION}/site-packages'
173    fi
174fi
175dnl AM_CONDITIONAL(WITH_PYTHON, test x$PYTHON != x)
176
177AC_SUBST(pythondir)
178dnl AC_SUBST(PYTHON_SUBDIR)
179
180AC_SUBST(MEX)
181AC_SUBST(MEX_ARCH)
182AC_SUBST(MKOCTFILE)
183AC_SUBST(PERL)
184AC_SUBST(PERL_INCLUDES)
185AC_SUBST(PYTHON)
186AC_SUBST(PYTHON_VERSION)
187AC_SUBST(PYTHON_INCLUDES)
188AC_SUBST(PYTHON_SITE_PACKAGES)
189
190AC_SUBST(VERSION)
191
192RP_BASE=`pwd`
193AC_SUBST(RP_BASE)
194
195AC_CONFIG_SUBDIRS( gui )
196AC_CONFIG_SUBDIRS( src/tcl )
197
198dnl read Makefile.in and write Makefile
199AC_OUTPUT(  Makefile \
200            examples/demo.bash
201            examples/app-fermi/cee/Makefile \
202            examples/app-fermi/fortran/Makefile \
203            examples/app-fermi/wrapper/cee/Makefile \
204            examples/c-example/Makefile \
205            perl/Makefile.PL \
206            python/setup.py \
207            src/Makefile \
208            src/matlab/Makefile \
209            src/octave/Makefile \
210            src2/core/Makefile \
211            test/Makefile \
212            gui/apps/rappture \
213            gui/apps/rappture.env   )
Note: See TracBrowser for help on using the repository browser.