This repository has been archived on 2025-02-12. You can view files and clone it, but cannot push or open issues or pull requests.
NeoStats-seenserv/configure.in

99 lines
2.4 KiB
Text

dnl Process this file with autoconf to produce a configure script.
AC_INIT(seenserv.c)
AC_CONFIG_HEADER(modconfig.h)
PACKAGE=SeenServ
MODULE_MAJOR=3
MODULE_MINOR=0
MODULE_REV=a4
VERSION=$MODULE_MAJOR.$MODULE_MINOR.$MODULE_REV
AC_DEFINE_UNQUOTED(MODULE_VERSION, "$VERSION")
AC_DEFINE_UNQUOTED(MODULE_MAJOR, "$MODULE_MAJOR")
AC_DEFINE_UNQUOTED(MODULE_MINOR, "$MODULE_MINOR")
AC_DEFINE_UNQUOTED(MODULE_REV, "$MODULE_REV")
DIRINST=~/NeoStats3.0/
AC_PREFIX_DEFAULT(~/NeoStats3.0/)
CFLAGS="$CFLAGS -O2 -fno-strict-aliasing -fPIC -DPIC"
case "$host_os" in
*openbsd*)
MAKEDEPENDENCIES="";;
*freebsd*)
MAKEDEPENDENCIES="";;
*)
MAKEDEPENDENCIES="-include \$(OBJS:.o=.d)";;
esac
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/neostats.h,
[INCLUDEDIR="$DIRINST/include/"],
[AC_MSG_ERROR(Can't find existing NeoStats Installation please supply with --with-neostats option)])
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 >= 3) {
if (MINOR >= 0) {
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
AC_MSG_ERROR(This module requires NeoStats 3.0.a2 or higher)
fi
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 -Wall -ggdb"
AC_DEFINE(DEBUG,1)
AC_MSG_RESULT(yes - Watch your Log Files)
;;
*)
AC_MSG_RESULT(no)
;;
esac],
AC_MSG_RESULT(no)
)
dnl Checks for programs.
AC_PROG_CC
AC_PROG_INSTALL
AC_ARG_WITH(distversion, [ --with-distversion - Version Name to use for
making distributions],
[DISTDIRVERSION="$PACKAGE-$VERSION-$withval"],
[DISTDIRVERSION="$PACKAGE-$VERSION"])
AC_SUBST(DISTDIRVERSION)
AC_SUBST(DIRINST)
AC_SUBST(MAKEDEPENDENCIES)
AC_SUBST(CFLAGS)
AC_SUBST(PACKAGE)
AC_SUBST(VERSION)
AC_OUTPUT(Makefile)
echo "Configuration complete."
read -p "Press Enter key to read the release notes"
clear
more RELNOTES
echo "Run 'make' (or 'gmake' on some systems) to compile."
echo "If you require support, see the README file."