From f37e2767b83d426a8097e5bd4b55cf146a5cd347 Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Thu, 26 Aug 2010 04:40:48 -0400 Subject: [PATCH] Rename base 3-7 system libraries to be unique without extension. This eliminates the need for some ugly special-casing in the test system. --- .gitignore | 10 +++---- README | 2 +- buildaux/Makefile.am | 32 +++++++++++----------- buildaux/Makefile.in | 45 ++++++++++++++++--------------- doc/ick.txi | 5 ++-- pit/CATALOG | 10 +++---- pit/Makefile | 22 +-------------- pit/lib/{syslib.3i => syslib3.3i} | 0 pit/lib/{syslib.4i => syslib4.4i} | 0 pit/lib/{syslib.5i => syslib5.5i} | 0 pit/lib/{syslib.6i => syslib6.6i} | 0 pit/lib/{syslib.7i => syslib7.7i} | 0 src/perpet.c | 2 +- 13 files changed, 55 insertions(+), 73 deletions(-) rename pit/lib/{syslib.3i => syslib3.3i} (100%) rename pit/lib/{syslib.4i => syslib4.4i} (100%) rename pit/lib/{syslib.5i => syslib5.5i} (100%) rename pit/lib/{syslib.6i => syslib6.6i} (100%) rename pit/lib/{syslib.7i => syslib7.7i} (100%) diff --git a/.gitignore b/.gitignore index e5a3006..0552c62 100644 --- a/.gitignore +++ b/.gitignore @@ -18,12 +18,12 @@ oil # C source files and includes in the top directory were copied there, ignore *.[chyl] # So were any copies of the INTERCAL libraries we might find here -syslib.3i -syslib.4i -syslib.5i -syslib.6i -syslib.7i syslib.i +syslib3.3i +syslib4.4i +syslib5.5i +syslib6.6i +syslib7.7i # Other generated stuff doc/*info* doc/*.htm diff --git a/README b/README index 4dcade9..7ad34b1 100644 --- a/README +++ b/README @@ -97,7 +97,7 @@ aclocal.m4 -- helper file needed to build the build system itself pit/* -- sample INTERCAL code; see pit/CATALOG pit/explib/* -- source code for expansion libraries -pit/lib/syslib.*i -- source code for the system libraries +pit/lib/syslib*.*i -- source code for the system libraries HOW TO GET STARTED diff --git a/buildaux/Makefile.am b/buildaux/Makefile.am index dbeae49..2a5ca7e 100644 --- a/buildaux/Makefile.am +++ b/buildaux/Makefile.am @@ -22,16 +22,16 @@ pickwrap.c : src/pickwrap.c $(LN_S) `test -f 'src/pickwrap.c' || echo '$(srcdir)/'`src/pickwrap.c pickwrap.c syslib.i : pit/lib/syslib.i $(LN_S) `test -f 'pit/lib/syslib.i' || echo '$(srcdir)/'`pit/lib/syslib.i syslib.i -syslib.3i : pit/lib/syslib.3i - $(LN_S) `test -f 'pit/lib/syslib.3i' || echo '$(srcdir)/'`pit/lib/syslib.3i syslib.3i -syslib.4i : pit/lib/syslib.4i - $(LN_S) `test -f 'pit/lib/syslib.4i' || echo '$(srcdir)/'`pit/lib/syslib.4i syslib.4i -syslib.5i : pit/lib/syslib.5i - $(LN_S) `test -f 'pit/lib/syslib.5i' || echo '$(srcdir)/'`pit/lib/syslib.5i syslib.5i -syslib.6i : pit/lib/syslib.6i - $(LN_S) `test -f 'pit/lib/syslib.6i' || echo '$(srcdir)/'`pit/lib/syslib.6i syslib.6i -syslib.7i : pit/lib/syslib.7i - $(LN_S) `test -f 'pit/lib/syslib.7i' || echo '$(srcdir)/'`pit/lib/syslib.7i syslib.7i +syslib3.3i : pit/lib/syslib3.3i + $(LN_S) `test -f 'pit/lib/syslib.3i' || echo '$(srcdir)/'`pit/lib/syslib3.3i syslib3.3i +syslib4.4i : pit/lib/syslib4.4i + $(LN_S) `test -f 'pit/lib/syslib.4i' || echo '$(srcdir)/'`pit/lib/syslib4.4i syslib4.4i +syslib5.5i : pit/lib/syslib5.5i + $(LN_S) `test -f 'pit/lib/syslib.5i' || echo '$(srcdir)/'`pit/lib/syslib5.5i syslib5.5i +syslib6.6i : pit/lib/syslib6.6i + $(LN_S) `test -f 'pit/lib/syslib.6i' || echo '$(srcdir)/'`pit/lib/syslib6.6i syslib6.6i +syslib7.7i : pit/lib/syslib7.7i + $(LN_S) `test -f 'pit/lib/syslib.7i' || echo '$(srcdir)/'`pit/lib/syslib7.7i syslib7.7i ick_ec.h : src/ick_ec.h $(LN_S) `test -f 'src/ick_ec.h' || echo '$(srcdir)/'`src/ick_ec.h ick_ec.h ick_lose.h : src/ick_lose.h @@ -47,8 +47,8 @@ AM_YFLAGS = -d # BUILT_SOURCES is used both to make sure parser.h is built early, and to # create symlinks used by ick to find files if it's run without first being # installed. -BUILT_SOURCES = parser.h ick-wrap.c pickwrap.c syslib.i syslib.3i syslib.4i \ - syslib.5i syslib.6i syslib.7i ick_ec.h fiddle.h abcess.h \ +BUILT_SOURCES = parser.h ick-wrap.c pickwrap.c syslib.i syslib3.3i syslib4.4i \ + syslib5.5i syslib6.6i syslib7.7i ick_ec.h fiddle.h abcess.h \ ick_lose.h yuk.h noinst_LIBRARIES = libidiot.a libidiot_a_SOURCES = src/idiotism.oil @@ -107,8 +107,8 @@ dist_ickdata_DATA = src/atari.bin src/baudot.bin src/ebcdic.bin src/latin1.bin \ src/ick-wrap.c src/pickwrap.c COPYING # These necessary pit files are in nodist_ here because they're in EXTRA_DIST # later along with the rest of the pit. -nodist_ickdata_DATA = pit/lib/syslib.i pit/lib/syslib.3i pit/lib/syslib.4i \ - pit/lib/syslib.5i pit/lib/syslib.6i pit/lib/syslib.7i \ +nodist_ickdata_DATA = pit/lib/syslib.i pit/lib/syslib3.3i pit/lib/syslib4.4i \ + pit/lib/syslib5.5i pit/lib/syslib6.6i pit/lib/syslib7.7i \ coopt.sh pit/explib/syslibc.c pit/explib/compunex.c \ pit/explib/ecto_b98.c dist_man1_MANS = doc/ick.1 doc/convickt.1 @@ -154,8 +154,8 @@ $(srcdir)/MANIFEST: distdir # links made to simplify the build, not the originals CLEANFILES = oilout*.c parser.y lexer.l ick-wrap.c pickwrap.c \ atari.c baudot.c ebcdic.c latin1.c ick.dvi \ - syslib.i syslib.3i syslib.4i syslib.5i \ - syslib.6i syslib.7i ick_ec.h fiddle.h abcess.h \ + syslib.i syslib3.3i syslib4.4i syslib5.5i \ + syslib6.6i syslib7.7i ick_ec.h fiddle.h abcess.h \ ick_lose.h yuk.h # Distclean deletes the Makefile and thus requires reconfiguring, # and therefore this is a safe moment to delete the build tree diff --git a/buildaux/Makefile.in b/buildaux/Makefile.in index 109d75a..f12ef9d 100644 --- a/buildaux/Makefile.in +++ b/buildaux/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.11 from Makefile.am. +# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, @@ -295,8 +295,8 @@ AM_YFLAGS = -d # BUILT_SOURCES is used both to make sure parser.h is built early, and to # create symlinks used by ick to find files if it's run without first being # installed. -BUILT_SOURCES = parser.h ick-wrap.c pickwrap.c syslib.i syslib.3i syslib.4i \ - syslib.5i syslib.6i syslib.7i ick_ec.h fiddle.h abcess.h \ +BUILT_SOURCES = parser.h ick-wrap.c pickwrap.c syslib.i syslib3.3i syslib4.4i \ + syslib5.5i syslib6.6i syslib7.7i ick_ec.h fiddle.h abcess.h \ ick_lose.h yuk.h noinst_LIBRARIES = libidiot.a @@ -331,8 +331,8 @@ dist_ickdata_DATA = src/atari.bin src/baudot.bin src/ebcdic.bin src/latin1.bin \ # These necessary pit files are in nodist_ here because they're in EXTRA_DIST # later along with the rest of the pit. -nodist_ickdata_DATA = pit/lib/syslib.i pit/lib/syslib.3i pit/lib/syslib.4i \ - pit/lib/syslib.5i pit/lib/syslib.6i pit/lib/syslib.7i \ +nodist_ickdata_DATA = pit/lib/syslib.i pit/lib/syslib3.3i pit/lib/syslib4.4i \ + pit/lib/syslib5.5i pit/lib/syslib6.6i pit/lib/syslib7.7i \ coopt.sh pit/explib/syslibc.c pit/explib/compunex.c \ pit/explib/ecto_b98.c @@ -354,8 +354,8 @@ EXTRA_DIST = pit etc BUGS src/abcess.h src/feh.h src/fiddle.h src/ick_ec.h \ # links made to simplify the build, not the originals CLEANFILES = oilout*.c parser.y lexer.l ick-wrap.c pickwrap.c \ atari.c baudot.c ebcdic.c latin1.c ick.dvi \ - syslib.i syslib.3i syslib.4i syslib.5i \ - syslib.6i syslib.7i ick_ec.h fiddle.h abcess.h \ + syslib.i syslib3.3i syslib4.4i syslib5.5i \ + syslib6.6i syslib7.7i ick_ec.h fiddle.h abcess.h \ ick_lose.h yuk.h # Distclean deletes the Makefile and thus requires reconfiguring, @@ -1159,7 +1159,8 @@ distdir: $(DISTFILES) top_distdir="$(top_distdir)" distdir="$(distdir)" \ dist-info dist-hook -test -n "$(am__skip_mode_fix)" \ - || find "$(distdir)" -type d ! -perm -777 -exec chmod a+rwx {} \; -o \ + || find "$(distdir)" -type d ! -perm -755 \ + -exec chmod u+rwx,go+rx {} \; -o \ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ @@ -1203,17 +1204,17 @@ dist dist-all: distdir distcheck: dist case '$(DIST_ARCHIVES)' in \ *.tar.gz*) \ - GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\ + GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ - bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\ + bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ *.tar.lzma*) \ - unlzma -c $(distdir).tar.lzma | $(am__untar) ;;\ + lzma -dc $(distdir).tar.lzma | $(am__untar) ;;\ *.tar.xz*) \ xz -dc $(distdir).tar.xz | $(am__untar) ;;\ *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ - GZIP=$(GZIP_ENV) gunzip -c $(distdir).shar.gz | unshar ;;\ + GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ esac @@ -1515,16 +1516,16 @@ pickwrap.c : src/pickwrap.c $(LN_S) `test -f 'src/pickwrap.c' || echo '$(srcdir)/'`src/pickwrap.c pickwrap.c syslib.i : pit/lib/syslib.i $(LN_S) `test -f 'pit/lib/syslib.i' || echo '$(srcdir)/'`pit/lib/syslib.i syslib.i -syslib.3i : pit/lib/syslib.3i - $(LN_S) `test -f 'pit/lib/syslib.3i' || echo '$(srcdir)/'`pit/lib/syslib.3i syslib.3i -syslib.4i : pit/lib/syslib.4i - $(LN_S) `test -f 'pit/lib/syslib.4i' || echo '$(srcdir)/'`pit/lib/syslib.4i syslib.4i -syslib.5i : pit/lib/syslib.5i - $(LN_S) `test -f 'pit/lib/syslib.5i' || echo '$(srcdir)/'`pit/lib/syslib.5i syslib.5i -syslib.6i : pit/lib/syslib.6i - $(LN_S) `test -f 'pit/lib/syslib.6i' || echo '$(srcdir)/'`pit/lib/syslib.6i syslib.6i -syslib.7i : pit/lib/syslib.7i - $(LN_S) `test -f 'pit/lib/syslib.7i' || echo '$(srcdir)/'`pit/lib/syslib.7i syslib.7i +syslib3.3i : pit/lib/syslib3.3i + $(LN_S) `test -f 'pit/lib/syslib.3i' || echo '$(srcdir)/'`pit/lib/syslib3.3i syslib3.3i +syslib4.4i : pit/lib/syslib4.4i + $(LN_S) `test -f 'pit/lib/syslib.4i' || echo '$(srcdir)/'`pit/lib/syslib4.4i syslib4.4i +syslib5.5i : pit/lib/syslib5.5i + $(LN_S) `test -f 'pit/lib/syslib.5i' || echo '$(srcdir)/'`pit/lib/syslib5.5i syslib5.5i +syslib6.6i : pit/lib/syslib6.6i + $(LN_S) `test -f 'pit/lib/syslib.6i' || echo '$(srcdir)/'`pit/lib/syslib6.6i syslib6.6i +syslib7.7i : pit/lib/syslib7.7i + $(LN_S) `test -f 'pit/lib/syslib.7i' || echo '$(srcdir)/'`pit/lib/syslib7.7i syslib7.7i ick_ec.h : src/ick_ec.h $(LN_S) `test -f 'src/ick_ec.h' || echo '$(srcdir)/'`src/ick_ec.h ick_ec.h ick_lose.h : src/ick_lose.h diff --git a/doc/ick.txi b/doc/ick.txi index 528291f..a412094 100644 --- a/doc/ick.txi +++ b/doc/ick.txi @@ -3784,7 +3784,8 @@ expression.) @portability{yes, all versions, no, all versions} -@ical{} has a system library, called @samp{syslib}. It is included +@ical{} has a system library, called @samp{syslib} (versions for bases +other than 2 will have a numeric suffix on the name). It is included automatically at the end of your program by the compiler whenever your program refers to a line from (1000) to (1999) without defining any line in that range in the program. (Although it is not added @@ -3814,7 +3815,7 @@ aiming at them. The system library is currently available in all bases from 2 to 7 (@pxref{TriINTERCAL}), but not every command is available in every base, and @cic{} is the only one of the three compilers listed above -that use the system library to ship with a version in bases other than +that has the system library to ship with a version in bases other than 2. (This table was originally based on the @icst{} manual, but has had extra information added for bases other than 2.) Here, ``overflow checked'' means that #1 is assigned to .4 if there is not an overflow, diff --git a/pit/CATALOG b/pit/CATALOG index 2e8a95e..68e719e 100644 --- a/pit/CATALOG +++ b/pit/CATALOG @@ -74,11 +74,11 @@ by Clemens Meier By Brian Raiter lib/numio.i I/O routines lib/numio.doc Description of the I/O routines - lib/syslib.3i - lib/syslib.4i - lib/syslib.5i - lib/syslib.6i Translations of the standard library to - lib/syslib.7i C-INTERCAL's other bases. + lib/syslib3.3i + lib/syslib4.4i + lib/syslib5.5i + lib/syslib6.6i Translations of the standard library to + lib/syslib7.7i C-INTERCAL's other bases. lib/syslib3-7.doc Documentation for same tests/hello.i + The traditional hello world program ins.i Intersections & Splats, a Mastermind-style game diff --git a/pit/Makefile b/pit/Makefile index 3223040..4313581 100644 --- a/pit/Makefile +++ b/pit/Makefile @@ -101,26 +101,6 @@ test: $(TARGETS) tests/permute: tests/permute.i $(ICK) -m tests/permute.i -./lib/syslib3: ./lib/syslib.3i - cp ./lib/syslib.3i ./lib/syslib3.3i - $(ICK) ./lib/syslib3.3i - -./lib/syslib4: ./lib/syslib.4i - cp ./lib/syslib.4i ./lib/syslib4.4i - $(ICK) ./lib/syslib4.4i - -./lib/syslib5: ./lib/syslib.5i - cp ./lib/syslib.5i ./lib/syslib5.5i - $(ICK) ./lib/syslib5.5i - -./lib/syslib6: ./lib/syslib.6i - cp ./lib/syslib.6i ./lib/syslib6.6i - $(ICK) ./lib/syslib6.6i - -./lib/syslib7: ./lib/syslib.7i - cp ./lib/syslib.7i ./lib/syslib7.7i - $(ICK) ./lib/syslib7.7i - ./tests/limits3: ./tests/limits.3i cp ./tests/limits.3i ./tests/limits3.3i $(ICK) ./tests/limits3.3i @@ -137,5 +117,5 @@ lines: wc -l $(SOURCES) clean: - rm -f $(TARGETS) *.c *.o *~ lib/syslib?.?i + rm -f $(TARGETS) *.c *.o *~ rm tests/limits3.3i tests/testops3.3i tests/testops5.5i diff --git a/pit/lib/syslib.3i b/pit/lib/syslib3.3i similarity index 100% rename from pit/lib/syslib.3i rename to pit/lib/syslib3.3i diff --git a/pit/lib/syslib.4i b/pit/lib/syslib4.4i similarity index 100% rename from pit/lib/syslib.4i rename to pit/lib/syslib4.4i diff --git a/pit/lib/syslib.5i b/pit/lib/syslib5.5i similarity index 100% rename from pit/lib/syslib.5i rename to pit/lib/syslib5.5i diff --git a/pit/lib/syslib.6i b/pit/lib/syslib6.6i similarity index 100% rename from pit/lib/syslib.6i rename to pit/lib/syslib6.6i diff --git a/pit/lib/syslib.7i b/pit/lib/syslib7.7i similarity index 100% rename from pit/lib/syslib.7i rename to pit/lib/syslib7.7i diff --git a/src/perpet.c b/src/perpet.c index 0cb35df..9d2d2e1 100644 --- a/src/perpet.c +++ b/src/perpet.c @@ -656,7 +656,7 @@ static void check_syslib(/*@partial@*/ char *buffer, if (ick_Base == 2) /* see code for opening the skeleton */ (void) ick_snprintf_or_die(buffer, size, "%s.i", SYSLIB); else - (void) ick_snprintf_or_die(buffer, size, "%s.%di", SYSLIB, ick_Base); + (void) ick_snprintf_or_die(buffer, size, "%s%d.%di", SYSLIB, ick_Base, ick_Base); if (ick_findandfreopen(buffer, ick_datadir, "r", argv0, stdin) == NULL) ick_lose(IE127, 1, (const char*) NULL); #ifdef USE_YYRESTART -- 2.43.0