Update of /cvsroot/leaf/src/bering-uclibc/buildtool/buildtool
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20424

Modified Files:
        buildtool.pm 
Log Message:
- added check (and creation) for /lib/ld-uClibc.so.0 in checkenv, missing link to real 
ld-uClibc.so.0 can cause problems with some configure scripts/tests


Index: buildtool.pm
===================================================================
RCS file: /cvsroot/leaf/src/bering-uclibc/buildtool/buildtool/buildtool.pm,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** buildtool.pm        21 Feb 2004 22:01:41 -0000      1.13
--- buildtool.pm        24 Apr 2004 04:19:57 -0000      1.14
***************
*** 69,111 ****
  }
  
- 
- 
- sub dump_hash {
-   my $hash = shift;
-   my $lvl = shift || 0;
-   my $ins = "";
-   my $newlvl;
- 
-   for (my $a = 0 ; $a < $lvl; $a++) {
-     $ins.= "      ";
-   }
- #  print $ins. "--------------------\n";
-   print "\n";
-   foreach my $key (keys %{$hash}) {
-    # print "$key:\n";
-     if (ref($hash->{$key}) eq "HASH") {
-       my $newlvl = ($lvl + 1);
-       print $ins . "->". $key.":";
-       dump_hash($hash->{$key}, $newlvl);
-     } elsif (ref($hash->{$key}) eq "ARRAY") {
-       for (my $a = 0 ; $a < scalar @{$hash->{$key}}; $a++) {
-       if (ref($hash->{$key}[$a]) eq "HASH") {
-         dump_hash($hash->{$key}[$a], $newlvl);
-       } else {
-         print "$ins". $hash->{$key}[$a] ."\n";
-       }
-       }
-     } else {
-       print $ins . $key.":" .$hash->{$key}."\n";
- 
-     }
-   }
- 
- }
- 
- 
- 
- 
- 
  ########################################################
  # adds the buildroot path to a given path if path is not
--- 69,72 ----
***************
*** 125,129 ****
  # checks the build environment (dirs and...)
  sub check_env {
! 
    my @dirs = @{$globConf{'buildenv_dir'}};
    foreach my $dir (@dirs) {
--- 86,90 ----
  # checks the build environment (dirs and...)
  sub check_env {
!       logme("checking build environment");
    my @dirs = @{$globConf{'buildenv_dir'}};
    foreach my $dir (@dirs) {
***************
*** 136,139 ****
--- 97,101 ----
        }
      }
+   check_lib_link();
  #  # search for itrace in the path...
  #  (system("which itrace >/dev/null 2>&1") == 0 ) or
***************
*** 143,146 ****
--- 105,135 ----
  }
  
+ # checks if the link from /lib/ld-uclibc.so to stagingdir/lib exists
+ sub check_lib_link {
+       my $linktarget;
+       my $linkdest = make_absolute_path("staging/lib/ld-uClibc.so.0");
+       logme("checking link /lib/ld-uClibc.so");
+       if ($linktarget=readlink("/lib/ld-uClibc.so.0")) {
+           # check if pointing to right location
+           if ($linktarget eq $linkdest) {
+                 return 1;
+           }
+       }
+       # else
+       print "\n\n" .buildtool::Common::Object::make_text_red('','Warning:');
+       print "The symlink from /lib/ld-uClibc.so.0 --> $linkdest does not exist, this 
may cause problems with some configure scripts that try to run a compiled 
program\n\nShould i create this link for you (Y/n)?";
+       my $ask = <STDIN>;
+       chop $ask;
+       if ($ask eq "" or $ask eq "y" or $ask eq "Y" or $ask eq "j" or $ask eq "J" ) {
+           print "please enter root ";
+           if (system("su -c \"ln -f -s $linkdest /lib/ld-uClibc.so.0 \"") != 0) {
+                 die "cannot create symlink";
+           }
+           
+       } 
+       return 1;
+ }
+ 
+ 
  ####################################################
  # print a colored o.k.



-------------------------------------------------------
This SF.net email is sponsored by: The Robotic Monkeys at ThinkGeek
For a limited time only, get FREE Ground shipping on all orders of $35
or more. Hurry up and shop folks, this offer expires April 30th!
http://www.thinkgeek.com/freeshipping/?cpg=12297
_______________________________________________
Leaf-cvs-commits mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/leaf-cvs-commits

Reply via email to