]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/blame - tools/usb/usbip/configure.ac
Merge tag 'pci-v5.15-fixes-2' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaa...
[mirror_ubuntu-jammy-kernel.git] / tools / usb / usbip / configure.ac
CommitLineData
af8bab06 1dnl Process this file with autoconf to produce a configure script.
0945b4fe
TH
2
3AC_PREREQ(2.59)
435d948c 4AC_INIT([usbip-utils], [2.0], [linux-usb@vger.kernel.org])
0aee5889 5AC_DEFINE([USBIP_VERSION], [0x00000111], [binary-coded decimal version number])
af8bab06 6
d762f5e1 7CURRENT=0
8REVISION=1
9AGE=0
10AC_SUBST([LIBUSBIP_VERSION], [$CURRENT:$REVISION:$AGE], [library version])
11
af8bab06 12AC_CONFIG_SRCDIR([src/usbipd.c])
13AC_CONFIG_HEADERS([config.h])
0945b4fe 14
0945b4fe 15AM_INIT_AUTOMAKE([foreign])
af8bab06 16LT_INIT
0945b4fe
TH
17
18# Silent build for automake >= 1.11
19m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
20
1c6e79d9 21AC_SUBST([EXTRA_CFLAGS], ["-Wall -Werror -Wextra -std=gnu99"])
0945b4fe 22
0945b4fe
TH
23# Checks for programs.
24AC_PROG_CC
25AC_PROG_INSTALL
af8bab06 26AC_PROG_MAKE_SET
0945b4fe
TH
27
28# Checks for header files.
29AC_HEADER_DIRENT
30AC_HEADER_STDC
af8bab06 31AC_CHECK_HEADERS([arpa/inet.h fcntl.h netdb.h netinet/in.h stdint.h stdlib.h dnl
950a4cd8 32 string.h sys/socket.h syslog.h unistd.h])
0945b4fe
TH
33
34# Checks for typedefs, structures, and compiler characteristics.
af8bab06 35AC_TYPE_INT32_T
0945b4fe 36AC_TYPE_SIZE_T
af8bab06 37AC_TYPE_SSIZE_T
38AC_TYPE_UINT16_T
39AC_TYPE_UINT32_T
40AC_TYPE_UINT8_T
0945b4fe
TH
41
42# Checks for library functions.
0945b4fe 43AC_FUNC_REALLOC
950a4cd8 44AC_CHECK_FUNCS([memset mkdir regcomp socket strchr strerror strstr dnl
af8bab06 45 strtoul])
0945b4fe 46
1e940319
VM
47AC_CHECK_HEADER([libudev.h],
48 [AC_CHECK_LIB([udev], [udev_new],
49 [LIBS="$LIBS -ludev"],
50 [AC_MSG_ERROR([Missing udev library!])])],
51 [AC_MSG_ERROR([Missing /usr/include/libudev.h])])
52
af8bab06 53# Checks for libwrap library.
0945b4fe 54AC_MSG_CHECKING([whether to use the libwrap (TCP wrappers) library])
af8bab06 55AC_ARG_WITH([tcp-wrappers],
56 [AS_HELP_STRING([--with-tcp-wrappers],
57 [use the libwrap (TCP wrappers) library])],
58 dnl [ACTION-IF-GIVEN]
ce591f76 59 [if test "$withval" = "yes"; then
af8bab06 60 AC_MSG_RESULT([yes])
61 AC_MSG_CHECKING([for hosts_access in -lwrap])
ce591f76
TK
62 saved_LIBS="$LIBS"
63 LIBS="-lwrap $saved_LIBS"
af8bab06 64 AC_TRY_LINK(
65 [int hosts_access(); int allow_severity, deny_severity;],
66 [hosts_access()],
67 [AC_MSG_RESULT([yes]);
68 AC_DEFINE([HAVE_LIBWRAP], [1],
69 [use tcp wrapper]) wrap_LIB="-lwrap"],
70 [AC_MSG_RESULT([not found]); exit 1])
71 else
ce591f76 72 AC_MSG_RESULT([no]);
ce591f76 73 fi],
af8bab06 74 dnl [ACTION-IF-NOT-GIVEN]
75 [AC_MSG_RESULT([(default)])
76 AC_MSG_CHECKING([for hosts_access in -lwrap])
77 saved_LIBS="$LIBS"
78 LIBS="-lwrap $saved_LIBS"
79 AC_TRY_LINK(
80 [int hosts_access(); int allow_severity, deny_severity;],
81 [hosts_access()],
82 [AC_MSG_RESULT([yes]);
83 AC_DEFINE([HAVE_LIBWRAP], [1], [use tcp wrapper])],
84 [AC_MSG_RESULT([no]); LIBS="$saved_LIBS"])])
85
86# Sets directory containing usb.ids.
af8bab06 87AC_ARG_WITH([usbids-dir],
88 [AS_HELP_STRING([--with-usbids-dir=DIR],
7ddf1a0c 89 [where usb.ids is found (default /usr/share/hwdata/)])],
90 [USBIDS_DIR=$withval], [USBIDS_DIR="/usr/share/hwdata/"])
af8bab06 91AC_SUBST([USBIDS_DIR])
0945b4fe 92
107fefd4
IH
93# use _FORTIFY_SOURCE
94AC_MSG_CHECKING([whether to use fortify])
95AC_ARG_WITH([fortify],
96 [AS_HELP_STRING([--with-fortify],
97 [use _FORTIFY_SROUCE option when compiling)])],
98 dnl [ACTION-IF-GIVEN]
99 [if test "$withval" = "yes"; then
100 AC_MSG_RESULT([yes])
101 CFLAGS="$CFLAGS -D_FORTIFY_SOURCE -O"
102 else
103 AC_MSG_RESULT([no])
104 CFLAGS="$CFLAGS -U_FORTIFY_SOURCE"
105 fi
106 ],
107 dnl [ACTION-IF-NOT-GIVEN]
108 [AC_MSG_RESULT([default])])
109
f9b90071 110AC_CONFIG_FILES([Makefile libsrc/Makefile src/Makefile])
0945b4fe 111AC_OUTPUT