History

configure: handle spaces correctly in $source_path

Add very few missing quotes where IFS/globs were applied to arbitrary user input (commands, arguments, but not assignments or case $var in. In fn_makelink $dn/$2/$f don't have IFS/globs). While configure now handles it correctly, there are 2 issues: - eval opt=\"$opt\" coalesces IFS chars (--prefix="$HOME/x y"). - Even with the eval removed, (gnu) make still fails to find it. I made few quick experiments with quoting these values in config.mak, but that had no impact, and make -d was not helpful. Was worth a try. So no spaces in paths, but at least configure can handle the src path.

Avi Halachmi (:avih) committed 1 year ago

Commit c45559e1 parent 9289c6c1 file · +4 −4Browse files

Unified · Split

configure+4−4
@@ -438,7 +438,7 @@ fi · 437 unmodified lines
438 438
439if test -z "$build_cross"; then439if test -z "$build_cross"; then
440 CONFTEST=./conftest$EXESUF440 CONFTEST=./conftest$EXESUF
441 if ! $cc -o $CONFTEST $source_path/conftest.c ; then441 if ! $cc -o $CONFTEST "$source_path/conftest.c" ; then
442 echo "configure: error: '$cc' failed to compile conftest.c."442 echo "configure: error: '$cc' failed to compile conftest.c."
443 else443 else
444 cc_name="$($CONFTEST compiler)"444 cc_name="$($CONFTEST compiler)"
@@ -553,7 +553,7 @@ fcho "Switches " "$tcc_switches" · 108 unmodified lines
553fcho "Config " "${confvars# }"553fcho "Config " "${confvars# }"
554echo "Creating config.mak and config.h"554echo "Creating config.mak and config.h"
555 555
556version=`head $source_path/VERSION`556version=$(head "$source_path/VERSION")
557 557
558cat >config.mak <<EOF558cat >config.mak <<EOF
559# Automatically generated by configure - do not modify559# Automatically generated by configure - do not modify
@@ -726,13 +726,13 @@ fn_makelink() · 166 unmodified lines
726 ;;726 ;;
727 esac727 esac
728 728
729 ln -sfn $tgt $2 || ( echo "ln failed. Using cp instead."; cp -f $1/$2 $2 )729 ln -sfn "$tgt" $2 || ( echo "ln failed. Using cp instead."; cp -f "$1/$2" $2 )
730}730}
731 731
732if test "$source_path_used" = "yes" ; then732if test "$source_path_used" = "yes" ; then
733 FILES="Makefile lib/Makefile tests/Makefile tests/tests2/Makefile tests/pp/Makefile"733 FILES="Makefile lib/Makefile tests/Makefile tests/tests2/Makefile tests/pp/Makefile"
734 for f in $FILES ; do734 for f in $FILES ; do
735 fn_makelink $source_path $f735 fn_makelink "$source_path" $f
736 done736 done
737fi737fi
738 738

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t