]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
configure: fix run-compiler for old /bin/sh
authorAlejandro R. Sedeño <asedeno@mit.edu>
Tue, 30 May 2023 21:56:58 +0000 (17:56 -0400)
committerDaniel Stenberg <daniel@haxx.se>
Wed, 31 May 2023 06:56:23 +0000 (08:56 +0200)
If you try to assign and export on the same line on some older /bin/sh
implementations, it complains:

```
$ export "NAME=value"
NAME=value: is not an identifier
```

This commit rewrites run-compiler's assignments and exports to work with
old /bin/sh, splitting assignment and export into two separate
statements, and only quote the value. So now we have:

```
NAME="value"
export NAME
```

While we're here, make the same change to the two supporting
assign+export lines preceeding the script to be consistent with how
exports work throughout the rest of configure.ac.

Closes #11228

configure.ac

index b358f9a1fa4af21fc772d39dea37b3f3dbb2fea7..02ad622f2cb717bda94f2923ce0c7696fbbb6e09 100644 (file)
@@ -193,11 +193,15 @@ dnl something different but only have that affect the execution of the results
 dnl of the compile, not change the libraries for the compiler itself.
 dnl
 compilersh="run-compiler"
-export "CURL_SAVED_CC=$CC"
-export "CURL_SAVED_LD_LIBRARY_PATH=$LD_LIBRARY_PATH"
+CURL_SAVED_CC="$CC"
+export CURL_SAVED_CC
+CURL_SAVED_LD_LIBRARY_PATH="$LD_LIBRARY_PATH"
+export CURL_SAVED_LD_LIBRARY_PATH
 cat <<\EOF > "$compilersh"
-export "CC=$CURL_SAVED_CC"
-export "LD_LIBRARY_PATH=$CURL_SAVED_LD_LIBRARY_PATH"
+CC="$CURL_SAVED_CC"
+export CC
+LD_LIBRARY_PATH="$CURL_SAVED_LD_LIBRARY_PATH"
+export LD_LIBRARY_PATH
 exec $CC "$@"
 EOF