Ticket #476: rpath_lib-2.patch

File rpath_lib-2.patch, 4.1 KB (added by doughera, 6 years ago)

A patch to allow specifying rpath_lib on the Configure.pl command line

  • config/init/defaults.pm

    diff -r -u parrot-current/config/init/defaults.pm parrot-andy/config/init/defaults.pm
    old new  
    129129        # -shared for GNU ld. 
    130130        ld_load_flags => $Config{lddlflags}, 
    131131 
     132        # Set -rpath (or equivalent) to append to $linkflags (and 
     133        # $ldflags) for executables to find the shared libparrot in 
     134        # the build directory. 
     135        # This is often something like -R $builddir/blib/lib 
     136        # (This is initialized to undef so that later parts of 
     137        # Configure.pl can distinguish between the variable being 
     138        # unset and being set (on the command line) to the empty 
     139        # string.) 
     140        rpath_blib => undef, 
     141 
     142        # Set -rpath (or equivalent) for the installed executables to 
     143        # find the installed shared libparrot.   
     144        # This is often something like -R /usr/local/lib 
     145        rpath_lib => undef, 
     146 
    132147        libs => $Config{libs}, 
    133148 
    134149        cc_inc     => "-I./include", 
  • config/inter/libparrot.pm

    diff -r -u parrot-current/config/inter/libparrot.pm parrot-andy/config/inter/libparrot.pm
    old new  
    9797 
    9898    # Set -rpath (or equivalent) for executables to find the 
    9999    # shared libparrot in the build directory. 
    100     $conf->data->set( 
    101         rpath_blib => ( $parrot_is_shared && $conf->data->get('rpath') ) 
    102         ? $conf->data->get('rpath') 
    103             . $conf->data->get('build_dir') 
    104             . $conf->data->get('slash') 
    105             . $conf->data->get('blib_dir') 
    106         : '' 
    107     ); 
     100    # Respect a hint file or command-line override. 
     101    my $rpath_blib = $conf->option_or_data('rpath_blib'); 
     102    if (!defined($rpath_blib)) { 
     103        $rpath_blib = ( $parrot_is_shared && $conf->data->get('rpath') ) 
     104            ? $conf->data->get('rpath') 
     105                . $conf->data->get('build_dir') 
     106                . $conf->data->get('slash') 
     107                . $conf->data->get('blib_dir') 
     108            : ''; 
     109    } 
    108110 
    109111    # Set -rpath (or equivalent) for the installed executables to find the 
    110112    # installed shared libparrot. 
     113    my $rpath_lib = $conf->option_or_data('rpath_lib'); 
     114    if (!defined($rpath_lib)) { 
     115        $rpath_lib = ( $parrot_is_shared && $conf->data->get('rpath') ) 
     116            ? $conf->data->get('rpath') 
     117                . $conf->data->get('libdir') 
     118            : ''; 
     119    } 
     120 
    111121    $conf->data->set( 
    112         rpath_lib => ( $parrot_is_shared && $conf->data->get('rpath') ) 
    113         ? $conf->data->get('rpath') 
    114             . $conf->data->get('libdir') 
    115         : '' 
     122        rpath_blib => $rpath_blib, 
     123        rpath_lib  => $rpath_lib 
    116124    ); 
    117125 
    118126    unless ( defined( $conf->data->get('libparrot_ldflags') ) ) { 
  • lib/Parrot/Configure/Options/Conf/Shared.pm

    diff -r -u parrot-current/lib/Parrot/Configure/Options/Conf/Shared.pm parrot-andy/lib/Parrot/Configure/Options/Conf/Shared.pm
    old new  
    5858    parrot_is_shared 
    5959    prefix 
    6060    profile 
     61    rpath_lib 
    6162    sbindir 
    6263    sharedstatedir 
    6364    silent 
  • lib/Parrot/Configure/Options/Conf.pm

    diff -r -u parrot-current/lib/Parrot/Configure/Options/Conf.pm parrot-andy/lib/Parrot/Configure/Options/Conf.pm
    old new  
    133133                            [/usr/local] 
    134134    --exec-prefix=EPREFIX   Install architecture-dependent files in EPREFIX 
    135135                            [PREFIX] 
     136    --rpath_lib=RPATH       add RPATH into link flags to tell the 
     137                            installed parrot how to find the installed  
     138                            version of libparrot.so (if appropriate). 
    136139 
    137140    By default, `make install' will install all the files in 
    138141    `/usr/local/bin', `/usr/local/lib' etc.  You can specify