2012-06-16 21:01:02 +04:00
|
|
|
# $NetBSD: Makefile,v 1.14 2012/06/16 17:01:04 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"
|
|
|
|
|
|
|
|
realdepends realall: config/config.status need-dl \
|
|
|
|
config/include/clang/Basic/Version.inc
|
|
|
|
|
|
|
|
config/include/clang/Basic/Version.inc: \
|
|
|
|
${LLVM_TOPLEVEL}/config/clang/Basic/Version.inc
|
|
|
|
mkdir -p ${.TARGET:H}
|
|
|
|
cat < ${.ALLSRC} > ${.TARGET}
|
|
|
|
|
|
|
|
config/config.status: ${LLVM_SRCDIR}/configure
|
|
|
|
mkdir -p config
|
2011-07-18 22:37:15 +04:00
|
|
|
cd config && ${LLVM_SRCDIR}/configure CC=${HOST_CC:Q} --prefix=/usr \
|
|
|
|
--enable-targets=x86,powerpc,sparc,arm,mips \
|
|
|
|
--host=${MACHINE_GNU_PLATFORM} \
|
2012-06-16 21:01:02 +04:00
|
|
|
--with-c-include-dirs=/usr/include/clang-3.2:/usr/include \
|
2012-02-28 21:09:29 +04:00
|
|
|
--with-clang-srcdir=${CLANG_SRCDIR} \
|
2012-05-31 22:52:16 +04:00
|
|
|
--enable-optimized llvm_cv_gnu_make_command=${MAKE}
|
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>
|