-
Notifications
You must be signed in to change notification settings - Fork 27
/
configure.ac
80 lines (66 loc) · 2.78 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
71
72
73
74
75
76
77
78
79
AC_PREREQ([2.65])
AC_INIT([libczmqpp], [1.2.0], [[email protected]])
AC_LANG(C++)
AC_CONFIG_AUX_DIR([build-aux])
AC_CONFIG_MACRO_DIR([m4])
AM_INIT_AUTOMAKE([subdir-objects])
AC_USE_SYSTEM_EXTENSIONS
AM_PROG_AR
LT_INIT
AC_PROG_CXX
AC_PROG_LIBTOOL
AC_GNU_SOURCE
AX_CXX_COMPILE_STDCXX_11(noext,mandatory)
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
# Declare environment variables that affect the build.
#------------------------------------------------------------------------------
AC_ARG_VAR([CC], "C compiler to use, such as gcc or clang")
AC_ARG_VAR([CXX], "C++ compiler to use, such as g++ or clang++")
AC_ARG_VAR([PKG_CONFIG_PATH], "Additional directories for package discovery.")
# Support --with-pkgconfigdir option (after verifying package config install).
#------------------------------------------------------------------------------
PKG_PROG_PKG_CONFIG
AC_MSG_CHECKING(--with-pkgconfigdir option)
AC_ARG_WITH([pkgconfigdir],
AS_HELP_STRING([--with-pkgconfigdir=PATH],
[Path to pkgconfig directory.]),
[pkgconfigdir=$withval],
[pkgconfigdir=${libdir}/pkgconfig])
AC_MSG_RESULT($pkgconfigdir)
AC_SUBST([pkgconfigdir])
# Require libczmq package min version.
#------------------------------------------------------------------------------
PKG_CHECK_MODULES([libczmq], [libczmq])
# Set warning levels.
#------------------------------------------------------------------------------
AX_CHECK_COMPILE_FLAG([-Wall],
[CXXFLAGS="$CXXFLAGS -Wall"])
AX_CHECK_COMPILE_FLAG([-Wextra],
[CXXFLAGS="$CXXFLAGS -Wextra"])
AX_CHECK_COMPILE_FLAG([-Wno-missing-braces],
[CXXFLAGS="$CXXFLAGS -Wno-missing-braces"])
AX_CHECK_COMPILE_FLAG([-Wpedantic],
[CXXFLAGS="$CXXFLAGS -Wpedantic"],
AX_CHECK_COMPILE_FLAG([-pedantic],
[CXXFLAGS="$CXXFLAGS -pedantic"]))
# socket.cpp accepts a non-literal format string with no args.
AX_CHECK_COMPILE_FLAG([-Wno-format-security],
[CXXFLAGS="$CXXFLAGS -Wno-format-security"])
# Set compiler flags.
#------------------------------------------------------------------------------
AX_CHECK_COMPILE_FLAG([-fvisibility-inlines-hidden],
[CXXFLAGS="$CXXFLAGS -fvisibility-inlines-hidden"])
AX_CHECK_COMPILE_FLAG([-fvisibility=internal],
[CXXFLAGS="$CXXFLAGS -fvisibility=internal"],
AX_CHECK_COMPILE_FLAG([-fvisibility=hidden],
[CXXFLAGS="$CXXFLAGS -fvisibility=hidden"]))
AX_CHECK_COMPILE_FLAG([-fstack-protector],
[AX_CHECK_LINK_FLAG([-fstack-protector],
[CXXFLAGS="$CXXFLAGS -fstack-protector"])])
AX_CHECK_COMPILE_FLAG([-fstack-protector-all],
[AX_CHECK_LINK_FLAG([-fstack-protector-all],
[CXXFLAGS="$CXXFLAGS -fstack-protector-all"])])
# Generate output files.
#------------------------------------------------------------------------------
AC_CONFIG_FILES([Makefile libczmq++.pc])
AC_OUTPUT