From ce7f54e953a4f6676c3569dc113e76147e19ef45 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Wed, 5 Mar 2003 09:33:43 +0000 Subject: Add a test for a useful property of the compiler - we can get link-time failures for some compile-time properties this way. Andrew Bartlett (This used to be commit ce618624b7df797e228f8ef0f19820b318c62ae9) --- source3/configure.in | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'source3') diff --git a/source3/configure.in b/source3/configure.in index 269d70c2fc..cc38e37f3f 100644 --- a/source3/configure.in +++ b/source3/configure.in @@ -652,6 +652,24 @@ if test x"$samba_cv_immediate_structures" = x"yes"; then AC_DEFINE(HAVE_IMMEDIATE_STRUCTURES,1,[Whether the compiler supports immediate structures]) fi +############################################ +# check if the compiler can do immediate structures +AC_CACHE_CHECK([if the compiler will optimize out function calls],samba_cv_optimize_out_funcation_calls, [ + AC_TRY_LINK([ +#include ], +[ + if (1) { + this_function_does_not_exist(); + } else { + return 1; + } + +], + samba_cv_optimize_out_funcation_calls=yes,samba_cv_optimize_out_funcation_calls=no)]) +if test x"$samba_cv_optimize_out_funcation_calls" = x"yes"; then + AC_DEFINE(HAVE_COMPILER_WILL_OPTIMIZE_OUT_FNS,1,[Whether the compiler will optimize out function calls]) +fi + ############################################ # check for unix domain sockets AC_CACHE_CHECK([for unix domain sockets],samba_cv_unixsocket, [ -- cgit