patches/libgsm-01-makefile.diff
author jurikm
Sun, 23 Oct 2011 09:48:48 +0000
changeset 7810 69230411510f
parent 368 4f17f8b5e830
child 8473 7e845e75f37b
permissions -rw-r--r--
encumbered/SFElibgsm.spec: fix multiarch
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
7810
69230411510f encumbered/SFElibgsm.spec: fix multiarch
jurikm
parents: 368
diff changeset
     1
--- gsm-1.0-pl13/Makefile	Sun Oct 23 11:19:08 2011
69230411510f encumbered/SFElibgsm.spec: fix multiarch
jurikm
parents: 368
diff changeset
     2
+++ gsm-1.0-pl13/Makefile	Sun Oct 23 11:16:48 2011
368
4f17f8b5e830 2007-08-30 Doug Scott <[email protected]>
drdoug007
parents:
diff changeset
     3
@@ -30,6 +30,8 @@
4f17f8b5e830 2007-08-30 Doug Scott <[email protected]>
drdoug007
parents:
diff changeset
     4
 ######### define this, and read about the GSM_OPT_WAV49 option in the
4f17f8b5e830 2007-08-30 Doug Scott <[email protected]>
drdoug007
parents:
diff changeset
     5
 ######### manual page on gsm_option(3).
4f17f8b5e830 2007-08-30 Doug Scott <[email protected]>
drdoug007
parents:
diff changeset
     6
 
4f17f8b5e830 2007-08-30 Doug Scott <[email protected]>
drdoug007
parents:
diff changeset
     7
+MAJOR=1
4f17f8b5e830 2007-08-30 Doug Scott <[email protected]>
drdoug007
parents:
diff changeset
     8
+
4f17f8b5e830 2007-08-30 Doug Scott <[email protected]>
drdoug007
parents:
diff changeset
     9
 # Choose a compiler.  The code works both with ANSI and K&R-C.
4f17f8b5e830 2007-08-30 Doug Scott <[email protected]>
drdoug007
parents:
diff changeset
    10
 # Use -DNeedFunctionPrototypes to compile with, -UNeedFunctionPrototypes to
4f17f8b5e830 2007-08-30 Doug Scott <[email protected]>
drdoug007
parents:
diff changeset
    11
 # compile without, function prototypes in the header files.
4f17f8b5e830 2007-08-30 Doug Scott <[email protected]>
drdoug007
parents:
diff changeset
    12
@@ -43,8 +45,8 @@
4f17f8b5e830 2007-08-30 Doug Scott <[email protected]>
drdoug007
parents:
diff changeset
    13
 # CC		= /usr/lang/acc
4f17f8b5e830 2007-08-30 Doug Scott <[email protected]>
drdoug007
parents:
diff changeset
    14
 # CCFLAGS 	= -c -O
4f17f8b5e830 2007-08-30 Doug Scott <[email protected]>
drdoug007
parents:
diff changeset
    15
 
4f17f8b5e830 2007-08-30 Doug Scott <[email protected]>
drdoug007
parents:
diff changeset
    16
-CC		= gcc -ansi -pedantic
4f17f8b5e830 2007-08-30 Doug Scott <[email protected]>
drdoug007
parents:
diff changeset
    17
-CCFLAGS 	= -c -O2 -DNeedFunctionPrototypes=1
4f17f8b5e830 2007-08-30 Doug Scott <[email protected]>
drdoug007
parents:
diff changeset
    18
+# CC		= gcc -ansi -pedantic
4f17f8b5e830 2007-08-30 Doug Scott <[email protected]>
drdoug007
parents:
diff changeset
    19
+# CCFLAGS 	= -c -O2 -DNeedFunctionPrototypes=1
4f17f8b5e830 2007-08-30 Doug Scott <[email protected]>
drdoug007
parents:
diff changeset
    20
 
4f17f8b5e830 2007-08-30 Doug Scott <[email protected]>
drdoug007
parents:
diff changeset
    21
 LD 		= $(CC)
4f17f8b5e830 2007-08-30 Doug Scott <[email protected]>
drdoug007
parents:
diff changeset
    22
 
7810
69230411510f encumbered/SFElibgsm.spec: fix multiarch
jurikm
parents: 368
diff changeset
    23
@@ -71,7 +73,7 @@
368
4f17f8b5e830 2007-08-30 Doug Scott <[email protected]>
drdoug007
parents:
diff changeset
    24
 # Leave INSTALL_ROOT empty (or just don't execute "make install") to
