sispmctl/configure.in

70 lines
2.1 KiB
Plaintext

# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ(2.59)
AC_INIT(sispmctl, 2.2, nuessle@uni-mannheim.de)
AC_CONFIG_AUX_DIR(admin)
AC_CANONICAL_TARGET
AM_INIT_AUTOMAKE(sispmctl,2.2)
# 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 ! -z "$HAVELIBUSB"; then
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.])
fi
dnl check for version of libusb
AC_MSG_CHECKING([if libusb version is >= 0.1.7])
libusb_version_needed="1007"
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)
AC_MSG_ERROR([*** libusb is too old ($libusb_version). You need a libusb installation newer or equal to 0.1.7.])
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])
# 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 socket strchr strdup strerror strncasecmp strrchr])
AC_CONFIG_FILES([Makefile
src/Makefile])
AC_OUTPUT
echo ""
echo "Good - your configure finished. Start make now"
echo ""