-
Notifications
You must be signed in to change notification settings - Fork 2
/
configure.in
167 lines (144 loc) · 6.96 KB
/
configure.in
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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
################################################################################
# The minimum version of autoconf required to regenerate the configure script. #
################################################################################
#AC_PREREQ(2.59)
################################################################################
# Initialise autoconf, set package name, version number and contact details. #
################################################################################
AC_INIT(Agility Record Book, 3.8.8.126, [help@agilityrecordbook.com])
AC_ARG_ENABLE(official, [--enable-official official build], USE_OFFICIAL_BUILD=$enableval, USE_OFFICIAL_BUILD=no)
# Allows linking when AgilityBookLibs is a submodule or built directly
AC_SUBST(ARBLIBS_DIR, "AgilityBookLibs/")
AC_SUBST(PACKAGE_ARB_SHORTNAME, "AgilityBook")
AC_SUBST(PACKAGE_HLP_SHORTNAME, "ARBHelp")
AC_SUBST(PACKAGE_CAL_SHORTNAME, "CalSites")
AC_SUBST(PACKAGE_TEST_SHORTNAME, "testarb")
AC_SUBST(PACKAGE_TESTLIB_SHORTNAME, "testarblib")
AC_SUBST(PACKAGE_COPYRIGHT, "Copyright (c) 2002-2024 David Connet. All Rights Reserved.")
################################################################################
# Check for programs used to build my_prg #
################################################################################
##########
# Check whether make sets the MAKE variable.
# Check which C++ compiler we have (sets CXX and CXXFLAGS)
# Check which RANLIB program we have
# Set the language for all further tests to C++
##########
AC_PROG_MAKE_SET
AC_PROG_CXX
AC_PROG_RANLIB
AC_PROG_INSTALL
AC_LANG(C++)
AC_ARG_PROGRAM
# Add macros to check for other programs here
################################################################################
# Checks for header files. #
################################################################################
# Add macros to check for header files here
################################################################################
# Checks for typedefs, structures, and compiler characteristics. #
################################################################################
# Add macros to check for these characteristics here
################################################################################
# Checks for library functions. #
################################################################################
# Add macros to check for library functions here
# We get these libs from our own src/ directories
# AC_CHECK_LIB([unittest], [RunAllTests])
AC_SUBST(CC, "`wx-config --cc`")
AC_SUBST(CXX, "`wx-config --cxx`")
AC_SUBST(LD, "`wx-config --ld`")
AC_SUBST(CFLAGS, "`wx-config --cflags`")
AC_SUBST(CXXFLAGS, "`wx-config --cxxflags`")
AC_SUBST(LDFLAGS, "`wx-config --libs`")
AC_SUBST(CXXFLAGS,"$CXXFLAGS -DUSE_WXWIDGETS")
if test $USE_OFFICIAL_BUILD = "yes" ; then
AC_SUBST(CXXFLAGS,"$CXXFLAGS -DOFFICIAL_BUILD -DVER_PARTS=3")
fi
# Ubuntu18 has 3.6, we need 3.8. If it doesn't exist, then building will just fail.
# There might be a better way, but this works...
AC_CHECK_FILE(/usr/bin/python3.8, AC_SUBST(PYTHON3, "python3.8"), AC_SUBST(PYTHON3, "python3"))
case `uname` in
Darwin*)
AC_SUBST(ARFLAGS, 'cru')
AC_SUBST(SHAREDLIBEXT, 'dylib')
# Leaving this in for a couple compilers for an example.
# Current min deployment is 10.13 (as set via wx-config, via BuildUnix.sh)
if test -d /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk
then
AC_SUBST(CFLAGS, "$CFLAGS -arch x86_64")
AC_SUBST(OBJCXXFLAGS, "$OBJCXXFLAGS -std=c++17 -stdlib=libc++")
AC_SUBST(CXXFLAGS, "$CXXFLAGS -arch x86_64 -D_GLIBCXX_EXTERN_TEMPLATE=0 -std=c++17 -stdlib=libc++")
AC_SUBST(LDFLAGS, ["$LDFLAGS -arch x86_64 -stdlib=libc++"])
# Note 12.0 added arm64 support
# That's where this originally changed to setting options as below.
# Assume the current SDK is at least 12.0
elif test -d /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk
then
# WX_ARCH is a kludge to pass the arch type of the wx library.
# This is set in the setwxpath.sh script (see notes there).
AC_SUBST(CFLAGS, "$CFLAGS $WX_ARCH")
AC_SUBST(OBJCXXFLAGS, "$OBJCXXFLAGS -std=c++17 -stdlib=libc++")
AC_SUBST(CXXFLAGS, "$CXXFLAGS $WX_ARCH -D_GLIBCXX_EXTERN_TEMPLATE=0 -std=c++17 -stdlib=libc++")
AC_SUBST(LDFLAGS, ["$LDFLAGS $WX_ARCH -stdlib=libc++"])
else
AC_MSG_ERROR(Cannot determine SDK)
fi
# dependency generation not supported for g++ for universal binaries
# For some reason ./configure --disable-dependency-generation is not supported by autoconf 2.63
# so put dependencies checking under non-Darwin builds
# Also no precompiled header support for universal binaries
AC_SUBST(NOPRECOMP,1)
#AC_SUBST(SHAREDLDFLAGS, "-prebind -bundle")
;;
Linux)
# Ubuntu
AC_SUBST(ARFLAGS, 'Ucru')
AC_SUBST(CFLAGS, "$CFLAGS -g")
#AC_SUBST(CFLAGS, "$CFLAGS -arch x86_64")
AC_SUBST(OBJCXXFLAGS, "$OBJCXXFLAGS -g -std=c++17")
AC_SUBST(CXXFLAGS, "$CXXFLAGS -g -D_GLIBCXX_EXTERN_TEMPLATE=0 -std=c++17")
AC_SUBST(LDFLAGS, ["$LDFLAGS -no-pie"])
AC_SUBST(NOPRECOMP,1)
;;
*)
##########
# Check how dependencies are created for the C++ compiler on this system
##########
AS_IF(g++ -v -MP 2> /dev/null,
[AC_SUBST(CPPDEPFLAGS, "-MMD -MP -MF \"\`dirname \$@\`/.deps/\`basename \$*\`.d\"")] [AC_SUBST(DEPDIR, ".deps")],
[AC_SUBST(CPPDEPFLAGS, "-MMD")] [AC_SUBST(DEPDIR, ".")])
AC_SUBST(SHAREDLIBEXT, 'so')
# AC_SUBST(SHAREDLDFLAGS, "-shared -W1,-soname,$(.TARGET)")
;;
esac
################################################################################
# Allow insertion of the global rules from NAM_rules.mk(.in) into any file #
# that requests it using @NAM_RULES@. Note that for this to work properly, #
# NAM_rules.mk must be listed BEFORE any Makefiles that use this feature in #
# the AC_CONFIG_FILES() macro below. #
################################################################################
NAM_RULES=NAM_rules.mk
AC_SUBST_FILE(NAM_RULES)
################################################################################
# List of files to generate from the corresponding (*.in) files and the #
# subsequent command to generate those files. #
################################################################################
AC_CONFIG_FILES([NAM_rules.mk Makefile \
AgilityBookLibs/Makefile \
AgilityBookLibs/3rdParty/Makefile \
AgilityBookLibs/3rdParty/catch/Makefile \
AgilityBookLibs/3rdParty/catch/catch3/Makefile \
AgilityBookLibs/3rdParty/LibFmt/Makefile \
AgilityBookLibs/3rdParty/LibTidyHtml/Makefile \
AgilityBookLibs/ARBCommon/Makefile \
AgilityBookLibs/LibARBWin/Makefile \
AgilityBookLibs/TestARBLib/Makefile \
src/Makefile \
src/Libraries/Makefile \
src/Libraries/ARB/Makefile \
src/ARBHelp/Makefile \
src/CalSites/Makefile \
src/TestARB/Makefile \
src/Win/Makefile])
AC_OUTPUT