4f17f8b5e830 2007-08-30 Doug Scott <[email protected]>
drdoug007
parents:
diff changeset
    25
 # not install gsm and toast outside of this directory.
4f17f8b5e830 2007-08-30 Doug Scott <[email protected]>
drdoug007
parents:
diff changeset
    26
 
4f17f8b5e830 2007-08-30 Doug Scott <[email protected]>
drdoug007
parents:
diff changeset
    27
-INSTALL_ROOT	=
4f17f8b5e830 2007-08-30 Doug Scott <[email protected]>
drdoug007
parents:
diff changeset
    28
+# INSTALL_ROOT	=
4f17f8b5e830 2007-08-30 Doug Scott <[email protected]>
drdoug007
parents:
diff changeset
    29
 
4f17f8b5e830 2007-08-30 Doug Scott <[email protected]>
drdoug007
parents:
diff changeset
    30
 # Where do you want to install the gsm library, header file, and manpages?
4f17f8b5e830 2007-08-30 Doug Scott <[email protected]>
drdoug007
parents:
diff changeset
    31
 #
7810
69230411510f encumbered/SFElibgsm.spec: fix multiarch
jurikm
parents: 368
diff changeset
    32
@@ -78,10 +80,10 @@
368
4f17f8b5e830 2007-08-30 Doug Scott <[email protected]>
drdoug007
parents:
diff changeset
    33
 # Leave GSM_INSTALL_ROOT empty to not install the GSM library outside of
4f17f8b5e830 2007-08-30 Doug Scott <[email protected]>
drdoug007
parents:
diff changeset
    34
 # this directory.
4f17f8b5e830 2007-08-30 Doug Scott <[email protected]>
drdoug007
parents:
diff changeset
    35
 
4f17f8b5e830 2007-08-30 Doug Scott <[email protected]>
drdoug007
parents:
diff changeset
    36
-GSM_INSTALL_ROOT = $(INSTALL_ROOT)
4f17f8b5e830 2007-08-30 Doug Scott <[email protected]>
drdoug007
parents:
diff changeset
    37
+GSM_INSTALL_ROOT = $(DESTDIR)$(INSTALL_ROOT)
4f17f8b5e830 2007-08-30 Doug Scott <[email protected]>
drdoug007
parents:
diff changeset
    38
 GSM_INSTALL_LIB = $(GSM_INSTALL_ROOT)/lib
4f17f8b5e830 2007-08-30 Doug Scott <[email protected]>
drdoug007
parents:
diff changeset
    39
-GSM_INSTALL_INC = $(GSM_INSTALL_ROOT)/inc
4f17f8b5e830 2007-08-30 Doug Scott <[email protected]>
drdoug007
parents:
diff changeset
    40
-GSM_INSTALL_MAN = $(GSM_INSTALL_ROOT)/man/man3
4f17f8b5e830 2007-08-30 Doug Scott <[email protected]>
drdoug007
parents:
diff changeset
    41
+GSM_INSTALL_INC = $(GSM_INSTALL_ROOT)/include
4f17f8b5e830 2007-08-30 Doug Scott <[email protected]>
drdoug007
parents:
diff changeset
    42
+GSM_INSTALL_MAN = $(GSM_INSTALL_ROOT)/share/man/man3
4f17f8b5e830 2007-08-30 Doug Scott <[email protected]>
drdoug007
parents:
diff changeset
    43
 
4f17f8b5e830 2007-08-30 Doug Scott <[email protected]>
drdoug007
parents:
diff changeset
    44
 
4f17f8b5e830 2007-08-30 Doug Scott <[email protected]>
drdoug007
parents:
diff changeset
    45
 # Where do you want to install the toast binaries and their manpage?
4f17f8b5e830 2007-08-30 Doug Scott <[email protected]>
drdoug007
parents:
diff changeset
    46
@@ -89,18 +91,18 @@
4f17f8b5e830 2007-08-30 Doug Scott <[email protected]>
drdoug007
parents:
diff changeset
    47
 # Leave TOAST_INSTALL_ROOT empty to not install the toast binaries outside
4f17f8b5e830 2007-08-30 Doug Scott <[email protected]>
drdoug007
parents:
diff changeset
    48
 # of this directory.
4f17f8b5e830 2007-08-30 Doug Scott <[email protected]>
drdoug007
parents:
diff changeset
    49
 
