2002-08-31 09:28:34 +00:00
|
|
|
dnl Process this file with autoconf to produce a configure script.
|
|
|
|
AC_INIT(opsb.c)
|
|
|
|
AC_CONFIG_HEADER(modconfig.h)
|
2003-05-14 14:21:44 +00:00
|
|
|
PACKAGE=OPSB
|
2004-03-13 23:35:08 +00:00
|
|
|
MODULE_MAJOR=2
|
|
|
|
MODULE_MINOR=1
|
|
|
|
VERSION=$MODULE_MAJOR.$MODULE_MINOR
|
|
|
|
AC_DEFINE_UNQUOTED(MODULE_VERSION, "$VERSION")
|
|
|
|
AC_DEFINE_UNQUOTED(MODULE_MAJOR, "$MODULE_MAJOR")
|
|
|
|
AC_DEFINE_UNQUOTED(MODULE_MINOR, "$MODULE_MINOR")
|
2002-08-31 09:28:34 +00:00
|
|
|
DIRINST=~/NeoStats/
|
|
|
|
AC_PREFIX_DEFAULT(~/NeoStats/)
|
|
|
|
CFLAGS="$CFLAGS -O2 -Wall"
|
|
|
|
|
|
|
|
dnl Checks for programs.
|
|
|
|
AC_PROG_CC
|
|
|
|
AC_PROG_INSTALL
|
2003-10-22 10:48:53 +00:00
|
|
|
ETR_SOCKET_NSL
|
|
|
|
|
|
|
|
dnl Checks for header files.
|
|
|
|
AC_HEADER_STDC
|
|
|
|
|
|
|
|
AC_CHECK_HEADERS(sys/poll.h, have_poll_sys_h=yes, have_sys_poll_h=no)
|
|
|
|
|
|
|
|
AC_CHECK_HEADERS(fcntl.h sys/time.h unistd.h strings.h)
|
|
|
|
|
|
|
|
dnl Checks for typedefs, structures, and compiler characteristics.
|
|
|
|
AC_C_CONST
|
|
|
|
AC_TYPE_SIZE_T
|
|
|
|
AC_HEADER_TIME
|
|
|
|
|
|
|
|
AC_FUNC_SNPRINTF
|
|
|
|
|
|
|
|
dnl if they want select() or they don't have poll() then we need to check
|
|
|
|
dnl that we actually have select()
|
|
|
|
if test "$have_sys_poll_h" = "no"; then
|
|
|
|
AC_CHECK_FUNCS(select, have_select=yes, have_select=no)
|
|
|
|
if test "$have_select" = "no"; then
|
|
|
|
AC_MSG_ERROR([No select() implementation found])
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
AC_CHECK_FUNCS(inet_aton inet_pton)
|
|
|
|
|
|
|
|
dnl Check if we can use gethostbyname2 for ipv6
|
|
|
|
AC_CHECK_FUNCS(gethostbyname gethostbyname2)
|
|
|
|
|
|
|
|
dnl AIX fun
|
|
|
|
AC_C_BIGENDIAN
|
|
|
|
|
|
|
|
dnl Solaris has to be weird doesn't it...
|
|
|
|
AC_CHECK_LIB(socket, socket, AC_SUBST(LSOCKET, [-lsocket]))
|
|
|
|
AC_CHECK_LIB(nsl, gethostbyname, AC_SUBST(LNSL, [-lnsl]))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2002-08-31 09:28:34 +00:00
|
|
|
|
|
|
|
AC_MSG_CHECKING(Location of NeoStats...)
|
|
|
|
AC_ARG_WITH(neostats,
|
|
|
|
[ --with-neostats=DIR Location of NeoStats installation],
|
|
|
|
[DIRINST=$withval])
|
|
|
|
AC_MSG_RESULT($DIRINST)
|
|
|
|
|
|
|
|
|
|
|
|
AC_CHECK_FILE($DIRINST/include/dl.h,
|
|
|
|
[INCLUDEDIR="$DIRINST/include/"],
|
|
|
|
[AC_MSG_ERROR(Can't find existing NeoStats Installation please supply with --with-neostats option)])
|
|
|
|
|
|
|
|
|
2003-04-17 15:55:47 +00:00
|
|
|
CPPFLAGS="$CPPFLAGS -I$INCLUDEDIR"
|
|
|
|
dnl Check we are running the latest supported version of NeoStats
|
|
|
|
AC_MSG_CHECKING(Version of NeoStats...)
|
|
|
|
AC_TRY_RUN(
|
|
|
|
[
|
|
|
|
#include <config.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
int main(void) {
|
|
|
|
if (MAJOR >= 2) {
|
|
|
|
if (MINOR >= 5) {
|
2003-10-29 12:08:13 +00:00
|
|
|
if (REV >= 8) {
|
2003-04-17 15:55:47 +00:00
|
|
|
exit(0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
exit(1);
|
|
|
|
}
|
|
|
|
], ns_version_ok='yes',
|
|
|
|
ns_version_ok='no',
|
|
|
|
ns_version_ok='no')
|
|
|
|
if test "$ns_version_ok" = "yes"; then
|
|
|
|
AC_MSG_RESULT(Compatible Version);
|
|
|
|
else
|
2003-10-29 12:08:13 +00:00
|
|
|
AC_MSG_ERROR(This Module requires NeoStats 2.5.8 or Higher)
|
2003-04-17 15:55:47 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2002-08-31 09:28:34 +00:00
|
|
|
dnl check if we are running with Debug....
|
|
|
|
AC_MSG_CHECKING(Whether to Enable Debuging...)
|
|
|
|
AC_ARG_ENABLE(debug,
|
|
|
|
[ --enable-debug - Enable Debuging],
|
|
|
|
[ case "$enableval" in
|
|
|
|
yes)
|
|
|
|
CFLAGS="$CFLAGS -ggdb"
|
2002-11-05 13:31:59 +00:00
|
|
|
AC_DEFINE(DEBUG,1)
|
2002-08-31 09:28:34 +00:00
|
|
|
AC_MSG_RESULT(yes - Watch your Log Files)
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
AC_MSG_RESULT(no)
|
|
|
|
;;
|
|
|
|
esac],
|
|
|
|
AC_MSG_RESULT(no)
|
|
|
|
)
|
|
|
|
|
|
|
|
AC_SUBST(DIRINST)
|
|
|
|
AC_SUBST(CFLAGS)
|
2003-05-14 14:21:44 +00:00
|
|
|
AC_SUBST(PACKAGE)
|
|
|
|
AC_SUBST(VERSION)
|
2003-10-22 10:48:53 +00:00
|
|
|
AC_OUTPUT(Makefile libopm/Makefile)
|
2002-08-31 09:28:34 +00:00
|
|
|
echo "(*----------------------------------------------------------*)"
|
|
|
|
echo "(| Important Instructions |)"
|
|
|
|
echo "(*----------------------------------------------------------*)"
|
2004-03-06 21:09:44 +00:00
|
|
|
echo "(| Now that configure is complete, type 'make' to compile |)"
|
|
|
|
echo "(| the module. When the compile has completed, type |)"
|
|
|
|
echo "(| 'make install' to install the module. |)"
|
|
|
|
echo "(| For BSD you might need to use 'gmake' and 'gmake install'|)"
|
2002-08-31 09:28:34 +00:00
|
|
|
echo "(*----------------------------------------------------------*)"
|
|
|
|
echo "(| For Support please visit: |)"
|
|
|
|
echo "(| IRC: /server irc.irc-chat.org |)"
|
|
|
|
echo "(| #neostats channel |)"
|
|
|
|
echo "(| WWW: http://www.neostats.net/boards/ |)"
|
|
|
|
echo "(*----------------------------------------------------------*)"
|
|
|
|
echo "(|This Module was written by: |)"
|
|
|
|
echo "(| fish (fish@dynam.ac) |)"
|
|
|
|
echo "(*----------------------------------------------------------*)"
|