-
Notifications
You must be signed in to change notification settings - Fork 3
/
configure.ac
61 lines (48 loc) · 2.01 KB
/
configure.ac
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
AC_INIT(smp_utils, 1.00, [email protected])
AM_INIT_AUTOMAKE([-Wall -Werror foreign])
AM_MAINTAINER_MODE
AM_CONFIG_HEADER(config.h)
AC_PROG_CC
# AC_PROG_CXX
AC_PROG_INSTALL
# AM_PROG_AR is supported and needed since automake v1.12+
ifdef([AM_PROG_AR], [AM_PROG_AR], [])
# Adding libtools to the build seems to bring in C++ environment
AC_PROG_LIBTOOL
# check for headers
AC_HEADER_STDC
# check for functions
AC_CHECK_FUNCS(posix_memalign)
AC_CANONICAL_HOST
AC_DEFINE_UNQUOTED(SMP_UTILS_BUILD_HOST, "${host}", [smp_utils Build Host])
check_for_linux_nvme_headers() {
AC_CHECK_HEADERS([linux/types.h linux/bsg.h linux/kdev_t.h], [], [],
[[#ifdef HAVE_LINUX_TYPES_H
# include <linux/types.h>
#endif
]])
}
case "${host}" in
*-*-android*)
AC_DEFINE_UNQUOTED(SMP_LIB_ANDROID, 1, [smp_utils on android])
AC_DEFINE_UNQUOTED(SMP_LIB_LINUX, 1, [smp_utils on linux])
check_for_linux_nvme_headers;;
*-*-freebsd*|*-*-kfreebsd*-gnu*)
AC_DEFINE_UNQUOTED(SMP_LIB_FREEBSD, 1, [smp_utils on FreeBSD])
LIBS="$LIBS -lcam";;
*-*-solaris*)
AC_DEFINE_UNQUOTED(SMP_UTILS_SOLARIS, 1, [smp_utils on Solaris]);;
*-*-linux-gnu* | *-*-linux* | *)
AC_DEFINE_UNQUOTED(SMP_LIB_LINUX, 1, [smp_utils on linux])
check_for_linux_nvme_headers;;
esac
# Define platform-specific symbol.
AM_CONDITIONAL(OS_FREEBSD, [echo $host_os | grep 'freebsd' > /dev/null])
AM_CONDITIONAL(OS_LINUX, [echo $host_os | grep '^linux' > /dev/null])
AM_CONDITIONAL(OS_SOLARIS, [echo $host_os | grep '^solaris' > /dev/null])
AM_CONDITIONAL(OS_ANDROID, [echo $host_os | grep 'android' > /dev/null])
AC_CHECK_LIB(smputils1, smp_send_req,
[SMPUTILS_LIBS="-lsmputils1"; have_smputils=yes], have_smputils=no)
AC_SUBST(SMPUTILS_LIBS)
AM_CONDITIONAL(HAVE_SMPUTILS, test x"$have_smputils" = xyes)
AC_OUTPUT(Makefile include/Makefile lib/Makefile src/Makefile doc/Makefile)