Bug #17702: -rpath is not used correctly, causing configure failure

From: Date: Tue, 11 Jun 2002 15:42:46 +0000
Subject: Bug #17702: -rpath is not used correctly, causing configure failure
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-10120@lists.php.net to get a copy of this message
From:             long@kestrel.cc.ukans.edu
Operating system: Tru64 4.0F PK3
PHP version:      4.2.1
PHP Bug Type:     Compile Failure
Bug description:  -rpath is not used correctly, causing configure failure

Well, all I wanted to do was reopen bug #8844
(http://bugs.php.net/bug.php?id=8844) but since I have an empty password
on that bug it won't accept it so I can't login to that bug.  So go read
that bug and I'll just paste in what I was going to add to it:

I'm back.  I'm finally sick and tired enough of PHP 4.2.1 not compiling
correctly out of the box that I did some digging.  I beg to differ that
this is not a PHP bug as the autoconf macros that cause this problem are
in acinclude.m4 (i.e. written by PHP developers).  This problem can be
corrected, but probably only correctly by someone who more fully
understands the PHP build process.  At the end of this note is a patch I
used that causes the -rpath to be setup correctly for my particular
environment.  I'm not claiming in any sense that this patch is absolutely
correct for anyone else using Tru64 and the Compaq C compiler but it
worked for me.  Perhaps it can be used by an autoconf guru among the PHP
developers to correctly set -rpath.

P.S: I don't know why the previous comments on this bug attribute the
comment to me that this bug might as well be closed and offered some other
wrapper workarounds as I did not say that.  (In fact I never wanted this
bug closed :-)

*** acinclude.m4	Thu Jun  6 11:42:35 2002
--- ../acinclude.m4.orig	Wed Jun  5 12:34:38 2002
***************
*** 707,725 ****
        $2="-R$1 -L$1 [$]$2"
      else
        AC_PHP_ONCE(LIBPATH, $ai_p, [
! 	os=uname -sr 2>/dev/null
! 	case $os in
! 	  "OSF1 V4.0")
! 	    case $CC in
! 	      cc) test -z "$LDFLAGS" && test -n "$ld_runpath_switch"
&&
LDFLAGS="$ld_runpath_switch";
! 		  test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS$ai_p:"; 
! 		  LDFLAGS="-L$ai_p $LDFLAGS";;
! 	       *) test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS
$ld_runpath_switch$ai_p"; 
! 		  LDFLAGS="$LDFLAGS -L$ai_p";;
! 	    esac;;
! 	   *) test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS
$ld_runpath_switch$ai_p"; 
! 	      LDFLAGS="$LDFLAGS -L$ai_p";;
! 	esac
          PHP_RPATHS="$PHP_RPATHS $ai_p"
        ])
      fi
--- 707,714 ----
        $2="-R$1 -L$1 [$]$2"
      else
        AC_PHP_ONCE(LIBPATH, $ai_p, [
!         test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS
$ld_runpath_switch$ai_p"
!         LDFLAGS="$LDFLAGS -L$ai_p"
          PHP_RPATHS="$PHP_RPATHS $ai_p"
        ])
      fi
***************
*** 735,760 ****
    if test "$PHP_RPATH" = "yes" && test -n "$PHP_RPATHS";
then
      OLD_RPATHS="$PHP_RPATHS"
      unset PHP_RPATHS
-     os=uname -sr 2>/dev/null
-     case $os in
-       "OSF1 V4.0")
-         case $CC in
-           cc) NATIVE_RPATHS="$ld_runpath_switch";;
-           *) ;;
-         esac;;
-       *) ;;
-     esac
      for i in $OLD_RPATHS; do
        PHP_LDFLAGS="$PHP_LDFLAGS -L$i"
        PHP_RPATHS="$PHP_RPATHS -R $i"
!       case $os in
!         "OSF1 V4.0")
!           case $CC in
!             cc) NATIVE_RPATHS="$NATIVE_RPATHS:$i";;
!             *) NATIVE_RPATHS="$NATIVE_RPATHS $ld_runpath_switch$i";;
!           esac;;
!         *) NATIVE_RPATHS="$NATIVE_RPATHS $ld_runpath_switch$i";;
!       esac
      done
    fi
  ])
--- 724,733 ----
    if test "$PHP_RPATH" = "yes" && test -n "$PHP_RPATHS";
then
      OLD_RPATHS="$PHP_RPATHS"
      unset PHP_RPATHS
      for i in $OLD_RPATHS; do
        PHP_LDFLAGS="$PHP_LDFLAGS -L$i"
        PHP_RPATHS="$PHP_RPATHS -R $i"
!       NATIVE_RPATHS="$NATIVE_RPATHS $ld_runpath_switch$i"
      done
    fi
  ])
-- 
Edit bug report at http://bugs.php.net/?id=17702&edit=1
-- 
Fixed in CVS:        http://bugs.php.net/fix.php?id=17702&r=fixedcvs
Fixed in release:    http://bugs.php.net/fix.php?id=17702&r=alreadyfixed
Need backtrace:      http://bugs.php.net/fix.php?id=17702&r=needtrace
Try newer version:   http://bugs.php.net/fix.php?id=17702&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=17702&r=support
Expected behavior:   http://bugs.php.net/fix.php?id=17702&r=notwrong
Not enough info:     http://bugs.php.net/fix.php?id=17702&r=notenoughinfo
Submitted twice:     http://bugs.php.net/fix.php?id=17702&r=submittedtwice
register_globals:    http://bugs.php.net/fix.php?id=17702&r=globals



Thread (10 messages)

« previous php.bugs (#10120) next »