diff mbox

[3/4] chrpath: Add option for replacing and stripping of chrpath, machine recipes

Message ID efcf40711d3015a632a718c522fe82367c7c4f63.1385470877.git.christian.braunersorensen@prevas.dk
State Superseded
Delegated to: Esben Haabendal
Headers show

Commit Message

christian.braunersorensen@prevas.dk Nov. 26, 2013, 1:03 p.m. UTC
From: Christian Sørensen <christian.braunersorensen@prevas.dk>

Adds 2 new useflags:
USE_chrpath_replace: is set to false by default. Set to true if you do
want the chrpaths to be replaced for machine recipes
USE_chrpath_strip: Is set to true by default Set to false if you not want
the chrpaths to be stripped.

Signed-off-by: Christian Sørensen <christian.braunersorensen@prevas.dk>
---
 classes/chrpath.oeclass | 25 +++++++++++++++++++++----
 1 file changed, 21 insertions(+), 4 deletions(-)

Comments

Esben Haabendal Nov. 28, 2013, 9:53 a.m. UTC | #1
<christian.braunersorensen@prevas.dk> writes:

> From: Christian Sørensen <christian.braunersorensen@prevas.dk>
>
> Adds 2 new useflags:
> USE_chrpath_replace: is set to false by default. Set to true if you do
> want the chrpaths to be replaced for machine recipes
> USE_chrpath_strip: Is set to true by default Set to false if you not want
> the chrpaths to be stripped.

So if you put

    DISTRO_USE_chrpath_replace = "1"

in your distro configuration, will you get what you need?
(as USE_chrpath_strip is left at default value...)

As the feature you are adding here is the option to build machine
recipes with $ORIGIN relative rpaths, why not add a single USE flag for
enabling this feature?  The USE flag could be named
USE_machine_elf_rpath, making it clear that it alters the behavior with
regards to machine elf rpath handling, and nothing else.

/Esben

>
> Signed-off-by: Christian Sørensen <christian.braunersorensen@prevas.dk>
> ---
>  classes/chrpath.oeclass | 25 +++++++++++++++++++++----
>  1 file changed, 21 insertions(+), 4 deletions(-)
>
> diff --git a/classes/chrpath.oeclass b/classes/chrpath.oeclass
> index 42c4a3e..4a2162c 100644
> --- a/classes/chrpath.oeclass
> +++ b/classes/chrpath.oeclass
> @@ -3,6 +3,13 @@
>  ## Strip of ELF rpath from machine recipe output, and rewrite ELF rpath
>  ## in all other recipe types to be relocatable using $ORIGIN relative paths.
>  ## TBD.
> +##
> +## @useflag chrpath_replace Set to true if you do want the chrpaths to be
> +##          replaced for machine recipes. Default is set to 0, meaning no
> +##          replace.
> +## @useflag chrpath_strip Set to false if you do not wants the chrpaths to
> +##          be stripped. Default is set to 1, meaning the chrpaths are
> +##          stripped.
>  
>  addtask chrpath after install before split
>  
> @@ -12,10 +19,20 @@ CHRPATH_DIRS = "${base_bindir} ${bindir} ${base_sbindir} ${sbindir} \
>          ${base_libdir} ${libdir} ${base_sharedlibdir} ${sharedlibdir} \
>          ${libexecdir}"
>  
> -CHRPATH_REPLACE_DIRS			= "${CHRPATH_DIRS}"
> -CHRPATH_STRIP_DIRS			= ""
> -CHRPATH_REPLACE_DIRS:machine		= ""
> -CHRPATH_STRIP_DIRS:machine		= "${CHRPATH_DIRS}"
> +CLASS_FLAGS += " chrpath_replace chrpath_strip"
> +CHRPATH_REPLACE                = "1"
> +#Default: Do not replace for machine recipes
> +CHRPATH_REPLACE:machine        = ""
> +DEFAULT_USE_chrpath_replace    = "${CHRPATH_REPLACE}"
> +CHRPATH_STRIP                  = ""
> +#Default: Strip only for machine recipes
> +CHRPATH_STRIP:machine          = "1"
> +DEFAULT_USE_chrpath_strip      = "${CHRPATH_STRIP}"
> +
> +CHRPATH_REPLACE_DIRS                   = ""
> +CHRPATH_STRIP_DIRS                     = ""
> +CHRPATH_REPLACE_DIRS:USE_chrpath_replace = "${CHRPATH_DIRS}"
> +CHRPATH_STRIP_DIRS:USE_chrpath_strip   = "${CHRPATH_DIRS}"
>  
>  CHRPATH_REPLACE_STAGEDIRS:native	= "1"
>  CHRPATH_REPLACE_STAGEDIRS:cross		= "1"
christian.braunersorensen@prevas.dk Nov. 28, 2013, 10:15 a.m. UTC | #2
Yup. Want a new patch, or can you squeeze the 2 useflags into 1?
Esben Haabendal Nov. 28, 2013, 1:29 p.m. UTC | #3
Christian Bräuner Sørensen <Christian.BraunerSorensen@prevas.dk> writes:

