#!/bin/sh # Created by Chris Suter # Copyright 2008 Coriolis Systems Limited. All rights reserved. # This script expands macros within the specified Info.plist and # creates an object file with the Info.plist in the appropriate # section. It's better to do it this way rather than with a # -sectcreate parameter to the linker because Xcode tracks the # dependencies correctly if you do it this way. # The eval expands macros. # We use Python to convert new-lines to \n # Lastly we use the assembler to stick the result into an object eval "echo \"`cat "$1"`\"" \ | python -c " import re, sys plist = sys.stdin.read() print '.section __TEXT,__info_plist\n' + '.ascii \"' + re.sub(r'\\n', '\\\\\\\\n', plist) + '\"'" \ | as -arch $CURRENT_ARCH -o "$2"