source: trunk/configure.in @ 508

Last change on this file since 508 was 508, checked in by dkearney, 15 years ago

updates to Makefile.in's, this should not change the current build process as these files are not in use yet. also added python's units stuff the the top level python package.

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