]> git.pld-linux.org Git - packages/libgsm.git/blob - libgsm-makefile.patch
- updated to 1.0.17
[packages/libgsm.git] / libgsm-makefile.patch
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
3 @@ -44,7 +44,7 @@
4  # CCFLAGS      = -c -O
5  
6  CC             = gcc -ansi -pedantic
7 -CCFLAGS        = -c -O2 -DNeedFunctionPrototypes=1 -Wall -Wno-comment
8 +CCFLAGS        = $(OPTFLAGS) -DNeedFunctionPrototypes=1 -Wall -Wno-comment
9  
10  LD             = $(CC)
11  
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 @@
21  # Leave GSM_INSTALL_ROOT empty to not install the GSM library outside of
22  # this directory.
23  
24 -GSM_INSTALL_ROOT = $(INSTALL_ROOT)
25 +GSM_INSTALL_ROOT = $(INSTALL_ROOT)/usr
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?
34 @@ -89,12 +90,13 @@
35  # Leave TOAST_INSTALL_ROOT empty to not install the toast binaries outside
36  # of this directory.
37  
38 -TOAST_INSTALL_ROOT       = $(INSTALL_ROOT)
39 +TOAST_INSTALL_ROOT = $(INSTALL_ROOT)/usr
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  
46 +MV             = mv
47  SHELL          = /bin/sh
48  LN             = ln
49  BASENAME       = basename
50 @@ -140,6 +142,7 @@
51  # Targets
52  
53  LIBGSM = $(LIB)/libgsm.a
54 +LIBGSMSO= $(LIB)/libgsm.so
55  
56  TOAST  = $(BIN)/toast
57  UNTOAST        = $(BIN)/untoast
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 @@
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        \
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
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
91 @@ -298,24 +304,37 @@
92  
93  
94  # The basic API: libgsm
95 +#$(LIBGSMSO):   $(LIB) $(GSM_OBJECTS)
96 +#              ld -o $@.1.0.10 -shared -soname libgsm.so.1 $(GSM_OBJECTS)
97  
98  $(LIBGSM):     $(LIB) $(GSM_OBJECTS)
99 -               -rm $(RMFLAGS) $(LIBGSM)
100                 $(AR) $(ARFLAGS) $(LIBGSM) $(GSM_OBJECTS)
101                 $(RANLIB) $(LIBGSM)
102  
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)           
115 +               cd shared; $(CC) -o ../lib/libgsm.so.1.0.10 -shared -Wl,-soname=libgsm.so.1 *.o
116 +
117 +
118  # Toast, Untoast and Tcat -- the compress-like frontends to gsm.
119  
120  $(TOAST):      $(BIN) $(TOAST_OBJECTS) $(LIBGSM)
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  
132 @@ -351,53 +370,47 @@
133                 fi
134  
135  $(TOAST_INSTALL_BIN)/toast:    $(TOAST)
136 -               -rm $@
137                 cp $(TOAST) $@
138                 chmod 755 $@
139  
140  $(TOAST_INSTALL_BIN)/untoast:  $(TOAST_INSTALL_BIN)/toast
141 -               -rm $@
142 -               ln $? $@
143 +               ln -sf toast $@
144  
145  $(TOAST_INSTALL_BIN)/tcat:     $(TOAST_INSTALL_BIN)/toast
146 -               -rm $@
147 -               ln $? $@
148 +               ln -sf toast $@
149  
150  $(TOAST_INSTALL_MAN)/toast.1:  $(MAN)/toast.1
151 -               -rm $@
152                 cp $? $@
153                 chmod 444 $@
154  
155  $(GSM_INSTALL_MAN)/gsm.3:      $(MAN)/gsm.3
156 -               -rm $@
157                 cp $? $@
158                 chmod 444 $@
159  
160  $(GSM_INSTALL_MAN)/gsm_option.3:       $(MAN)/gsm_option.3
161 -               -rm $@
162                 cp $? $@
163                 chmod 444 $@
164  
165  $(GSM_INSTALL_MAN)/gsm_explode.3:      $(MAN)/gsm_explode.3
166 -               -rm $@
167                 cp $? $@
168                 chmod 444 $@
169  
170  $(GSM_INSTALL_MAN)/gsm_print.3:        $(MAN)/gsm_print.3
171 -               -rm $@
172                 cp $? $@
173                 chmod 444 $@
174  
175  $(GSM_INSTALL_INC)/gsm.h:      $(INC)/gsm.h
176 -               -rm $@
177                 cp $? $@
178                 chmod 444 $@
179  
180  $(GSM_INSTALL_LIB)/libgsm.a:   $(LIBGSM)
181 -               -rm $@
182                 cp $? $@
183                 chmod 444 $@
184  
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
189  
190  # Distribution
191  
This page took 0.105529 seconds and 3 git commands to generate.