Mercurial > pub > dyncall > dyncall
comparison test/dynload_plain/Makefile.generic @ 594:0bb9c03ff617
- test/dynload_plain: workaround for shell incompatibilities on some platforms
author | Tassilo Philipp |
---|---|
date | Tue, 20 Sep 2022 10:20:32 +0200 |
parents | 996424e8a5fc |
children | 82aa83f09264 |
comparison
equal
deleted
inserted
replaced
593:806e415df417 | 594:0bb9c03ff617 |
---|---|
10 .PHONY: all clean install | 10 .PHONY: all clean install |
11 all: ${TEST_C_LD} ${TEST_U8_SO} | 11 all: ${TEST_C_LD} ${TEST_U8_SO} |
12 # deduce path to default libc.so file, easier to do via shell than in code | 12 # deduce path to default libc.so file, easier to do via shell than in code |
13 # (see main() in dynload_plain.c); get from what ${TEST_C_LD} is linked | 13 # (see main() in dynload_plain.c); get from what ${TEST_C_LD} is linked |
14 # against, then reinvoke make with actual build | 14 # against, then reinvoke make with actual build |
15 export X=`((ldd ${TEST_C_LD} | grep -o '/.*/libc.so[^ ]*' || ls /lib*/libc.so* || ls /usr/lib/libc.so*) | grep -v '\.a$$' | (sort -V -r || sort -t . -n -k 2)) 2>/dev/null | head -1`; \ | 15 export X=`((ldd ${TEST_C_LD} | awk '/libc\.so/{for(i=0;i<NF;++i){if($$i ~ "^/")print $$i}}' || ls /lib*/libc.so* || ls /usr/lib/libc.so*) | grep -v '\.a$$' | (sort -V -r || sort -t . -n -k 2)) 2>/dev/null | head -1`; \ |
16 ${MAKE} DEF_C_DYLIB="$$X" ${APP} | 16 ${MAKE} DEF_C_DYLIB="$$X" ${APP} |
17 ${TEST_C_LD}: | 17 ${TEST_C_LD}: |
18 # dummy bin built with same toolchain and flags to deduce default c lib this is linked with | 18 # dummy bin built with same toolchain and flags to deduce default c lib this is linked with |
19 echo 'int main() { return 0; }' | ${CC} -x c ${CFLAGS} ${LDFLAGS} -o ${TEST_C_LD} - | 19 echo 'int main() { return 0; }' | ${CC} -x c ${CFLAGS} ${LDFLAGS} -o ${TEST_C_LD} - |
20 ${APP}: ${OBJS} | 20 ${APP}: ${OBJS} |