Reviewed by eseidel.
authoraroben <aroben@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 13 Sep 2006 07:08:39 +0000 (07:08 +0000)
committeraroben <aroben@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 13 Sep 2006 07:08:39 +0000 (07:08 +0000)
        Switch back to passing relative paths to generate-bindings.pl when
        generating JS bindings.

        * DerivedSources.make: Pass in relative paths to generate-bindings.pl
        * bindings/scripts/CodeGenerator.pm: Make ScanDirectory never call
        chdir and always construct absolute paths instead.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@16342 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebCore/ChangeLog
WebCore/DerivedSources.make
WebCore/bindings/scripts/CodeGenerator.pm

index 4b2729ff1929d03e801fb210ecee2434dace97c9..efb95447618188d1df7bba0a1d897fb4aac3aa7c 100644 (file)
@@ -1,3 +1,14 @@
+2006-09-12  Adam Roben  <aroben@apple.com>
+
+        Reviewed by eseidel.
+
+        Switch back to passing relative paths to generate-bindings.pl when
+        generating JS bindings.
+
+        * DerivedSources.make: Pass in relative paths to generate-bindings.pl
+        * bindings/scripts/CodeGenerator.pm: Make ScanDirectory never call
+        chdir and always construct absolute paths instead.
+
 2006-09-12  David Hyatt  <hyatt@apple.com>
 
         Fix for bug 3244, implement html4 label support.
index 86b016e3ebb06d617b8595b7a4d55ca66ca42ebe..4a869fb594e88bc573f6de133d7266b8e5d3103b 100644 (file)
@@ -515,7 +515,7 @@ OBJC_BINDINGS_SCRIPTS = \
 #
 
 DOM%.h : %.idl $(OBJC_BINDINGS_SCRIPTS) bindings/objc/PublicDOMInterfaces.h
-       perl -I`pwd`/$(WebCore)/bindings/scripts `pwd`/$(WebCore)/bindings/scripts/generate-bindings.pl --defines "$(FEATURE_DEFINES) LANGUAGE_OBJECTIVE_C" --generator ObjC --include `pwd`/$(WebCore)/dom --include `pwd`/$(WebCore)/html --include `pwd`/$(WebCore)/xpath --include `pwd`/$(WebCore)/ksvg2/svg --outputdir `pwd` $<
+       perl -I $(WebCore)/bindings/scripts $(WebCore)/bindings/scripts/generate-bindings.pl --defines "$(FEATURE_DEFINES) LANGUAGE_OBJECTIVE_C" --generator ObjC --include $(WebCore)/dom --include $(WebCore)/html --include $(WebCore)/xpath --include $(WebCore)/ksvg2/svg --outputdir . $<
 
 # new-style JavaScript bindings
 
@@ -528,4 +528,4 @@ JS_BINDINGS_SCRIPTS = \
 #
 
 JS%.h : %.idl $(JS_BINDINGS_SCRIPTS)
-       perl -I`pwd`/$(WebCore)/bindings/scripts `pwd`/$(WebCore)/bindings/scripts/generate-bindings.pl --defines "$(FEATURE_DEFINES) LANGUAGE_JAVASCRIPT" --generator JS --include `pwd`/$(WebCore)/dom --include `pwd`/$(WebCore)/html --include `pwd`/$(WebCore)/xml --include `pwd`/$(WebCore)/ksvg2/svg --outputdir `pwd` $<
+       perl -I $(WebCore)/bindings/scripts $(WebCore)/bindings/scripts/generate-bindings.pl --defines "$(FEATURE_DEFINES) LANGUAGE_JAVASCRIPT" --generator JS --include dom --include html --include xml --include ksvg2/svg --outputdir . $<
index d8941e1fc8d7e1e884ce22a7bdcef8c19c3973d6..477ae4ef28bfab8e3ec6952cbc32f96a6d0e638a 100644 (file)
@@ -44,7 +44,7 @@ my %svgAnimatedTypeHash = ("SVGAnimatedAngle" => 1, "SVGAnimatedBoolean" => 1,
                            "SVGAnimatedPreserveAspectRatio" => 1,
                            "SVGAnimatedRect" => 1, "SVGAnimatedString" => 1,
                            "SVGAnimatedTransformList" => 1);
-    
+
 # Helpers for 'ScanDirectory'
 my $endCondition = 0;
 my $foundFilename = "";
@@ -208,10 +208,10 @@ sub ScanDirectory
 
     return if ($endCondition eq 1) and ($reportAllFiles eq 0);
 
-    chdir($directory) or die "[ERROR] Can't enter directory $directory: \"$!\"\n";
-    opendir(DIR, ".") or die "[ERROR] Can't open directory $directory: \"$!\"\n";
+    $thisDir = "$ENV{SOURCE_ROOT}/$directory";
+    opendir(DIR, $thisDir) or die "[ERROR] Can't open directory $thisDir: \"$!\"\n";
 
-    my @names = readdir(DIR) or die "[ERROR] Cant't read directory $directory: \"$!\"\n";
+    my @names = readdir(DIR) or die "[ERROR] Cant't read directory $thisDir \"$!\"\n";
     closedir(DIR);
 
     foreach my $name (@names) {
@@ -220,8 +220,8 @@ sub ScanDirectory
         next if ($endCondition eq 1) or ($name =~ /^\./);
 
         # Recurisvely enter directory
-        if (-d $name) {
-            $object->ScanDirectory($interface, $name, $useDirectory, $reportAllFiles);
+        if (-d "$thisDir/$name") {
+            $object->ScanDirectory($interface, "$thisDir/$name", $useDirectory, $reportAllFiles);
             next;
         }
 
@@ -230,7 +230,7 @@ sub ScanDirectory
         $condition = 1 if ($interface eq "allidls") and ($name =~ /\.idl$/);
 
         if ($condition) {
-            $foundFilename = "$directory/$name";
+            $foundFilename = "$thisDir/$name";
 
             if ($reportAllFiles eq 0) {
                 $endCondition = 1;
@@ -238,8 +238,6 @@ sub ScanDirectory
                 push(@foundFilenames, $foundFilename);
             }
         }
-
-        chdir($useDirectory) or die "[ERROR] Can't change directory to $useDirectory: \"$!\"\n";
     }
 }