1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
|
$NetBSD: patch-aa,v 1.4 2002/10/25 10:30:37 wiz Exp $
--- Makefile.orig Sat Sep 18 11:29:44 1999
+++ Makefile Sat Jan 15 12:34:29 2000
@@ -3,16 +3,19 @@
# Debugging options
-DEBUG = -g -DHEXDUMP
+#DEBUG = -g -DHEXDUMP
#DEBUG = -g -DHEXDUMP -DNOCRYPTO
-#DEBUG = -O
+DEBUG = -O
# Installation
# Install program
-INSTALL = /usr/bin/install
+#INSTALL = /usr/bin/install
+INSTALL_PROGRAM = ${BSD_INSTALL_PROGRAM}
+INSTALL_SCRIPT = ${BSD_INSTALL_SCRIPT}
+INSTALL_MAN = ${BSD_INSTALL_MAN}
# Installation root directory
-INSTDIR = /usr/local
+INSTDIR = ${PREFIX}
# Binaries
INSTDIR_BIN = $(INSTDIR)/bin
# Manual pages
@@ -38,9 +41,9 @@
# functionality is working. Please see the detailed description
# of the available flags which follows these declarations.
#
-CCFLAGS = -DAUDIO_BLOCKING -DLINUX -DHALF_DUPLEX -DM_LITTLE_ENDIAN
-CC = gcc -O3 # for GNU's gcc compiler
-LFLAGS = -lncurses -lm
+#CCFLAGS = -DAUDIO_BLOCKING -DLINUX -DHALF_DUPLEX -DM_LITTLE_ENDIAN
+#CC = gcc -O3 # for GNU's gcc compiler
+#LFLAGS = -lncurses -lm
#
# If the above LFLAGS doesn't work, try the one below.
#LFLAGS = -lcurses -lm
@@ -223,6 +226,18 @@
#CCFLAGS = -DM_LITTLE_ENDIAN
#LFLAGS = -lcurses -ltermcap -lcompat -lm
+# NetBSD 1.4
+# (courtesy of John A. Maier)
+
+# -lossaudio is needed to provide OSS audio emulation. -DHALF_DUPLEX may
+# also be needed in CCFLAGS depending on the driver for the sound card
+# (see below). -lcompat is needed to link correctly since the source uses
+# the obsoleted function cuserid().
+
+CCFLAGS += -DUSE_CURSES
+CCFLAGS += -DSOUNDDIR=\"${SOUNDDIR}\"
+LFLAGS += -lcurses -ltermcap -lm -lcompat -lossaudio
+
# Hewlett-Packard
# (courtesy of Marc Kilian)
#
@@ -233,7 +248,7 @@
# Where Perl is located on your system. This is used to make
# a directly-executable version of sfvod.
-PERL = /usr/bin/perl
+#PERL = /usr/bin/perl
# If your audio hardware is half duplex, uncomment the next line.
# You can also, if you wish, define this on the CCFLAGS definition
@@ -267,23 +282,67 @@
CARGS = -DInternet_Port=$(INTERNET_PORT)
+# Crypto
+.if defined(USE_CRYPTO) && $(USE_CRYPTO) == "YES"
+.if defined(HAVE_LIBCRYPTO) && $(HAVE_LIBCRYPTO) == "YES"
+CRYPTOFLAGS = -I$(SSLBASE)/include
+CRYPTOLIBS = des/des.a -Wl,-R$(SSLBASE)/lib -L$(SSLBASE)/lib -lcrypto
+CRYPTOOBJS = deslib.o
+.else
+CRYPTOFLAGS = -Ilibdes -Iblowfish
+CRYPTOLIBS = blowfish/libblowfish.a des/des.a libdes/libdes.a
+CRYPTOOBJS = libblowfish.o deslib.o libdes.o
+.if defined(USE_IDEA) && $(USE_IDEA) == "YES"
+CRYPTOFLAGS += -DUSE_IDEA -Iidea
+CRYPTOLIBS += idea/idea.a
+CRYPTOOBJS += idealib.o
+.endif
+.endif
+.else
+CCFLAGS += -DNOCRYPTO
+CRYPTOFLAGS =
+CRYPTOLIBS =
+CRYPTOOBJS =
+.endif
+
+.if defined(HAVE_GSM) && ${HAVE_GSM} == "YES"
+GSMFLAGS = -I${BUILDLINK_PREFIX.gsm}/include
+GSMLIBS = -Wl,-R${BUILDLINK_PREFIX.gsm}/lib -L${BUILDLINK_PREFIX.gsm}/lib -lgsm
+GSMOBJS =
+.else
+GSMFLAGS = -Igsm/inc
+GSMLIBS = gsm/lib/libgsm.a
+GSMOBJS = gsmlib.o
+.endif
+
+.if defined(HAVE_MD5) && $(HAVE_MD5) == "YES"
+MD5FLAGS = -I/usr/include
+MD5LIBS =
+MD5OBJS =
+.else
+MD5FLAGS = -Imd5
+MD5LIBS = md5/md5.o
+MD5OBJS = md5lib.o
+.endif
+
# Compiler flags
-CFLAGS = $(DEBUG) -Iadpcm -Ilpc -Igsm/inc -Imd5 -Iidea -Ilibdes -Iblowfish $(CARGS) $(DUPLEX) $(CCFLAGS) $(DOMAIN)
+CFLAGS = $(DEBUG) -Iadpcm -Ilpc $(GSMFLAGS) $(MD5FLAGS) $(CRYPTOFLAGS) $(CARGS) $(DUPLEX) $(CCFLAGS) $(DOMAIN)
-PROGRAMS = sfspeaker sfmike sflaunch sflwld sflwl sfecho sfreflect sfvod
+PROGRAMS = sfspeaker sfmike sflaunch sflwld sflwl sfecho sfreflect
+SCRIPTS = sfvod
-all: $(PROGRAMS)
+all: $(PROGRAMS) $(SCRIPTS)
SPKROBJS = speaker.o codecs.o deskey.o g711.o rate.o rtpacket.o soundbyte.o ulaw.o usleep.o vatpkt.o vox.o audio_hp.o audio_sgi.o common.o
-sfspeaker: $(SPKROBJS) adpcmlib.o libblowfish.o lpclib.o lpc10lib.o gsmlib.o deslib.o md5lib.o idealib.o libdes.o xdsub.o
- $(CC) $(SPKROBJS) adpcm/adpcm-u.o blowfish/libblowfish.a des/des.a md5/md5.o idea/idea.a lpc10/liblpc10.a gsm/lib/libgsm.a lpc/lpc.o xdsub.o libdes/libdes.a $(LFLAGS) -o sfspeaker
+sfspeaker: $(SPKROBJS) adpcmlib.o lpclib.o lpc10lib.o $(GSMOBJS) $(MD5OBJS) xdsub.o $(CRYPTOOBJS)
+ $(CC) $(SPKROBJS) adpcm/adpcm-u.o $(MD5LIBS) lpc10/liblpc10.a $(GSMLIBS) lpc/lpc.o xdsub.o $(CRYPTOLIBS) $(LFLAGS) -o sfspeaker
MIKEOBJS = mike.o codecs.o deskey.o g711.o rate.o rtpacket.o soundbyte.o ulaw.o usleep.o vatpkt.o xdsub.o audio_hp.o audio_sgi.o
-sfmike: $(MIKEOBJS) adpcmlib.o libblowfish.o lpclib.o lpc10lib.o gsmlib.o deslib.o md5lib.o idealib.o libdes.o
- $(CC) $(MIKEOBJS) adpcm/adpcm-u.o des/des.a md5/md5.o idea/idea.a -lm blowfish/libblowfish.a lpc10/liblpc10.a gsm/lib/libgsm.a lpc/lpc.o libdes/libdes.a $(LFLAGS) -o sfmike
+sfmike: $(MIKEOBJS) adpcmlib.o lpclib.o lpc10lib.o $(GSMOBJS) $(MD5OBJS) $(CRYPTOOBJS)
+ $(CC) $(MIKEOBJS) adpcm/adpcm-u.o $(MD5LIBS) -lm lpc10/liblpc10.a $(GSMLIBS) lpc/lpc.o $(CRYPTOLIBS) $(LFLAGS) -o sfmike
LAUNCHOBJS = launch.o soundbyte.o usleep.o g711.o
@@ -302,13 +361,13 @@
ECHOOBJS = echo.o codecs.o g711.o rtpacket.o ulaw.o xdsub.o
-sfecho: $(ECHOOBJS) md5lib.o
- $(CC) $(ECHOOBJS) md5/md5.o adpcm/adpcm-u.o lpc/lpc.o $(LFLAGS) -o sfecho
+sfecho: $(ECHOOBJS) $(MD5OBJS)
+ $(CC) $(ECHOOBJS) $(MD5LIBS) adpcm/adpcm-u.o lpc/lpc.o $(LFLAGS) -o sfecho
REFLECTOBJS = reflect.o codecs.o html.o g711.o rtpacket.o ulaw.o xdsub.o
-sfreflect: $(REFLECTOBJS) md5lib.o
- $(CC) $(REFLECTOBJS) md5/md5.o adpcm/adpcm-u.o lpc/lpc.o $(LFLAGS) -o sfreflect
+sfreflect: $(REFLECTOBJS) $(MD5OBJS)
+ $(CC) $(REFLECTOBJS) $(MD5LIBS) adpcm/adpcm-u.o lpc/lpc.o $(LFLAGS) -o sfreflect
# Configure the voice on demand server for the platform's
# location of Perl and network constant definitions.
@@ -402,8 +461,8 @@
speakfree.h: audio_descr.h rtp.h rtpacket.h ulaw2linear.h types.h
-testgsm: testgsm.o gsmlib.o
- $(CC) testgsm.o -lm gsm/lib/libgsm.a $(LFLAGS) -o testgsm
+testgsm: testgsm.o $(GSMOBJS)
+ $(CC) testgsm.o -lm $(GSMLIBS) $(LFLAGS) -o testgsm
manpage:
nroff -man sfmike.1 | $(PAGER)
@@ -442,7 +501,7 @@
# Clean everything
clean:
- rm -f core *.out *.o *.bak $(PROGRAMS) *.shar sfvod-t*
+ rm -f core *.out *.o *.bak $(PROGRAMS) $(SCRIPTS) *.shar sfvod-t*
( cd adpcm; make clean )
( cd blowfish; make clean )
( cd libdes; make clean )
@@ -456,11 +515,12 @@
# Clean only the main directory, not the libraries
dusty:
- rm -f core *.out *.o *.bak $(PROGRAMS) *.shar sfvod-t*
+ rm -f core *.out *.o *.bak $(PROGRAMS) $(SCRIPTS) *.shar sfvod-t*
# Install binaries and manual pages. You'll need to
# be root to install in system directories.
install: $(PROGRAMS)
- $(INSTALL) -o root -g root -m 755 -s $(PROGRAMS) $(INSTDIR_BIN)
- $(INSTALL) -o root -g root -m 644 *.1 $(INSTDIR_MAN)/man1
+ $(INSTALL_PROGRAM) $(PROGRAMS) $(INSTDIR_BIN)
+ $(INSTALL_SCRIPT) $(SCRIPTS) $(INSTDIR_BIN)
+ $(INSTALL_MAN) *.1 $(INSTDIR_MAN)/man1
|