erlang: fix host build when pcre/host is installed 13271/head
authorSebastian Kemper <sebastian_ml@gmx.net>
Tue, 1 Sep 2020 21:14:58 +0000 (23:14 +0200)
committerSebastian Kemper <sebastian_ml@gmx.net>
Tue, 1 Sep 2020 21:15:06 +0000 (23:15 +0200)
commit49ad98ce606d521a2f8b63600370c6c73e1331db
treea0a650d282d6b4c5c70588512bcd90e3234fae54
parent8966849a5a723169bd98519898d0132d6e7341ce
erlang: fix host build when pcre/host is installed

OpenWrt added pcre/host recently. When it is available (installed)
erlang finds staging_dir/hostpkg/include/pcre.h before it finds its own
copy and the build fails.

 CC obj/x86_64-pc-linux-gnu/opt/smp/erl_bif_chksum.o
 CC obj/x86_64-pc-linux-gnu/opt/smp/erl_bif_re.o
beam/erl_bif_re.c: In function 'erts_init_bif_re':
beam/erl_bif_re.c:96:5: error: 'erts_pcre_malloc' undeclared (first use in this function)
     erts_pcre_malloc = &erts_erts_pcre_malloc;
     ^~~~~~~~~~~~~~~~
beam/erl_bif_re.c:96:5: note: each undeclared identifier is reported only once for each function it appears in
beam/erl_bif_re.c:97:5: error: 'erts_pcre_free' undeclared (first use in this function)
     erts_pcre_free = &erts_erts_pcre_free;
     ^~~~~~~~~~~~~~

This adds a patch from Romain Naour and Bernd Kuhls to prevent that.
Patch snatched from buildroot [1].

[1] https://github.com/buildroot/buildroot/blob/master/package/erlang/0002-erts-emulator-reorder-inclued-headers-paths.patch

Signed-off-by: Sebastian Kemper <sebastian_ml@gmx.net>
lang/erlang/Makefile
lang/erlang/patches/020-erts-emulator-reorder-inclued-headers-paths.patch [new file with mode: 0644]