chiark / gitweb /
base91: Build the C basE91 code with our own renaming
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 17 Nov 2019 01:44:30 +0000 (01:44 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 7 Dec 2019 17:08:50 +0000 (17:08 +0000)
We want to use a variant character set.  This will mean patching the
library.  (That will happen in a moment.)  It seems unwise, and
perhaps rude, to make a thing that has the same name as the official
basE91 but has a different and incompatible encoding.

So we change all the names: `basE91' and `base91' become base91s.

We don't change the leaf filenames because that's rather
inconvenient.  We do put it all in a base91s subdirectory.

Rather than running the basE91 upstream makefile, or trying to sed it,
or something, we simply make our own makefile.  It is simple enough.
The only complication is that the "source" files are all actually made
by this name substitution perl rune.

Overall, the chief result is that we build a base91s/base91s utility,
by default.

Right now it does not have our charset change, so it is not ready for
use yet.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
.gitignore
base91s/Subdir.sd.mk [new file with mode: 0644]
configure
configure.ac

index b166c4277819d983bbe5a3fa9303ede4c2670918..301117d3b85c4608c4a87ed203a4c50fac8d891a 100644 (file)
@@ -47,3 +47,6 @@ build-stamp
 
 [sm]test/d-*
 stest/udp-preload.so
+
+base91s/*.[ch]
+base91s/base91s
diff --git a/base91s/Subdir.sd.mk b/base91s/Subdir.sd.mk
new file mode 100644 (file)
index 0000000..d41ca9a
--- /dev/null
@@ -0,0 +1,16 @@
+
+&TARGETS += & base91s base91.o
+&OBJECTS += & base91.o cli.o
+
+&CFILES += & base91.c base91.h cli.c
+&CLEAN += $(&CFILES)
+
+$(&CFILES): &/%: &~/base91-c/% &/Subdir.mk
+       perl -pe <$< >$@.tmp \
+ 'next if m{^\#include}; s/basE91/base91s/g; s/base91\b/base91s/g'
+       mv -f $@.tmp $@
+
+$(&OBJECTS): &base91.h
+
+&base91s: $(&OBJECTS)
+       $(CC) -o$@ $(&LDFLAGS) $^ $(&LDLIBS)
index 37e76cb30c4e81cd2b8527918362b3d2f7695667..d76d35bede014afa1f4f4af65aef74c16779ed24 100755 (executable)
--- a/configure
+++ b/configure
@@ -2149,6 +2149,10 @@ ac_config_headers="$ac_config_headers config.h"
   ac_config_files="$ac_config_files stest/Subdir.mk:stest/Subdir.mk.tmp"
 
 
+  subdirmk_subdirs="$subdirmk_subdirs 'base91s/'"
+  ac_config_files="$ac_config_files base91s/Subdir.mk:base91s/Subdir.mk.tmp"
+
+
 
 
 
@@ -4873,6 +4877,7 @@ do
     "test-example/Subdir.mk") CONFIG_FILES="$CONFIG_FILES test-example/Subdir.mk:test-example/Subdir.mk.tmp" ;;
     "mtest/Subdir.mk") CONFIG_FILES="$CONFIG_FILES mtest/Subdir.mk:mtest/Subdir.mk.tmp" ;;
     "stest/Subdir.mk") CONFIG_FILES="$CONFIG_FILES stest/Subdir.mk:stest/Subdir.mk.tmp" ;;
+    "base91s/Subdir.mk") CONFIG_FILES="$CONFIG_FILES base91s/Subdir.mk:base91s/Subdir.mk.tmp" ;;
     "common.make") CONFIG_FILES="$CONFIG_FILES common.make:common.make.in" ;;
     "default") CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;
 
index 256abc84622d0d1f7b748e667ec05c2ff4c90021..7b06f099e92912622989f51b1f3f4dd8627f2034 100644 (file)
@@ -25,7 +25,7 @@ AC_INIT(secnet,0.1.18+,secnet@chiark.greenend.org.uk)
 AC_CONFIG_SRCDIR(secnet.c)
 AC_CONFIG_HEADER(config.h)
 
-SUBDIRMK_SUBDIRS([test-example mtest stest])
+SUBDIRMK_SUBDIRS([test-example mtest stest base91s])
 
 AC_PREREQ(2.50)
 AC_REVISION($Id: configure.in,v 1.4 2002/09/09 22:05:02 steve Exp $)