Skip to content

Commit

Permalink
rename USE_SYS_DYN_MEM to CAPSTONE_USE_SYS_DYN_MEM for consistency wi…
Browse files Browse the repository at this point in the history
…th other options
  • Loading branch information
aquynh committed Apr 29, 2014
1 parent 38863f2 commit e31327d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions COMPILE.TXT
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ Capstone requires no prerequisite packages, so it is easy to compile & install.
Capstone supports 4 options, as followings.

- CAPSTONE_ARCHS: specify list of architectures to compiled in.
- USE_SYS_DYN_MEM: change this if you have your own dynamic memory management.
- CAPSTONE_USE_SYS_DYN_MEM: change this if you have your own dynamic memory management.
- CAPSTONE_DIET: use this to make the output binaries more compact.
- CAPSTONE_X86_REDUCE: another option to make X86 binary smaller.

To avoid editing config.mk for these customization, can pass their values to
make.sh, as followings.

$ CAPSTONE_ARCHS="arm aarch64 x86" USE_SYS_DYN_MEM=no CAPSTONE_DIET=yes CAPSTONE_X86_REDUCE=yes ./make.sh
$ CAPSTONE_ARCHS="arm aarch64 x86" CAPSTONE_USE_SYS_DYN_MEM=no CAPSTONE_DIET=yes CAPSTONE_X86_REDUCE=yes ./make.sh

NOTE: on commandline, put these values in front of ./make.sh, not after it.

Expand Down
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ endif

CFLAGS += -fPIC -Wall -Iinclude

ifeq ($(USE_SYS_DYN_MEM),yes)
ifeq ($(CAPSTONE_USE_SYS_DYN_MEM),yes)
CFLAGS += -DUSE_SYS_DYN_MEM
endif

Expand Down Expand Up @@ -205,9 +205,9 @@ 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)
AR_EXT = a
# Homebrew wants to make sure its formula does not disable FORTIFY_SOURCE
# However, this is not really necessary because 'USE_SYS_DYN_MEM=yes' by default
# However, this is not really necessary because 'CAPSTONE_USE_SYS_DYN_MEM=yes' by default
ifneq ($(HOMEBREW_CAPSTONE),1)
ifneq ($(USE_SYS_DYN_MEM),yes)
ifneq ($(CAPSTONE_USE_SYS_DYN_MEM),yes)
# remove string check because OSX kernel complains about missing symbols
CFLAGS += -D_FORTIFY_SOURCE=0
endif
Expand Down
8 changes: 4 additions & 4 deletions config.mk
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ CAPSTONE_ARCHS ?= arm aarch64 mips powerpc sparc systemz x86


################################################################################
# Comment out the line below ('USE_SYS_DYN_MEM = yes'), or change it to
# 'USE_SYS_DYN_MEM = no' if do NOT use malloc/calloc/realloc/free/vsnprintf()
# provided by system for internal dynamic memory management.
# Comment out the line below ('CAPSTONE_USE_SYS_DYN_MEM = yes'), or change it to
# 'CAPSTONE_USE_SYS_DYN_MEM = no' if do NOT use malloc/calloc/realloc/free/
# vsnprintf() provided by system for internal dynamic memory management.
#
# NOTE: in that case, specify your own malloc/calloc/realloc/free/vsnprintf()
# functions in your program via API cs_option(), using CS_OPT_MEM option type.

USE_SYS_DYN_MEM ?= yes
CAPSTONE_USE_SYS_DYN_MEM ?= yes


################################################################################
Expand Down

0 comments on commit e31327d

Please sign in to comment.