4f17f8b5e830 2007-08-30 Doug Scott <[email protected]>
drdoug007
parents:
diff changeset
    50
-TOAST_INSTALL_ROOT	  = $(INSTALL_ROOT)
4f17f8b5e830 2007-08-30 Doug Scott <[email protected]>
drdoug007
parents:
diff changeset
    51
+TOAST_INSTALL_ROOT	  = $(DESTDIR)$(INSTALL_ROOT)
4f17f8b5e830 2007-08-30 Doug Scott <[email protected]>
drdoug007
parents:
diff changeset
    52
 TOAST_INSTALL_BIN = $(TOAST_INSTALL_ROOT)/bin
4f17f8b5e830 2007-08-30 Doug Scott <[email protected]>
drdoug007
parents:
diff changeset
    53
-TOAST_INSTALL_MAN = $(TOAST_INSTALL_ROOT)/man/man1
4f17f8b5e830 2007-08-30 Doug Scott <[email protected]>
drdoug007
parents:
diff changeset
    54
+TOAST_INSTALL_MAN = $(TOAST_INSTALL_ROOT)/share/man/man1
4f17f8b5e830 2007-08-30 Doug Scott <[email protected]>
drdoug007
parents:
diff changeset
    55
 
4f17f8b5e830 2007-08-30 Doug Scott <[email protected]>
drdoug007
parents:
diff changeset
    56
 #  Other tools
4f17f8b5e830 2007-08-30 Doug Scott <[email protected]>
drdoug007
parents:
diff changeset
    57
 
4f17f8b5e830 2007-08-30 Doug Scott <[email protected]>
drdoug007
parents:
diff changeset
    58
-SHELL		= /bin/sh
4f17f8b5e830 2007-08-30 Doug Scott <[email protected]>
drdoug007
parents:
diff changeset
    59
+SHELL		= /bin/bash
4f17f8b5e830 2007-08-30 Doug Scott <[email protected]>
drdoug007
parents:
diff changeset
    60
 LN		= ln
4f17f8b5e830 2007-08-30 Doug Scott <[email protected]>
drdoug007
parents:
diff changeset
    61
 BASENAME 	= basename
4f17f8b5e830 2007-08-30 Doug Scott <[email protected]>
drdoug007
parents:
diff changeset
    62
 AR		= ar
4f17f8b5e830 2007-08-30 Doug Scott <[email protected]>
drdoug007
parents:
diff changeset
    63
 ARFLAGS		= cr
4f17f8b5e830 2007-08-30 Doug Scott <[email protected]>
drdoug007
parents:
diff changeset
    64
-RMFLAGS		=
4f17f8b5e830 2007-08-30 Doug Scott <[email protected]>
drdoug007
parents:
diff changeset
    65
+RMFLAGS		= -f
4f17f8b5e830 2007-08-30 Doug Scott <[email protected]>
drdoug007
parents:
diff changeset
    66
 FIND		= find
4f17f8b5e830 2007-08-30 Doug Scott <[email protected]>
drdoug007
parents:
diff changeset
    67
 COMPRESS 	= compress
4f17f8b5e830 2007-08-30 Doug Scott <[email protected]>
drdoug007
parents:
diff changeset
    68
 COMPRESSFLAGS 	= 
4f17f8b5e830 2007-08-30 Doug Scott <[email protected]>
drdoug007
parents:
diff changeset
    69
@@ -129,7 +131,7 @@
4f17f8b5e830 2007-08-30 Doug Scott <[email protected]>
drdoug007
parents:
diff changeset
    70
 # DEBUG	= -DNDEBUG
4f17f8b5e830 2007-08-30 Doug Scott <[email protected]>
drdoug007
parents:
diff changeset
    71
 ######### Remove -DNDEBUG to enable assertions.
4f17f8b5e830 2007-08-30 Doug Scott <[email protected]>
drdoug007
parents:
diff changeset
    72
 
4f17f8b5e830 2007-08-30 Doug Scott <[email protected]>
drdoug007
parents:
diff changeset
    73
-CFLAGS	= $(CCFLAGS) $(SASR) $(DEBUG) $(MULHACK) $(FAST) $(LTP_CUT) \
4f17f8b5e830 2007-08-30 Doug Scott <[email protected]>
drdoug007
parents:
diff changeset
    74
