IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 12136


Ignore:
Timestamp:
Mar 1, 2007, 9:40:41 AM (19 years ago)
Author:
eugene
Message:

fixing build tool names

Location:
trunk/psconfig
Files:
2 added
1 deleted
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/psconfig/psbuild

    r11637 r12136  
    1 #!/bin/csh
    2 
    3 set args=""
    4 set clean=0
    5 set rebuild=0
    6 set update=0
    7 set optimize=0
    8 set version=""
    9 set start=""
    10 set stop=""
    11 while ($#argv)
    12  switch ($1)
    13   case -version:
    14    shift
    15    set version=$1;
    16    breaksw;
    17   case -clean:
    18    set clean=1;
    19    breaksw;
    20   case -rebuild:
    21    set rebuild=1;
    22    set clean=1;
    23    breaksw;
    24   case -update:
    25    set update=1;
    26    breaksw;
    27   case -optimize:
    28    set optimize=1;
    29    breaksw;
    30   case -only:
    31    shift
    32    set start=$1;
    33    set stop=$1;
    34    breaksw;
    35   case -start:
    36    shift
    37    set start=$1;
    38    breaksw;
    39   case -stop:
    40    shift
    41    set stop=$1;
    42    breaksw;
    43   default:
    44    set args=($args $1);
    45    breaksw;
    46  endsw
    47  shift
    48 end
    49 
    50 if ($#args != 1) goto usage
    51 if ("$args" == "") goto usage
    52 
    53 set group   = $args[1]
    54 set tagsets = tagsets/$group
    55 
    56 if (! -e $tagsets) then
    57   echo "target $group not found in tagsets"
    58   exit 2
    59 endif
    60 
    61 # set the version based on psconfig or -version (if set)
    62 if ("$version" != "") then
    63   source psconfig.sh $version
    64 else
    65   if (! $?PSVERSION) then
    66     source psconfig.sh default
    67   else
    68     source psconfig.sh $PSVERSION
    69   endif
    70 endif
    71 
    72 set psopts = ""
    73 if ($optimize) set psopts = "$psopts --enable-optimize"
    74 
    75 foreach target (`cat $tagsets | grep -v \#`)
    76  set name = `echo $target | tr ':' ' '`
    77 
    78  set dir = $name[1]
    79  set tag = $name[2]
    80 
    81  set mode = "NORMAL"
    82  set branch = 0
    83 
    84  if ($#name >= 3) then
    85    set branch = $name[3]
    86  endif
    87  if ($#name >= 4) then
    88    set mode = $name[4]
    89  endif
    90 
    91  if ("$start" != "") then
    92    if ("$start" != "$dir") then
    93      echo "skipping $dir"
    94      continue
    95    endif
    96    set start = ""
    97  endif
    98 
    99  if ("$mode" == "SKIP") then
    100     echo "skipping $dir"
    101     continue
    102  endif
    103 
    104  set current = `pwd`
    105  cd ../$dir
     1#!/usr/bin/env perl
     2
     3$tagsets = "tagsets";
     4
     5$version = "";
     6$clean = 0;
     7$rebuild = 0;
     8$optimize = 0;
     9$start = "";
     10$stop = "";
     11$verbose = 0;
     12
     13@tARGV = ();
     14for (; @ARGV > 0; ) {
     15    if ($ARGV[0] eq "-version") {
     16        $version = $ARGV[1];
     17        shift; shift; next;
     18    }
     19    if ($ARGV[0] eq "-verbose") {
     20        $verbose = 1;
     21        shift; next;
     22    }
     23    if ($ARGV[0] eq "-clean") {
     24        $clean = 1;
     25        shift; next;
     26    }
     27    if ($ARGV[0] eq "-rebuild") {
     28        $rebuild = 1;
     29        shift; next;
     30    }
     31    if ($ARGV[0] eq "-optimize") {
     32        $optimize = 1;
     33        shift; next;
     34    }
     35    if ($ARGV[0] eq "-only") {
     36        $start = $ARGV[1];
     37        $stop = $ARGV[1];
     38        shift; shift; next;
     39    }
     40    if ($ARGV[0] eq "-start") {
     41        $start = $ARGV[1];
     42        shift; shift; next;
     43    }
     44    if ($ARGV[0] eq "-stop") {
     45        $stop = $ARGV[1];
     46        shift; shift; next;
     47    }
     48    if ($ARGV[0] eq "-list") {
     49        &list_distributions ();
     50    }
     51    if ($ARGV[0] eq "-h")     { &usage (); }
     52    if ($ARGV[0] eq "-help")  { &usage (); }
     53    if ($ARGV[0] eq "--help") { &usage (); }
     54    @tARGV = (@tARGV, $ARGV[0]);
     55    shift;
     56}
     57@ARGV = @tARGV;
     58
     59if ( @ARGV != 1) { &usage (); }
     60
     61$distribution = $ARGV[0];
     62&load_distfile ();
     63
     64&build_distribution ();
     65exit 0;
     66
     67sub build_distribution {
     68   
     69    # use psconfig.sh to set needed build aliases
     70
     71    # set the psconfig version:
     72    if ("$version" eq "") {
     73        $version = $ENV{'PSVERSION'};
     74    }
     75    if ("$version" eq "") {
     76        $version = "default";
     77    }
     78
     79    $psconfigure = `csh psconfig.sh --psconfigure $version`;
     80    $psautogen   = `csh psconfig.sh --psautogen $version`;
     81    $psperlbuild = `csh psconfig.sh --psperlbuild $version`;
     82
     83    print "psconfigure: $psconfigure\n";
     84    print "psautogen:   $psautogen\n";
     85    print "psperlbuild: $psperlbuild\n";
     86
     87    # set build environment variables
     88    ps_setenv ("PATH",            "--path");
     89    ps_setenv ("ARCH",            "--arch");
     90    ps_setenv ("LD_LIBRARY_PATH", "--ld_library_path");
     91    ps_setenv ("PKG_CONFIG_PATH", "--pkg_config_path");
     92    ps_setenv ("ACLOCAL_FLAGS",   "--aclocal_flags");
     93    ps_setenv ("PERL5LIB",        "--perl5lib");
     94
     95    print STDERR "ENV: $ENV{'PATH'}\n";
     96
     97    $psopts = "";
     98    if ($optimize) { $psopts = "$psopts --enable-optimize"; }
     99
     100    $homedir = `pwd`; chomp $homedir;
     101
     102    for ($i = 0; $i < @cvsname; $i++) {
     103        if (($start ne "") && ($start ne $cvsname[$i])) { next; }
     104        $start = "";
     105
     106        ($do_tag, $do_build, $do_package, $do_update) = $mode[$i] =~ m|(\S)(\S)(\S)(\S)|;
     107        if ($do_build eq "N") { next; }
     108
     109        $workdir = "../$cvsname[$i]";
     110        print "workdir: $workdir\n";
     111        chdir $workdir;
     112       
     113        # XXX need to grab current value for cleanup
     114        print "\n ** psbuild: $cvsname[$i] ** \n";
     115        print "\033]0; ** psbuild: $cvsname[$i] ** \007";
     116
     117        # how do we build this component?
     118        # - autogen.sh : configure : make : make install
     119        # - configure : make : make install
     120        # - make : make install
     121        # - perl Build.PL : ./Build : ./Build install
    106122 
    107  echo ""
    108  echo "***** building $name ($target) *****"
    109  pwd
    110 
    111  if ($update) then
    112   switch ($tag)
    113    case HEAD:
    114     cvs -q up -d -A
    115     if ($status) goto failure;
    116     breaksw;
    117    case NONE:
    118     breaksw;
    119    default:
    120     cvs -q up -d -r $tag
    121     if ($status) goto failure;
    122     breaksw;
    123   endsw
    124  endif
    125 
    126  # how do we build this component?
    127  # - autogen.sh : configure : make : make install
    128  # - configure : make : make install
    129  # - make : make install
    130  # - perl Build.PL : ./Build : ./Build install
    131  
    132  if (-e Build.PL) then
    133     echo $PERL5LIB
    134     alias psperlbuild
    135     psperlbuild
    136     # perl Build.PL --install_path script=$bindir --install_path lib=$libdir --install_path bindoc={$PSCONFDIR}/man/man1 --install_path libdoc={$PSCONFDIR}/man/man3
    137     if ($status) goto failure;
    138 
    139     ./Build
    140     if ($status) goto failure;
    141 
    142     ./Build install
    143     if ($status) goto failure;
    144 
    145     goto success;
    146  endif
    147 
    148  if ($rebuild && $clean) then
    149    if (-e configure) rm -f Makefile
    150    if (-e configure.ac && -e autogen.sh) rm -f configure
    151  endif
    152 
    153  if (! -e Makefile) set rebuild = 1
    154 
    155  #  fix this: this runs autogen, which runs configure, then re-runs configure!
    156  if ($rebuild && ! -e configure && -e autogen.sh) then
    157     echo psautogen $psopts
    158     psautogen $psopts
    159     if ($status) goto failure;
    160  endif
    161 
    162  if ($rebuild && -e configure) then
    163     echo psconfigure $psopts
    164     psconfigure $psopts
    165     if ($status) goto failure;
    166  endif
    167 
    168  if (! -e Makefile) goto failure;
    169 
    170  if ($clean) then
    171     echo make clean
    172     make clean
    173     if ($status) goto failure;
    174  endif
    175 
    176  make
    177  if ($status) goto failure;
    178 
    179  make install
    180  if ($status) goto failure;
    181 
    182  success:
    183  cd $current
    184 
    185  if ("$stop" != "") then
    186    if ("$stop" == "$dir") then
    187      echo "stopping at $dir"
    188      exit 0
    189    endif
    190  endif
    191 
    192 end
    193 
    194 exit 0
    195 
    196 usage:
    197   echo "USAGE: psbuild (group) [-version version] [-clean] [-rebuild] [-update] [-optimize]"
    198   exit 2
    199 
    200 failure:
    201   echo "psbuild failed"
    202   echo "target: $target"
    203   echo "dir: $dir"
    204   echo "tag: $tag"
    205   exit 2
     123        if (-e "Build.PL") {
     124            vsystem ("$psperlbuild");
     125            if ($?) { &failure($cvsname[$i], "failure in perl Build.PL"); }
     126
     127            vsystem ("./Build");
     128            if ($?) { &failure($cvsname[$i], "failure in Build"); }
     129
     130            vsystem ("./Build install");
     131            if ($?) { &failure($cvsname[$i], "failure in Build install"); }
     132           
     133            next;
     134        }
     135
     136        if ($rebuild && $clean) {
     137            if (-e "configure") { unlink "Makefile"; }
     138            if (-e "configure.ac" && -e "autogen.sh") { unlink "configure"; }
     139        }
     140        $rebuild_this = $rebuild;
     141
     142        # set a local variable for this loop on rebuild;
     143        if (! -e "Makefile") { $rebuild_this = 1; }
     144
     145        #  run autogen
     146        $skip_configure = 0;
     147        if ($rebuild_this && ! -e "configure" && -e "autogen.sh") {
     148            $skip_configure = 1;
     149            vsystem ("$psautogen $psopts");
     150            if ($?) { &failure($cvsname[$i], "failure in psautogen"); }
     151        }
     152
     153        if ($rebuild_this && -e "configure" && !$skip_configure) {
     154            vsystem ("$psconfigure $psopts");
     155            if ($?) { &failure($cvsname[$i], "failure in psconfigure"); }
     156        }
     157
     158        if (! -e "Makefile") { &failure($cvsname[$i], "missing makefile"); }
     159
     160        if ($clean) {
     161            vsystem ("make clean");
     162            if ($?) { &failure($cvsname[$i], "failure in make clean"); }
     163        }
     164
     165        vsystem ("make");
     166        if ($?) { &failure($cvsname[$i], "failure in make"); }
     167
     168        vsystem ("make install");
     169        if ($?) { &failure($cvsname[$i], "failure in make install"); }
     170
     171        print "*** done with $cvsname[$i] ***\n";
     172
     173      success:
     174        chdir $homedir;
     175        if (($stop ne "") && ($stop eq $cvsname[$i])) { last; }
     176    }
     177    print "\033]0; ** psbuild: finished ** \007";
     178    exit 0;
     179}
     180
     181sub vsystem {
     182    print STDERR "@_\n";
     183    $status = system ("@_");
     184    $status;
     185}
     186
     187sub list_distributions {
     188    @list = <$tagsets/*.dst>;
     189    foreach $line (@list) {
     190        chomp $line;
     191        ($dist) = $line =~ m|$tagsets/(\S*).dst|;
     192        print STDERR "$dist\n";
     193    }
     194    exit 2;
     195}
     196
     197sub load_distfile {
     198    # open and read the distribution file
     199    # results go into @cvsname, @branchtag, @branchver, @mode
     200    $file = "$tagsets/$ARGV[0].dst";
     201    open (FILE, $file) || die "ERROR: can't open distribution file $file\n";
     202    @list = <FILE>;
     203    close (FILE);
     204
     205    @mode = ();
     206    @cvsname = ();
     207    @branchtag = ();
     208    @branchver = ();
     209
     210    foreach $line (@list) {
     211        chop $line;
     212        if ($line =~ m|^\s*$|) { next; }
     213        if ($line =~ m|^\s*\#|) { next; }
     214
     215        ($mode, $cvsname, $branchtag, $branchver) = split (" ", $line);
     216       
     217        if ($cvsname eq "") { die "missing module name\n"; }
     218
     219        ($do_tag, $do_build, $do_package, $do_update) = $mode =~ m|(\S)(\S)(\S)(\S)|;
     220        if (($do_tag ne "Y") && ($do_tag ne "N")) { die "invalid tag option $do_tag\n"; }
     221        if (($do_build ne "Y") && ($do_build ne "N")) { die "invalid tag option $do_build\n"; }
     222        if (($do_package ne "Y") && ($do_package ne "N")) { die "invalid tag option $do_package\n"; }
     223        if (($do_update ne "Y") && ($do_update ne "N")) { die "invalid tag option $do_update\n"; }
     224       
     225        if ($verbose) { print "tag: $do_tag, build: $do_build, package: $do_package, update: $do_update "; }
     226        if ($verbose) { print "module: $cvsname, branchtag: $branchtag, branchver: $branchver \n"; }
     227
     228        push @mode, $mode;
     229        push @cvsname, $cvsname;
     230        push @branchtag, $branchtag;
     231        push @branchver, $branchver;
     232    }
     233}
     234
     235sub failure {
     236    die "problem building $_[0] : $_[1]\n";
     237    print "\033]0; ** psbuild: failure  ** \007";
     238}
     239
     240sub usage {
     241    print STDERR "USAGE: psbuild [options] (distribution)\n";
     242    print STDERR "     : -version (version) : specify alternate psconfig installation version\n";
     243    print STDERR "     : -clean             : clean the source directories before building\n";
     244    print STDERR "     : -rebuild           : run 'autogen' (C code)\n";
     245    print STDERR "     : -optimize          : set flags for optimized code\n";
     246    print STDERR "     : -only (module)     : only build the specified module\n";
     247    print STDERR "     : -start (module)    : begin build at specified module\n";
     248    print STDERR "     : -stop (module)     : stop build after specified module\n\n";
     249    print STDERR "     : psbuild -list      : list the available distributions\n";
     250    print STDERR "     : psbuild -h         : this help listing\n";
     251    print STDERR "     : psbuild -help      : this help listing\n";
     252    print STDERR "     : psbuild --help     : this help listing\n";
     253    exit 2;
     254}
     255
     256sub ps_setenv {
     257
     258    my $var = $_[0];
     259    my $flag = $_[1];
     260
     261    my $answer = `csh psconfig.sh $flag $version`;
     262    chomp $answer;
     263
     264    $ENV{$var} = $answer;
     265}
     266
  • trunk/psconfig/tagsets/ipp-1.0.dst

    r12132 r12136  
    77# ||||  CVS module     CVS branch tag   CVS branch version   
    88# ||||
    9   NYNY  Ohana
    10   NNYN  ohana.base      base-1-5         -0
    11   NNYN  libohana        libohana-1-9     -0
    12   NNYN  libfits         libfits-1-7      -0
    13   NNYN  libautocode     libautocode-1-6  -0
    14   NNYN  libdvo          libdvo-1-4       -0
    15   NNYN  libkapa         libkapa-1-3      -0
    16   NNYN  addstar         addstar-1-8      -0
    17   NNYN  delstar         delstar-1-7      -0
    18   NNYN  getstar         getstar-1-3      -0
    19   NNYN  kapa            kapa-1-7         -0
    20   NNYN  kii             kii-1-7          -0
    21   NNYN  relphot         relphot-1-5      -0
    22   NNYN  uniphot         uniphot-1-5      -0
    23   NNYN  opihi.base      opihi-2-9        -0
    24   NNYN  mana            mana-1-7         -0
    25   NNYN  dvo             dvo-1-0          -0
    26   NNYN  pantasks        pantasks-1-0     -0
    27   NNYN  pcontrol        pcontrol-1-0     -0
    28   NNYN  pclient         pclient-1-0      -0
     9  NYNN  Ohana
     10  NNYY  ohana.base      base-1-5         -0
     11  NNYY  libohana        libohana-1-9     -0
     12  NNYY  libfits         libfits-1-7      -0
     13  NNYY  libautocode     libautocode-1-6  -0
     14  NNYY  libdvo          libdvo-1-4       -0
     15  NNYY  libkapa         libkapa-1-3      -0
     16  NNYY  addstar         addstar-1-8      -0
     17  NNYY  delstar         delstar-1-7      -0
     18  NNYY  getstar         getstar-1-3      -0
     19  NNYY  kapa            kapa-1-7         -0
     20  NNYY  kii             kii-1-7          -0
     21  NNYY  relphot         relphot-1-5      -0
     22  NNYY  uniphot         uniphot-1-5      -0
     23  NNYY  opihi.base      opihi-2-9        -0
     24  NNYY  mana            mana-1-7         -0
     25  NNYY  dvo             dvo-1-0          -0
     26  NNYY  pantasks        pantasks-1-0     -0
     27  NNYY  pcontrol        pcontrol-1-0     -0
     28  NNYY  pclient         pclient-1-0      -0
    2929  NYYY  psLib           rel-1-0          -0
    3030  NYYY  psModules       rel-1-0          -0
Note: See TracChangeset for help on using the changeset viewer.