All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] need help adding apache to buildroot
@ 2013-01-16 21:30 Jenkins, Lee
  2013-01-16 21:35 ` Gustavo Zacarias
                   ` (2 more replies)
  0 siblings, 3 replies; 28+ messages in thread
From: Jenkins, Lee @ 2013-01-16 21:30 UTC (permalink / raw)
  To: buildroot

Hello. I'm adding apache httpd to my buildroot project but I'm stuck and need some help.

Here's what I've done so far:


1.       created a directory buildroot/package/apache

2.       created buildroot/package/apache/Config.in (see below)

3.       as a starting point, downloaded the panda-buildroot apache.mk (see below)  to buildroot/package/apache

4.       added a line <<source "package/apache/Config.in">> to buildroot/package/Config.in under "Networking applications"

5.       ran "make menuconfig", selected "apache" in "Package Selection" > "Networking applications", saved & exited

6.       ran "make" and expected httpd to be built and show up in my rootfs target. It was not there.

7.       ran "make apache-source" as a test, but make replies: "No rule to make target `apache-source'. Stop."

I expected make to pick up the new package, but that's clearly not happening. What am I missing?

Lee Jenkins


----- buildroot/package/apache/Config.in -----

config BR2_PACKAGE_APACHE
     bool "apache"
     help
       Apache web server software

----- buildroot/package/apache/apache.mk -----

#############################################################
#
# apache
#
#############################################################
APACHE_VERSION    = 2.2.19
#APACHE_SITE       = http://mir2.ovh.net/ftp.apache.org/dist/httpd/
APACHE_SITE       = http://archive.apache.org/dist/httpd/
APACHE_SOURCE = httpd-$(APACHE_VERSION).tar.bz2
APACHE_INSTALL_STAGING = YES
APACHE_INSTALL_TARGET = YES
APACHE_AUTORECONF = YES

APACHE_CONF_ENV += \
        ac_cv_file__dev_zero=yes \
        ac_cv_func_setpgrp_void=yes \
        apr_cv_tcp_nodelay_with_cork=yes \
        ac_cv_sizeof_struct_iovec=8 \
        apr_cv_process_shared_works=yes \
        apr_cv_mutex_robust_shared=no \
        ac_cv_struct_rlimit=yes \
        ap_cv_void_ptr_lt_long=no \
        CC="$(TARGET_CC)" \
        CFLAGS="$(TARGET_CFLAGS)" \
        LDFLAGS="$(TARGET_LDFLAGS)" \

APACHE_CONF_OPT += \
        --host="$(REAL_GNU_TARGET_NAME)" \
        --prefix="/apacheSW/" \
        --enable-so \
        --enable-module=all





define APACHE_CONFIGURE_CMDS
        (cd $(@D) && rm -rf config.cache; \
                $(APACHE_CONF_ENV) \
                ./configure \
                $(APACHE_CONF_OPT) \
        )
endef
define ADD_INIT_SCRIPT

$(INSTALL) -m 0755 -D $(APACHE_DIR_PREFIX)/$(APACHE_NAME)/Apache_InitScript \
        $(TARGET_DIR)/etc/init.d/S90Apache;
endef
APACHE_POST_INSTALL_STAGING_HOOKS += ADD_INIT_SCRIPT


$(eval $(call AUTOTARGETS))



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20130116/797f8c3a/attachment-0001.html>

^ permalink raw reply	[flat|nested] 28+ messages in thread

* [Buildroot] need help adding apache to buildroot
  2013-01-16 21:30 [Buildroot] need help adding apache to buildroot Jenkins, Lee
@ 2013-01-16 21:35 ` Gustavo Zacarias
  2013-01-17 22:41   ` Jenkins, Lee
  2013-01-16 21:54 ` [Buildroot] need help adding apache to buildroot Thomas Petazzoni
  2013-07-07 14:16 ` Stephan Hoffmann
  2 siblings, 1 reply; 28+ messages in thread
From: Gustavo Zacarias @ 2013-01-16 21:35 UTC (permalink / raw)
  To: buildroot

On 01/16/2013 06:30 PM, Jenkins, Lee (ISS Houston) wrote:

> Hello. I?m adding apache httpd to my buildroot project but I?m stuck and
> need some help.
> 
> Here?s what I?ve done so far:
> 
> 7.       ran ?make apache-source? as a test, but make replies: ?No rule
> to make target `apache-source?. Stop.?
> 
>  
> 
> I expected make to pick up the new package, but that?s clearly not
> happening. What am I missing?
> 
> $(eval $(call AUTOTARGETS))

If you're using latest git buildroot this has changed to:

$(eval $(autotools-package))

So the package infrastructure isn't evaluating (parsing) your package at
all.
Regards.

^ permalink raw reply	[flat|nested] 28+ messages in thread

* [Buildroot] need help adding apache to buildroot
  2013-01-16 21:30 [Buildroot] need help adding apache to buildroot Jenkins, Lee
  2013-01-16 21:35 ` Gustavo Zacarias
@ 2013-01-16 21:54 ` Thomas Petazzoni
  2013-07-07 14:16 ` Stephan Hoffmann
  2 siblings, 0 replies; 28+ messages in thread
From: Thomas Petazzoni @ 2013-01-16 21:54 UTC (permalink / raw)
  To: buildroot

Dear Jenkins, Lee (ISS Houston),

On Wed, 16 Jan 2013 21:30:31 +0000, Jenkins, Lee (ISS Houston) wrote:

> I expected make to pick up the new package, but that's clearly not
> happening. What am I missing?

Gustavo gave the explanation for this.

I'm however going to add a few more comments below, as I hope you'll be
submitting this package to Buildroot once it works.

> ----- buildroot/package/apache/Config.in -----
> 
> config BR2_PACKAGE_APACHE
>      bool "apache"
>      help
>        Apache web server software

You should add the upstream URL of the project here, separated from the
main description by an empty newline. (See how other packages do it).

> 
> ----- buildroot/package/apache/apache.mk -----
> 
> #############################################################
> #
> # apache
> #
> #############################################################
> APACHE_VERSION    = 2.2.19

We usually put an empty new line between the header and the first
variable declaration.

> #APACHE_SITE       = http://mir2.ovh.net/ftp.apache.org/dist/httpd/

Please remove unneeded comments if you want to submit this package to
Buildroot.

> APACHE_SITE       = http://archive.apache.org/dist/httpd/
> APACHE_SOURCE = httpd-$(APACHE_VERSION).tar.bz2
> APACHE_INSTALL_STAGING = YES
> APACHE_INSTALL_TARGET = YES

This line is not needed, as it is the default.

> APACHE_AUTORECONF = YES

This is generally not needed, as releases shipped as tarballs usually
have the configure script and the Makefile.in pre-generated. So there
should be a comment above this line that explains why it is needed.

> 
> APACHE_CONF_ENV += \
>         ac_cv_file__dev_zero=yes \
>         ac_cv_func_setpgrp_void=yes \
>         apr_cv_tcp_nodelay_with_cork=yes \
>         ac_cv_sizeof_struct_iovec=8 \
>         apr_cv_process_shared_works=yes \
>         apr_cv_mutex_robust_shared=no \
>         ac_cv_struct_rlimit=yes \
>         ap_cv_void_ptr_lt_long=no \
>         CC="$(TARGET_CC)" \
>         CFLAGS="$(TARGET_CFLAGS)" \
>         LDFLAGS="$(TARGET_LDFLAGS)" \

The CC, CFLAGS and LDFLAGS are not needed here, they are already passed
by the Buildroot autotools infrastructure.

> APACHE_CONF_OPT += \
>         --host="$(REAL_GNU_TARGET_NAME)" \

--host is already passed by Buildroot.

>         --prefix="/apacheSW/" \

--prefix is already passed by Buildroot (and /apacheSW/ is not a
standard and appropriate location).

>         --enable-so \
>         --enable-module=all
> 
> 
> 
> 
> 

Please remove useless empty lines.

> define APACHE_CONFIGURE_CMDS
>         (cd $(@D) && rm -rf config.cache; \
>                 $(APACHE_CONF_ENV) \
>                 ./configure \
>                 $(APACHE_CONF_OPT) \
>         )
> endef

This is not needed, Buildroot already has a default
<pkg>_CONFIGURE_CMDS for autotools packages that does the right thing.
If it doesn't then please add a comment above that explains why we need
to override the CONFIGURE_CMDS.

> define ADD_INIT_SCRIPT
> 	$(INSTALL) -m 0755 -D $(APACHE_DIR_PREFIX)/$(APACHE_NAME)/Apache_InitScript $(TARGET_DIR)/etc/init.d/S90Apache;
> endef
> APACHE_POST_INSTALL_STAGING_HOOKS += ADD_INIT_SCRIPT

You should use APACHE_INSTALL_INIT_SYSV to install an init script. See
package/lighttpd/lighttpd.mk for an example. Also, please name your
script S90apache in package/apache/. So in the end, it should look like:

define APACHE_INSTALL_INIT_SYSV
	[ -f $(TARGET_DIR)/etc/init.d/S50apache ] || \
		$(INSTALL) -D -m 755 package/apache/S50apache \
			$(TARGET_DIR)/etc/init.d/S50apache
endef

Thanks!

Thomas
-- 
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com

^ permalink raw reply	[flat|nested] 28+ messages in thread

