From cfe95088f6b936d8b110b635bf726cfcb07f4fda Mon Sep 17 00:00:00 2001 From: Reuben Thomas Date: Sat, 27 Jan 2018 13:26:30 +0000 Subject: [PATCH] Fix building of lat1{ansel,iso5426}.h from respective .l files --- build-aux/invert-l-to-h | 5 +++++ src/Makefile.am | 13 ++++++++----- 2 files changed, 13 insertions(+), 5 deletions(-) create mode 100755 build-aux/invert-l-to-h diff --git a/build-aux/invert-l-to-h b/build-aux/invert-l-to-h new file mode 100755 index 0000000..1ae0413 --- /dev/null +++ b/build-aux/invert-l-to-h @@ -0,0 +1,5 @@ +#!/bin/sh +# Invert the conversion in a flex file to get a C header file for the other direction +grep '^\\' $1 | \ + perl -npe 's/{ put_byte \(//;s /, subtask\); }//;s%^\\%%' | \ + perl -ne '($a,$b)=split; $c=substr($a,0,3);$d=substr($a,3);$e = eval "0$c"; next if $b < 0200 ;printf("\t{%d, \"%c%s\"}, %s* %c *%s\n", $b, $e, $d, "/", $b, "/")' diff --git a/src/Makefile.am b/src/Makefile.am index 2f0c6ae..8b7cd37 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -119,11 +119,14 @@ iconv.lo: iconvdecl.h iconvdecl.h: ../tables.py $(TABLES_PY) -i -# lat1ansel.h and lat1iso5426.h -.l.h: - grep '^\\' $< | \ - perl -npe 's/{ put_byte \(//;s /, subtask\); }//;s%^\\%%' | \ - perl -ne '($$a,$$b)=split; $$c=substr($$a,0,3);$$d=substr($$a,3);$$e = eval "0$$c"; next if $$b < 0200 ;printf("\t{%d, \"%c%s\"}, %s* %c *%s\n", $$b, $$e, $$d, "/", $$b, "/")' > $@ +lat1ansel.c: lat1ansel.h +lat1iso5426.c: lat1iso5426.h + +lat1ansel.h: ansellat1.l + $(top_srcdir)/build-aux/invert-l-to-h $< > $@ + +lat1iso5426.h: iso5426lat1.l + $(top_srcdir)/build-aux/invert-l-to-h $< > $@ african.lo afrtran.lo atarist.lo bangbang.lo cdcnos.lo \ ebcdic.lo ibmpc.lo iconqnx.lo lat1asci.lo lat1iso5426.lo lat1ansel.lo \ -- 2.50.0