From 248b0c2d0cbbc4637af651dbee7da0f42e030185 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sun, 13 Jul 2014 19:22:40 +0000 Subject: Add configure option to ignore POSIX functions even if present. git-svn-id: http://svn.drobilla.net/serd/trunk@462 490d8e77-9747-427b-9fa3-0b8f29cee8a0 --- wscript | 37 ++++++++++++++++++++----------------- 1 file changed, 20 insertions(+), 17 deletions(-) (limited to 'wscript') diff --git a/wscript b/wscript index 3de68167..b35e0930 100644 --- a/wscript +++ b/wscript @@ -37,6 +37,8 @@ def options(opt): help='Build programs as static binaries') opt.add_option('--largefile', action='store_true', dest='largefile', help='Build with large file support on 32-bit systems') + opt.add_option('--no-posix', action='store_true', dest='no_posix', + help='Do not use posix_memalign, posix_fadvise, and fileno, even if present') def configure(conf): conf.load('compiler_c') @@ -71,23 +73,24 @@ def configure(conf): lib = ['m'], mandatory = False) - conf.check(function_name = 'posix_memalign', - header_name = 'stdlib.h', - define_name = 'HAVE_POSIX_MEMALIGN', - defines = ['_POSIX_C_SOURCE=201112L'], - mandatory = False) - - conf.check(function_name = 'posix_fadvise', - header_name = 'fcntl.h', - define_name = 'HAVE_POSIX_FADVISE', - defines = ['_POSIX_C_SOURCE=201112L'], - mandatory = False) - - conf.check(function_name = 'fileno', - header_name = 'stdio.h', - define_name = 'HAVE_FILENO', - defines = ['_POSIX_C_SOURCE=201112L'], - mandatory = False) + if not Options.options.no_posix: + conf.check(function_name = 'posix_memalign', + header_name = 'stdlib.h', + define_name = 'HAVE_POSIX_MEMALIGN', + defines = ['_POSIX_C_SOURCE=201112L'], + mandatory = False) + + conf.check(function_name = 'posix_fadvise', + header_name = 'fcntl.h', + define_name = 'HAVE_POSIX_FADVISE', + defines = ['_POSIX_C_SOURCE=201112L'], + mandatory = False) + + conf.check(function_name = 'fileno', + header_name = 'stdio.h', + define_name = 'HAVE_FILENO', + defines = ['_POSIX_C_SOURCE=201112L'], + mandatory = False) autowaf.define(conf, 'SERD_VERSION', SERD_VERSION) autowaf.set_lib_env(conf, 'serd', SERD_VERSION) -- cgit v1.2.1