-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.ac
69 lines (58 loc) · 1.68 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
62
63
64
65
66
67
68
69
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ([2.67])
AC_INIT([marisa2], [pre-alpha], [syata@acm.org])
AC_CONFIG_SRCDIR([lib/marisa2.h])
AM_INIT_AUTOMAKE
LT_INIT([win32-dll])
AC_PROG_CXX
AC_PROG_INSTALL
AC_CONFIG_MACRO_DIR([m4])
AM_CXXFLAGS="-Wall -Wextra"
OLD_CXXFLAGS="${CXXFLAGS}"
CXXFLAGS="-std=c++11"
AC_LANG_PUSH([C++])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])],
[AM_CXXFLAGS="${AM_CXXFLAGS} -std=c++11"],
[AM_CXXFLAGS="${AM_CXXFLAGS} -std=c++0x"])
AC_LANG_POP([C++])
CXXFLAGS="${OLD_CXXFLAGS}"
AC_CANONICAL_HOST
case "${host}" in
*-*-mingw*|*-*-cygwin*)
AM_CXXFLAGS="${AM_CXXFLAGS} -DMARISA2_BUILD_DLL"
AM_LDFLAGS="-no-undefined"
;;
*)
AM_LDFLAGS=""
;;
esac
AC_MSG_CHECKING([whether to use popcnt (SSE4.2)])
AC_ARG_ENABLE([popcnt],
[AS_HELP_STRING([--enable-popcnt],
[use popcnt (SSE4.2) [default=no]])],
[],
[enable_popcnt="no"])
if test "x${enable_popcnt}" != "xno"
then
AM_CXXFLAGS="$AM_CXXFLAGS -DMARISA2_USE_POPCNT -msse4.2"
enable_popcnt="yes"
fi
AC_MSG_RESULT([${enable_popcnt}])
AC_SUBST([AM_CXXFLAGS])
AC_SUBST([AM_LDFLAGS])
AC_CONFIG_FILES([Makefile
marisa2.pc
lib/Makefile
src/Makefile
test/Makefile])
AC_OUTPUT
echo
echo "${PACKAGE_NAME} ${PACKAGE_VERSION} configuration:"
echo "-------------------------------"
echo " HOST: ${host}"
echo " CXX: ${CXX}"
echo " CXXFLAGS: ${AM_CXXFLAGS} ${CXXFLAGS}"
echo " LDFLAGS: ${AM_LDFLAGS} ${LDFLAGS}"
echo " PREFIX: ${prefix}"
echo