1 |
# configure.ac |
2 |
|
3 |
## Process this file with autoconf to create configure. -*- autoconf -*- |
4 |
# Copyright (c) 2002 Thomas Degris |
5 |
|
6 |
# http://www.freesoftware.fsf.org/satom/ |
7 |
|
8 |
# This program is free software; you can redistribute it and/or |
9 |
# modify it under the terms of the GNU General Public License as |
10 |
# published by the Free Software Foundation; either version 2 of the |
11 |
# License, or (at your option) any later version. |
12 |
|
13 |
# This program is distributed in the hope that it will be useful, |
14 |
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
15 |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
16 |
# GNU General Public License for more details. |
17 |
|
18 |
# You should have received a copy of the GNU General Public License |
19 |
# along with this program; if not, write to the Free Software |
20 |
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 |
21 |
# USA |
22 |
|
23 |
AC_INIT(src/satom/satom.hpp) |
24 |
AC_CANONICAL_TARGET |
25 |
AM_INIT_AUTOMAKE(Satom, 0.0.1) |
26 |
AM_CONFIG_HEADER(config.h) |
27 |
AC_PREREQ(2.52) |
28 |
|
29 |
dnl Checking for programs |
30 |
AC_PROG_CC |
31 |
AC_PROG_CPP |
32 |
AC_PROG_CXX |
33 |
AC_PROG_INSTALL |
34 |
|
35 |
dnl Check for dlopen support |
36 |
AC_LIBTOOL_DLOPEN |
37 |
dnl Enable building of the convenience library |
38 |
dnl and set LIBLTDL accordingly |
39 |
AC_LIBLTDL_CONVENIENCE |
40 |
dnl Substitute LTDLINCL and LIBLTDL in the Makefiles |
41 |
AC_SUBST(INCLTDL) |
42 |
AC_SUBST(LIBLTDL) |
43 |
dnl Configure libltdl |
44 |
AC_CONFIG_SUBDIRS(libltdl) |
45 |
dnl Configure libtool |
46 |
AM_DISABLE_STATIC |
47 |
AM_ENABLE_SHARED |
48 |
AC_PROG_LIBTOOL |
49 |
|
50 |
dnl Selection the language |
51 |
AC_LANG([C++]) |
52 |
AC_CHECK_LIB(stdc++, main,,AC_MSG_ERROR(Satom requires stdc++)) |
53 |
|
54 |
dnl Checking for headers file |
55 |
AC_STDC_HEADERS |
56 |
AC_CHECK_HEADERS(dirent.h stdio.h assert.h) |
57 |
|
58 |
dnl Checking for functions |
59 |
AC_CHECK_FUNCS(readlink, , ) |
60 |
|
61 |
dnl Fix the conditional for Darwin operating system |
62 |
AM_CONDITIONAL(DARWINSYSTEM, [ test `uname` = "Darwin" ]) |
63 |
|
64 |
dnl Enable debug mode flags |
65 |
AC_ARG_ENABLE(debug, |
66 |
[ --enable-debug[[=ARG]] compile in debug info default=no],[ |
67 |
if test "$enable_debug" = "yes"; then |
68 |
CFLAGS="-g3 -Wall -pedantic-errors -fPIC" |
69 |
if test `uname` = "Darwin"; then |
70 |
CFLAGS="$CFLAGS -ggdb3" |
71 |
else |
72 |
CFLAGS="$CFLAGS -gdwarf-2" |
73 |
fi |
74 |
CXXFLAGS="$CFLAGS" |
75 |
fi |
76 |
],[ |
77 |
CFLAGS="-O2 -fPIC" |
78 |
CXXFLAGS="$CFLAGS" |
79 |
]) |
80 |
|
81 |
dnl Enable profiler mode |
82 |
AC_ARG_ENABLE(profile, |
83 |
[ --enable-profile[[=ARG]] compile with gprof profiler default=no],[ |
84 |
if test "$enable_profile" = "yes"; then |
85 |
CFLAGS="$CFLAGS -pg " |
86 |
CXXFLAGS="$CXXFLAGS -pg " |
87 |
LDFLAGS="${LDFLAGS} -pg" |
88 |
fi |
89 |
]) |
90 |
|
91 |
dnl Checking for libxml2 |
92 |
AC_ARG_WITH(libxml2, |
93 |
[ --with-libxml2[[=DIR]] use libxml2 in DIR],[ |
94 |
if test "$withval" != "no" -a "$withval" != "yes"; then |
95 |
LIBXML2_DIR=$withval |
96 |
CPPFLAGS="${CPPFLAGS} -I$withval/include" |
97 |
LDFLAGS="${LDFLAGS} -L$withval" |
98 |
fi |
99 |
]) |
100 |
AC_PATH_PROG(XML2CONFIG, "xml2-config", "no", [${PATH}:${LIBXML2_DIR}/bin:${LIBXML2_DIR}]) |
101 |
if test "$XML2CONFIG" = "no"; then |
102 |
AC_MSG_ERROR(Satom requires libxml2) |
103 |
fi |
104 |
# AC_CHECK_LIB(xml2, main,,AC_MSG_ERROR(Satom requires libxml2)) |
105 |
# AC_CHECK_HEADERS(libxml/globals.h,, AC_MSG_ERROR(Satom requires libxml2-dev), `$XML2CONFIG --cflags`) |
106 |
|
107 |
|
108 |
dnl Checking for libxslt |
109 |
AC_ARG_WITH(libxslt, |
110 |
[ --with-libxslt[[=DIR]] use libxslt in DIR],[ |
111 |
if test "$withval" != "no" -a "$withval" != "yes"; then |
112 |
LIBXSLT_DIR=$withval |
113 |
CPPFLAGS="${CPPFLAGS} -I$withval" |
114 |
LDFLAGS="${LDFLAGS} -L$withval/libxslt -L$withval/libexslt" |
115 |
fi |
116 |
]) |
117 |
AC_PATH_PROG(XSLTCONFIG, "xslt-config", "no", [${PATH}:${LIBXSLT_DIR}/bin:${LIBXSLT_DIR}]) |
118 |
if test "$XSLTCONFIG" = "no"; then |
119 |
AC_MSG_ERROR(Satom requires libxslt) |
120 |
fi |
121 |
|
122 |
dnl Checking for wsock32 |
123 |
AC_CHECK_LIB(wsock32, main,[LDWINSOCKET="-lwsock32"],) |
124 |
AC_SUBST(LDWINSOCKET) |
125 |
|
126 |
# AC_CHECK_LIB(xslt, main,,AC_MSG_ERROR(Satom requires libxslt)) |
127 |
# AC_CHECK_HEADERS(libxslt/xslt.h,, AC_MSG_ERROR(Satom requires libxslt-dev)) |
128 |
|
129 |
dnl Checking for libxeslt |
130 |
dnl AC_ARG_WITH(libexslt, |
131 |
dnl [ --with-libexslt[[=DIR]] use libexslt in DIR],[ |
132 |
dnl if test "$withval" != "no" -a "$withval" != "yes"; then |
133 |
dnl LIBXSTL_DIR=$withval |
134 |
dnl CPPFLAGS="${CPPFLAGS} -I$withval/include" |
135 |
dnl LDFLAGS="${LDFLAGS} -L$withval/lib" |
136 |
dnl fi |
137 |
dnl ]) |
138 |
dnl AC_CHECK_LIB(exslt, main,,AC_MSG_ERROR(Satom requires libexslt)) |
139 |
# AC_CHECK_HEADERS(libexslt/exslt.h,, AC_MSG_ERROR(Satom requires libexslt-dev)) |
140 |
|
141 |
dnl Check wether to use ln or cp |
142 |
AC_CHECK_PROG(LNCONFIG, ln, yes) |
143 |
if test "$LNCONFIG" = "yes"; then |
144 |
LN="ln -f" |
145 |
else |
146 |
LN="cp" |
147 |
fi |
148 |
AC_SUBST(LN) |
149 |
|
150 |
dnl Checking for Java |
151 |
AC_ARG_WITH(java, |
152 |
[ --with-java[[=DIR]] use Sun/IBM JDK in DIR],[ |
153 |
if test "$withval" != "no" -a "$withval" != "yes"; then |
154 |
JAVA_DIR="${withval}" |
155 |
fi |
156 |
]) |
157 |
|
158 |
if test -z "$JAVA_DIR"; then |
159 |
MAYBE_JAVA= |
160 |
JAVASATOM_JDK= |
161 |
echo "*** Warning: Java is disabled ***" |
162 |
else |
163 |
MAYBE_JAVA=java |
164 |
if test `uname` = "Darwin"; then |
165 |
JAVASATOM_INCLUDEDIR="-I${JAVA_DIR}/include" |
166 |
JAVA_LIBS="-Wl,-framework,JavaVM" |
167 |
else |
168 |
JAVASATOM_INCLUDEDIR="-I${JAVA_DIR}/include -I${JAVA_DIR}/include/linux" |
169 |
JAVASATOM_LIBDIR="-L${withval}/jre/bin -L${withval}/jre/bin/classic -L${withval}/jre/lib/i386 -L${withval}/jre/lib/i386/native_threads -L${withval}/jre/lib/i386/client" |
170 |
dnl JAVA_LIBS="-ljava -ljvm -ljsig -lhpi" |
171 |
JAVA_LIBS="-ljava -ljvm" |
172 |
fi |
173 |
JAVASATOM_CFLAG="-D_LP64 ${JAVASATOM_INCLUDEDIR}" |
174 |
JAVASATOM_LIBS="${JAVA_LIBS} -lsatomjava ${JAVASATOM_LIBDIR}" |
175 |
JAVASATOM_JDK="${JAVA_DIR}" |
176 |
AC_PATH_PROG(JAVAC, "javac", "no", [${JAVA_DIR}/bin:${PATH}]) |
177 |
if test "$JAVAC" = "no"; then |
178 |
AC_MSG_ERROR(Satom requires javac when Java is enabled) |
179 |
fi |
180 |
fi |
181 |
|
182 |
|
183 |
|
184 |
dnl Defines variables |
185 |
SATOM_CFLAGS="" |
186 |
SATOM_INCLUDEDIR="-I${includedir}" |
187 |
SATOM_LIBDIR="-L${libdir}" |
188 |
SATOM_LIBS="-lsatom" |
189 |
SATOM_LIBTOOLLIBS="satom.la" |
190 |
SATOM_CLASSPATH="$prefix/share/satom/java" |
191 |
|
192 |
AC_DEFINE_UNQUOTED(SATOMPREFIX, "$prefix", Satom prefix installation) |
193 |
AC_DEFINE_UNQUOTED(STIDIR, "$prefix/share/satom/sti/", Xslt Satom folder installation) |
194 |
AC_DEFINE_UNQUOTED(XSLTDIR, "$prefix/share/satom/xslt/", Xslt Satom folder installation) |
195 |
AC_DEFINE_UNQUOTED(ETCDIR, "$prefix/etc/", Xslt Satom folder installation) |
196 |
AC_DEFINE_UNQUOTED(LIBDIR, "$prefix/lib", Library Satom folder installation) |
197 |
AC_DEFINE_UNQUOTED(SATOM_CLASSPATH, "$SATOM_CLASSPATH", Classpath for Satom Java class) |
198 |
|
199 |
AC_SUBST(SATOM_CFLAGS) |
200 |
AC_SUBST(SATOM_INCLUDEDIR) |
201 |
AC_SUBST(SATOM_LIBDIR) |
202 |
AC_SUBST(SATOM_LIBS) |
203 |
AC_SUBST(SATOM_LIBTOOLLIBS) |
204 |
|
205 |
AC_SUBST(MAYBE_JAVA) |
206 |
AC_SUBST(JAVA_LIBS) |
207 |
AC_SUBST(SATOM_CLASSPATH) |
208 |
AC_SUBST(JAVASATOM_CFLAG) |
209 |
AC_SUBST(JAVASATOM_INCLUDEDIR) |
210 |
AC_SUBST(JAVASATOM_LIBDIR) |
211 |
AC_SUBST(JAVASATOM_LIBS) |
212 |
AC_SUBST(JAVASATOM_JDK) |
213 |
|
214 |
echo |
215 |
echo "Satom compilation options" |
216 |
echo "enable-debug = $enable_debug" |
217 |
echo "enable-profile = $enable_profile" |
218 |
echo "CFLAGS = $CFLAGS" |
219 |
echo "CXXFLAGS = $CXXFLAGS" |
220 |
echo "LDFLAGS = $LDFLAGS" |
221 |
echo |
222 |
|
223 |
AC_OUTPUT([ |
224 |
st.conf |
225 |
satom-config |
226 |
Makefile |
227 |
src/Makefile |
228 |
src/stcpp/Makefile |
229 |
src/satom/Makefile |
230 |
src/stmain/Makefile |
231 |
src/stconfig/Makefile |
232 |
src/stutils/Makefile |
233 |
src/java/Makefile |
234 |
src/java/satomjava/Makefile |
235 |
src/java/org/Makefile |
236 |
src/java/org/satom/Makefile |
237 |
data/Makefile |
238 |
data/xslt/Makefile |
239 |
data/xslt/cpp/Makefile |
240 |
data/xslt/java/Makefile |
241 |
data/xslt/doc/Makefile |
242 |
]) |