sispmctl/configure.ac

77 lines
2.4 KiB
Plaintext
Raw Normal View History

2006-02-20 10:21:29 +00:00
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ(2.59)
AC_INIT(sispmctl, 3.1, mondrian.nuessle@googlemail.com)
2006-02-20 10:21:29 +00:00
AC_CONFIG_AUX_DIR(admin)
AC_CANONICAL_TARGET
AM_INIT_AUTOMAKE(sispmctl,3.1)
2006-02-20 10:21:29 +00:00
# Checks for programs.
AC_PROG_CC
# check configure options
AC_ARG_ENABLE(webless,
[ --enable-webless compile version of sispmctl without internal webserver],
[WEBLESS=true])
AC_SUBST(WEBLESS)
AM_CONDITIONAL(WEBLESSCOND, test x$WEBLESS = xtrue)
AC_ARG_WITH(webdir,[ --with-webdir=DIR use DIR to look for html files for the web-interface], [WEBDIR="$withval"])
AC_SUBST(WEBDIR)
AC_ARG_WITH(bindaddr,[ --with-bindaddr=IP bind listening socket to IP], [BINDADDR="$withval"])
AC_SUBST(BINDADDR)
# Checks for libraries.
dnl check for libusb-config
AC_PATH_PROG(HAVELIBUSB, libusb-config, $PATH)
if test -e "$HAVELIBUSB"; then
2006-02-20 10:21:29 +00:00
dnl LIBUSB_CFLAGS=`$HAVELIBUSB --cflags`
LIBUSB_LIBS=`$HAVELIBUSB --libs`
CFLAGS="$CFLAGS $LIBUSB_CFLAGS"
LIBS="$LIBS $LIBUSB_LIBS"
else
AC_MSG_ERROR([*** libusb-config not found. You need a working libusb installation. Version >=0.1.7])
2006-02-20 10:21:29 +00:00
fi
dnl check for version of libusb
2008-04-01 07:40:19 +00:00
AC_MSG_CHECKING([if libusb version is >= 0.1.9])
libusb_version_needed="1009"
2006-02-20 10:21:29 +00:00
libusb_version=`$HAVELIBUSB --version | sed -e "s/libusb //" | awk 'BEGIN { FS = "."; } { printf "%d", ($''1 * 1000 + $''2) * 1000 + $''3;}'`
if test $libusb_version -lt $libusb_version_needed; then
AC_MSG_RESULT(no)
2008-04-01 07:40:19 +00:00
AC_MSG_ERROR([*** libusb is too old ($libusb_version). You need a libusb installation newer or equal to 0.1.9.])
2006-02-20 10:21:29 +00:00
else
AC_MSG_RESULT(yes)
fi
# Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS([fcntl.h netinet/in.h stdlib.h string.h sys/socket.h unistd.h net/ethernet.h sys/ethernet.h])
2006-02-20 10:21:29 +00:00
# Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_TYPE_SIZE_T
AC_TYPE_UID_T
# Checks for library functions.
AC_FUNC_MALLOC
AC_CHECK_FUNCS([memset strchr strdup strerror strncasecmp strrchr])
AC_CHECK_DECL(MSG_NOSIGNAL)
AC_CHECK_FUNC(nanosleep, [true], [AC_CHECK_LIB(rt, nanosleep)])
AC_CHECK_FUNC(inet_pton, [true], [AC_CHECK_LIB(nsl, inet_pton)])
AC_CHECK_FUNC(socket, [true], [AC_CHECK_LIB(socket, socket)])
2006-02-20 10:21:29 +00:00
AC_CONFIG_FILES([Makefile
src/Makefile])
AM_CONFIG_HEADER(config.h)
2006-02-20 10:21:29 +00:00
AC_OUTPUT
echo ""
echo "Good - your configure finished. Start make now"
echo ""