IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 34087


Ignore:
Timestamp:
Jun 26, 2012, 11:39:02 AM (14 years ago)
Author:
eugene
Message:

add -no-as-needed and -debug-build options to psbuild; add -bootstrap current option; add more verbosity and debug options to pscheckmods; add -clean option to pscheckperl; set LDFLAGS with no-as-needed if we are using Ubuntu with gcc 4.6.3; update Module::Build to version 0.3601 (note: 0.40 requires updates to other modules); update Params:Validate to 0.96 to deal with change to "ref" command; update DBI and DBD:mysql to handle change of xcode namespace; use linker SEARCH_DIR and cpp include information to set hidden search paths

Location:
trunk/psconfig
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/psconfig/psbuild

    r31466 r34087  
    99$optimize = 0;
    1010$profile = 0;
     11$no_as_needed = 0;
     12$debug_build = 0;
    1113$developer = 0;
    1214$magic = 0;
     
    7274    if ($ARGV[0] eq "-profile") {
    7375        $profile = 1;
     76        shift; next;
     77    }
     78    if ($ARGV[0] eq "-no-as-needed") {
     79        $no_as_needed = 1;
     80        shift; next;
     81    }
     82    if ($ARGV[0] eq "-debug-build") {
     83        $debug_build = 1;
    7484        shift; next;
    7585    }
     
    262272    if ($optimize) { $psopts = "$psopts --enable-optimize"; }
    263273    if ($profile)  { $psopts = "$psopts --enable-profile --disable-shared --enable-static"; }
     274    if ($debug_build)  { $psopts = "$psopts --enable-debug-build"; }
     275    if ($no_as_needed)  { $psopts = "$psopts --enable-no-as-needed"; }
    264276    $psopts .= " --disable-version" if $offline;
    265277
     
    383395
    384396sub bootstrap {
    385 
    386     if (@ARGV != 2) { die "USAGE: psbuild -bootstrap (install_dir)\n"; }
     397    if (@ARGV != 2) { die "USAGE: psbuild -bootstrap (install_dir | current)\n"; }
    387398    $psconfdir = $ARGV[1];
     399
     400    if ($psconfdir eq "current") {
     401        $psconfdir = $ENV{'PSCONFDIR'};
     402        if (! $psconfdir) { die "no env variable PSCONFDIR found for psbuild -bootstrap current\n"; }
     403    }
    388404    die "Target directory must be absolute, not relative: $psconfdir\n" unless $psconfdir =~ m|^/|;
    389405
     
    479495    print STDERR "     : -optimize          : set flags for optimized code\n";
    480496    print STDERR "     : -profile           : set flags for profiling\n";
     497    print STDERR "     : -debug-build       : set flags for debug build (Wall, but not Werror; use to find and fix warnings from Wall)\n";
     498    print STDERR "     : -no-as-needed      : add --no-as-needed flag to gcc (to disable default --as-needed flags from Ubuntu, etc)\n";
    481499    print STDERR "     : -only (module)     : only build the specified module\n";
    482500    print STDERR "     : -start (module)    : begin build at specified module\n";
  • trunk/psconfig/pschecklibs

    r26273 r34087  
    142142unshift @incpath, $incdir;
    143143
     144# get a list of implicit paths from cpp directly
     145&checkpreprocessor ();
     146
     147# get a list of implicit paths from the linker directly
     148&checklinker ();
     149
    144150# add the system paths specified for each architecture
    145151&checkarch ();
    146152print "setting architecture to: $arch\n";
    147153print "searching for libraries in: @libpath\n";
     154print "searching for headers in: @incpath\n";
    148155print "searching for programs in: @binpath\n";
    149156print "\n";
     
    404411                $path = "$topdir/$subdir";
    405412            }
    406             # print "trying $path\n";
    407413            if (! -e $path) { next; }
    408414            $binname = "$path/$name";
     
    441447}
    442448
     449sub checklinker {
     450    # we are going to supplement the libpath with entries reported by
     451    # the linker (this depends on ld --verbose
     452
     453    my $line, @lines;
     454    my $item, @items;
     455
     456    @lines = `ld --verbose | grep SEARCH_DIR`;
     457    foreach $line (@lines) {
     458        # we expect items of the form SEARCH_DIR("path");
     459        # or SEARCH_DIR("=path") -- in that case we should prepend sysroo
     460        next unless ($line =~ m|SEARCH_DIR|);
     461        @items = split (";", $line);
     462        foreach $item (@items) {
     463            next unless ($item);
     464            ($p1) = $item =~ m|SEARCH_DIR\050"=(\S*)"|;
     465            ($p2) = $item =~ m|SEARCH_DIR\050"(\S*)"|;
     466            next if (!$p1 && !$p2);
     467            if (!$p1 && $p2) {
     468                push @libpath, $p2;
     469            }
     470            if ($p1 && $p2) {
     471                push @libpath, $p1;
     472            }
     473            if ($p1 && !$p2) {
     474                print "programming error!\n";
     475                exit 4;
     476            }
     477        }
     478    }
     479    return 0;
     480}
     481
     482sub checkpreprocessor {
     483    # we are going to supplement the libpath with entries reported by
     484    # the linker (this depends on ld --verbose
     485
     486### #include <...> search starts here:
     487###  /home/eugene/src/psconfig/ipp-dev.linux/include
     488###  .
     489###  /usr/lib/gcc/i686-linux-gnu/4.6/include
     490###  /usr/local/include
     491###  /usr/lib/gcc/i686-linux-gnu/4.6/include-fixed
     492###  /usr/include/i386-linux-gnu
     493###  /usr/include
     494### End of search list.
     495
     496    my $line, @lines;
     497    my $found_start;
     498
     499    @lines = `cpp --verbose < /dev/null 2>&1`;
     500    $found_start = 0;
     501    foreach $line (@lines) {
     502        if (!$found_start) {
     503            if ($line =~ m|include \<...\> search starts here|) {
     504                $found_start = 1;
     505                next;
     506            } else {
     507                next;
     508            }
     509        }
     510        chomp $line;
     511        if ($line =~ m|End of search list|) {
     512            return 1;
     513        }
     514        ($cleanline) = $line =~ m|\s*(\S*)|;
     515        push @incpath, $cleanline;
     516    }
     517    return 0;
     518}
     519
    443520sub checkarch {
    444521    # we are going to supplement the global libpath supplied
  • trunk/psconfig/pscheckmods

    r31162 r34087  
    11#!/usr/bin/env perl
    22
     3$DEBUG = 0;
    34$VERBOSE = 0;
    45if (@ARGV > 2 && $ARGV[0] eq "-v") {
     
    1011if ($VERBOSE) { print STDERR "checking in @INC\n"; }
    1112
    12 # &detailed_require ($ARGV[0]);
     13if ($DEBUG) { &detailed_require ($ARGV[0]);}
    1314
    1415$x = eval "require $ARGV[0]; 1";
     
    1819    &detailed_require ($ARGV[0]);
    1920}
    20 if ($VERBOSE) { print "x: $x\n"; }
     21if ($VERBOSE) { print "result of require: $x\n"; }
    2122
    2223$version = eval "\$$ARGV[0]::VERSION";
     
    3435    $filename =~ s|::|/|g;
    3536    $filename = "$filename.pm";
    36     print "$filename\n";
     37    print "\ntesting : $filename\n" if $DEBUG;
    3738    if (exists $INC{$filename}) {
    3839        return 1 if $INC{$filename};
    39         die "Compilation failed in require";
    4040    }
    4141    my ($realfilename,$result);
     
    4343      foreach $prefix (@INC) {
    4444          $realfilename = "$prefix/$filename";
    45           print "$realfilename\n";
     45          print "real: $realfilename\n" if $DEBUG;
    4646          if (-f $realfilename) {
    4747              $INC{$filename} = $realfilename;
     48              print "calling 'do' on $realfilename\n" if $DEBUG;
    4849              $result = do $realfilename;
     50              print "result: $result\n" if $DEBUG;
    4951              last ITER;
    5052          }
     
    5355    }
    5456    if ($@) {
     57        print "$@" if $DEBUG;
    5558        $INC{$filename} = undef;
    5659        die $@;
    5760    } elsif (!$result) {
     61        print "no result\n" if $DEBUG;
    5862        delete $INC{$filename};
    5963        die "$filename did not return true value";
    6064    } else {
     65        print "done with detailed_require\n" if $DEBUG;
    6166        return $result;
    6267    }
  • trunk/psconfig/pscheckperl

    r28191 r34087  
    55$version = "";
    66$build = 0;
     7$clean = 0;
    78my %force;   # Names of module to force build
    89@tARGV = ();
     
    1415    if ($ARGV[0] eq "-build") {
    1516        $build = 1;
     17        shift; next;
     18    }
     19    if ($ARGV[0] eq "-clean") {
     20        $clean = 1;
    1621        shift; next;
    1722    }
     
    3237if ( @ARGV > 1) { &usage(); }
    3338
     39if ($build && $clean) {die "-build and -clean are incompatible\n";}
     40
    3441if ( @ARGV == 0) {
    3542    @list = <$tagsets/*.perl>;
     
    95102    # if ($modver eq "") { $modver = 0; }
    96103
     104    if ($clean) {
     105        ($tardir) = $tarball =~ m|(\S*).tar.gz|;
     106        $tardir = "../extperl/$tardir";
     107        if (-d $tardir) {
     108            print "remove tardir: $tardir\n";
     109            vsystem ("rm -rf $tardir");
     110        }
     111        next;
     112    }
     113   
    97114    system ("pscheckmods $module $modver");
    98115    if (($? == 0) and not defined $force{$module} and not defined $force{'all'}) {
     
    127144    if ($prompts eq "NONE") { $prompts = ""; }
    128145
    129     if (-e "Build.PL" and $module ne "Params::Validate" and $module ne "DateTime::TimeZone") {
     146    if (-e "Build.PL" and $module ne "DateTime::TimeZone") {
    130147        # vsystem("perl Build.PL --install_path lib=$perldir ");
    131148        vsystem("perl Build.PL --install_base $prefix $buildopts");
  • trunk/psconfig/psconfig.csh.in

    r31162 r34087  
    125125if ($?PERL5LIB == 0) setenv PERL5LIB
    126126if ($?MANPATH == 0) setenv MANPATH
     127if ($?LDFLAGS == 0) setenv LDFLAGS
    127128
    128129# identify system architecture
     
    318319 case linux:
    319320 case linrh:
     321   gcc --version | grep 4.6.3 | grep Ubuntu >& /dev/null
     322   if ($status == 0) then
     323    set xtraflags = "-Wl,--no-as-needed"
     324    echo $LDFLAGS | grep -- $xtraflags >& /dev/null
     325    if ($status) then
     326      setenv LDFLAGS "$LDFLAGS $xtraflags"
     327    endif
     328   endif 
    320329   breaksw;
    321330
    322331 case lin64:
    323332 case linrh64:
     333   gcc --version | grep 4.6.3 | grep Ubuntu >& /dev/null
     334   if ($status == 0) then
     335    set xtraflags = "-Wl,--no-as-needed"
     336    echo $LDFLAGS | grep -- $xtraflags >& /dev/null
     337    if ($status) then
     338      setenv LDFLAGS "$LDFLAGS $xtraflags"
     339    endif
     340   endif 
    324341   set xtralibs = ( $xtralibs "/usr/lib64" "/usr/X11R6/lib64" "/lib64" )
    325342   breaksw;
  • trunk/psconfig/tagsets/ipp-3.0.perl

    r31162 r34087  
    66# a Version of 0 is required if no specific version is desired                                 options   responses
    77  00    Getopt::Long                   Getopt-Long-2.36.tar.gz                  2.3            NONE      n
    8   00    Module::Build                  Module-Build-0.2806.tar.gz               0.2806         NONE      NONE # special comment here
     8# 00    Module::Build                  Module-Build-0.40.tar.gz                 0.38           NONE      NONE # special comment here
     9  00    Module::Build                  Module-Build-0.3601.tar.gz               0.3601         NONE      NONE # special comment here
    910  01    ExtUtils::MakeMaker            ExtUtils-MakeMaker-6.54.tar.gz           0              NONE      NONE
    1011  02a   Attribute::Handlers            Attribute-Handlers-0.87.tar.gz           0.79           NONE      NONE
    11   02    Params::Validate               Params-Validate-0.92.tar.gz              0.92           NONE      NONE
     12# Params::Validate 0.92 breaks with Perl >= 5.14 (and probably earlier) because 'ref' added RegExp as a type
     13  02    Params::Validate               Params-Validate-0.96.tar.gz              0.96           NONE      NONE
    1214# 02    Apache::Test                   Apache-Test-1.29.tar.gz                  1.29           NONE      NONE
    1315  03a   Class::Singleton               Class-Singleton-1.4.tar.gz               0              NONE      NONE
     
    8183  70    Config::YAML                   Config-YAML-1.42.tar.gz                  0              NONE      NONE
    8284# 72    File::ExtAttr                  File-ExtAttr-1.07.tar.gz                 0              NONE      NONE
    83   73    DBI                            DBI-1.601.tar.gz                         0              NONE      NONE
    84   71    DBD::mysql                     DBD-mysql-4.006.tar.gz                   0              NONE      NONE
     85# version 1.622 updates sv_undef and related to new namespace (PL_*) (needed as of Perl 5.13.XX)
     86  73    DBI                            DBI-1.622.tar.gz                         1.622          NONE      NONE
     87# version 4.021 updates sv_undef and related to new namespace (PL_*) (needed as of Perl 5.13.XX)
     88  71    DBD::mysql                     DBD-mysql-4.021.tar.gz                   4.021          NONE      NONE
     89
    8590# 74    Net::Server::Daemonize         Net-Server-0.97.tar.gz                   0.05           NONE      NONE
    8691  75    File::Path                      File-Path-2.04.tar.gz                   0              NONE      NONE
Note: See TracChangeset for help on using the changeset viewer.