From 9773afa84a6ba2bdaa9acab70b27ce75c9e78c4c Mon Sep 17 00:00:00 2001 From: Michal Vaner Date: Sun, 30 Nov 2008 13:30:47 +0100 Subject: [PATCH] Turn off CONFIG_DIRECT when needed --- ucw/perl/UCW/Configure/C.pm | 6 +++++- ucw/perl/UCW/Configure/LibUCW.pm | 13 +++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/ucw/perl/UCW/Configure/C.pm b/ucw/perl/UCW/Configure/C.pm index 026aef6f..6219a164 100644 --- a/ucw/perl/UCW/Configure/C.pm +++ b/ucw/perl/UCW/Configure/C.pm @@ -256,7 +256,11 @@ if (IsSet("CONFIG_DARWIN")) { Append("COPT" => "-I/sw/include"); # Fill in some constants not found in the system header files Set("SOL_TCP" => 6); # missing in /usr/include/netinet/tcp.h - Set("O_DIRECT" => 0); # Darwin doesn't support direct IO, so make Sherlock at least compilable + if (IsGiven("CONFIG_DIRECT") && IsSet("CONFIG_DIRECT")) { + Fail("Direct I/O is not available on darwin"); + } else { + UnSet("CONFIG_DIRECT"); + } } ### Writing C headers with configuration ### diff --git a/ucw/perl/UCW/Configure/LibUCW.pm b/ucw/perl/UCW/Configure/LibUCW.pm index 6a25dbba..19fcb038 100644 --- a/ucw/perl/UCW/Configure/LibUCW.pm +++ b/ucw/perl/UCW/Configure/LibUCW.pm @@ -43,6 +43,19 @@ if (Get("CPU_ARCH") eq "default" || Get("CPU_ARCH") =~ /^i[345]86$/) { Set("CONFIG_UCW_RADIX_SORTER_BITS" => 12); } +# fb_direct needs threads +if (!IsSet("CONFIG_UCW_THREADS")) { + if (IsGiven("CONFIG_DIRECT") && IsSet("CONFIG_DIRECT")) { + if (!IsGiven("CONFIG_UCW_THREADS")) { + Set("CONFIG_UCW_THREADS"); + } else { + Fail("CONFIG_DIRECT needs CONFIG_UCW_THREADS"); + } + } else { + UnSet("CONFIG_DIRECT"); + } +} + PostConfig { AtWrite { UCW::Configure::C::ConfigHeader("ucw/autoconf.h", [ -- 2.39.2