diff mbox series

build/prereq: merge ifndef IB block together

Message ID 20201230042341.3109627-1-mail@aparcar.org
State Accepted
Delegated to: Paul Spooren
Headers show
Series build/prereq: merge ifndef IB block together | expand

Commit Message

Paul Spooren Dec. 30, 2020, 4:23 a.m. UTC
Multiple prereq checks are only required within the build system but not
for the ImageBuilder. These checks are excluded by using ifndef IB.

This commit merges the three ifndef IB blocks together.

Signed-off-by: Paul Spooren <mail@aparcar.org>
---
 include/prereq-build.mk | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

Comments

Baptiste Jonglez Dec. 30, 2020, 5:28 p.m. UTC | #1
Hi,

On 29-12-20, Paul Spooren wrote:
> Multiple prereq checks are only required within the build system but not
> for the ImageBuilder. These checks are excluded by using ifndef IB.
> 
> This commit merges the three ifndef IB blocks together.

To clarify, this is only cosmetic, right?

I just saw the last changes that avoid requiring build dependencies for
the imagebuilder, this is good news.  It makes sense to backport them
(4a1a58a3e2d236 & ae12a747cae3d & this one) for openwrt-19.07.

Thanks,
Baptiste

> diff --git a/include/prereq-build.mk b/include/prereq-build.mk
> index ad204e95e8..3a51c4cd70 100644
> --- a/include/prereq-build.mk
> +++ b/include/prereq-build.mk
> @@ -38,9 +38,7 @@ $(eval $(call TestHostCommand,working-gcc, \
>  	it appears to be broken, \
>  	echo 'int main(int argc, char **argv) { return 0; }' | \
>  		gcc -x c -o $(TMP_DIR)/a.out -))
> -endif
>  
> -ifndef IB
>  $(eval $(call SetupHostCommand,g++, \
>  	Please install the GNU C++ Compiler (g++) 4.8 or later, \
>  	$(CXX) -dumpversion | grep -E '^(4\.[8-9]|[5-9]\.?|10\.?)', \
> @@ -53,14 +51,12 @@ $(eval $(call TestHostCommand,working-g++, \
>  	echo 'int main(int argc, char **argv) { return 0; }' | \
>  		g++ -x c++ -o $(TMP_DIR)/a.out - -lstdc++ && \
>  		$(TMP_DIR)/a.out))
> -endif
>  
> -ifndef IB
>  $(eval $(call TestHostCommand,ncurses, \
>  	Please install ncurses. (Missing libncurses.so or ncurses.h), \
>  	echo 'int main(int argc, char **argv) { initscr(); return 0; }' | \
>  		gcc -include ncurses.h -x c -o $(TMP_DIR)/a.out - -lncurses))
> -endif
> +endif # IB
>  
>  ifeq ($(HOST_OS),Linux)
>    zlib_link_flags := -Wl,-Bstatic -lz -Wl,-Bdynamic
Paul Spooren Dec. 31, 2020, 4:10 a.m. UTC | #2
On Mi, Dez 30, 2020 at 18:28, Baptiste Jonglez 
<baptiste@bitsofnetworks.org> wrote:
> Hi,
> 
> On 29-12-20, Paul Spooren wrote:
>>  Multiple prereq checks are only required within the build system 
>> but not
>>  for the ImageBuilder. These checks are excluded by using ifndef IB.
>> 
>>  This commit merges the three ifndef IB blocks together.
> 
> To clarify, this is only cosmetic, right?

Yes

> 
> I just saw the last changes that avoid requiring build dependencies 
> for
> the imagebuilder, this is good news.  It makes sense to backport them
> (4a1a58a3e2d236 & ae12a747cae3d & this one) for openwrt-19.07.

True, I'll do that.

> 
> Thanks,
> Baptiste
> 
>>  diff --git a/include/prereq-build.mk b/include/prereq-build.mk
>>  index ad204e95e8..3a51c4cd70 100644
>>  --- a/include/prereq-build.mk
>>  +++ b/include/prereq-build.mk
>>  @@ -38,9 +38,7 @@ $(eval $(call TestHostCommand,working-gcc, \
>>   	it appears to be broken, \
>>   	echo 'int main(int argc, char **argv) { return 0; }' | \
>>   		gcc -x c -o $(TMP_DIR)/a.out -))
>>  -endif
>> 
>>  -ifndef IB
>>   $(eval $(call SetupHostCommand,g++, \
>>   	Please install the GNU C++ Compiler (g++) 4.8 or later, \
>>   	$(CXX) -dumpversion | grep -E '^(4\.[8-9]|[5-9]\.?|10\.?)', \
>>  @@ -53,14 +51,12 @@ $(eval $(call TestHostCommand,working-g++, \
>>   	echo 'int main(int argc, char **argv) { return 0; }' | \
>>   		g++ -x c++ -o $(TMP_DIR)/a.out - -lstdc++ && \
>>   		$(TMP_DIR)/a.out))
>>  -endif
>> 
>>  -ifndef IB
>>   $(eval $(call TestHostCommand,ncurses, \
>>   	Please install ncurses. (Missing libncurses.so or ncurses.h), \
>>   	echo 'int main(int argc, char **argv) { initscr(); return 0; }' | 
>> \
>>   		gcc -include ncurses.h -x c -o $(TMP_DIR)/a.out - -lncurses))
>>  -endif
>>  +endif # IB
>> 
>>   ifeq ($(HOST_OS),Linux)
>>     zlib_link_flags := -Wl,-Bstatic -lz -Wl,-Bdynamic
Paul Spooren Dec. 31, 2020, 7:35 p.m. UTC | #3
On Mi, Dez 30, 2020 at 18:10, Paul Spooren <mail@aparcar.org> wrote:
> 
> 
> On Mi, Dez 30, 2020 at 18:28, Baptiste Jonglez 
> <baptiste@bitsofnetworks.org> wrote:
>> Hi,
>> 
>> On 29-12-20, Paul Spooren wrote:
>>>  Multiple prereq checks are only required within the build system 
>>> but not
>>>  for the ImageBuilder. These checks are excluded by using ifndef IB.
>>> 
>>>  This commit merges the three ifndef IB blocks together.
>> 
>> To clarify, this is only cosmetic, right?
> 
> Yes
> 
>> 
>> I just saw the last changes that avoid requiring build dependencies 
>> for
>> the imagebuilder, this is good news.  It makes sense to backport them
>> (4a1a58a3e2d236 & ae12a747cae3d & this one) for openwrt-19.07.
> 
> True, I'll do that.

Merged and backported.

> 
>> 
>> Thanks,
>> Baptiste
>> 
>>>  diff --git a/include/prereq-build.mk b/include/prereq-build.mk
>>>  index ad204e95e8..3a51c4cd70 100644
>>>  --- a/include/prereq-build.mk
>>>  +++ b/include/prereq-build.mk
>>>  @@ -38,9 +38,7 @@ $(eval $(call TestHostCommand,working-gcc, \
>>>   	it appears to be broken, \
>>>   	echo 'int main(int argc, char **argv) { return 0; }' | \
>>>   		gcc -x c -o $(TMP_DIR)/a.out -))
>>>  -endif
>>> 
>>>  -ifndef IB
>>>   $(eval $(call SetupHostCommand,g++, \
>>>   	Please install the GNU C++ Compiler (g++) 4.8 or later, \
>>>   	$(CXX) -dumpversion | grep -E '^(4\.[8-9]|[5-9]\.?|10\.?)', \
>>>  @@ -53,14 +51,12 @@ $(eval $(call TestHostCommand,working-g++, \
>>>   	echo 'int main(int argc, char **argv) { return 0; }' | \
>>>   		g++ -x c++ -o $(TMP_DIR)/a.out - -lstdc++ && \
>>>   		$(TMP_DIR)/a.out))
>>>  -endif
>>> 
>>>  -ifndef IB
>>>   $(eval $(call TestHostCommand,ncurses, \
>>>   	Please install ncurses. (Missing libncurses.so or ncurses.h), \
>>>   	echo 'int main(int argc, char **argv) { initscr(); return 0; }' 
>>> | \
>>>   		gcc -include ncurses.h -x c -o $(TMP_DIR)/a.out - -lncurses))
>>>  -endif
>>>  +endif # IB
>>> 
>>>   ifeq ($(HOST_OS),Linux)
>>>     zlib_link_flags := -Wl,-Bstatic -lz -Wl,-Bdynamic
>
Sven Roederer Jan. 1, 2021, 4:24 p.m. UTC | #4
Am Mittwoch, 30. Dezember 2020, 05:23:41 CET schrieb Paul Spooren:
> Multiple prereq checks are only required within the build system but not
> for the ImageBuilder. These checks are excluded by using ifndef IB.
> 
> This commit merges the three ifndef IB blocks together.

Happy new year to all.

When I made the change to not check for gcc, g++ I was also thinking of using 
a common "ifndef" block.
I used atomic blocks, as I expect it's more straight-forward on later changes 
and more consistent (copy and paste) for other tools.


Best Sven
Sven Roederer Jan. 1, 2021, 4:29 p.m. UTC | #5
Am Donnerstag, 31. Dezember 2020, 20:35:47 CET schrieb Paul Spooren:
> 
> Merged and backported.
> 

I think 4f3806364011aa3aef26fcab2e7b71837a777bcc needs to be backported too, 
to make it work.

Sven
diff mbox series

Patch

diff --git a/include/prereq-build.mk b/include/prereq-build.mk
index ad204e95e8..3a51c4cd70 100644
--- a/include/prereq-build.mk
+++ b/include/prereq-build.mk
@@ -38,9 +38,7 @@  $(eval $(call TestHostCommand,working-gcc, \
 	it appears to be broken, \
 	echo 'int main(int argc, char **argv) { return 0; }' | \
 		gcc -x c -o $(TMP_DIR)/a.out -))
-endif
 
-ifndef IB
 $(eval $(call SetupHostCommand,g++, \
 	Please install the GNU C++ Compiler (g++) 4.8 or later, \
 	$(CXX) -dumpversion | grep -E '^(4\.[8-9]|[5-9]\.?|10\.?)', \
@@ -53,14 +51,12 @@  $(eval $(call TestHostCommand,working-g++, \
 	echo 'int main(int argc, char **argv) { return 0; }' | \
 		g++ -x c++ -o $(TMP_DIR)/a.out - -lstdc++ && \
 		$(TMP_DIR)/a.out))
-endif
 
-ifndef IB
 $(eval $(call TestHostCommand,ncurses, \
 	Please install ncurses. (Missing libncurses.so or ncurses.h), \
 	echo 'int main(int argc, char **argv) { initscr(); return 0; }' | \
 		gcc -include ncurses.h -x c -o $(TMP_DIR)/a.out - -lncurses))
-endif
+endif # IB
 
 ifeq ($(HOST_OS),Linux)
   zlib_link_flags := -Wl,-Bstatic -lz -Wl,-Bdynamic