Project

General

Profile

Bug #2638

Updated by jeremyevans0 (Jeremy Evans) about 5 years ago

=begin 
  
  Hello all, 
 
  This issue is very tricky, though. 
 
  For my build, I am using tools of "AIX Toolbox for Linux Applications" like gcc-4.2, make, ... which are located by default into prefix dir: "/opt/freeware". 
 
  But my own builds like ruby stand into my prefix dir: /opt/mce-pware. 
 
  Now that I describe my way of work, after I my build of ruby-1.9.1-p37[68] with configure --prefix=/opt-mce-pware, it failed to run because it needs libgcc but ignoring where this is installed. 
 
  This lib comes from "Aix Toolbox" libgcc-4.2.0-3.aix5.3.ppc.rpm which doesn't install links into /usr/lib. Obviously, I can create this links but I worry of what wouls happen for my ruby if I update libgcc? 
 
  On the other hand, I have a look to the search path of ruby with "# dump -Hv ./ruby" and this search path just contains "/opt/mce-pware/lib:/usr/lib:/lib". 
 
  I could also use "LIBPATH" environment variable and include it in script to wrap ruby cmdl? 
 
  I also try to use this "LIBPTAH" to build ruby but it failed to me because my own prefix contains some build of more recent release of tools like gettext also used by make. And unfortunately this break make to run ;<( 
 
  So as a first work-around, I create a variable which I name LIBGCCPATH which contains 
          LIBGCCPATH=$(gcc -print-libgcc-file-name) 
          LIBGCCPATH=$(dirname $LIBGCCPATH) 
          export LIBGCCPATH 
 
  and hack ruby-1.9.1-p378/configure file like: 
  --- ruby-1.9.1-p378/configure     2010-01-10 11:36:35.000000000 +0000 
  +++ ruby-1.9.1-p378-aix0/configure        2010-01-21 07:26:26.000000000 +0000 
  @@ -10968,7 +10968,7 @@ 
                          LDSHARED="$LDSHARED ${linker_flag}-G" 
                          DLDFLAGS='-eInit_$(TARGET)' 
                          XLDFLAGS="${linker_flag}-bE:ruby.imp ${linker_flag}-brtl" 
  -                         XLDFLAGS="$XLDFLAGS ${linker_flag}-blibpath:${prefix}/lib:${LIBPATH:-/usr/lib:/lib}" 
  +                         XLDFLAGS="$XLDFLAGS ${linker_flag}-blibpath:${prefix}/lib${LIBGCCPATH:+:}${LIBGCCPATH:-}:${LIBPATH:-/usr/lib:/lib}" 
                          : ${ARCHFILE="ruby.imp"} 
                           TRY_LINK='$(CC) $(LDFLAGS) -oconftest $(INCFLAGS) -I$(hdrdir) $(CPPFLAGS)' 
                           TRY_LINK="$TRY_LINK"' $(CFLAGS) $(src) $(LIBPATH) $(LOCAL_LIBS) $(LIBS)' 
  === <> === 
 
  and it works fine. 
 
  May be a better fix would be to create another var like TARGETRUBYLIBPATH which I could custom to my environment (e.g. /opt/mce-paware/lib:${LIBGCCPATH}:/usr/lib:/lib) or if TARGETRUBYLIBPATH is unset, set to LIBPATH for the one who can use it in its environment or if LIBPATH is not define by user this TARGETRUBYLIBPATH would be set to    "/usr/lib:/lib"; but this required better knowledge then mine to fix it. 
 
  Thanks in advance for further help, 
      J. 
 
 =end 
 

Back