summaryrefslogtreecommitdiff
blob: 7f60c2719023e6f42ca3b0590971688d3377192e (plain)
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
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
diff --git a/config.sh b/config.sh
index 17ade83..643b07e 100755
--- a/config.sh
+++ b/config.sh
@@ -80,7 +80,7 @@ echo "Configuring..."
 
 echo "/* automatically created by config.sh - do not modify */" > config.h
 echo "# automatically created by config.sh - do not modify" > makefile.opts
-> config.ldflags
+> config.libs
 > config.cflags
 > .config.log
 
@@ -134,7 +134,7 @@ done
 
 if [ "$MPDM" != "NOTFOUND" ] ; then
 	echo "-I$MPDM" >> config.cflags
-	echo "-L$MPDM -lmpdm" >> config.ldflags
+	echo "-L$MPDM -lmpdm" >> config.libs
 	echo "OK ($MPDM)"
 else
 	echo "No"
@@ -146,7 +146,7 @@ if [ ! -f $MPDM/Makefile ] ; then
 	( echo ; cd $MPDM ; ./config.sh --prefix=$PREFIX --docdir=$PREFIX/share/doc/$APPNAME $CONF_ARGS ; echo )
 fi
 
-cat $MPDM/config.ldflags >> config.ldflags
+cat $MPDM/config.libs >> config.libs
 echo "MPDM=$MPDM" >> makefile.opts
 
 # MPSL
@@ -160,7 +160,7 @@ done
 
 if [ "$MPSL" != "NOTFOUND" ] ; then
 	echo "-I$MPSL" >> config.cflags
-	echo "-L$MPSL -lmpsl" >> config.ldflags
+	echo "-L$MPSL -lmpsl" >> config.libs
 	echo "OK ($MPSL)"
 else
 	echo "No"
@@ -172,7 +172,7 @@ if [ ! -f $MPSL/Makefile ] ; then
 	( echo ; cd $MPSL ; ./config.sh --prefix=$PREFIX --docdir=$PREFIX/share/doc/$APPNAME $CONF_ARGS ; echo )
 fi
 
-cat $MPSL/config.ldflags >> config.ldflags
+cat $MPSL/config.libs >> config.libs
 echo "MPSL=$MPSL" >> makefile.opts
 
 # Win32
@@ -184,7 +184,7 @@ else
 	grep CONFOPT_WIN32 ${MPDM}/config.h >/dev/null
 
 	if [ $? = 0 ] ; then
-		echo "-mwindows -lcomctl32" >> config.ldflags
+		echo "-mwindows -lcomctl32" >> config.libs
 		echo "#define CONFOPT_WIN32 1" >> config.h
 		echo "OK"
 		DRIVERS="win32 $DRIVERS"
@@ -279,7 +279,7 @@ else
 
 		if [ $? = 0 ] ; then
 			echo $TMP_CFLAGS >> config.cflags
-			echo $TMP_LDFLAGS >> config.ldflags
+			echo $TMP_LDFLAGS >> config.libs
 
 			echo "#define CONFOPT_KDE4 1" >> config.h
 			echo "OK"
@@ -357,7 +357,7 @@ else
 	if [ $? = 0 ] ; then
 		echo "#define CONFOPT_GTK 2" >> config.h
 		echo "$TMP_CFLAGS " >> config.cflags
-		echo "$TMP_LDFLAGS " >> config.ldflags
+		echo "$TMP_LDFLAGS " >> config.libs
 		echo "OK (2.0)"
 		DRIVERS="gtk $DRIVERS"
 		DRV_OBJS="mpv_gtk.o $DRV_OBJS"
diff --git a/makefile.in b/makefile.in
index 704eb57..5714f62 100644
--- a/makefile.in
+++ b/makefile.in
@@ -36,7 +36,7 @@ dep:
 	gcc -MM *.c `cat config.cflags` > makefile.depend
 
 $(APPNAME): $(OBJS) $(MPDM)/libmpdm.a $(MPSL)/libmpsl.a
-	$(CCLINK) $(CFLAGS) $(OBJS) `cat config.ldflags` -o $@
+	$(CCLINK) $(CFLAGS) $(OBJS) `cat config.ldflags` `cat config.libs` -o $@
 
 mpv_kde4.o: mpv_kde4.cpp mpv_kde4.moc
 	$(CPP) $(CFLAGS) -I. `cat config.cflags` -c $<
@@ -54,7 +54,7 @@ mp_res.o: mp_res.rc
 	$(WINDRES) mp_res.rc mp_res.o
 
 mp-5.exe: $(OBJS) mp_res.o $(MPDM)/libmpdm.a $(MPSL)/libmpsl.a
-	$(CC) $(CFLAGS) $(OBJS) mp_res.o `cat config.ldflags` -o $@
+	$(CC) $(CFLAGS) $(OBJS) mp_res.o `cat config.ldflags` `cat config.libs` -o $@
 
 clean:
 	rm -f $(APPNAME) $(LIB) $(OBJS) *.o *.moc tags *.tar.gz *.exe *.zip .installer.c *.1
@@ -62,7 +62,7 @@ clean:
 	(cd $(MPSL) ; make clean)
 
 distclean: clean
-	rm -f config.h config.cflags config.ldflags \
+	rm -f config.h config.cflags config.ldflags config.libs \
 		makefile.opts Makefile po/minimum-profit.pot
 
 docsclean:
