From: Ian Jackson Date: Sun, 17 Nov 2019 01:44:30 +0000 (+0000) Subject: base91: Build the C basE91 code with our own renaming X-Git-Tag: v0.6.0~202 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=secnet.git;a=commitdiff_plain;h=d89426ef1149cdb2e31b48d4ea6f057e1d16fd62 base91: Build the C basE91 code with our own renaming 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 --- diff --git a/.gitignore b/.gitignore index 31d9244..dd93a21 100644 --- a/.gitignore +++ b/.gitignore @@ -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 index 0000000..d793dd2 --- /dev/null +++ b/base91s/Dir.sd.mk @@ -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) diff --git a/configure b/configure index eadb5fb..b9cf39a 100755 --- 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" ;; diff --git a/configure.ac b/configure.ac index 256abc8..7b06f09 100644 --- a/configure.ac +++ b/configure.ac @@ -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 $)