[tnozaki-flex] mkskel.sh uses ${TOOL_SED} for USETOOLS

Issue #327 resolved
Takehiko NOZAKI repo owner created an issue

there’s override some macro while running mkskel.sh to generate skel.c

see following target in external/bsd/flex/bin/Makefile:

skel.c: flex.skl mkskel.sh flexint.h tables_shared.h
        ${TOOL_SED} -e 's/m4_/m4postproc_/g' -e 's/m4preproc_/m4_/g' \
            ${IDIST}/flex.skl | ${TOOL_M4} -I${IDIST} -P \
            -DFLEX_MAJOR_VERSION=`echo ${VERSION} | cut -f 1 -d .` \
            -DFLEX_MINOR_VERSION=`echo ${VERSION} | cut -f 2 -d .` \
            -DFLEX_SUBMINOR_VERSION=`echo ${VERSION} | cut -f 3 -d .` | \
            ${TOOL_SED} -e 's/m4postproc_/m4_/g' | \
            ${HOST_SH} ${IDIST}/mkskel.sh ${IDIST} ${TOOL_M4} ${VERSION} > ${.TARGET}

Comments (6)

  1. Takehiko NOZAKI reporter

    N HEAD:

    skel.c: flex.skl mkskel.sh flexint.h tables_shared.h
            ${TOOL_SED} -e 's/4_/a4_/g; s/m4preproc_/m4_/g' \
                ${IDIST}/flex.skl | ${TOOL_M4} -I${IDIST} -P \
                -DFLEX_MAJOR_VERSION=`echo ${VERSION} | cut -f 1 -d .` \
                -DFLEX_MINOR_VERSION=`echo ${VERSION} | cut -f 2 -d .` \
                -DFLEX_SUBMINOR_VERSION=`echo ${VERSION} | cut -f 3 -d .` | \
                ${TOOL_SED} -e 's/m4postproc_/m4_/g' | \
                ${HOST_SH} ${IDIST}/mkskel.sh ${IDIST} ${TOOL_M4} ${VERSION} > ${.TARGET}
    

  2. Takehiko NOZAKI reporter

    it seems that N HEAD ${TOOL_SED} -e 's/4_/a4_/g; s/m4preproc_/m4_/g' break ifdef `__ia64__ arch(replaced `__ia6a4__), curious. what are they doing?

  3. Takehiko NOZAKI reporter

    ok, this replacing keyword is done by mkskel.sh but this script can’t override sed by nbsed

    sed 's/4_/a4_/g
    s/m4preproc_/m4_/g
    ' "$srcdir/flex.skl" |
    "$m4" -P -I "$srcdir" "-DFLEX_MAJOR_VERSION=$1" \
       "-DFLEX_MINOR_VERSION=$2" \
       "-DFLEX_SUBMINOR_VERSION=$3" |
    sed '/^%#/d
    s/m4_/m4preproc_/g
    s/a4_/4_/g
    s/[\\"]/\\&/g
    s/.*/  "&",/'
    

  4. Log in to comment