]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
tests: Support older GNU Modula-2 compilers.
authorBruno Haible <bruno@clisp.org>
Mon, 28 Apr 2025 14:22:32 +0000 (16:22 +0200)
committerBruno Haible <bruno@clisp.org>
Mon, 28 Apr 2025 14:22:32 +0000 (16:22 +0200)
* gettext-tools/tests/lang-modula2: Don't use the option -fscaffold-main.

gettext-tools/tests/lang-modula2

index b4b111e7a94d35fcf22f9c19114afcc002f1b9ab..29938574232fbd18032057bf54387861ac2af861 100644 (file)
@@ -110,17 +110,29 @@ test -d fr/LC_MESSAGES || mkdir fr/LC_MESSAGES
 : ${MSGFMT=msgfmt}
 ${MSGFMT} -o fr/LC_MESSAGES/prog.mo fr.po
 
-${M2C} ${M2FLAGS} -I"$top_builddir"/../gettext-runtime/intl-modula2 \
-       -c -fscaffold-main prog.mod \
-  || Exit 1
-
-: ${CONFIG_SHELL=${SHELL-/bin/sh}}
-${CONFIG_SHELL} "$top_builddir"/libtool --quiet --tag=CC --mode=link \
-  ${M2C} ${M2FLAGS} -o prog \
-                    prog.${OBJEXT} \
-                    "$top_builddir"/../gettext-runtime/intl-modula2/libintl_m2.la \
-                    ${LTLIBINTL} \
-  || Exit 1
+if false; then
+  # Separate compilation requires the option -fscaffold-main, that was not
+  # present in gm2 versions before GCC 13.
+  ${M2C} ${M2FLAGS} -I"$top_builddir"/../gettext-runtime/intl-modula2 \
+         -c -fscaffold-main prog.mod \
+    || Exit 1
+
+  : ${CONFIG_SHELL=${SHELL-/bin/sh}}
+  ${CONFIG_SHELL} "$top_builddir"/libtool --quiet --tag=CC --mode=link \
+    ${M2C} ${M2FLAGS} -o prog \
+                      prog.${OBJEXT} \
+                      "$top_builddir"/../gettext-runtime/intl-modula2/libintl_m2.la \
+                      ${LTLIBINTL} \
+    || Exit 1
+else
+  ${CONFIG_SHELL} "$top_builddir"/libtool --quiet --tag=CC --mode=link \
+    ${M2C} ${M2FLAGS} -I"$top_builddir"/../gettext-runtime/intl-modula2 \
+                      -o prog \
+                      prog.mod \
+                      "$top_builddir"/../gettext-runtime/intl-modula2/libintl_m2.la \
+                      ${LTLIBINTL} \
+    || Exit 1
+fi
 
 : ${DIFF=diff}
 cat <<\EOF > prog.ok