* [Buildroot] need help adding apache to buildroot
  2013-01-16 21:35 ` Gustavo Zacarias
@ 2013-01-17 22:41   ` Jenkins, Lee
  2013-01-18  9:25     ` Jérôme Pouiller
  0 siblings, 1 reply; 28+ messages in thread
From: Jenkins, Lee @ 2013-01-17 22:41 UTC (permalink / raw)
  To: buildroot

Gustavo & Thomas, thanks for the quick replies!

After a few changes to apache.mk the build started doing its thing, only to fail in mid stride.

The root problem is that the apache make process builds a binary (or maybe more than one) on the BUILD system that are then used to complete the build, but when cross-compiling, the binaries are being built for the target system instead of the build system. Ugh.

The good news is I found a patch that provides a CC_FOR_BUILD variable to fix the problem. However, the patch is not an "official" apache patch, but hosted at a different location here: http://people.apache.org/~fuankg/diffs/httpd-2.2.x-cross_compile.diff. If I'm reading the buildroot docs correctly, if I add APACHE_PATCH to apache.mk it will require the patch to be at the same URL as the tarball. Ugh.

Are the "patch hooks" simply shell commands? How egregious would it be (from a buildroot maintainer perspective) to use the patch hooks to wget the patch and apply it? :-)

Is there a simpler solution I'm not aware of?

^ permalink raw reply	[flat|nested] 28+ messages in thread

* [Buildroot] need help adding apache to buildroot
  2013-01-17 22:41   ` Jenkins, Lee
@ 2013-01-18  9:25     ` Jérôme Pouiller
  2013-01-18 15:31       ` Thomas Petazzoni
  0 siblings, 1 reply; 28+ messages in thread
From: Jérôme Pouiller @ 2013-01-18  9:25 UTC (permalink / raw)
  To: buildroot

On Thursday 17 January 2013 22:41:24 Jenkins, Lee wrote:
[...]
> The good news is I found a patch that provides a CC_FOR_BUILD variable to
> fix the problem. However, the patch is not an "official" apache patch, but
> hosted at a different location here:
> http://people.apache.org/~fuankg/diffs/httpd-2.2.x-cross_compile.diff. If
> I'm reading the buildroot docs correctly, if I add APACHE_PATCH to
> apache.mk it will require the patch to be at the same URL as the tarball.
> Ugh.
> 
> Are the "patch hooks" simply shell commands? How egregious would it be (from
> a buildroot maintainer perspective) to use the patch hooks to wget the
> patch and apply it? :-)
IMHO, this patch is small enough to be included in Buildroot tree.

Download manually the patch, place it in your package directory and name it 
RAWNAME-DESCRIPTION.patch (apache-cross-compile-fix.patch) (Exact naming rule 
is in packages/pkg-generic.mk:$(BUILD_DIR)/%/.stamp_patched).

Patch will be automatically applied.



-- 
J?r?me Pouiller

^ permalink raw reply	[flat|nested] 28+ messages in thread

* [Buildroot] need help adding apache to buildroot
  2013-01-18  9:25     ` Jérôme Pouiller
@ 2013-01-18 15:31       ` Thomas Petazzoni
  2013-01-18 16:11         ` [Buildroot] [PATCH] Add support for plain URL in $(PKG)_PATCH variable Jérôme Pouiller
  0 siblings, 1 reply; 28+ messages in thread
From: Thomas Petazzoni @ 2013-01-18 15:31 UTC (permalink / raw)
  To: buildroot

Dear J?r?me Pouiller,

On Fri, 18 Jan 2013 10:25:03 +0100, J?r?me Pouiller wrote:
> On Thursday 17 January 2013 22:41:24 Jenkins, Lee wrote:
> [...]
> > The good news is I found a patch that provides a CC_FOR_BUILD variable to
> > fix the problem. However, the patch is not an "official" apache patch, but
> > hosted at a different location here:
> > http://people.apache.org/~fuankg/diffs/httpd-2.2.x-cross_compile.diff. If
> > I'm reading the buildroot docs correctly, if I add APACHE_PATCH to
> > apache.mk it will require the patch to be at the same URL as the tarball.
> > Ugh.
> > 
> > Are the "patch hooks" simply shell commands? How egregious would it be (from
> > a buildroot maintainer perspective) to use the patch hooks to wget the
> > patch and apply it? :-)
> IMHO, this patch is small enough to be included in Buildroot tree.
> 
> Download manually the patch, place it in your package directory and name it 
> RAWNAME-DESCRIPTION.patch (apache-cross-compile-fix.patch) (Exact naming rule 
> is in packages/pkg-generic.mk:$(BUILD_DIR)/%/.stamp_patched).
> 
> Patch will be automatically applied.

Agreed, the patch seems small enough to be included in Buildroot
directly.

That said, I've also found a bit strange that our package
infrastructure enforces that the patches must be located on the same
site, at the same location, as the original tarball. It doesn't make
much sense. So we might want to change that in the future, but for this
specific case, having the patch directly in Buildroot makes sense, I
agree.

Best regards,

Thomas
-- 
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com

^ permalink raw reply	[flat|nested] 28+ messages in thread

* [Buildroot] [PATCH] Add support for plain URL in $(PKG)_PATCH variable
  2013-01-18 15:31       ` Thomas Petazzoni
@ 2013-01-18 16:11         ` Jérôme Pouiller
  2013-01-30 18:59           ` Yann E. MORIN
  2013-01-30 19:23           ` Yann E. MORIN
  0 siblings, 2 replies; 28+ messages in thread
From: Jérôme Pouiller @ 2013-01-18 16:11 UTC (permalink / raw)
  To: buildroot

Until now, $(PKG)_PATCH allow only to download patches from same URL than tarball.
This patch allow to detect when plain URL are used in $(PKG)_PATCH and correctly
handle them.

Signed-off-by: J?r?me Pouiller <jezz@sysmic.org>
---
 package/pkg-generic.mk |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/package/pkg-generic.mk b/package/pkg-generic.mk
index b0eca0a..37f3a29 100644
--- a/package/pkg-generic.mk
+++ b/package/pkg-generic.mk
@@ -40,7 +40,7 @@ ifeq ($(DL_MODE),DOWNLOAD)
 	fi
 endif
 	$(if $($(PKG)_SOURCE),$(call DOWNLOAD,$($(PKG)_SITE)/$($(PKG)_SOURCE)))
-	$(foreach p,$($(PKG)_PATCH),$(call DOWNLOAD,$($(PKG)_SITE)/$(p))$(sep))
+	$(foreach p,$($(PKG)_PATCH),$(call DOWNLOAD,$(if $(findstring ://,$(p)),$(p),$($(PKG)_SITE)/$(p)))$(sep))
 	$(foreach hook,$($(PKG)_POST_DOWNLOAD_HOOKS),$(call $(hook))$(sep))
 ifeq ($(DL_MODE),DOWNLOAD)
 	$(Q)mkdir -p $(@D)
@@ -85,7 +85,7 @@ $(BUILD_DIR)/%/.stamp_patched: NAMEVER = $(RAWNAME)-$($(PKG)_VERSION)
 $(BUILD_DIR)/%/.stamp_patched:
 	@$(call MESSAGE,"Patching $($(PKG)_DIR_PREFIX)/$(RAWNAME)")
 	$(foreach hook,$($(PKG)_PRE_PATCH_HOOKS),$(call $(hook))$(sep))
-	$(foreach p,$($(PKG)_PATCH),support/scripts/apply-patches.sh $(@D) $(DL_DIR) $(p)$(sep))
+	$(foreach p,$($(PKG)_PATCH),support/scripts/apply-patches.sh $(@D) $(DL_DIR) $(notdir $(p))$(sep))
 	$(Q)( \
 	if test -d $($(PKG)_DIR_PREFIX)/$(RAWNAME); then \
 	  if test "$(wildcard $($(PKG)_DIR_PREFIX)/$(RAWNAME)/$(NAMEVER)*.patch*)"; then \
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [Buildroot] [PATCH] Add support for plain URL in $(PKG)_PATCH variable
  2013-01-18 16:11         ` [Buildroot] [PATCH] Add support for plain URL in $(PKG)_PATCH variable Jérôme Pouiller
@ 2013-01-30 18:59           ` Yann E. MORIN
  2013-01-30 19:23           ` Yann E. MORIN
  1 sibling, 0 replies; 28+ messages in thread
From: Yann E. MORIN @ 2013-01-30 18:59 UTC (permalink / raw)
  To: buildroot

J?r?me, Peter, All,

On Friday 18 January 2013 J?r?me Pouiller wrote:
> Until now, $(PKG)_PATCH allow only to download patches from same URL than tarball.
> This patch allow to detect when plain URL are used in $(PKG)_PATCH and correctly
> handle them.
> 
> Signed-off-by: J?r?me Pouiller <jezz@sysmic.org>

I've added this patch to my tree, as I need it to cleanly add new packages,
and it will be included in my next pull-request.

I'll add my *-by tags at the same time.

Thank you! :-)

Regards,
Yann E. MORIN.


-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

^ permalink raw reply	[flat|nested] 28+ messages in thread

* [Buildroot] [PATCH] Add support for plain URL in $(PKG)_PATCH variable
  2013-01-18 16:11         ` [Buildroot] [PATCH] Add support for plain URL in $(PKG)_PATCH variable Jérôme Pouiller
  2013-01-30 18:59           ` Yann E. MORIN
