mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
* [ptxdist] [PATCH] Fix usage of fakeroot on Darwin
@ 2012-01-16 20:30 Bernhard Walle
  2012-01-19 19:55 ` Michael Olbrich
  0 siblings, 1 reply; 5+ messages in thread
From: Bernhard Walle @ 2012-01-16 20:30 UTC (permalink / raw)
  To: ptxdist

The extension of shared libraries on Darwin is .dylib, not .so. While
the fakeroot script itself (which is part of the fakeroot distribution)
can handle Darwin, ptxdist calls 'fakeroot' with the '-l' parameter and
directly provides the full path to the shared library which is
pre-loaded.

This patch adds a simple check, explicitly checking for Darwin in the
'uname -s' output. Verified to fix the build on Mac OS 10.7 (Lion).

Signed-off-by: Bernhard Walle <bernhard@bwalle.de>
---
 rules/pre/Rules.make |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/rules/pre/Rules.make b/rules/pre/Rules.make
index c531a50..32c198b 100644
--- a/rules/pre/Rules.make
+++ b/rules/pre/Rules.make
@@ -13,7 +13,14 @@ GNU_BUILD	:= $(shell $(SCRIPTSDIR)/autoconf/config.guess)
 GNU_HOST	:= $(shell echo $(GNU_BUILD) | sed s/-[a-zA-Z0-9_]*-/-host-/)
 
 INSTALL		:= install
-FAKEROOT	:= $(PTXDIST_SYSROOT_HOST)/bin/fakeroot -l $(PTXDIST_SYSROOT_HOST)/lib/libfakeroot.so
+
+ifeq ($(shell uname -s),Darwin)
+SHLIB_SUFFIX	:= dylib
+else
+SHLIB_SUFFIX	:= so
+endif
+
+FAKEROOT	:= $(PTXDIST_SYSROOT_HOST)/bin/fakeroot -l $(PTXDIST_SYSROOT_HOST)/lib/libfakeroot.$(SHLIB_SUFFIX)
 
 CHECK_PIPE_STATUS := \
 	for i in  "$${PIPESTATUS[@]}"; do [ $$i -gt 0 ] && {			\
-- 
1.7.7.4


-- 
ptxdist mailing list
ptxdist@pengutronix.de

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

* Re: [ptxdist] [PATCH] Fix usage of fakeroot on Darwin
  2012-01-16 20:30 [ptxdist] [PATCH] Fix usage of fakeroot on Darwin Bernhard Walle
@ 2012-01-19 19:55 ` Michael Olbrich
  2012-01-19 21:16   ` Bernhard Walle
  0 siblings, 1 reply; 5+ messages in thread
From: Michael Olbrich @ 2012-01-19 19:55 UTC (permalink / raw)
  To: ptxdist

On Mon, Jan 16, 2012 at 09:30:25PM +0100, Bernhard Walle wrote:
> The extension of shared libraries on Darwin is .dylib, not .so. While
> the fakeroot script itself (which is part of the fakeroot distribution)
> can handle Darwin, ptxdist calls 'fakeroot' with the '-l' parameter and
> directly provides the full path to the shared library which is
> pre-loaded.

Can you try removing '-l <lib>' instead. From looking at the fakeroot
source, it should work. We use it like that in other places already.

Michael

> This patch adds a simple check, explicitly checking for Darwin in the
> 'uname -s' output. Verified to fix the build on Mac OS 10.7 (Lion).
> 
> Signed-off-by: Bernhard Walle <bernhard@bwalle.de>
> ---
>  rules/pre/Rules.make |    9 ++++++++-
>  1 files changed, 8 insertions(+), 1 deletions(-)
> 
> diff --git a/rules/pre/Rules.make b/rules/pre/Rules.make
> index c531a50..32c198b 100644
> --- a/rules/pre/Rules.make
> +++ b/rules/pre/Rules.make
> @@ -13,7 +13,14 @@ GNU_BUILD	:= $(shell $(SCRIPTSDIR)/autoconf/config.guess)
>  GNU_HOST	:= $(shell echo $(GNU_BUILD) | sed s/-[a-zA-Z0-9_]*-/-host-/)
>  
>  INSTALL		:= install
> -FAKEROOT	:= $(PTXDIST_SYSROOT_HOST)/bin/fakeroot -l $(PTXDIST_SYSROOT_HOST)/lib/libfakeroot.so
> +
> +ifeq ($(shell uname -s),Darwin)
> +SHLIB_SUFFIX	:= dylib
> +else
> +SHLIB_SUFFIX	:= so
> +endif
> +
> +FAKEROOT	:= $(PTXDIST_SYSROOT_HOST)/bin/fakeroot -l $(PTXDIST_SYSROOT_HOST)/lib/libfakeroot.$(SHLIB_SUFFIX)
>  
>  CHECK_PIPE_STATUS := \
>  	for i in  "$${PIPESTATUS[@]}"; do [ $$i -gt 0 ] && {			\
> -- 
> 1.7.7.4
> 
> 
> -- 
> ptxdist mailing list
> ptxdist@pengutronix.de
> 

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

-- 
ptxdist mailing list
ptxdist@pengutronix.de

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

* Re: [ptxdist] [PATCH] Fix usage of fakeroot on Darwin
  2012-01-19 19:55 ` Michael Olbrich
