blob: 4a620738796cabf5d8453ccc993ceabbcf0c0430 [file] [log] [blame]
#!/bin/sh -e
# Create the product header.
sed -E -e 's/<WebCore\//<WebKitLegacy\//' -e "s/(^ *)WEBCORE_EXPORT /\1/" "${INPUT_FILE_PATH}" > "${SCRIPT_OUTPUT_FILE_0}"
# Create a forwarding header to make all imports of this header use WebKitLegacy's header map.
echo "#import <WebKitLegacy/${INPUT_FILE_NAME}>" > "${SCRIPT_OUTPUT_FILE_1}"
if [ ${WK_PLATFORM_NAME} != macosx ]; then
# *_SEARCH_PATHS are already shell-escaped, convert to an array so we can pass a flag for each path.
# Note that this method does not work for search paths which contain spaces (rdar://91303280).
eval HEADER_SEARCH_PATHS=(${HEADER_SEARCH_PATHS} ${SYSTEM_HEADER_SEARCH_PATHS})
eval FRAMEWORK_SEARCH_PATHS=(${FRAMEWORK_SEARCH_PATHS} ${SYSTEM_FRAMEWORK_SEARCH_PATHS})
# Create an export list, which will be used by "Generate Export Files" to make the
# EXPORTED_SYMBOLS_FILE passes to the linker.
for WK_CURRENT_ARCH in ${ARCHS}; do
tapi reexport -target ${WK_CURRENT_ARCH}-${LLVM_TARGET_TRIPLE_VENDOR}-${LLVM_TARGET_TRIPLE_OS_VERSION}${LLVM_TARGET_TRIPLE_SUFFIX} -isysroot ${SDK_DIR} -I${BUILT_PRODUCTS_DIR} ${HEADER_SEARCH_PATHS[@]/#/-I} -F${BUILT_PRODUCTS_DIR} ${FRAMEWORK_SEARCH_PATHS[@]/#/-F} -DWEBCORE_EXPORT= "${SDK_DIR}/usr/include/TargetConditionals.h" "${INPUT_FILE_PATH}" -o /dev/stdout
done > "${SCRIPT_OUTPUT_FILE_2}"
else
# Mac platforms don't use this export list.
touch "${SCRIPT_OUTPUT_FILE_2}"
fi