makefile: Add support for HomeBrew supplied packages on OS X

Addresses issues discussed in #493 and #489
This commit is contained in:
Mark Pizzolato 2017-12-02 15:22:44 -08:00
parent 395420b8b8
commit b167d889a7
2 changed files with 47 additions and 17 deletions

View file

@ -422,6 +422,15 @@ The MacPorts package manager is available to provide these external packages. O
# port install vde2
# port install libsdl2
# port install libsdl2_ttf
OR
The HomeBrew package manager can be used to provide these packages:
$ brew install vde
$ brew install sdl2
$ brew install sdl2_ttf
###### Linux - Dependencies
@ -432,6 +441,7 @@ Ubuntu:
# apt-get install libpcap-dev
# apt-get install vde2
# apt-get install libsdl2
# apt-get install libsdl2_ttf
#### Windows

View file

@ -262,6 +262,10 @@ ifeq ($(WIN32),) #*nix Environments (&& cygwin)
LIBPATH += /opt/local/lib
OS_LDFLAGS += -L/opt/local/lib
endif
ifeq (HomeBrew,$(shell if $(TEST) -d /usr/local/Cellar; then echo HomeBrew; fi))
INCPATH += $(foreach dir,$(wildcard /usr/local/Cellar/*/*),$(dir)/include)
LIBPATH += $(foreach dir,$(wildcard /usr/local/Cellar/*/*),$(dir)/lib)
endif
ifeq (libXt,$(shell if $(TEST) -d /usr/X11/lib; then echo libXt; fi))
LIBPATH += /usr/X11/lib
OS_LDFLAGS += -L/usr/X11/lib
@ -506,14 +510,14 @@ ifeq ($(WIN32),) #*nix Environments (&& cygwin)
ifneq (,$(call find_lib,SDL2))
ifneq (,$(findstring Haiku,$(OSTYPE)))
ifneq (,$(shell which sdl2-config))
SDL2_CONFIG = sdl2-config
SDLX_CONFIG = sdl2-config
endif
else
SDL2_CONFIG = $(realpath $(dir $(call find_include,SDL2/SDL))../../bin/sdl2-config)
SDLX_CONFIG = $(realpath $(dir $(call find_include,SDL2/SDL))../../bin/sdl2-config)
endif
ifneq (,$(SDL2_CONFIG))
VIDEO_CCDEFS += -DHAVE_LIBSDL -DUSE_SIM_VIDEO `$(SDL2_CONFIG) --cflags`
VIDEO_LDFLAGS += `$(SDL2_CONFIG) --libs`
ifneq (,$(SDLX_CONFIG))
VIDEO_CCDEFS += -DHAVE_LIBSDL -DUSE_SIM_VIDEO `$(SDLX_CONFIG) --cflags`
VIDEO_LDFLAGS += `$(SDLX_CONFIG) --libs`
VIDEO_FEATURES = - video capabilities provided by libSDL2 (Simple Directmedia Layer)
DISPLAYL = ${DISPLAYD}/display.c $(DISPLAYD)/sim_ws.c
DISPLAYVT = ${DISPLAYD}/vt11.c
@ -529,14 +533,14 @@ ifeq ($(WIN32),) #*nix Environments (&& cygwin)
ifneq (,$(call find_lib,SDL))
ifneq (,$(findstring Haiku,$(OSTYPE)))
ifneq (,$(shell which sdl-config))
SDL_CONFIG = sdl-config
SDLX_CONFIG = sdl-config
endif
else
SDL_CONFIG = $(realpath $(dir $(call find_include,SDL/SDL))../../bin/sdl-config)
SDLX_CONFIG = $(realpath $(dir $(call find_include,SDL/SDL))../../bin/sdl-config)
endif
ifneq (,$(SDL_CONFIG))
VIDEO_CCDEFS += -DHAVE_LIBSDL -DUSE_SIM_VIDEO `$(SDL_CONFIG) --cflags`
VIDEO_LDFLAGS += `$(SDL_CONFIG) --libs`
ifneq (,$(SDLX_CONFIG))
VIDEO_CCDEFS += -DHAVE_LIBSDL -DUSE_SIM_VIDEO `$(SDLX_CONFIG) --cflags`
VIDEO_LDFLAGS += `$(SDLX_CONFIG) --libs`
VIDEO_FEATURES = - video capabilities provided by libSDL (Simple Directmedia Layer)
DISPLAYL = ${DISPLAYD}/display.c $(DISPLAYD)/sim_ws.c
DISPLAYVT = ${DISPLAYD}/vt11.c
@ -557,9 +561,17 @@ ifeq ($(WIN32),) #*nix Environments (&& cygwin)
$(info *** Info *** The simulator$(BUILD_MULTIPLE) you are building could provide more)
$(info *** Info *** functionality if video support were available on your system.)
ifeq (Darwin,$(OSTYPE))
$(info *** Info *** Install the MacPorts libSDL2 packaged to provide this)
$(info *** Info *** Install the MacPorts libSDL2 package to provide this)
$(info *** Info *** functionality for your OS X system:)
$(info *** Info *** # port install libsdl2)
ifeq (/usr/local/bin/brew,$(shell which brew))
$(info *** Info ***)
$(info *** Info *** OR)
$(info *** Info ***)
$(info *** Info *** Install the HomeBrew libSDL2 package to provide this)
$(info *** Info *** functionality for your OS X system:)
$(info *** Info *** $$ brew install sdl2)
endif
else
ifneq (,$(and $(findstring Linux,$(OSTYPE)),$(call find_exe,apt-get)))
$(info *** Info *** Install the development components of libSDL or libSDL2)
@ -728,7 +740,7 @@ ifeq ($(WIN32),) #*nix Environments (&& cygwin)
endif
ifeq (,$(findstring HAVE_VDE_NETWORK,$(NETWORK_CCDEFS)))
# Support is available on Linux for libvdeplug. Advise on its usage
ifneq (,$(findstring Linux,$(OSTYPE)))
ifneq (,$(findstring Linux,$(OSTYPE))$(findstring Darwin,$(OSTYPE)))
ifneq (,$(findstring USE_NETWORK,$(NETWORK_CCDEFS))$(findstring USE_SHARED,$(NETWORK_CCDEFS)))
$(info *** Info ***)
$(info *** Info *** $(BUILD_SINGLE)Simulator$(BUILD_MULTIPLE) are being built with)
@ -744,6 +756,14 @@ ifeq ($(WIN32),) #*nix Environments (&& cygwin)
$(info *** Info *** should install the MacPorts vde2 package to provide this)
$(info *** Info *** functionality for your OS X system:)
$(info *** Info *** # port install vde2)
ifeq (/usr/local/bin/brew,$(shell which brew))
$(info *** Info ***)
$(info *** Info *** OR)
$(info *** Info ***)
$(info *** Info *** Install the HomeBrew vde package to provide this)
$(info *** Info *** functionality for your OS X system:)
$(info *** Info *** $$ brew install vde)
endif
else
ifneq (,$(and $(findstring Linux,$(OSTYPE)),$(call find_exe,apt-get)))
$(info *** Info *** should install the vde2 package to provide this)
@ -1497,7 +1517,7 @@ BESM6 = ${BESM6D}/besm6_cpu.c ${BESM6D}/besm6_sys.c ${BESM6D}/besm6_mmu.c \
${BESM6D}/besm6_tty.c ${BESM6D}/besm6_panel.c ${BESM6D}/besm6_printer.c \
${BESM6D}/besm6_punch.c ${BESM6D}/besm6_punchcard.c
ifneq (,$(BESM6_BUILD))
ifneq (,$(and $(BESM6_BUILD),${SDLX_CONFIG}))
ifneq (,$(and ${VIDEO_LDFLAGS}, $(or $(and $(call find_include,SDL2/SDL_ttf),$(call find_lib,SDL2_ttf)), $(and $(call find_include,SDL/SDL_ttf),$(call find_lib,SDL_ttf)))))
FONTPATH += /usr/share/fonts /Library/Fonts /usr/lib/jvm /System/Library/Frameworks/JavaVM.framework/Versions C:/Windows/Fonts
FONTPATH := $(dir $(foreach dir,$(strip $(FONTPATH)),$(wildcard $(dir)/.)))
@ -1523,7 +1543,7 @@ ifneq (,$(BESM6_BUILD))
$(info *** No SDL ttf support available. BESM-6 video panel disabled.)
$(info ***)
BESM6_OPT = -I ${BESM6D} -DUSE_INT64
else ifneq (,$(and $(findstring SDL2,${VIDEO_LDFLAGS}),$(call find_include,SDL2/SDL_ttf),$(call find_lib,SDL2_ttf)))
else ifneq (,$(and $(findstring sdl2,${VIDEO_LDFLAGS}),$(call find_include,SDL2/SDL_ttf),$(call find_lib,SDL2_ttf)))
$(info using libSDL2_ttf: $(call find_lib,SDL2_ttf) $(call find_include,SDL2/SDL_ttf))
$(info ***)
BESM6_OPT = -I ${BESM6D} -DFONTFILE=${FONTFILE} -DUSE_INT64 ${VIDEO_CCDEFS} ${VIDEO_LDFLAGS} -lSDL2_ttf