]> mj.ucw.cz Git - libucw.git/commitdiff
Turn off CONFIG_DIRECT when needed
authorMichal Vaner <vorner@ucw.cz>
Sun, 30 Nov 2008 12:30:47 +0000 (13:30 +0100)
committerMichal Vaner <vorner@ucw.cz>
Sun, 30 Nov 2008 12:30:47 +0000 (13:30 +0100)
ucw/perl/UCW/Configure/C.pm
ucw/perl/UCW/Configure/LibUCW.pm

index 026aef6fe76da55c29a2cba62e9ae0117aa9b09f..6219a164bf11eed8548f8d3ff9052dd3f1ab3ac9 100644 (file)
@@ -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 ###
index 6a25dbbae29bd1328201a08f902e1543b2663785..19fcb0384e07b8c5ee6271825bc9653791d3a931 100644 (file)
@@ -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", [