1 1.10 adam # $NetBSD: Makefile,v 1.10 2011/07/18 18:37:15 adam Exp $ 2 1.1 joerg 3 1.1 joerg .include <bsd.init.mk> 4 1.1 joerg 5 1.1 joerg # 6 1.1 joerg # Do *not* set HOSTPROG or HOSTLIB at this point otherwise 7 1.1 joerg # it will create a loop trying to extract the object directory. 8 1.1 joerg # 9 1.1 joerg .include "Makefile.inc" 10 1.1 joerg .include "${LLVM_TOPLEVEL}/lib/Makefile.inc" 11 1.1 joerg 12 1.1 joerg realdepends realall: config/config.status need-dl \ 13 1.1 joerg config/include/clang/Basic/Version.inc 14 1.1 joerg 15 1.1 joerg config/include/clang/Basic/Version.inc: \ 16 1.1 joerg ${LLVM_TOPLEVEL}/config/clang/Basic/Version.inc 17 1.1 joerg mkdir -p ${.TARGET:H} 18 1.1 joerg cat < ${.ALLSRC} > ${.TARGET} 19 1.1 joerg 20 1.1 joerg config/config.status: ${LLVM_SRCDIR}/configure 21 1.1 joerg mkdir -p config 22 1.10 adam cd config && ${LLVM_SRCDIR}/configure CC=${HOST_CC:Q} --prefix=/usr \ 23 1.10 adam --enable-targets=x86,powerpc,sparc,arm,mips \ 24 1.10 adam --host=${MACHINE_GNU_PLATFORM} \ 25 1.4 joerg --with-c-include-dirs=/usr/include/clang-3.0:/usr/include \ 26 1.10 adam --enable-optimized --disable-assertions 27 1.4 joerg 28 1.1 joerg need-dl: 29 1.1 joerg printf '#include <dlfcn.h>\nint main(void){void *p; return dladdr(p, p);}' > need-dl.c 30 1.1 joerg if ${HOST_CC} -o need-dl.out -D_GNU_SOURCE need-dl.c > /dev/null 2>&1; then \ 31 1.1 joerg echo > ${.TARGET}; \ 32 1.1 joerg elif ${HOST_CC} -o need-dl.out -D_GNU_SOURCE need-dl.c -ldl > /dev/null 2>&1; then \ 33 1.1 joerg echo -ldl > ${.TARGET}; \ 34 1.1 joerg else \ 35 1.1 joerg echo > ${.TARGET}; \ 36 1.1 joerg fi 37 1.1 joerg 38 1.1 joerg CLEANFILES+= need-dl need-dl.c need-dl.out 39 1.1 joerg 40 1.1 joerg cleandir: cleandir-llvm 41 1.1 joerg 42 1.1 joerg cleandir-llvm: 43 1.9 matt test ! -d config || rm -r config 44 1.1 joerg rm -f need-dl need-dl.tmp 45 1.1 joerg 46 1.1 joerg .include <bsd.hostprog.mk> 47