-
Notifications
You must be signed in to change notification settings - Fork 23
Expand file tree
/
Copy pathconfigure.ac
More file actions
64 lines (52 loc) · 1.87 KB
/
configure.ac
File metadata and controls
64 lines (52 loc) · 1.87 KB
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
62
63
64
# Process this file with autoconf to produce a configure script.
#AC_PREREQ([2.69])
AC_INIT([libnvme], [0.0.1], [christophe.louargant@wdc.com, damien.lemoal@wdc.com])
AC_CONFIG_AUX_DIR([build-aux])
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_HEADER([include/config.h])
AC_PREFIX_DEFAULT(/usr)
AM_INIT_AUTOMAKE([-Wall -Werror foreign subdir-objects])
AM_SILENT_RULES([yes])
AC_PROG_CC
AM_PROG_CC_C_O
m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
m4_pattern_allow([AM_PROG_AR])
LT_INIT
ACX_PTHREAD
LIBS="$PTHREAD_LIBS $LIBS"
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
CC="$PTHREAD_CC"
# Checks for header files.
AC_CHECK_HEADERS([stddef.h stdint.h stdlib.h \
string.h inttypes.h \
unistd.h assert.h])
AC_CHECK_LIB(pciaccess, pci_device_probe, [], AC_MSG_ERROR([Couldn't find libpciaccess. Try installing pciaccess library.]))
AC_CHECK_HEADER(pciaccess.h, [], [AC_MSG_ERROR([Couldn't find pciaccess.h. Try installing pciaccess library development package.])])
AC_CHECK_LIB(numa, mbind, [], AC_MSG_ERROR([Couldn't find libnuma. Try installing numa library package.]))
AC_CHECK_HEADER(numaif.h, [], [AC_MSG_ERROR([Couldn't find numaif.h. Try installing numa library development package.])])
# CPU flags detection
if grep "^flags.* sse" /proc/cpuinfo > /dev/null; then
have_sse=yes
fi
if grep "^flags.* sse2" /proc/cpuinfo > /dev/null; then
have_sse2=yes
fi
if grep "^flags.* avx" /proc/cpuinfo > /dev/null; then
have_avx=yes
fi
if test "$have_sse" = "yes"; then have_sse2=yes; fi
if test "$have_sse2" = "yes"; then
AC_DEFINE(__SSE2__,1,[Define to enable SSE/SSE2 optimizations.])
fi
AM_CONDITIONAL(__SSE2__, test "$have_sse2" = "yes")
if test "$have_avx" = "yes"; then
AC_DEFINE(__AVX__,1,[Define to enable AVX optimizations.])
fi
AM_CONDITIONAL(__AVX__, test "$have_avx" = "yes")
# Checks for library functions.
# AC_CHECK_FUNCS([memset])
AC_CONFIG_FILES([
libnvme.pc
Makefile
])
AC_OUTPUT