1 # $NetBSD: Makefile,v 1.20 2015/03/05 10:22:25 joerg Exp $
6 # Do *not* set HOSTPROG or HOSTLIB at this point otherwise
7 # it will create a loop trying to extract the object directory.
9 .
include "Makefile.inc"
10 .
include "${LLVM_TOPLEVEL}/lib/Makefile.inc"
12 realdepends realall
: config
/config.status need-dl need-terminfo
14 config
/config.status
: ${LLVM_SRCDIR}/configure
16 printf
'#!/bin/sh\necho 2.7.3' > config
/python
17 chmod
755 config
/python
18 cd config
&& ${HOST_SH} ${LLVM_SRCDIR}/configure
${LLVM_CONFIGURE_ARGS} \
19 --enable-optimized CC
=${HOST_CC
:Q
} CXX
=${HOST_CXX
:Q
} \
20 --with-python
=${.OBJDIR
}/config
/python
21 # --disable-assertions
24 printf
'#include <dlfcn.h>\nint main(void){void *p; return dladdr(p, p);}' > need-dl.c
25 if
${HOST_CC} -o need-dl.out
-D_GNU_SOURCE need-dl.c
> /dev
/null
2>&1; then \
27 elif
${HOST_CC} -o need-dl.out
-D_GNU_SOURCE need-dl.c
-ldl
> /dev
/null
2>&1; then \
28 echo
-ldl
> ${.TARGET
}; \
34 printf
'#include <term.h>\nint main(void){return setupterm(0, 0, 0);}' > need-terminfo.c
35 for lib in tinfo terminfo ncurses curses
; do \
36 if
${HOST_CC} -o need-terminfo.out need-terminfo.c
-l
$$lib > /dev
/null
2>&1; then \
37 echo
-l
$$lib > ${.TARGET
}; \
42 CLEANFILES
+= need-dl need-dl.c need-dl.out need-terminfo need-terminfo.c need-terminfo.out
44 cleandir
: cleandir-llvm
47 test ! -d config ||
rm -r config
48 rm -f need-dl need-dl.tmp
50 .
include <bsd.hostprog.mk
>