Mark Dootson wrote:
F.Y.I.

I don't know if this helps in tracking down the problem, but on Win32

  Yes, it does, and your analisys is correct.

perl Build.PL --prefix=F:/path/i/want

works fine and Alien::wxWidgets gets installed where I have specified.

However, I am not using Alien to build wxWidgets and in my
package Alien::wxWidgets::Config::msw_2_8_7_uni_mslu_gcc_3_4;

the config vars for include_path, link_libraries etc. all point to the standard sitearch location, not the location where Alien::wxWidgets has actually been installed.


I used to patch 'My::Build::Utility;' with an ugly none portable hack to fix this ( the methods in question always return $Config{sitearchexp} )

The patch is attached as it is tested and does work if the env variable '$ENV{WX_BUILDENV_LIB}' is set. A better approach using some other method of setting $BUILDLIBPREFIX would solve this problem I think.

  Tentative and hopefully correct patch attached below (it passes
a sane-looking --refix value to configure, but it will be a couple
of hours before the Linux build finishes and I can check...).

  And I haven't checked on Win32/Mac yet.

Thanks!
Mattia

Index: inc/My/Build/Win32_MSVC_Tmake.pm
===================================================================
--- inc/My/Build/Win32_MSVC_Tmake.pm    (revisione 2371)
+++ inc/My/Build/Win32_MSVC_Tmake.pm    (copia locale)
@@ -49,11 +49,11 @@
     };
 
     my $lib_link = sub {
-        awx_install_arch_file( 'rEpLaCe/lib/' . $_[0] .
+        awx_install_arch_file( $self, 'rEpLaCe/lib/' . $_[0] .
                                ( $self->awx_debug ? 'h' : '' ) . $Config{_a} );
     };
     my $link_implib = awx_install_arch_file
-      ( 'rEpLaCe/lib/'. File::Basename::basename( $implib ) );
+      ( $self, 'rEpLaCe/lib/' . File::Basename::basename( $implib ) );
 
     $data{dlls} = { core => { dll  => $dll,
                               lib  => $implib,
Index: inc/My/Build/Win32_MSVC_Bakefile.pm
===================================================================
--- inc/My/Build/Win32_MSVC_Bakefile.pm (revisione 2380)
+++ inc/My/Build/Win32_MSVC_Bakefile.pm (copia locale)
@@ -53,7 +53,7 @@
             s{[-/]LIBPATH:(\S+)}
              {$orig_libdir = File::Spec->canonpath
                                  ( File::Spec->rel2abs( $1 ) );
-              '-L' . ( $libdir = awx_install_arch_file( 'rEpLaCe/lib' ) )}egi;
+              '-L' . ( $libdir = awx_install_arch_file( $self, 'rEpLaCe/lib' ) 
)}egi;
             $data{libs} = $_;
         } elsif( s/^\s*cl\s+// ) {
             s/\s+\S+\.(cpp|pdb|obj)/ /g;
Index: inc/My/Build/Win32_MinGW_Tmake.pm
===================================================================
--- inc/My/Build/Win32_MinGW_Tmake.pm   (revisione 2371)
+++ inc/My/Build/Win32_MinGW_Tmake.pm   (copia locale)
@@ -49,10 +49,10 @@
     };
 
     my $lib_link = sub {
-        awx_install_arch_file( 'rEpLaCe/lib/' . 'lib' . $_[0] . $Config{_a} );
+        awx_install_arch_file( $self, 'rEpLaCe/lib/' . 'lib' . $_[0] . 
$Config{_a} );
     };
     my $link_implib = awx_install_arch_file
-      ( 'rEpLaCe/lib/'. File::Basename::basename( $implib ) );
+      ( $self, 'rEpLaCe/lib/' . File::Basename::basename( $implib ) );
 
     $data{dlls} = { core => { dll  => $dll,
                               lib  => $implib,
Index: inc/My/Build/Win32_MinGW_Bakefile.pm
===================================================================
--- inc/My/Build/Win32_MinGW_Bakefile.pm        (revisione 2380)
+++ inc/My/Build/Win32_MinGW_Bakefile.pm        (copia locale)
@@ -40,7 +40,7 @@
             s{-L(\S+)}
              {$orig_libdir = File::Spec->canonpath
                                  ( File::Spec->rel2abs( $1 ) );
-              '-L' . ( $libdir = awx_install_arch_file( 'rEpLaCe/lib' ) )}eg;
+              '-L' . ( $libdir = awx_install_arch_file( $self, 'rEpLaCe/lib' ) 
)}eg;
             $data{libs} = $_;
         } elsif( s/^\s*g\+\+\s+// ) {
             s/\s+\S+\.(cpp|o|d)/ /g;
Index: inc/My/Build/Any_wx_config.pm
===================================================================
--- inc/My/Build/Any_wx_config.pm       (revisione 2372)
+++ inc/My/Build/Any_wx_config.pm       (copia locale)
@@ -204,7 +204,7 @@
 sub build_wxwidgets {
     my $self = shift;
     my $prefix_dir = $self->_key;
-    my $prefix = awx_install_arch_dir( $prefix_dir );
+    my $prefix = awx_install_arch_dir( $self, $prefix_dir );
     my $opengl = $self->notes( 'build_wx_opengl' );
     my $args = sprintf '--with-%s %s--disable-compat24',
                        $self->awx_build_toolkit,
@@ -225,6 +225,7 @@
     # do not reconfigure unless necessary
     mkdir 'bld' unless -d 'bld';
     chdir 'bld';
+    # print $cmd, "\n";
     $self->_system( $cmd ) unless -f 'Makefile';
     $self->_system( 'make all' );
     chdir 'contrib/src/stc';
Index: inc/My/Build/Win32_MSVC.pm
===================================================================
--- inc/My/Build/Win32_MSVC.pm  (revisione 2371)
+++ inc/My/Build/Win32_MSVC.pm  (copia locale)
@@ -20,7 +20,7 @@
     my $libs = $self->wx_config( 'libs' );
     my $incdir = $self->awx_wx_config_data->{wxinc};
     my $cincdir = $self->awx_wx_config_data->{wxcontrinc};
-    my $iincdir = awx_install_arch_dir( 'rEpLaCe/include' );
+    my $iincdir = awx_install_arch_dir( $self, 'rEpLaCe/include' );
 
     foreach ( split /\s+/, $cccflags ) {
         m(^-DSTRICT) && next;
@@ -32,7 +32,7 @@
             }
             if( $_ =~ /-I\Q$self->{awx_setup_dir}\E/ && !$self->is_wince ) {
                 $config{include_path} .=
-                  '-I' . awx_install_arch_file( 'rEpLaCe/lib' ) . ' ';
+                  '-I' . awx_install_arch_file( $self, 'rEpLaCe/lib' ) . ' ';
             } else {
                 $config{include_path} .= "$_ ";
             }
Index: inc/My/Build/Win32.pm
===================================================================
--- inc/My/Build/Win32.pm       (revisione 2381)
+++ inc/My/Build/Win32.pm       (copia locale)
@@ -82,7 +82,7 @@
     my $self = shift;
     my $wxdir_b = $ENV{WXDIR};
     my $wxdir = $self->notes( 'build_wx' ) ?
-      awx_install_arch_dir( 'rEpLaCe' ) : $wxdir_b;
+      awx_install_arch_dir( $self, 'rEpLaCe' ) : $wxdir_b;
 
     return { 'wxdir'       => $wxdir,
              'wxdir_build' => $wxdir_b,
@@ -98,7 +98,7 @@
 
     $config{prefix} = $self->wx_config( 'wxdir' );
     $config{config}{toolkit} = $self->is_wince ? 'wce' : 'msw';
-    $config{shared_library_path} = awx_install_arch_file( "rEpLaCe/lib" );
+    $config{shared_library_path} = awx_install_arch_file( $self, "rEpLaCe/lib" 
);
 
     die "Unable to find setup.h directory"
       unless $self->wx_config( 'cxxflags' )
Index: inc/My/Build/Utility.pm
===================================================================
--- inc/My/Build/Utility.pm     (revisione 2371)
+++ inc/My/Build/Utility.pm     (copia locale)
@@ -22,20 +22,23 @@
 }
 
 sub awx_install_arch_file {
-    my( $vol, $dir, $file ) = File::Spec->splitpath( $_[0] || '' );
-    File::Spec->catfile( $Config{sitearchexp}, 'Alien', 'wxWidgets',
+    my( $build, $p ) = @_;
+    my( $vol, $dir, $file ) = File::Spec->splitpath( $p || '' );
+    File::Spec->catfile( $build->install_destination( 'arch' ), 'Alien', 
'wxWidgets',
                          File::Spec->splitdir( $dir ), $file );
 }
 
 sub awx_install_arch_dir {
-    my( $vol, $dir, $file ) = File::Spec->splitpath( $_[0] || '' );
-    File::Spec->catdir( $Config{sitearchexp}, 'Alien', 'wxWidgets',
+    my( $build, $p ) = @_;
+    my( $vol, $dir, $file ) = File::Spec->splitpath( $p || '' );
+    File::Spec->catdir( $build->install_destination( 'arch' ), 'Alien', 
'wxWidgets',
                         File::Spec->splitdir( $dir ), $file );
 }
 
 sub awx_install_arch_auto_file {
-    my( $vol, $dir, $file ) = File::Spec->splitpath( $_[0] || '' );
-    File::Spec->catfile( $Config{sitearchexp}, 'auto', 'Alien', 'wxWidgets',
+    my( $build, $p ) = @_;
+    my( $vol, $dir, $file ) = File::Spec->splitpath( $p || '' );
+    File::Spec->catfile( $build->install_destination( 'arch' ), 'auto', 
'Alien', 'wxWidgets',
                          File::Spec->splitdir( $dir ), $file );
 }
 
Index: inc/My/Build/Win32_MinGW.pm
===================================================================
--- inc/My/Build/Win32_MinGW.pm (revisione 2371)
+++ inc/My/Build/Win32_MinGW.pm (copia locale)
@@ -35,7 +35,7 @@
     my $libs = $self->wx_config( 'libs' );
     my $incdir = $self->awx_wx_config_data->{wxinc};
     my $cincdir = $self->awx_wx_config_data->{wxcontrinc};
-    my $iincdir = awx_install_arch_dir( 'rEpLaCe/include' );
+    my $iincdir = awx_install_arch_dir( $self, 'rEpLaCe/include' );
 
     foreach ( split /\s+/, $cccflags ) {
         m(^-DSTRICT) && next;
@@ -49,7 +49,7 @@
             }
             if( $_ =~ /-I\Q$self->{awx_setup_dir}\E/ ) {
                 $config{include_path} .=
-                  '-I' . awx_install_arch_file( 'rEpLaCe/lib' ) . ' ';
+                  '-I' . awx_install_arch_file( $self, 'rEpLaCe/lib' ) . ' ';
             } else {
                 $config{include_path} .= "$_ ";
             }

Reply via email to