Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 19 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ RANLIB = $(CROSS)ranlib
STRIP = $(CROSS)strip
endif

ifeq ($(OS),OS/390)
RANLIB = touch
endif

ifneq (,$(findstring yes,$(CAPSTONE_DIET)))
CFLAGS ?= -Os
CFLAGS += -DCAPSTONE_DIET
Expand All @@ -45,7 +49,14 @@ ifneq (,$(findstring yes,$(CAPSTONE_X86_ATT_DISABLE)))
CFLAGS += -DCAPSTONE_X86_ATT_DISABLE
endif

ifeq ($(CC),xlc)
CFLAGS += -qcpluscmt -qkeyword=inline -qlanglvl=extc1x -Iinclude
ifneq ($(OS),OS/390)
CFLAGS += -fPIC
endif
else
CFLAGS += -fPIC -Wall -Wwrite-strings -Wmissing-prototypes -Iinclude
endif

ifeq ($(CAPSTONE_USE_SYS_DYN_MEM),yes)
CFLAGS += -DCAPSTONE_USE_SYS_DYN_MEM
Expand Down Expand Up @@ -335,7 +346,11 @@ endif
else
CFLAGS += $(foreach arch,$(LIBARCHS),-arch $(arch))
LDFLAGS += $(foreach arch,$(LIBARCHS),-arch $(arch))
ifeq ($(OS), AIX)
$(LIBNAME)_LDFLAGS += -qmkshrobj
else
$(LIBNAME)_LDFLAGS += -shared
endif
# Cygwin?
IS_CYGWIN := $(shell $(CC) -dumpmachine 2>/dev/null | grep -i cygwin | wc -l)
ifeq ($(IS_CYGWIN),1)
Expand Down Expand Up @@ -556,9 +571,12 @@ define install-library
endef
endif

ifeq ($(AR_FLAGS),)
AR_FLAGS := q
endif

define create-archive
$(AR) q $(ARCHIVE) $(LIBOBJ)
$(AR) $(AR_FLAGS) $(ARCHIVE) $(LIBOBJ)
$(RANLIB) $(ARCHIVE)
endef

Expand Down
4 changes: 2 additions & 2 deletions include/capstone/capstone.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,14 @@ extern "C" {
#endif
#else
#define CAPSTONE_API
#if defined(__GNUC__) && !defined(CAPSTONE_STATIC)
#if (defined(__GNUC__) || defined(__IBMC__)) && !defined(CAPSTONE_STATIC)
#define CAPSTONE_EXPORT __attribute__((visibility("default")))
#else // defined(CAPSTONE_STATIC)
#define CAPSTONE_EXPORT
#endif
#endif

#ifdef __GNUC__
#if (defined(__GNUC__) || defined(__IBMC__))
#define CAPSTONE_DEPRECATED __attribute__((deprecated))
#elif defined(_MSC_VER)
#define CAPSTONE_DEPRECATED __declspec(deprecated)
Expand Down
3 changes: 3 additions & 0 deletions make.sh
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,9 @@ case "$TARGET" in
${MAKE} "$@";;
"mac-universal" ) MACOS_UNIVERSAL=yes ${MAKE} "$@";;
"mac-universal-no" ) MACOS_UNIVERSAL=no ${MAKE} "$@";;
"xlc31" ) CC=xlc CFLAGS=-q31 LDFLAGS=-q31 ${MAKE} "$@";;
"xlc32" ) CC=xlc CFLAGS=-q32 LDFLAGS=-q32 ${MAKE} "$@";;
"xlc64" ) CC=xlc CFLAGS=-q64 LDFLAGS=-q64 ${MAKE} "$@";;
* )
echo "Usage: $0 ["$(grep '^ "' $0 | cut -d '"' -f 2 | tr "\\n" "|")"]"
exit 1;;
Expand Down