1 | AC_INIT() |
---|
2 | |
---|
3 | AMMONITE_MAJOR_VERSION=0 |
---|
4 | AMMONITE_MINOR_VERSION=8 |
---|
5 | AMMONITE_MICRO_VERSION=1 |
---|
6 | AMMONITE_VERSION="$AMMONITE_MAJOR_VERSION.$AMMONITE_MINOR_VERSION.$AMMONITE_MICRO_VERSION" |
---|
7 | AM_INIT_AUTOMAKE(ammonite,$AMMONITE_VERSION) |
---|
8 | AM_CONFIG_HEADER(src/config.h) |
---|
9 | |
---|
10 | AC_SUBST(AMMONITE_MAJOR_VERSION) |
---|
11 | AC_SUBST(AMMONITE_MINOR_VERSION) |
---|
12 | AC_SUBST(AMMONITE_MICRO_VERSION) |
---|
13 | AC_SUBST(AMMONITE_VERSION) |
---|
14 | |
---|
15 | dnl Checks for programs. |
---|
16 | AM_DISABLE_STATIC |
---|
17 | AM_PROG_LIBTOOL |
---|
18 | AC_PROG_CC |
---|
19 | AC_PROG_INSTALL |
---|
20 | |
---|
21 | dnl Checks for header files. |
---|
22 | AC_HEADER_STDC |
---|
23 | AC_CHECK_HEADERS(fcntl.h sys/time.h syslog.h unistd.h alloca.h) |
---|
24 | |
---|
25 | dnl Checks for typedefs, structures, and compiler characteristics. |
---|
26 | AC_C_CONST |
---|
27 | AC_TYPE_SIZE_T |
---|
28 | AC_HEADER_TIME |
---|
29 | AC_C_INLINE |
---|
30 | |
---|
31 | dnl ==================================== |
---|
32 | dnl = |
---|
33 | dnl = Profiling support |
---|
34 | dnl = |
---|
35 | dnl ==================================== |
---|
36 | ENABLE_PROFILER= |
---|
37 | AC_ARG_ENABLE(profiler, |
---|
38 | [ --enable-profiler Enable profiler], |
---|
39 | ENABLE_PROFILER=1 |
---|
40 | AC_DEFINE(ENABLE_PROFILER)) |
---|
41 | |
---|
42 | if test "x$ENABLE_PROFILER" = "x1" |
---|
43 | then |
---|
44 | CFLAGS="-g -O -gdwarf-2 -finstrument-functions -D__NO_STRING_INLINES" |
---|
45 | LDFLAGS="/gnome/PROFILE/lib/libprofiler.so -lpthread" |
---|
46 | fi |
---|
47 | |
---|
48 | AC_SUBST(ENABLE_PROFILER) |
---|
49 | AM_CONDITIONAL(ENABLE_PROFILER, test "x$ENABLE_PROFILER" = "x1") |
---|
50 | dnl ==================================== |
---|
51 | dnl = Profiling support |
---|
52 | dnl ==================================== |
---|
53 | |
---|
54 | dnl borrowed from stunnel - check for openssl |
---|
55 | checkssldir() { : |
---|
56 | if test -f "$1/include/openssl/ssl.h"; then |
---|
57 | AC_DEFINE(HAVE_OPENSSL) |
---|
58 | ssldir="$1" |
---|
59 | return 0 |
---|
60 | fi |
---|
61 | return 1 |
---|
62 | } |
---|
63 | |
---|
64 | AC_MSG_CHECKING([for openSSL directory]) |
---|
65 | AC_ARG_WITH(openssl, |
---|
66 | [ --with-openssl=DIR location of installed openSSL libraries/include files]) |
---|
67 | |
---|
68 | dnl Search default localtions of SSL library |
---|
69 | for maindir in $with_openssl /usr /usr/local /usr/lib /usr/pkg ; do |
---|
70 | for dir in $maindir $maindir/openssl $maindir/ssl; do |
---|
71 | checkssldir $dir |
---|
72 | done |
---|
73 | done |
---|
74 | |
---|
75 | if test -z "$ssldir"; then |
---|
76 | AC_MSG_RESULT(Not found) |
---|
77 | echo |
---|
78 | echo "Building without openSSL!" |
---|
79 | echo "Use --with-openssl option if you want SSL support" |
---|
80 | echo |
---|
81 | OPENSSL_LIBS= |
---|
82 | OPENSSL_CFLAGS= |
---|
83 | else |
---|
84 | dnl |
---|
85 | dnl OPENSSL_LIBS="-L$ssldir/lib -lssl -lcrypto" |
---|
86 | dnl |
---|
87 | dnl For now we are linking in openssl statically |
---|
88 | dnl |
---|
89 | OPENSSL_LIBS="$ssldir/lib/libssl.a $ssldir/lib/libcrypto.a" |
---|
90 | |
---|
91 | OPENSSL_CFLAGS="-I$ssldir/include" |
---|
92 | fi |
---|
93 | AC_MSG_RESULT($ssldir) |
---|
94 | dnl AC_DEFINE_UNQUOTED(OPENSSL_LIBS, "$OPENSSL_LIBS") |
---|
95 | dnl AC_DEFINE_UNQUOTED(OPENSSL_CFLAGS, "$OPENSSL_CFLAGS") |
---|
96 | AC_SUBST(HAVE_OPENSSL) |
---|
97 | AC_SUBST(OPENSSL_LIBS) |
---|
98 | AC_SUBST(OPENSSL_CFLAGS) |
---|
99 | |
---|
100 | |
---|
101 | dnl chris - allow user to choose log file location, port and username |
---|
102 | AC_ARG_WITH(log-file, \ |
---|
103 | [--with-log-file=FILE Default logfile name], \ |
---|
104 | [AC_DEFINE_UNQUOTED(DEFAULT_LOG, "$withval" )]) |
---|
105 | |
---|
106 | dnl mfleming -- added GLIB |
---|
107 | AM_PATH_GLIB(1.2.8,, |
---|
108 | AC_MSG_ERROR([ |
---|
109 | *** GLIB 1.2.8 or better is required. The latest version of GLIB |
---|
110 | *** is always available from ftp://ftp.gtk.org/.])) |
---|
111 | AM_PATH_GCONF(0.11.0,,,gconf) |
---|
112 | |
---|
113 | AC_PATH_PROG(XML_CONFIG,xml-config,no) |
---|
114 | if test x$XML_CONFIG = xno; then |
---|
115 | AC_MSG_ERROR(Couldn't find xml-config please install the gnome-xml package) |
---|
116 | fi |
---|
117 | XML_LIBS=`$XML_CONFIG --libs` |
---|
118 | XML_CFLAGS=`$XML_CONFIG --cflags` |
---|
119 | AC_SUBST(XML_LIBS) |
---|
120 | AC_SUBST(XML_CFLAGS) |
---|
121 | |
---|
122 | AM_PATH_OAF(0.6.0) |
---|
123 | |
---|
124 | dnl This is only for the login box |
---|
125 | AM_PATH_GNOME(1.2.0,,AC_MSG_ERROR([*** GNOME 1.2.0 or better is required.]), gtk gnome gnomeui) |
---|
126 | AC_SUBST(GTK_LIBS) |
---|
127 | AC_SUBST(GTK_CFLAGS) |
---|
128 | AC_SUBST(GNOME_LIBS) |
---|
129 | AC_SUBST(GNOME_CFLAGS) |
---|
130 | AC_SUBST(GNOMEUI_LIBS) |
---|
131 | AC_SUBST(GNOMEUI_CFLAGS) |
---|
132 | |
---|
133 | |
---|
134 | AC_CHECK_LIB(popt, poptGetContext,, |
---|
135 | AC_MSG_ERROR([You must have popt installed. Get it from ftp://ftp.redhat.com/pub/redhat/code/popt/])) |
---|
136 | |
---|
137 | dnl Checks for library functions. |
---|
138 | AC_TYPE_SIGNAL |
---|
139 | AC_FUNC_STRFTIME |
---|
140 | AC_FUNC_VPRINTF |
---|
141 | AC_CHECK_FUNCS(socket select strerror strdup vsyslog vsnprintf) |
---|
142 | |
---|
143 | dnl Add the warnings if we have the GCC compiler |
---|
144 | rm -f conftest* |
---|
145 | |
---|
146 | AC_ARG_ENABLE(more-warnings, |
---|
147 | [ --enable-more-warnings Maximum compiler warnings], |
---|
148 | set_more_warnings="$enableval",[ |
---|
149 | if test -f $srcdir/CVSVERSION; then |
---|
150 | set_more_warnings=yes |
---|
151 | else |
---|
152 | set_more_warnings=no |
---|
153 | fi |
---|
154 | ]) |
---|
155 | AC_MSG_CHECKING(for more warnings, including -Werror) |
---|
156 | if test "$GCC" = "yes" -a "$set_more_warnings" != "no"; then |
---|
157 | AC_MSG_RESULT(yes) |
---|
158 | CFLAGS="\ |
---|
159 | -Wall \ |
---|
160 | -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes \ |
---|
161 | -Wnested-externs -Wpointer-arith \ |
---|
162 | -Werror \ |
---|
163 | $CFLAGS" |
---|
164 | |
---|
165 | for option in -Wsign-promo -Wno-sign-compare; do |
---|
166 | SAVE_CFLAGS="$CFLAGS" |
---|
167 | CFLAGS="$CFLAGS $option" |
---|
168 | AC_MSG_CHECKING([whether gcc understands $option]) |
---|
169 | AC_TRY_COMPILE([], [int test;], |
---|
170 | has_option=yes, |
---|
171 | has_option=no,) |
---|
172 | CFLAGS="$SAVE_CFLAGS" |
---|
173 | if test $has_option = yes; then |
---|
174 | CFLAGS="$CFLAGS $option" |
---|
175 | fi |
---|
176 | AC_MSG_RESULT($has_option) |
---|
177 | unset has_option |
---|
178 | unset SAVE_CFLAGS |
---|
179 | done |
---|
180 | unset option |
---|
181 | else |
---|
182 | AC_MSG_RESULT(no) |
---|
183 | fi |
---|
184 | |
---|
185 | dnl ORBit |
---|
186 | AM_PATH_ORBIT |
---|
187 | |
---|
188 | |
---|
189 | AC_CHECK_LIB(nsl, gethostname, [LIBS="$LIBS -lnsl"]) |
---|
190 | AC_CHECK_LIB(socket, setsockopt, [LIBS="$LIBS -lsocket"]) |
---|
191 | |
---|
192 | dnl Check to see if the debuging code is turned on |
---|
193 | AC_MSG_CHECKING(whether to include debugging code) |
---|
194 | AC_ARG_ENABLE(debug, \ |
---|
195 | [--enable-debug=[yes/no] turn on additional debugging code], |
---|
196 | [debug_enabled=yes], [debug_enabled=no]) |
---|
197 | if test "$debug_enabled" = "yes"; then |
---|
198 | CFLAGS="$CFLAGS -DDEBUG" |
---|
199 | fi |
---|
200 | AC_MSG_RESULT($debug_enabled) |
---|
201 | |
---|
202 | dnl Check for SOCKS support |
---|
203 | AC_MSG_CHECKING(whether to include support for SOCKS) |
---|
204 | AC_ARG_ENABLE(socks, \ |
---|
205 | [--enable-socks=[yes/no] enable SOCKS support], |
---|
206 | [socks_enabled=yes], [socks_enabled=no]) |
---|
207 | if test "$socks_enabled" = "$yes"; then |
---|
208 | AC_CHECK_HEADER(socks.h, [socks_header="yes"], [socks_header="no"]) |
---|
209 | AC_CHECK_LIB(socks, main, [socks_library="yes"], [socks_library="no"]) |
---|
210 | if test "$socks_header" = "yes" && test "$socks_library" = "yes"; then |
---|
211 | CFLAGS="$CFLAGS -I/usr/include/sock.h -DSOCKS" |
---|
212 | LIBS="$LIBS -lsocks" |
---|
213 | else |
---|
214 | socks_enabled=no |
---|
215 | fi |
---|
216 | fi |
---|
217 | AC_MSG_RESULT($socks_enabled) |
---|
218 | |
---|
219 | AC_SUBST(IDL_CFLAGS) |
---|
220 | |
---|
221 | AC_SUBST(CFLAGS)dnl |
---|
222 | AC_SUBST(LIBS)dnl |
---|
223 | |
---|
224 | dnl |
---|
225 | dnl Variables used for ammoniteConf.sh |
---|
226 | dnl |
---|
227 | |
---|
228 | AMMONITE_LIBDIR='-L$$ATHTOOLROOT${libdir}' |
---|
229 | AMMONITE_INCLUDEDIR='-I$$ATHTOOLROOT${includedir}' |
---|
230 | AMMONITE_LIBS='-lammonite-gtk -lammonite' |
---|
231 | |
---|
232 | AC_SUBST(AMMONITE_LIBDIR) |
---|
233 | AC_SUBST(AMMONITE_INCLUDEDIR) |
---|
234 | AC_SUBST(AMMONITE_LIBS) |
---|
235 | |
---|
236 | AC_OUTPUT([ |
---|
237 | ammonite.spec |
---|
238 | Makefile |
---|
239 | idl/Makefile |
---|
240 | src/Makefile |
---|
241 | doc/Makefile |
---|
242 | src/test/Makefile |
---|
243 | src/util/Makefile |
---|
244 | libammonite/Makefile |
---|
245 | libammonite-gtk/Makefile |
---|
246 | data/Makefile |
---|
247 | ]) |
---|
248 | |
---|
249 | dnl <= Configuration summary => |
---|
250 | |
---|
251 | echo "<= ammonite configuration summary :" |
---|
252 | dnl <= Profile support? => |
---|
253 | case "X$ENABLE_PROFILER" in |
---|
254 | X1) |
---|
255 | echo " |
---|
256 | Enable profiler : YES" |
---|
257 | ;; |
---|
258 | *) |
---|
259 | echo " |
---|
260 | Enable profiler : NO" |
---|
261 | echo |
---|
262 | ;; |
---|
263 | esac |
---|
264 | |
---|
265 | dnl <= CFLAGS and LDFLAGS => |
---|
266 | echo " |
---|
267 | CFLAGS : $CFLAGS |
---|
268 | LDFLAGS : $LDFLAGS" |
---|
269 | echo |
---|