aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2014-07-20 01:55:24 +0200
committerJelmer Vernooij <jelmer@samba.org>2014-07-20 01:55:24 +0200
commitd203495723441ec129fde8ba792776b8f5691706 (patch)
tree4e2a29c2258eedc4676f9ad03e69c6339b471550
parent5f818ae134304381bc39d67ac1f251b01c4be471 (diff)
Allow LDFLAGS to be provided in the environment and consistently use $(LDFLAGS)
when linking (not partially linking).
-rw-r--r--Makefile6
-rwxr-xr-xconfigure2
-rwxr-xr-xdebian/rules2
3 files changed, 6 insertions, 4 deletions
diff --git a/Makefile b/Makefile
index 750f97f2..96c5a4c2 100644
--- a/Makefile
+++ b/Makefile
@@ -15,7 +15,7 @@ subdirs = lib protocols
ifeq ($(TARGET),i586-mingw32msvc)
objects += win32.o
-LFLAGS+=-lws2_32
+LDFLAGS+=-lws2_32
EFLAGS+=-lsecur32
OUTFILE=bitlbee.exe
else
@@ -173,7 +173,7 @@ $(OTR_PI): %.so: $(_SRCDIR_)%.c
$(SKYPE_PI): $(_SRCDIR_)protocols/skype/skype.c
@echo '*' Building plugin skype
- @$(CC) $(CFLAGS) $(SKYPEFLAGS) $< -o $@
+ @$(CC) $(CFLAGS) $(LDFLAGS) $(SKYPEFLAGS) $< -o $@
$(objects): %.o: $(_SRCDIR_)%.c
@echo '*' Compiling $<
@@ -183,7 +183,7 @@ $(objects): Makefile Makefile.settings config.h
$(OUTFILE): $(objects) $(subdirs)
@echo '*' Linking $(OUTFILE)
- @$(CC) $(objects) $(subdirobjs) -o $(OUTFILE) $(LDFLAGS_BITLBEE) $(LFLAGS) $(EFLAGS)
+ @$(CC) $(objects) $(subdirobjs) -o $(OUTFILE) $(LDFLAGS_BITLBEE) $(LDFLAGS) $(EFLAGS)
ifndef DEBUG
@echo '*' Stripping $(OUTFILE)
@-$(STRIP) $(OUTFILE)
diff --git a/configure b/configure
index 3ac1680d..fbb8a33e 100755
--- a/configure
+++ b/configure
@@ -212,6 +212,8 @@ if [ "$pie" = "1" ]; then
echo 'LDFLAGS_BITLBEE=-pie' >> Makefile.settings
fi
+echo LDFLAGS=$LDFLAGS >> Makefile.settings
+
echo CFLAGS=$CFLAGS $CPPFLAGS >> Makefile.settings
echo CFLAGS+=-I${srcdir} -I${srcdir}/lib -I${srcdir}/protocols -I. >> Makefile.settings
diff --git a/debian/rules b/debian/rules
index e1068919..a4c8c1f3 100755
--- a/debian/rules
+++ b/debian/rules
@@ -43,7 +43,7 @@ build-stamp:
ifeq ($(BITLBEE_LIBPURPLE),1)
mkdir -p debian/build-libpurple
- ROOT=$$PWD; cd debian/build-libpurple; $(BITLBEE_CONFIGURE_VERSION) $$ROOT/configure --debug=$(DEBUG) --prefix=/usr --etcdir=/etc/bitlbee --purple=1 $(BITLBEE_CONFIGURE_FLAGS)
+ ROOT=$$PWD; cd debian/build-libpurple; $(BITLBEE_CONFIGURE_VERSION) $(shell dpkg-buildflags --export=configure) $$ROOT/configure --debug=$(DEBUG) --prefix=/usr --etcdir=/etc/bitlbee --purple=1 $(BITLBEE_CONFIGURE_FLAGS)
$(MAKE) -C debian/build-libpurple
endif