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, 15 Feb 2020 21:53:31 +0000 (21:53 +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/Dir.sd.mk [new file with mode: 0644]
configure
configure.ac

index 31d92445fa85cf0d44b6465c2f4cffcf4b6ccced..dd93a2196faa60b1f80e5e8101b2da4f5033b0a1 100644 (file)
@@ -48,3 +48,6 @@ build-stamp
 
 [sm]test/d-*
 stest/udp-preload.so
+
+base91s/*.[ch]
+base91s/base91s
diff --git a/base91s/Dir.sd.mk b/base91s/Dir.sd.mk
new file mode 100644 (file)
index 0000000..d793dd2
--- /dev/null
@@ -0,0 +1,18 @@
+
+&TARGETS += & base91s base91.o
+&OBJECTS += & base91.o cli.o
+
+&CFILES += & base91.c base91.h cli.c
+&CLEAN += $(&CFILES)
+
+$(&CFILES): &/%: &~/base91-c/% &/Dir.mk
+       perl -pe <$< >$@.tmp \
+ 'next if m{^\#include}; s/basE91/base91s/g; s/base91\b/base91s/g'
+       mv -f $@.tmp $@
+
+$(&OBJECTS): &base91.h
+
+&:local+global &LDFLAGS &LDLIBS
+
+&base91s: $(&OBJECTS)
+       $(CC) -o$@ $(&LDFLAGS) $^ $(&LDLIBS)
index eadb5fb593b17b7b3d05cc378a02ebe13024e6b9..b9cf39a164d763ab5e2586c02033738abf647a88 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/Dir.mk:stest/Dir.mk.tmp"
 
 
+  subdirmk_subdirs="$subdirmk_subdirs 'base91s/'"
+  ac_config_files="$ac_config_files base91s/Dir.mk:base91s/Dir.mk.tmp"
+
+
 
 
 
@@ -4874,6 +4878,7 @@ do
     "test-example/Dir.mk") CONFIG_FILES="$CONFIG_FILES test-example/Dir.mk:test-example/Dir.mk.tmp" ;;
     "mtest/Dir.mk") CONFIG_FILES="$CONFIG_FILES mtest/Dir.mk:mtest/Dir.mk.tmp" ;;
     "stest/Dir.mk") CONFIG_FILES="$CONFIG_FILES stest/Dir.mk:stest/Dir.mk.tmp" ;;
+    "base91s/Dir.mk") CONFIG_FILES="$CONFIG_FILES base91s/Dir.mk:base91s/Dir.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 $)