IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 15009


Ignore:
Timestamp:
Sep 25, 2007, 4:19:35 AM (19 years ago)
Author:
eugene
Message:

moving pschecklibs.pl to pschecklibs; updating tagsets to 2.3

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

Legend:

Unmodified
Added
Removed
  • trunk/psconfig/pschecklibs

    r14424 r15009  
    1 #!/bin/csh -f
    2 
    3 # XXX : add needed subdirs (eg, DIR/mysql, DIR/jpeg...)
    4 # XXX : add -build option
    5 # XXX : additional override options for certain packages
    6 # XXX : add pkg-config
    7 
    8 # this scripts searches for the needed libraries in standard locations and in the
    9 # current psconfig installation tree
    10 
    11 set version = ""
    12 set args = ""
    13 while ("$1" != "")
    14  switch ("$1")
    15   case -version:
    16    shift
    17    set version = $1
    18    breaksw
    19   case --help:
    20    goto usage
    21   case -*:
    22    echo ""
    23    echo "Unknown option: $1"
    24    goto usage
    25   default:
    26    set args=($args $1);
    27    breaksw;
    28  endsw
    29  shift
    30 end
    31 if ($#args != 1) goto usage
    32 
    33 # set supplied PSVERSION
    34 if ("$version" != "") then
    35   setenv PSVERSION $version
    36 endif
    37 
    38 # set install paths for PSVERSION
    39 set libdir  = `source psconfig.csh --libs $PSVERSION`
    40 set incdir  = `source psconfig.csh --include $PSVERSION`
    41 
    42 # make these directories
    43 mkdir -p $libdir
    44 mkdir -p $incdir
    45 
    46 # I supplement this list with LIBRARY_PATH below
    47 set syslibpath = "/lib /usr/lib /usr/X11R6/lib /usr/local/lib "
    48 set needlibs   = ""
    49 set needlibs   = "$needlibs png"
    50 set needlibs   = "$needlibs z"
    51 set needlibs   = "$needlibs jpeg"
    52 set needlibs   = "$needlibs readline"
    53 set needlibs   = "$needlibs X11"
    54 set needlibs   = "$needlibs pthread"
    55 set needlibs   = "$needlibs cfitsio"
    56 set needlibs   = "$needlibs mysqlclient"
    57 set needlibs   = "$needlibs gsl"
    58 set needlibs   = "$needlibs xml2"
    59 set needlibs   = "$needlibs fftw3"
    60 set needlibs   = "$needlibs fftw3f"
    61 set needlibs   = "$needlibs m"
    62 
    63 # I supplement this list with CPATH below
    64 set sysincpath = "/usr/include /usr/local/include /usr/X11R6/include "
    65 set needincs = ""
    66 set needincs = "$needincs X11/Xatom.h"
    67 set needincs = "$needincs X11/Xlib.h"
    68 set needincs = "$needincs X11/Xresource.h"
    69 set needincs = "$needincs X11/Xutil.h"
    70 set needincs = "$needincs X11/cursorfont.h"
    71 set needincs = "$needincs X11/keysym.h"
    72 set needincs = "$needincs X11/keysymdef.h"
    73 set needincs = "$needincs arpa/inet.h"
    74 set needincs = "$needincs assert.h"
    75 set needincs = "$needincs complex.h"
    76 set needincs = "$needincs ctype.h"
    77 set needincs = "$needincs errno.h"
    78 set needincs = "$needincs fcntl.h"
    79 set needincs = "$needincs fitsio.h"
    80 set needincs = "$needincs glob.h"
    81 set needincs = "$needincs gsl/gsl_randist.h"
    82 set needincs = "$needincs gsl/gsl_rng.h"
    83 set needincs = "$needincs inttypes.h"
    84 set needincs = "$needincs jpeglib.h"
    85 set needincs = "$needincs limits.h"
    86 set needincs = "$needincs malloc.h"
    87 set needincs = "$needincs math.h"
    88 set needincs = "$needincs memory.h"
    89 set needincs = "$needincs netdb.h"
    90 set needincs = "$needincs netinet/ip.h"
    91 set needincs = "$needincs png.h"
    92 set needincs = "$needincs pthread.h"
    93 set needincs = "$needincs readline/history.h"
    94 set needincs = "$needincs readline/readline.h"
    95 set needincs = "$needincs regex.h"
    96 set needincs = "$needincs signal.h"
    97 set needincs = "$needincs stdint.h"
    98 set needincs = "$needincs stdio.h"
    99 set needincs = "$needincs stdlib.h"
    100 set needincs = "$needincs string.h"
    101 set needincs = "$needincs sys/ipc.h"
    102 set needincs = "$needincs sys/resource.h"
    103 set needincs = "$needincs sys/sem.h"
    104 set needincs = "$needincs sys/socket.h"
    105 set needincs = "$needincs sys/stat.h"
    106 set needincs = "$needincs sys/time.h"
    107 set needincs = "$needincs sys/types.h"
    108 set needincs = "$needincs sys/uio.h"
    109 set needincs = "$needincs sys/un.h"
    110 set needincs = "$needincs sys/wait.h"
    111 set needincs = "$needincs time.h"
    112 set needincs = "$needincs unistd.h"
    113 set needincs = "$needincs zlib.h"
    114 
    115 # XXX need to have options for non-ANSI includes? (ie, varargs.h)
    116 # set needincs = "$needincs values.h" - this only provides values already defined in limits.h?
    117 # set needincs = "$needincs libxml/parser.h"
    118 # set needincs = "$needincs cfuncs.h" - from non-ANSI option in ohana.h
    119 # set needincs = "$needincs float.h" - is from missing_proto (CFHT)
    120 # set needincs = "$needincs floatingpoint.h" - is from missing_proto (CFHT)
    121 # set needincs = "$needincs stdarg.h" - from std includes (in gcc path)
    122 # set needincs = "$needincs varargs.h" - from std includes (in gcc path)
    123 # set needincs = "$needincs stdbool.h" - from std includes (in gcc path) ?
    124 
    125 # check the hardware architecture:
    126 set sys=`uname -s`
    127 set ranlib = "ranlib"
    128 set dlltype = "so"
    129 switch ($sys)
    130  case IRIX64:
    131    set arch="irix";
    132    breaksw;
    133  case SunOS:
    134    set ver=`uname -r | awk '{print substr($1,1,1)}'`;
    135    if ($ver == 5) then
    136      set arch="sol";
    137    else
    138      set arch="sun4";
    139    endif
    140    # sun (at least) seems to need the socket library (linux does not)
    141    set syslibpath = "$syslibpath /usr/openwin/lib"
    142    set sysincpath = "$sysincpath /usr/openwin/include"
    143    set needlibs = "$needlibs libsocket libnsl"
    144    set ranlib = "touch"
    145    breaksw;
    146  case Linux:
    147    set arch="linux";
    148    if (-e /etc/sidious.config) set arch="sid";
    149    set mach=`uname -m`
    150    if ("$mach" == "x86_64") then
    151     set arch="lin64";
    152     set syslibpath = "/lib64 /usr/lib64 /usr/X11R6/lib64 $syslibpath"
    153    endif
    154    breaksw;
    155  case Darwin:
    156    set arch="darwin";
    157    set mach=`uname -m`
    158    if ("$mach" == "i386") then
    159     set arch="darwin_x86";
    160    endif
    161    set syslibpath = "$syslibpath /sw/lib /usr/local/lib/mysql"
    162    set sysincpath = "$sysincpath /sw/include /usr/include/sys"
    163    set dlltype = dylib
    164    breaksw;
    165  case HP-UX:
    166     set arch="hpux";
    167     breaksw;
    168  default:
    169    echo "unknown architecture";
    170    exit 1;
    171    breaksw;
    172 endsw
    173 echo "setting architecture to: $arch"
    174 
    175 # add the LIBRARY_PATH
    176 if ($?LIBRARY_PATH) then
    177   set libpath = `echo $LIBRARY_PATH | tr ':' ' '`
    178 else
    179   set libpath = ""
    180 endif
    181 
    182 # check for basic libraries
    183 echo ""
    184 echo "searching for needed external libraries..."
    185 set faillibs = ""
    186 set libflags = ""
    187 set libdirs  = ""
    188 set nonomatch
    189 foreach f ( $needlibs )
    190     foreach g ( $libdir $libpath $syslibpath )
    191         if (! -e $g) continue
    192         set name = $g/lib$f.a
    193         if (-e $name[1]) goto got_lib;
    194         set name = $g/lib$f.$dlltype
    195         if (-e $name[1]) goto got_lib;
    196     end
    197     # if we find a .so.N without a matching .so, we link this in
    198     # the installed libdir
    199     foreach g ( $libpath $syslibpath )
    200         set name = $g/lib$f.$dlltype*
    201         #echo "libname: $name"
    202         if (-e $name[1]) then
    203           echo "making link to numbered .$dlltype library $libdir/lib$f.$dlltype"
    204           ln -s $name[$#name] $libdir/lib$f.$dlltype
    205           if ($status) exit 1
    206           goto got_lib
    207         endif
    208     end
    209     echo "missing lib$f"
    210     set faillibs = "$faillibs lib$f"
    211     continue
    212 got_lib:
    213     echo "found lib$f ($name[$#name])"
    214 end
    215 
    216 # we need a curses library; can choose one of the following:
    217 # check for termcap, curses, etc
    218 foreach f ( ncurses curses termcap )
    219     foreach g ( $libdir $libpath $syslibpath )
    220         set name = $g/lib$f.a
    221         if (-e $name[1]) goto got_curses;
    222         set name = $g/lib$f.$dlltype
    223         if (-e $name[1]) goto got_curses;
    224     end
    225     # if we find a .so.N without a matching .so, we link this in
    226     # the installed libdir
    227     foreach g ( $libpath $syslibpath )
    228         set name = $g/lib$f.$dlltype*
    229         if ($#name > 0) then
    230           echo "making link to numbers .$dlltype library $libdir/lib$f.$dlltype"
    231           ln -s $name[$#name] $libdir/lib$f.$dlltype
    232           goto got_curses;
    233         endif
    234     end
    235 end
    236 set faillibs = "$faillibs (ncurses | curses | termcap)"
    237 echo "missing a valid curses library"
    238 echo "missing: $faillibs"
    239 echo "please find one of them and install them in $libdir"
    240 exit 1
    241 
    242 got_curses:
    243   echo "found $f ($name[$#name])"
    244 
    245 if ("$faillibs" != "") then
    246   echo "your installation is missing some important libraries"
    247   echo "missing: $faillibs"
    248   echo "please find them and install them in $libdir"
    249   exit 1
    250 endif   
    251 
    252 # add the CPATH
    253 if ($?CPATH) then
    254   set incpath = `echo $CPATH | tr ':' ' '`
    255 else
    256   set incpath = ""
    257 endif
    258 
    259 # check for headers
    260 echo ""
    261 echo "searching for needed external header files..."
    262 set failincs = ""
    263 set incdirs = ""
    264 foreach f ( $needincs )
    265   foreach g ( $incdir $incpath $sysincpath )
    266     set name = "$g/$f"
    267     if (-e $name) goto got_inc;
    268   end
    269   echo "missing $f"
    270   set failincs = "$failincs $f"
    271   continue
    272 got_inc:
    273   echo "found $f ($name)"
    274 end
    275 
    276 if ("$failincs" != "") then
    277   echo "your installation is missing some important library headers"
    278   echo "please find them and install them in $incdir"
    279   exit 1
    280 endif   
    281 
    282 exit 0
    283 
    284 usage:
    285 cat <<EOF
    286 USAGE: pschecklibs
    287 
    288 searches for needed libraries and include files in system and psconfig installation directories
    289 
    290 Additional options
    291   -h, --help              display this help and exit
    292 
    293 EOF
    294  exit 2;
     1#!/usr/bin/env perl
     2
     3$tagsets = "tagsets";
     4
     5# default system library locations
     6@binpath = ( );
     7@libpath = ( "/lib", "/usr/lib", "/usr/X11R6/lib", "/usr/local/lib" );
     8@incpath = ( "/usr/include", "/usr/local/include", "/usr/X11R6/include" );
     9
     10$version = "";
     11$build = 0;
     12$force = "";
     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 "-build") {
     20        $build = 1;
     21        shift; next;
     22    }
     23    if ($ARGV[0] eq "-force") {
     24        if (@ARGV < 2) { die "-force must be coupled to a library name\n"; }
     25        $force = $ARGV[1];
     26        shift; shift; next;
     27    }
     28    if ($ARGV[0] eq "-h")     { &usage (); }
     29    if ($ARGV[0] eq "help")   { &usage (); }
     30    if ($ARGV[0] eq "-help")  { &usage (); }
     31    if ($ARGV[0] eq "--help") { &usage (); }
     32    if ($ARGV[0] eq "-list")  { &list_distributions(); }
     33    @tARGV = (@tARGV, $ARGV[0]);
     34    shift;
     35}
     36@ARGV = @tARGV;
     37if ( @ARGV > 1) { &usage(); }
     38
     39if ( @ARGV == 0) {
     40    @list = <$tagsets/*.libs>;
     41    $file = $list[-1];
     42} else {
     43    $file = "$tagsets/$ARGV[0].libs";
     44}
     45print "examining C libraries based on $file\n\n";
     46
     47# load the C libraries list
     48open (FILE, $file) || die "ERROR: can't open C libraries list: $file\n";
     49@list = <FILE>;
     50close (FILE);
     51
     52# set the psconfig version:
     53if ("$version" eq "") {
     54    $version = $ENV{'PSVERSION'};
     55}
     56if ("$version" eq "") {
     57    $version = "default";
     58}
     59
     60# set the lib and include paths set by psconfig
     61$bindir      = `csh psconfig.csh --bin $version`;         chomp $bindir;
     62$libdir      = `csh psconfig.csh --libs $version`;        chomp $libdir;
     63$mandir      = `csh psconfig.csh --man $version`;         chomp $mandir;
     64$incdir      = `csh psconfig.csh --include $version`;     chomp $incdir;
     65$psconfigure = `csh psconfig.csh --psconfigure $version`; chomp $psconfigure;
     66$prefix      = `csh psconfig.csh --prefix $version`;      chomp $prefix;
     67$homedir     = `pwd`; chomp $homedir;
     68
     69print "psconfig version: $version\n";
     70print "bindir: $bindir\n";
     71print "libdir: $libdir\n";
     72print "incdir: $incdir\n";
     73print "mandir: $mandir\n";
     74print "\n";
     75
     76# create the directories above if not found:
     77if (! -e $libdir) { vsystem ("mkdir -p $libdir"); }
     78if (! -e $incdir) { vsystem ("mkdir -p $incdir"); }
     79if (! -e $bindir) { vsystem ("mkdir -p $bindir"); }
     80if (! -e $mandir) { vsystem ("mkdir -p $mandir"); }
     81if (! -e "$mandir/man1") { vsystem ("mkdir -p $mandir/man1"); }
     82if (! -e "$mandir/man3") { vsystem ("mkdir -p $mandir/man3"); }
     83
     84# add the path defined by LIBRARY_PATH
     85@tmppath = split (":", $ENV{'LIBRARY_PATH'});
     86if (@tmppath) {
     87    unshift @libpath, @tmppath;
     88}
     89# search for, and drop, existing libdir entry in libpath?
     90unshift @libpath, $libdir;
     91
     92# add the path defined by PATH
     93@tmppath = split (":", $ENV{'PATH'});
     94if (@tmppath) {
     95    unshift @binpath, @tmppath;
     96}
     97# search for, and drop, existing libdir entry in libpath?
     98unshift @binpath, $bindir;
     99
     100# add the path defined by PATH
     101@tmppath = split (":", $ENV{'CPATH'});
     102if (@tmppath) {
     103    unshift @incpath, @tmppath;
     104}
     105# search for, and drop, existing libdir entry in libpath?
     106unshift @incpath, $incdir;
     107
     108# add the system paths specified for each architecture
     109&checkarch ();
     110print "setting architecture to: $arch\n";
     111print "searching for libraries in: @libpath\n";
     112print "searching for programs in: @binpath\n";
     113print "\n";
     114
     115# read the lib distribution file, search / build each entry
     116@faillibs = ();
     117@failincs = ();
     118foreach $line (@list) {
     119    chop $line;
     120    if ($line =~ m|^\s*$|) { next; }
     121    if ($line =~ m|^\s*\#|) { next; }
     122
     123    ($type, $name, $altnames, $altpaths, $tarball, $tardir, $use_equals, $configure_opts, $make_opts, $install_opts) = split (" ", $line);
     124    if (($use_equals ne "Y") && ($use_equals ne "N")) { die "invalid value for use_equals field\n"; }
     125
     126    if ($force ne "") {
     127        if ($force eq $name) {
     128            &buildlib ($name, $tarball, $tardir, $use_equals, $configure_opts, $make_opts, $install_opts);
     129            exit 0;
     130        }
     131        next;
     132    }
     133
     134    ## check for the C library
     135    if ($type eq "lib") {
     136        $found = &checklib ($name, $altnames, $altpaths);
     137    }
     138    if ($type eq "bin") {
     139        $found = &checkbin ($name, $altnames, $altpaths);
     140    }   
     141    if ($type eq "inc") {
     142        $found = &checkinc ($name, $altnames, $altpaths);
     143    }   
     144
     145    if ($found) {
     146        print "pass $name ($found)\n";
     147        next;
     148    } else {
     149        print "fail $name\n";
     150        push @faillibs, "$name";
     151    }   
     152
     153    if (! $build) { next; }
     154    if ($type eq "inc") {
     155        print "ERROR: missing header file from library which is supposedly installed\n";
     156        next;
     157    }
     158    &buildlib ($name, $tarball, $tardir, $use_equals, $configure_opts, $make_opts, $install_opts);
     159}
     160if ($build) { exit 0; }
     161print "\n";
     162
     163if (@faillibs > 0) {
     164    print "The following C libraries are missing from your system\n";
     165    foreach $name (@faillibs) {
     166        print "  $name\n";
     167    }
     168    print "\n";
     169    print "you may install them in your local path by re-running pschecklibs with -build\n";
     170} else {
     171    print "no C libraries are missing from your system\n";
     172}
     173exit 0;
     174
     175sub buildlib {
     176    my ($name, $tarball, $tardir, $use_equals, $configure_opts, $make_opts, $install_opts) = @_;
     177
     178    if ($tarball eq "NONE") {
     179        print "ERROR: require tarball for $name\n";
     180        exit 1;
     181    }
     182
     183    ## try to build the module from ../../extlibs/$tarball
     184
     185    # go to extlibs and unpack the tarball
     186    chdir "../../extlibs";
     187
     188    print "extract $name from $tarball\n";
     189    vsystem ("tar xvzf $tarball");
     190   
     191    print "tardir: $tardir\n";
     192
     193    # enter the directory and build
     194    chdir $tardir;
     195
     196    # build the library using psconfigure, make, make install
     197    if ($configure_opts eq "NONE") {
     198        if ($use_equals eq "Y") {
     199            vsystem ("configure --prefix=$prefix");
     200        } else {
     201            vsystem ("configure --prefix $prefix");
     202        }
     203    } else {
     204        $configure_opts = join (' ', split (',', $configure_opts));
     205        vsystem ("configure --prefix=$prefix $configure_opts");
     206    }
     207    if ($?) { &failure($name, "failure in configure"); }
     208   
     209    if ($make_opts eq "NONE") {
     210        vsystem ("make");
     211    } else {
     212        $make_opts = join (' ', split (',', $make_opts));
     213        vsystem ("make $make_opts");
     214    }
     215    if ($?) { &failure($name, "failure in make"); }
     216
     217    if ($install_opts eq "NONE") {
     218        vsystem ("make install");
     219    } else {
     220        $install_opts = join (' ', split (',', $install_opts));
     221        vsystem ("make install $install_opts");
     222    }
     223    if ($?) { &failure($name, "failure in make install"); }
     224
     225    chdir $homedir;
     226    return 1;
     227}
     228
     229sub checklib {
     230    my $name = $_[0];
     231    my $altnames = $_[1];
     232    my $altpaths = $_[2];
     233   
     234    @subdirs = ".";
     235    if ($altpaths ne "NONE") {
     236        @altpaths = split (',', $altpaths);
     237        push @subdirs, @altpaths;
     238    }
     239   
     240    @trynames = ($name);
     241    if ($altnames ne "NONE") {
     242        @altnames = split (',', $altnames);
     243        push @trynames, @altnames;
     244    }
     245
     246    # try each of the possible library names
     247    foreach $tryname (@trynames) {
     248        # try each of the library paths, with the default as well as each altpath
     249        foreach $topdir ( @libpath ) {
     250            foreach $subdir ( @subdirs ) {
     251                if ($subdir eq ".") {
     252                    $path = $topdir;
     253                } else {
     254                    $path = "$topdir/$subdir";
     255                }
     256                # print "trying $path\n";
     257                if (! -e $path) { next; }
     258                $libname = "$path/$tryname.a";
     259                if (-e $libname) { return $libname; }
     260                # print "no $libname\n";
     261                $libname = "$path/$tryname.$dlltype";
     262                if (-e $libname) { return $libname; }
     263                # print "no $libname\n";
     264            }
     265        }
     266
     267        # if we failed to find the basic named library files, try the
     268        # versions libraries if we find only a .so.N without a matching
     269        # .so, we link this in the installed libdir
     270        foreach $topdir ( @libpath ) {
     271            foreach $subdir ( @subdirs ) {
     272                if ($subdir eq ".") {
     273                    $path = $topdir;
     274                } else {
     275                    $path = "$topdir/$subdir";
     276                }
     277                if (! -e $path) { next; }
     278                @libnames = <$path/$tryname.$dlltype*>;
     279                if (@libnames > 0) {
     280                    $libname = @libnames[-1];
     281                    # print "making link to numbered .$dlltype library $libdir/$f.$dlltype\n";
     282                    symlink $libname, "$libdir/$f.$dlltype";
     283                    if ($?) { exit 1; }
     284                    return $libname;
     285                }
     286                # print "no $path/$tryname.$dlltype*\n";
     287            }
     288        }
     289    }
     290    return 0;
     291}
     292
     293sub checkbin {
     294    my $name = $_[0];
     295    my $altnames = $_[1];
     296    my $altpaths = $_[2];
     297   
     298    # XXX drop this for bin?
     299    @subdirs = ".";
     300    if ($altpaths ne "NONE") {
     301        @altpaths = split (',', $altpaths);
     302        push @subdirs, @altpaths;
     303    }
     304   
     305    # try each of the library paths, with the default as well as each altpath
     306    foreach $topdir ( @binpath ) {
     307        foreach $subdir ( @subdirs ) {
     308            if ($subdir eq ".") {
     309                $path = $topdir;
     310            } else {
     311                $path = "$topdir/$subdir";
     312            }
     313            # print "trying $path\n";
     314            if (! -e $path) { next; }
     315            $binname = "$path/$name";
     316            if (-e $binname) { return $binname; }
     317        }
     318    }
     319    return 0;
     320}
     321
     322sub checkinc {
     323    my $name = $_[0];
     324    my $altnames = $_[1];
     325    my $altpaths = $_[2];
     326   
     327    @subdirs = ".";
     328    if ($altpaths ne "NONE") {
     329        @altpaths = split (',', $altpaths);
     330        push @subdirs, @altpaths;
     331    }
     332   
     333    # try each of the library paths, with the default as well as each altpath
     334    foreach $topdir ( @incpath ) {
     335        foreach $subdir ( @subdirs ) {
     336            if ($subdir eq ".") {
     337                $path = $topdir;
     338            } else {
     339                $path = "$topdir/$subdir";
     340            }
     341            if (! -e $path) { next; }
     342            $incname = "$path/$name";
     343            if (-e $incname) { return $incname; }
     344        }
     345    }
     346
     347    return 0;
     348}
     349
     350sub checkarch {
     351    # we are going to supplement the global libpath supplied
     352   
     353    # check the hardware architecture:
     354    $sys=`uname -s`; chomp $sys;
     355
     356    # default values
     357    $ranlib = "ranlib";
     358    $dlltype = "so";
     359
     360    if ($sys eq "IRIX64") {
     361        $arch = "irix";
     362        return;
     363    }
     364
     365    if ($sys eq "SunOS") {
     366        $ver=`uname -r | awk '{print substr($1,1,1)}'`;
     367        if ($ver == 5) {
     368            $arch = "sol";
     369        } else {
     370            $arch="sun4";
     371        }
     372
     373        # sun (at least) seems to need the socket library (linux does not)
     374        push @libpath, "/usr/openwin/lib";
     375        push @incpath, "/usr/openwin/include";
     376
     377        # XXX this is a problem
     378        print STDERR "need to add system dependent libraries (eg, libsocket, libnsl)\n";
     379        exit 1;
     380        $needlibs = "$needlibs libsocket libnsl";
     381        $ranlib = "touch";
     382        return;
     383    }
     384
     385    if ($sys eq "Linux") {
     386        $arch = "linux";
     387
     388        if (-e "/etc/sidious.config") {
     389            $arch = "sid";
     390            return;
     391        }
     392
     393        $mach = `uname -m`; chomp $mach;
     394
     395        if ($mach eq "x86_64") {
     396            $arch = "lin64";
     397            unshift @libpath, "/lib64";
     398            unshift @libpath, "/usr/lib64";
     399            unshift @libpath, "/usr/X11R6/lib64";
     400            return;
     401        }
     402        return;
     403    }
     404
     405    if ($sys eq "Darwin") {
     406        $arch = "darwin";
     407        $mach = `uname -m`; chomp $mach;
     408        if ($mach == "i386") {
     409            $arch="darwin_x86";
     410        } else {
     411            unshift @libpath, "/sw/lib";
     412            unshift @incpath, "/sw/include";
     413            unshift @incpath, "/usr/include/sys";
     414            $dlltype = "dylib";
     415        }
     416        return;
     417    }
     418
     419    if ($sys eq "HP-UX") {
     420        $arch = "hpux";
     421        return;
     422    }
     423   
     424    print "unknown architecture";
     425    exit 1;
     426}
     427
     428sub usage {
     429    print STDERR "USAGE: pscheckperl [-version] [-build]\n";
     430    exit 2;
     431}
     432
     433sub vsystem {
     434    print STDERR "@_\n";
     435    $status = system ("@_");
     436    $status;
     437}
     438
     439sub list_distributions {
     440    @list = <$tagsets/*.perl>;
     441    foreach $line (@list) {
     442        chomp $line;
     443        ($dist) = $line =~ m|$tagsets/(\S*).perl|;
     444        print STDERR "$dist\n";
     445    }
     446    exit 2;
     447}
     448
     449sub failure {
     450    system ("ls");
     451    die "problem building $_[0] : $_[1]\n";
     452    print "\033]0; ** pschecklibs: failure  ** \007";
     453}
     454
Note: See TracChangeset for help on using the changeset viewer.