2012-06-17 11:40:25 +04:00
|
|
|
# $NetBSD: Makefile,v 1.15 2012/06/17 07:40:25 joerg Exp $
|
2011-02-06 04:13:42 +03:00
|
|
|
|
|
|
|
.include <bsd.init.mk>
|
|
|
|
|
|
|
|
#
|
|
|
|
# Do *not* set HOSTPROG or HOSTLIB at this point otherwise
|
|
|
|
# it will create a loop trying to extract the object directory.
|
|
|
|
#
|
|
|
|
.include "Makefile.inc"
|
|
|
|
.include "${LLVM_TOPLEVEL}/lib/Makefile.inc"
|
|
|
|
|
2012-06-17 11:40:25 +04:00
|
|
|
realdepends realall: config/config.status need-dl
|
2011-02-06 04:13:42 +03:00
|
|
|
|
|
|
|
config/config.status: ${LLVM_SRCDIR}/configure
|
|
|
|
mkdir -p config
|
2012-06-17 11:40:25 +04:00
|
|
|
cd config && ${LLVM_SRCDIR}/configure ${LLVM_CONFIGURE_ARGS} \
|
|
|
|
--enable-optimized CC=${HOST_CC:Q}
|
2011-07-18 23:11:28 +04:00
|
|
|
# --disable-assertions
|
2011-05-16 23:27:47 +04:00
|
|
|
|
2011-02-06 04:13:42 +03:00
|
|
|
need-dl:
|
|
|
|
printf '#include <dlfcn.h>\nint main(void){void *p; return dladdr(p, p);}' > need-dl.c
|
|
|
|
if ${HOST_CC} -o need-dl.out -D_GNU_SOURCE need-dl.c > /dev/null 2>&1; then \
|
|
|
|
echo > ${.TARGET}; \
|
|
|
|
elif ${HOST_CC} -o need-dl.out -D_GNU_SOURCE need-dl.c -ldl > /dev/null 2>&1; then \
|
|
|
|
echo -ldl > ${.TARGET}; \
|
|
|
|
else \
|
|
|
|
echo > ${.TARGET}; \
|
|
|
|
fi
|
|
|
|
|
|
|
|
CLEANFILES+= need-dl need-dl.c need-dl.out
|
|
|
|
|
|
|
|
cleandir: cleandir-llvm
|
|
|
|
|
|
|
|
cleandir-llvm:
|
2011-07-07 09:41:59 +04:00
|
|
|
test ! -d config || rm -r config
|
2011-02-06 04:13:42 +03:00
|
|
|
rm -f need-dl need-dl.tmp
|
|
|
|
|
|
|
|
.include <bsd.hostprog.mk>
|