X-Git-Url: https://git.saurik.com/apple/xnu.git/blobdiff_plain/6d2010ae8f7a6078e10b361c6962983bab233e0f..bca245acd4c03fd752d1a45f011ad495e60fe53d:/bsd/sys/make_symbol_aliasing.sh diff --git a/bsd/sys/make_symbol_aliasing.sh b/bsd/sys/make_symbol_aliasing.sh index fa5f0e33c..8e98dee4b 100755 --- a/bsd/sys/make_symbol_aliasing.sh +++ b/bsd/sys/make_symbol_aliasing.sh @@ -22,6 +22,25 @@ # @APPLE_OSREFERENCE_LICENSE_HEADER_END@ # +function usage() { + echo "Usage: $0 " 1>&2 + exit 1 +} + +if [ $# -ne 2 ]; then + usage +fi + +SDKROOT="$1" +OUTPUT="$2" + +AVAILABILITY_PL="${SDKROOT}/${DRIVERKITROOT}/usr/local/libexec/availability.pl" + +if [ ! -x "${AVAILABILITY_PL}" ] ; then + echo "Unable to locate ${AVAILABILITY_PL} (or not executable)" >&2 + exit 1 +fi + { cat <= ${value}" echo "#define __DARWIN_ALIAS_STARTING_MAC_${str}(x) x" echo "#else" @@ -82,5 +115,5 @@ for ver in $(${SDKROOT}/usr/local/libexec/availability.pl --macosx) ; do echo "#endif" echo "" done -} > $1 +} > "$OUTPUT"