2011-05-14 10:55:13 +00:00
|
|
|
dnl Process this file with autoconf to produce a configure script.
|
2011-05-14 10:55:07 +00:00
|
|
|
|
|
|
|
AC_PREREQ(2.59)
|
2011-05-14 10:55:13 +00:00
|
|
|
AC_INIT([usbip], [0.1.8], [usbip-devel@lists.sourceforge.net])
|
|
|
|
AC_DEFINE([USBIP_VERSION], [0x000106], [numeric version number])
|
|
|
|
|
|
|
|
AC_CONFIG_SRCDIR([src/usbipd.c])
|
|
|
|
AC_CONFIG_HEADERS([config.h])
|
2011-05-14 10:55:07 +00:00
|
|
|
|
|
|
|
AM_INIT_AUTOMAKE([foreign])
|
2011-05-14 10:55:13 +00:00
|
|
|
LT_INIT
|
2011-05-14 10:55:07 +00:00
|
|
|
|
|
|
|
# Silent build for automake >= 1.11
|
|
|
|
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
|
|
|
|
|
|
|
|
AC_SUBST([EXTRA_CFLAGS])
|
|
|
|
|
|
|
|
# Checks for programs.
|
|
|
|
AC_PROG_CC
|
|
|
|
AC_PROG_INSTALL
|
2011-05-14 10:55:13 +00:00
|
|
|
AC_PROG_MAKE_SET
|
2011-05-14 10:55:07 +00:00
|
|
|
|
|
|
|
# Checks for header files.
|
|
|
|
AC_HEADER_DIRENT
|
|
|
|
AC_HEADER_STDC
|
2011-05-14 10:55:13 +00:00
|
|
|
AC_CHECK_HEADERS([arpa/inet.h fcntl.h netdb.h netinet/in.h stdint.h stdlib.h dnl
|
|
|
|
string.h strings.h sys/socket.h syslog.h unistd.h])
|
2011-05-14 10:55:07 +00:00
|
|
|
|
|
|
|
# Checks for typedefs, structures, and compiler characteristics.
|
2011-05-14 10:55:13 +00:00
|
|
|
AC_TYPE_INT32_T
|
2011-05-14 10:55:07 +00:00
|
|
|
AC_TYPE_SIZE_T
|
2011-05-14 10:55:13 +00:00
|
|
|
AC_TYPE_SSIZE_T
|
|
|
|
AC_TYPE_UINT16_T
|
|
|
|
AC_TYPE_UINT32_T
|
|
|
|
AC_TYPE_UINT8_T
|
2011-05-14 10:55:07 +00:00
|
|
|
|
|
|
|
# Checks for library functions.
|
|
|
|
AC_FUNC_REALLOC
|
2011-05-14 10:55:13 +00:00
|
|
|
AC_CHECK_FUNCS([bzero memset mkdir regcomp socket strchr strerror strstr dnl
|
|
|
|
strtoul])
|
2011-05-14 10:55:07 +00:00
|
|
|
|
2011-05-14 10:55:13 +00:00
|
|
|
AC_CHECK_HEADER([sysfs/libsysfs.h],
|
|
|
|
[AC_CHECK_LIB([sysfs], [sysfs_open_directory_list],
|
|
|
|
[LIBS="$LIBS -lsysfs"],
|
|
|
|
[AC_MSG_ERROR([Missing sysfs2 library!])])],
|
|
|
|
[AC_MSG_ERROR([Missing /usr/include/sysfs/libsysfs.h])])
|
2011-05-14 10:55:07 +00:00
|
|
|
|
2011-05-14 10:55:13 +00:00
|
|
|
# Checks for libwrap library.
|
2011-05-14 10:55:07 +00:00
|
|
|
AC_MSG_CHECKING([whether to use the libwrap (TCP wrappers) library])
|
2011-05-14 10:55:13 +00:00
|
|
|
AC_ARG_WITH([tcp-wrappers],
|
|
|
|
[AS_HELP_STRING([--with-tcp-wrappers],
|
|
|
|
[use the libwrap (TCP wrappers) library])],
|
|
|
|
dnl [ACTION-IF-GIVEN]
|
|
|
|
[saved_LIBS="$LIBS"
|
|
|
|
if test "$withval" = "yes"; then
|
|
|
|
AC_MSG_RESULT([yes])
|
|
|
|
AC_MSG_CHECKING([for hosts_access in -lwrap])
|
|
|
|
LIBS="-lwrap $LIBS"
|
|
|
|
AC_TRY_LINK(
|
|
|
|
[int hosts_access(); int allow_severity, deny_severity;],
|
|
|
|
[hosts_access()],
|
|
|
|
[AC_MSG_RESULT([yes]);
|
|
|
|
AC_DEFINE([HAVE_LIBWRAP], [1],
|
|
|
|
[use tcp wrapper]) wrap_LIB="-lwrap"],
|
|
|
|
[AC_MSG_RESULT([not found]); exit 1])
|
|
|
|
else
|
|
|
|
AC_MSG_RESULT([no])
|
|
|
|
fi
|
|
|
|
LIBS="$saved_LIBS"],
|
|
|
|
dnl [ACTION-IF-NOT-GIVEN]
|
|
|
|
[AC_MSG_RESULT([(default)])
|
|
|
|
AC_MSG_CHECKING([for hosts_access in -lwrap])
|
|
|
|
saved_LIBS="$LIBS"
|
|
|
|
LIBS="-lwrap $saved_LIBS"
|
|
|
|
AC_TRY_LINK(
|
|
|
|
[int hosts_access(); int allow_severity, deny_severity;],
|
|
|
|
[hosts_access()],
|
|
|
|
[AC_MSG_RESULT([yes]);
|
|
|
|
AC_DEFINE([HAVE_LIBWRAP], [1], [use tcp wrapper])],
|
|
|
|
[AC_MSG_RESULT([no]); LIBS="$saved_LIBS"])])
|
|
|
|
|
|
|
|
# Sets directory containing usb.ids.
|
2011-05-14 10:55:07 +00:00
|
|
|
USBIDS_DIR='${datadir}/usbip'
|
2011-05-14 10:55:13 +00:00
|
|
|
AC_ARG_WITH([usbids-dir],
|
|
|
|
[AS_HELP_STRING([--with-usbids-dir=DIR],
|
|
|
|
[where usb.ids is found (default ${datadir}/usbip)])],
|
|
|
|
[USBIDS_DIR=$withval])
|
|
|
|
AC_SUBST([USBIDS_DIR])
|
2011-05-14 10:55:07 +00:00
|
|
|
|
|
|
|
dnl FIXME: when disabled, empty directry is created
|
|
|
|
usbids=install
|
2011-05-14 10:55:13 +00:00
|
|
|
AC_ARG_ENABLE([usbids-install],
|
|
|
|
[AS_HELP_STRING([--enable-usbids-install],
|
|
|
|
[install usb.ids (default)])],
|
|
|
|
[AS_CASE([$enableval],
|
|
|
|
[yes], [usbids=install],
|
|
|
|
[no], [usbids=notinstall],
|
|
|
|
[AC_MSG_ERROR(
|
|
|
|
[bad value ${enableval} for --enable-usbids-install])]
|
|
|
|
)])
|
|
|
|
AM_CONDITIONAL([INSTALL_USBIDS], [test x$usbids = xinstall])
|
2011-05-14 10:55:07 +00:00
|
|
|
|
|
|
|
GLIB2_REQUIRED=2.6.0
|
2011-05-14 10:55:13 +00:00
|
|
|
PKG_CHECK_MODULES([PACKAGE], [glib-2.0 >= $GLIB2_REQUIRED])
|
|
|
|
AC_SUBST([PACKAGE_CFLAGS])
|
|
|
|
AC_SUBST([PACKAGE_LIBS])
|
2011-05-14 10:55:07 +00:00
|
|
|
|
2011-05-14 10:55:09 +00:00
|
|
|
AC_CONFIG_FILES([Makefile libsrc/Makefile src/Makefile])
|
2011-05-14 10:55:07 +00:00
|
|
|
AC_OUTPUT
|