Blame SOURCES/gsm-makefile.patch

510637
--- gsm-1.0-pl12/Makefile.mk	2006-04-26 21:14:26.000000000 +0200
510637
+++ gsm-1.0-pl12/Makefile	2007-05-13 13:03:32.000000000 +0200
510637
@@ -30,6 +30,10 @@
510637
 ######### define this, and read about the GSM_OPT_WAV49 option in the
510637
 ######### manual page on gsm_option(3).
510637
 
510637
+PG =
510637
+#PG = -g -pg
510637
+######### Profiling flags.  If you don't know what that means, leave it blank
510637
+
510637
 # Choose a compiler.  The code works both with ANSI and K&R-C.
510637
 # Use -DNeedFunctionPrototypes to compile with, -UNeedFunctionPrototypes to
510637
 # compile without, function prototypes in the header files.
510637
@@ -44,7 +48,7 @@
510637
 # CCFLAGS 	= -c -O
510637
 
510637
 CC		= gcc -ansi -pedantic
510637
-CCFLAGS 	= -c -O2 -DNeedFunctionPrototypes=1
510637
+CCFLAGS 	= -c $(RPM_OPT_FLAGS) -D_REENTRANT -DNeedFunctionPrototypes=1
510637
 
510637
 LD 		= $(CC)
510637
 
510637
@@ -81,7 +85,7 @@
510637
 GSM_INSTALL_ROOT = $(INSTALL_ROOT)
510637
 GSM_INSTALL_LIB = $(GSM_INSTALL_ROOT)/lib
510637
 GSM_INSTALL_INC = $(GSM_INSTALL_ROOT)/inc
510637
-GSM_INSTALL_MAN = $(GSM_INSTALL_ROOT)/man/man3
510637
+GSM_INSTALL_MAN = $(GSM_INSTALL_ROOT)/share/man/man3
510637
 
510637
 
510637
 # Where do you want to install the toast binaries and their manpage?
510637
@@ -91,16 +95,16 @@
510637
 
510637
 TOAST_INSTALL_ROOT	  = $(INSTALL_ROOT)
510637
 TOAST_INSTALL_BIN = $(TOAST_INSTALL_ROOT)/bin
510637
-TOAST_INSTALL_MAN = $(TOAST_INSTALL_ROOT)/man/man1
510637
+TOAST_INSTALL_MAN = $(TOAST_INSTALL_ROOT)/share/man/man1
510637
 
510637
 #  Other tools
510637
 
510637
 SHELL		= /bin/sh
510637
-LN		= ln
510637
+LN		= ln -s
510637
 BASENAME 	= basename
510637
 AR		= ar
510637
 ARFLAGS		= cr
510637
-RMFLAGS		=
510637
+RMFLAGS		= -f
510637
 FIND		= find
510637
 COMPRESS 	= compress
510637
 COMPRESSFLAGS 	= 
510637
@@ -129,17 +133,18 @@
510637
 # DEBUG	= -DNDEBUG
510637
 ######### Remove -DNDEBUG to enable assertions.
510637
 
510637
-CFLAGS	= $(CCFLAGS) $(SASR) $(DEBUG) $(MULHACK) $(FAST) $(LTP_CUT) \
510637
+CFLAGS	= $(PG) $(CCFLAGS) $(SASR) $(DEBUG) $(MULHACK) $(FAST) $(LTP_CUT) \
510637
 	$(WAV49) $(CCINC) -I$(INC)
510637
 ######### It's $(CC) $(CFLAGS)
510637
 
510637
-LFLAGS	= $(LDFLAGS) $(LDINC)
510637
+LFLAGS	= $(PG) $(LDFLAGS) $(LDINC)
510637
 ######### It's $(LD) $(LFLAGS)
510637
 
510637
 
510637
 # Targets
510637
 
510637
 LIBGSM	= $(LIB)/libgsm.a
510637
+LIBGSMSO = $(LIB)/libgsm.so
510637
 
510637
 TOAST	= $(BIN)/toast
510637
 UNTOAST	= $(BIN)/untoast
510637
@@ -279,7 +284,7 @@
510637
 
510637
 # Target rules
510637
 
510637
-all:		$(LIBGSM) $(TOAST) $(TCAT) $(UNTOAST)
510637
+all:		$(LIBGSM) $(LIBGSMSO) $(TOAST) $(TCAT) $(UNTOAST)
510637
 		@-echo $(ROOT): Done.
510637
 
510637
 tst:		$(TST)/lin2cod $(TST)/cod2lin $(TOAST) $(TST)/test-result
510637
@@ -299,24 +304,28 @@
510637
 
510637
 # The basic API: libgsm
510637
 
510637
+$(LIBGSMSO): $(LIB) $(GSM_OBJECTS)
510637
+			$(LD) -o $@.1.0.12 -shared -Xlinker -soname -Xlinker libgsm.so.1 $(GSM_OBJECTS) -lc
510637
+			ln -fs libgsm.so.1.0.12 lib/libgsm.so.1
510637
+			ln -fs libgsm.so.1.0.12 lib/libgsm.so
510637
+
510637
 $(LIBGSM):	$(LIB) $(GSM_OBJECTS)
510637
 		-rm $(RMFLAGS) $(LIBGSM)
510637
 		$(AR) $(ARFLAGS) $(LIBGSM) $(GSM_OBJECTS)
510637
 		$(RANLIB) $(LIBGSM)
510637
 
510637
-
510637
 # Toast, Untoast and Tcat -- the compress-like frontends to gsm.
510637
 
510637
-$(TOAST):	$(BIN) $(TOAST_OBJECTS) $(LIBGSM)
510637
-		$(LD) $(LFLAGS) -o $(TOAST) $(TOAST_OBJECTS) $(LIBGSM) $(LDLIB)
510637
+$(TOAST):	$(BIN) $(TOAST_OBJECTS) $(LIBGSM) $(LIBGSMSO)
510637
+		$(LD) $(LFLAGS) -o $(TOAST) $(TOAST_OBJECTS) $(LIBGSMSO) $(LDLIB)
510637
 
510637
 $(UNTOAST):	$(BIN) $(TOAST)
510637
 		-rm $(RMFLAGS) $(UNTOAST)
510637
-		$(LN) $(TOAST) $(UNTOAST)
510637
+		$(LN) toast $(UNTOAST)
510637
 
510637
 $(TCAT):	$(BIN) $(TOAST)
510637
 		-rm $(RMFLAGS) $(TCAT)
510637
-		$(LN) $(TOAST) $(TCAT)
510637
+		$(LN) toast $(TCAT)
510637
 
510637
 
510637
 # The local bin and lib directories