Skip to content

Commit

Permalink
Fix LDFLAGS
Browse files Browse the repository at this point in the history
- Use user-supplied LDFLAGS
- Use LDFLAGS for linking proxychains4
  • Loading branch information
tyll committed Mar 15, 2015
1 parent ea51cda commit e79e05a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
7 changes: 4 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ GENH = src/version.h
CFLAGS += -Wall -O0 -g -std=c99 -D_GNU_SOURCE -pipe
NO_AS_NEEDED = -Wl,--no-as-needed
LIBDL = -ldl
LDFLAGS = -shared -fPIC $(NO_AS_NEEDED) $(LIBDL) -lpthread
LDFLAGS = -fPIC $(NO_AS_NEEDED)
INC =
PIC = -fPIC
AR = $(CROSS_COMPILE)ar
Expand All @@ -46,6 +46,7 @@ ALL_CONFIGS = src/proxychains.conf
-include config.mak

CFLAGS+=$(USER_CFLAGS) $(MAC_CFLAGS)
LDFLAGS+=$(USER_LDFLAGS)
CFLAGS_MAIN=-DLIB_DIR=\"$(libdir)\" -DSYSCONFDIR=\"$(sysconfdir)\" -DDLL_NAME=\"$(LDSO_PATHNAME)\"


Expand Down Expand Up @@ -81,10 +82,10 @@ src/version.o: src/version.h
$(CC) $(CPPFLAGS) $(CFLAGS) $(CFLAGS_MAIN) $(INC) $(PIC) -c -o $@ $<

$(LDSO_PATHNAME): $(LOBJS)
$(CC) $(LDFLAGS) $(LD_SET_SONAME)$(LDSO_PATHNAME) -o $@ $(LOBJS)
$(CC) -shared -lpthread $(LIBDL) $(LDFLAGS) $(LD_SET_SONAME)$(LDSO_PATHNAME) -o $@ $(LOBJS)

$(ALL_TOOLS): $(OBJS)
$(CC) src/main.o src/common.o -o $(PXCHAINS)
$(CC) $(LDFLAGS) src/main.o src/common.o -o $(PXCHAINS)


.PHONY: all clean install install-config install-libs install-tools
1 change: 1 addition & 0 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ fi
echo CC?=$CC>config.mak
[ -z "$CPPFLAGS" ] || echo CPPFLAGS?=$CPPFLAGS>>config.mak
[ -z "$CFLAGS" ] || echo USER_CFLAGS?=$CFLAGS>>config.mak
[ -z "$LDFLAGS" ] || echo USER_LDFLAGS?=$LDFLAGS>>config.mak
echo prefix=$prefix>>config.mak
echo exec_prefix=$exec_prefix>>config.mak
echo bindir=$bindir>>config.mak
Expand Down

0 comments on commit e79e05a

Please sign in to comment.