IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 11739


Ignore:
Timestamp:
Feb 9, 2007, 3:36:38 PM (19 years ago)
Author:
eugene
Message:

fixed up mkbuild, psconfig.sh

Location:
trunk/psconfig
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/psconfig/mkbuild

    r11737 r11739  
    7676    $psperlbuild = `csh psconfig.sh --psperlbuild $version`;
    7777
    78     # alias  psconfigure configure --prefix={$PSCONFDIR}/{$PSCONFIG} --bindir=$bindir --libdir=$libdir --includedir={$PSCONFDIR}/{$PSCONFIG}/include --sysconfdir={$PSCONFDIR}/{$PSCONFIG}/etc --datadir={$PSCONFDIR}/share --mandir={$PSCONFDIR}/man
    79     # alias  psautogen autogen.sh --bindir=$bindir --libdir=$libdir --mandir=$mandir --includedir={$PSCONFDIR}/{$PSCONFIG}/include --sysconfdir={$PSCONFDIR}/{$PSCONFIG}/etc --datadir={$PSCONFDIR}/share
    80     # alias  psperlbuild perl Build.PL --prefix {$PSCONFDIR}/{$PSCONFIG} --install_path script=$bindir --install_path arch=$bindir --install_path bin=$bindir --install_path lib=$libdir --install_path bindoc={$PSCONFDIR}/man/man1 --install_path libdoc={$PSCONFDIR}/man/man3
    81 
    8278    print "psconfigure: $psconfigure\n";
    8379    print "psautogen: $psautogen\n";
    8480    print "psperlbuild: $psperlbuild\n";
    85 
    86     exit 1;
    8781
    8882    $psopts = "";
     
    107101        # - perl Build.PL : ./Build : ./Build install
    108102 
    109         if (-e Build.PL) {
     103        if (-e "Build.PL") {
    110104            print $PERL5LIB;
    111105
    112             # psperlbuild;
    113             # perl Build.PL --install_path script=$bindir --install_path lib=$libdir --install_path bindoc={$PSCONFDIR}/man/man1 --install_path libdoc={$PSCONFDIR}/man/man3
    114             if ($?) { &failure(); }
    115 
    116             # ./Build
    117             if ($?) { &failure(); }
    118 
    119             # ./Build install
    120             if ($?) { &failure(); }
     106            vsystem ("$psperlbuild");
     107            if ($?) { &failure($cvsname[$i], "failure in perl Build.PL"); }
     108
     109            vsystem ("./Build");
     110            if ($?) { &failure($cvsname[$i], "failure in Build"); }
     111
     112            vsystem ("./Build install");
     113            if ($?) { &failure($cvsname[$i], "failure in Build install"); }
    121114           
    122115            next;
     
    124117
    125118        if ($rebuild && $clean) {
    126             if (-e configure) { unlink "Makefile"; }
    127             if (-e configure.ac && -e autogen.sh) { unlink "configure"; }
     119            if (-e "configure") { unlink "Makefile"; }
     120            if (-e "configure.ac" && -e "autogen.sh") { unlink "configure"; }
    128121        }
    129122        $rebuild_this = $rebuild;
    130123
    131124        # set a local variable for this loop on rebuild;
    132         if (! -e Makefile) { $rebuild_this = 1; }
     125        if (! -e "Makefile") { $rebuild_this = 1; }
    133126
    134127        #  run autogen
    135128        $skip_configure = 0;
    136         if ($rebuild_this && ! -e configure && -e autogen.sh) {
     129        if ($rebuild_this && ! -e "configure" && -e "autogen.sh") {
    137130            $skip_configure = 1;
    138             print "psautogen $psopts\n";
    139             vsystem ("psautogen $psopts");
    140             if ($?) { &failure(); }
    141         }
    142 
    143         if ($rebuild_this && -e configure && !$skip_configure) {
    144             print "psconfigure $psopts\n";
    145             vsystem ("psconfigure $psopts");
    146             if ($?) { &failure(); }
    147         }
    148 
    149         if (! -e Makefile) { &failure(); }
     131            vsystem ("$psautogen $psopts");
     132            if ($?) { &failure($cvsname[$i], "failure in psautogen"); }
     133        }
     134
     135        if ($rebuild_this && -e "configure" && !$skip_configure) {
     136            vsystem ("$psconfigure $psopts");
     137            if ($?) { &failure($cvsname[$i], "failure in psconfigure"); }
     138        }
     139
     140        if (! -e "Makefile") { &failure($cvsname[$i], "missing makefile"); }
    150141
    151142        if ($clean) {
    152             print "make clean\n";
    153143            vsystem ("make clean");
    154             if ($?) { &failure(); }
     144            if ($?) { &failure($cvsname[$i], "failure in make clean"); }
    155145        }
    156146
    157147        vsystem ("make");
    158         if ($?) { &failure(); }
     148        if ($?) { &failure($cvsname[$i], "failure in make"); }
    159149
    160150        vsystem ("make install");
    161         if ($?) { &failure(); }
     151        if ($?) { &failure($cvsname[$i], "failure in make install"); }
    162152
    163153      success:
     
    171161sub vsystem {
    172162    print STDERR "@_\n";
    173     #$status = system ("@_");
    174     #$status;
     163    $status = system ("@_");
     164    $status;
    175165}
    176166
    177167sub list_distributions {
    178 
    179 
    180168    vsystem ("ls $tagsets/*.dst");
    181169    exit 2;
     
    210198        if (($do_update ne "Y") && ($do_update ne "N")) { die "invalid tag option $do_update\n"; }
    211199       
    212         print "module: $cvsname, branchtag: $branchtag, branchver: $branchver ";
    213         print "tag: $do_tag, build: $do_build, package: $do_package, update: $do_update\n";
     200        print "tag: $do_tag, build: $do_build, package: $do_package, update: $do_update ";
     201        print "module: $cvsname, branchtag: $branchtag, branchver: $branchver \n";
    214202
    215203        push @mode, $mode;
     
    218206        push @branchver, $branchver;
    219207    }
     208}
     209
     210sub failure {
     211    die "problem building $_[0] : $_[1]\n";
    220212}
    221213
  • trunk/psconfig/psconfig.sh

    r11738 r11739  
    22# this file is sourced using the command 'psconfig'
    33
    4 # list the current settings
    5 if ($#argv == 0) then
    6   if (! $?PSCONFDIR) echo "PSCONFDIR is not set : run psconfig with an argument to setup"
    7   if (! $?PSVERSION) echo "PSVERSION is not set : run psconfig with an argument to setup"
    8   if (! $?ARCH)      echo "ARCH is not set : run psconfig with an argument to setup"
    9   echo $PSCONFDIR : $PSVERSION : $ARCH
    10   echo "psconfig --help for additional info"
    11   exit 2
    12 endif
    13 
    14 # show usage information
    15 if ("$argv[1]" == "--help") then
    16   echo "psconfig: set or show the current pslib configuration information"
    17   echo "USAGE: psconfig (version) : set configuration to specified version"
    18   echo "       psconfig --bin     : return the current path"
    19   echo "       psconfig --libs    : return the current library path"
    20   echo "       psconfig --list    : list currently availabe configuration versions"
    21   echo "       psconfig --help    : this listing"
    22   echo " use ~/.psconfigrc to set PSCONFDIR as desired"
    23   exit 0
    24 endif
    25 
    26 # list the defined psconfig versions
    27 if ("$argv[1]" == "--list") then
    28   /bin/ls $PSCONFDIR | grep -v "\<man\>" | grep -v "\<share\>" | awk -v dir=$PSCONFDIR -F. '{printf "%s : %-10s : %s\n", dir, $1, $2}'
    29   exit 0
    30 endif
    31 
    32 # list the defined psconfig versions
    33 if ("$argv[1]" == "--prefix") then
    34   echo $PSCONFDIR/$PSVERSION.$ARCH
    35   exit 0
    36 endif
    37 
    38 # list the defined psconfig versions
    39 if ("$argv[1]" == "--libs") then
    40   echo $PSCONFDIR/$PSVERSION.$ARCH/lib
    41   exit 0
    42 endif
    43 
    44 # list the defined psconfig versions
    45 if ("$argv[1]" == "--bin") then
    46   echo $PSCONFDIR/$PSVERSION.$ARCH/bin
    47   exit 0
    48 endif
    49 
    504# list the defined psconfig versions
    515set show_configure = 0
    52 if ("$argv[1]" == "--psconfigure") then
    53   set show_configure = 1
    54   shift
    55 endif
    56 
    57 # list the defined psconfig versions
    586set show_autogen = 0
    59 if ("$argv[1]" == "--psautogen") then
    60   set show_autogen = 1
    61   shift
    62 endif
    63 
    64 # list the defined psconfig versions
    65 set show_psperlbuild = 0
    66 if ("$argv[1]" == "--psperlbuild") then
    67   set show_psperlbuild = 1
    68   shift
    69 endif
     7set show_perlbuild = 0
     8set args = ""
     9while ($#argv)
     10  switch ($argv[1])
     11    case --help:
     12      goto help;
     13
     14    case --list:
     15      /bin/ls $PSCONFDIR | grep -v "\<man\>" | grep -v "\<share\>" | awk -v dir=$PSCONFDIR -F. '{printf "%s : %-10s : %s\n", dir, $1, $2}'
     16      exit 0
     17      breaksw
     18
     19    case --prefix:
     20      echo $PSCONFDIR/$PSVERSION.$ARCH
     21      exit 0
     22      breaksw
     23
     24    case --libs:
     25      echo $PSCONFDIR/$PSVERSION.$ARCH/lib
     26      exit 0
     27      breaksw
     28
     29    case --bin
     30      echo $PSCONFDIR/$PSVERSION.$ARCH/bin
     31      exit 0
     32      breaksw
     33
     34    case --psconfigure:
     35      set show_configure = 1
     36      shift
     37      breaksw;   
     38    case --psautogen:
     39      set show_autogen = 1
     40      shift
     41      breaksw;
     42    case --psperlbuild:
     43      set show_perlbuild = 1
     44      shift
     45      breaksw;
     46    case -*:
     47      echo "unknown option $1"
     48      goto help;
     49    default:
     50      set args=($args $1);
     51      shift
     52      breaksw;
     53  endsw
     54end
     55if ($#args != 1) goto usage
     56if ("$args" == "") goto usage
    7057
    7158# make this configurable by the user
     
    7764endif
    7865
    79 setenv PSVERSION $argv[1]
     66setenv PSVERSION $args[1]
    8067
    8168if ($?LD_LIBRARY_PATH == 0) setenv LD_LIBRARY_PATH
     
    290277  exit 0
    291278endif
     279
     280exit 0
     281
     282usage:
     283  if (! $?PSCONFDIR) echo "PSCONFDIR is not set : run psconfig with an argument to setup"
     284  if (! $?PSVERSION) echo "PSVERSION is not set : run psconfig with an argument to setup"
     285  if (! $?ARCH)      echo "ARCH is not set : run psconfig with an argument to setup"
     286  echo $PSCONFDIR : $PSVERSION : $ARCH
     287  echo "psconfig --help for additional info"
     288  exit 2
     289
     290help:
     291  echo "psconfig: set or show the current pslib configuration information"
     292  echo "USAGE: psconfig (version) : set configuration to specified version"
     293  echo "       psconfig --bin     : return the current path"
     294  echo "       psconfig --libs    : return the current library path"
     295  echo "       psconfig --list    : list currently availabe configuration versions"
     296  echo "       psconfig --help    : this listing"
     297  echo " use ~/.psconfigrc to set PSCONFDIR as desired"
     298  exit 1
Note: See TracChangeset for help on using the changeset viewer.