1 diff -ruN gsm-1.0.10-orig/Makefile gsm-1.0.10-1/Makefile
2 --- gsm-1.0.10-orig/Makefile 1996-07-02 16:36:06.000000000 +0200
3 +++ gsm-1.0.10-1/Makefile 2005-04-08 18:47:52.000000000 +0200
6 ######### Define SASR if >> is a signed arithmetic shift (-1 >> 1 == -1)
8 -MULHACK = -DUSE_FLOAT_MUL
9 +#MULHACK = -DUSE_FLOAT_MUL
11 ######### Define this if your host multiplies floats faster than integers,
12 ######### e.g. on a SPARCstation.
17 ######### Define together with USE_FLOAT_MUL to enable the GSM library's
18 ######### approximation option for incorrect, but good-enough results.
23 CC = gcc -ansi -pedantic
24 -CCFLAGS = -c -O2 -DNeedFunctionPrototypes=1
26 +CCFLAGS = -c $(COPTS) -DNeedFunctionPrototypes=1
31 # Leave GSM_INSTALL_ROOT empty to not install the GSM library outside of
34 -GSM_INSTALL_ROOT = $(INSTALL_ROOT)
35 +GSM_INSTALL_ROOT = $(INSTALL_ROOT)/usr
36 GSM_INSTALL_LIB = $(GSM_INSTALL_ROOT)/lib
37 -GSM_INSTALL_INC = $(GSM_INSTALL_ROOT)/inc
38 -GSM_INSTALL_MAN = $(GSM_INSTALL_ROOT)/man/man3
39 +GSM_INSTALL_INC = $(GSM_INSTALL_ROOT)/include
40 +GSM_INSTALL_MAN = $(GSM_INSTALL_ROOT)/share/man/man3
43 # Where do you want to install the toast binaries and their manpage?
45 # Leave TOAST_INSTALL_ROOT empty to not install the toast binaries outside
48 -TOAST_INSTALL_ROOT = $(INSTALL_ROOT)
49 +TOAST_INSTALL_ROOT = $(INSTALL_ROOT)/usr
50 TOAST_INSTALL_BIN = $(TOAST_INSTALL_ROOT)/bin
51 -TOAST_INSTALL_MAN = $(TOAST_INSTALL_ROOT)/man/man1
52 +TOAST_INSTALL_MAN = $(TOAST_INSTALL_ROOT)/share/man/man1
68 ######### Remove -DNDEBUG to enable assertions.
70 CFLAGS = $(CCFLAGS) $(SASR) $(DEBUG) $(MULHACK) $(FAST) $(LTP_CUT) \
74 LIBGSM = $(LIB)/libgsm.a
75 +LIBGSMSO= $(LIB)/libgsm.so
78 UNTOAST = $(BIN)/untoast
81 GSM_INSTALL_TARGETS = \
82 $(GSM_INSTALL_LIB)/libgsm.a \
83 + $(GSM_INSTALL_LIB)/libgsm.so \
84 + $(GSM_INSTALL_LIB)/libgsm.so.1 \
85 + $(GSM_INSTALL_LIB)/libgsm.so.1.0.10 \
86 $(GSM_INSTALL_INC)/gsm.h \
87 $(GSM_INSTALL_MAN)/gsm.3 \
88 $(GSM_INSTALL_MAN)/gsm_explode.3 \
93 -all: $(LIBGSM) $(TOAST) $(TCAT) $(UNTOAST)
94 +all: $(LIBGSM) $(LIBGSMSO) $(TOAST) $(TCAT) $(UNTOAST)
97 tst: $(TST)/lin2cod $(TST)/cod2lin $(TOAST) $(TST)/test-result
100 # The basic API: libgsm
102 +$(LIBGSMSO): $(LIB) $(GSM_OBJECTS)
103 + $(LD) -o $@.1.0.10 -shared -Xlinker -soname -Xlinker libgsm.so.1 $(GSM_OBJECTS) -lc
104 + ln -fs libgsm.so.1.0.10 lib/libgsm.so.1
105 + ln -fs libgsm.so.1.0.10 lib/libgsm.so
107 $(LIBGSM): $(LIB) $(GSM_OBJECTS)
108 -rm $(RMFLAGS) $(LIBGSM)
109 $(AR) $(ARFLAGS) $(LIBGSM) $(GSM_OBJECTS)
110 @@ -308,15 +320,15 @@
111 # Toast, Untoast and Tcat -- the compress-like frontends to gsm.
113 $(TOAST): $(BIN) $(TOAST_OBJECTS) $(LIBGSM)
114 - $(LD) $(LFLAGS) -o $(TOAST) $(TOAST_OBJECTS) $(LIBGSM) $(LDLIB)
115 + $(LD) $(LFLAGS) -o $(TOAST) $(TOAST_OBJECTS) $(LIBGSMSO) $(LDLIB)
117 $(UNTOAST): $(BIN) $(TOAST)
118 -rm $(RMFLAGS) $(UNTOAST)
119 - $(LN) $(TOAST) $(UNTOAST)
120 + $(LN) toast $(UNTOAST)
122 $(TCAT): $(BIN) $(TOAST)
123 -rm $(RMFLAGS) $(TCAT)
124 - $(LN) $(TOAST) $(TCAT)
125 + $(LN) toast $(TCAT)
128 # The local bin and lib directories
129 @@ -351,53 +363,66 @@
132 $(TOAST_INSTALL_BIN)/toast: $(TOAST)
135 + mkdir -p $(TOAST_INSTALL_BIN)
139 $(TOAST_INSTALL_BIN)/untoast: $(TOAST_INSTALL_BIN)/toast
142 + mkdir -p $(TOAST_INSTALL_BIN)
145 $(TOAST_INSTALL_BIN)/tcat: $(TOAST_INSTALL_BIN)/toast
148 + mkdir -p $(TOAST_INSTALL_BIN)
151 $(TOAST_INSTALL_MAN)/toast.1: $(MAN)/toast.1
154 + mkdir -p $(TOAST_INSTALL_MAN)
158 $(GSM_INSTALL_MAN)/gsm.3: $(MAN)/gsm.3
161 + mkdir -p $(GSM_INSTALL_MAN)
165 $(GSM_INSTALL_MAN)/gsm_option.3: $(MAN)/gsm_option.3
168 + mkdir -p $(GSM_INSTALL_MAN)
172 $(GSM_INSTALL_MAN)/gsm_explode.3: $(MAN)/gsm_explode.3
175 + mkdir -p $(GSM_INSTALL_MAN)
179 $(GSM_INSTALL_MAN)/gsm_print.3: $(MAN)/gsm_print.3
182 + mkdir -p $(GSM_INSTALL_MAN)
186 $(GSM_INSTALL_INC)/gsm.h: $(INC)/gsm.h
189 + mkdir -p $(GSM_INSTALL_INC)
193 $(GSM_INSTALL_LIB)/libgsm.a: $(LIBGSM)
196 + mkdir -p $(GSM_INSTALL_LIB)
200 +$(GSM_INSTALL_LIB)/libgsm.so: $(LIBGSMSO)
201 + mkdir -p $(GSM_INSTALL_LIB)
204 +$(GSM_INSTALL_LIB)/libgsm.so.1: $(LIBGSMSO)
205 + mkdir -p $(GSM_INSTALL_LIB)
208 +$(GSM_INSTALL_LIB)/libgsm.so.1.0.10: $(LIBGSMSO)
209 + mkdir -p $(GSM_INSTALL_LIB)
219 -rm $(RMFLAGS) $(LIBGSM) $(ADDTST)/add \
220 - $(TOAST) $(TCAT) $(UNTOAST) \
221 + $(LIBGSMSO) $(LIB)/libgsm.so.1.0.10 \
222 + $(LIB)libgsm.so.1 \
223 + $(TOAST) $(TCAT) $(UNTOAST) \
224 $(ROOT)/gsm-1.0.tar.Z
227 diff -ruN gsm-1.0.10-orig/inc/config.h gsm-1.0.10-1/inc/config.h
228 --- gsm-1.0.10-orig/inc/config.h 1996-07-02 16:32:27.000000000 +0200
229 +++ gsm-1.0.10-1/inc/config.h 2005-04-08 18:24:31.000000000 +0200
234 -/*efine SIGHANDLER_T int /* signal handlers are void */
235 -/*efine HAS_SYSV_SIGNAL 1 /* sigs not blocked/reset? */
236 +/*efine SIGHANDLER_T int -* signal handlers are void */
237 +/*efine HAS_SYSV_SIGNAL 1 -* sigs not blocked/reset? */
239 #define HAS_STDLIB_H 1 /* /usr/include/stdlib.h */
240 -/*efine HAS_LIMITS_H 1 /* /usr/include/limits.h */
241 +#define HAS_STDIO_H 1 /* /usr/include/stdio.h */
242 +/*efine HAS_LIMITS_H 1 -* /usr/include/limits.h */
243 #define HAS_FCNTL_H 1 /* /usr/include/fcntl.h */
244 -/*efine HAS_ERRNO_DECL 1 /* errno.h declares errno */
246 #define HAS_FSTAT 1 /* fstat syscall */
247 #define HAS_FCHMOD 1 /* fchmod syscall */
248 #define HAS_CHMOD 1 /* chmod syscall */
249 #define HAS_FCHOWN 1 /* fchown syscall */
250 #define HAS_CHOWN 1 /* chown syscall */
251 -/*efine HAS__FSETMODE 1 /* _fsetmode -- set file mode */
252 +/*efine HAS__FSETMODE 1 -* _fsetmode -- set file mode */
254 #define HAS_STRING_H 1 /* /usr/include/string.h */
255 -/*efine HAS_STRINGS_H 1 /* /usr/include/strings.h */
256 +/*efine HAS_STRINGS_H 1 -* /usr/include/strings.h */
258 #define HAS_UNISTD_H 1 /* /usr/include/unistd.h */
259 #define HAS_UTIME 1 /* POSIX utime(path, times) */
260 -/*efine HAS_UTIMES 1 /* use utimes() syscall instead */
261 +/*efine HAS_UTIMES 1 -* use utimes() syscall instead */
262 #define HAS_UTIME_H 1 /* UTIME header file */
263 -/*efine HAS_UTIMBUF 1 /* struct utimbuf */
264 -/*efine HAS_UTIMEUSEC 1 /* microseconds in utimbuf? */
265 +/*efine HAS_UTIMBUF 1 -* struct utimbuf */
266 +/*efine HAS_UTIMEUSEC 1 -* microseconds in utimbuf? */
268 #endif /* CONFIG_H */
269 diff -ruN gsm-1.0.10-orig/inc/gsm.h gsm-1.0.10-1/inc/gsm.h
270 --- gsm-1.0.10-orig/inc/gsm.h 1996-07-05 20:31:51.000000000 +0200
271 +++ gsm-1.0.10-1/inc/gsm.h 2005-04-08 18:24:31.000000000 +0200
273 #define GSM_OPT_FRAME_INDEX 5
274 #define GSM_OPT_FRAME_CHAIN 6
280 extern gsm gsm_create GSM_P((void));
281 extern void gsm_destroy GSM_P((gsm));
284 extern int gsm_explode GSM_P((gsm, gsm_byte *, gsm_signal *));
285 extern void gsm_implode GSM_P((gsm, gsm_signal *, gsm_byte *));
294 diff -ruN gsm-1.0.10-orig/inc/toast.h gsm-1.0.10-1/inc/toast.h
295 --- gsm-1.0.10-orig/inc/toast.h 1996-07-02 16:32:29.000000000 +0200
296 +++ gsm-1.0.10-1/inc/toast.h 2005-04-08 18:24:31.000000000 +0200
301 +#include <pthread.h>
305 -#ifndef HAS_ERRNO_DECL
323 diff -ruN gsm-1.0.10-orig/src/code.c gsm-1.0.10-1/src/code.c
324 --- gsm-1.0.10-orig/src/code.c 1996-07-02 16:32:36.000000000 +0200
325 +++ gsm-1.0.10-1/src/code.c 2005-04-08 18:24:31.000000000 +0200
336 extern char * memcpy P((char *, char *, int));
337 diff -ruN gsm-1.0.10-orig/src/debug.c gsm-1.0.10-1/src/debug.c
338 --- gsm-1.0.10-orig/src/debug.c 1996-07-02 16:32:37.000000000 +0200
339 +++ gsm-1.0.10-1/src/debug.c 2005-04-08 18:24:31.000000000 +0200
341 fprintf( stderr, "%s [%d .. %d]: ", name, from, to );
344 - fprintf(stderr, "%d ", ptr[ from ] );
345 + fprintf(stderr, "%ld ", ptr[ from ] );
347 if (nprinted++ >= 7) {
353 - fprintf(stderr, "%s: %d\n", name, (long)value );
354 + fprintf(stderr, "%s: %ld\n", name, (long)value );
357 void gsm_debug_word P2( (name, value),
361 - fprintf(stderr, "%s: %d\n", name, (long)value);
362 + fprintf(stderr, "%s: %ld\n", name, (long)value);
366 diff -ruN gsm-1.0.10-orig/src/toast.c gsm-1.0.10-1/src/toast.c
367 --- gsm-1.0.10-orig/src/toast.c 1996-07-02 16:32:55.000000000 +0200
368 +++ gsm-1.0.10-1/src/toast.c 2005-04-08 18:24:31.000000000 +0200
372 if (!(s = malloc(len))) {
373 - fprintf(stderr, "%s: failed to malloc %d bytes -- abort\n",
375 + fprintf(stderr, "%s: failed to malloc %ld bytes -- abort\n",
376 + progname, (long) len);
381 maxlen = strlen(name) + 1 + strlen(want) + strlen(cut);
382 p = strcpy(emalloc(maxlen), name);
384 - if (s = suffix(p, cut)) strcpy(s, want);
385 + if ((s = suffix(p, cut))) strcpy(s, want);
386 else if (*want && !suffix(p, want)) strcat(p, want);
390 ut[0] = instat.st_atime;
391 ut[1] = instat.st_mtime;
393 - (void) utime(outname, ut);
394 + (void) utime(outname, (struct utimbuf *)ut);
400 if (st->st_nlink > 1 && !f_cat && !f_precious) {
402 - "%s: \"%s\" has %s other link%s -- unchanged.\n",
403 + "%s: \"%s\" has %d other link%s -- unchanged.\n",
404 progname,name,st->st_nlink - 1,"s" + (st->st_nlink<=2));
409 if (cc != sizeof(s)) {
410 if (cc >= 0) fprintf(stderr,
411 - "%s: incomplete frame (%d byte%s missing) from %s\n",
412 - progname, sizeof(s) - cc,
413 + "%s: incomplete frame (%ld byte%s missing) from %s\n",
414 + progname, (long) sizeof(s) - cc,
415 "s" + (sizeof(s) - cc == 1),
416 inname ? inname : "stdin" );
420 static int process P1((name), char * name)
428 case 'h': help(); exit(0);
433 "Usage: %s [-fcpdhvuaslFC] [files...] (-h for help)\n",