From: Michal Vaner Date: Sun, 30 Nov 2008 12:30:47 +0000 (+0100) Subject: Turn off CONFIG_DIRECT when needed X-Git-Tag: holmes-import~132 X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=9773afa84a6ba2bdaa9acab70b27ce75c9e78c4c;p=libucw.git Turn off CONFIG_DIRECT when needed --- 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", [