-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.ac
70 lines (59 loc) · 2.07 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
70
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ(2.59)
AC_INIT([libmtkw], [0.2.0], [[email protected]])
AC_CONFIG_SRCDIR([src/profile.hpp])
AC_CONFIG_HEADER([config.h])
AM_INIT_AUTOMAKE
# Checks for programs.
AC_PROG_LIBTOOL
AC_PROG_CXX
# Checks for libraries.
# Checks for header files.
# Checks for typedefs, structures, and compiler characteristics.
use_glog="no"
AC_ARG_WITH(glog,
AC_HELP_STRING([--with-glog], [use google-glog]),
[
use_glog=$withval
],
[
use_glog="no"
])
# Check PFI_INTERNAL
AC_ARG_ENABLE(pfi,
AC_HELP_STRING([--enable-pfi], [enable PFI internal mode]),
[
MTKW_CXXFLAGS="-DMTKW_PFI_INTERNAL"
CXXFLAGS="$CXXFLAGS -DMTKW_PFI_INTERNAL"
LDFLAGS="$LDFLAGS -lpficommon"
use_glog="yes"
],
[
LDFLAGS="$LDFLAGS -lboost_thread-mt"
])
# Check glog
AM_CONDITIONAL(MTKW_WITH_GLOG, test "x${use_glog}" = xyes)
if test "x$use_glog" = "xyes"; then
MTKW_CXXFLAGS="$MTKW_CXXFLAGS -DMTKW_WITH_GLOG"
AC_LANG_PUSH([C++])
AC_CHECK_HEADER([glog/logging.h],
[],
[AC_MSG_ERROR([Can't find glog/logging.h. Please install google-glog.])])
AC_LANG_POP([C++])
fi
AC_SUBST([MTKW_CXXFLAGS])
# add some flags
if test "x$CC" = "xgcc" -o "x$CC" = "xccache gcc"; then
CFLAGS="$CFLAGS -O2 -g -Wswitch-enum -Wall -D_REENTRANT -Wformat=2 -pipe -Wno-sign-compare -D_FORTIFY_SOURCE=1 -Wcast-qual -Wcast-align -Wpointer-arith -Wwrite-strings -fno-omit-frame-pointer"
fi
if test "x$CXX" = "xg++" -o "x$CXX" = "xccache g++"; then
CXXFLAGS="$CXXFLAGS -O2 -g -Wswitch-enum -Wall -D_REENTRANT -Wformat=2 -pipe -Wno-sign-compare -D_FORTIFY_SOURCE=1 -Wcast-qual -Wcast-align -Wpointer-arith -Wwrite-strings -Woverloaded-virtual -fno-omit-frame-pointer"
fi
# Checks for library functions.
AC_CONFIG_FILES([Makefile
libmtkw.pc
src/Makefile
tests/Makefile
])
AC_OUTPUT