提交 af8bab06 编写于 作者: M matt mooney 提交者: Greg Kroah-Hartman

staging: usbip: userspace: configure.ac: major overhaul

All parameters have been quoted; and autoscan was rerun so new
headers, types, and functions were added. The deprecated macros
AM_CONFIG_HEADER and AM_PROG_LIBTOOL were changed to
AC_CONFIG_HEADERS and LT_INIT, respectively. The AS_HELP_STRING
macro is used to avoid arbitrary spacing for proper help menu
alignment, and AS_CASE to avoid quoting issues. And finally, the
macros were realigned to allow mere mortals the ability to read them.
Signed-off-by: Nmatt mooney <mfm@muteddisk.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
上级 220973dd
# -*- Autoconf -*- dnl Process this file with autoconf to produce a configure script.
# Process this file with autoconf to produce a configure script.
AC_PREREQ(2.59) AC_PREREQ(2.59)
AC_REVISION($Id$) AC_INIT([usbip], [0.1.8], [usbip-devel@lists.sourceforge.net])
AC_INIT(usbip, 0.1.8, usbip-devel@lists.sourceforge.net) AC_DEFINE([USBIP_VERSION], [0x000106], [numeric version number])
AC_DEFINE(USBIP_VERSION, 0x000106, Numeric version number)
AC_CONFIG_SRCDIR([src/usbipd.c])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_SRCDIR([config.h.in])
AM_INIT_AUTOMAKE([foreign]) AM_INIT_AUTOMAKE([foreign])
LT_INIT
# Silent build for automake >= 1.11 # Silent build for automake >= 1.11
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
AM_CONFIG_HEADER(config.h)
AC_SUBST([EXTRA_CFLAGS]) AC_SUBST([EXTRA_CFLAGS])
AC_PROG_LIBTOOL
# Checks for programs. # Checks for programs.
AC_PROG_CC AC_PROG_CC
AC_PROG_INSTALL AC_PROG_INSTALL
AC_PROG_MAKE_SET
# Checks for libraries.
# Checks for header files. # Checks for header files.
AC_HEADER_DIRENT AC_HEADER_DIRENT
AC_HEADER_STDC AC_HEADER_STDC
AC_CHECK_HEADERS([fcntl.h netdb.h stdint.h stdlib.h string.h strings.h sys/socket.h syslog.h unistd.h]) 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])
# Checks for typedefs, structures, and compiler characteristics. # Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST AC_TYPE_INT32_T
AC_TYPE_SIZE_T AC_TYPE_SIZE_T
AC_TYPE_SSIZE_T
AC_TYPE_UINT16_T
AC_TYPE_UINT32_T
AC_TYPE_UINT8_T
# Checks for library functions. # Checks for library functions.
AC_FUNC_MALLOC
AC_FUNC_REALLOC AC_FUNC_REALLOC
AC_CHECK_FUNCS([bzero memset strchr strerror strstr strtoul]) AC_CHECK_FUNCS([bzero memset mkdir regcomp socket strchr strerror strstr dnl
strtoul])
AC_CHECK_HEADER(sysfs/libsysfs.h, AC_CHECK_HEADER([sysfs/libsysfs.h],
[AC_CHECK_LIB(sysfs, sysfs_open_directory_list, [AC_CHECK_LIB([sysfs], [sysfs_open_directory_list],
[LIBS="$LIBS -lsysfs"], [LIBS="$LIBS -lsysfs"],
[AC_MSG_ERROR([Missing sysfs2 library!])])], [AC_MSG_ERROR([Missing sysfs2 library!])])],
[AC_MSG_ERROR([Missing /usr/include/sysfs/libsysfs.h])]) [AC_MSG_ERROR([Missing /usr/include/sysfs/libsysfs.h])])
# Checks for libwrap library.
# get from stunnel
dnl Check for libwrap library.
AC_MSG_CHECKING([whether to use the libwrap (TCP wrappers) library]) AC_MSG_CHECKING([whether to use the libwrap (TCP wrappers) library])
AC_ARG_WITH([tcp-wrappers],
AC_ARG_WITH(tcp-wrappers, [AS_HELP_STRING([--with-tcp-wrappers],
[ --with-tcp-wrappers Use the libwrap (TCP wrappers) library ], [use the libwrap (TCP wrappers) library])],
[saved_LIBS="$LIBS" dnl [ACTION-IF-GIVEN]
[saved_LIBS="$LIBS"
if test "$withval" = "yes"; then if test "$withval" = "yes"; then
AC_MSG_RESULT([yes]) AC_MSG_RESULT([yes])
AC_MSG_CHECKING([for hosts_access in -lwrap]) AC_MSG_CHECKING([for hosts_access in -lwrap])
...@@ -60,46 +59,51 @@ AC_ARG_WITH(tcp-wrappers, ...@@ -60,46 +59,51 @@ AC_ARG_WITH(tcp-wrappers,
AC_TRY_LINK( AC_TRY_LINK(
[int hosts_access(); int allow_severity, deny_severity;], [int hosts_access(); int allow_severity, deny_severity;],
[hosts_access()], [hosts_access()],
[AC_MSG_RESULT([yes]); AC_DEFINE(HAVE_LIBWRAP, 1, use tcp wrapper) wrap_LIB="-lwrap"], [AC_MSG_RESULT([yes]);
AC_DEFINE([HAVE_LIBWRAP], [1],
[use tcp wrapper]) wrap_LIB="-lwrap"],
[AC_MSG_RESULT([not found]); exit 1]) [AC_MSG_RESULT([not found]); exit 1])
else else
AC_MSG_RESULT([no]) AC_MSG_RESULT([no])
fi fi
LIBS="$saved_LIBS"], LIBS="$saved_LIBS"],
[AC_MSG_RESULT([(default)]) dnl [ACTION-IF-NOT-GIVEN]
[AC_MSG_RESULT([(default)])
AC_MSG_CHECKING([for hosts_access in -lwrap]) AC_MSG_CHECKING([for hosts_access in -lwrap])
saved_LIBS="$LIBS" saved_LIBS="$LIBS"
LIBS="-lwrap $saved_LIBS" LIBS="-lwrap $saved_LIBS"
AC_TRY_LINK( AC_TRY_LINK(
[int hosts_access(); int allow_severity, deny_severity;], [int hosts_access(); int allow_severity, deny_severity;],
[hosts_access()], [hosts_access()],
[AC_MSG_RESULT([yes]); AC_DEFINE(HAVE_LIBWRAP, 1, use tcp wrapper)], [AC_MSG_RESULT([yes]);
[AC_MSG_RESULT([no]); LIBS="$saved_LIBS"]) AC_DEFINE([HAVE_LIBWRAP], [1], [use tcp wrapper])],
]) [AC_MSG_RESULT([no]); LIBS="$saved_LIBS"])])
# Sets directory containing usb.ids.
USBIDS_DIR='${datadir}/usbip' USBIDS_DIR='${datadir}/usbip'
AC_ARG_WITH(usbids-dir, [ --with-usbids-dir=DIR where usb.ids is found (default ${datadir}/usbip)], [USBIDS_DIR=$withval]) AC_ARG_WITH([usbids-dir],
AC_SUBST(USBIDS_DIR) [AS_HELP_STRING([--with-usbids-dir=DIR],
[where usb.ids is found (default ${datadir}/usbip)])],
[USBIDS_DIR=$withval])
AC_SUBST([USBIDS_DIR])
dnl FIXME: when disabled, empty directry is created dnl FIXME: when disabled, empty directry is created
usbids=install usbids=install
AC_ARG_ENABLE(usbids-install, AC_ARG_ENABLE([usbids-install],
[ --enable-usbids-install install usb.ids (default)], [AS_HELP_STRING([--enable-usbids-install],
[case "${enableval}" in [install usb.ids (default)])],
yes) usbids=install ;; [AS_CASE([$enableval],
no) usbids=notinstall ;; [yes], [usbids=install],
*) AC_MSG_ERROR(bad value ${enableval} for --enable-usbids-install) ;; [no], [usbids=notinstall],
esac]) [AC_MSG_ERROR(
AM_CONDITIONAL(INSTALL_USBIDS, test x$usbids = xinstall) [bad value ${enableval} for --enable-usbids-install])]
)])
AM_CONDITIONAL([INSTALL_USBIDS], [test x$usbids = xinstall])
GLIB2_REQUIRED=2.6.0 GLIB2_REQUIRED=2.6.0
PKG_CHECK_MODULES(PACKAGE, glib-2.0 >= $GLIB2_REQUIRED) PKG_CHECK_MODULES([PACKAGE], [glib-2.0 >= $GLIB2_REQUIRED])
AC_SUBST(PACKAGE_CFLAGS) AC_SUBST([PACKAGE_CFLAGS])
AC_SUBST(PACKAGE_LIBS) AC_SUBST([PACKAGE_LIBS])
AC_CONFIG_FILES([Makefile libsrc/Makefile src/Makefile]) AC_CONFIG_FILES([Makefile libsrc/Makefile src/Makefile])
AC_OUTPUT AC_OUTPUT
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册