@ 2013-01-30 19:23           ` Yann E. MORIN
  2013-01-30 22:37             ` Jérôme Pouiller
  2013-01-30 22:50             ` Thomas Petazzoni
  1 sibling, 2 replies; 28+ messages in thread
From: Yann E. MORIN @ 2013-01-30 19:23 UTC (permalink / raw)
  To: buildroot

J?r?me, Thomas, All,

On Friday 18 January 2013 J?r?me Pouiller wrote:
> Until now, $(PKG)_PATCH allow only to download patches from same URL than tarball.
> This patch allow to detect when plain URL are used in $(PKG)_PATCH and correctly
> handle them.
> 
> Signed-off-by: J?r?me Pouiller <jezz@sysmic.org>
> ---
>  package/pkg-generic.mk |    4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/package/pkg-generic.mk b/package/pkg-generic.mk
> index b0eca0a..37f3a29 100644
> --- a/package/pkg-generic.mk
> +++ b/package/pkg-generic.mk
> @@ -40,7 +40,7 @@ ifeq ($(DL_MODE),DOWNLOAD)
>  	fi
>  endif
>  	$(if $($(PKG)_SOURCE),$(call DOWNLOAD,$($(PKG)_SITE)/$($(PKG)_SOURCE)))
> -	$(foreach p,$($(PKG)_PATCH),$(call DOWNLOAD,$($(PKG)_SITE)/$(p))$(sep))
> +	$(foreach p,$($(PKG)_PATCH),$(call DOWNLOAD,$(if $(findstring ://,$(p)),$(p),$($(PKG)_SITE)/$(p)))$(sep))
>  	$(foreach hook,$($(PKG)_POST_DOWNLOAD_HOOKS),$(call $(hook))$(sep))
>  ifeq ($(DL_MODE),DOWNLOAD)
>  	$(Q)mkdir -p $(@D)
> @@ -85,7 +85,7 @@ $(BUILD_DIR)/%/.stamp_patched: NAMEVER = $(RAWNAME)-$($(PKG)_VERSION)
>  $(BUILD_DIR)/%/.stamp_patched:
>  	@$(call MESSAGE,"Patching $($(PKG)_DIR_PREFIX)/$(RAWNAME)")
>  	$(foreach hook,$($(PKG)_PRE_PATCH_HOOKS),$(call $(hook))$(sep))
> -	$(foreach p,$($(PKG)_PATCH),support/scripts/apply-patches.sh $(@D) $(DL_DIR) $(p)$(sep))
> +	$(foreach p,$($(PKG)_PATCH),support/scripts/apply-patches.sh $(@D) $(DL_DIR) $(notdir $(p))$(sep))
>  	$(Q)( \
>  	if test -d $($(PKG)_DIR_PREFIX)/$(RAWNAME); then \
>  	  if test "$(wildcard $($(PKG)_DIR_PREFIX)/$(RAWNAME)/$(NAMEVER)*.patch*)"; then \

Hm. Not specific to the patch per-se, but:

Currently the (single) PKG_PATCH is saved to a file which name is the
plain filename ("notdir") of the patch.

In case one uses a custom directory to store all downloaded files (eg. I
use "${HOME}/src" so I don't have to download them again and again), this
directory gets cluttered with many files that are difficult to link to
the package they apply to.

It gets even worse with this change.

What about saving the patches to a file named thus:
   $(PKG_NAME)-$(PKG_VERSION)-$(PKG_PATCH_FILENAME).patch

Regards,
Yann E. MORIN.

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

^ permalink raw reply	[flat|nested] 28+ messages in thread

* [Buildroot] [PATCH] Add support for plain URL in $(PKG)_PATCH variable
  2013-01-30 19:23           ` Yann E. MORIN
@ 2013-01-30 22:37             ` Jérôme Pouiller
  2013-01-30 22:37               ` Jérôme Pouiller
  2013-01-30 22:50             ` Thomas Petazzoni
  1 sibling, 1 reply; 28+ messages in thread
From: Jérôme Pouiller @ 2013-01-30 22:37 UTC (permalink / raw)
  To: buildroot


On Wednesday 30 January 2013 20:23:58 Yann E. MORIN wrote:
[...]
> In case one uses a custom directory to store all downloaded files (eg. I
> use "${HOME}/src" so I don't have to download them again and again), this
> directory gets cluttered with many files that are difficult to link to
> the package they apply to.
> 
> It gets even worse with this change.
> 
> What about saving the patches to a file named thus:
>    $(PKG_NAME)-$(PKG_VERSION)-$(PKG_PATCH_FILENAME).patches
Sure!

Patch follows, Looks doing the job. Nevertheless, I begin to found this feature a 
little difficult to read (euphemism...). Someone has an opinion about coding 
style?


-- 
J?r?me Pouiller

^ permalink raw reply	[flat|nested] 28+ messages in thread

* [Buildroot] [PATCH] Add support for plain URL in $(PKG)_PATCH variable
  2013-01-30 22:37             ` Jérôme Pouiller
@ 2013-01-30 22:37               ` Jérôme Pouiller
  2013-01-30 22:54                 ` Yann E. MORIN
  0 siblings, 1 reply; 28+ messages in thread
From: Jérôme Pouiller @ 2013-01-30 22:37 UTC (permalink / raw)
  To: buildroot

Until now, $(PKG)_PATCH allow only to download patches from same URL than tarball.
This patch allow to detect when plain URL are used in $(PKG)_PATCH and correctly
handle them.

Downloaded patches are named $(PKG_NAME)-$(PKG_VERSION)-$(PKG_PATCH_FILENAME).patch

Signed-off-by: J?r?me Pouiller <jezz@sysmic.org>
---
 package/pkg-generic.mk |    9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/package/pkg-generic.mk b/package/pkg-generic.mk
index b0eca0a..0afa72d 100644
--- a/package/pkg-generic.mk
+++ b/package/pkg-generic.mk
@@ -40,7 +40,12 @@ ifeq ($(DL_MODE),DOWNLOAD)
 	fi
 endif
 	$(if $($(PKG)_SOURCE),$(call DOWNLOAD,$($(PKG)_SITE)/$($(PKG)_SOURCE)))
