source: trunk/third/ammonite/configure.in @ 15618

Revision 15618, 6.5 KB checked in by ghudson, 24 years ago (diff)
Need to include alloca.h where present to use alloca().
Line 
1AC_INIT()
2
3AMMONITE_MAJOR_VERSION=0
4AMMONITE_MINOR_VERSION=8
5AMMONITE_MICRO_VERSION=1
6AMMONITE_VERSION="$AMMONITE_MAJOR_VERSION.$AMMONITE_MINOR_VERSION.$AMMONITE_MICRO_VERSION"
7AM_INIT_AUTOMAKE(ammonite,$AMMONITE_VERSION)
8AM_CONFIG_HEADER(src/config.h)
9
10AC_SUBST(AMMONITE_MAJOR_VERSION)
11AC_SUBST(AMMONITE_MINOR_VERSION)
12AC_SUBST(AMMONITE_MICRO_VERSION)
13AC_SUBST(AMMONITE_VERSION)
14
15dnl Checks for programs.
16AM_DISABLE_STATIC
17AM_PROG_LIBTOOL
18AC_PROG_CC
19AC_PROG_INSTALL
20
21dnl Checks for header files.
22AC_HEADER_STDC
23AC_CHECK_HEADERS(fcntl.h sys/time.h syslog.h unistd.h alloca.h)
24
25dnl Checks for typedefs, structures, and compiler characteristics.
26AC_C_CONST
27AC_TYPE_SIZE_T
28AC_HEADER_TIME
29AC_C_INLINE
30
31dnl ====================================
32dnl =
33dnl = Profiling support
34dnl =
35dnl ====================================
36ENABLE_PROFILER=
37AC_ARG_ENABLE(profiler,
38[  --enable-profiler            Enable profiler],
39ENABLE_PROFILER=1
40AC_DEFINE(ENABLE_PROFILER))
41
42if test "x$ENABLE_PROFILER" = "x1"
43then
44        CFLAGS="-g -O -gdwarf-2 -finstrument-functions -D__NO_STRING_INLINES"
45        LDFLAGS="/gnome/PROFILE/lib/libprofiler.so -lpthread"
46fi
47
48AC_SUBST(ENABLE_PROFILER)
49AM_CONDITIONAL(ENABLE_PROFILER, test "x$ENABLE_PROFILER" = "x1")
50dnl ====================================
51dnl = Profiling support
52dnl ====================================
53
54dnl borrowed from stunnel - check for openssl
55checkssldir() { :
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
64AC_MSG_CHECKING([for openSSL directory])
65AC_ARG_WITH(openssl,
66    [  --with-openssl=DIR      location of installed openSSL libraries/include files])
67
68dnl Search default localtions of SSL library
69for 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
73done
74
75if 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=
83else
84dnl
85dnl OPENSSL_LIBS="-L$ssldir/lib -lssl -lcrypto"
86dnl
87dnl For now we are linking in openssl statically
88dnl
89    OPENSSL_LIBS="$ssldir/lib/libssl.a $ssldir/lib/libcrypto.a"
90
91    OPENSSL_CFLAGS="-I$ssldir/include"
92fi
93AC_MSG_RESULT($ssldir)
94dnl AC_DEFINE_UNQUOTED(OPENSSL_LIBS, "$OPENSSL_LIBS")
95dnl AC_DEFINE_UNQUOTED(OPENSSL_CFLAGS, "$OPENSSL_CFLAGS")
96AC_SUBST(HAVE_OPENSSL)
97AC_SUBST(OPENSSL_LIBS)
98AC_SUBST(OPENSSL_CFLAGS)
99
100
101dnl chris - allow user to choose log file location, port and username
102AC_ARG_WITH(log-file, \
103  [--with-log-file=FILE    Default logfile name], \
104        [AC_DEFINE_UNQUOTED(DEFAULT_LOG, "$withval" )])
105
106dnl mfleming -- added GLIB
107AM_PATH_GLIB(1.2.8,,
108AC_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/.]))
111AM_PATH_GCONF(0.11.0,,,gconf)
112
113AC_PATH_PROG(XML_CONFIG,xml-config,no)
114if test x$XML_CONFIG = xno; then
115  AC_MSG_ERROR(Couldn't find xml-config please install the gnome-xml package)
116fi
117XML_LIBS=`$XML_CONFIG --libs`
118XML_CFLAGS=`$XML_CONFIG --cflags`
119AC_SUBST(XML_LIBS)
120AC_SUBST(XML_CFLAGS)
121
122AM_PATH_OAF(0.6.0)
123
124dnl This is only for the login box
125AM_PATH_GNOME(1.2.0,,AC_MSG_ERROR([*** GNOME 1.2.0 or better is required.]), gtk gnome gnomeui)
126AC_SUBST(GTK_LIBS)
127AC_SUBST(GTK_CFLAGS)
128AC_SUBST(GNOME_LIBS)
129AC_SUBST(GNOME_CFLAGS)
130AC_SUBST(GNOMEUI_LIBS)
131AC_SUBST(GNOMEUI_CFLAGS)
132
133
134AC_CHECK_LIB(popt, poptGetContext,,
135AC_MSG_ERROR([You must have popt installed. Get it from ftp://ftp.redhat.com/pub/redhat/code/popt/]))
136
137dnl Checks for library functions.
138AC_TYPE_SIGNAL
139AC_FUNC_STRFTIME
140AC_FUNC_VPRINTF
141AC_CHECK_FUNCS(socket select strerror strdup vsyslog vsnprintf)
142
143dnl Add the warnings if we have the GCC compiler
144rm -f conftest*
145
146AC_ARG_ENABLE(more-warnings,
147[  --enable-more-warnings  Maximum compiler warnings],
148set_more_warnings="$enableval",[
149if test -f $srcdir/CVSVERSION; then
150        set_more_warnings=yes
151else
152        set_more_warnings=no
153fi
154])
155AC_MSG_CHECKING(for more warnings, including -Werror)
156if 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
181else
182        AC_MSG_RESULT(no)
183fi
184
185dnl ORBit
186AM_PATH_ORBIT
187
188
189AC_CHECK_LIB(nsl, gethostname, [LIBS="$LIBS -lnsl"])
190AC_CHECK_LIB(socket, setsockopt, [LIBS="$LIBS -lsocket"])
191
192dnl Check to see if the debuging code is turned on
193AC_MSG_CHECKING(whether to include debugging code)
194AC_ARG_ENABLE(debug, \
195  [--enable-debug=[yes/no]          turn on additional debugging code],
196  [debug_enabled=yes], [debug_enabled=no])
197if test "$debug_enabled" = "yes"; then
198  CFLAGS="$CFLAGS -DDEBUG"
199fi
200AC_MSG_RESULT($debug_enabled)
201
202dnl Check for SOCKS support
203AC_MSG_CHECKING(whether to include support for SOCKS)
204AC_ARG_ENABLE(socks, \
205  [--enable-socks=[yes/no]          enable SOCKS support],
206  [socks_enabled=yes], [socks_enabled=no])
207if 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
216fi
217AC_MSG_RESULT($socks_enabled)
218
219AC_SUBST(IDL_CFLAGS)
220
221AC_SUBST(CFLAGS)dnl
222AC_SUBST(LIBS)dnl
223
224dnl
225dnl Variables used for ammoniteConf.sh
226dnl
227
228AMMONITE_LIBDIR='-L$$ATHTOOLROOT${libdir}'
229AMMONITE_INCLUDEDIR='-I$$ATHTOOLROOT${includedir}'
230AMMONITE_LIBS='-lammonite-gtk -lammonite'
231
232AC_SUBST(AMMONITE_LIBDIR)
233AC_SUBST(AMMONITE_INCLUDEDIR)
234AC_SUBST(AMMONITE_LIBS)
235
236AC_OUTPUT([
237ammonite.spec
238Makefile
239idl/Makefile
240src/Makefile
241doc/Makefile
242src/test/Makefile
243src/util/Makefile
244libammonite/Makefile
245libammonite-gtk/Makefile
246data/Makefile
247])
248
249dnl <= Configuration summary =>
250
251echo "<= ammonite configuration summary :"
252dnl <= Profile support? =>
253case "X$ENABLE_PROFILER" in
254X1)
255echo "
256Enable profiler         : YES"
257;;
258*)
259echo "
260Enable profiler         : NO"
261echo
262;;
263esac
264
265dnl <= CFLAGS and LDFLAGS =>
266echo "
267CFLAGS                  : $CFLAGS
268LDFLAGS                 : $LDFLAGS"
269echo
Note: See TracBrowser for help on using the repository browser.