env: Allow text-env tests to run with awk

At present the tests assume that gawk is being used. Adjust the tests so
that the names are inserted in alphabetical order, so that awk is happy.

Also use PROCINFO to make gawk output in alphabetical order. This is not
ideal, since it changes the env-car ordering from what the user provided,
but it may be acceptable.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reported-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Fixes: https://source.denx.de/u-boot/u-boot/-/issues/10
diff --git a/scripts/env2string.awk b/scripts/env2string.awk
index 1bfe9ed..de470a4 100644
--- a/scripts/env2string.awk
+++ b/scripts/env2string.awk
@@ -81,7 +81,10 @@
 	if (do_output) {
 		printf("%s", "#define CONFIG_EXTRA_ENV_TEXT \"")
 
-		# Print out all the variables
+		# Print out all the variables by alphabetic order, if using
+		# gawk. This allows test_env_test.py to work on both awk (where
+		# this next line does nothing)
+		PROCINFO["sorted_in"] = "@ind_str_asc"
 		for (var in vars) {
 			env = vars[var]
 			print var "=" vars[var] "\\0"