-	$(foreach p,$($(PKG)_PATCH),$(call DOWNLOAD,$($(PKG)_SITE)/$(p))$(sep))
+	$(foreach p,$($(PKG)_PATCH),\
+		$(if $(findstring ://,$(p)),\
+			$(call DOWNLOAD,$(p),$($(PKG)_NAME)-$($(PKG)_VERSION)-$(basename $(notdir $(p)).patch)),\
+			$(call DOWNLOAD,$($(PKG)_SITE)/$(p))\
+		)\
+	$(sep))
 	$(foreach hook,$($(PKG)_POST_DOWNLOAD_HOOKS),$(call $(hook))$(sep))
 ifeq ($(DL_MODE),DOWNLOAD)
 	$(Q)mkdir -p $(@D)
@@ -85,7 +90,7 @@ $(BUILD_DIR)/%/.stamp_patched: NAMEVER = $(RAWNAME)-$($(PKG)_VERSION)
 $(BUILD_DIR)/%/.stamp_patched:
 	@$(call MESSAGE,"Patching $($(PKG)_DIR_PREFIX)/$(RAWNAME)")
 	$(foreach hook,$($(PKG)_PRE_PATCH_HOOKS),$(call $(hook))$(sep))
-	$(foreach p,$($(PKG)_PATCH),support/scripts/apply-patches.sh $(@D) $(DL_DIR) $(p)$(sep))
+	$(foreach p,$($(PKG)_PATCH),support/scripts/apply-patches.sh $(@D) $(DL_DIR) $(notdir $(p))$(sep))
 	$(Q)( \
 	if test -d $($(PKG)_DIR_PREFIX)/$(RAWNAME); then \
 	  if test "$(wildcard $($(PKG)_DIR_PREFIX)/$(RAWNAME)/$(NAMEVER)*.patch*)"; then \
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [Buildroot] [PATCH] Add support for plain URL in $(PKG)_PATCH variable
  2013-01-30 19:23           ` Yann E. MORIN
  2013-01-30 22:37             ` Jérôme Pouiller
@ 2013-01-30 22:50             ` Thomas Petazzoni
  2013-01-30 22:57               ` Yann E. MORIN
  1 sibling, 1 reply; 28+ messages in thread
From: Thomas Petazzoni @ 2013-01-30 22:50 UTC (permalink / raw)
  To: buildroot

Dear Yann E. MORIN,

On Wed, 30 Jan 2013 20:23:58 +0100, Yann E. MORIN wrote:
> In case one uses a custom directory to store all downloaded files
> (eg. I use "${HOME}/src" so I don't have to download them again and
> again), this directory gets cluttered with many files that are
> difficult to link to the package they apply to.
> 
> It gets even worse with this change.
> 
> What about saving the patches to a file named thus:
>    $(PKG_NAME)-$(PKG_VERSION)-$(PKG_PATCH_FILENAME).patch

I am not sure because we don't do this for tarballs: we keep their
original name. For example Python-3.3.0 even though the package is
named python3, cJSONFiles.zip even though the package is named cjson,
etc.

So either we decide to keep the original name for everything, or we
decide to use our own name for everything.

Thomas
-- 
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com

^ permalink raw reply	[flat|nested] 28+ messages in thread

* [Buildroot] [PATCH] Add support for plain URL in $(PKG)_PATCH variable
  2013-01-30 22:37               ` Jérôme Pouiller
@ 2013-01-30 22:54                 ` Yann E. MORIN
  2013-01-30 23:11                   ` Jérôme Pouiller
  0 siblings, 1 reply; 28+ messages in thread
From: Yann E. MORIN @ 2013-01-30 22:54 UTC (permalink / raw)
  To: buildroot

J?r?me, All,

On Wednesday 30 January 2013 J?r?me Pouiller wrote:
> Until now, $(PKG)_PATCH allow only to download patches from same URL than tarball.
> This patch allow to detect when plain URL are used in $(PKG)_PATCH and correctly
> handle them.
> 
> Downloaded patches are named $(PKG_NAME)-$(PKG_VERSION)-$(PKG_PATCH_FILENAME).patch

Well, I meant: $(PKG_NAME)-$(PKG_VERSION)-$(PKG_PATCH_FILENAME)
We should keep the original filename (in case it is compresed).

> Signed-off-by: J?r?me Pouiller <jezz@sysmic.org>
> ---
>  package/pkg-generic.mk |    9 +++++++--
>  1 file changed, 7 insertions(+), 2 deletions(-)
> 
> diff --git a/package/pkg-generic.mk b/package/pkg-generic.mk
> index b0eca0a..0afa72d 100644
> --- a/package/pkg-generic.mk
> +++ b/package/pkg-generic.mk
> @@ -40,7 +40,12 @@ ifeq ($(DL_MODE),DOWNLOAD)
>  	fi
>  endif
>  	$(if $($(PKG)_SOURCE),$(call DOWNLOAD,$($(PKG)_SITE)/$($(PKG)_SOURCE)))
> -	$(foreach p,$($(PKG)_PATCH),$(call DOWNLOAD,$($(PKG)_SITE)/$(p))$(sep))
> +	$(foreach p,$($(PKG)_PATCH),\
> +		$(if $(findstring ://,$(p)),\
> +			$(call DOWNLOAD,$(p),$($(PKG)_NAME)-$($(PKG)_VERSION)-$(basename $(notdir $(p)).patch)),\

forget 'basename', don;t add '.patch' (the file may be compressed, we
shouldnot rename it or we won;t be able to apply it.

> +			$(call DOWNLOAD,$($(PKG)_SITE)/$(p))\

The naming should also be applied for the 'plain-file' case, too.

> +		)\
> +	$(sep))
>  	$(foreach hook,$($(PKG)_POST_DOWNLOAD_HOOKS),$(call $(hook))$(sep))
>  ifeq ($(DL_MODE),DOWNLOAD)
>  	$(Q)mkdir -p $(@D)
> @@ -85,7 +90,7 @@ $(BUILD_DIR)/%/.stamp_patched: NAMEVER = $(RAWNAME)-$($(PKG)_VERSION)
>  $(BUILD_DIR)/%/.stamp_patched:
>  	@$(call MESSAGE,"Patching $($(PKG)_DIR_PREFIX)/$(RAWNAME)")
>  	$(foreach hook,$($(PKG)_PRE_PATCH_HOOKS),$(call $(hook))$(sep))
> -	$(foreach p,$($(PKG)_PATCH),support/scripts/apply-patches.sh $(@D) $(DL_DIR) $(p)$(sep))
> +	$(foreach p,$($(PKG)_PATCH),support/scripts/apply-patches.sh $(@D) $(DL_DIR) $(notdir $(p))$(sep))

Make that consistent with the above, please.

Also, here you're doing two indepndent changes:
  - change the downloaded file names
  - allow plain URLs

This should be two different patches (multiple URLs first, I'd suggest).

Regards,
Yann E. MORIN.

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

^ permalink raw reply	[flat|nested] 28+ messages in thread

* [Buildroot] [PATCH] Add support for plain URL in $(PKG)_PATCH variable
  2013-01-30 22:50             ` Thomas Petazzoni
@ 2013-01-30 22:57               ` Yann E. MORIN
  2013-01-30 23:04                 ` Jérôme Pouiller
  0 siblings, 1 reply; 28+ messages in thread
From: Yann E. MORIN @ 2013-01-30 22:57 UTC (permalink / raw)
  To: buildroot

Thomas, All,

On Wednesday 30 January 2013 Thomas Petazzoni wrote:
> Dear Yann E. MORIN,
> 
> On Wed, 30 Jan 2013 20:23:58 +0100, Yann E. MORIN wrote:
> > In case one uses a custom directory to store all downloaded files
> > (eg. I use "${HOME}/src" so I don't have to download them again and
> > again), this directory gets cluttered with many files that are
> > difficult to link to the package they apply to.
> > 
> > It gets even worse with this change.
> > 
> > What about saving the patches to a file named thus:
> >    $(PKG_NAME)-$(PKG_VERSION)-$(PKG_PATCH_FILENAME).patch
> 
> I am not sure because we don't do this for tarballs: we keep their
> original name. For example Python-3.3.0 even though the package is
> named python3, cJSONFiles.zip even though the package is named cjson,
> etc.
> 
> So either we decide to keep the original name for everything, or we
> decide to use our own name for everything.

So, given two packages, 'foo' and 'bar', what will happen if both have
a patch file named 'mktemp.patch' ?

 1- only one will be downloaded
 2- it will be applied onto both packages

Err... :-(

Regards,
Yann E. MORIN.

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

^ permalink raw reply	[flat|nested] 28+ messages in thread

* [Buildroot] [PATCH] Add support for plain URL in $(PKG)_PATCH variable
  2013-01-30 22:57               ` Yann E. MORIN
@ 2013-01-30 23:04                 ` Jérôme Pouiller
  2013-01-30 23:10                   ` Yann E. MORIN
  0 siblings, 1 reply; 28+ messages in thread
From: Jérôme Pouiller @ 2013-01-30 23:04 UTC (permalink / raw)
  To: buildroot

On Wednesday 30 January 2013 23:57:13 Yann E. MORIN wrote:
> On Wednesday 30 January 2013 Thomas Petazzoni wrote:
[...]
> > > What about saving the patches to a file named thus:
> > >    $(PKG_NAME)-$(PKG_VERSION)-$(PKG_PATCH_FILENAME).patch
> > 
> > I am not sure because we don't do this for tarballs: we keep their
> > original name. For example Python-3.3.0 even though the package is
> > named python3, cJSONFiles.zip even though the package is named cjson,
> > etc.
> > 
> > So either we decide to keep the original name for everything, or we
> > decide to use our own name for everything.
> 
> So, given two packages, 'foo' and 'bar', what will happen if both have
> a patch file named 'mktemp.patch' ?
> 
>  1- only one will be downloaded
>  2- it will be applied onto both packages
And what about
  $(PKG_NAME)-$(PKG_VERSION)/$(PKG_PATCH_FILENAME).patch
?

-- 
J?r?me Pouiller

^ permalink raw reply	[flat|nested] 28+ messages in thread

* [Buildroot] [PATCH] Add support for plain URL in $(PKG)_PATCH variable
  2013-01-30 23:04                 ` Jérôme Pouiller
@ 2013-01-30 23:10                   ` Yann E. MORIN
  0 siblings, 0 replies; 28+ messages in thread
From: Yann E. MORIN @ 2013-01-30 23:10 UTC (permalink / raw)
  To: buildroot

J?r?me, All,

On Thursday 31 January 2013 J?r?me Pouiller wrote:
> On Wednesday 30 January 2013 23:57:13 Yann E. MORIN wrote:
> > So, given two packages, 'foo' and 'bar', what will happen if both have
> > a patch file named 'mktemp.patch' ?
> > 
> >  1- only one will be downloaded
> >  2- it will be applied onto both packages
> And what about
>   $(PKG_NAME)-$(PKG_VERSION)/$(PKG_PATCH_FILENAME).patch

No, we have to keep the patch filename as-is, or apply-patches.sh will
not know it has to uncompress it. So, do not append '.patch' .

Besides, we do not want to create sub-dirs in the DL dir (which can be
a custom dir, as it is in my case).

So, my proposal still stands: ;-)
    $(PKG_NAME)-$(PKG_VERSION)-$(PKG_PATCH_FILENAME)

Regards,
Yann E. MORIN.

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

^ permalink raw reply	[flat|nested] 28+ messages in thread

* [Buildroot] [PATCH] Add support for plain URL in $(PKG)_PATCH variable
  2013-01-30 22:54                 ` Yann E. MORIN
@ 2013-01-30 23:11                   ` Jérôme Pouiller
  2013-01-31  8:18                     ` [Buildroot] [PATCH 1/2] " Jérôme Pouiller
  2013-01-31  8:20                     ` [Buildroot] [PATCH] " Jérôme Pouiller
  0 siblings, 2 replies; 28+ messages in thread
From: Jérôme Pouiller @ 2013-01-30 23:11 UTC (permalink / raw)
  To: buildroot

On Wednesday 30 January 2013 23:54:23 Yann E. MORIN wrote:
> J?r?me, All,
> 
> On Wednesday 30 January 2013 J?r?me Pouiller wrote:
> > Until now, $(PKG)_PATCH allow only to download patches from same URL than
> > tarball. This patch allow to detect when plain URL are used in
> > $(PKG)_PATCH and correctly handle them.
> > 
> > Downloaded patches are named
> > $(PKG_NAME)-$(PKG_VERSION)-$(PKG_PATCH_FILENAME).patch
> Well, I meant: $(PKG_NAME)-$(PKG_VERSION)-$(PKG_PATCH_FILENAME)
> We should keep the original filename (in case it is compresed).
In this case, I think files ending with .diff will not work (and compressed 
patches are not supported without a HOOK).

[...]
> > +			$(call DOWNLOAD,$($(PKG)_SITE)/$(p))\
> 
> The naming should also be applied for the 'plain-file' case, too.
Sure.

[...]
-- 
J?r?me Pouiller

^ permalink raw reply	[flat|nested] 28+ messages in thread

* [Buildroot] [PATCH 1/2] Add support for plain URL in $(PKG)_PATCH variable
  2013-01-30 23:11                   ` Jérôme Pouiller
@ 2013-01-31  8:18                     ` Jérôme Pouiller
  2013-01-31  8:18                       ` [Buildroot] [PATCH 2/2] Add $(PKG_NAME) in name of downloaded patches Jérôme Pouiller
  2013-04-26  6:00                       ` [Buildroot] [PATCH 1/2] " Arnout Vandecappelle
  2013-01-31  8:20                     ` [Buildroot] [PATCH] " Jérôme Pouiller
  1 sibling, 2 replies; 28+ messages in thread
From: Jérôme Pouiller @ 2013-01-31  8:18 UTC (permalink / raw)
  To: buildroot

Until now, $(PKG)_PATCH allow only to download patches from same URL than tarball.
This patch allow to detect when plain URL are used in $(PKG)_PATCH and correctly
handle them.

Signed-off-by: J?r?me Pouiller <jezz@sysmic.org>
---
 package/pkg-generic.mk |    9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/package/pkg-generic.mk b/package/pkg-generic.mk
index b0eca0a..fbc2bb9 100644
--- a/package/pkg-generic.mk
+++ b/package/pkg-generic.mk
@@ -40,7 +40,12 @@ ifeq ($(DL_MODE),DOWNLOAD)
 	fi
 endif
 	$(if $($(PKG)_SOURCE),$(call DOWNLOAD,$($(PKG)_SITE)/$($(PKG)_SOURCE)))
-	$(foreach p,$($(PKG)_PATCH),$(call DOWNLOAD,$($(PKG)_SITE)/$(p))$(sep))
+	$(foreach p,$($(PKG)_PATCH),\
+		$(if $(findstring ://,$(p)),\
+			$(call DOWNLOAD,$(p)),\
+			$(call DOWNLOAD,$($(PKG)_SITE)/$(p))\
+		)\
+	$(sep))
 	$(foreach hook,$($(PKG)_POST_DOWNLOAD_HOOKS),$(call $(hook))$(sep))
 ifeq ($(DL_MODE),DOWNLOAD)
 	$(Q)mkdir -p $(@D)
@@ -85,7 +90,7 @@ $(BUILD_DIR)/%/.stamp_patched: NAMEVER = $(RAWNAME)-$($(PKG)_VERSION)
 $(BUILD_DIR)/%/.stamp_patched:
 	@$(call MESSAGE,"Patching $($(PKG)_DIR_PREFIX)/$(RAWNAME)")
 	$(foreach hook,$($(PKG)_PRE_PATCH_HOOKS),$(call $(hook))$(sep))
-	$(foreach p,$($(PKG)_PATCH),support/scripts/apply-patches.sh $(@D) $(DL_DIR) $(p)$(sep))
+	$(foreach p,$($(PKG)_PATCH),support/scripts/apply-patches.sh $(@D) $(DL_DIR) $(notdir $(p))$(sep))
 	$(Q)( \
 	if test -d $($(PKG)_DIR_PREFIX)/$(RAWNAME); then \
 	  if test "$(wildcard $($(PKG)_DIR_PREFIX)/$(RAWNAME)/$(NAMEVER)*.patch*)"; then \
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [Buildroot] [PATCH 2/2] Add $(PKG_NAME) in name of downloaded patches
  2013-01-31  8:18                     ` [Buildroot] [PATCH 1/2] " Jérôme Pouiller
@ 2013-01-31  8:18                       ` Jérôme Pouiller
  2013-04-26  6:18                         ` Arnout Vandecappelle
  2013-04-26  6:00                       ` [Buildroot] [PATCH 1/2] " Arnout Vandecappelle
  1 sibling, 1 reply; 28+ messages in thread
From: Jérôme Pouiller @ 2013-01-31  8:18 UTC (permalink / raw)
  To: buildroot

Until now, patch was downloaded without be renamed. $(DL_DIR) quickly become a
mess. Downloaded patches are now named
$(PKG_NAME)-$(PKG_VERSION)-$(PKG_PATCH_FILENAME).

Signed-off-by: J?r?me Pouiller <jezz@sysmic.org>
---
 package/pkg-generic.mk |    7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/package/pkg-generic.mk b/package/pkg-generic.mk
index fbc2bb9..f2bf40a 100644
--- a/package/pkg-generic.mk
+++ b/package/pkg-generic.mk
@@ -42,8 +42,8 @@ endif
 	$(if $($(PKG)_SOURCE),$(call DOWNLOAD,$($(PKG)_SITE)/$($(PKG)_SOURCE)))
 	$(foreach p,$($(PKG)_PATCH),\
 		$(if $(findstring ://,$(p)),\
-			$(call DOWNLOAD,$(p)),\
-			$(call DOWNLOAD,$($(PKG)_SITE)/$(p))\
+			$(call DOWNLOAD,$(p),$($(PKG)_NAME)-$($(PKG)_VERSION)-$(notdir $(p))),\
+			$(call DOWNLOAD,$($(PKG)_SITE)/$(p),$($(PKG)_NAME)-$($(PKG)_VERSION)-$(notdir $(p)))\
 		)\
 	$(sep))
 	$(foreach hook,$($(PKG)_POST_DOWNLOAD_HOOKS),$(call $(hook))$(sep))
@@ -90,7 +90,8 @@ $(BUILD_DIR)/%/.stamp_patched: NAMEVER = $(RAWNAME)-$($(PKG)_VERSION)
 $(BUILD_DIR)/%/.stamp_patched:
 	@$(call MESSAGE,"Patching $($(PKG)_DIR_PREFIX)/$(RAWNAME)")
 	$(foreach hook,$($(PKG)_PRE_PATCH_HOOKS),$(call $(hook))$(sep))
-	$(foreach p,$($(PKG)_PATCH),support/scripts/apply-patches.sh $(@D) $(DL_DIR) $(notdir $(p))$(sep))
+	$(foreach p,$($(PKG)_PATCH),\
+	  support/scripts/apply-patches.sh $(@D) $(DL_DIR) $($(PKG)_NAME)-$($(PKG)_VERSION)-$(notdir $(p))$(sep))
 	$(Q)( \
 	if test -d $($(PKG)_DIR_PREFIX)/$(RAWNAME); then \
 	  if test "$(wildcard $($(PKG)_DIR_PREFIX)/$(RAWNAME)/$(NAMEVER)*.patch*)"; then \
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [Buildroot] [PATCH] Add support for plain URL in $(PKG)_PATCH variable
  2013-01-30 23:11                   ` Jérôme Pouiller
  2013-01-31  8:18                     ` [Buildroot] [PATCH 1/2] " Jérôme Pouiller
@ 2013-01-31  8:20                     ` Jérôme Pouiller
  1 sibling, 0 replies; 28+ messages in thread
From: Jérôme Pouiller @ 2013-01-31  8:20 UTC (permalink / raw)
  To: buildroot

On Thursday 31 January 2013 00:11:08 J?r?me Pouiller wrote:
> On Wednesday 30 January 2013 23:54:23 Yann E. MORIN wrote:
> > J?r?me, All,
> > 
> > On Wednesday 30 January 2013 J?r?me Pouiller wrote:
> > > Until now, $(PKG)_PATCH allow only to download patches from same URL
> > > than
> > > tarball. This patch allow to detect when plain URL are used in
> > > $(PKG)_PATCH and correctly handle them.
> > > 
> > > Downloaded patches are named
> > > $(PKG_NAME)-$(PKG_VERSION)-$(PKG_PATCH_FILENAME).patch
> > 
> > Well, I meant: $(PKG_NAME)-$(PKG_VERSION)-$(PKG_PATCH_FILENAME)
> > We should keep the original filename (in case it is compresed).
> 
> In this case, I think files ending with .diff will not work (and compressed
> patches are not supported without a HOOK).
Forget this comment, I was tired.

-- 
J?r?me Pouiller, Sysmic
Embedded Linux specialist
http://www.sysmic.fr

^ permalink raw reply	[flat|nested] 28+ messages in thread

* [Buildroot] [PATCH 1/2] Add support for plain URL in $(PKG)_PATCH variable
  2013-01-31  8:18                     ` [Buildroot] [PATCH 1/2] " Jérôme Pouiller
  2013-01-31  8:18                       ` [Buildroot] [PATCH 2/2] Add $(PKG_NAME) in name of downloaded patches Jérôme Pouiller
@ 2013-04-26  6:00                       ` Arnout Vandecappelle
  1 sibling, 0 replies; 28+ messages in thread
From: Arnout Vandecappelle @ 2013-04-26  6:00 UTC (permalink / raw)
  To: buildroot

On 31/01/13 09:18, J?r?me Pouiller wrote:
> Until now, $(PKG)_PATCH allow only to download patches from same URL than tarball.
> This patch allow to detect when plain URL are used in $(PKG)_PATCH and correctly
> handle them.
>
> Signed-off-by: J?r?me Pouiller <jezz@sysmic.org>

Acked-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>

  (untested but it's pretty obvious that the current packages won't break).


> ---
>   package/pkg-generic.mk |    9 +++++++--
>   1 file changed, 7 insertions(+), 2 deletions(-)
>
> diff --git a/package/pkg-generic.mk b/package/pkg-generic.mk
> index b0eca0a..fbc2bb9 100644
> --- a/package/pkg-generic.mk
> +++ b/package/pkg-generic.mk
> @@ -40,7 +40,12 @@ ifeq ($(DL_MODE),DOWNLOAD)
>   	fi
>   endif
>   	$(if $($(PKG)_SOURCE),$(call DOWNLOAD,$($(PKG)_SITE)/$($(PKG)_SOURCE)))
> -	$(foreach p,$($(PKG)_PATCH),$(call DOWNLOAD,$($(PKG)_SITE)/$(p))$(sep))
> +	$(foreach p,$($(PKG)_PATCH),\
> +		$(if $(findstring ://,$(p)),\
> +			$(call DOWNLOAD,$(p)),\
> +			$(call DOWNLOAD,$($(PKG)_SITE)/$(p))\

  I would have put the condition inside the DOWNLOAD call, even though 
that's a bit less efficient. But I guess it's just a matter of taste.

  Regards,
  Arnout

> +		)\
> +	$(sep))
>   	$(foreach hook,$($(PKG)_POST_DOWNLOAD_HOOKS),$(call $(hook))$(sep))
>   ifeq ($(DL_MODE),DOWNLOAD)
>   	$(Q)mkdir -p $(@D)
> @@ -85,7 +90,7 @@ $(BUILD_DIR)/%/.stamp_patched: NAMEVER = $(RAWNAME)-$($(PKG)_VERSION)
>   $(BUILD_DIR)/%/.stamp_patched:
>   	@$(call MESSAGE,"Patching $($(PKG)_DIR_PREFIX)/$(RAWNAME)")
>   	$(foreach hook,$($(PKG)_PRE_PATCH_HOOKS),$(call $(hook))$(sep))
> -	$(foreach p,$($(PKG)_PATCH),support/scripts/apply-patches.sh $(@D) $(DL_DIR) $(p)$(sep))
> +	$(foreach p,$($(PKG)_PATCH),support/scripts/apply-patches.sh $(@D) $(DL_DIR) $(notdir $(p))$(sep))
>   	$(Q)( \
>   	if test -d $($(PKG)_DIR_PREFIX)/$(RAWNAME); then \
>   	  if test "$(wildcard $($(PKG)_DIR_PREFIX)/$(RAWNAME)/$(NAMEVER)*.patch*)"; then \
>


-- 
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F

^ permalink raw reply	[flat|nested] 28+ messages in thread

* [Buildroot] [PATCH 2/2] Add $(PKG_NAME) in name of downloaded patches
  2013-01-31  8:18                       ` [Buildroot] [PATCH 2/2] Add $(PKG_NAME) in name of downloaded patches Jérôme Pouiller
@ 2013-04-26  6:18                         ` Arnout Vandecappelle
  2013-05-13 15:51                           ` [Buildroot] [PATCH v2] Add support for plain URL in $(PKG)_PATCH variable Jérôme Pouiller
  0 siblings, 1 reply; 28+ messages in thread
From: Arnout Vandecappelle @ 2013-04-26  6:18 UTC (permalink / raw)
  To: buildroot

On 31/01/13 09:18, J?r?me Pouiller wrote:
> Until now, patch was downloaded without be renamed. $(DL_DIR) quickly become a
> mess.

  Not really... There is just a chance that the patch isn't named 
according to the package name, which could lead to conflicts between 
patch names. But currently there is not a single patch for which the 
patch name differs from the archive name.

> Downloaded patches are now named
> $(PKG_NAME)-$(PKG_VERSION)-$(PKG_PATCH_FILENAME).

  How about adding a new function, CLEAN_DOWNLOAD_NAME, that does

$($(PKG)_NAME)-$($(PKG)_VERSION)-$(patsubst \
   $($(PKG)_VERSION)-%,%,$(patsubst $($(PKG)_NAME)-%,%,$(1)))

  so that the names don't get too long in the usual case?

  The same could also be applied to the package archives.

  But really I think it's making things more complex without being 
necessary in practice. I don't expect this situation of conflicting names 
is likely to occur.

  Regards,
  Arnout

>
> Signed-off-by: J?r?me Pouiller <jezz@sysmic.org>
> ---
>   package/pkg-generic.mk |    7 ++++---
>   1 file changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/package/pkg-generic.mk b/package/pkg-generic.mk
> index fbc2bb9..f2bf40a 100644
> --- a/package/pkg-generic.mk
> +++ b/package/pkg-generic.mk
> @@ -42,8 +42,8 @@ endif
>   	$(if $($(PKG)_SOURCE),$(call DOWNLOAD,$($(PKG)_SITE)/$($(PKG)_SOURCE)))
>   	$(foreach p,$($(PKG)_PATCH),\
>   		$(if $(findstring ://,$(p)),\
> -			$(call DOWNLOAD,$(p)),\
> -			$(call DOWNLOAD,$($(PKG)_SITE)/$(p))\
> +			$(call DOWNLOAD,$(p),$($(PKG)_NAME)-$($(PKG)_VERSION)-$(notdir $(p))),\
> +			$(call DOWNLOAD,$($(PKG)_SITE)/$(p),$($(PKG)_NAME)-$($(PKG)_VERSION)-$(notdir $(p)))\
>   		)\
>   	$(sep))
>   	$(foreach hook,$($(PKG)_POST_DOWNLOAD_HOOKS),$(call $(hook))$(sep))
> @@ -90,7 +90,8 @@ $(BUILD_DIR)/%/.stamp_patched: NAMEVER = $(RAWNAME)-$($(PKG)_VERSION)
>   $(BUILD_DIR)/%/.stamp_patched:
>   	@$(call MESSAGE,"Patching $($(PKG)_DIR_PREFIX)/$(RAWNAME)")
>   	$(foreach hook,$($(PKG)_PRE_PATCH_HOOKS),$(call $(hook))$(sep))
> -	$(foreach p,$($(PKG)_PATCH),support/scripts/apply-patches.sh $(@D) $(DL_DIR) $(notdir $(p))$(sep))
> +	$(foreach p,$($(PKG)_PATCH),\
> +	  support/scripts/apply-patches.sh $(@D) $(DL_DIR) $($(PKG)_NAME)-$($(PKG)_VERSION)-$(notdir $(p))$(sep))
>   	$(Q)( \
>   	if test -d $($(PKG)_DIR_PREFIX)/$(RAWNAME); then \
>   	  if test "$(wildcard $($(PKG)_DIR_PREFIX)/$(RAWNAME)/$(NAMEVER)*.patch*)"; then \
>


-- 
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F

^ permalink raw reply	[flat|nested] 28+ messages in thread

* [Buildroot] [PATCH v2] Add support for plain URL in $(PKG)_PATCH variable
  2013-04-26  6:18                         ` Arnout Vandecappelle
@ 2013-05-13 15:51                           ` Jérôme Pouiller
  2013-05-13 20:59                             ` Yann E. MORIN
  2013-09-07  6:12                             ` Peter Korsgaard
  0 siblings, 2 replies; 28+ messages in thread
From: Jérôme Pouiller @ 2013-05-13 15:51 UTC (permalink / raw)
  To: buildroot

Until now, $(PKG)_PATCH allow only to download patches from same URL than tarball.
This patch allow to detect when plain URL are used in $(PKG)_PATCH and correctly
handle them.

Signed-off-by: J?r?me Pouiller <jezz@sysmic.org>

---
v2: 
  - Rebase to apply to HEAD
  - Drop patch called "Add $(PKG_NAME) in name of downloaded patches" since I am
    not personally convinced of its usefulness

---
 package/pkg-generic.mk |    9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/package/pkg-generic.mk b/package/pkg-generic.mk
index d25797c..db34c13 100644
--- a/package/pkg-generic.mk
+++ b/package/pkg-generic.mk
@@ -40,7 +40,12 @@ ifeq ($(DL_MODE),DOWNLOAD)
 	fi
 endif
 	$(if $($(PKG)_SOURCE),$(call DOWNLOAD,$($(PKG)_SITE:/=)/$($(PKG)_SOURCE)))
-	$(foreach p,$($(PKG)_PATCH),$(call DOWNLOAD,$($(PKG)_SITE:/=)/$(p))$(sep))
+	$(foreach p,$($(PKG)_PATCH),\
+		$(if $(findstring ://,$(p)),\
+			$(call DOWNLOAD,$(p)),\
+			$(call DOWNLOAD,$($(PKG)_SITE:/=)/$(p))\
+		)\
+	$(sep))
 	$(foreach hook,$($(PKG)_POST_DOWNLOAD_HOOKS),$(call $(hook))$(sep))
 ifeq ($(DL_MODE),DOWNLOAD)
 	$(Q)mkdir -p $(@D)
@@ -86,7 +91,7 @@ $(BUILD_DIR)/%/.stamp_patched: PATCH_BASE_DIRS = $($(PKG)_DIR_PREFIX)/$(RAWNAME)
 $(BUILD_DIR)/%/.stamp_patched:
 	@$(call MESSAGE,"Patching $($(PKG)_DIR_PREFIX)/$(RAWNAME)")
 	$(foreach hook,$($(PKG)_PRE_PATCH_HOOKS),$(call $(hook))$(sep))
-	$(foreach p,$($(PKG)_PATCH),support/scripts/apply-patches.sh $(@D) $(DL_DIR) $(p)$(sep))
+	$(foreach p,$($(PKG)_PATCH),support/scripts/apply-patches.sh $(@D) $(DL_DIR) $(notdir $(p))$(sep))
 	$(Q)( \
 	for D in $(PATCH_BASE_DIRS); do \
 	  if test -d $${D}; then \
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [Buildroot] [PATCH v2] Add support for plain URL in $(PKG)_PATCH variable
  2013-05-13 15:51                           ` [Buildroot] [PATCH v2] Add support for plain URL in $(PKG)_PATCH variable Jérôme Pouiller
@ 2013-05-13 20:59                             ` Yann E. MORIN
  2013-05-14  9:51                               ` Markos Chandras
  2013-09-07  6:12                             ` Peter Korsgaard
  1 sibling, 1 reply; 28+ messages in thread
From: Yann E. MORIN @ 2013-05-13 20:59 UTC (permalink / raw)
  To: buildroot

J?r?me, All,

On 2013-05-13 17:51 +0200, J?r?me Pouiller spake thusly:
> Until now, $(PKG)_PATCH allow only to download patches from same URL than tarball.
> This patch allow to detect when plain URL are used in $(PKG)_PATCH and correctly
> handle them.
> 
> Signed-off-by: J?r?me Pouiller <jezz@sysmic.org>

Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr>

Regards,
Yann E. MORIN.

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

^ permalink raw reply	[flat|nested] 28+ messages in thread

* [Buildroot] [PATCH v2] Add support for plain URL in $(PKG)_PATCH variable
  2013-05-13 20:59                             ` Yann E. MORIN
@ 2013-05-14  9:51                               ` Markos Chandras
  0 siblings, 0 replies; 28+ messages in thread
From: Markos Chandras @ 2013-05-14  9:51 UTC (permalink / raw)
  To: buildroot

On 13 May 2013 21:59, Yann E. MORIN <yann.morin.1998@free.fr> wrote:
> J?r?me, All,
>
> On 2013-05-13 17:51 +0200, J?r?me Pouiller spake thusly:
>> Until now, $(PKG)_PATCH allow only to download patches from same URL than tarball.
>> This patch allow to detect when plain URL are used in $(PKG)_PATCH and correctly
>> handle them.
>>
>> Signed-off-by: J?r?me Pouiller <jezz@sysmic.org>
>
> Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
>

The patch looks good to me.

Reviewed-by: Markos Chandras <markos.chandras@imgtec.com>

--
Regards,
Markos Chandras

^ permalink raw reply	[flat|nested] 28+ messages in thread

* [Buildroot] need help adding apache to buildroot
  2013-01-16 21:30 [Buildroot] need help adding apache to buildroot Jenkins, Lee
  2013-01-16 21:35 ` Gustavo Zacarias
  2013-01-16 21:54 ` [Buildroot] need help adding apache to buildroot Thomas Petazzoni
@ 2013-07-07 14:16 ` Stephan Hoffmann
  2013-07-18 16:46   ` Jenkins, Lee
  2 siblings, 1 reply; 28+ messages in thread
From: Stephan Hoffmann @ 2013-07-07 14:16 UTC (permalink / raw)
  To: buildroot

Am 16.01.2013 22:30, schrieb Jenkins, Lee (ISS Houston):
>
> Hello. I'm adding apache httpd to my buildroot project but I'm stuck
> and need some help.
>
Hello Lee,

did you finally manage to build apache? If yes, could you provide a patch?

Kind Regards

Stephan
>
>  
>
> Here's what I've done so far:
>
>  
>
> 1.       created a directory buildroot/package/apache
>
> 2.       created buildroot/package/apache/Config.in (see below)
>
> 3.       as a starting point, downloaded the panda-buildroot apache.mk
> (see below)  to buildroot/package/apache
>
> 4.       added a line <<source "package/apache/Config.in">> to
> buildroot/package/Config.in under "Networking applications"
>
> 5.       ran "make menuconfig", selected "apache" in "Package
> Selection" > "Networking applications", saved & exited
>
> 6.       ran "make" and expected httpd to be built and show up in my
> rootfs target. It was not there.
>
> 7.       ran "make apache-source" as a test, but make replies: "No
> rule to make target `apache-source'. Stop."
>
>  
>
> I expected make to pick up the new package, but that's clearly not
> happening. What am I missing?
>
>  
>
> Lee Jenkins
>
>  
>
>  
>
> ----- buildroot/package/apache/Config.in -----
>
>  
>
> config BR2_PACKAGE_APACHE
>
>      bool "apache"
>
>      help
>
>        Apache web server software
>
>  
>
> ----- buildroot/package/apache/apache.mk -----
>
>  
>
> #############################################################
>
> #
>
> # apache
>
> #
>
> #############################################################
>
> APACHE_VERSION    = 2.2.19
>
> #APACHE_SITE       = http://mir2.ovh.net/ftp.apache.org/dist/httpd/
>
> APACHE_SITE       = http://archive.apache.org/dist/httpd/
>
> APACHE_SOURCE = httpd-$(APACHE_VERSION).tar.bz2
>
> APACHE_INSTALL_STAGING = YES
>
> APACHE_INSTALL_TARGET = YES
>
> APACHE_AUTORECONF = YES
>
>  
>
> APACHE_CONF_ENV += \
>
>         ac_cv_file__dev_zero=yes \
>
>         ac_cv_func_setpgrp_void=yes \
>
>         apr_cv_tcp_nodelay_with_cork=yes \
>
>         ac_cv_sizeof_struct_iovec=8 \
>
>         apr_cv_process_shared_works=yes \
>
>         apr_cv_mutex_robust_shared=no \
>
>         ac_cv_struct_rlimit=yes \
>
>         ap_cv_void_ptr_lt_long=no \
>
>         CC="$(TARGET_CC)" \
>
>         CFLAGS="$(TARGET_CFLAGS)" \
>
>         LDFLAGS="$(TARGET_LDFLAGS)" \
>
>  
>
> APACHE_CONF_OPT += \
>
>         --host="$(REAL_GNU_TARGET_NAME)" \
>
>         --prefix="/apacheSW/" \
>
>         --enable-so \
>
>         --enable-module=all
>
>  
>
>  
>
>        
>
>                 
>
>                 
>
> define APACHE_CONFIGURE_CMDS
>
>         (cd $(@D) && rm -rf config.cache; \
>
>                 $(APACHE_CONF_ENV) \
>
>                 ./configure \
>
>                 $(APACHE_CONF_OPT) \
>
>         )
>
> endef
>
> define ADD_INIT_SCRIPT
>
>  
>
> $(INSTALL) -m 0755 -D
> $(APACHE_DIR_PREFIX)/$(APACHE_NAME)/Apache_InitScript \
>
>         $(TARGET_DIR)/etc/init.d/S90Apache;
>
> endef
>
> APACHE_POST_INSTALL_STAGING_HOOKS += ADD_INIT_SCRIPT
>
>  
>
>  
>
> $(eval $(call AUTOTARGETS))
>
>  
>
>  
>
>  
>
>
>
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20130707/614c5484/attachment-0001.html>

^ permalink raw reply	[flat|nested] 28+ messages in thread

* [Buildroot] need help adding apache to buildroot
  2013-07-07 14:16 ` Stephan Hoffmann
@ 2013-07-18 16:46   ` Jenkins, Lee
  0 siblings, 0 replies; 28+ messages in thread
From: Jenkins, Lee @ 2013-07-18 16:46 UTC (permalink / raw)
  To: buildroot

On Sunday, July 07, 2013 9:16 AM, Stephan Hoffmann wrote:
> Hello Lee,
>
> did you finally manage to build apache? If yes, could you provide a patch?
>
> Kind Regards
>
> Stephan

Stephan,

I did. It's a bit of a hack. Understatement, let me try again. It's a huge hack.

Some parts of buildroot are still pretty opaque to me and unfortunately I don't really have to the time to figure out how to make a proper patch.

I also had trouble with the patch command not recursing sub-directories. The diff file appeared to have the proper paths, but I'm obviously missing something.

Anyway, what I have works, but it clearly needs cleaning up before adding to buildroot and I just don't have the time to do it.

If anyone cares to try, I've included the makefile, Config, and startup script, plus the original patch/diff file and the break-out files that are called out in apache.mk.

Hopefully someone else with a little more expertise with buildroot and patch can clean these up for everyone else's benefit.

grace & peace,
Lee Jenkins

==========[ apache.mk ]==========

#############################################################
#
# apache
#
#############################################################

APACHE_VERSION    = 2.2.23
APACHE_SITE       = http://archive.apache.org/dist/httpd/
APACHE_SOURCE = httpd-$(APACHE_VERSION).tar.bz2
APACHE_INSTALL_STAGING = YES
APACHE_PACKAGE_DIR=$(@D)/../../../package/apache

APACHE_CONF_ENV += \
        ac_cv_file__dev_zero=yes \
        ac_cv_func_setpgrp_void=yes \
        apr_cv_tcp_nodelay_with_cork=yes \
        ac_cv_sizeof_struct_iovec=8 \
        apr_cv_process_shared_works=yes \
        apr_cv_mutex_robust_shared=no \
        ac_cv_struct_rlimit=yes \
        ap_cv_void_ptr_lt_long=no \
        CC=/opt/Marvell_toolchain_201201/armv7-marvell-linux-gnueabi-softfp_i686/bin/arm-marvell-linux-gnueabi-gcc

APACHE_CONF_OPT += \
        --build=i686-pc-linux-gnu \
        --host=arm-marvell-linux-gnueabi \
        --enable-so \
        --enable-module=all

# the stock apache package provides two cross-compile options --host and
# --build that get passed into configure to allow make to distinguish between
# the build machine and the target machine, but they don't work as advertised.
#      http://www.devshed.com/c/a/Apache/Building-Apache-the-Way-You-Want-It/10/
# luckily, I found a patch that allows apache to be built using an additional
# variable CC_FOR_BUILD that fixes this problem. the patch was downloaded from
#      http://people.apache.org/~fuankg/diffs/httpd-2.2.x-cross_compile.diff
# strangely, the patch utility on my build machine would not apply patches
# to files in sub-directories. therefore I've divided the patch diff into
# parts for each directory and applied the patches separately.
# also, I tried using the patch hooks, but it appears that X_PRE_PATCH_HOOKS
# is only executing if X_PATCH is defined -- and X_PATCH requires the patch
# to be located at X_SITE and this patch is not located at the same site
# as the apache package. ugh. so the files get patched as the first step in
# the configure process below.

define APACHE_CONFIGURE_CMDS
    ( cd $(@D); ./buildconf )
        ( cd $(@D); patch -i $(APACHE_PACKAGE_DIR)/httpd-2.2.x-cross_compile-apache-root.diff )
        ( cd $(@D)/server; patch -i $(APACHE_PACKAGE_DIR)/httpd-2.2.x-cross_compile-apache-root-server.diff )
        ( cd $(@D)/srclib/pcre; patch -i $(APACHE_PACKAGE_DIR)/httpd-2.2.x-cross_compile-apache-root-srclib-pcre.diff )
        ( cd $(@D) && rm -rf config.cache; \
    $(APACHE_CONF_ENV) \
    ./configure \
    $(APACHE_CONF_OPT) \
    )
endef

APACHE_MAKE_ENV += \
    CC_FOR_BUILD=cc \
    CFLAGS_FOR_BUILD=

define APACHE_INSTALL_INIT_SCRIPT

    $(INSTALL) -m 0755 package/apache/S50apache $(TARGET_DIR)/etc/init.d/S50apache

endef

APACHE_POST_INSTALL_TARGET_HOOKS += APACHE_INSTALL_INIT_SCRIPT

$(eval $(call AUTOTARGETS,package,apache))

==========[ Config.in ]==========

config BR2_PACKAGE_APACHE
    bool "apache"
    help
      Apache web server software.

      http://httpd.apache.org/

==========[ S50apache ]==========

#!/bin/sh
#
# Start the network....
#

APACHE_DIR=/usr/local/apache2/bin

case "$1" in
  start)
    echo "Starting apache web server..."
    $APACHE_DIR/apachectl -k start
    ;;
  stop)
    echo -n "Stopping apache web server..."
    $APACHE_DIR/apachectl -k stop
    ;;
  restart|reload)
    $APACHE_DIR/apachectl -k stop
    $APACHE_DIR/apachectl -k start
    ;;
  *)
    echo $"Usage: $0 {start|stop|restart}"
    exit 1
esac

exit $?

==========[  httpd-2.2.x-cross_compile-apache-root.diff  ]==========

Index: configure.in
===================================================================
--- configure.in    (revision 1328718)
+++ configure.in    (working copy)
@@ -154,6 +154,14 @@
AC_PROG_CC
AC_PROG_CPP
+dnl In case of cross compilation we set CC_FOR_BUILD to cc unless
+dnl we got already CC_FOR_BUILD from environment.
+if test "x${build_alias}" != "x${host_alias}"; then
+  if test "x${CC_FOR_BUILD}" = "x"; then
+    CC_FOR_BUILD=cc
+  fi
+fi
+
if test "x${cache_file}" = "x/dev/null"; then
   # Likewise, ensure that CC and CPP are passed through to the pcre
   # configure script iff caching is disabled (the autoconf 2.5x default).
Index: acinclude.m4
===================================================================
--- acinclude.m4    (revision 1328718)
+++ acinclude.m4    (working copy)
@@ -53,6 +53,8 @@
   APACHE_SUBST(CPPFLAGS)
   APACHE_SUBST(CFLAGS)
   APACHE_SUBST(CXXFLAGS)
+  APACHE_SUBST(CC_FOR_BUILD)
+  APACHE_SUBST(CFLAGS_FOR_BUILD)
   APACHE_SUBST(LTFLAGS)
   APACHE_SUBST(LDFLAGS)
   APACHE_SUBST(LT_LDFLAGS)
@@ -568,7 +570,7 @@
{
     return sizeof(void *) < sizeof(long);
 }], [ap_cv_void_ptr_lt_long=no], [ap_cv_void_ptr_lt_long=yes],
-    [ap_cv_void_ptr_lt_long=yes])])
+    [ap_cv_void_ptr_lt_long="cross compile - not checked"])])
 if test "$ap_cv_void_ptr_lt_long" = "yes"; then
     AC_MSG_ERROR([Size of "void *" is less than size of "long"])