@ 2012-01-19 21:16   ` Bernhard Walle
  2012-01-19 21:18     ` Bernhard Walle
  2012-01-19 21:24     ` Michael Olbrich
  0 siblings, 2 replies; 5+ messages in thread
From: Bernhard Walle @ 2012-01-19 21:16 UTC (permalink / raw)
  To: ptxdist

Am 19.01.12 20:55, schrieb Michael Olbrich:
> On Mon, Jan 16, 2012 at 09:30:25PM +0100, Bernhard Walle wrote:
>> The extension of shared libraries on Darwin is .dylib, not .so. While
>> the fakeroot script itself (which is part of the fakeroot distribution)
>> can handle Darwin, ptxdist calls 'fakeroot' with the '-l' parameter and
>> directly provides the full path to the shared library which is
>> pre-loaded.
> 
> Can you try removing '-l <lib>' instead. From looking at the fakeroot
> source, it should work. We use it like that in other places already.

That works indeed. I also wondered why you're calling fakeroot with -l,
but I thought it must have a reason. :)

New version is coming.


Regards,
Bernhard

-- 
ptxdist mailing list
ptxdist@pengutronix.de

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

* [ptxdist] [PATCH] Fix usage of fakeroot on Darwin
  2012-01-19 21:16   ` Bernhard Walle
@ 2012-01-19 21:18     ` Bernhard Walle
  2012-01-19 21:24     ` Michael Olbrich
  1 sibling, 0 replies; 5+ messages in thread
From: Bernhard Walle @ 2012-01-19 21:18 UTC (permalink / raw)
  To: ptxdist

The extension of shared libraries on Darwin is .dylib, not .so.
Because fakeroot doesn't need specification of the pre-load library
but finds the library automatically, remove calling fakeroot with -l.

Signed-off-by: Bernhard Walle <bernhard@bwalle.de>
---
 rules/pre/Rules.make |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/rules/pre/Rules.make b/rules/pre/Rules.make
index c531a50..1d6da52 100644
--- a/rules/pre/Rules.make
+++ b/rules/pre/Rules.make
@@ -13,7 +13,8 @@ GNU_BUILD	:= $(shell $(SCRIPTSDIR)/autoconf/config.guess)
 GNU_HOST	:= $(shell echo $(GNU_BUILD) | sed s/-[a-zA-Z0-9_]*-/-host-/)
 
 INSTALL		:= install
-FAKEROOT	:= $(PTXDIST_SYSROOT_HOST)/bin/fakeroot -l $(PTXDIST_SYSROOT_HOST)/lib/libfakeroot.so
+
+FAKEROOT	:= $(PTXDIST_SYSROOT_HOST)/bin/fakeroot
 
 CHECK_PIPE_STATUS := \
 	for i in  "$${PIPESTATUS[@]}"; do [ $$i -gt 0 ] && {			\
-- 
1.7.7.4


-- 
ptxdist mailing list
ptxdist@pengutronix.de

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

* Re: [ptxdist] [PATCH] Fix usage of fakeroot on Darwin
  2012-01-19 21:16   ` Bernhard Walle
  2012-01-19 21:18     ` Bernhard Walle
@ 2012-01-19 21:24     ` Michael Olbrich
  1 sibling, 0 replies; 5+ messages in thread
From: Michael Olbrich @ 2012-01-19 21:24 UTC (permalink / raw)
  To: ptxdist

On Thu, Jan 19, 2012 at 10:16:51PM +0100, Bernhard Walle wrote:
> Am 19.01.12 20:55, schrieb Michael Olbrich:
> > On Mon, Jan 16, 2012 at 09:30:25PM +0100, Bernhard Walle wrote:
> >> The extension of shared libraries on Darwin is .dylib, not .so. While
> >> the fakeroot script itself (which is part of the fakeroot distribution)
> >> can handle Darwin, ptxdist calls 'fakeroot' with the '-l' parameter and
> >> directly provides the full path to the shared library which is
> >> pre-loaded.
> > 
> > Can you try removing '-l <lib>' instead. From looking at the fakeroot
> > source, it should work. We use it like that in other places already.
> 
> That works indeed. I also wondered why you're calling fakeroot with -l,
> but I thought it must have a reason. :)

Well this was added before we hacked fakeroot to find the lib by itself...

Michael

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

-- 
ptxdist mailing list
ptxdist@pengutronix.de

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

end of thread, other threads:[~2012-01-19 21:24 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-01-16 20:30 [ptxdist] [PATCH] Fix usage of fakeroot on Darwin Bernhard Walle
2012-01-19 19:55 ` Michael Olbrich
2012-01-19 21:16   ` Bernhard Walle
2012-01-19 21:18     ` Bernhard Walle
2012-01-19 21:24     ` Michael Olbrich

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox