summaryrefslogtreecommitdiff
blob: 4eac9aa3a2a0437bc4151e425a8392be72370d87 (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
https://bugs.gentoo.org/show_bug.cgi?id=352265

Make sure LDFLAGS comes first, such that all libraries are considered,
and not discarded when --as-needed is in effect.

https://bugs.gentoo.org/show_bug.cgi?id=391279

Use LDFLAGS for all targets, not just the exim binary, such that
--as-needed works as well.


--- OS/Makefile-Base
+++ OS/Makefile-Base
@@ -327,12 +327,12 @@
 	$(FE)$(CC) -c $(CFLAGS) $(INCLUDE) $(IPV6_INCLUDE) $(TLS_INCLUDE) version.c
 	rm -f exim
 	@echo "$(LNCC) -o exim"
-	$(FE)$(PURIFY) $(LNCC) -o exim $(LFLAGS) $(OBJ_EXIM) version.o \
+	$(FE)$(PURIFY) $(LNCC) -o exim $(LDFLAGS) $(OBJ_EXIM) version.o \
 	  routers/routers.a transports/transports.a lookups/lookups.a \
 	  auths/auths.a pdkim/pdkim.a \
 	  $(LIBRESOLV) $(LIBS) $(LIBS_EXIM) $(IPV6_LIBS) $(EXTRALIBS) \
 	  $(EXTRALIBS_EXIM) $(DBMLIB) $(LOOKUP_LIBS) $(AUTH_LIBS) \
-	  $(PERL_LIBS) $(TLS_LIBS) $(PCRE_LIBS) $(LDFLAGS)
+	  $(PERL_LIBS) $(TLS_LIBS) $(PCRE_LIBS) $(LFLAGS)
 	@if [ x"$(STRIP_COMMAND)" != x"" ]; then \
 	  echo $(STRIP_COMMAND) exim; \
 	  $(STRIP_COMMAND) exim; \
@@ -340,8 +340,8 @@
 
 exim_dumpdb: $(OBJ_DUMPDB)
 	@echo "$(LNCC) -o exim_dumpdb"
-	$(FE)$(LNCC) $(CFLAGS) $(INCLUDE) -o exim_dumpdb $(LFLAGS) $(OBJ_DUMPDB) \
-	  $(LIBS) $(EXTRALIBS) $(DBMLIB)
+	$(FE)$(LNCC) $(CFLAGS) $(INCLUDE) -o exim_dumpdb $(LDFLAGS) $(OBJ_DUMPDB) \
+	  $(LIBS) $(EXTRALIBS) $(DBMLIB) $(LFLAGS)
 	@if [ x"$(STRIP_COMMAND)" != x"" ]; then \
 	  echo $(STRIP_COMMAND) exim_dumpdb; \
 	  $(STRIP_COMMAND) exim_dumpdb; \
@@ -355,8 +355,8 @@
 
 exim_fixdb:  $(OBJ_FIXDB) auths/auths.a
 	@echo "$(LNCC) -o exim_fixdb"
-	$(FE)$(LNCC) $(CFLAGS) $(INCLUDE) -o exim_fixdb $(LFLAGS) $(OBJ_FIXDB) \
-	  auths/auths.a $(LIBS) $(EXTRALIBS) $(DBMLIB)
+	$(FE)$(LNCC) $(CFLAGS) $(INCLUDE) -o exim_fixdb $(LDFLAGS) $(OBJ_FIXDB) \
+	  auths/auths.a $(LIBS) $(EXTRALIBS) $(DBMLIB) $(LFLAGS)
 	@if [ x"$(STRIP_COMMAND)" != x"" ]; then \
 	  echo $(STRIP_COMMAND) exim_fixdb; \
 	  $(STRIP_COMMAND) exim_fixdb; \
@@ -370,8 +370,8 @@
 
 exim_tidydb: $(OBJ_TIDYDB)
 	@echo "$(LNCC) -o exim_tidydb"
-	$(FE)$(LNCC) $(CFLAGS) $(INCLUDE) -o exim_tidydb $(LFLAGS) $(OBJ_TIDYDB) \
-	  $(LIBS) $(EXTRALIBS) $(DBMLIB)
+	$(FE)$(LNCC) $(CFLAGS) $(INCLUDE) -o exim_tidydb $(LDFLAGS) $(OBJ_TIDYDB) \
+	  $(LIBS) $(EXTRALIBS) $(DBMLIB) $(LFLAGS)
 	@if [ x"$(STRIP_COMMAND)" != x"" ]; then \
 	  echo $(STRIP_COMMAND) exim_tidydb; \
 	  $(STRIP_COMMAND) exim_tidydb; \
@@ -383,8 +383,8 @@
 
 exim_dbmbuild: exim_dbmbuild.o
 	@echo "$(LNCC) -o exim_dbmbuild"
-	$(FE)$(LNCC) -o exim_dbmbuild $(LFLAGS) exim_dbmbuild.o \
-	  $(LIBS) $(EXTRALIBS) $(DBMLIB)
+	$(FE)$(LNCC) -o exim_dbmbuild $(LDFLAGS) exim_dbmbuild.o \
+	  $(LIBS) $(EXTRALIBS) $(DBMLIB) $(LFLAGS)
 	@if [ x"$(STRIP_COMMAND)" != x"" ]; then \
 	  echo $(STRIP_COMMAND) exim_dbmbuild; \
 	  $(STRIP_COMMAND) exim_dbmbuild; \
@@ -398,8 +398,8 @@
 	@echo "$(CC) exim_lock.c"
 	$(FE)$(CC) -c $(CFLAGS) $(INCLUDE) exim_lock.c
 	@echo "$(LNCC) -o exim_lock"
-	$(FE)$(LNCC) -o exim_lock $(LFLAGS) exim_lock.o  \
-	  $(LIBS) $(EXTRALIBS)
+	$(FE)$(LNCC) -o exim_lock $(LDFLAGS) exim_lock.o  \
+	  $(LIBS) $(EXTRALIBS) $(LFLAGS)
 	@if [ x"$(STRIP_COMMAND)" != x"" ]; then \
 	  echo $(STRIP_COMMAND) exim_lock; \
 	  $(STRIP_COMMAND) exim_lock; \
@@ -429,9 +429,9 @@
 	$(FE)$(CC) -o em_version.o -c \
 	  $(CFLAGS) $(XINCLUDE) -I. ../exim_monitor/em_version.c
 	@echo "$(LNCC) -o eximon.bin"
-	$(FE)$(PURIFY) $(LNCC) -o eximon.bin em_version.o $(LFLAGS) $(XLFLAGS) \
+	$(FE)$(PURIFY) $(LNCC) -o eximon.bin em_version.o $(LDFLAGS) $(XLFLAGS) \
 	$(OBJ_MONBIN) -lXaw -lXmu -lXt -lXext -lX11 $(PCRE_LIBS) \
-	  $(LIBS) $(LIBS_EXIMON) $(EXTRALIBS) $(EXTRALIBS_EXIMON) -lc
+	  $(LIBS) $(LIBS_EXIMON) $(EXTRALIBS) $(EXTRALIBS_EXIMON) -lc $(LFLAGS)
 	@if [ x"$(STRIP_COMMAND)" != x"" ]; then \
 	  echo $(STRIP_COMMAND) eximon.bin; \
 	  $(STRIP_COMMAND) eximon.bin; \
@@ -706,9 +706,9 @@
 test_dbfn:   config.h dbfn.c dummies.o sa-globals.o sa-os.o store.o \
 	       string.o tod.o version.o
 	$(CC) -c $(CFLAGS) $(INCLUDE) -DSTAND_ALONE dbfn.c
-	$(LNCC) -o test_dbfn $(LFLAGS) dbfn.o \
+	$(LNCC) -o test_dbfn $(LDFLAGS) dbfn.o \
 	  dummies.o sa-globals.o sa-os.o store.o string.o \
-	  tod.o version.o $(LIBS) $(DBMLIB)
+	  tod.o version.o $(LIBS) $(DBMLIB) $(LFLAGS)
 	rm -f dbfn.o
 
 test_host:   config.h child.c host.c dns.c dummies.c sa-globals.o os.o \
@@ -717,28 +717,28 @@
 	$(CC) -c $(CFLAGS) $(INCLUDE) -DSTAND_ALONE -DTEST_HOST host.c
 	$(CC) -c $(CFLAGS) $(INCLUDE) -DSTAND_ALONE -DTEST_HOST dns.c
 	$(CC) -c $(CFLAGS) $(INCLUDE) -DSTAND_ALONE -DTEST_HOST dummies.c
-	$(LNCC) -o test_host $(LFLAGS) \
+	$(LNCC) -o test_host $(LDFLAGS) \
 	  host.o child.o dns.o dummies.o sa-globals.o os.o store.o string.o \
-	  tod.o tree.o $(LIBS) $(LIBRESOLV)
+	  tod.o tree.o $(LIBS) $(LIBRESOLV) $(LFLAGS)
 	rm -f child.o dummies.o host.o dns.o
 
 test_os:     os.h os.c dummies.o sa-globals.o store.o string.o tod.o
 	$(CC) -c $(CFLAGS) $(INCLUDE) -DSTAND_ALONE os.c
-	$(LNCC) -o test_os $(LFLAGS) os.o dummies.o \
-	  sa-globals.o store.o string.o tod.o $(LIBS)
+	$(LNCC) -o test_os $(LDFLAGS) os.o dummies.o \
+	  sa-globals.o store.o string.o tod.o $(LIBS) $(LFLAGS)
 	rm -f os.o
 
 test_parse:  config.h parse.c dummies.o sa-globals.o \
 	     store.o string.o tod.o version.o
 	$(CC) -c $(CFLAGS) $(INCLUDE) -DSTAND_ALONE parse.c
-	$(LNCC) -o test_parse $(LFLAGS) parse.o \
-	  dummies.o sa-globals.o store.o string.o tod.o version.o
+	$(LNCC) -o test_parse $(LDFLAGS) parse.o \
+	  dummies.o sa-globals.o store.o string.o tod.o version.o $(LFLAGS)
 	rm -f parse.o
 
 test_string: config.h string.c dummies.o sa-globals.o store.o tod.o
 	$(CC) -c $(CFLAGS) $(INCLUDE) -DSTAND_ALONE string.c
-	$(LNCC) -o test_string $(LFLAGS) -DSTAND_ALONE string.o \
-	  dummies.o sa-globals.o store.o tod.o $(LIBS)
+	$(LNCC) -o test_string $(LDFLAGS) -DSTAND_ALONE string.o \
+	  dummies.o sa-globals.o store.o tod.o $(LIBS) $(LFLAGS)
 	rm -f string.o
 
 # End