==========[  httpd-2.2.x-cross_compile-apache-root-server.diff  ]==========

Index: server/Makefile.in
===================================================================
--- server/Makefile.in  (revision 1328718)
+++ server/Makefile.in  (working copy)
@@ -21,9 +21,14 @@
include $(top_builddir)/build/rules.mk
include $(top_srcdir)/build/library.mk
+ifdef CC_FOR_BUILD
+gen_test_char: gen_test_char.c
+   $(CC_FOR_BUILD) $(CFLAGS_FOR_BUILD) -DCROSS_COMPILE -o $@ $<
+else
gen_test_char_OBJECTS = gen_test_char.lo
gen_test_char: $(gen_test_char_OBJECTS)
    $(LINK) $(EXTRA_LDFLAGS) $(gen_test_char_OBJECTS) $(EXTRA_LIBS)
+endif
 test_char.h: gen_test_char
    ./gen_test_char > test_char.h


==========[  httpd-2.2.x-cross_compile.diff  ]==========

Index: srclib/pcre/Makefile.in
===================================================================
--- srclib/pcre/Makefile.in (revision 1328718)
+++ srclib/pcre/Makefile.in (working copy)
@@ -11,8 +11,13 @@
 $(LTLIBRARY_OBJECTS) dftables.lo: config.h
