5 # Define RESCUE for make and compiler
6 CRUNCH_BUILDOPTS+= -DRESCUE
7 CRUNCH_CFLAGS+= -DRESCUE
9 # Crunchgen needs to use the right libraries. Normally if DESTDIR is
10 # specified it should also use the target binaries, however if run
11 # from buildworld DESTDIR points to the obj world_x86_64 which is not
12 # entirely populated. In that situation we leave the path alone, it
13 # will point to the cross tools.
15 .if defined(DESTDIR) && ${DESTDIR} != "" && ${DESTDIR} != "/"
16 .if !defined(WORLDBUILD)
17 CRUNCH_CFLAGS+= --sysroot=${DESTDIR}
18 CRUNCHENV+= PATH=${DESTDIR}/sbin:${DESTDIR}/bin:${DESTDIR}/usr/sbin:${DESTDIR}/usr/bin
20 _SHLIBDIRPREFIX= ${DESTDIR}
23 # Apply the same flags to link the crunched binary because crunchgen(1) does
24 # not recognize ${CRUNCH_CFLAGS}.
25 CRUNCH_LINKOPTS+= ${CRUNCH_CFLAGS}
27 # Use soft links to create the crunched program links