### Description During build on alpine we get error ``` generating core/autover.h ... CC (gcc) [kamailio] main.o CC (gcc) [kamailio] core/daemonize.o CC (gcc) [kamailio] core/nonsip_hooks.o CC (gcc) [kamailio] core/timer_proc.o CC (gcc) [kamailio] core/select_buf.o CC (gcc) [kamailio] core/stun.o CC (gcc) [kamailio] core/action.o CC (gcc) [kamailio] core/raw_listener.o CC (gcc) [kamailio] core/sctp_core.o CC (gcc) [kamailio] core/str.o CC (gcc) [kamailio] core/atomic_ops.o CC (gcc) [kamailio] core/bit_count.o CC (gcc) [kamailio] core/select_core.o CC (gcc) [kamailio] core/pvapi.o CC (gcc) [kamailio] core/forward.o CC (gcc) [kamailio] core/ut.o CC (gcc) [kamailio] core/timer.o CC (gcc) [kamailio] core/ver.o CC (gcc) [kamailio] core/id.o CC (gcc) [kamailio] core/switch.o CC (gcc) [kamailio] core/kemi.o CC (gcc) [kamailio] core/local_timer.o CC (gcc) [kamailio] core/dns_cache.o CC (gcc) [kamailio] core/route.o CC (gcc) [kamailio] core/udp_server.o CC (gcc) [kamailio] core/sr_compat.o CC (gcc) [kamailio] core/locking.o CC (gcc) [kamailio] core/socket_info.o CC (gcc) [kamailio] core/resolve.o core/resolve.c: In function 'get_record': core/resolve.c:961:9: error: 'T_OPT' undeclared (first use in this function) 961 | case T_OPT: | ^~~~~ core/resolve.c:961:9: note: each undeclared identifier is reported only once for each function it appears in make[1]: *** [Makefile.rules:100: core/resolve.o] Error 1 make[1]: *** Waiting for unfinished jobs.... make[1]: Leaving directory '/usr/src/kamailio/pkg/kamailio/alpine/src/kamailio-49a78933845f136f8f7caaf7e24e6cdcf206cbb5/src' make: *** [Makefile:30: all] Error 2
ERROR: kamailio: build failed kamailio: Uninstalling dependencies...
(1/1) Purging .makedepends-kamailio (20191007.100221) OK: 635 MiB in 184 packages pre_build hook failed! (1) ```
This is related to GH #2087 - can you give me the glibc version number on this distribution?
Looks as Alpine not use `glibc` and used [`musl 1.1.23-r3`](https://pkgs.alpinelinux.org/package/edge/main/x86/musl) library ([sources](http://www.musl-libc.org/releases/musl-1.1.23.tar.gz))
I tried search about usage `#ifdef __MUSL__` and found this [response](https://www.openwall.com/lists/musl/2013/03/29/13).
I also looked into `musl` sources and `musl-dev` package and not found `GLIBC` comparability macros.
On glibc dist `T_OPT` macro defined inside `/usr/include/arpa/nameser_compat.h` file and looks as ``` #define T_OPT ns_t_opt ``` Inside Alpine dist also exist file `/usr/include/arpa/nameser_compat.h` but content of this file ``` /usr/include # cat /usr/include/arpa/nameser_compat.h #include <arpa/nameser.h>
/usr/include # ``` Is need use `nameser_compat.h` file?
Why not use `ns_t_opt` as is? [Example](https://github.com/c-ares/c-ares/blob/master/test/dns-proto.h#L181)
And replace T_A, T_AAAA and other macros to similar from `arpa/nameser.h`.
It looks that the musl library did not added this T_OPT define yet, all others (T_A, T_AAAA) are there: [link](https://git.musl-libc.org/cgit/musl/tree/include/arpa/nameser.h). I don't want to change the complete implementation just for a bug fix, this might have some other side-effects as well for other distributions and/or libraries.
Can you check if it works now with commit cec1043a9c
On master looks as ok. Could you backport this to `5.3` and `5.2` branches.
Thanks for the confirmation - backported to stable branches and 5.3.
Closed #2095.
Looks as for `5.3` need also backport
Yes, now its there as well.