+CFLAGS	= -c $(PICFLAG) $(OPTFLAGS) $(SASR) $(DEBUG) $(MULHACK) $(FAST) $(LTP_CUT) \
4f17f8b5e830 2007-08-30 Doug Scott <[email protected]>
drdoug007
parents:
diff changeset
    75
 	$(WAV49) $(CCINC) -I$(INC)
4f17f8b5e830 2007-08-30 Doug Scott <[email protected]>
drdoug007
parents:
diff changeset
    76
 ######### It's $(CC) $(CFLAGS)
4f17f8b5e830 2007-08-30 Doug Scott <[email protected]>
drdoug007
parents:
diff changeset
    77
 
4f17f8b5e830 2007-08-30 Doug Scott <[email protected]>
drdoug007
parents:
diff changeset
    78
@@ -139,7 +141,7 @@
4f17f8b5e830 2007-08-30 Doug Scott <[email protected]>
drdoug007
parents:
diff changeset
    79
 
4f17f8b5e830 2007-08-30 Doug Scott <[email protected]>
drdoug007
parents:
diff changeset
    80
 # Targets
4f17f8b5e830 2007-08-30 Doug Scott <[email protected]>
drdoug007
parents:
diff changeset
    81
 
4f17f8b5e830 2007-08-30 Doug Scott <[email protected]>
drdoug007
parents:
diff changeset
    82
-LIBGSM	= $(LIB)/libgsm.a
4f17f8b5e830 2007-08-30 Doug Scott <[email protected]>
drdoug007
parents:
diff changeset
    83
+LIBGSM	= $(LIB)/libgsm.so.$(MAJOR)
4f17f8b5e830 2007-08-30 Doug Scott <[email protected]>
drdoug007
parents:
diff changeset
    84
 
4f17f8b5e830 2007-08-30 Doug Scott <[email protected]>
drdoug007
parents:
diff changeset
    85
 TOAST	= $(BIN)/toast
4f17f8b5e830 2007-08-30 Doug Scott <[email protected]>
drdoug007
parents:
diff changeset
    86
 UNTOAST	= $(BIN)/untoast
4f17f8b5e830 2007-08-30 Doug Scott <[email protected]>
drdoug007
parents:
diff changeset
    87
@@ -257,7 +259,7 @@
4f17f8b5e830 2007-08-30 Doug Scott <[email protected]>
drdoug007
parents:
diff changeset
    88
 # Install targets
4f17f8b5e830 2007-08-30 Doug Scott <[email protected]>
drdoug007
parents:
diff changeset
    89
 
4f17f8b5e830 2007-08-30 Doug Scott <[email protected]>
drdoug007
parents:
diff changeset
    90
 GSM_INSTALL_TARGETS =	\
4f17f8b5e830 2007-08-30 Doug Scott <[email protected]>
drdoug007
parents:
diff changeset
    91
-		$(GSM_INSTALL_LIB)/libgsm.a		\
4f17f8b5e830 2007-08-30 Doug Scott <[email protected]>
drdoug007
parents:
diff changeset
    92
+		$(GSM_INSTALL_LIB)/libgsm.so.$(MAJOR)	\
4f17f8b5e830 2007-08-30 Doug Scott <[email protected]>
drdoug007
parents:
diff changeset
    93
 		$(GSM_INSTALL_INC)/gsm.h		\
4f17f8b5e830 2007-08-30 Doug Scott <[email protected]>
drdoug007
parents:
diff changeset
    94
 		$(GSM_INSTALL_MAN)/gsm.3		\
4f17f8b5e830 2007-08-30 Doug Scott <[email protected]>
drdoug007
parents:
diff changeset
    95
 		$(GSM_INSTALL_MAN)/gsm_explode.3	\
7810
69230411510f encumbered/SFElibgsm.spec: fix multiarch
jurikm
parents: 368
diff changeset
    96
@@ -301,14 +303,13 @@
368
4f17f8b5e830 2007-08-30 Doug Scott <[email protected]>
drdoug007
parents:
diff changeset
    97
 
4f17f8b5e830 2007-08-30 Doug Scott <[email protected]>
drdoug007
parents:
diff changeset
    98
 $(LIBGSM):	$(LIB) $(GSM_OBJECTS)
4f17f8b5e830 2007-08-30 Doug Scott <[email protected]>
drdoug007
parents:
diff changeset
    99
 		-rm $(RMFLAGS) $(LIBGSM)
4f17f8b5e830 2007-08-30 Doug Scott <[email protected]>
drdoug007
parents:
diff changeset
   100
