All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH v7,1/1] php: add apache support
Date: Mon, 12 Dec 2016 22:50:23 +0100	[thread overview]
Message-ID: <20161212225023.03d99bc2@free-electrons.com> (raw)
In-Reply-To: <1481495356-24462-1-git-send-email-fabrice.fontaine@orange.com>

Hello,

On Sun, 11 Dec 2016 23:29:16 +0100, Fabrice Fontaine wrote:

> diff --git a/package/php/0008-Call-apxs-with-correct-prefix.patch b/package/php/0008-Call-apxs-with-correct-prefix.patch
> new file mode 100644
> index 0000000..b850ab7
> --- /dev/null
> +++ b/package/php/0008-Call-apxs-with-correct-prefix.patch
> @@ -0,0 +1,49 @@
> +From 4342bdea7a1a21430ce0d051fa4387441166c473 Mon Sep 17 00:00:00 2001
> +From: Fabrice Fontaine <fabrice.fontaine@orange.com>
> +Date: Sun, 11 Dec 2016 23:12:46 +0100
> +Subject: [PATCH] Call apxs with correct prefix
> +
> +php uses apache's apxs script from staging directory to install libphp
> +dynamic library and update /etc/apache2/httpd.conf in the staging and target
> +directories. Here is the full command line:
> +"apxs -S LIBEXECDIR='$(INSTALL_ROOT)/usr/modules'
> + -S SYSCONFDIR='$(INSTALL_ROOT)/etc/apache2' -i -a -n php7"
> +This does not work for target directory as apxs sets the full path of the
> +library and not the relative one. Indeed, apxs is smart enough to substitute
> +away the prefix specified in $(STAGING_DIR)/usr/build/config_vars.mk so
> +httpd.conf will only be correct in the staging directory.
> +To fix this, add -S PREFIX='$(INSTALL_ROOT)/usr' to apxs call in configure
> +
> +Signed-off-by: Fabrice Fontaine <fabrice.fontaine@orange.com>

Thanks, this approach is better I believe.

> +diff --git a/sapi/apache2handler/config.m4 b/sapi/apache2handler/config.m4
> +index 2e64b21..f5bf002 100644
> +--- a/sapi/apache2handler/config.m4
> ++++ b/sapi/apache2handler/config.m4
> +@@ -66,10 +66,12 @@ if test "$PHP_APXS2" != "no"; then
> +     AC_MSG_ERROR([Please note that Apache version >= 2.0.44 is required])
> +   fi
> + 
> ++  APXS_PREFIX='$(INSTALL_ROOT)'/usr

This is still wrong, because the prefix could be something else
than /usr. However, if you query APXS -q PREFIX, it returns
$(STAGING_DIR)/usr, which is not what you want.

In fact, this is all messed up by the fact that we want APXS to
automagically return results prefixed by $(STAGING_DIR), in order for
the build to work fine, but in your case, you want some of the things
to take place on $(TARGET_DIR) as well at installation time. Somewhat
conflicting needs, not easy to handle with the current situation.

Bottom line: I've applied your patch as-is, since I don't see really
how to do things better for the moment.

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

      reply	other threads:[~2016-12-12 21:50 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-11 22:29 [Buildroot] [PATCH v7,1/1] php: add apache support Fabrice Fontaine
2016-12-12 21:50 ` Thomas Petazzoni [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20161212225023.03d99bc2@free-electrons.com \
    --to=thomas.petazzoni@free-electrons.com \
    --cc=buildroot@busybox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.