-
Notifications
You must be signed in to change notification settings - Fork 9
/
configure.ac
93 lines (71 loc) · 2.67 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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
# Order is largely irrelevant, although it must start with AC_INIT and end with AC_OUTPUT
# See http://autotoolset.sourceforge.net/tutorial.html
# and http://www.openismus.com/documents/linux/automake/automake.shtml
# This is used solely for creating the test program
# Review Makefile.am which includes Makefile.defs
#
# This file is public domain
#
AC_PREREQ([2.69])
AC_INIT([BE20_API],[2.1.0],[bugs@digitalcorpora.org])
AC_CONFIG_MACRO_DIR(m4)
m4_include([m4/ax_cxx_compile_stdcxx.m4])
AC_MSG_NOTICE([at start CPPFLAGS are $CPPFLAGS])
AC_CONFIG_FILES([Makefile ])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_AUX_DIR([build-aux])
AM_INIT_AUTOMAKE
AM_MAINTAINER_MODE
AC_PROG_RANLIB
AM_PROG_AR
# Programs we will be using
AC_PROG_CC
AC_PROG_CXX
AM_PROG_CC_C_O dnl allow per-produce flags
AC_PROG_INSTALL
# Must use C++17 mode.
AC_LANG_PUSH(C++)
AX_CXX_COMPILE_STDCXX([17], [noext], [mandatory])
AC_LANG_POP()
# Turn on all warnings
m4_include([m4/slg_gcc_all_warnings.m4])
################################################################
# Specify our headers
#
# Check for headers used by bulk Extractor
# do not put pthread here
#
# Check dfxml and be20_api headers
m4_include([dfxml_cpp/src/dfxml_configure.m4])
m4_include([m4/slg_address_sanitizer.m4])
m4_include([m4/slg_noopt.m4])
m4_include([be20_configure.m4])
m4_include([m4/ax_path_lib_pcre.m4])
AC_MSG_NOTICE([point1 - CFLAGS are now $CFLAGS])
AC_MSG_NOTICE([point2 - CPPFLAGS are now $CPPFLAGS])
AC_MSG_NOTICE([point3 - CXXFLAGS are now $CXXFLAGS])
AX_PATH_LIB_PCRE
################################################################
# Take out duplicate flags
CFLAGS=$(echo $CFLAGS | tr ' ' '\n' | sort -u | tr '\n' ' ')
CPPFLAGS=$(echo $CPPFLAGS | tr ' ' '\n' | sort -u | tr '\n' ' ')
CXXFLAGS=$(echo $CXXFLAGS | tr ' ' '\n' | sort -u | tr '\n' ' ')
AM_LDFLAGS=$(echo $LDFLAGS | tr ' ' '\n' | sort -u | tr '\n' ' ')
################################################################
# drop optimization flags and add -g if requested
if test "${with_opt}" = "no" ; then
CFLAGS=`echo -g "$CFLAGS" | sed s/-O[[0-9]]//` # note the double quoting!
CXXFLAGS=`echo -g "$CXXFLAGS" | sed s/-O[[0-9]]//`
fi
# LIBS="-lstdc++ $LIBS"
## Remove flags that shouldn't be present
AC_MSG_NOTICE([point4 - CXX: $CXX])
CXX=$(echo $CXX | sed s/-std=gnu..11//)
################################################################
AC_MSG_NOTICE([CFLAGS are now $CFLAGS])
AC_MSG_NOTICE([CPPFLAGS are now $CPPFLAGS])
AC_MSG_NOTICE([CXXFLAGS are now $CXXFLAGS])
AC_MSG_NOTICE([AM_LDFLAGS are now $AM_LDFLAGS])
AC_OUTPUT