Re: [PATCH] examples: allow to reuse environment variables in android-build

2016-09-06 Thread walter harms


Am 05.09.2016 23:33, schrieb Denys Vlasenko:
> Can you give some context? What were you trying to do?
> how current script wasn't good enough? etc
> 
> On Mon, Sep 5, 2016 at 7:41 AM, Petr Vorel  wrote:
>> + rename them to not clash with non intended environment variables
>>
>> Signed-off-by: Petr Vorel 
>> ---
>>  examples/android-build | 10 +-
>>  1 file changed, 5 insertions(+), 5 deletions(-)
>>
>> diff --git a/examples/android-build b/examples/android-build
>> index 123ba96..a420c2c 100755
>> --- a/examples/android-build
>> +++ b/examples/android-build
>> @@ -8,24 +8,24 @@
>>  # the android libc must be patched around) and Gingerbread.
>>
>>  # Point this to the Android root directory; it's used in the defconfig 
>> CFLAGS
>> -export A="$HOME/android"
>> +export ANDROID="${ANDROID:-$HOME/android}"
>>
>>  # Android product being built
>> -P=zoom2
>> +TARGET_PRODUCT=${TARGET_PRODUCT:-zoom2}
>>
>>  # Toolchain version in use by this version of Android
>>  GCCVER=4.4.3
>>
>> -export PATH="$A/prebuilt/linux-x86/toolchain/arm-eabi-$GCCVER/bin:$PATH"
>> +export 
>> PATH="$ANDROID/prebuilt/linux-x86/toolchain/arm-eabi-$GCCVER/bin:$PATH"
>>
>>  # Set the linker flags; compiler flags are in the defconfig file
>>  if grep "^CONFIG_STATIC=y" .config >/dev/null ; then
>> # Static linking
>> -   LDFLAGS="-static -Xlinker -z -Xlinker muldefs -nostdlib 
>> $A/out/target/product/$P/obj/lib/crtbegin_static.o 
>> $A/out/target/product/$P/obj/lib/crtend_android.o 
>> -L$A/out/target/product/$P/obj/lib 
>> -L$A/out/target/product/$P/obj/STATIC_LIBRARIES/libm_intermediates 
>> -L$A/out/target/product/$P/obj/STATIC_LIBRARIES/libc_intermediates"
>> +   LDFLAGS="-static -Xlinker -z -Xlinker muldefs -nostdlib 
>> $ANDROID/out/target/product/$TARGET_PRODUCT/obj/lib/crtbegin_static.o 
>> $ANDROID/out/target/product/$TARGET_PRODUCT/obj/lib/crtend_android.o 
>> -L$ANDROID/out/target/product/$TARGET_PRODUCT/obj/lib 
>> -L$ANDROID/out/target/product/$TARGET_PRODUCT/obj/STATIC_LIBRARIES/libm_intermediates
>>  
>> -L$ANDROID/out/target/product/$TARGET_PRODUCT/obj/STATIC_LIBRARIES/libc_intermediates"
>> LDLIBS="m c gcc"
>>  else
>> # Dynamic linking
>> -   LDFLAGS="-Xlinker -z -Xlinker muldefs -nostdlib -Bdynamic -Xlinker 
>> -T$A/build/core/armelf.x -Xlinker -dynamic-linker -Xlinker 
>> /system/bin/linker -Xlinker -z -Xlinker nocopyreloc -Xlinker --no-undefined 
>> $A/out/target/product/$P/obj/lib/crtbegin_dynamic.o 
>> $A/out/target/product/$P/obj/lib/crtend_android.o 
>> -L$A/out/target/product/$P/obj/lib"
>> +   LDFLAGS="-Xlinker -z -Xlinker muldefs -nostdlib -Bdynamic -Xlinker 
>> -T$ANDROID/build/core/armelf.x -Xlinker -dynamic-linker -Xlinker 
>> /system/bin/linker -Xlinker -z -Xlinker nocopyreloc -Xlinker --no-undefined 
>> $ANDROID/out/target/product/$TARGET_PRODUCT/obj/lib/crtbegin_dynamic.o 
>> $ANDROID/out/target/product/$TARGET_PRODUCT/obj/lib/crtend_android.o 
>> -L$ANDROID/out/target/product/$TARGET_PRODUCT/obj/lib"
>> LDLIBS="dl m c gcc"
>>  fi
>>
>> --