+ifdef CC_FOR_BUILD
+dftables: dftables.c
+   $(CC_FOR_BUILD) $(CFLAGS_FOR_BUILD) -o $@ $<
+else
dftables: dftables.lo
    $(LINK) $(EXTRA_LDFLAGS) dftables.lo $(EXTRA_LIBS)
+endif
 $(srcdir)/chartables.c: dftables
    ./dftables $@


==========[  httpd-2.2.x-cross_compile-apache-root-srclib-pcre.diff  ]==========

Index: server/Makefile.in
===================================================================
--- server/Makefile.in  (revision 1328718)
+++ server/Makefile.in  (working copy)
@@ -21,9 +21,14 @@
include $(top_builddir)/build/rules.mk
include $(top_srcdir)/build/library.mk
+ifdef CC_FOR_BUILD
+gen_test_char: gen_test_char.c
+   $(CC_FOR_BUILD) $(CFLAGS_FOR_BUILD) -DCROSS_COMPILE -o $@ $<
+else
gen_test_char_OBJECTS = gen_test_char.lo
gen_test_char: $(gen_test_char_OBJECTS)
    $(LINK) $(EXTRA_LDFLAGS) $(gen_test_char_OBJECTS) $(EXTRA_LIBS)
+endif
 test_char.h: gen_test_char
    ./gen_test_char > test_char.h