diff --git a/mpdm/config.sh b/mpdm/config.sh
index 9e4f2f8..16033d3 100755
--- a/mpdm/config.sh
+++ b/mpdm/config.sh
@@ -70,7 +70,7 @@ echo "Configuring MPDM..."
 
 echo "/* automatically created by config.sh - do not modify */" > config.h
 echo "# automatically created by config.sh - do not modify" > makefile.opts
-> config.ldflags
+> config.libs
 > config.cflags
 > .config.log
 
@@ -169,7 +169,7 @@ if [ "$WITH_PCRE" = 1 ] ; then
 		echo "OK (using pcre library)"
 		echo "#define CONFOPT_PCRE 1" >> config.h
 		echo "$TMP_CFLAGS " >> config.cflags
-		echo "$TMP_LDFLAGS " >> config.ldflags
+		echo "$TMP_LDFLAGS " >> config.libs
 		REGEX_YET=1
 	fi
 fi
@@ -316,7 +316,7 @@ else
 		if [ $? = 0 ] ; then
 			echo "OK (libintl needed)"
 			echo "#define CONFOPT_GETTEXT 1" >> config.h
-			echo "$TMP_LDFLAGS" >> config.ldflags
+			echo "$TMP_LDFLAGS" >> config.libs
 		else
 			echo "No"
 		fi
@@ -349,7 +349,7 @@ else
 		if [ $? = 0 ] ; then
 			echo "OK (libiconv needed)"
 			echo "#define CONFOPT_ICONV 1" >> config.h
-			echo "$TMP_LDFLAGS" >> config.ldflags
+			echo "$TMP_LDFLAGS" >> config.libs
 		else
 			echo "No"
 		fi
diff --git a/mpdm/makefile.in b/mpdm/makefile.in
index 17ee1a0..10c102d 100644
--- a/mpdm/makefile.in
+++ b/mpdm/makefile.in
@@ -32,7 +32,7 @@ $(LIB): $(OBJS)
 	$(AR) rv $(LIB) $(OBJS)
 
 stress: stress.c $(LIB)
-	$(CC) $(CFLAGS) `cat config.ldflags` stress.c -L. -lmpdm -o $@
+	$(CC) $(CFLAGS) `cat config.ldflags` `cat config.libs` stress.c -L. -lmpdm -o $@
 
 .SUFFIXES: .txt .html
 
@@ -54,7 +54,7 @@ clean:
 	rm -f $(TARGET) $(LIB) $(OBJS) *.o tags *.tar.gz stress
 
 distclean: clean
-	rm -f config.h config.cflags config.ldflags makefile.opts .config.log Makefile
+	rm -f config.h config.cflags config.ldflags config.libs makefile.opts .config.log Makefile
 
 realclean: distclean docsclean
 
diff --git a/mpsl/config.sh b/mpsl/config.sh
index d325412..4f36b06 100755
--- a/mpsl/config.sh
+++ b/mpsl/config.sh
@@ -69,7 +69,7 @@ echo "Configuring MPSL..."
 
 echo "/* automatically created by config.sh - do not modify */" > config.h
 echo "# automatically created by config.sh - do not modify" > makefile.opts
-> config.ldflags
+> config.libs
 > config.cflags
 > .config.log
 
@@ -131,7 +131,7 @@ done
 
 if [ "$MPDM" != "NOTFOUND" ] ; then
 	echo "-I$MPDM" >> config.cflags
-	echo "-L$MPDM -lmpdm" >> config.ldflags
+	echo "-L$MPDM -lmpdm" >> config.libs
 	echo "OK ($MPDM)"
 else
 	echo "No"
@@ -143,7 +143,7 @@ if [ ! -f $MPDM/Makefile ] ; then
 	( echo ; cd $MPDM ; ./config.sh $CONF_ARGS ; echo )
 fi
 
-cat $MPDM/config.ldflags >> config.ldflags
+cat $MPDM/config.libs >> config.libs
 
 # if win32, the interpreter is called mpsl.exe
 grep CONFOPT_WIN32 ${MPDM}/config.h >/dev/null && TARGET=mpsl.exe
diff --git a/mpsl/makefile.in b/mpsl/makefile.in
index 14ed62d..253e278 100644
--- a/mpsl/makefile.in
+++ b/mpsl/makefile.in
@@ -49,11 +49,11 @@ $(LIB): $(OBJS)
 	$(AR) rv $(LIB) $(OBJS)
 
 $(TARGET): $(LIB) $(MPDM)/libmpdm.a
-	$(CC) $(CFLAGS) -L. -lmpsl `cat config.ldflags` -o $@
+	$(CC) $(CFLAGS) -L. -lmpsl `cat config.ldflags` `cat config.libs` -o $@
 
 stress: stress.c $(LIB) $(MPDM)/libmpdm.a
 	$(CC) $(CFLAGS) `cat config.cflags` stress.c \
-		-L. -lmpsl `cat config.ldflags` -o $@
+		-L. -lmpsl `cat config.ldflags` `cat config.libs` -o $@
 
 clean:
 	rm -f $(TARGET) $(LIB) $(OBJS) *.o tags *.tar.gz stress
@@ -62,7 +62,7 @@ realclean: clean
 	rm -f y.tab.c y.tab.h lex.yy.c
 
 distclean: clean y.tab.c y.tab.h lex.yy.c
-	rm -f config.h config.cflags config.ldflags makefile.opts .config.log Makefile
+	rm -f config.h config.cflags config.ldflags config.libs makefile.opts .config.log Makefile
 
 realclean: distclean docsclean