php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #28960 When INSTALL_ROOT don't use apxs with Option '-a'
Submitted: 2004-06-29 15:51 UTC Modified: 2017-01-29 04:22 UTC
Votes:3
Avg. Score:4.3 ± 0.9
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: Joerg dot Dieter dot Friedrich at uni-konstanz dot de Assigned:
Status: No Feedback Package: *General Issues
PHP Version: Irrelevant OS: irrelevant
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: Joerg dot Dieter dot Friedrich at uni-konstanz dot de
New email:
PHP Version: OS:

 

 [2004-06-29 15:51 UTC] Joerg dot Dieter dot Friedrich at uni-konstanz dot de
Description:
------------
It would be really great if apxs would not be called with '-a' when INSTALL_ROOT is set.
This would make package building easier.
this is a patch to sapi/apache/config.m4 which I think it must fix it. But please proove-read it.
--- sapi/apache/config.m4.orig  Tue Jun 29 15:44:21 2004
+++ sapi/apache/config.m4       Tue Jun 29 15:48:26 2004
@@ -70,9 +70,16 @@

   # Test whether apxs support -S option
   $APXS -q -S CFLAGS="$APXS_CFLAGS" CFLAGS >/dev/null 2>&1
+
+  # Test whether INSTALL_ROOT is set
+  ifeq  ($(strip $(INSTALL_ROOT)),)
+    APXS_ACTIVATE="-a"
+  else
+    APXS_ACTIVATE="-a"
+  endif

   if test "$?" != "0"; then
-    APACHE_INSTALL="$APXS -i -a -n php4 $SAPI_SHARED" # Old apxs does not have -S option
+    APACHE_INSTALL="$APXS -i $APXS_ACTIVATE -n php4 $SAPI_SHARED" # Old apxs does not have -S option
   else
     APXS_LIBEXECDIR='$(INSTALL_ROOT)'`$APXS -q LIBEXECDIR`
     if test -z `$APXS -q SYSCONFDIR`; then
@@ -85,7 +92,7 @@
                       \$(mkinstalldirs) '$APXS_SYSCONFDIR' && \
                        $APXS -S LIBEXECDIR='$APXS_LIBEXECDIR' \
                              -S SYSCONFDIR='$APXS_SYSCONFDIR' \
-                             -i -a -n php4 $SAPI_SHARED"
+                             -i $APXS_ACTIVATE -n php4 $SAPI_SHARED"
     fi
   fi




Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-06-29 15:54 UTC] Joerg dot Dieter dot Friedrich at uni-konstanz dot de
oops, typo in patch:

--- sapi/apache/config.m4.orig  Tue Jun 29 15:44:21 2004
+++ sapi/apache/config.m4       Tue Jun 29 15:52:54 2004
@@ -70,9 +70,16 @@

   # Test whether apxs support -S option
   $APXS -q -S CFLAGS="$APXS_CFLAGS" CFLAGS >/dev/null 2>&1
+
+  # Test whether INSTALL_ROOT is set
+  ifeq  ($(strip $(INSTALL_ROOT)),)
+    APXS_ACTIVATE="-a"
+  else
+    APXS_ACTIVATE=""
+  endif

   if test "$?" != "0"; then
-    APACHE_INSTALL="$APXS -i -a -n php4 $SAPI_SHARED" # Old apxs does not have -S option
+    APACHE_INSTALL="$APXS -i $APXS_ACTIVATE -n php4 $SAPI_SHARED" # Old apxs does not have -S option
   else
     APXS_LIBEXECDIR='$(INSTALL_ROOT)'`$APXS -q LIBEXECDIR`
     if test -z `$APXS -q SYSCONFDIR`; then
@@ -85,7 +92,7 @@
                       \$(mkinstalldirs) '$APXS_SYSCONFDIR' && \
                        $APXS -S LIBEXECDIR='$APXS_LIBEXECDIR' \
                              -S SYSCONFDIR='$APXS_SYSCONFDIR' \
