asterisk: link in libdl when linking to liblua
Currently building for archs target against glibc fails:
checking for mandatory modules: CAP GSM ILBC LIBEDIT LIBXML2 LUA PJPROJECT SQLITE3 SRTP ZLIB... fail
configure: ***
configure: *** The LUA installation appears to be missing or broken.
Checking config.log reveals:
/home/sk/tmp/sdk/openwrt-sdk-archs38-generic_gcc-8.4.0_glibc.Linux-x86_64/staging_dir/toolchain-arc_archs_gcc-8.4.0_glibc/bin/../lib/gcc/arc-openwrt-linux-gnu/8.4.0/../../../../arc-openwrt-linux-gnu/bin/ld: /home/sk/tmp/sdk/openwrt-sdk-archs38-generic_gcc-8.4.0_glibc.Linux-x86_64/staging_dir/target-arc_archs_glibc/usr/lib/liblua.so: undefined reference to `dlopen'
/home/sk/tmp/sdk/openwrt-sdk-archs38-generic_gcc-8.4.0_glibc.Linux-x86_64/staging_dir/toolchain-arc_archs_gcc-8.4.0_glibc/bin/../lib/gcc/arc-openwrt-linux-gnu/8.4.0/../../../../arc-openwrt-linux-gnu/bin/ld: /home/sk/tmp/sdk/openwrt-sdk-archs38-generic_gcc-8.4.0_glibc.Linux-x86_64/staging_dir/target-arc_archs_glibc/usr/lib/liblua.so: undefined reference to `dlclose'
/home/sk/tmp/sdk/openwrt-sdk-archs38-generic_gcc-8.4.0_glibc.Linux-x86_64/staging_dir/toolchain-arc_archs_gcc-8.4.0_glibc/bin/../lib/gcc/arc-openwrt-linux-gnu/8.4.0/../../../../arc-openwrt-linux-gnu/bin/ld: /home/sk/tmp/sdk/openwrt-sdk-archs38-generic_gcc-8.4.0_glibc.Linux-x86_64/staging_dir/target-arc_archs_glibc/usr/lib/liblua.so: undefined reference to `dlerror'
/home/sk/tmp/sdk/openwrt-sdk-archs38-generic_gcc-8.4.0_glibc.Linux-x86_64/staging_dir/toolchain-arc_archs_gcc-8.4.0_glibc/bin/../lib/gcc/arc-openwrt-linux-gnu/8.4.0/../../../../arc-openwrt-linux-gnu/bin/ld: /home/sk/tmp/sdk/openwrt-sdk-archs38-generic_gcc-8.4.0_glibc.Linux-x86_64/staging_dir/target-arc_archs_glibc/usr/lib/liblua.so: undefined reference to `dlsym'
This commit adds "-ldl" to lua linker flags so compilation against glibc
works. This has no ill effect on musl where libdl is just an empty
library archive.
This is not something that should be sent upstream, as they maybe
support non-Linux platforms as well.
Signed-off-by: Sebastian Kemper <sebastian_ml@gmx.net>