1 --- gsm-1.0-pl22/Makefile.orig 2022-08-04 20:46:46.107815841 +0000
2 +++ gsm-1.0-pl22/Makefile 2022-10-31 09:39:21.985606716 +0000
4 ######### define this, and read about the GSM_OPT_WAV49 option in the
5 ######### manual page on gsm_option(3).
7 +######### Define MAJOR so number.
10 # Choose a compiler. The code works both with ANSI and K&R-C.
11 # Use -DNeedFunctionPrototypes to compile with, -UNeedFunctionPrototypes to
12 # compile without, function prototypes in the header files.
17 -CC = gcc -ansi -pedantic
18 -CCFLAGS = -c -O2 -DNeedFunctionPrototypes=1 -Wall -Wno-comment
19 +#CC = gcc -ansi -pedantic
20 +#CCFLAGS = -c -O2 -DNeedFunctionPrototypes=1 -Wall -Wno-comment
25 # Leave INSTALL_ROOT empty (or just don't execute "make install") to
26 # not install gsm and toast outside of this directory.
31 # Where do you want to install the gsm library, header file, and manpages?
33 # Leave GSM_INSTALL_ROOT empty to not install the GSM library outside of
36 -GSM_INSTALL_ROOT = $(INSTALL_ROOT)
37 -GSM_INSTALL_LIB = $(GSM_INSTALL_ROOT)/lib
38 -GSM_INSTALL_INC = $(GSM_INSTALL_ROOT)/inc
39 -GSM_INSTALL_MAN = $(GSM_INSTALL_ROOT)/man/man3
40 +GSM_INSTALL_ROOT = $(DESTDIR)$(INSTALL_ROOT)
41 +GSM_INSTALL_LIB = $(GSM_INSTALL_ROOT)/lib$(ARCH)
42 +GSM_INSTALL_INC = $(GSM_INSTALL_ROOT)/include
43 +GSM_INSTALL_MAN = $(GSM_INSTALL_ROOT)/share/man/man3
46 # Where do you want to install the toast binaries and their manpage?
48 # Leave TOAST_INSTALL_ROOT empty to not install the toast binaries outside
51 -TOAST_INSTALL_ROOT = $(INSTALL_ROOT)
52 +TOAST_INSTALL_ROOT= $(DESTDIR)$(INSTALL_ROOT)
53 TOAST_INSTALL_BIN = $(TOAST_INSTALL_ROOT)/bin
54 -TOAST_INSTALL_MAN = $(TOAST_INSTALL_ROOT)/man/man1
55 +TOAST_INSTALL_MAN = $(TOAST_INSTALL_ROOT)/share/man/man1
66 ######### Remove -DNDEBUG to enable assertions.
68 -CFLAGS = $(CCFLAGS) $(SASR) $(DEBUG) $(MULHACK) $(FAST) $(LTP_CUT) \
69 - $(WAV49) $(CCINC) -I$(INC)
70 +CFLAGS = -c $(MYCFLAGS) $(PICFLAG) $(OPTFLAGS) $(SASR) $(DEBUG) $(MULHACK) $(FAST) $(LTP_CUT) \
71 + $(WAV49) $(CCINC) -I$(INC)
73 ######### It's $(CC) $(CFLAGS)
75 LFLAGS = $(LDFLAGS) $(LDINC)
80 -LIBGSM = $(LIB)/libgsm.a
81 +LIBGSM = $(LIB)/libgsm.so.$(MAJOR)
84 UNTOAST = $(BIN)/untoast
88 GSM_INSTALL_TARGETS = \
89 - $(GSM_INSTALL_LIB)/libgsm.a \
90 + $(GSM_INSTALL_LIB)/libgsm.so.$(MAJOR) \
91 $(GSM_INSTALL_INC)/gsm.h \
92 $(GSM_INSTALL_MAN)/gsm.3 \
93 $(GSM_INSTALL_MAN)/gsm_explode.3 \
96 $(LIBGSM): $(LIB) $(GSM_OBJECTS)
97 -rm $(RMFLAGS) $(LIBGSM)
98 - $(AR) $(ARFLAGS) $(LIBGSM) $(GSM_OBJECTS)
101 + $(LD) -shared $(GSM_OBJECTS) -o $(LIBGSM) $(LDFLAGS)
102 + ln -sf libgsm.so.$(MAJOR) $(LIB)/libgsm.so
104 # Toast, Untoast and Tcat -- the compress-like frontends to gsm.
106 $(TOAST): $(BIN) $(TOAST_OBJECTS) $(LIBGSM)
107 - $(LD) $(LFLAGS) -o $(TOAST) $(TOAST_OBJECTS) $(LIBGSM) $(LDLIB)
108 + $(LD) $(LFLAGS) -o $(TOAST) $(TOAST_OBJECTS) -L./lib -lgsm $(LDLIB)
110 $(UNTOAST): $(BIN) $(TOAST)
111 -rm $(RMFLAGS) $(UNTOAST)
116 -$(GSM_INSTALL_LIB)/libgsm.a: $(LIBGSM)
117 +$(GSM_INSTALL_LIB)/libgsm.so.$(MAJOR): $(LIBGSM)
120 + ( cd $(GSM_INSTALL_LIB) ; ln -sf libgsm.so.$(MAJOR) libgsm.so )