summaryrefslogtreecommitdiff
blob: 4ddc3461ea112e5df536a2e101582c3d70089e87 (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
Respect LDFLAGS

http://bugs.gentoo.org/show_bug.cgi?id=331129

--- js/src/Makefile.ref
+++ js/src/Makefile.ref
@@ -87,7 +87,7 @@
 LDFLAGS                = $(XLDFLAGS)
 
 ifndef NO_LIBM
-LDFLAGS += -lm
+OTHER_LIBS += -lm
 endif
 
 # Prevent floating point errors caused by VC++ optimizations
@@ -325,7 +325,7 @@
 	$(CC) -o $@ -c $(CFLAGS) $<
 
 $(OBJDIR)/jskwgen$(HOST_BIN_SUFFIX): $(OBJDIR)/jskwgen.$(OBJ_SUFFIX)
-	$(CC) -o $@ $(CFLAGS) $(LDFLAGS) $^
+	$(CC) $(HOST_LDFLAGS) -o $@ $(CFLAGS) $(OTHER_LIBS) $^
 
 endif
 
@@ -338,7 +338,7 @@
 	link.exe -out:"$@" $(EXE_LINK_FLAGS) $^
 else
 $(PROGRAM): $(PROG_OBJS) $(LIBRARY)
-	$(CC) -o $@ $(CFLAGS) $(PROG_OBJS) $(LIBRARY) $(LDFLAGS) $(OTHER_LIBS) \
+	$(CC) $(HOST_LDFLAGS) -o $@ $(CFLAGS) $(PROG_OBJS) $(LIBRARY) $(OTHER_LIBS) \
 	    $(PROG_LIBS)
 endif
 
@@ -355,7 +355,7 @@
 	$(OBJDIR)/jscpucfg > $@
 
 $(OBJDIR)/jscpucfg: $(OBJDIR)/jscpucfg.o
-	$(CC) -o $@ $(OBJDIR)/jscpucfg.o
+	$(CC) $(HOST_LDFLAGS) -o $@ $(OBJDIR)/jscpucfg.o
 
 # Add to TARGETS for clobber rule
 TARGETS += $(OBJDIR)/jsautocfg.h $(OBJDIR)/jscpucfg \