Changeset 18707
- Timestamp:
- Jul 24, 2008, 9:38:54 AM (18 years ago)
- File:
-
- 1 edited
-
trunk/psconfig/pschecklibs (modified) (16 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psconfig/pschecklibs
r17598 r18707 5 5 # default system library locations 6 6 @binpath = ( ); 7 @libpath = ( "/ lib", "/usr/lib", "/usr/X11R6/lib", "/usr/local/lib" );8 @incpath = ( "/usr/ include", "/usr/local/include", "/usr/X11R6/include" );7 @libpath = ( "/usr/local/lib", "/usr/lib", "/usr/X11R6/lib", "/lib" ); 8 @incpath = ( "/usr/local/include", "/usr/include", "/usr/X11R6/include" ); 9 9 10 10 $version = ""; … … 14 14 for (; @ARGV > 0; ) { 15 15 if ($ARGV[0] eq "-version") { 16 $version = $ARGV[1];16 $version = $ARGV[1]; 17 17 shift; shift; next; 18 18 } 19 19 if ($ARGV[0] eq "-build") { 20 $build = 1;20 $build = 1; 21 21 shift; next; 22 22 } 23 23 if ($ARGV[0] eq "-force") { 24 if (@ARGV < 2) { die "-force must be coupled to a library name\n"; }25 $force = $ARGV[1];24 if (@ARGV < 2) { die "-force must be coupled to a library name\n"; } 25 $force = $ARGV[1]; 26 26 shift; shift; next; 27 27 } … … 37 37 if ( @ARGV > 1) { &usage(); } 38 38 39 if ( @ARGV == 0) { 39 if ( @ARGV == 0) { 40 40 @list = <$tagsets/*.libs>; 41 41 $file = $list[-1]; … … 110 110 # add the system paths specified for each architecture 111 111 &checkarch (); 112 print "setting architecture to: $arch\n"; 112 print "setting architecture to: $arch\n"; 113 113 print "searching for libraries in: @libpath\n"; 114 114 print "searching for programs in: @binpath\n"; … … 131 131 132 132 if ($force ne "") { 133 if ($force eq $name or (lc($force) eq "all" and lc($tarball) ne "none")) {134 &buildlib ($name, $tarball, $tardir, $use_equals, $configure_opts, $make_opts, $install_opts);135 # exit 0;136 }137 next;133 if ($force eq $name or (lc($force) eq "all" and lc($tarball) ne "none")) { 134 &buildlib ($name, $tarball, $tardir, $use_equals, $configure_opts, $make_opts, $install_opts); 135 # exit 0; 136 } 137 next; 138 138 } 139 139 140 140 ## check for the C library 141 if ($type eq "lib") { 142 $found = &checklib ($name, $altnames, $altpaths);143 } 144 if ($type eq "bin") { 145 $found = &checkbin ($name, $altnames, $altpaths);146 } 147 if ($type eq "inc") { 148 $found = &checkinc ($name, $altnames, $altpaths);149 } 141 if ($type eq "lib") { 142 $found = &checklib ($name, $altnames, $altpaths); 143 } 144 if ($type eq "bin") { 145 $found = &checkbin ($name, $altnames, $altpaths); 146 } 147 if ($type eq "inc") { 148 $found = &checkinc ($name, $altnames, $altpaths); 149 } 150 150 151 151 if ($found) { 152 print "pass $name ($found)\n";153 next;152 print "pass $name ($found)\n"; 153 next; 154 154 } else { 155 print "fail $name\n";156 push @faillibs, "$name";157 } 155 print "fail $name\n"; 156 push @faillibs, "$name"; 157 } 158 158 159 159 if (! $build) { next; } 160 160 if ($type eq "inc") { 161 print "ERROR: missing header file from library which is supposedly installed\n";162 # Will attempt to install library.161 print "ERROR: missing header file from library which is supposedly installed\n"; 162 # Will attempt to install library. 163 163 } 164 164 &buildlib ($name, $tarball, $tardir, $use_equals, $configure_opts, $make_opts, $install_opts); … … 170 170 print "The following C libraries are missing from your system\n"; 171 171 foreach $name (@faillibs) { 172 print " $name\n";172 print " $name\n"; 173 173 } 174 174 print "\n"; … … 184 184 185 185 if ($tarball eq "NONE") { 186 print "No tarball available for $name. You'll have to build it yourself.\n";187 exit 1;186 print "No tarball available for $name. You'll have to build it yourself.\n"; 187 exit 1; 188 188 } 189 189 190 190 if ($name eq "libz") { 191 # zlib doesn't like the full list of arguments to configure192 $psconfigure = "./configure --prefix=$prefix";191 # zlib doesn't like the full list of arguments to configure 192 $psconfigure = "./configure --prefix=$prefix"; 193 193 } else { 194 $psconfigure = `csh psconfig.csh --psconfigure $version`; chomp $psconfigure;194 $psconfigure = `csh psconfig.csh --psconfigure $version`; chomp $psconfigure; 195 195 } 196 196 … … 204 204 print "extract $name from $tarball\n"; 205 205 vsystem ("tar xvzf $tarball"); 206 206 207 207 print "tardir: $tardir\n"; 208 208 … … 211 211 212 212 # build the library using psconfigure, make, make install 213 if ($configure_opts eq "NONE") { 214 vsystem ("$psconfigure");213 if ($configure_opts eq "NONE") { 214 vsystem ("$psconfigure"); 215 215 } else { 216 $configure_opts = join (' ', split (',', $configure_opts));217 vsystem ("$psconfigure $configure_opts");216 $configure_opts = join (' ', split (',', $configure_opts)); 217 vsystem ("$psconfigure $configure_opts"); 218 218 } 219 219 if ($?) { &failure($name, "failure in configure"); } 220 221 if ($make_opts eq "NONE") { 222 vsystem ("make");220 221 if ($make_opts eq "NONE") { 222 vsystem ("make"); 223 223 } else { 224 $make_opts = join (' ', split (',', $make_opts));225 vsystem ("make $make_opts");224 $make_opts = join (' ', split (',', $make_opts)); 225 vsystem ("make $make_opts"); 226 226 } 227 227 if ($?) { &failure($name, "failure in make"); } 228 228 229 229 if ($install_opts eq "NONE") { 230 vsystem ("make install");230 vsystem ("make install"); 231 231 } else { 232 $install_opts = join (' ', split (',', $install_opts));233 vsystem ("make install $install_opts");232 $install_opts = join (' ', split (',', $install_opts)); 233 vsystem ("make install $install_opts"); 234 234 } 235 235 if ($?) { &failure($name, "failure in make install"); } … … 243 243 my $altnames = $_[1]; 244 244 my $altpaths = $_[2]; 245 245 246 246 @subdirs = "."; 247 247 if ($altpaths ne "NONE") { 248 @altpaths = split (',', $altpaths);249 push @subdirs, @altpaths;250 } 251 248 @altpaths = split (',', $altpaths); 249 push @subdirs, @altpaths; 250 } 251 252 252 @trynames = ($name); 253 253 if ($altnames ne "NONE") { 254 @altnames = split (',', $altnames);255 push @trynames, @altnames;254 @altnames = split (',', $altnames); 255 push @trynames, @altnames; 256 256 } 257 257 258 258 # try each of the possible library names 259 foreach $tryname (@trynames) { 260 # try each of the library paths, with the default as well as each altpath261 foreach $topdir ( @libpath ) {262 foreach $subdir ( @subdirs ) {263 if ($subdir eq ".") {264 $path = $topdir;265 } else {266 $path = "$topdir/$subdir";267 }268 # print "trying $path\n";269 if (! -e $path) { next; }270 $libname = "$path/$tryname.a";271 if (-e $libname) { return $libname; }272 # print "no $libname\n";273 $libname = "$path/$tryname.$dlltype";274 if (-e $libname) { return $libname; }275 # print "no $libname\n";276 }277 }278 279 # if we failed to find the basic named library files, try the280 # versions libraries if we find only a .so.N without a matching281 # .so, we link this in the installed libdir282 foreach $topdir ( @libpath ) {283 foreach $subdir ( @subdirs ) {284 if ($subdir eq ".") {285 $path = $topdir;286 } else {287 $path = "$topdir/$subdir";288 }289 if (! -e $path) { next; }290 @libnames = <$path/$tryname.$dlltype*>;291 if (@libnames > 0) { 292 $libname = @libnames[-1];293 # print "making link to numbered .$dlltype library $libdir/$f.$dlltype\n";294 symlink $libname, "$libdir/$f.$dlltype";295 if ($?) { exit 1; }296 return $libname; 297 }298 # print "no $path/$tryname.$dlltype*\n";299 }300 }259 foreach $tryname (@trynames) { 260 # try each of the library paths, with the default as well as each altpath 261 foreach $topdir ( @libpath ) { 262 foreach $subdir ( @subdirs ) { 263 if ($subdir eq ".") { 264 $path = $topdir; 265 } else { 266 $path = "$topdir/$subdir"; 267 } 268 # print "trying $path\n"; 269 if (! -e $path) { next; } 270 $libname = "$path/$tryname.a"; 271 if (-e $libname) { return $libname; } 272 # print "no $libname\n"; 273 $libname = "$path/$tryname.$dlltype"; 274 if (-e $libname) { return $libname; } 275 # print "no $libname\n"; 276 } 277 } 278 279 # if we failed to find the basic named library files, try the 280 # versions libraries if we find only a .so.N without a matching 281 # .so, we link this in the installed libdir 282 foreach $topdir ( @libpath ) { 283 foreach $subdir ( @subdirs ) { 284 if ($subdir eq ".") { 285 $path = $topdir; 286 } else { 287 $path = "$topdir/$subdir"; 288 } 289 if (! -e $path) { next; } 290 @libnames = <$path/$tryname.$dlltype*>; 291 if (@libnames > 0) { 292 $libname = @libnames[-1]; 293 # print "making link to numbered .$dlltype library $libdir/$f.$dlltype\n"; 294 symlink $libname, "$libdir/$f.$dlltype"; 295 if ($?) { exit 1; } 296 return $libname; 297 } 298 # print "no $path/$tryname.$dlltype*\n"; 299 } 300 } 301 301 } 302 302 return 0; … … 307 307 my $altnames = $_[1]; 308 308 my $altpaths = $_[2]; 309 309 310 310 # XXX drop this for bin? 311 311 @subdirs = "."; 312 312 if ($altpaths ne "NONE") { 313 @altpaths = split (',', $altpaths);314 push @subdirs, @altpaths;315 } 316 313 @altpaths = split (',', $altpaths); 314 push @subdirs, @altpaths; 315 } 316 317 317 # try each of the library paths, with the default as well as each altpath 318 318 foreach $topdir ( @binpath ) { 319 foreach $subdir ( @subdirs ) {320 if ($subdir eq ".") {321 $path = $topdir;322 } else {323 $path = "$topdir/$subdir";324 }325 # print "trying $path\n";326 if (! -e $path) { next; }327 $binname = "$path/$name";328 if (-e $binname) { return $binname; }329 }319 foreach $subdir ( @subdirs ) { 320 if ($subdir eq ".") { 321 $path = $topdir; 322 } else { 323 $path = "$topdir/$subdir"; 324 } 325 # print "trying $path\n"; 326 if (! -e $path) { next; } 327 $binname = "$path/$name"; 328 if (-e $binname) { return $binname; } 329 } 330 330 } 331 331 return 0; … … 336 336 my $altnames = $_[1]; 337 337 my $altpaths = $_[2]; 338 338 339 339 @subdirs = "."; 340 340 if ($altpaths ne "NONE") { 341 @altpaths = split (',', $altpaths);342 push @subdirs, @altpaths;343 } 344 341 @altpaths = split (',', $altpaths); 342 push @subdirs, @altpaths; 343 } 344 345 345 # try each of the library paths, with the default as well as each altpath 346 346 foreach $topdir ( @incpath ) { 347 foreach $subdir ( @subdirs ) {348 if ($subdir eq ".") {349 $path = $topdir;350 } else {351 $path = "$topdir/$subdir";352 }353 if (! -e $path) { next; }354 $incname = "$path/$name";355 if (-e $incname) { return $incname; }356 }347 foreach $subdir ( @subdirs ) { 348 if ($subdir eq ".") { 349 $path = $topdir; 350 } else { 351 $path = "$topdir/$subdir"; 352 } 353 if (! -e $path) { next; } 354 $incname = "$path/$name"; 355 if (-e $incname) { return $incname; } 356 } 357 357 } 358 358 … … 362 362 sub checkarch { 363 363 # we are going to supplement the global libpath supplied 364 364 365 365 # check the hardware architecture: 366 366 $sys=`uname -s`; chomp $sys; … … 371 371 372 372 if ($sys eq "IRIX64") { 373 $arch = "irix";374 return;373 $arch = "irix"; 374 return; 375 375 } 376 376 377 377 if ($sys eq "SunOS") { 378 $ver=`uname -r | awk '{print substr($1,1,1)}'`;379 if ($ver == 5) {380 $arch = "sol";381 } else {382 $arch="sun4";383 }384 385 # sun (at least) seems to need the socket library (linux does not)386 push @libpath, "/usr/openwin/lib";387 push @incpath, "/usr/openwin/include";388 389 # XXX this is a problem390 print STDERR "need to add system dependent libraries (eg, libsocket, libnsl)\n";391 exit 1;392 $needlibs = "$needlibs libsocket libnsl";393 $ranlib = "touch";394 return;378 $ver=`uname -r | awk '{print substr($1,1,1)}'`; 379 if ($ver == 5) { 380 $arch = "sol"; 381 } else { 382 $arch="sun4"; 383 } 384 385 # sun (at least) seems to need the socket library (linux does not) 386 push @libpath, "/usr/openwin/lib"; 387 push @incpath, "/usr/openwin/include"; 388 389 # XXX this is a problem 390 print STDERR "need to add system dependent libraries (eg, libsocket, libnsl)\n"; 391 exit 1; 392 $needlibs = "$needlibs libsocket libnsl"; 393 $ranlib = "touch"; 394 return; 395 395 } 396 396 397 397 if ($sys eq "Linux") { 398 $arch = "linux";399 400 if (-e "/etc/sidious.config") { 401 $arch = "sid";402 return;403 }404 405 $mach = `uname -m`; chomp $mach;406 407 if ($mach eq "x86_64") {408 $arch = "lin64";409 unshift @libpath, "/lib64";410 unshift @libpath, "/usr/lib64";411 unshift @libpath, "/usr/X11R6/lib64";412 return;413 }414 return;398 $arch = "linux"; 399 400 if (-e "/etc/sidious.config") { 401 $arch = "sid"; 402 return; 403 } 404 405 $mach = `uname -m`; chomp $mach; 406 407 if ($mach eq "x86_64") { 408 $arch = "lin64"; 409 unshift @libpath, "/lib64"; 410 unshift @libpath, "/usr/lib64"; 411 unshift @libpath, "/usr/X11R6/lib64"; 412 return; 413 } 414 return; 415 415 } 416 416 … … 430 430 431 431 if ($sys eq "HP-UX") { 432 $arch = "hpux";433 return;434 } 435 432 $arch = "hpux"; 433 return; 434 } 435 436 436 print "unknown architecture"; 437 437 exit 1; … … 452 452 @list = <$tagsets/*.perl>; 453 453 foreach $line (@list) { 454 chomp $line;455 ($dist) = $line =~ m|$tagsets/(\S*).perl|;456 print STDERR "$dist\n";454 chomp $line; 455 ($dist) = $line =~ m|$tagsets/(\S*).perl|; 456 print STDERR "$dist\n"; 457 457 } 458 458 exit 2;
Note:
See TracChangeset
for help on using the changeset viewer.
