Changeset 18315
- Timestamp:
- Jun 24, 2008, 3:30:10 PM (18 years ago)
- File:
-
- 1 edited
-
trunk/psconfig/psbuild (modified) (11 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psconfig/psbuild
r17403 r18315 19 19 for (; @ARGV > 0; ) { 20 20 if ($ARGV[0] eq "-version") { 21 $version = $ARGV[1];21 $version = $ARGV[1]; 22 22 shift; shift; next; 23 23 } 24 24 if ($ARGV[0] eq "-verbose") { 25 $verbose = 1;25 $verbose = 1; 26 26 shift; next; 27 27 } 28 28 if ($ARGV[0] eq "-extlibs") { 29 $extlibs = $ARGV[1];29 $extlibs = $ARGV[1]; 30 30 shift; shift; next; 31 31 } 32 32 if ($ARGV[0] eq "-extperl") { 33 $extperl = $ARGV[1];33 $extperl = $ARGV[1]; 34 34 shift; shift; next; 35 35 } 36 36 if ($ARGV[0] eq "-clean") { 37 $clean = 1;37 $clean = 1; 38 38 shift; next; 39 39 } 40 40 if ($ARGV[0] eq "-extcheck") { 41 $extlibs = "check";42 $extperl = "check";41 $extlibs = "check"; 42 $extperl = "check"; 43 43 shift; next; 44 44 } 45 45 if ($ARGV[0] eq "-extbuild") { 46 $extlibs = "build";47 $extperl = "build";46 $extlibs = "build"; 47 $extperl = "build"; 48 48 shift; next; 49 49 } 50 50 if ($ARGV[0] eq "-rebuild") { 51 $rebuild = 1;51 $rebuild = 1; 52 52 shift; next; 53 53 } 54 54 if ($ARGV[0] eq "-optimize") { 55 $optimize = 1;55 $optimize = 1; 56 56 shift; next; 57 57 } 58 58 if ($ARGV[0] eq "-dev") { 59 $developer = 1;59 $developer = 1; 60 60 shift; next; 61 61 } 62 62 if ($ARGV[0] eq "-only") { 63 $start = $ARGV[1];64 $stop = $ARGV[1];63 $start = $ARGV[1]; 64 $stop = $ARGV[1]; 65 65 shift; shift; next; 66 66 } 67 67 if ($ARGV[0] eq "-start") { 68 $start = $ARGV[1];68 $start = $ARGV[1]; 69 69 shift; shift; next; 70 70 } 71 71 if ($ARGV[0] eq "-stop") { 72 $stop = $ARGV[1];72 $stop = $ARGV[1]; 73 73 shift; shift; next; 74 74 } 75 75 if ($ARGV[0] eq "-list") { 76 &list_distributions ();76 &list_distributions (); 77 77 } 78 78 if ($ARGV[0] eq "-bootstrap") { 79 &bootstrap ();79 &bootstrap (); 80 80 } 81 81 if ($ARGV[0] eq "-env") { 82 &show_environment ();82 &show_environment (); 83 83 } 84 84 if ($ARGV[0] eq "-h") { &usage (); } … … 90 90 @ARGV = @tARGV; 91 91 92 if ( @ARGV == 0) { 92 if ( @ARGV == 0) { 93 93 @list = <$tagsets/*.dist>; 94 94 $distribution = $list[-1]; … … 111 111 112 112 sub show_environment { 113 113 114 114 # use psconfig.csh to set needed build aliases 115 115 116 116 # set the psconfig version: 117 117 if ("$version" eq "") { 118 $version = $ENV{'PSVERSION'};118 $version = $ENV{'PSVERSION'}; 119 119 } 120 120 if ("$version" eq "") { 121 $version = "default";121 $version = "default"; 122 122 } 123 123 124 124 if (! -e psconfig.csh) { 125 $psconfdir = $ENV{'PSCONFDIR'};126 if ($psconfdir eq "") { die "PSCONFDIR not found, run psbuild -bootstrap and follow instructions\n"; }127 vsystem ("cat psconfig.csh.in | sed 's|\@PSCONFDIR@|$psconfdir|' > psconfig.csh");128 vsystem ("cat psconfig.bash.in | sed 's|\@PSCONFDIR@|$psconfdir|' > psconfig.bash");125 $psconfdir = $ENV{'PSCONFDIR'}; 126 if ($psconfdir eq "") { die "PSCONFDIR not found, run psbuild -bootstrap and follow instructions\n"; } 127 vsystem ("cat psconfig.csh.in | sed 's|\@PSCONFDIR@|$psconfdir|' > psconfig.csh"); 128 vsystem ("cat psconfig.bash.in | sed 's|\@PSCONFDIR@|$psconfdir|' > psconfig.bash"); 129 129 } 130 130 … … 138 138 139 139 # set build environment variables 140 ps_setenv (1, "PATH", "--path");141 ps_setenv (1, "CPATH", "--cpath");142 ps_setenv (1, "ARCH", "--arch");140 ps_setenv (1, "PATH", "--path"); 141 ps_setenv (1, "CPATH", "--cpath"); 142 ps_setenv (1, "ARCH", "--arch"); 143 143 ps_setenv (1, "LIBRARY_PATH", "--library_path"); 144 144 ps_setenv (1, "LD_LIBRARY_PATH", "--ld_library_path"); … … 151 151 152 152 sub build_distribution { 153 153 154 154 # use psconfig.csh to set needed build aliases 155 155 156 if ($extlibs eq "check") { 157 $status = vsystem ("pschecklibs");158 if ($status) { die "failed to find external libraries\n"; }159 } 160 if ($extlibs eq "build") { 161 $status = vsystem ("pschecklibs -build");162 if ($status) { die "failed to build external libraries\n"; }163 } 164 165 if ($extperl eq "check") { 166 $status = vsystem ("pschecklperl");167 if ($status) { die "failed to find external perl modules\n"; }168 } 169 if ($extperl eq "build") { 170 $status = vsystem ("pscheckperl -build");171 if ($status) { die "failed to build external perl modules\n"; }156 if ($extlibs eq "check") { 157 $status = vsystem ("pschecklibs"); 158 if ($status) { die "failed to find external libraries\n"; } 159 } 160 if ($extlibs eq "build") { 161 $status = vsystem ("pschecklibs -build"); 162 if ($status) { die "failed to build external libraries\n"; } 163 } 164 165 if ($extperl eq "check") { 166 $status = vsystem ("pschecklperl"); 167 if ($status) { die "failed to find external perl modules\n"; } 168 } 169 if ($extperl eq "build") { 170 $status = vsystem ("pscheckperl -build"); 171 if ($status) { die "failed to build external perl modules\n"; } 172 172 } 173 173 174 174 # set the psconfig version: 175 175 if ("$version" eq "") { 176 $version = $ENV{'PSVERSION'};176 $version = $ENV{'PSVERSION'}; 177 177 } 178 178 if ("$version" eq "") { 179 $version = "default";179 $version = "default"; 180 180 } 181 181 … … 189 189 190 190 # set build environment variables 191 ps_setenv (0, "PATH", "--path");192 ps_setenv (0, "CPATH", "--cpath");193 ps_setenv (0, "ARCH", "--arch");191 ps_setenv (0, "PATH", "--path"); 192 ps_setenv (0, "CPATH", "--cpath"); 193 ps_setenv (0, "ARCH", "--arch"); 194 194 ps_setenv (0, "LIBRARY_PATH", "--library_path"); 195 195 ps_setenv (0, "LD_LIBRARY_PATH", "--ld_library_path"); … … 213 213 $stop_now = 0; 214 214 for ($i = 0; !$stop_now && ($i < @cvsname); $i++) { 215 if (($stop ne "") && ($stop eq $cvsname[$i])) { $stop_now = 1; }216 if (($start ne "") && ($start ne $cvsname[$i])) { next; }217 $start = "";218 219 ($do_tag, $do_build, $do_package, $do_update, $dev_build) = $mode[$i] =~ m|(\S)(\S)(\S)(\S)(\S)|;220 if ($developer) { $do_build = $dev_build; }221 if ($do_build eq "N") { next; }222 223 $workdir = "../$cvsname[$i]";224 225 # XXX need to grab current value for cleanup226 print "\n ** psbuild: $cvsname[$i] ** \n";227 print "\033]0; ** psbuild: $cvsname[$i] ** \007";228 229 if (!-d $workdir || !-r $workdir || !-x $workdir) { 230 print STDERR "WARNING: no directory for component $cvsname[$i], skipping\n"; 231 next;232 }233 234 chdir $workdir;235 236 # how do we build this component?237 # - autogen.sh : configure : make : make install238 # - configure : make : make install239 # - make : make install240 # - perl Build.PL : ./Build : ./Build install241 242 if (-e "Build.PL") {243 vsystem ("$psperlbuild");244 if ($?) { &failure($cvsname[$i], "failure in perl Build.PL"); }245 246 vsystem ("./Build");247 if ($?) { &failure($cvsname[$i], "failure in Build"); }248 249 vsystem ("./Build install");250 if ($?) { &failure($cvsname[$i], "failure in Build install"); }251 252 next;253 }254 255 if ($rebuild && $clean) {256 if (-e "configure") { unlink "Makefile"; }257 if ($developer && -e "configure.ac" && -e "autogen.sh") { unlink "configure"; }258 }259 $rebuild_this = $rebuild;260 261 # set a local variable for this loop on rebuild;262 if (! -e "Makefile") { $rebuild_this = 1; }263 264 # run autogen265 $skip_configure = 0;266 if ($developer && $rebuild_this && ! -e "configure" && -e "autogen.sh") {267 $skip_configure = 1;268 vsystem ("$psautogen $psopts");269 if ($?) { &failure($cvsname[$i], "failure in psautogen"); }270 }271 272 if ($rebuild_this && -e "configure" && !$skip_configure) {273 vsystem ("$psconfigure $psopts");274 if ($?) { &failure($cvsname[$i], "failure in psconfigure"); }275 }276 277 if (! -e "Makefile") { &failure($cvsname[$i], "missing makefile: do you need to run the -dev developer build?"); }278 279 if ($clean) { 280 vsystem ("make clean");281 if ($?) { &failure($cvsname[$i], "failure in make clean"); }282 }283 284 vsystem ("make");285 if ($?) { &failure($cvsname[$i], "failure in make"); }286 287 vsystem ("make install");288 if ($?) { &failure($cvsname[$i], "failure in make install"); }289 290 print "*** done with $cvsname[$i] ***\n";215 if (($stop ne "") && ($stop eq $cvsname[$i])) { $stop_now = 1; } 216 if (($start ne "") && ($start ne $cvsname[$i])) { next; } 217 $start = ""; 218 219 ($do_tag, $do_build, $do_package, $do_update, $dev_build) = $mode[$i] =~ m|(\S)(\S)(\S)(\S)(\S)|; 220 if ($developer) { $do_build = $dev_build; } 221 if ($do_build eq "N") { next; } 222 223 $workdir = "../$cvsname[$i]"; 224 225 # XXX need to grab current value for cleanup 226 print "\n ** psbuild: $cvsname[$i] ** \n"; 227 print "\033]0; ** psbuild: $cvsname[$i] ** \007"; 228 229 if (!-d $workdir || !-r $workdir || !-x $workdir) { 230 print STDERR "WARNING: no directory for component $cvsname[$i], skipping\n"; 231 next; 232 } 233 234 chdir $workdir; 235 236 # how do we build this component? 237 # - autogen.sh : configure : make : make install 238 # - configure : make : make install 239 # - make : make install 240 # - perl Build.PL : ./Build : ./Build install 241 242 if (-e "Build.PL") { 243 vsystem ("$psperlbuild"); 244 if ($?) { &failure($cvsname[$i], "failure in perl Build.PL"); } 245 246 vsystem ("./Build"); 247 if ($?) { &failure($cvsname[$i], "failure in Build"); } 248 249 vsystem ("./Build install"); 250 if ($?) { &failure($cvsname[$i], "failure in Build install"); } 251 252 next; 253 } 254 255 if ($rebuild && $clean) { 256 if (-e "configure") { unlink "Makefile"; } 257 if ($developer && -e "configure.ac" && -e "autogen.sh") { unlink "configure"; } 258 } 259 $rebuild_this = $rebuild; 260 261 # set a local variable for this loop on rebuild; 262 if (! -e "Makefile") { $rebuild_this = 1; } 263 264 # run autogen 265 $skip_configure = 0; 266 if ($developer && $rebuild_this && ! -e "configure" && -e "autogen.sh") { 267 $skip_configure = 1; 268 vsystem ("$psautogen $psopts"); 269 if ($?) { &failure($cvsname[$i], "failure in psautogen"); } 270 } 271 272 if ($rebuild_this && -e "configure" && !$skip_configure) { 273 vsystem ("$psconfigure $psopts"); 274 if ($?) { &failure($cvsname[$i], "failure in psconfigure"); } 275 } 276 277 if (! -e "Makefile") { &failure($cvsname[$i], "missing makefile: do you need to run the -dev developer build?"); } 278 279 if ($clean) { 280 vsystem ("make clean"); 281 if ($?) { &failure($cvsname[$i], "failure in make clean"); } 282 } 283 284 vsystem ("make"); 285 if ($?) { &failure($cvsname[$i], "failure in make"); } 286 287 vsystem ("make install"); 288 if ($?) { &failure($cvsname[$i], "failure in make install"); } 289 290 print "*** done with $cvsname[$i] ***\n"; 291 291 292 292 success: 293 chdir $homedir;293 chdir $homedir; 294 294 } 295 295 print "\033]0; ** psbuild: finished ** \007"; … … 306 306 @list = <$tagsets/*.dist>; 307 307 foreach $line (@list) { 308 chomp $line;309 ($dist) = $line =~ m|$tagsets/(\S*).dist|;310 print STDERR "$dist\n";308 chomp $line; 309 ($dist) = $line =~ m|$tagsets/(\S*).dist|; 310 print STDERR "$dist\n"; 311 311 } 312 312 exit 2; … … 326 326 vsystem ("cp psconfig.csh $psconfdir/psconfig.csh"); 327 327 vsystem ("cp psconfig.bash $psconfdir/psconfig.bash"); 328 vsystem ("chmod u+x $psconfdir/psconfig.bash"); 328 329 329 330 print STDOUT "\n"; 330 331 331 332 print STDOUT "** if you use csh, tcsh or equivalent as your shell, add the following to your .cshrc\n"; 332 333 print STDOUT " if (-e $psconfdir/psconfig.csh) then\n"; … … 363 364 364 365 foreach $line (@list) { 365 chop $line;366 if ($line =~ m|^\s*$|) { next; }367 if ($line =~ m|^\s*\#|) { next; }368 369 ($mode, $cvsname, $branchtag, $branchver) = split (" ", $line);370 371 if ($cvsname eq "") { die "missing module name\n"; }372 373 ($do_tag, $do_build, $do_package, $do_update) = $mode =~ m|(\S)(\S)(\S)(\S)|;374 if (($do_tag ne "Y") && ($do_tag ne "N")) { die "invalid tag option $do_tag\n"; }375 if (($do_build ne "Y") && ($do_build ne "N")) { die "invalid tag option $do_build\n"; }376 if (($do_package ne "Y") && ($do_package ne "N")) { die "invalid tag option $do_package\n"; }377 if (($do_update ne "Y") && ($do_update ne "N")) { die "invalid tag option $do_update\n"; }378 379 if ($verbose) { print "tag: $do_tag, build: $do_build, package: $do_package, update: $do_update "; }380 if ($verbose) { print "module: $cvsname, branchtag: $branchtag, branchver: $branchver \n"; }381 382 push @mode, $mode;383 push @cvsname, $cvsname;384 push @branchtag, $branchtag;385 push @branchver, $branchver;366 chop $line; 367 if ($line =~ m|^\s*$|) { next; } 368 if ($line =~ m|^\s*\#|) { next; } 369 370 ($mode, $cvsname, $branchtag, $branchver) = split (" ", $line); 371 372 if ($cvsname eq "") { die "missing module name\n"; } 373 374 ($do_tag, $do_build, $do_package, $do_update) = $mode =~ m|(\S)(\S)(\S)(\S)|; 375 if (($do_tag ne "Y") && ($do_tag ne "N")) { die "invalid tag option $do_tag\n"; } 376 if (($do_build ne "Y") && ($do_build ne "N")) { die "invalid tag option $do_build\n"; } 377 if (($do_package ne "Y") && ($do_package ne "N")) { die "invalid tag option $do_package\n"; } 378 if (($do_update ne "Y") && ($do_update ne "N")) { die "invalid tag option $do_update\n"; } 379 380 if ($verbose) { print "tag: $do_tag, build: $do_build, package: $do_package, update: $do_update "; } 381 if ($verbose) { print "module: $cvsname, branchtag: $branchtag, branchver: $branchver \n"; } 382 383 push @mode, $mode; 384 push @cvsname, $cvsname; 385 push @branchtag, $branchtag; 386 push @branchver, $branchver; 386 387 } 387 388 } … … 426 427 $ENV{$var} = $answer; 427 428 if ($verbose) { 428 print STDERR "$var = $answer\n";429 } 430 } 431 429 print STDERR "$var = $answer\n"; 430 } 431 } 432
Note:
See TracChangeset
for help on using the changeset viewer.