Index: srclib/pcre/Makefile.in
===================================================================
--- srclib/pcre/Makefile.in (revision 1328718)
+++ srclib/pcre/Makefile.in (working copy)
@@ -11,8 +11,13 @@
 $(LTLIBRARY_OBJECTS) dftables.lo: config.h
+ifdef CC_FOR_BUILD
+dftables: dftables.c
+   $(CC_FOR_BUILD) $(CFLAGS_FOR_BUILD) -o $@ $<
+else
dftables: dftables.lo
    $(LINK) $(EXTRA_LDFLAGS) dftables.lo $(EXTRA_LIBS)
+endif
 $(srcdir)/chartables.c: dftables
    ./dftables $@
Index: configure.in
===================================================================
--- configure.in    (revision 1328718)
+++ configure.in    (working copy)
@@ -154,6 +154,14 @@
AC_PROG_CC
AC_PROG_CPP
+dnl In case of cross compilation we set CC_FOR_BUILD to cc unless
+dnl we got already CC_FOR_BUILD from environment.
+if test "x${build_alias}" != "x${host_alias}"; then
+  if test "x${CC_FOR_BUILD}" = "x"; then
+    CC_FOR_BUILD=cc
+  fi
+fi
+
if test "x${cache_file}" = "x/dev/null"; then
   # Likewise, ensure that CC and CPP are passed through to the pcre
   # configure script iff caching is disabled (the autoconf 2.5x default).