> Yup. Want a new patch, or can you squeeze the 2 useflags into 1?

As I think I need to do some additional work in this direction, I can
continue from here.

/Esben
>
> ________________________________________
> From: Esben Haabendal [esben.haabendal@dev.prevas.dk]
> Sent: 28 November 2013 10:53
> To: Christian Bräuner Sørensen
> Cc: dev@oe-lite.org
> Subject: Re: [PATCH 3/4] chrpath: Add option for replacing and stripping of chrpath, machine recipes
>
> <christian.braunersorensen@prevas.dk> writes:
>
>> From: Christian Sørensen <christian.braunersorensen@prevas.dk>
>>
>> Adds 2 new useflags:
>> USE_chrpath_replace: is set to false by default. Set to true if you do
>> want the chrpaths to be replaced for machine recipes
>> USE_chrpath_strip: Is set to true by default Set to false if you not want
>> the chrpaths to be stripped.
>
> So if you put
>
>     DISTRO_USE_chrpath_replace = "1"
>
> in your distro configuration, will you get what you need?
> (as USE_chrpath_strip is left at default value...)
>
> As the feature you are adding here is the option to build machine
> recipes with $ORIGIN relative rpaths, why not add a single USE flag for
> enabling this feature?  The USE flag could be named
> USE_machine_elf_rpath, making it clear that it alters the behavior with
> regards to machine elf rpath handling, and nothing else.
>
> /Esben
>
>>
>> Signed-off-by: Christian Sørensen <christian.braunersorensen@prevas.dk>
>> ---
>>  classes/chrpath.oeclass | 25 +++++++++++++++++++++----
>>  1 file changed, 21 insertions(+), 4 deletions(-)
>>
>> diff --git a/classes/chrpath.oeclass b/classes/chrpath.oeclass
>> index 42c4a3e..4a2162c 100644
>> --- a/classes/chrpath.oeclass
>> +++ b/classes/chrpath.oeclass
>> @@ -3,6 +3,13 @@
>>  ## Strip of ELF rpath from machine recipe output, and rewrite ELF rpath
>>  ## in all other recipe types to be relocatable using $ORIGIN relative paths.
>>  ## TBD.
>> +##
>> +## @useflag chrpath_replace Set to true if you do want the chrpaths to be
>> +##          replaced for machine recipes. Default is set to 0, meaning no
>> +##          replace.
>> +## @useflag chrpath_strip Set to false if you do not wants the chrpaths to
>> +##          be stripped. Default is set to 1, meaning the chrpaths are
>> +##          stripped.
>>
>>  addtask chrpath after install before split
>>
>> @@ -12,10 +19,20 @@ CHRPATH_DIRS = "${base_bindir} ${bindir} ${base_sbindir} ${sbindir} \
>>          ${base_libdir} ${libdir} ${base_sharedlibdir} ${sharedlibdir} \
>>          ${libexecdir}"
>>
>> -CHRPATH_REPLACE_DIRS                 = "${CHRPATH_DIRS}"
>> -CHRPATH_STRIP_DIRS                   = ""
>> -CHRPATH_REPLACE_DIRS:machine         = ""
>> -CHRPATH_STRIP_DIRS:machine           = "${CHRPATH_DIRS}"
>> +CLASS_FLAGS += " chrpath_replace chrpath_strip"
>> +CHRPATH_REPLACE                = "1"
>> +#Default: Do not replace for machine recipes
>> +CHRPATH_REPLACE:machine        = ""
>> +DEFAULT_USE_chrpath_replace    = "${CHRPATH_REPLACE}"
>> +CHRPATH_STRIP                  = ""
>> +#Default: Strip only for machine recipes
>> +CHRPATH_STRIP:machine          = "1"
>> +DEFAULT_USE_chrpath_strip      = "${CHRPATH_STRIP}"
>> +
>> +CHRPATH_REPLACE_DIRS                   = ""
>> +CHRPATH_STRIP_DIRS                     = ""
>> +CHRPATH_REPLACE_DIRS:USE_chrpath_replace = "${CHRPATH_DIRS}"
>> +CHRPATH_STRIP_DIRS:USE_chrpath_strip   = "${CHRPATH_DIRS}"
>>
>>  CHRPATH_REPLACE_STAGEDIRS:native     = "1"
>>  CHRPATH_REPLACE_STAGEDIRS:cross              = "1"
diff mbox

