##
-# Copyright (c) 2007 Apple Inc. All rights reserved.
+# Copyright (c) 2007-2010 Apple Inc. All rights reserved.
#
# @APPLE_LICENSE_HEADER_START@
#
run: all
all:
- ${CC} ${CCFLAGS} main.c -o main -undefined dynamic_lookup
+ ${CC} ${CCFLAGS} main.c -o main -undefined dynamic_lookup
nm -m main | grep _foo | grep "dynamically looked up" | ${FAIL_IF_EMPTY}
+ ${DYLDINFO} -lazy_bind -bind main | grep _foo | grep "flat-namespace" | ${FAIL_IF_EMPTY}
+ ${DYLDINFO} -lazy_bind -bind main | grep _exit | grep "flat-namespace" | ${FAIL_IF_STDIN}
${FAIL_IF_BAD_MACHO} main
${CC} ${CCFLAGS} main.c -o main -Wl,-U,_foo
nm -m main | grep _foo | grep "dynamically looked up" | ${FAIL_IF_EMPTY}
+ ${DYLDINFO} -lazy_bind -bind main | grep _foo | grep "flat-namespace" | ${FAIL_IF_EMPTY}
+ ${DYLDINFO} -lazy_bind -bind main | grep _exit | grep "flat-namespace" | ${FAIL_IF_STDIN}
${FAIL_IF_BAD_MACHO} main
${CC} ${CCFLAGS} main.c -o main -flat_namespace -Wl,-U,_foo
nm -m main | grep _foo | grep "dynamically looked up" | ${FAIL_IF_STDIN}
- ${PASS_IFF_GOOD_MACHO} main
+ ${DYLDINFO} -lazy_bind -bind main | grep _foo | grep "flat-namespace" | ${FAIL_IF_EMPTY}
+ ${DYLDINFO} -lazy_bind -bind main | grep _exit | grep "flat-namespace" | ${FAIL_IF_EMPTY}
+ ${FAIL_IF_BAD_MACHO} main
+
+ ${CC} ${CCFLAGS} main.c -bundle -o main.bundle -nodefaultlibs -undefined dynamic_lookup
+ nm -m main.bundle | grep _foo | grep "dynamically looked up" | ${FAIL_IF_EMPTY}
+ ${DYLDINFO} -lazy_bind -bind main.bundle | grep _foo | grep "flat-namespace" | ${FAIL_IF_EMPTY}
+ ${DYLDINFO} -lazy_bind -bind main.bundle | grep _exit | grep "flat-namespace" | ${FAIL_IF_STDIN}
+ ${PASS_IFF_GOOD_MACHO} main.bundle
+
clean:
- rm main
+ rm -f main main.bundle