])
# Add general compiler options per platform...
+AC_MSG_CHECKING([for OS-specific compiler options])
AS_CASE([$host_os_name], [linux*], [
# glibc 2.8 and higher breaks peer credentials unless you
# define _GNU_SOURCE... 32-bit Linux needs 64-bit time/file offsets...
AS_IF([test x$enable_relro = xyes], [
RELROFLAGS="-Wl,-z,relro,-z,now"
])
+
+ AC_MSG_RESULT([-D_GNU_SOURCE -D_TIME_BITS=64 -D_FILE_OFFSET_BITS=64 $RELROFLAGS])
+], [darwin*], [
+ # When not building for debug, target macOS 11 or later, "universal"
+ # binaries when possible...
+ AS_IF([echo "$CPPFLAGS $CFLAGS $LDFLAGS $OPTIM" | grep -q "\\-arch "], [
+ # Don't add architecture/min-version flags if they are already present
+ AC_MSG_RESULT([none])
+ ], [echo "$CPPFLAGS $CFLAGS $LDFLAGS $OPTIM" | grep -q "\\-mmacosx-version-"], [
+ # Don't add architecture/min-version flags if they are already present
+ AC_MSG_RESULT([none])
+ ], [test "$host_os_version" -ge 200 -a x$enable_debug != xyes], [
+ # macOS 11.0 and higher support the Apple Silicon (arm64) CPUs
+ OPTIM="$OPTIM -mmacosx-version-min=11.0 -arch x86_64 -arch arm64"
+ AC_MSG_RESULT([-mmacosx-version-min=11.0 -arch x86_64 -arch arm64])
+ ], [
+ # Don't add architecture/min-version flags if debug enabled
+ AC_MSG_RESULT([none])
+ ])
+], [*], [
+ AC_MSG_RESULT([none])
])
fi
# Add general compiler options per platform...
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for OS-specific compiler options" >&5
+printf %s "checking for OS-specific compiler options... " >&6; }
case $host_os_name in #(
linux*) :
RELROFLAGS="-Wl,-z,relro,-z,now"
fi
+
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: -D_GNU_SOURCE -D_TIME_BITS=64 -D_FILE_OFFSET_BITS=64 $RELROFLAGS" >&5
+printf "%s\n" "-D_GNU_SOURCE -D_TIME_BITS=64 -D_FILE_OFFSET_BITS=64 $RELROFLAGS" >&6; }
+ ;; #(
+ darwin*) :
+
+ # When not building for debug, target macOS 11 or later, "universal"
+ # binaries when possible...
+ if echo "$CPPFLAGS $CFLAGS $LDFLAGS $OPTIM" | grep -q "\\-arch "
+then :
+
+ # Don't add architecture/min-version flags if they are already present
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none" >&5
+printf "%s\n" "none" >&6; }
+
+elif echo "$CPPFLAGS $CFLAGS $LDFLAGS $OPTIM" | grep -q "\\-mmacosx-version-"
+then :
+
+ # Don't add architecture/min-version flags if they are already present
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none" >&5
+printf "%s\n" "none" >&6; }
+
+elif test "$host_os_version" -ge 200 -a x$enable_debug != xyes
+then :
+
+ # macOS 11.0 and higher support the Apple Silicon (arm64) CPUs
+ OPTIM="$OPTIM -mmacosx-version-min=11.0 -arch x86_64 -arch arm64"
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: -mmacosx-version-min=11.0 -arch x86_64 -arch arm64" >&5
+printf "%s\n" "-mmacosx-version-min=11.0 -arch x86_64 -arch arm64" >&6; }
+
+else $as_nop
+
+ # Don't add architecture/min-version flags if debug enabled
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none" >&5
+printf "%s\n" "none" >&6; }
+
+fi
+ ;; #(
+ *) :
+
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none" >&5
+printf "%s\n" "none" >&6; }
;; #(
*) :
;;