]> git.pld-linux.org Git - packages/libgsm.git/blame - libgsm-makefile.patch
- updated to 1.0.17
[packages/libgsm.git] / libgsm-makefile.patch
CommitLineData
a0b45594
JB
1--- gsm-1.0-pl17/Makefile.orig 2017-06-28 02:24:24.000000000 +0200
2+++ gsm-1.0-pl17/Makefile 2017-07-16 17:50:06.936841632 +0200
01204daa 3@@ -44,7 +44,7 @@
4 # CCFLAGS = -c -O
5
6 CC = gcc -ansi -pedantic
a0b45594
JB
7-CCFLAGS = -c -O2 -DNeedFunctionPrototypes=1 -Wall -Wno-comment
8+CCFLAGS = $(OPTFLAGS) -DNeedFunctionPrototypes=1 -Wall -Wno-comment
01204daa 9
10 LD = $(CC)
11
a446e0b1
AF
12@@ -64,6 +64,7 @@
13 # LDLIB = -lgcc
14 ######### Additional libraries needed by $(LD)
15
16+PICFLAGS = -fPIC
17
18 # Where do you want to install libraries, binaries, a header file
19 # and the manual pages?
20@@ -78,10 +79,10 @@
01204daa 21 # Leave GSM_INSTALL_ROOT empty to not install the GSM library outside of
22 # this directory.
23
24-GSM_INSTALL_ROOT = $(INSTALL_ROOT)
97d3e054 25+GSM_INSTALL_ROOT = $(INSTALL_ROOT)/usr
01204daa 26 GSM_INSTALL_LIB = $(GSM_INSTALL_ROOT)/lib
27-GSM_INSTALL_INC = $(GSM_INSTALL_ROOT)/inc
28-GSM_INSTALL_MAN = $(GSM_INSTALL_ROOT)/man/man3
29+GSM_INSTALL_INC = $(GSM_INSTALL_ROOT)/include
30+GSM_INSTALL_MAN = $(GSM_INSTALL_ROOT)/share/man/man3
31
32
33 # Where do you want to install the toast binaries and their manpage?
a446e0b1 34@@ -89,12 +90,13 @@
01204daa 35 # Leave TOAST_INSTALL_ROOT empty to not install the toast binaries outside
36 # of this directory.
37
38-TOAST_INSTALL_ROOT = $(INSTALL_ROOT)
97d3e054 39+TOAST_INSTALL_ROOT = $(INSTALL_ROOT)/usr
01204daa 40 TOAST_INSTALL_BIN = $(TOAST_INSTALL_ROOT)/bin
41-TOAST_INSTALL_MAN = $(TOAST_INSTALL_ROOT)/man/man1
42+TOAST_INSTALL_MAN = $(TOAST_INSTALL_ROOT)/share/man/man1
43
44 # Other tools
45
a446e0b1
AF
46+MV = mv
47 SHELL = /bin/sh
48 LN = ln
49 BASENAME = basename
50@@ -140,6 +142,7 @@
97d3e054 51 # Targets
52
53 LIBGSM = $(LIB)/libgsm.a
54+LIBGSMSO= $(LIB)/libgsm.so
55
56 TOAST = $(BIN)/toast
57 UNTOAST = $(BIN)/untoast
a446e0b1
AF
58@@ -222,6 +225,8 @@
59 $(SRC)/short_term.o \
60 $(SRC)/table.o
61
62+GSM_SHOBJECTS = $(foreach OBJX,$(GSM_OBJECTS),$(patsubst $(SRC)/%,shared/%,$(OBJX)))
63+
64 TOAST_OBJECTS = $(SRC)/toast.o \
65 $(SRC)/toast_lin.o \
66 $(SRC)/toast_ulaw.o \
67@@ -258,6 +263,7 @@
97d3e054 68
69 GSM_INSTALL_TARGETS = \
70 $(GSM_INSTALL_LIB)/libgsm.a \
71+ $(GSM_INSTALL_LIB)/libgsm.so.1.0.10 \
72 $(GSM_INSTALL_INC)/gsm.h \
73 $(GSM_INSTALL_MAN)/gsm.3 \
74 $(GSM_INSTALL_MAN)/gsm_explode.3 \
a446e0b1
AF
75@@ -274,12 +280,12 @@
76 # Default rules
77
78 .c.o:
79- $(CC) $(CFLAGS) $?
80- @-mv `$(BASENAME) $@` $@ > /dev/null 2>&1
81+ $(CC) -c $(CFLAGS) $? -o $@
82+# @-mv `$(BASENAME) $@` $@ > /dev/null 2>&1
97d3e054 83
84 # Target rules
85
86-all: $(LIBGSM) $(TOAST) $(TCAT) $(UNTOAST)
87+all: $(LIBGSM) $(LIBGSMSO) $(TOAST) $(TCAT) $(UNTOAST)
88 @-echo $(ROOT): Done.
89
90 tst: $(TST)/lin2cod $(TST)/cod2lin $(TOAST) $(TST)/test-result
927e9bc8 91@@ -298,24 +304,37 @@
97d3e054 92
93
01204daa 94 # The basic API: libgsm
a446e0b1
AF
95+#$(LIBGSMSO): $(LIB) $(GSM_OBJECTS)
96+# ld -o $@.1.0.10 -shared -soname libgsm.so.1 $(GSM_OBJECTS)
01204daa 97
98 $(LIBGSM): $(LIB) $(GSM_OBJECTS)
99- -rm $(RMFLAGS) $(LIBGSM)
100 $(AR) $(ARFLAGS) $(LIBGSM) $(GSM_OBJECTS)
101 $(RANLIB) $(LIBGSM)
102
a446e0b1
AF
103
104+shared:
105+ mkdir shared
106+
107+shared/%.o:
108+ $(CC) -c $(CFLAGS) $(PICFLAGS) -o $@ $(addprefix $(SRC)/,$(patsubst %.o,%.c,$(@F)))
109+
110+#libgsm.so.2: shared $(GSM_SHOBJECTS)
111+# echo $(GSM_SHOBJECTS)
112+# cd shared; $(CC) -shared -Wl -soname libgsm.so.2 -o libgsm.so.2.0 *.o
113+
114+$(LIBGSMSO): shared $(GSM_SHOBJECTS)
927e9bc8 115+ cd shared; $(CC) -o ../lib/libgsm.so.1.0.10 -shared -Wl,-soname=libgsm.so.1 *.o
a446e0b1
AF
116+
117+
118 # Toast, Untoast and Tcat -- the compress-like frontends to gsm.
119
120 $(TOAST): $(BIN) $(TOAST_OBJECTS) $(LIBGSM)
01204daa 121 $(LD) $(LFLAGS) -o $(TOAST) $(TOAST_OBJECTS) $(LIBGSM) $(LDLIB)
122
123 $(UNTOAST): $(BIN) $(TOAST)
124- -rm $(RMFLAGS) $(UNTOAST)
125 $(LN) $(TOAST) $(UNTOAST)
126
127 $(TCAT): $(BIN) $(TOAST)
128- -rm $(RMFLAGS) $(TCAT)
129 $(LN) $(TOAST) $(TCAT)
130
131
a0b45594 132@@ -351,53 +370,47 @@
01204daa 133 fi
134
135 $(TOAST_INSTALL_BIN)/toast: $(TOAST)
136- -rm $@
97d3e054 137 cp $(TOAST) $@
138 chmod 755 $@
01204daa 139
140 $(TOAST_INSTALL_BIN)/untoast: $(TOAST_INSTALL_BIN)/toast
141- -rm $@
142- ln $? $@
b5a5ca5f 143+ ln -sf toast $@
01204daa 144
a0b45594 145 $(TOAST_INSTALL_BIN)/tcat: $(TOAST_INSTALL_BIN)/toast
01204daa 146- -rm $@
147- ln $? $@
b5a5ca5f 148+ ln -sf toast $@
01204daa 149
150 $(TOAST_INSTALL_MAN)/toast.1: $(MAN)/toast.1
151- -rm $@
97d3e054 152 cp $? $@
153 chmod 444 $@
01204daa 154
155 $(GSM_INSTALL_MAN)/gsm.3: $(MAN)/gsm.3
156- -rm $@
97d3e054 157 cp $? $@
158 chmod 444 $@
01204daa 159
160 $(GSM_INSTALL_MAN)/gsm_option.3: $(MAN)/gsm_option.3
161- -rm $@
97d3e054 162 cp $? $@
163 chmod 444 $@
01204daa 164
165 $(GSM_INSTALL_MAN)/gsm_explode.3: $(MAN)/gsm_explode.3
166- -rm $@
97d3e054 167 cp $? $@
168 chmod 444 $@
01204daa 169
170 $(GSM_INSTALL_MAN)/gsm_print.3: $(MAN)/gsm_print.3
171- -rm $@
97d3e054 172 cp $? $@
173 chmod 444 $@
01204daa 174
175 $(GSM_INSTALL_INC)/gsm.h: $(INC)/gsm.h
176- -rm $@
97d3e054 177 cp $? $@
178 chmod 444 $@
01204daa 179
180 $(GSM_INSTALL_LIB)/libgsm.a: $(LIBGSM)
181- -rm $@
97d3e054 182 cp $? $@
183 chmod 444 $@
01204daa 184
97d3e054 185+$(GSM_INSTALL_LIB)/libgsm.so.1.0.10: $(LIBGSMSO).1.0.10
186+ cp $? $@
187+ ln -sf libgsm.so.1.0.10 $(GSM_INSTALL_LIB)/libgsm.so.1
188+ ln -sf libgsm.so.1.0.10 $(GSM_INSTALL_LIB)/libgsm.so
01204daa 189
190 # Distribution
97d3e054 191
This page took 0.15339 seconds and 4 git commands to generate.