p7zip: assorted fixes
[oi-userland.git] / components / encumbered / gsm / patches / 01-makefile.patch
blob0d04ba2ff467a2f1f44fc101e4286d419892ab27
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
3 @@ -30,6 +30,9 @@
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.
8 +MAJOR=1
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.
13 @@ -43,8 +46,8 @@
14 # CC = /usr/lang/acc
15 # CCFLAGS = -c -O
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
22 LD = $(CC)
24 @@ -71,17 +74,17 @@
25 # Leave INSTALL_ROOT empty (or just don't execute "make install") to
26 # not install gsm and toast outside of this directory.
28 -INSTALL_ROOT =
29 +#INSTALL_ROOT =
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
34 # this directory.
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?
47 @@ -89,13 +92,13 @@
48 # Leave TOAST_INSTALL_ROOT empty to not install the toast binaries outside
49 # of this directory.
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
57 # Other tools
59 -SHELL = /bin/sh
60 +SHELL = /bin/bash
61 LN = ln
62 BASENAME = basename
63 AR = ar
64 @@ -129,8 +132,9 @@
65 # DEBUG = -DNDEBUG
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)
76 @@ -139,7 +143,7 @@
78 # Targets
80 -LIBGSM = $(LIB)/libgsm.a
81 +LIBGSM = $(LIB)/libgsm.so.$(MAJOR)
83 TOAST = $(BIN)/toast
84 UNTOAST = $(BIN)/untoast
85 @@ -257,7 +261,7 @@
86 # Install targets
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 \
94 @@ -301,14 +305,13 @@
96 $(LIBGSM): $(LIB) $(GSM_OBJECTS)
97 -rm $(RMFLAGS) $(LIBGSM)
98 - $(AR) $(ARFLAGS) $(LIBGSM) $(GSM_OBJECTS)
99 - $(RANLIB) $(LIBGSM)
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)
112 @@ -393,9 +396,10 @@
113 cp $? $@
114 chmod 444 $@
116 -$(GSM_INSTALL_LIB)/libgsm.a: $(LIBGSM)
117 +$(GSM_INSTALL_LIB)/libgsm.so.$(MAJOR): $(LIBGSM)
118 -rm $(RMFLAGS) $@
119 cp $? $@
120 + ( cd $(GSM_INSTALL_LIB) ; ln -sf libgsm.so.$(MAJOR) libgsm.so )
121 chmod 444 $@