Index: acinclude.m4
===================================================================
--- acinclude.m4    (revision 1328718)
+++ acinclude.m4    (working copy)
@@ -53,6 +53,8 @@
   APACHE_SUBST(CPPFLAGS)
   APACHE_SUBST(CFLAGS)
   APACHE_SUBST(CXXFLAGS)
+  APACHE_SUBST(CC_FOR_BUILD)
+  APACHE_SUBST(CFLAGS_FOR_BUILD)
   APACHE_SUBST(LTFLAGS)
   APACHE_SUBST(LDFLAGS)
   APACHE_SUBST(LT_LDFLAGS)
@@ -568,7 +570,7 @@
{
     return sizeof(void *) < sizeof(long);
 }], [ap_cv_void_ptr_lt_long=no], [ap_cv_void_ptr_lt_long=yes],
-    [ap_cv_void_ptr_lt_long=yes])])
+    [ap_cv_void_ptr_lt_long="cross compile - not checked"])])
 if test "$ap_cv_void_ptr_lt_long" = "yes"; then
     AC_MSG_ERROR([Size of "void *" is less than size of "long"])

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20130718/b1ff1e0b/attachment-0001.html>

^ permalink raw reply	[flat|nested] 28+ messages in thread

* [Buildroot] [PATCH v2] Add support for plain URL in $(PKG)_PATCH variable
  2013-05-13 15:51                           ` [Buildroot] [PATCH v2] Add support for plain URL in $(PKG)_PATCH variable Jérôme Pouiller
  2013-05-13 20:59                             ` Yann E. MORIN
@ 2013-09-07  6:12                             ` Peter Korsgaard
  1 sibling, 0 replies; 28+ messages in thread
From: Peter Korsgaard @ 2013-09-07  6:12 UTC (permalink / raw)
  To: buildroot

>>>>> "J?r?me" == J?r?me Pouiller <jezz@sysmic.org> writes:

 J?r?me> Until now, $(PKG)_PATCH allow only to download patches from same URL than tarball.
 J?r?me> This patch allow to detect when plain URL are used in $(PKG)_PATCH and correctly
 J?r?me> handle them.

 J?r?me> Signed-off-by: J?r?me Pouiller <jezz@sysmic.org>

 J?r?me> ---
 J?r?me> v2: 
 J?r?me>   - Rebase to apply to HEAD
 J?r?me>   - Drop patch called "Add $(PKG_NAME) in name of downloaded patches" since I am
 J?r?me>     not personally convinced of its usefulness

Committed, thanks.

-- 
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 28+ messages in thread

end of thread, other threads:[~2013-09-07  6:12 UTC | newest]

Thread overview: 28+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-01-16 21:30 [Buildroot] need help adding apache to buildroot Jenkins, Lee
2013-01-16 21:35 ` Gustavo Zacarias
2013-01-17 22:41   ` Jenkins, Lee
2013-01-18  9:25     ` Jérôme Pouiller
2013-01-18 15:31       ` Thomas Petazzoni
2013-01-18 16:11         ` [Buildroot] [PATCH] Add support for plain URL in $(PKG)_PATCH variable Jérôme Pouiller
2013-01-30 18:59           ` Yann E. MORIN
2013-01-30 19:23           ` Yann E. MORIN
2013-01-30 22:37             ` Jérôme Pouiller
2013-01-30 22:37               ` Jérôme Pouiller
2013-01-30 22:54                 ` Yann E. MORIN
2013-01-30 23:11                   ` Jérôme Pouiller
2013-01-31  8:18                     ` [Buildroot] [PATCH 1/2] " Jérôme Pouiller
2013-01-31  8:18                       ` [Buildroot] [PATCH 2/2] Add $(PKG_NAME) in name of downloaded patches Jérôme Pouiller
2013-04-26  6:18                         ` Arnout Vandecappelle
2013-05-13 15:51                           ` [Buildroot] [PATCH v2] Add support for plain URL in $(PKG)_PATCH variable Jérôme Pouiller
2013-05-13 20:59                             ` Yann E. MORIN
2013-05-14  9:51                               ` Markos Chandras
2013-09-07  6:12                             ` Peter Korsgaard
2013-04-26  6:00                       ` [Buildroot] [PATCH 1/2] " Arnout Vandecappelle
2013-01-31  8:20                     ` [Buildroot] [PATCH] " Jérôme Pouiller
2013-01-30 22:50             ` Thomas Petazzoni
2013-01-30 22:57               ` Yann E. MORIN
2013-01-30 23:04                 ` Jérôme Pouiller
2013-01-30 23:10                   ` Yann E. MORIN
2013-01-16 21:54 ` [Buildroot] need help adding apache to buildroot Thomas Petazzoni
2013-07-07 14:16 ` Stephan Hoffmann
2013-07-18 16:46   ` Jenkins, Lee

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.