ZOSOpenTools / autoconfport

Delta files to build autoconf for z/OS
Apache License 2.0
1 stars 3 forks source link

basic autom4te invocation creates mixed ascii/ebcdic m4 file #1

Closed MikeFultonDev closed 2 years ago

MikeFultonDev commented 2 years ago

Running tests/firstbug.sh and then hacking 'm4' to capture the temporary m4 file it generates, as follows:

!/bin/sh

echo "$" >>/tmp/out tmparg="$2" if [ "${tmparg#/tmp}" != "${tmparg}" ]; then backup=basename ${tmparg} echo "Copied ${tmparg} to /tmp/${backup}.$$" >>/tmp/out cp "${tmparg}" "/tmp/${backup}.$$" fi exec /usr/local/bin/realm4 "$@" and also renaming /usr/local/bin/m4 to /usr/local/bin/realm4

then we can capture the temporary m4 file (probably an easier way, but this worked).

The temporary file is marked as IBM-1047 (should probably be ISO8859-1) but the bigger problem is the contents are mixed.

They start in EBCDIC: divert(-1) changequote([, ])

_at_MODE(SEPARATOR, ELT1, ELT2...)

----------------------------------

List the elements, separating then with SEPARATOR.

MODE can be:

'at' -- the elements are enclosed in brackets.

'star' -- the elements are listed as are.

'percent' -- the elements are 'flattened': spaces are singled out,

and no new line remains.

...

but later there is ASCII:

gnu: line: <__line__> program: <__program__> unix: builtin: changecom: changequote: debugfile: debugmode: decr: define: defn: divert: divnum: dnl: ...

This actually. bounces back and forth a few times

MikeFultonDev commented 2 years ago

this works when using the makeport version of 'make' and the m4port version of 'm4'