1 | AC_INIT(src/core/RpLibrary.cc) |
---|
2 | |
---|
3 | VERSION=0.0.1 |
---|
4 | |
---|
5 | #------------------------------------------------------------------------ |
---|
6 | # Handle the --prefix=... option |
---|
7 | #------------------------------------------------------------------------ |
---|
8 | |
---|
9 | if test "${prefix}" = "NONE"; then |
---|
10 | prefix=/usr/local |
---|
11 | fi |
---|
12 | if test "${exec_prefix}" = "NONE"; then |
---|
13 | exec_prefix=$prefix |
---|
14 | fi |
---|
15 | |
---|
16 | # AC_PROG_INSTALL |
---|
17 | AC_PROG_MAKE_SET |
---|
18 | |
---|
19 | dnl find and test the C compiler |
---|
20 | AC_PROG_CC |
---|
21 | AC_LANG_C |
---|
22 | |
---|
23 | AC_HEADER_STDC |
---|
24 | AC_CHECK_FUNC(atol,,AC_MSG_ERROR(oops! no atol ?!?)) |
---|
25 | |
---|
26 | AC_PROG_CXX |
---|
27 | AC_LANG_CPLUSPLUS |
---|
28 | |
---|
29 | AC_CHECK_LIB(stdc++, main,,AC_MSG_ERROR(librappture requires libstdc++)) |
---|
30 | AC_CHECK_HEADERS(stack,,AC_MSG_WARN(STL classes missing ?)) |
---|
31 | AC_CHECK_HEADERS(string,,AC_MSG_WARN(STL classes missing ?)) |
---|
32 | AC_CHECK_HEADERS(list,,AC_MSG_WARN(STL classes missing ?)) |
---|
33 | AC_CHECK_HEADERS(vector,,AC_MSG_WARN(STL classes missing ?)) |
---|
34 | |
---|
35 | AC_PROG_F77([f77 fort77 g77 f90 xlf xlf90 fl32]) |
---|
36 | |
---|
37 | dnl perl and python check borrowed from |
---|
38 | dnl http://www.opensource.apple.com/darwinsource/Current/libxslt-8.1/libxslt/configure.in |
---|
39 | dnl |
---|
40 | dnl Perl is just needed for generating some data for XSLtmark |
---|
41 | dnl |
---|
42 | |
---|
43 | AC_ARG_WITH(perl, [ --with-perl[=DIR] Build Perl bindings if found]) |
---|
44 | AC_CHECK_PROG(PERL, perl, perl, false) |
---|
45 | dnl AM_CONDITIONAL(WITH_PERL, test "$PERL" != "false") |
---|
46 | |
---|
47 | dnl |
---|
48 | dnl check for python |
---|
49 | dnl |
---|
50 | |
---|
51 | PYTHON= |
---|
52 | PYTHON_VERSION= |
---|
53 | PYTHON_INCLUDES= |
---|
54 | PYTHON_SITE_PACKAGES= |
---|
55 | pythondir= |
---|
56 | AC_ARG_WITH(python, [ --with-python[=DIR] Build Python bindings if found]) |
---|
57 | if 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 |
---|
75 | dnl LIBXML2_PYTHON=`$PYTHON -c "try : import libxml2 ; print 1 |
---|
76 | dnl except: print 0"` |
---|
77 | dnl if test "$LIBXML2_PYTHON" = "1" |
---|
78 | dnl then |
---|
79 | dnl echo Found libxml2-python module |
---|
80 | dnl else |
---|
81 | dnl echo Warning: Missing libxml2-python |
---|
82 | dnl 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 |
---|
117 | fi |
---|
118 | dnl AM_CONDITIONAL(WITH_PYTHON, test "$PYTHON_INCLUDES" != "") |
---|
119 | dnl if test "$PYTHON_INCLUDES" != "" |
---|
120 | dnl then |
---|
121 | dnl PYTHON_SUBDIR=python |
---|
122 | dnl else |
---|
123 | dnl PYTHON_SUBDIR= |
---|
124 | dnl fi |
---|
125 | AC_SUBST(pythondir) |
---|
126 | dnl AC_SUBST(PYTHON_SUBDIR) |
---|
127 | |
---|
128 | AC_SUBST(PERL) |
---|
129 | AC_SUBST(PYTHON) |
---|
130 | AC_SUBST(PYTHON_VERSION) |
---|
131 | AC_SUBST(PYTHON_INCLUDES) |
---|
132 | AC_SUBST(PYTHON_SITE_PACKAGES) |
---|
133 | |
---|
134 | AC_SUBST(VERSION) |
---|
135 | |
---|
136 | RP_BASE=`pwd` |
---|
137 | AC_SUBST(RP_BASE) |
---|
138 | |
---|
139 | dnl read Makefile.in and write Makefile |
---|
140 | AC_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 ) |
---|