Skip to content

Commit

Permalink
Avoid modifying the raw LDFLAGS directly
Browse files Browse the repository at this point in the history
  • Loading branch information
danghvu committed May 14, 2014
1 parent 0c478ab commit e1c7a21
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ IS_APPLE := $(shell $(CC) -dM -E - < /dev/null | grep __apple_build_version__ |
ifeq ($(IS_APPLE),1)
EXT = dylib
VERSION_EXT = $(API_MAJOR).$(EXT)
LDFLAGS += -dynamiclib -install_name lib$(LIBNAME).$(VERSION_EXT) -current_version $(PKG_MAJOR).$(PKG_MINOR).$(PKG_EXTRA) -compatibility_version $(PKG_MAJOR).$(PKG_MINOR)
$(LIBNAME)_LDFLAGS += -dynamiclib -install_name lib$(LIBNAME).$(VERSION_EXT) -current_version $(PKG_MAJOR).$(PKG_MINOR).$(PKG_EXTRA) -compatibility_version $(PKG_MAJOR).$(PKG_MINOR)
AR_EXT = a
# Homebrew wants to make sure its formula does not disable FORTIFY_SOURCE
# However, this is not really necessary because 'CAPSTONE_USE_SYS_DYN_MEM=yes' by default
Expand All @@ -226,7 +226,7 @@ CFLAGS += -D_FORTIFY_SOURCE=0
endif
endif
else
LDFLAGS += -shared
$(LIBNAME)_LDFLAGS += -shared
# Cygwin?
IS_CYGWIN := $(shell $(CC) -dumpmachine | grep -i cygwin | wc -l)
ifeq ($(IS_CYGWIN),1)
Expand All @@ -249,7 +249,7 @@ else
EXT = so
VERSION_EXT = $(EXT).$(API_MAJOR)
AR_EXT = a
LDFLAGS += -Wl,-soname,lib$(LIBNAME).$(VERSION_EXT)
$(LIBNAME)_LDFLAGS += -Wl,-soname,lib$(LIBNAME).$(VERSION_EXT)
endif
endif
endif
Expand Down Expand Up @@ -382,7 +382,7 @@ endef


define create-library
$(CC) $(LDFLAGS) $(LIBOBJ) -o $(LIBRARY)
$(CC) $(LDFLAGS) $($(LIBNAME)_LDFLAGS) $(LIBOBJ) -o $(LIBRARY)
endef


Expand Down

0 comments on commit e1c7a21

Please sign in to comment.