Welcome to little lamb

Code » comain » commit e72dd70

More POSIX sh fixes

author Olivier Brunel
2023-07-23 11:53:49 UTC
committer Olivier Brunel
2023-07-23 11:54:50 UTC
parent 198d5c66253357302b4cfb9d31cdc6b77150936e

More POSIX sh fixes

configure +7 -5

diff --git a/configure b/configure
index dddf944..545fbe2 100755
--- a/configure
+++ b/configure
@@ -887,6 +887,8 @@ setupobjs()
     local docs_objs
     local d
     # FIXME find's -printf isn't POSIX
+    lf="
+"
     for d in src/*; do
         local name="$(expr substr "$d" 5 ${#d})"
         if test "$name" = "*" || test "$name" = "include"; then continue; fi
@@ -896,25 +898,25 @@ setupobjs()
         elif test "$name" = "doc"; then
             if test $nodoc -eq 1; then continue; fi
             objs="$(find "$d" -name '*.md' \! -path "$d"/include/'*')"
-            for i in {9..0}; do
+            for i in 9 8 7 6 5 4 3 2 1 0; do
                 local s="$(echo "$objs" \
                     | sed -e 's/^src\/doc\/\(.\+\).'$i'.md$/build\/doc\/\1.'$i'.md/g' \
                         -e 's/src\/.\+$//g' \
                     | tr '\n' ' ' | sed -e 's/ \+/ /g')"
-                BLD_DOCS="BLD_MD$i=$s"$'\n'"$BLD_DOCS"
+                BLD_DOCS="BLD_MD$i=$s$lf$BLD_DOCS"
             done
             BLD_DOCS="BLD_DOCS=$(echo "$objs" \
                 | sed -e 's/^src\/doc.*\/\(.\+\.\(.\)\.md\)$/\2\/\1/g' \
-                | tr '\n' ' ' | sed -e 's/ \+/ /g')"$'\n'"$BLD_DOCS"
+                | tr '\n' ' ' | sed -e 's/ \+/ /g')$lf$BLD_DOCS"
             BLD_DOCS="$(echo "$objs" \
                 | sed -e 's/^src\/doc\(.*\)\/\(.\+\.\(.\)\.md\)$/\$(DESTMD)\/\3\/\2: build\/doc\1\/\2\n	$(INSTMD)/g' \
-                )"$'\n'"$BLD_DOCS"
+                )$lf$BLD_DOCS"
             continue
         elif test "$(expr substr "$name" 1 3)" = "lib"; then
             objs="$(find "$d"/include -type f)"
             INST_HDR="$(echo "$objs" \
                 | sed -e 's/^src\/lib\(.\+\)\/include\/\(.\+\)$/$(DESTDIR)$(INCDIR)\/\2: \0\n	$(INSTHDR)/g' \
-                )"$'\n'"$INST_HDR"
+                )$lf$INST_HDR"
             HEADERS="$(echo "$objs" \
                 | sed -e 's/^src\/lib.\+\/include\/\(.\+\)$/\1/g' \
                 | tr '\n' ' ') $HEADERS"