aboutsummaryrefslogtreecommitdiffstats
path: root/configure.in
diff options
context:
space:
mode:
Diffstat (limited to 'configure.in')
-rw-r--r--configure.in115
1 files changed, 26 insertions, 89 deletions
diff --git a/configure.in b/configure.in
index aaa89e1..22626af 100644
--- a/configure.in
+++ b/configure.in
@@ -1,6 +1,4 @@
-AC_PREREQ(2.12)
-AC_COPYRIGHT(test)
-
+# proces this file with autoconf
rm -f config.cache
AC_INIT(acconfig.h)
@@ -8,20 +6,14 @@ AC_INIT(acconfig.h)
AC_CANONICAL_SYSTEM
AC_ARG_PROGRAM
-AM_INIT_AUTOMAKE(sualibrary,0.1.4)
-
-AC_PREFIX_DEFAULT(/usr/local)
-if test "x$prefix" = "xNONE"; then
- prefix=$ac_default_prefix
- ac_configure_args="$ac_configure_args --prefix $prefix"
-fi
+AM_INIT_AUTOMAKE(sualibrary,0.1.5)
-# keep this order because automake gets confused apart from the authors
AM_CONFIG_HEADER(config.h:config.h.in)
# Checks for programs.
AC_PROG_AWK
AC_PROG_CC
+AC_PROG_CPP
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_CXX
@@ -30,7 +22,7 @@ AC_PROG_RANLIB
# Checks for libraries.
# create only shared libtool-libraries (add --enable-shared)
-AC_ENABLE_SHARED(no)
+AC_ENABLE_SHARED(yes)
# AM_DISABLE_SHARED
# set the following to yes, if you want to create static
@@ -60,17 +52,21 @@ all_includes="$all_includes $USER_INCLUDES"
AC_SUBST(all_includes)
AC_SUBST(all_libraries)
AC_SUBST(AUTODIRS)
+AC_SUBST(ac_aux_dir)
-# Checks for header files.
+AC_SUBST(CHECKERGCC,[checkergcc])
+# Checks for header files.
AC_HEADER_STDC
AC_HEADER_TIME
-AC_CHECK_HEADERS(strings.h sys/file.h sys/time.h unistd.h netinet/in.h netdb.h \
-sys/socket.h netinet/icmp6.h)
+AC_CHECK_HEADERS([stdlib.h string.h])
+AC_CHECK_HEADERS(strings.h sys/file.h sys/time.h unistd.h)
+AC_CHECK_HEADERS( netinet/in.h netdb.h sys/socket.h netinet/icmp6.h)
AC_CHECK_HEADERS(sys/poll.h, AC_DEFINE(HAVE_SYS_POLL_H))
# Checks for typedefs, structures, and compiler characteristics.
+AC_C_CONST
# ----------------------
# Packages configuration - Blatantly stolen from zebra !
@@ -198,94 +194,34 @@ AC_TRY_COMPILE([#include <sys/types.h>
AC_MSG_RESULT(yes)],
[AC_MSG_RESULT(no)])
-# This is taken from the ethereal configuration scripts.
-# We check whether user wants to build gtk-based programs
-# These need to be enabled explicitly
-GTK_OK=yes
-
-# GTK checks
-# We don't add $GLIB_LIBS to LIBS, because we don't want to force all
-# programs to be built with GTK+.
-#
+# Checks for library functions.
+AC_CHECK_LIB(socket, socket)
+AC_CHECK_LIB(nsl, gethostbyname)
+# removed libefence....this should be used though, when we REALLY debug :-)
+AC_CHECK_LIB(efence, malloc)
-AM_PATH_GTK(1.2.0, CFLAGS="$CFLAGS $GTK_CFLAGS", GTK_OK=no)
-if test "x$GTK_OK" = "xno" ; then
- AC_MSG_RESULT(GTK distribution not found - disabling sctpd compilation.)
- AC_MSG_RESULT(On FreeBSD, you might want to do: ln -s gtk12-config gtk-config)
-fi
+AC_CHECK_LIB(c, inet_ntop, [AC_DEFINE(HAVE_INET_NTOP)])
+AC_CHECK_LIB(c, inet_pton, [AC_DEFINE(HAVE_INET_PTON)])
+AC_CHECK_LIB(c, inet_aton, [AC_DEFINE(HAVE_INET_ATON)])
-# GLib checks
-# This doesn't add GLIB_CFLAGS to CFLAGS, because AM_PATH_GTK will add
-# GTK_CFLAGS to CFLAGS, and GTK_CFLAGS is a superset of CFLAGS.
-# However, this means that both @GLIB_LIBS@ and @GTK_LIBS@ will be
-# set when generating the Makefile, so we can make programs that require
-# only GLib link with @GLIB_LIBS@ and make programs that require GTK+
-# link with @GTK_LIBS@ (which includes @GLIB_LIBS@).
-# We don't add $GLIB_LIBS to LIBS, because we don't want to force all
-# programs to be built with GLib.
-#
+# GLib & SCTPlib checks
enable_sctpd="no"
-# gtkprogs_bin=""
sctpd_SUBDIRS=""
+
# Honor GLIB_CFLAGS
AM_PATH_GLIB(1.2.0, CFLAGS="$CFLAGS $GLIB_CFLAGS", AC_MSG_ERROR(GLib distribution not found. On FreeBSD do: ln -s glib12-config glib-config), gmodule)
+glib_LIBS="$GLIB_LIBS"
+AC_SUBST(glib_LIBS)
-#AC_SUBST(gtkprogs_bin)
-AC_SUBST(sctp_SUBDIRS)
-
-
-# Checks for library functions.
-AC_CHECK_LIB(socket, socket)
-AC_CHECK_LIB(nsl, gethostbyname)
-AC_CHECK_LIB(sctp, sctp_eventloop)
-
-# removed libefence....this should be used though, when we REALLY debug :-)
-AC_CHECK_LIB(efence, malloc)
AC_CHECK_LIB(glib, g_main_add_poll)
+sctp_LIBS="-L/usr/local/lib -lsctplib"
-AC_CHECK_HEADERS(ncurses.h, AC_DEFINE(HAVE_NCURSES_H))
-# AC_CHECK_HEADERS(curses.h, AC_DEFINE(HAVE_CURSES_H))
-AC_CHECK_LIB(ncurses, initscr, found_ncurses_lib=yes,found_ncurses_lib=no)
-
-if test "x$found_ncurses_lib" = "xyes" -a "x$ac_cv_header_ncurses_h" = "xyes" ; then
- curses_LIBS="-lncurses"
- # CPPFLAGS="$CPPFLAGS -I/usr/include/ncurses.h"
- cursesprogs_BIN="monitor chat echo_monitor"
-else
-# AC_CHECK_LIB(curses, initscr, found_curses_lib=yes,found_curses_lib=no)
-# if test "x$found_curses_lib" = "xyes" -a "x$ac_cv_header_curses_h" = "xyes" ; then
-# curses_LIBS="-lcurses"
- # CPPFLAGS="$CPPFLAGS -I/usr/include/curses.h"
-# cursesprogs_BIN="monitor chat echo_monitor"
-# else
- cursesprogs_BIN=""
- curses_LIBS=""
- AC_MSG_WARN(nCurses libraries seem to be missing. Not compiling Curses-Programs! Please contact ajung@exp-math.uni-essen.de in case this test should not have failed!)
-# fi
-fi
-AC_SUBST(cursesprogs_BIN)
-AC_SUBST(curses_LIBS)
-
-if test "$GTK_OK" = "yes" ; then
- sctp_LIBS="-L/usr/local/lib/ -lsctp"
- gtk_LIBS="$GTK_LIBS"
- glib_LIBS="$GLIB_LIBS"
-else
- sctp_LIBS="-L/usr/local/lib/ -lsctp"
- gtk_LIBS=""
- glib_LIBS="$GLIB_LIBS"
-fi
+AC_CHECK_LIB(sctplib, sctp_eventLoop)
AC_SUBST(sctp_LIBS)
-AC_SUBST(gtk_LIBS)
-AC_SUBST(glib_LIBS)
-
-AC_CHECK_LIB(c, inet_ntop, [AC_DEFINE(HAVE_INET_NTOP)])
-AC_CHECK_LIB(c, inet_pton, [AC_DEFINE(HAVE_INET_PTON)])
-AC_CHECK_LIB(c, inet_aton, [AC_DEFINE(HAVE_INET_ATON)])
# Checks for library functions.
AC_FUNC_VPRINTF
@@ -293,6 +229,7 @@ AC_FUNC_MEMCMP
AC_CHECK_FUNCS(gettimeofday socket strerror poll getuid setuid geteuid random)
AC_CHECK_FUNCS(getaddrinfo, [have_getaddrinfo=yes], [have_getaddrinfo=no])
+CFLAGS="$CFLAGS -D_REENTRANT -D_THREAD_SAFE"
# checks for host/build/target system type
AC_CANONICAL_HOST