having more descriptive names than A is also a bonus.

just my 2 cents,

re,
 wh

___
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox


Re: [PATCH] examples: allow to reuse environment variables in android-build

2016-09-05 Thread Petr Vorel
Hi Denys,

> Can you give some context? What were you trying to do?
> how current script wasn't good enough? etc
It uses environment variables ANDROID and TARGET_PRODUCT variables if user has 
already
defined them. Variables are renamed to avoid clash with environment variables 
for
different purpose (not to be meant for this script) and also for better 
readability.

I know this is just an example script, not supposed to work out of box (maybe 
no worth
trying to polish it), but this patch saves a need to copy this script and 
modify it.


Kind regards,
Petr
___
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox


Re: [PATCH] examples: allow to reuse environment variables in android-build

2016-09-05 Thread Denys Vlasenko
Can you give some context? What were you trying to do?
how current script wasn't good enough? etc

On Mon, Sep 5, 2016 at 7:41 AM, Petr Vorel  wrote:
> + rename them to not clash with non intended environment variables
>
> Signed-off-by: Petr Vorel 
> ---
>  examples/android-build | 10 +-
>  1 file changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/examples/android-build b/examples/android-build
> index 123ba96..a420c2c 100755
> --- a/examples/android-build
> +++ b/examples/android-build
> @@ -8,24 +8,24 @@
>  # the android libc must be patched around) and Gingerbread.
>
>  # Point this to the Android root directory; it's used in the defconfig CFLAGS
> -export A="$HOME/android"
> +export ANDROID="${ANDROID:-$HOME/android}"
>
>  # Android product being built
> -P=zoom2
> +TARGET_PRODUCT=${TARGET_PRODUCT:-zoom2}
>
>  # Toolchain version in use by this version of Android
>  GCCVER=4.4.3
>
> -export PATH="$A/prebuilt/linux-x86/toolchain/arm-eabi-$GCCVER/bin:$PATH"
> +export 
> PATH="$ANDROID/prebuilt/linux-x86/toolchain/arm-eabi-$GCCVER/bin:$PATH"
>
>  # Set the linker flags; compiler flags are in the defconfig file
>  if grep "^CONFIG_STATIC=y" .config >/dev/null ; then
> # Static linking
> -   LDFLAGS="-static -Xlinker -z -Xlinker muldefs -nostdlib 
> $A/out/target/product/$P/obj/lib/crtbegin_static.o 
> $A/out/target/product/$P/obj/lib/crtend_android.o 
> -L$A/out/target/product/$P/obj/lib 
> -L$A/out/target/product/$P/obj/STATIC_LIBRARIES/libm_intermediates 
> -L$A/out/target/product/$P/obj/STATIC_LIBRARIES/libc_intermediates"
> +   LDFLAGS="-static -Xlinker -z -Xlinker muldefs -nostdlib 
> $ANDROID/out/target/product/$TARGET_PRODUCT/obj/lib/crtbegin_static.o 
> $ANDROID/out/target/product/$TARGET_PRODUCT/obj/lib/crtend_android.o 
> -L$ANDROID/out/target/product/$TARGET_PRODUCT/obj/lib 
> -L$ANDROID/out/target/product/$TARGET_PRODUCT/obj/STATIC_LIBRARIES/libm_intermediates
>  
> -L$ANDROID/out/target/product/$TARGET_PRODUCT/obj/STATIC_LIBRARIES/libc_intermediates"
> LDLIBS="m c gcc"
>  else
> # Dynamic linking
> -   LDFLAGS="-Xlinker -z -Xlinker muldefs -nostdlib -Bdynamic -Xlinker 
> -T$A/build/core/armelf.x -Xlinker -dynamic-linker -Xlinker /system/bin/linker 
> -Xlinker -z -Xlinker nocopyreloc -Xlinker --no-undefined 
> $A/out/target/product/$P/obj/lib/crtbegin_dynamic.o 
> $A/out/target/product/$P/obj/lib/crtend_android.o 
> -L$A/out/target/product/$P/obj/lib"
> +   LDFLAGS="-Xlinker -z -Xlinker muldefs -nostdlib -Bdynamic -Xlinker 
> -T$ANDROID/build/core/armelf.x -Xlinker -dynamic-linker -Xlinker 
> /system/bin/linker -Xlinker -z -Xlinker nocopyreloc -Xlinker --no-undefined 
> $ANDROID/out/target/product/$TARGET_PRODUCT/obj/lib/crtbegin_dynamic.o 
> $ANDROID/out/target/product/$TARGET_PRODUCT/obj/lib/crtend_android.o 
> -L$ANDROID/out/target/product/$TARGET_PRODUCT/obj/lib"
> LDLIBS="dl m c gcc"
>  fi
>
> --
> 2.9.3
>
> ___
> busybox mailing list
> busybox@busybox.net
> http://lists.busybox.net/mailman/listinfo/busybox
___
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox


[PATCH] examples: allow to reuse environment variables in android-build

2016-09-04 Thread Petr Vorel
+ rename them to not clash with non intended environment variables

Signed-off-by: Petr Vorel 
---
 examples/android-build | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/examples/android-build b/examples/android-build
index 123ba96..a420c2c 100755
--- a/examples/android-build
+++ b/examples/android-build
@@ -8,24 +8,24 @@
 # the android libc must be patched around) and Gingerbread.
 
 # Point this to the Android root directory; it's used in the defconfig CFLAGS
-export A="$HOME/android"
+export ANDROID="${ANDROID:-$HOME/android}"
 
 # Android product being built
-P=zoom2
+TARGET_PRODUCT=${TARGET_PRODUCT:-zoom2}
 
 # Toolchain version in use by this version of Android
 GCCVER=4.4.3
 
-export PATH="$A/prebuilt/linux-x86/toolchain/arm-eabi-$GCCVER/bin:$PATH"
+export PATH="$ANDROID/prebuilt/linux-x86/toolchain/arm-eabi-$GCCVER/bin:$PATH"
 
 # Set the linker flags; compiler flags are in the defconfig file
 if grep "^CONFIG_STATIC=y" .config >/dev/null ; then
# Static linking
-   LDFLAGS="-static -Xlinker -z -Xlinker muldefs -nostdlib 
$A/out/target/product/$P/obj/lib/crtbegin_static.o 
$A/out/target/product/$P/obj/lib/crtend_android.o 
-L$A/out/target/product/$P/obj/lib 
-L$A/out/target/product/$P/obj/STATIC_LIBRARIES/libm_intermediates 
-L$A/out/target/product/$P/obj/STATIC_LIBRARIES/libc_intermediates"
+   LDFLAGS="-static -Xlinker -z -Xlinker muldefs -nostdlib 
$ANDROID/out/target/product/$TARGET_PRODUCT/obj/lib/crtbegin_static.o 
$ANDROID/out/target/product/$TARGET_PRODUCT/obj/lib/crtend_android.o 
-L$ANDROID/out/target/product/$TARGET_PRODUCT/obj/lib 
-L$ANDROID/out/target/product/$TARGET_PRODUCT/obj/STATIC_LIBRARIES/libm_intermediates
 
-L$ANDROID/out/target/product/$TARGET_PRODUCT/obj/STATIC_LIBRARIES/libc_intermediates"
LDLIBS="m c gcc"
 else
# Dynamic linking
-   LDFLAGS="-Xlinker -z -Xlinker muldefs -nostdlib -Bdynamic -Xlinker 
-T$A/build/core/armelf.x -Xlinker -dynamic-linker -Xlinker /system/bin/linker 
-Xlinker -z -Xlinker nocopyreloc -Xlinker --no-undefined 
$A/out/target/product/$P/obj/lib/crtbegin_dynamic.o 
$A/out/target/product/$P/obj/lib/crtend_android.o 
-L$A/out/target/product/$P/obj/lib"
+   LDFLAGS="-Xlinker -z -Xlinker muldefs -nostdlib -Bdynamic -Xlinker 
-T$ANDROID/build/core/armelf.x -Xlinker -dynamic-linker -Xlinker 
/system/bin/linker -Xlinker -z -Xlinker nocopyreloc -Xlinker --no-undefined 
$ANDROID/out/target/product/$TARGET_PRODUCT/obj/lib/crtbegin_dynamic.o 
$ANDROID/out/target/product/$TARGET_PRODUCT/obj/lib/crtend_android.o 
-L$ANDROID/out/target/product/$TARGET_PRODUCT/obj/lib"
LDLIBS="dl m c gcc"
 fi
 
-- 
2.9.3

___
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox