--- ./makefile.orig	2024-10-31 00:50:23.320196000 -0400
+++ ./makefile	2024-10-31 00:50:23.510132000 -0400
@@ -416,19 +416,19 @@
 
 default:
 	@$(MAKE) common-tasks
-	@./tools/buildall.sh $(MAKE) $(CC) $(OSNAME) $(CFLAGS) $(BUILDOPTS)
+	@./tools/buildall.sh $(MAKE) "$(CC)" $(OSNAME) $(CFLAGS) $(BUILDOPTS)
 
 shared:
 	@$(MAKE) common-tasks
-	@./tools/buildall.sh shared $(MAKE) $(CC) $(OSNAME) $(CFLAGS) $(BUILDOPTS)
+	@./tools/buildall.sh shared $(MAKE) "$(CC)" $(OSNAME) $(CFLAGS) $(BUILDOPTS)
 
 debug:
 	@$(MAKE) common-tasks
-	@./tools/buildall.sh $(MAKE) $(CC) $(OSNAME) $(CFLAGS_DEBUG) $(BUILDOPTS)
+	@./tools/buildall.sh $(MAKE) "$(CC)" $(OSNAME) $(CFLAGS_DEBUG) $(BUILDOPTS)
 
 generic:
 	@$(MAKE) common-tasks
-	@./tools/buildall.sh generic $(MAKE) $(CC) $(OSNAME) $(CFLAGS) $(BUILDOPTS)
+	@./tools/buildall.sh generic $(MAKE) "$(CC)" $(OSNAME) $(CFLAGS) $(BUILDOPTS)
 
 # Special-case targets.  The "analyse" target isn't used directly but is
 # invoked as part of the clang static analyser build process.  analyse-gcc
--- ./tools/buildall.sh.orig	2024-10-03 22:59:12.000000000 -0400
+++ ./tools/buildall.sh	2024-10-31 00:50:23.517152000 -0400
@@ -123,7 +123,7 @@
 if [ "$OSNAME" = "SunOS" ] ; then
 	for sunccpath in $SUNCCPATHS ; do
 		if [ -f $sunccpath ] ; then
-			checkSunCompilerVersion $CC $sunccpath ;
+			checkSunCompilerVersion "$CC" $sunccpath ;
 			break ;
 		fi
 	done
@@ -147,9 +147,9 @@
 if [ $ANALYSE -le 0 ] || [ "$CC" != "gcc" ] ; then
 	if [ "$OSNAME" = "SunOS" ] ; then
 		# shellcheck disable=SC2006 # Antediluvian Sun tools.
-		CC=`./tools/getcompiler.sh $CC $OSNAME` ;
+		CC=`./tools/getcompiler.sh "$CC" $OSNAME` ;
 	else
-		CC="$(./tools/getcompiler.sh $CC $OSNAME)" ;
+		CC="$(./tools/getcompiler.sh "$CC" $OSNAME)" ;
 	fi
 fi
 
@@ -219,19 +219,19 @@
 # we add an extra character to the comparison string to avoid syntax errors.
 
 if [ $ANALYSE -gt 0 ] ; then
-	CFLAGS="$(./tools/ccopts.sh analyse $CC $OSNAME)" ;
+	CFLAGS="$(./tools/ccopts.sh analyse "$CC" $OSNAME)" ;
 elif [ $ISSPECIAL -gt 0 ] ; then
-	CFLAGS="$(./tools/ccopts.sh special $CC $OSNAME)" ;
+	CFLAGS="$(./tools/ccopts.sh special "$CC" $OSNAME)" ;
 elif [ $GENERICBUILD -gt 0 ] ; then
-	CFLAGS="$(./tools/ccopts.sh generic $CC $OSNAME)" ;
+	CFLAGS="$(./tools/ccopts.sh generic "$CC" $OSNAME)" ;
 elif [ $SHARED -gt 0 ] ; then
-	CFLAGS="$(./tools/ccopts.sh shared $CC $OSNAME)" ;
+	CFLAGS="$(./tools/ccopts.sh shared "$CC" $OSNAME)" ;
 else
 	if [ "$OSNAME" = "SunOS" ] ; then
 		# shellcheck disable=SC2006 # Antediluvian Sun tools.
-		CFLAGS=`./tools/ccopts.sh $CC $OSNAME` ;
+		CFLAGS=`./tools/ccopts.sh "$CC" $OSNAME` ;
 	else
-		CFLAGS="$(./tools/ccopts.sh $CC $OSNAME)" ;
+		CFLAGS="$(./tools/ccopts.sh "$CC" $OSNAME)" ;
 	fi ;
 fi
 # shellcheck disable=SC2050 # "'x' expression is constant".
@@ -259,7 +259,7 @@
 # shellcheck disable=SC2050 # "'x' expression is constant".
 if [ '$(CROSSCOMPILE)x' = '1x' ] ; then
 	echo "Cross-compiling for OS target $OSNAME" ;
-	CFLAGS="$* $(./tools/ccopts-crosscompile.sh $CC $OSNAME) \
+	CFLAGS="$* $(./tools/ccopts-crosscompile.sh "$CC" $OSNAME) \
 			-DOSVERSION=$(./tools/osversion.sh $OSNAME)" ;
 	if [ $SHARED -gt 0 ] ; then
 		$MAKE TARGET="$SLIBNAME" OBJPATH="$SHARED_OBJ_PATH" "$CFLAGS" "$OSNAME" ;
--- ./tools/ccopts.sh.orig	2024-10-31 00:50:22.771693000 -0400
+++ ./tools/ccopts.sh	2024-10-31 00:50:23.520522000 -0400
@@ -298,7 +298,7 @@
 if [ "$($CC -v 2>&1 | grep -c "ccc-analyzer")" -gt 0 ] ; then
 	ISCLANG_ANALYSER=1 ;
 fi
-if [ $ISCLANG -le 0 ] && [ $CC != "xlc" ] && [ "$($CC -v 2>&1 | grep -c "gcc")" -gt 0 ] ; then
+if [ $ISCLANG -le 0 ] && [ "$CC" != "xlc" ] && [ "$($CC -v 2>&1 | grep -c "gcc")" -gt 0 ] ; then
 	ISGCC=1 ;
 fi
 if [ $ISCLANG_ANALYSER -gt 0 ] ; then
@@ -316,7 +316,7 @@
 # Find out which version of clang or gcc we're using.
 
 if [ $ISCLANG -gt 0 ] || [ $ISGCC -gt 0 ] ; then
-	COMPILER_VER="$(./tools/getcompiler_ver.sh $CC)" ;
+	COMPILER_VER="$(./tools/getcompiler_ver.sh "$CC")" ;
 fi
 
 # Determine whether various optional system features are installed and
@@ -1018,7 +1018,7 @@
 #			 on some versions of the compiler).
 
 if [ "$OSNAME" = "AIX" ] ; then
-	if [ $CC = "xlc" ] ; then
+	if [ "$CC" = "xlc" ] ; then
 		echo "$CCARGS -qlanglvl=extended0x -qmaxmem=-1 -qnolist -qroconst" ;
 		exit 0 ;
 	fi ;
--- ./tools/getlibs.sh.orig	2024-09-16 20:08:50.000000000 -0400
+++ ./tools/getlibs.sh	2024-10-31 00:50:23.514406000 -0400
@@ -29,12 +29,12 @@
 if [ $ISSPECIAL -eq 0 ] ; then
 	if [ "$OSNAME" = "SunOS" ] ; then
 		# shellcheck disable=SC2006 # Antediluvian Sun tools.
-		BUILDOPTS=`./tools/ccopts.sh $CC $OSNAME 2>/dev/null` ;
+		BUILDOPTS=`./tools/ccopts.sh "$CC" $OSNAME 2>/dev/null` ;
 	else
-		BUILDOPTS="$(./tools/ccopts.sh $CC $OSNAME 2>/dev/null)" ;
+		BUILDOPTS="$(./tools/ccopts.sh "$CC" $OSNAME 2>/dev/null)" ;
 	fi ;
 else
-	BUILDOPTS="$(./tools/ccopts.sh special $CC $OSNAME 2>/dev/null)" ;
+	BUILDOPTS="$(./tools/ccopts.sh special "$CC" $OSNAME 2>/dev/null)" ;
 fi
 
 hasSubstring()
@@ -218,4 +218,4 @@
 
 # Finally, report what we've found
 
-echo "$LDARGS"
\ No newline at end of file
+echo "$LDARGS"
