source: trunk/configure.in @ 497

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

added checks to configure.in to find where python and perl live,
added .in files for python and perl build files
configure now builds perl/Makefile.PL and python/setup.py and fits
it with the correct values needed to build and install the module
in the correct directory, where it will live in the rappture distribution.
there had been talk of using env variables to point python and perl
to where these modules live, so that is the current line of thinking.
added queue module for python. the Rappture.queue module's purpose
is to make it easy to send a job to the pbs and condor queues and
track the job using rappture. pbs is kinda complete, condor is not
complete and is still being worked on. the signalHandler and tools
python modules came from left over code that all python rappture
applications might want to include to make the developers life
a little more enjoyable.

File size: 4.4 KB
Line 
1AC_INIT(src/core/RpLibrary.cc)
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
37dnl perl and python check borrowed from
38dnl http://www.opensource.apple.com/darwinsource/Current/libxslt-8.1/libxslt/configure.in
39dnl
40dnl Perl is just needed for generating some data for XSLtmark
41dnl
42
43AC_ARG_WITH(perl, [  --with-perl[=DIR]         Build Perl bindings if found])
44AC_CHECK_PROG(PERL, perl, perl, false)
45dnl AM_CONDITIONAL(WITH_PERL, test "$PERL" != "false")
46
47dnl
48dnl check for python
49dnl
50
51PYTHON=
52PYTHON_VERSION=
53PYTHON_INCLUDES=
54PYTHON_SITE_PACKAGES=
55pythondir=
56AC_ARG_WITH(python, [  --with-python[=DIR]       Build Python bindings if found])
57if test "$with_python" != "no" ; then
58    if test -x "$with_python/bin/python"
59    then
60        echo Found python in $with_python/bin/python
61        PYTHON="$with_python/bin/python"
62    else
63        if test -x "$with_python"
64        then
65            echo Found python in $with_python
66            PYTHON="$with_python"
67        else
68            AC_PATH_PROG(PYTHON, python python2.4 python2.3 python2.2 python2.1 python2.0 python1.6 python1.5)
69        fi
70    fi
71    if test "$PYTHON" != ""
72    then
73        PYTHON_VERSION=`$PYTHON -c "import sys; print sys.version[[0:3]]"`
74    echo Found Python version $PYTHON_VERSION
75dnl    LIBXML2_PYTHON=`$PYTHON -c "try : import libxml2 ; print 1
76dnl except: print 0"`
77dnl     if test "$LIBXML2_PYTHON" = "1"
78dnl     then
79dnl         echo Found libxml2-python module
80dnl     else
81dnl         echo Warning: Missing libxml2-python
82dnl     fi
83    fi
84    if test "$PYTHON_VERSION" != ""
85    then
86    if test -r $with_python/include/python$PYTHON_VERSION/Python.h -a \
87       -d $with_python/lib/python$PYTHON_VERSION/site-packages
88    then
89        PYTHON_INCLUDES=$with_python/include/python$PYTHON_VERSION
90        PYTHON_SITE_PACKAGES=$with_python/lib/python$PYTHON_VERSION/site-packages
91    else
92        if test -r $prefix/include/python$PYTHON_VERSION/Python.h
93        then
94            PYTHON_INCLUDES='$(prefix)/include/python$(PYTHON_VERSION)'
95            PYTHON_SITE_PACKAGES='$(libdir)/python$(PYTHON_VERSION)/site-packages'
96        else
97            if test -r /usr/include/python$PYTHON_VERSION/Python.h
98            then
99                PYTHON_INCLUDES=/usr/include/python$PYTHON_VERSION
100                PYTHON_SITE_PACKAGES='$(libdir)/python$(PYTHON_VERSION)/site-packages'
101            else
102                echo could not find python$PYTHON_VERSION/Python.h
103            fi
104        fi
105        if test ! -d "$PYTHON_SITE_PACKAGES"
106        then
107            PYTHON_SITE_PACKAGES=`$PYTHON -c "from distutils import sysconfig; print sysconfig.get_python_lib()"`
108        fi
109    fi
110    fi
111    if test "$with_python" != ""
112    then
113        pythondir='$(PYTHON_SITE_PACKAGES)'
114    else
115        pythondir='$(libdir)/python${PYTHON_VERSION}/site-packages'
116    fi
117fi
118dnl AM_CONDITIONAL(WITH_PYTHON, test "$PYTHON_INCLUDES" != "")
119dnl if test "$PYTHON_INCLUDES" != ""
120dnl then
121dnl     PYTHON_SUBDIR=python
122dnl else
123dnl     PYTHON_SUBDIR=
124dnl fi
125AC_SUBST(pythondir)
126dnl AC_SUBST(PYTHON_SUBDIR)
127
128AC_SUBST(PERL)
129AC_SUBST(PYTHON)
130AC_SUBST(PYTHON_VERSION)
131AC_SUBST(PYTHON_INCLUDES)
132AC_SUBST(PYTHON_SITE_PACKAGES)
133
134AC_SUBST(VERSION)
135
136RP_BASE=`pwd`
137AC_SUBST(RP_BASE)
138
139dnl read Makefile.in and write Makefile
140AC_OUTPUT(  Makefile \
141            examples/app-fermi/cee/Makefile \
142            examples/app-fermi/fortran/Makefile \
143            examples/c-example/Makefile \
144            perl/Makefile.PL \
145            python/setup.py \
146            src/Makefile \
147            src/matlab/Makefile \
148            src/octave/Makefile \
149            test/Makefile \
150            gui/apps/rappture   )
Note: See TracBrowser for help on using the repository browser.