autogen.sh : OpenBSD tweaks.
[platform/upstream/flac.git] / configure.ac
index 5d9fc1d..8b6edcb 100644 (file)
@@ -40,6 +40,7 @@ AC_PROG_MAKE_SET
 AC_SYS_LARGEFILE
 AC_FUNC_FSEEKO
 
+AC_CHECK_SIZEOF(off_t,1)       # Fake default value.
 AC_CHECK_SIZEOF([void*])
 AC_SEARCH_LIBS([lround],[m], [AC_DEFINE(HAVE_LROUND,1,lround support)])
 
@@ -234,7 +235,10 @@ fi
 AC_SUBST(FLAC__TEST_LEVEL)
 
 AC_ARG_ENABLE(gcc-werror,
-       AC_HELP_STRING([--enable-gcc-werror], [enable -Werror in all Makefiles]))
+       AC_HELP_STRING([--enable-gcc-werror], [Enable -Werror in all Makefiles]))
+
+AC_ARG_ENABLE(stack-smash-protection,
+       AC_HELP_STRING([--enable-stack-smash-protection], [Enable GNU GCC stack smash protection]))
 
 AC_ARG_ENABLE(valgrind-testing,
 AC_HELP_STRING([--enable-valgrind-testing], [Run all tests inside Valgrind]),
@@ -382,14 +386,10 @@ XIPH_ADD_CFLAGS([-Wextra])
 XIPH_ADD_CFLAGS([-Wdeclaration-after-statement])
 XIPH_ADD_CFLAGS([-D_FORTIFY_SOURCE=2])
 
-case "$host_os" in
-       mingw32msvc | mingw32 | freebsd* )
-               # Stack protector not working on these platforms 2013/03/09.
-               ;;
-       *)
-               XIPH_ADD_CFLAGS([-fstack-protector --param ssp-buffer-size=4])
-               ;;
-       esac
+if test x$enable_stack_smash_protection = "xyes" ; then
+       XIPH_GCC_STACK_PROTECTOR
+       XIPH_GXX_STACK_PROTECTOR
+       fi
 
 #@@@
 AM_CONDITIONAL(FLaC__HAS_AS__TEMPORARILY_DISABLED, test "yes" = "no")