# test that second -o works
${CC} ${CCFLAGS} -dynamiclib baz.c -o libbaz.${ARCH}.dylib foo.${ARCH}.dylib
+ ${FAIL_IF_BAD_MACHO} foo.${ARCH}.dylib
# test that -o and -install_name works with install_name as an allowable
${CC} ${CCFLAGS} -dynamiclib bar.c -o temp.${ARCH}.dylib -install_name /tmp/libbar.${ARCH}.dylib foo.${ARCH}.dylib
${FAIL_IF_BAD_MACHO} temp.${ARCH}.dylib
+# test that -install_name works with variant name
+ ${CC} ${CCFLAGS} -dynamiclib bar.c -o temp.${ARCH}.dylib -install_name /tmp/libbar_profile foo.${ARCH}.dylib
+ ${FAIL_IF_BAD_MACHO} temp.${ARCH}.dylib
+
# test that -o and -install_name fails with install_name different than allowable
-### ${FAIL_IF_SUCCESS} ${CC} ${CCFLAGS} -dynamiclib bar.c -o bar.${ARCH}.dylib -install_name /tmp/fail.${ARCH}.dylib foo.${ARCH}.dylib >& fail.log
+ ${FAIL_IF_SUCCESS} ${CC} ${CCFLAGS} -dynamiclib bar.c -o bar.${ARCH}.dylib -install_name /tmp/fail.${ARCH}.dylib foo.${ARCH}.dylib >& fail.log
# test that a bundle and no client_name fails
-### ${FAIL_IF_SUCCESS} ${CC} ${CCFLAGS} -bundle bar.c -o temp.${ARCH}.bundle foo.${ARCH}.dylib >& fail.log
+ ${FAIL_IF_SUCCESS} ${CC} ${CCFLAGS} -bundle bar.c -o temp.${ARCH}.bundle foo.${ARCH}.dylib >& fail.log
# test that a bundle and an allowable client_name passes
${CC} ${CCFLAGS} -bundle bar.c -client_name bar -o bar.${ARCH}.bundle foo.${ARCH}.dylib
${CC} ${CCFLAGS} -dynamiclib foo.${ARCH}.dylib -o foo.framework/foo
${FAIL_IF_BAD_MACHO} foo.framework/foo
+# test umbrella variant can link against subs
+ mkdir -p foo.framework
+ ${CC} ${CCFLAGS} -dynamiclib foo.${ARCH}.dylib -o foo.framework/foo_debug -install_name /path/foo.framework/foo_debug
+ ${FAIL_IF_BAD_MACHO} foo.framework/foo_debug
+
# test sibling in umbrella can link against subs
${CC} ${CCFLAGS} -dynamiclib main.c -umbrella foo foo.${ARCH}.dylib -o ./main.dylib
${FAIL_IF_BAD_MACHO} main.dylib
${FAIL_IF_BAD_MACHO} main.${ARCH}
# test that an executable and no client_name fails
-### ${FAIL_IF_SUCCESS} ${CC} ${CCFLAGS} main.c -o main.${ARCH} foo.${ARCH}.dylib >& fail.log
+ ${FAIL_IF_SUCCESS} ${CC} ${CCFLAGS} main.c -o main.${ARCH} foo.${ARCH}.dylib >& fail.log
# test that an executable and an allowable client_name passes
-# ${CC} ${CCFLAGS} main.c -o main.${ARCH} -client_name bar foo.${ARCH}.dylib
-# ${PASS_IFF_GOOD_MACHO} main.${ARCH}
+ ${CC} ${CCFLAGS} main.c -o main.${ARCH} -client_name bar foo.${ARCH}.dylib
+ ${PASS_IFF_GOOD_MACHO} main.${ARCH}
+# test that a regular dylib can be made unlinkable by using -allowable_client
+ ${CC} ${CCFLAGS} -dynamiclib foo.c -allowable_client '!' -o unlinkable_foo.${ARCH}.dylib
+ ${FAIL_IF_BAD_MACHO} unlinkable_foo.${ARCH}.dylib
+ ${FAIL_IF_SUCCESS} ${CC} ${CCFLAGS} main.c -o main.${ARCH} unlinkable_foo.${ARCH}.dylib >& fail.log
+
+# test that a regular dylib can be made linkable by only specially named clients
+ ${CC} ${CCFLAGS} -dynamiclib foo.c -allowable_client special -o restrictive_foo.${ARCH}.dylib
+ ${FAIL_IF_BAD_MACHO} restrictive_foo.${ARCH}.dylib
+ ${FAIL_IF_SUCCESS} ${CC} ${CCFLAGS} main.c -o main.${ARCH} restrictive_foo.${ARCH}.dylib >& fail.log
+ ${CC} ${CCFLAGS} main.c -o main.${ARCH} -client_name special restrictive_foo.${ARCH}.dylib
+ ${FAIL_IF_BAD_MACHO} main.${ARCH}
# print final pass
${PASS_IFF_GOOD_MACHO} foo.${ARCH}.dylib
clean:
-
- rm -rf *.${ARCH}.dylib *.${ARCH}.bundle main.${ARCH} fail.log foo.framework bar.framework main.dylib
+ rm -rf *.dylib *.bundle main.???* fail.log *.framework