Hi! Here is a patch that enables hsdis compilation for Darwin.
-- Christian diff --git a/src/share/tools/hsdis/Makefile b/src/share/tools/hsdis/Makefile --- a/src/share/tools/hsdis/Makefile +++ b/src/share/tools/hsdis/Makefile @@ -22,7 +22,8 @@ # # -# Single gnu makefile for solaris, linux and windows (windows requires cygwin and mingw) +# Single GNU Makefile for Solaris, Linux, Darwin and Windows (Windows +# requires Cygwin and Mingw) # Default arch; it is changed below as needed. ARCH = i386 @@ -84,17 +85,40 @@ DLDFLAGS += -shared LDFLAGS += -ldl OUTFLAGS += -o $@ +else +## OS = Darwin ## +ifeq ($(OS),Darwin) +CPU = $(shell uname -m) +ARCH1=$(CPU:x86_64=amd64) +ARCH=$(ARCH1:i686=i386) +ifdef LP64 +ifeq ($(ARCH),i386) +ARCH = amd64 +endif +endif +CFLAGS/i386 += -m32 +CFLAGS/amd64 += -m64 +CFLAGS += $(CFLAGS/$(ARCH)) +CFLAGS += -fPIC +OS = bsd +LIB_EXT = .dylib +CC = gcc +CFLAGS += -O +DLDFLAGS += -dynamiclib -lz +LDFLAGS += -ldl +OUTFLAGS += -o $@ ## OS = Windows ## -else # !SunOS, !Linux => Windows +else # !SunOS, !Linux, !Darwin => Windows OS = windows CC = gcc #CPPFLAGS += /D"WIN32" /D"_WINDOWS" /D"DEBUG" /D"NDEBUG" CFLAGS += /nologo /MD /W3 /WX /O2 /Fo$(@:.dll=.obj) /Gi- -CFLAGS += LIBARCH=\"$(LIBARCH)\"" +CFLAGS += LIBARCH=\"$(LIBARCH)\" DLDFLAGS += /dll /subsystem:windows /incremental:no \ /export:decode_instruction OUTFLAGS += /link /out:$@ LIB_EXT = .dll +endif # Darwin endif # Linux endif # SunOS