makefile_base.mak: Add libjpeg build steps for OS X

This commit is contained in:
John Schoenick 2018-08-29 18:00:02 -07:00
parent bbe3decd78
commit 6bff02aff6

View file

@ -267,6 +267,13 @@ LIBPNG_OBJ64 := ./obj-libpng64
LIBPNG_OUT64 := $(TOOLS_DIR64)/lib/libprotonpng16.dylib
LIBPNG_OUT32 := $(TOOLS_DIR32)/lib/libprotonpng16.dylib
LIBJPEG := $(SRCDIR)/libjpeg-turbo
LIBJPEGPROTON := ./syn-libjpeg
LIBJPEG_OBJ32 := ./obj-libjpeg32
LIBJPEG_OBJ64 := ./obj-libjpeg64
LIBJPEG_OUT64 := $(TOOLS_DIR64)/lib/libprotonjpeg.dylib
LIBJPEG_OUT32 := $(TOOLS_DIR32)/lib/libprotonjpeg.dylib
## Object directories
OBJ_DIRS := $(TOOLS_DIR32) $(TOOLS_DIR64) \
$(FREETYPE_OBJ32) $(FREETYPE_OBJ64) \
@ -277,7 +284,8 @@ OBJ_DIRS := $(TOOLS_DIR32) $(TOOLS_DIR64) \
$(VRCLIENT_OBJ32) $(VRCLIENT_OBJ64) \
$(DXVK_OBJ32) $(DXVK_OBJ64) \
$(CMAKE_OBJ32) $(CMAKE_OBJ64) \
$(LIBPNG_OBJ32) $(LIBPNG_OBJ64)
$(LIBPNG_OBJ32) $(LIBPNG_OBJ64) \
$(LIBJPEG_OBJ32) $(LIBJPEG_OBJ64)
$(OBJ_DIRS):
mkdir -p $@
@ -532,6 +540,77 @@ libpng32-intermediate: $(LIBPNG_CONFIGURE_FILES32)
endif # ifeq ($(OSX),1)
##
## libjpeg
##
ifeq ($(OSX),1) # currently only for OS X builds
## Synthetic libjpeg for autogen
$(LIBJPEGPROTON)/.created: $(LIBJPEG) $(MAKEFILE_DEP) $(LIBJPEG)/configure.ac
rm -rf ./$(LIBJPEGPROTON)
mkdir -p $(LIBJPEGPROTON)/
cd $(LIBJPEGPROTON)/ && \
ln -sfv ../$(LIBJPEG)/* .
rm -f $(LIBJPEGPROTON)/configure
cd $(LIBJPEGPROTON) && autoreconf -fiv
touch $(LIBJPEGPROTON)/.created
$(LIBJPEGPROTON): $(LIBJPEGPROTON)/.created
## Create & configure object directory for libjpeg
LIBJPEG_CONFIGURE_FILES32 := $(LIBJPEG_OBJ32)/Makefile
LIBJPEG_CONFIGURE_FILES64 := $(LIBJPEG_OBJ64)/Makefile
# 64-bit configure
$(LIBJPEG_CONFIGURE_FILES64): $(LIBJPEG_AUTOGEN_FILES) $(MAKEFILE_DEP) $(LIBJPEGPROTON) | $(LIBJPEG_OBJ64)
cd $(dir $@) && \
$(abspath $(LIBJPEGPROTON)/configure) --prefix=$(abspath $(TOOLS_DIR64)) --host x86_64-apple-darwin
# 32bit-configure
$(LIBJPEG_CONFIGURE_FILES32): $(LIBJPEG_AUTOGEN_FILES) $(MAKEFILE_DEP) $(LIBJPEGPROTON) | $(LIBJPEG_OBJ32)
cd $(dir $@) && \
$(abspath $(LIBJPEGPROTON)/configure) --prefix=$(abspath $(TOOLS_DIR32)) --host i686-apple-darwin \
CFLAGS='-O3 -g -m32' LDFLAGS=-m32
## Libjpeg goals
.PHONY: libjpeg libjpeg32 libjpeg64 libjpeg_configure libjpeg_configure32 libjpeg_configure64
GOAL_TARGETS += libjpeg
libjpeg_configure: $(LIBJPEG_CONFIGURE_FILES32) $(LIBJPEG_CONFIGURE_FILES64)
libjpeg_configure64: $(LIBJPEG_CONFIGURE_FILES64)
libjpeg_configure32: $(LIBJPEG_CONFIGURE_FILES32)
libjpeg: libjpeg32 libjpeg64
# Make silliness to make both the explicit libjpeg goal and the outfile come from the same recipe
.INTERMEDIATE: libjpeg64-intermediate libjpeg32-intermediate
$(LIBJPEG_OUT64) libjpeg64: libjpeg64-intermediate
$(LIBJPEG_OUT32) libjpeg32: libjpeg32-intermediate
libjpeg64-intermediate: $(LIBJPEG_CONFIGURE_FILES64)
$(MAKE) -C $(LIBJPEG_OBJ64)
$(MAKE) -C $(LIBJPEG_OBJ64) install
mv $(TOOLS_DIR64)/lib/lib{,proton}jpeg.dylib
cp $(LIBJPEG_OUT64) $(DST_DIR)/lib64
$(STRIP) $(DST_DIR)/lib64/libprotonjpeg.dylib
libjpeg32-intermediate: $(LIBJPEG_CONFIGURE_FILES32)
$(MAKE) -C $(LIBJPEG_OBJ32)
$(MAKE) -C $(LIBJPEG_OBJ32) install
mv $(TOOLS_DIR32)/lib/lib{,proton}jpeg.dylib
cp $(LIBJPEG_OUT32) $(DST_DIR)/lib
$(STRIP) $(DST_DIR)/lib/libprotonjpeg.dylib
endif # ifeq ($(OSX),1)
##
## OpenAL
##
@ -783,7 +862,7 @@ WINE_CONFIGURE_FILES64 := $(WINE_OBJ64)/Makefile
# 64bit-configure
$(WINE_CONFIGURE_FILES64): SHELL = $(CONTAINER_SHELL64)
$(WINE_CONFIGURE_FILES64): $(MAKEFILE_DEP) | $(WINE_OBJ64) $(FREETYPE_OUT64) $(LIBPNG_OUT64)
$(WINE_CONFIGURE_FILES64): $(MAKEFILE_DEP) | $(WINE_OBJ64) $(FREETYPE_OUT64) $(LIBPNG_OUT64) $(LIBJPEG_OUT64)
cd $(dir $@) && \
STRIP=$(STRIP) \
CFLAGS=-I$(abspath $(TOOLS_DIR64))"/include -g -O2" \
@ -806,7 +885,7 @@ $(WINE_CONFIGURE_FILES64): $(MAKEFILE_DEP) | $(WINE_OBJ64) $(FREETYPE_OUT64) $(L
# 32-bit configure
$(WINE_CONFIGURE_FILES32): SHELL = $(CONTAINER_SHELL32)
$(WINE_CONFIGURE_FILES32): $(MAKEFILE_DEP) | $(WINE_OBJ32) $(FREETYPE_OUT32) $(LIBPNG_OUT32)
$(WINE_CONFIGURE_FILES32): $(MAKEFILE_DEP) | $(WINE_OBJ32) $(FREETYPE_OUT32) $(LIBPNG_OUT32) $(LIBJPEG_OUT32)
cd $(dir $@) && \
STRIP=$(STRIP) \
CFLAGS=-I$(abspath $(TOOLS_DIR32))"/include -g -O2" \
@ -1097,7 +1176,6 @@ dxvk32: $(DXVK_CONFIGURE_FILES32)
endif # NO_DXVK
# TODO OS X
# build_libjpeg
# build_libSDL
# build_moltenvk