-		$(AR) $(ARFLAGS) $(LIBGSM) $(GSM_OBJECTS)
4f17f8b5e830 2007-08-30 Doug Scott <[email protected]>
drdoug007
parents:
diff changeset
   101
-		$(RANLIB) $(LIBGSM)
4f17f8b5e830 2007-08-30 Doug Scott <[email protected]>
drdoug007
parents:
diff changeset
   102
+		$(LD) -G $(GSM_OBJECTS) -o $(LIBGSM) $(LDFLAGS)
4f17f8b5e830 2007-08-30 Doug Scott <[email protected]>
drdoug007
parents:
diff changeset
   103
 
4f17f8b5e830 2007-08-30 Doug Scott <[email protected]>
drdoug007
parents:
diff changeset
   104
 
4f17f8b5e830 2007-08-30 Doug Scott <[email protected]>
drdoug007
parents:
diff changeset
   105
 # Toast, Untoast and Tcat -- the compress-like frontends to gsm.
7810
69230411510f encumbered/SFElibgsm.spec: fix multiarch
jurikm
parents: 368
diff changeset
   106
 
69230411510f encumbered/SFElibgsm.spec: fix multiarch
jurikm
parents: 368
diff changeset
   107
 $(TOAST):	$(BIN) $(TOAST_OBJECTS) $(LIBGSM)
69230411510f encumbered/SFElibgsm.spec: fix multiarch
jurikm
parents: 368
diff changeset
   108
-		$(LD) $(LFLAGS) -o $(TOAST) $(TOAST_OBJECTS) $(LIBGSM) $(LDLIB)
69230411510f encumbered/SFElibgsm.spec: fix multiarch
jurikm
parents: 368
diff changeset
   109
+		$(LD) $(LFLAGS) -o $(TOAST) $(TOAST_OBJECTS) -lgsm -L./lib $(LDLIB)
69230411510f encumbered/SFElibgsm.spec: fix multiarch
jurikm
parents: 368
diff changeset
   110
 
69230411510f encumbered/SFElibgsm.spec: fix multiarch
jurikm
parents: 368
diff changeset
   111
 $(UNTOAST):	$(BIN) $(TOAST)
69230411510f encumbered/SFElibgsm.spec: fix multiarch
jurikm
parents: 368
diff changeset
   112
 		-rm $(RMFLAGS) $(UNTOAST)
368
4f17f8b5e830 2007-08-30 Doug Scott <[email protected]>
drdoug007
parents:
diff changeset
   113
@@ -393,9 +394,10 @@
4f17f8b5e830 2007-08-30 Doug Scott <[email protected]>
drdoug007
parents:
diff changeset
   114
 		cp $? $@
4f17f8b5e830 2007-08-30 Doug Scott <[email protected]>
drdoug007
parents:
diff changeset
   115
 		chmod 444 $@
4f17f8b5e830 2007-08-30 Doug Scott <[email protected]>
drdoug007
parents:
diff changeset
   116
 
4f17f8b5e830 2007-08-30 Doug Scott <[email protected]>
drdoug007
parents:
diff changeset
   117
-$(GSM_INSTALL_LIB)/libgsm.a:	$(LIBGSM)
4f17f8b5e830 2007-08-30 Doug Scott <[email protected]>
drdoug007
parents:
diff changeset
   118
+$(GSM_INSTALL_LIB)/libgsm.so.$(MAJOR):	$(LIBGSM)
4f17f8b5e830 2007-08-30 Doug Scott <[email protected]>
drdoug007
parents:
diff changeset
   119
 		-rm $@
4f17f8b5e830 2007-08-30 Doug Scott <[email protected]>
drdoug007
parents:
diff changeset
   120
 		cp $? $@
4f17f8b5e830 2007-08-30 Doug Scott <[email protected]>
drdoug007
parents:
diff changeset
   121
+		( cd $(GSM_INSTALL_LIB) ; ln -s libgsm.so.$(MAJOR) libgsm.so )
4f17f8b5e830 2007-08-30 Doug Scott <[email protected]>
drdoug007
parents:
diff changeset
   122
 		chmod 444 $@
4f17f8b5e830 2007-08-30 Doug Scott <[email protected]>
drdoug007
parents:
diff changeset
   123
 
4f17f8b5e830 2007-08-30 Doug Scott <[email protected]>
drdoug007
parents:
diff changeset
   124