gsm-1.0-pl10-shared.diff 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302
  1. --- Makefile 1996-07-02 16:36:06.000000000 +0200
  2. +++ Makefile.oden 2004-09-11 17:39:00.308986936 +0200
  3. @@ -30,6 +30,10 @@
  4. ######### define this, and read about the GSM_OPT_WAV49 option in the
  5. ######### manual page on gsm_option(3).
  6. +PG =
  7. +#PG = -g -pg
  8. +######### Profiling flags. If you don't know what that means, leave it blank
  9. +
  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. @@ -44,7 +48,7 @@
  14. # CCFLAGS = -c -O
  15. CC = gcc -ansi -pedantic
  16. -CCFLAGS = -c -O2 -DNeedFunctionPrototypes=1
  17. +CCFLAGS = -c $(RPM_OPT_FLAGS) -fPIC -D_REENTRANT -DNeedFunctionPrototypes=1
  18. LD = $(CC)
  19. @@ -64,43 +68,27 @@
  20. # LDLIB = -lgcc
  21. ######### Additional libraries needed by $(LD)
  22. -
  23. -# Where do you want to install libraries, binaries, a header file
  24. -# and the manual pages?
  25. -#
  26. -# Leave INSTALL_ROOT empty (or just don't execute "make install") to
  27. -# not install gsm and toast outside of this directory.
  28. -
  29. -INSTALL_ROOT =
  30. -
  31. # Where do you want to install the gsm library, header file, and manpages?
  32. #
  33. -# Leave GSM_INSTALL_ROOT empty to not install the GSM library outside of
  34. +# Leave DESTDIR empty to not install the GSM library outside of
  35. # 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. +DESTDIR =
  41. -
  42. -# Where do you want to install the toast binaries and their manpage?
  43. -#
  44. -# Leave TOAST_INSTALL_ROOT empty to not install the toast binaries outside
  45. -# of this directory.
  46. -
  47. -TOAST_INSTALL_ROOT = $(INSTALL_ROOT)
  48. -TOAST_INSTALL_BIN = $(TOAST_INSTALL_ROOT)/bin
  49. -TOAST_INSTALL_MAN = $(TOAST_INSTALL_ROOT)/man/man1
  50. +prefix = /usr
  51. +libdir = $(prefix)/lib
  52. +includedir = $(prefix)/include
  53. +datadir = $(prefix)/share
  54. +mandir = $(datadir)/man
  55. # Other tools
  56. SHELL = /bin/sh
  57. -LN = ln
  58. +LN = ln -s
  59. BASENAME = basename
  60. AR = ar
  61. ARFLAGS = cr
  62. -RMFLAGS =
  63. +RMFLAGS = -f
  64. FIND = find
  65. COMPRESS = compress
  66. COMPRESSFLAGS =
  67. @@ -129,17 +117,18 @@
  68. # DEBUG = -DNDEBUG
  69. ######### Remove -DNDEBUG to enable assertions.
  70. -CFLAGS = $(CCFLAGS) $(SASR) $(DEBUG) $(MULHACK) $(FAST) $(LTP_CUT) \
  71. +CFLAGS = $(PG) $(CCFLAGS) $(SASR) $(DEBUG) $(MULHACK) $(FAST) $(LTP_CUT) \
  72. $(WAV49) $(CCINC) -I$(INC)
  73. ######### It's $(CC) $(CFLAGS)
  74. -LFLAGS = $(LDFLAGS) $(LDINC)
  75. +LFLAGS = $(PG) $(LDFLAGS) $(LDINC)
  76. ######### It's $(LD) $(LFLAGS)
  77. # Targets
  78. LIBGSM = $(LIB)/libgsm.a
  79. +LIBGSMSO = $(LIB)/libgsm.so
  80. TOAST = $(BIN)/toast
  81. UNTOAST = $(BIN)/untoast
  82. @@ -257,18 +246,19 @@
  83. # Install targets
  84. GSM_INSTALL_TARGETS = \
  85. - $(GSM_INSTALL_LIB)/libgsm.a \
  86. - $(GSM_INSTALL_INC)/gsm.h \
  87. - $(GSM_INSTALL_MAN)/gsm.3 \
  88. - $(GSM_INSTALL_MAN)/gsm_explode.3 \
  89. - $(GSM_INSTALL_MAN)/gsm_option.3 \
  90. - $(GSM_INSTALL_MAN)/gsm_print.3
  91. + $(DESTDIR)$(libdir)/libgsm.a \
  92. + $(DESTDIR)$(libdir)/libgsm.so \
  93. + $(DESTDIR)$(includedir)/gsm/gsm.h \
  94. + $(DESTDIR)$(mandir)/man3/gsm.3 \
  95. + $(DESTDIR)$(mandir)/man3/gsm_explode.3 \
  96. + $(DESTDIR)$(mandir)/man3/gsm_option.3 \
  97. + $(DESTDIR)$(mandir)/man3/gsm_print.3
  98. TOAST_INSTALL_TARGETS = \
  99. - $(TOAST_INSTALL_BIN)/toast \
  100. - $(TOAST_INSTALL_BIN)/tcat \
  101. - $(TOAST_INSTALL_BIN)/untoast \
  102. - $(TOAST_INSTALL_MAN)/toast.1
  103. + $(DESTDIR)$(bindir)/toast \
  104. + $(DESTDIR)$(bindir)/tcat \
  105. + $(DESTDIR)$(bindir)/untoast \
  106. + $(DESTDIR)$(mandir)/man1/toast.1
  107. # Default rules
  108. @@ -279,7 +269,7 @@
  109. # Target rules
  110. -all: $(LIBGSM) $(TOAST) $(TCAT) $(UNTOAST)
  111. +all: $(LIBGSM) $(LIBGSMSO) $(TOAST) $(TCAT) $(UNTOAST)
  112. @-echo $(ROOT): Done.
  113. tst: $(TST)/lin2cod $(TST)/cod2lin $(TOAST) $(TST)/test-result
  114. @@ -299,24 +289,28 @@
  115. # The basic API: libgsm
  116. +$(LIBGSMSO): $(LIB) $(GSM_OBJECTS)
  117. + $(LD) -o $@.1.0.10 -shared -Xlinker -soname -Xlinker libgsm.so.1 $(GSM_OBJECTS) -lc
  118. + ln -fs libgsm.so.1.0.10 lib/libgsm.so.1
  119. + ln -fs libgsm.so.1.0.10 lib/libgsm.so
  120. +
  121. $(LIBGSM): $(LIB) $(GSM_OBJECTS)
  122. -rm $(RMFLAGS) $(LIBGSM)
  123. $(AR) $(ARFLAGS) $(LIBGSM) $(GSM_OBJECTS)
  124. $(RANLIB) $(LIBGSM)
  125. -
  126. # Toast, Untoast and Tcat -- the compress-like frontends to gsm.
  127. -$(TOAST): $(BIN) $(TOAST_OBJECTS) $(LIBGSM)
  128. - $(LD) $(LFLAGS) -o $(TOAST) $(TOAST_OBJECTS) $(LIBGSM) $(LDLIB)
  129. +$(TOAST): $(BIN) $(TOAST_OBJECTS) $(LIBGSMSO)
  130. + $(LD) $(LFLAGS) -o $(TOAST) $(TOAST_OBJECTS) $(LIBGSMSO) $(LDLIB)
  131. $(UNTOAST): $(BIN) $(TOAST)
  132. -rm $(RMFLAGS) $(UNTOAST)
  133. - $(LN) $(TOAST) $(UNTOAST)
  134. + $(LN) toast $(UNTOAST)
  135. $(TCAT): $(BIN) $(TOAST)
  136. -rm $(RMFLAGS) $(TCAT)
  137. - $(LN) $(TOAST) $(TCAT)
  138. + $(LN) toast $(TCAT)
  139. # The local bin and lib directories
  140. @@ -331,72 +325,71 @@
  141. # Installation
  142. gsminstall:
  143. - -if [ x"$(GSM_INSTALL_ROOT)" != x ] ; then \
  144. - make $(GSM_INSTALL_TARGETS) ; \
  145. - fi
  146. + make $(GSM_INSTALL_TARGETS)
  147. toastinstall:
  148. - -if [ x"$(TOAST_INSTALL_ROOT)" != x ]; then \
  149. - make $(TOAST_INSTALL_TARGETS); \
  150. - fi
  151. + make $(TOAST_INSTALL_TARGETS)
  152. gsmuninstall:
  153. - -if [ x"$(GSM_INSTALL_ROOT)" != x ] ; then \
  154. - rm $(RMFLAGS) $(GSM_INSTALL_TARGETS) ; \
  155. - fi
  156. + rm $(RMFLAGS) $(GSM_INSTALL_TARGETS)
  157. toastuninstall:
  158. - -if [ x"$(TOAST_INSTALL_ROOT)" != x ] ; then \
  159. - rm $(RMFLAGS) $(TOAST_INSTALL_TARGETS); \
  160. - fi
  161. -
  162. -$(TOAST_INSTALL_BIN)/toast: $(TOAST)
  163. - -rm $@
  164. - cp $(TOAST) $@
  165. - chmod 755 $@
  166. -
  167. -$(TOAST_INSTALL_BIN)/untoast: $(TOAST_INSTALL_BIN)/toast
  168. - -rm $@
  169. - ln $? $@
  170. -
  171. -$(TOAST_INSTALL_BIN)/tcat: $(TOAST_INSTALL_BIN)/toast
  172. - -rm $@
  173. - ln $? $@
  174. -
  175. -$(TOAST_INSTALL_MAN)/toast.1: $(MAN)/toast.1
  176. - -rm $@
  177. - cp $? $@
  178. - chmod 444 $@
  179. -
  180. -$(GSM_INSTALL_MAN)/gsm.3: $(MAN)/gsm.3
  181. - -rm $@
  182. - cp $? $@
  183. - chmod 444 $@
  184. -
  185. -$(GSM_INSTALL_MAN)/gsm_option.3: $(MAN)/gsm_option.3
  186. - -rm $@
  187. - cp $? $@
  188. - chmod 444 $@
  189. -
  190. -$(GSM_INSTALL_MAN)/gsm_explode.3: $(MAN)/gsm_explode.3
  191. - -rm $@
  192. - cp $? $@
  193. - chmod 444 $@
  194. -
  195. -$(GSM_INSTALL_MAN)/gsm_print.3: $(MAN)/gsm_print.3
  196. - -rm $@
  197. - cp $? $@
  198. - chmod 444 $@
  199. -
  200. -$(GSM_INSTALL_INC)/gsm.h: $(INC)/gsm.h
  201. - -rm $@
  202. - cp $? $@
  203. - chmod 444 $@
  204. -
  205. -$(GSM_INSTALL_LIB)/libgsm.a: $(LIBGSM)
  206. - -rm $@
  207. - cp $? $@
  208. - chmod 444 $@
  209. + rm $(RMFLAGS) $(TOAST_INSTALL_TARGETS)
  210. +
  211. +$(DESTDIR)$(bindir)/toast: $(TOAST)
  212. + -rm $(RMFLAGS) $@
  213. + -mkdir -p $(DESTDIR)$(bindir)
  214. + install -m0755 $(TOAST) $@
  215. +
  216. +$(DESTDIR)$(bindir)/untoast: $(DESTDIR)$(bindir)/toast
  217. + -rm $(RMFLAGS) $@
  218. + -mkdir -p $(DESTDIR)$(bindir)
  219. + ln -sf $(TOAST) $@
  220. +
  221. +$(DESTDIR)$(bindir)/tcat: $(DESTDIR)$(bindir)/toast
  222. + -rm $(RMFLAGS) $@
  223. + -mkdir -p $(DESTDIR)$(bindir)
  224. + ln -sf $(TOAST) $@
  225. +
  226. +$(DESTDIR)$(mandir)/man1/toast.1: $(MAN)/toast.1
  227. + -rm $(RMFLAGS) $@
  228. + -mkdir -p $(DESTDIR)$(mandir)/man1/
  229. + install -m0444 $? $@
  230. +
  231. +$(DESTDIR)$(mandir)/man3/gsm.3: $(MAN)/gsm.3
  232. + -rm $(RMFLAGS) $@
  233. + -mkdir -p $(DESTDIR)$(mandir)/man3/
  234. + install -m0444 $? $@
  235. +
  236. +$(DESTDIR)$(mandir)/man3/gsm_option.3: $(MAN)/gsm_option.3
  237. + -rm $(RMFLAGS) $@
  238. + -mkdir -p $(DESTDIR)$(mandir)/man3/
  239. + install -m0444 $? $@
  240. +
  241. +$(DESTDIR)$(mandir)/man3/gsm_explode.3: $(MAN)/gsm_explode.3
  242. + -rm $(RMFLAGS) $@
  243. + -mkdir -p $(DESTDIR)$(mandir)/man3/
  244. + install -m0444 $? $@
  245. +
  246. +$(DESTDIR)$(mandir)/man3/gsm_print.3: $(MAN)/gsm_print.3
  247. + -rm $(RMFLAGS) $@
  248. + -mkdir -p $(DESTDIR)$(mandir)/man3/
  249. + install -m0444 $? $@
  250. +
  251. +$(DESTDIR)$(includedir)/gsm/gsm.h: $(INC)/gsm.h
  252. + -rm $(RMFLAGS) $@
  253. + -mkdir -p $(DESTDIR)$(includedir)/gsm/
  254. + install -m0444 $? $@
  255. +
  256. +$(DESTDIR)$(libdir)/libgsm.a: $(LIBGSM)
  257. + -rm $(RMFLAGS) $@
  258. + -mkdir -p $(DESTDIR)$(libdir)
  259. + install -m0444 $? $@
  260. +
  261. +$(DESTDIR)$(libdir)/libgsm.so: $(LIBGSMSO)
  262. + -rm $(RMFLAGS) $@
  263. + -mkdir -p $(DESTDIR)$(libdir)
  264. + cp -av $?* $(DESTDIR)$(libdir)/
  265. # Distribution