un
A unit conversion tool.
un is a small command-line utility which converts physical
units. It is not simply a list of conversion factors, but
you can enter data in one unit and see what it corresponds
to in all other units in the group. You will find, among
others, groups for length, mass, speed, temperature, and
cooking volumes.
The software was written by Gregory R. Simpson. The version
used for the CygWin port is dated 1/23/89.
The source code is ANSI C and compiles with gcc right out of
the box. The makefile needed some polishing, though:
--- makefile.orig Fri Jun 23 21:08:28 1989
+++ makefile Sun Aug 01 23:33:27 1999
@@ -1,9 +1,9 @@
# UN.C
# Unit conversion program
-BIN = /usr/local
-CC = cc -O
-MAN = /usr/man/manl
+BIN = /usr/local/bin
+CC = gcc -O
+MAN = /usr/local/man/man1
PROG = un
OBJ = u.o cons.o control.o getit.o temp.o
INC = un.h unit_table.h
@@ -27,8 +27,8 @@
$(CC) -c temp.c
install:
- cp $(PROG) $(BIN)
- chmod a+rx $(BIN)/$(PROG)
- strip $(BIN)/$(PROG)
- cp $(PROG).n $(MAN)/$(PROG).l
+ install $(PROG).exe $(BIN)
+ chmod a+rx $(BIN)/$(PROG).exe
+ strip $(BIN)/$(PROG).exe
+ install $(PROG).n $(MAN)/$(PROG).l
chmod a+r $(MAN)/$(PROG).l
System requirements
I used the following setup to build the software:
- Windows NT 4.0 SP3 Workstation
- CygwinB20.1
- gcc-2.95
- A directory /usr/local with symlinks called bin and man which
point to the CygWin bin and man directory, respectively (or use
equivalent mounts).
With this setup, make and make
install run smoothly.
To manually install the precompiled binary, simply copy un.exe
into your Cygwin /bin directory and un.1 into your man1
directory.
The original sources can be downloaded here.
The precompiled binary for CygwinB20 (they still run on more
recent releases like 1.3.2) including a makefile.diff to apply the
above patch to the sources are shipped as cygwinb20-units.tar.gz (10
kb).
|