Lines Matching +full:- +full:- +full:add +full:- +full:architecture
4 dnl Copyright © 2020-2024 by OpenPrinting.
5 dnl Copyright © 2007-2018 by Apple Inc.
6 dnl Copyright © 1997-2007 by Easy Software Products, all rights reserved.
12 dnl Clear the debugging and non-shared library options unless the user asks
17 AC_ARG_WITH([optim], AS_HELP_STRING([--with-optim], [set optimization flags]), [
24 AC_ARG_ENABLE([debug], AS_HELP_STRING([--enable-debug], [build with debugging symbols]))
25 AC_ARG_ENABLE([debug_guards], AS_HELP_STRING([--enable-debug-guards], [build with memory allocation…
26 AC_ARG_ENABLE([debug_printfs], AS_HELP_STRING([--enable-debug-printfs], [build with CUPS_DEBUG_LOG …
27 AC_ARG_ENABLE([maintainer], AS_HELP_STRING([--enable-maintainer], [turn on maintainer mode (warning…
28 AC_ARG_ENABLE([unit_tests], AS_HELP_STRING([--enable-unit-tests], [build and run unit tests]))
31 AS_IF([test x$enable_debug = xyes -a "x$OPTIM" = x], [
32 OPTIM="-g"
34 INSTALL_STRIP="-s"
39 CFLAGS="$CFLAGS -DDEBUG"
40 CXXFLAGS="$CXXFLAGS -DDEBUG"
46 CFLAGS="$CFLAGS -DDEBUG_GUARDS"
47 CXXFLAGS="$CXXFLAGS -DDEBUG_GUARDS"
53 AC_MSG_ERROR([Sorry, cannot build unit tests when cross-compiling.])
62 dnl Setup general architecture flags...
63 AC_ARG_WITH([archflags], AS_HELP_STRING([--with-archflags], [set default architecture flags]))
64 AC_ARG_WITH([ldarchflags], AS_HELP_STRING([--with-ldarchflags], [set program architecture flags]))
66 AS_IF([test -z "$with_archflags"], [
72 AS_IF([test -z "$with_ldarchflags"], [
81 dnl Read-only data/program support on Linux...
82 AC_ARG_ENABLE([relro], AS_HELP_STRING([--enable-relro], [build with the relro option]))
85 AC_ARG_ENABLE([sanitizer], AS_HELP_STRING([--enable-sanitizer], [build with AddressSanitizer]))
100 AS_IF([test -n "$GCC"], [
101 # Add GCC/Clang compiler options...
106 # Use -fsanitize=address with debugging...
107 OPTIM="$OPTIM -g -fsanitize=address"
108 ], [echo "$CXXFLAGS $CFLAGS" | grep -q _FORTIFY_SOURCE], [
109 # Don't add _FORTIFY_SOURCE if it is already there
113 CFLAGS="$CFLAGS -D_FORTIFY_SOURCE=3"
114 CXXFLAGS="$CXXFLAGS -D_FORTIFY_SOURCE=3"
118 AS_IF([test -z "$OPTIM"], [
119 # Default to optimize-for-size and debug
120 OPTIM="-Os -g"
123 # Generate position-independent code as needed...
125 OPTIM="-fPIC $OPTIM"
128 # The -fstack-protector-strong and -fstack-protector options are available
131 # First check for -fstack-protector-strong, then for -fstack-protector...
132 AC_MSG_CHECKING([whether compiler supports -fstack-protector-strong])
134 CFLAGS="$CFLAGS -fstack-protector-strong"
136 OPTIM="$OPTIM -fstack-protector-strong"
140 AC_MSG_CHECKING([whether compiler supports -fstack-protector])
141 CFLAGS="$OLDCFLAGS -fstack-protector"
143 OPTIM="$OPTIM -fstack-protector"
152 # The -fPIE option is available with some versions of GCC and
157 AC_MSG_CHECKING([whether compiler supports -fPIE])
160 CFLAGS="$CFLAGS -fPIE -Wl,-pie"
162 PIEFLAGS="-fPIE -Wl,-pie"
168 CFLAGS="$CFLAGS -fPIE -pie"
170 PIEFLAGS="-fPIE -pie"
180 WARNING_OPTIONS="-Wall -Wunused"
182 dnl Drop some not-useful/unreliable warnings...
183 …for warning in char-subscripts deprecated-declarations format-truncation format-y2k switch unused-…
184 AC_MSG_CHECKING([whether compiler supports -Wno-$warning])
187 CFLAGS="$CFLAGS -Wno-$warning -Werror"
191 WARNING_OPTIONS="$WARNING_OPTIONS -Wno-$warning"
199 dnl Maintainer mode enables -Werror...
201 WARNING_OPTIONS="$WARNING_OPTIONS -Werror"
204 # Add vendor-specific compiler options...
207 AS_IF([test -z "$OPTIM"], [
208 OPTIM="-xO2"
212 OPTIM="-KPIC $OPTIM"
227 # Add general compiler options per platform...
231 OPTIM="$OPTIM -D_GNU_SOURCE"
233 # The -z relro option is provided by the Linux linker command to
234 # make relocatable data read-only.
236 RELROFLAGS="-Wl,-z,relro,-z,now"