]> mj.ucw.cz Git - libucw.git/commitdiff
More pieces of new configure.
authorMartin Mares <mj@ucw.cz>
Tue, 12 Apr 2005 14:36:54 +0000 (14:36 +0000)
committerMartin Mares <mj@ucw.cz>
Tue, 12 Apr 2005 14:36:54 +0000 (14:36 +0000)
build/sherlock.cfg
lib/perl/Configure.pm

index a94eb57d1c41885d9b498ef4de86611b0374bde2..abdeb4aea8b96cee63a3a4630577de05d4190d54 100644 (file)
@@ -72,7 +72,7 @@ Set("CONFIG_MAX_CONTEXTS" => 256);
 Set("CONFIG_32BIT_REFERENCES");
 
 # Debugging tools
-Set("CONFIG_DEBUG");
+UnSet("CONFIG_DEBUG");
 
 # Search server: Enable EXPLAIN command (slows searching down slightly)
 Set("CONFIG_EXPLAIN");
@@ -122,7 +122,7 @@ UnSet("CONFIG_UFAL_DICT_SK");
 UnSet("CONFIG_PL_STEMMER");
 
 # Dynamic weights
-Set("CONFIG_WEIGHTS");
+UnSet("CONFIG_WEIGHTS");
 
 #endif
 
index bbc6e82c268daeb749695e6892414cbbfb0dc52c..6900dbe3837e52b3bd973281f2dd1704e5b0c5f9 100644 (file)
@@ -16,7 +16,7 @@ BEGIN {
        our ($VERSION, @ISA, @EXPORT, @EXPORT_OK, %EXPORT_TAGS);
        $VERSION = 1.0;
        @ISA = qw(Exporter);
-       @EXPORT = qw(&Init &Log &Fail &IsSet &Set &UnSet &Override &Get &Test &Include);
+       @EXPORT = qw(&Init &Log &Fail &IsSet &Set &UnSet &Override &Get &Test &Include &Finish &FindFile &TryFindFile);
        @EXPORT_OK = qw();
        %EXPORT_TAGS = ();
 }
@@ -129,4 +129,47 @@ sub Include($) {
        require $f;
 }
 
+sub Finish() {
+       print "\n";
+
+       if (Get("SRCDIR") ne ".") {
+               Log "Preparing for compilation from directory " . Get("SRCDIR") . " to obj/ ... ";
+               -l "src" and unlink "src";
+               symlink Get("SRCDIR"), "src" or Fail "Cannot link source directory to src: $!";
+               Override("SRCDIR" => "src");
+               -l "Makefile" and unlink "Makefile";
+               -f "Makefile" and Fail "Makefile already exists";
+               symlink "src/Makefile", "Makefile" or Fail "Cannot link Makefile: $!";
+       } else {
+               Log "Preparing for compilation from current directory to obj/ ... ";
+       }
+       `rm -rf obj` if -d "obj"; Fail "Cannot delete old obj directory" if $?;
+       -d "obj" or mkdir("obj", 0777) or Fail "Cannot create obj directory: $!";
+       -d "obj/lib" or mkdir("obj/lib", 0777) or Fail "Cannot create obj/lib directory: $!";
+       Log "done\n";
+
+       Log "Generating autoconf.h... ";
+       open X, ">obj/lib/autoconf.h" or Fail $!;
+       print X "/* Generated automatically by $0, please don't touch manually. */\n";
+       foreach my $x (sort keys %vars) {
+               # Don't export variables which contain no underscores
+               next unless $x =~ /_/;
+               my $v = $vars{$x};
+               # Try to add quotes if necessary
+               $v = '"' . $v . '"' unless ($v =~ /^"/ || $v =~ /^\d*$/);
+               print X "#define $x $v\n";
+       }
+       close X;
+       Log "done\n";
+
+       Log "Generating config.mk... ";
+       open X, ">obj/config.mk" or Fail $!;
+       print X "# Generated automatically by $0, please don't touch manually.\n";
+       foreach my $x (sort keys %vars) {
+               print X "$x=$vars{$x}\n";
+       }
+       close X;
+       Log "done\n";
+}
+
 1;  # OK