-                             -i -a -n php4 $SAPI_SHARED"
+                             -i $APXS_ACTIVATE -n php4 $SAPI_SHARED"
     fi
   fi
 [2004-06-29 16:38 UTC] Joerg dot Dieter dot Friedrich at uni-konstanz dot de
OK, my patch is obviously wrong.

I'm not really good at autoconf and configure.

my ifeq-test is make-syntax not configure, I thought this will be put into the Makefile, which is not, and configure fails :-(

please look at it.
 [2012-10-05 16:30 UTC] mamfelt at gmail dot com
I have been trying to figure out how to get information into Makefile so that
looking at the value of INSTALL_ROOT is determined at 'make install' time.

The following logic is run either at buildconf, or configure time
(does this mean INSTALL_ROOT needs to be defined BEFORE running ./configure??)

because it seems the outoput is always coming from the 'else' block
  if test -z `$APXS -q SYSCONFDIR`; then
    INSTALL_IT="\$(mkinstalldirs) '$APXS_LIBEXECDIR' && \
                 $APXS -S LIBEXECDIR='$APXS_LIBEXECDIR' \
                       -i -n php5"
  else
    APXS_SYSCONFDIR='$(INSTALL_ROOT)'`$APXS -q SYSCONFDIR`
    INSTALL_IT="\$(mkinstalldirs) '$APXS_LIBEXECDIR' && \
                \$(mkinstalldirs) '$APXS_SYSCONFDIR' && \
                 $APXS -S LIBEXECDIR='$APXS_LIBEXECDIR' \
                       -S SYSCONFDIR='$APXS_SYSCONFDIR' \
                       -i -a -n php5"
  fi

as the -a option is hard coded as the only statement in Makefile
 [2012-12-27 12:18 UTC] mamfelt at gmail dot com
Have since learned that INSTALL_ROOT should only be set just before "make install" because having it set earlier has side-effects for the regular make (at least on AIX).

Now the APXS call is part of a compound command (multiple calls with &&) so it is not even looking at INSTALL_ROOT - other than to pass it as an argument.

I am not "smart enough" to come up with the right Makefile syntax change,

and - would also be "nice" if TARGET_ROOT was DESTDIR like most "GNU" based opensource packages. - but that would be a new feature request I expect :)
 [2012-12-28 13:05 UTC] mamfelt at gmail dot com
I did some testing and cannot get the ifeq to work, what does work is this change in Makefile.global (for version 5.3.20 +)

--- Makefile.global.distr       2012-12-19 16:13:48.000000000 +0100
+++ Makefile.global     2012-12-28 13:57:48.000000000 +0100
@@ -33,6 +33,11 @@
                        fi; \
                done; \
        fi
+         @if [ -z $(strip $(INSTALL_ROOT)) ]; then \
+                 APXS_ACTIVATE="-a" ; \
+         else \
+                 APXS_ACTIVATE="" ; \
+         fi
        @$(INSTALL_IT)
  
  install-modules: build-modules

I have not been able to find the file that creates the INSTALL_IT definition for Makefile. I thought it would be sapi/apache2handler/config.m4 but any (or where) I make changes are not applied by the ./configure process.

I switch -a for $(APXS_ACTIVATE) so it reads:

INSTALL_IT = $(mkinstalldirs) '$(INSTALL_ROOT)/opt/httpd/libexec' && $(mkinstalldirs) '$(INSTALL_ROOT)/var/httpd/etc' && /opt/httpd/sbin/apxs -S LIBEXECDIR='$(INSTALL_ROOT)/opt/httpd/libexec' -S SYSCONFDIR='$(INSTALL_ROOT)/var/httpd/etc' -i $(APXS_ACTIVATE) -n php5 libphp5.la

/var/http/etc, /opt/httpd/sbin, etc, are coming from the configure inputs of course.
 [2017-01-20 20:21 UTC] heiglandreas@php.net
-Status: Open +Status: Feedback -Package: Feature/Change Request +Package: *General Issues
 [2017-01-20 20:21 UTC] heiglandreas@php.net
Is this still relevant?
 [2017-01-29 04:22 UTC] php-bugs at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 18 09:01:27 2024 UTC