Patch

diff --git a/classes/chrpath.oeclass b/classes/chrpath.oeclass
index 42c4a3e..4a2162c 100644
--- a/classes/chrpath.oeclass
+++ b/classes/chrpath.oeclass
@@ -3,6 +3,13 @@ 
 ## Strip of ELF rpath from machine recipe output, and rewrite ELF rpath
 ## in all other recipe types to be relocatable using $ORIGIN relative paths.
 ## TBD.
+##
+## @useflag chrpath_replace Set to true if you do want the chrpaths to be
+##          replaced for machine recipes. Default is set to 0, meaning no
+##          replace.
+## @useflag chrpath_strip Set to false if you do not wants the chrpaths to
+##          be stripped. Default is set to 1, meaning the chrpaths are
+##          stripped.
 
 addtask chrpath after install before split
 
@@ -12,10 +19,20 @@  CHRPATH_DIRS = "${base_bindir} ${bindir} ${base_sbindir} ${sbindir} \
         ${base_libdir} ${libdir} ${base_sharedlibdir} ${sharedlibdir} \
         ${libexecdir}"
 
-CHRPATH_REPLACE_DIRS			= "${CHRPATH_DIRS}"
-CHRPATH_STRIP_DIRS			= ""
-CHRPATH_REPLACE_DIRS:machine		= ""
-CHRPATH_STRIP_DIRS:machine		= "${CHRPATH_DIRS}"
+CLASS_FLAGS += " chrpath_replace chrpath_strip"
+CHRPATH_REPLACE                = "1"
+#Default: Do not replace for machine recipes
+CHRPATH_REPLACE:machine        = ""
+DEFAULT_USE_chrpath_replace    = "${CHRPATH_REPLACE}"
+CHRPATH_STRIP                  = ""
+#Default: Strip only for machine recipes
+CHRPATH_STRIP:machine          = "1"
+DEFAULT_USE_chrpath_strip      = "${CHRPATH_STRIP}"
+
+CHRPATH_REPLACE_DIRS                   = ""
+CHRPATH_STRIP_DIRS                     = ""
+CHRPATH_REPLACE_DIRS:USE_chrpath_replace = "${CHRPATH_DIRS}"
+CHRPATH_STRIP_DIRS:USE_chrpath_strip   = "${CHRPATH_DIRS}"
 
 CHRPATH_REPLACE_STAGEDIRS:native	= "1"
 CHRPATH_REPLACE_STAGEDIRS:cross		= "1"