From 38f8b86c7756893a32d24eee101d272b35209f78 Mon Sep 17 00:00:00 2001 From: Kai Blin Date: Mon, 22 Mar 2010 22:58:43 +0100 Subject: build: Check if the compiler will optimize out functions --- source3/wscript | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/source3/wscript b/source3/wscript index e6f44f463d..ef682c5e11 100644 --- a/source3/wscript +++ b/source3/wscript @@ -152,6 +152,15 @@ main() { headers='sys/types.h rpc/rpc.h', msg="Checking for uint32 typedef included by rpc/rpc.h") + # Check if the compiler will optimize out functions + conf.CHECK_CODE(''' +if (0) { + this_function_does_not_exist(); +} else { + return 1; +}''', 'HAVE_COMPILER_WILL_OPTIMIZE_OUT_FNS', + msg="Checking if the compiler will optimize out functions") + # Look for CUPS conf.find_program('cups-config', var='CUPS_CONFIG') if conf.env.CUPS_CONFIG: -- cgit