diff --git a/interfaces-and-libraries.sh b/interfaces-and-libraries.sh index 6ef70a156d..efe2a372a4 100755 --- a/interfaces-and-libraries.sh +++ b/interfaces-and-libraries.sh @@ -171,7 +171,7 @@ function setUpInterfacesAndLibraries() if [ $BUILD_68K != false ]; then echo "Converting 68K static libraries..." for macobj in "${M68KLIBRARIES}/"*.o; do - if [ -r $macobj ]; then + if [ -r "$macobj" ]; then libname=`basename "$macobj"` libname=${libname%.o} printf " %30s => %-30s\n" ${libname}.o lib${libname}.a @@ -203,17 +203,17 @@ function setUpInterfacesAndLibraries() ;; esac - if [ -d ${PPCLIBRARIES} ]; then + if [ -d "${PPCLIBRARIES}" ]; then echo "Copying static PPC libraries" - for obj in ${PPCLIBRARIES}/OpenT*.o ${PPCLIBRARIES}/CarbonAccessors.o ${PPCLIBRARIES}/CursorDevicesGlue.o; do - if [ -r $obj ]; then + for obj in "${PPCLIBRARIES}/OpenT*.o" "${PPCLIBRARIES}/CarbonAccessors.o" "${PPCLIBRARIES}/CursorDevicesGlue.o"; do + if [ -r "$obj" ]; then # copy the library: - cp $obj $PREFIX/powerpc-apple-macos/lib/ + cp "$obj" "$PREFIX/powerpc-apple-macos/lib/" # and wrap it in a .a archive for convenience - lib=$PREFIX/powerpc-apple-macos/lib/lib`basename "${obj%.o}"`.a - rm -f $lib - $PREFIX/bin/powerpc-apple-macos-ar cqs $lib $obj + lib="$PREFIX"/powerpc-apple-macos/lib/lib`basename "${obj%.o}"`.a + rm -f "$lib" + powerpc-apple-macos-ar cqs "$lib" "$obj" fi done fi @@ -228,12 +228,13 @@ if [ "$0" = "$BASH_SOURCE" ]; then exit 1 fi - PREFIX=$1 - INTERFACES_DIR=$2 + PREFIX="$1" + INTERFACES_DIR="$2" BUILD_68K=${3:-true} BUILD_PPC=${4:-true} BUILD_CARBON=${5:-true} SRC=$(cd `dirname $0` && pwd -P) + export PATH="$PREFIX/bin:$PATH" locateAndCheckInterfacesAndLibraries setUpInterfacesAndLibraries diff --git a/prepare-headers.sh b/prepare-headers.sh index b920b7673b..a39c9143b9 100644 --- a/prepare-headers.sh +++ b/prepare-headers.sh @@ -1,10 +1,10 @@ -IN=$1 -OUT=$2 +IN="$1" +OUT="$2" # Make Mac OS X's tr and sed not complain that the files are not UTF-8 export LC_ALL=C -for file in $(cd $IN; ls *.h); do +for file in $(cd "$IN"; ls *.h); do # Filter by file names. # Some CIncludes packages include the MPW standard library. # Header files from that standard library would overwrite @@ -52,12 +52,12 @@ for file in $(cd $IN; ls *.h); do esac if [ $USE = true ]; then - sed 's/\r$//' < $IN/$file | tr '\r' '\n' > $OUT/$file + sed 's/\r$//' < "$IN/$file" | tr '\r' '\n' > "$OUT/$file" fi done ############################# ConditionalMacros.h ############################# -cat > $OUT/ConditionalMacros.h < "$OUT/ConditionalMacros.h" < $OUT/ConditionalMacros.h <> $OUT/ConditionalMacros.h +sed 's/\r$//' < "$IN/ConditionalMacros.h" | tr '\r' '\n' | sed 's/__GNUC__/__GNUC_DISABLED__/g' >> "$OUT/ConditionalMacros.h" -cat >> $OUT/ConditionalMacros.h <> "$OUT/ConditionalMacros.h" < $OUT/fp.h < "$OUT/fp.h" < $OUT/MixedMode.h +sed 's/\r$//' < "$IN/MixedMode.h" | tr '\r' '\n' | sed 's/Opaque\#\#name\#\#\*/Opaque\#\#name \*/g' > "$OUT/MixedMode.h" ############################# CGBase.h ############################# -if [ -r $IN/CGBase.h ]; then -cat > $OUT/CGBase.h < "$OUT/CGBase.h" < $OUT/CGBase.h <> $OUT/CGBase.h +sed 's/\r$//' < "$IN/CGBase.h" | tr '\r' '\n' >> "$OUT/CGBase.h" -cat >> $OUT/CGBase.h <> "$OUT/CGBase.h" < $OUT/$f - elif [ ! -r $IN/Mac$f ]; then - echo "#include \"$f\"" > $OUT/Mac$f + if [ ! -r "$IN/$f" ]; then + echo "#include \"Mac$f\"" > "$OUT/$f" + elif [ ! -r "$IN/Mac$f" ]; then + echo "#include \"$f\"" > "$OUT/Mac$f" fi done -if [ -d $IN/CoreFoundation ]; then - mkdir -p $OUT/CoreFoundation - for file in $(cd $IN; ls CoreFoundation/*.h); do - sed 's/\r$//' < $IN/$file | tr '\r' '\n' > $OUT/$file +if [ -d "$IN/CoreFoundation" ]; then + mkdir -p "$OUT/CoreFoundation" + for file in $(cd "$IN"; ls CoreFoundation/*.h); do + sed 's/\r$//' < "$IN/$file" | tr '\r' '\n' > "$OUT/$file" done fi diff --git a/prepare-rincludes.sh b/prepare-rincludes.sh index 0143861831..30ccb30bc4 100644 --- a/prepare-rincludes.sh +++ b/prepare-rincludes.sh @@ -1,11 +1,11 @@ -IN=$1 -OUT=$2 +IN="$1" +OUT="$2" # Make Mac OS X's tr and sed not complain that the files are not UTF-8 export LC_ALL=C # cp $IN/[A-Z]*.r $OUT/ -for file in $(cd $IN; ls [A-Z]*.r); do +for file in $(cd "$IN"; ls [A-Z]*.r); do tr '\r' '\n' < $IN/$file > $OUT/$file done