mirror of https://github.com/sm64pc/sm64pc.git
Merge branch 'nightly' into BLJAnywhere
This commit is contained in:
commit
d13b5975ea
234
Makefile
234
Makefile
|
@ -10,6 +10,8 @@ default: all
|
|||
# These options can either be changed by modifying the makefile, or
|
||||
# by building with 'make SETTING=value'. 'make clean' may be required.
|
||||
|
||||
# Build debug version (default)
|
||||
DEBUG ?= 1
|
||||
# Version of the game to build
|
||||
VERSION ?= us
|
||||
# Graphics microcode used
|
||||
|
@ -44,15 +46,29 @@ EXT_OPTIONS_MENU ?= 1
|
|||
TEXTSAVES ?= 0
|
||||
# Load resources from external files
|
||||
EXTERNAL_DATA ?= 0
|
||||
# Enable Discord Rich Presence
|
||||
DISCORDRPC ?= 0
|
||||
|
||||
# Various workarounds for weird toolchains
|
||||
|
||||
NO_BZERO_BCOPY ?= 0
|
||||
NO_LDIV ?= 0
|
||||
|
||||
# Use OpenGL 1.3 renderer
|
||||
# Backend selection
|
||||
|
||||
LEGACY_GL ?= 0
|
||||
# Renderers: GL, GL_LEGACY, D3D11, D3D12
|
||||
RENDER_API ?= GL
|
||||
# Window managers: SDL2, DXGI (forced if D3D11 or D3D12 in RENDER_API)
|
||||
WINDOW_API ?= SDL2
|
||||
# Audio backends: SDL2
|
||||
AUDIO_API ?= SDL2
|
||||
# Controller backends (can have multiple, space separated): SDL2
|
||||
CONTROLLER_API ?= SDL2
|
||||
|
||||
# Misc settings for EXTERNAL_DATA
|
||||
|
||||
BASEDIR ?= res
|
||||
BASEPACK ?= base.zip
|
||||
|
||||
# Automatic settings for PC port(s)
|
||||
|
||||
|
@ -73,9 +89,9 @@ else
|
|||
endif
|
||||
|
||||
ifeq ($(TARGET_WEB),0)
|
||||
ifeq ($(HOST_OS),Windows)
|
||||
WINDOWS_BUILD := 1
|
||||
endif
|
||||
ifeq ($(HOST_OS),Windows)
|
||||
WINDOWS_BUILD := 1
|
||||
endif
|
||||
endif
|
||||
|
||||
# MXE overrides
|
||||
|
@ -94,8 +110,6 @@ endif
|
|||
|
||||
ifneq ($(TARGET_BITS),0)
|
||||
BITS := -m$(TARGET_BITS)
|
||||
else
|
||||
BITS :=
|
||||
endif
|
||||
|
||||
# Release (version) flag defs
|
||||
|
@ -197,7 +211,23 @@ VERSION_ASFLAGS := --defsym AVOID_UB=1
|
|||
COMPARE := 0
|
||||
|
||||
ifeq ($(TARGET_WEB),1)
|
||||
VERSION_CFLAGS := $(VERSION_CFLAGS) -DTARGET_WEB
|
||||
VERSION_CFLAGS := $(VERSION_CFLAGS) -DTARGET_WEB -DUSE_GLES
|
||||
endif
|
||||
|
||||
# Check backends
|
||||
|
||||
ifneq (,$(filter $(RENDER_API),D3D11 D3D12))
|
||||
ifneq ($(WINDOWS_BUILD),1)
|
||||
$(error DirectX is only supported on Windows)
|
||||
endif
|
||||
ifneq ($(WINDOW_API),DXGI)
|
||||
$(warning DirectX renderers require DXGI, forcing WINDOW_API value)
|
||||
WINDOW_API := DXGI
|
||||
endif
|
||||
else
|
||||
ifeq ($(WINDOW_API),DXGI)
|
||||
$(error DXGI can only be used with DirectX renderers)
|
||||
endif
|
||||
endif
|
||||
|
||||
################### Universal Dependencies ###################
|
||||
|
@ -266,9 +296,13 @@ LEVEL_DIRS := $(patsubst levels/%,%,$(dir $(wildcard levels/*/header.h)))
|
|||
# Directories containing source files
|
||||
|
||||
# Hi, I'm a PC
|
||||
SRC_DIRS := src src/engine src/game src/audio src/menu src/buffers actors levels bin data assets src/pc src/pc/gfx src/pc/audio src/pc/controller
|
||||
SRC_DIRS := src src/engine src/game src/audio src/menu src/buffers actors levels bin data assets src/pc src/pc/gfx src/pc/audio src/pc/controller src/pc/fs src/pc/fs/packtypes
|
||||
ASM_DIRS :=
|
||||
|
||||
ifeq ($(DISCORDRPC),1)
|
||||
SRC_DIRS += src/pc/discord
|
||||
endif
|
||||
|
||||
BIN_DIRS := bin bin/$(VERSION)
|
||||
|
||||
ULTRA_SRC_DIRS := lib/src lib/src/math
|
||||
|
@ -280,15 +314,11 @@ GODDARD_SRC_DIRS := src/goddard src/goddard/dynlists
|
|||
MIPSISET := -mips2
|
||||
MIPSBIT := -32
|
||||
|
||||
ifeq ($(VERSION),eu)
|
||||
OPT_FLAGS := -O2
|
||||
else
|
||||
ifeq ($(VERSION),sh)
|
||||
OPT_FLAGS := -O2
|
||||
ifeq ($(DEBUG),1)
|
||||
OPT_FLAGS := -g
|
||||
else
|
||||
OPT_FLAGS := -O2
|
||||
endif
|
||||
endif
|
||||
|
||||
# Set BITS (32/64) to compile for
|
||||
OPT_FLAGS += $(BITS)
|
||||
|
@ -297,10 +327,6 @@ ifeq ($(TARGET_WEB),1)
|
|||
OPT_FLAGS := -O2 -g4 --source-map-base http://localhost:8080/
|
||||
endif
|
||||
|
||||
# Use a default opt flag for gcc, then override if RPi
|
||||
|
||||
# OPT_FLAGS := -O2 # "Whole-compile optimization flag" Breaks sound on x86.
|
||||
|
||||
ifeq ($(TARGET_RPI),1)
|
||||
machine = $(shell sh -c 'uname -m 2>/dev/null || echo unknown')
|
||||
# Raspberry Pi B+, Zero, etc
|
||||
|
@ -346,10 +372,6 @@ GODDARD_C_FILES := $(foreach dir,$(GODDARD_SRC_DIRS),$(wildcard $(dir)/*.c))
|
|||
GENERATED_C_FILES := $(BUILD_DIR)/assets/mario_anim_data.c $(BUILD_DIR)/assets/demo_data.c \
|
||||
$(addprefix $(BUILD_DIR)/bin/,$(addsuffix _skybox.c,$(notdir $(basename $(wildcard textures/skyboxes/*.png)))))
|
||||
|
||||
ifeq ($(WINDOWS_BUILD),0)
|
||||
CXX_FILES :=
|
||||
endif
|
||||
|
||||
# We need to keep this for now
|
||||
# If we're not N64 use below
|
||||
|
||||
|
@ -448,6 +470,18 @@ ULTRA_O_FILES := $(foreach file,$(ULTRA_S_FILES),$(BUILD_DIR)/$(file:.s=.o)) \
|
|||
|
||||
GODDARD_O_FILES := $(foreach file,$(GODDARD_C_FILES),$(BUILD_DIR)/$(file:.c=.o))
|
||||
|
||||
RPC_LIBS :=
|
||||
ifeq ($(DISCORDRPC),1)
|
||||
ifeq ($(WINDOWS_BUILD),1)
|
||||
RPC_LIBS := lib/discord/libdiscord-rpc.dll
|
||||
else ifeq ($(OSX_BUILD),1)
|
||||
# needs testing
|
||||
RPC_LIBS := lib/discord/libdiscord-rpc.dylib
|
||||
else
|
||||
RPC_LIBS := lib/discord/libdiscord-rpc.so
|
||||
endif
|
||||
endif
|
||||
|
||||
# Automatic dependency files
|
||||
DEP_FILES := $(O_FILES:.o=.d) $(ULTRA_O_FILES:.o=.d) $(GODDARD_O_FILES:.o=.d) $(BUILD_DIR)/$(LD_SCRIPT).d
|
||||
|
||||
|
@ -471,11 +505,14 @@ ifneq ($(TARGET_WEB),1) # As in, not-web PC port
|
|||
CXX := $(CROSS)g++
|
||||
else
|
||||
CC := emcc
|
||||
CXX := emcc
|
||||
endif
|
||||
|
||||
LD := $(CC)
|
||||
|
||||
ifeq ($(WINDOWS_BUILD),1)
|
||||
ifeq ($(DISCORDRPC),1)
|
||||
LD := $(CXX)
|
||||
else ifeq ($(WINDOWS_BUILD),1)
|
||||
ifeq ($(CROSS),i686-w64-mingw32.static-) # fixes compilation in MXE on Linux and WSL
|
||||
LD := $(CC)
|
||||
else ifeq ($(CROSS),x86_64-w64-mingw32.static-)
|
||||
|
@ -502,18 +539,69 @@ endif
|
|||
PYTHON := python3
|
||||
SDLCONFIG := $(CROSS)sdl2-config
|
||||
|
||||
# configure backend flags
|
||||
|
||||
BACKEND_CFLAGS := -DRAPI_$(RENDER_API)=1 -DWAPI_$(WINDOW_API)=1 -DAAPI_$(AUDIO_API)=1
|
||||
# can have multiple controller APIs
|
||||
BACKEND_CFLAGS += $(foreach capi,$(CONTROLLER_API),-DCAPI_$(capi)=1)
|
||||
BACKEND_LDFLAGS :=
|
||||
SDL2_USED := 0
|
||||
|
||||
# for now, it's either SDL+GL or DXGI+DirectX, so choose based on WAPI
|
||||
ifeq ($(WINDOW_API),DXGI)
|
||||
DXBITS := `cat $(ENDIAN_BITWIDTH) | tr ' ' '\n' | tail -1`
|
||||
ifeq ($(RENDER_API),D3D11)
|
||||
BACKEND_LDFLAGS += -ld3d11
|
||||
else ifeq ($(RENDER_API),D3D12)
|
||||
BACKEND_LDFLAGS += -ld3d12
|
||||
BACKEND_CFLAGS += -Iinclude/dxsdk
|
||||
endif
|
||||
BACKEND_LDFLAGS += -ld3dcompiler -ldxgi -ldxguid
|
||||
BACKEND_LDFLAGS += -lsetupapi -ldinput8 -luser32 -lgdi32 -limm32 -lole32 -loleaut32 -lshell32 -lwinmm -lversion -luuid -static
|
||||
else ifeq ($(WINDOW_API),SDL2)
|
||||
ifeq ($(WINDOWS_BUILD),1)
|
||||
BACKEND_LDFLAGS += -lglew32 -lglu32 -lopengl32
|
||||
else ifeq ($(TARGET_RPI),1)
|
||||
BACKEND_LDFLAGS += -lGLESv2
|
||||
else ifeq ($(OSX_BUILD),1)
|
||||
BACKEND_LDFLAGS += -framework OpenGL `pkg-config --libs glew`
|
||||
else
|
||||
BACKEND_LDFLAGS += -lGL
|
||||
endif
|
||||
SDL_USED := 2
|
||||
endif
|
||||
|
||||
ifeq ($(AUDIO_API),SDL2)
|
||||
SDL_USED := 2
|
||||
endif
|
||||
|
||||
ifneq (,$(findstring SDL,$(CONTROLLER_API)))
|
||||
SDL_USED := 2
|
||||
endif
|
||||
|
||||
# SDL can be used by different systems, so we consolidate all of that shit into this
|
||||
ifeq ($(SDL_USED),2)
|
||||
BACKEND_CFLAGS += -DHAVE_SDL2=1 `$(SDLCONFIG) --cflags`
|
||||
ifeq ($(WINDOWS_BUILD),1)
|
||||
BACKEND_LDFLAGS += `$(SDLCONFIG) --static-libs` -lsetupapi -luser32 -limm32 -lole32 -loleaut32 -lshell32 -lwinmm -lversion
|
||||
else
|
||||
BACKEND_LDFLAGS += `$(SDLCONFIG) --libs`
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(WINDOWS_BUILD),1)
|
||||
CC_CHECK := $(CC) -fsyntax-only -fsigned-char $(INCLUDE_CFLAGS) -Wall -Wextra -Wno-format-security $(VERSION_CFLAGS) $(GRUCODE_CFLAGS) `$(SDLCONFIG) --cflags` -DUSE_SDL=2
|
||||
CFLAGS := $(OPT_FLAGS) $(INCLUDE_CFLAGS) $(VERSION_CFLAGS) $(GRUCODE_CFLAGS) -fno-strict-aliasing -fwrapv `$(SDLCONFIG) --cflags` -DUSE_SDL=2
|
||||
CC_CHECK := $(CC) -fsyntax-only -fsigned-char $(BACKEND_CFLAGS) $(INCLUDE_CFLAGS) -Wall -Wextra -Wno-format-security $(VERSION_CFLAGS) $(GRUCODE_CFLAGS)
|
||||
CFLAGS := $(OPT_FLAGS) $(INCLUDE_CFLAGS) $(BACKEND_CFLAGS) $(VERSION_CFLAGS) $(GRUCODE_CFLAGS) -fno-strict-aliasing -fwrapv
|
||||
|
||||
else ifeq ($(TARGET_WEB),1)
|
||||
CC_CHECK := $(CC) -fsyntax-only -fsigned-char $(INCLUDE_CFLAGS) -Wall -Wextra -Wno-format-security $(VERSION_CFLAGS) $(GRUCODE_CFLAGS) -s USE_SDL=2
|
||||
CFLAGS := $(OPT_FLAGS) $(INCLUDE_CFLAGS) $(VERSION_CFLAGS) $(GRUCODE_CFLAGS) -fno-strict-aliasing -fwrapv -s USE_SDL=2
|
||||
CC_CHECK := $(CC) -fsyntax-only -fsigned-char $(BACKEND_CFLAGS) $(INCLUDE_CFLAGS) -Wall -Wextra -Wno-format-security $(VERSION_CFLAGS) $(GRUCODE_CFLAGS) -s USE_SDL=2
|
||||
CFLAGS := $(OPT_FLAGS) $(INCLUDE_CFLAGS) $(BACKEND_CFLAGS) $(VERSION_CFLAGS) $(GRUCODE_CFLAGS) -fno-strict-aliasing -fwrapv -s USE_SDL=2
|
||||
|
||||
# Linux / Other builds below
|
||||
else
|
||||
CC_CHECK := $(CC) -fsyntax-only -fsigned-char $(INCLUDE_CFLAGS) -Wall -Wextra -Wno-format-security $(VERSION_CFLAGS) $(GRUCODE_CFLAGS) `$(SDLCONFIG) --cflags` -DUSE_SDL=2
|
||||
CFLAGS := $(OPT_FLAGS) $(INCLUDE_CFLAGS) $(VERSION_CFLAGS) $(GRUCODE_CFLAGS) -fno-strict-aliasing -fwrapv `$(SDLCONFIG) --cflags` -DUSE_SDL=2
|
||||
CC_CHECK := $(CC) -fsyntax-only -fsigned-char $(BACKEND_CFLAGS) $(INCLUDE_CFLAGS) -Wall -Wextra -Wno-format-security $(VERSION_CFLAGS) $(GRUCODE_CFLAGS)
|
||||
CFLAGS := $(OPT_FLAGS) $(INCLUDE_CFLAGS) $(BACKEND_CFLAGS) $(VERSION_CFLAGS) $(GRUCODE_CFLAGS) -fno-strict-aliasing -fwrapv
|
||||
|
||||
endif
|
||||
|
||||
# Check for enhancement options
|
||||
|
@ -536,6 +624,12 @@ ifeq ($(NODRAWINGDISTANCE),1)
|
|||
CFLAGS += -DNODRAWINGDISTANCE
|
||||
endif
|
||||
|
||||
# Check for Discord Rich Presence option
|
||||
ifeq ($(DISCORDRPC),1)
|
||||
CC_CHECK += -DDISCORDRPC
|
||||
CFLAGS += -DDISCORDRPC
|
||||
endif
|
||||
|
||||
# Check for texture fix option
|
||||
ifeq ($(TEXTURE_FIX),1)
|
||||
CC_CHECK += -DTEXTURE_FIX
|
||||
|
@ -568,33 +662,39 @@ endif
|
|||
|
||||
# Load external textures
|
||||
ifeq ($(EXTERNAL_DATA),1)
|
||||
CC_CHECK += -DEXTERNAL_DATA
|
||||
CFLAGS += -DEXTERNAL_DATA
|
||||
CC_CHECK += -DEXTERNAL_DATA -DFS_BASEDIR="\"$(BASEDIR)\""
|
||||
CFLAGS += -DEXTERNAL_DATA -DFS_BASEDIR="\"$(BASEDIR)\""
|
||||
# tell skyconv to write names instead of actual texture data and save the split tiles so we can use them later
|
||||
SKYCONV_ARGS := --store-names --write-tiles "$(BUILD_DIR)/textures/skybox_tiles"
|
||||
SKYTILE_DIR := $(BUILD_DIR)/textures/skybox_tiles
|
||||
SKYCONV_ARGS := --store-names --write-tiles "$(SKYTILE_DIR)"
|
||||
endif
|
||||
|
||||
ASFLAGS := -I include -I $(BUILD_DIR) $(VERSION_ASFLAGS)
|
||||
|
||||
ifeq ($(TARGET_WEB),1)
|
||||
LDFLAGS := -lm -lGL -lSDL2 -no-pie -s TOTAL_MEMORY=20MB -g4 --source-map-base http://localhost:8080/ -s "EXTRA_EXPORTED_RUNTIME_METHODS=['callMain']"
|
||||
|
||||
else ifeq ($(WINDOWS_BUILD),1)
|
||||
LDFLAGS := $(BITS) -march=$(TARGET_ARCH) -Llib -lpthread -lglew32 `$(SDLCONFIG) --static-libs` -lm -lglu32 -lsetupapi -ldinput8 -luser32 -lgdi32 -limm32 -lole32 -loleaut32 -lshell32 -lwinmm -lversion -luuid -lopengl32 -static
|
||||
LDFLAGS := $(BITS) -march=$(TARGET_ARCH) -Llib -lpthread $(BACKEND_LDFLAGS) -static
|
||||
ifeq ($(CROSS),)
|
||||
LDFLAGS += -no-pie
|
||||
endif
|
||||
ifeq ($(WINDOWS_CONSOLE),1)
|
||||
LDFLAGS += -mconsole
|
||||
endif
|
||||
|
||||
else ifeq ($(TARGET_RPI),1)
|
||||
# Linux / Other builds below
|
||||
LDFLAGS := $(OPT_FLAGS) -lm -lGLESv2 `$(SDLCONFIG) --libs` -no-pie
|
||||
LDFLAGS := $(OPT_FLAGS) -lm $(BACKEND_LDFLAGS) -no-pie
|
||||
|
||||
else ifeq ($(OSX_BUILD),1)
|
||||
LDFLAGS := -lm $(BACKEND_LDFLAGS) -no-pie -lpthread
|
||||
|
||||
else
|
||||
ifeq ($(OSX_BUILD),1)
|
||||
LDFLAGS := -lm -framework OpenGL `$(SDLCONFIG) --libs` -no-pie -lpthread `pkg-config --libs libusb-1.0 glfw3 glew`
|
||||
else
|
||||
LDFLAGS := $(BITS) -march=$(TARGET_ARCH) -lm -lGL `$(SDLCONFIG) --libs` -no-pie -lpthread
|
||||
endif
|
||||
LDFLAGS := $(BITS) -march=$(TARGET_ARCH) -lm $(BACKEND_LDFLAGS) -no-pie -lpthread
|
||||
ifeq ($(DISCORDRPC),1)
|
||||
LDFLAGS += -ldl -Wl,-rpath .
|
||||
endif
|
||||
|
||||
endif # End of LDFLAGS
|
||||
|
||||
# Prevent a crash with -sopt
|
||||
|
@ -629,8 +729,6 @@ ZEROTERM = $(PYTHON) $(TOOLS_DIR)/zeroterm.py
|
|||
|
||||
all: $(EXE)
|
||||
|
||||
ifeq ($(EXTERNAL_DATA),1)
|
||||
|
||||
# thank you apple very cool
|
||||
ifeq ($(HOST_OS),Darwin)
|
||||
CP := gcp
|
||||
|
@ -638,20 +736,33 @@ else
|
|||
CP := cp
|
||||
endif
|
||||
|
||||
# depend on resources as well
|
||||
all: res
|
||||
ifeq ($(EXTERNAL_DATA),1)
|
||||
|
||||
# prepares the resource folder for external data
|
||||
res: $(EXE)
|
||||
@mkdir -p $(BUILD_DIR)/res/sound
|
||||
@$(CP) -r -f textures/ $(BUILD_DIR)/res/
|
||||
@$(CP) -r -f $(BUILD_DIR)/textures/skybox_tiles/ $(BUILD_DIR)/res/textures/
|
||||
@$(CP) -f $(SOUND_BIN_DIR)/sound_data.ctl $(BUILD_DIR)/res/sound/
|
||||
@$(CP) -f $(SOUND_BIN_DIR)/sound_data.tbl $(BUILD_DIR)/res/sound/
|
||||
@$(CP) -f $(SOUND_BIN_DIR)/sequences.bin $(BUILD_DIR)/res/sound/
|
||||
@$(CP) -f $(SOUND_BIN_DIR)/bank_sets $(BUILD_DIR)/res/sound/
|
||||
@find actors -name \*.png -exec $(CP) --parents {} $(BUILD_DIR)/res/ \;
|
||||
@find levels -name \*.png -exec $(CP) --parents {} $(BUILD_DIR)/res/ \;
|
||||
BASEPACK_PATH := $(BUILD_DIR)/$(BASEDIR)/$(BASEPACK)
|
||||
BASEPACK_LST := $(BUILD_DIR)/basepack.lst
|
||||
|
||||
# depend on resources as well
|
||||
all: $(BASEPACK_PATH)
|
||||
|
||||
# phony target for building resources
|
||||
res: $(BASEPACK_PATH)
|
||||
|
||||
# prepares the basepack.lst
|
||||
$(BASEPACK_LST): $(EXE)
|
||||
@mkdir -p $(BUILD_DIR)/$(BASEDIR)
|
||||
@echo -n > $(BASEPACK_LST)
|
||||
@echo "$(BUILD_DIR)/sound/bank_sets sound/bank_sets" >> $(BASEPACK_LST)
|
||||
@echo "$(BUILD_DIR)/sound/sequences.bin sound/sequences.bin" >> $(BASEPACK_LST)
|
||||
@echo "$(BUILD_DIR)/sound/sound_data.ctl sound/sound_data.ctl" >> $(BASEPACK_LST)
|
||||
@echo "$(BUILD_DIR)/sound/sound_data.tbl sound/sound_data.tbl" >> $(BASEPACK_LST)
|
||||
@$(foreach f, $(wildcard $(SKYTILE_DIR)/*), echo $(f) gfx/$(f:$(BUILD_DIR)/%=%) >> $(BASEPACK_LST);)
|
||||
@find actors -name \*.png -exec echo "{} gfx/{}" >> $(BASEPACK_LST) \;
|
||||
@find levels -name \*.png -exec echo "{} gfx/{}" >> $(BASEPACK_LST) \;
|
||||
@find textures -name \*.png -exec echo "{} gfx/{}" >> $(BASEPACK_LST) \;
|
||||
|
||||
# prepares the resource ZIP with base data
|
||||
$(BASEPACK_PATH): $(BASEPACK_LST)
|
||||
@$(PYTHON) $(TOOLS_DIR)/mkzip.py $(BASEPACK_LST) $(BASEPACK_PATH)
|
||||
|
||||
endif
|
||||
|
||||
|
@ -671,6 +782,9 @@ test: $(ROM)
|
|||
load: $(ROM)
|
||||
$(LOADER) $(LOADER_FLAGS) $<
|
||||
|
||||
$(BUILD_DIR)/$(RPC_LIBS):
|
||||
@$(CP) -f $(RPC_LIBS) $(BUILD_DIR)
|
||||
|
||||
libultra: $(BUILD_DIR)/libultra.a
|
||||
|
||||
asm/boot.s: $(BUILD_DIR)/lib/bin/ipl3_font.bin
|
||||
|
@ -737,11 +851,17 @@ $(BUILD_DIR)/src/menu/star_select.o: $(BUILD_DIR)/include/text_strings.h $(BUILD
|
|||
$(BUILD_DIR)/src/game/ingame_menu.o: $(BUILD_DIR)/include/text_strings.h $(BUILD_DIR)/bin/eu/translation_en.o $(BUILD_DIR)/bin/eu/translation_de.o $(BUILD_DIR)/bin/eu/translation_fr.o
|
||||
$(BUILD_DIR)/src/game/options_menu.o: $(BUILD_DIR)/include/text_strings.h $(BUILD_DIR)/bin/eu/translation_en.o $(BUILD_DIR)/bin/eu/translation_de.o $(BUILD_DIR)/bin/eu/translation_fr.o
|
||||
O_FILES += $(BUILD_DIR)/bin/eu/translation_en.o $(BUILD_DIR)/bin/eu/translation_de.o $(BUILD_DIR)/bin/eu/translation_fr.o
|
||||
ifeq ($(DISCORDRPC),1)
|
||||
$(BUILD_DIR)/src/pc/discord/discordrpc.o: $(BUILD_DIR)/include/text_strings.h $(BUILD_DIR)/bin/eu/translation_en.o $(BUILD_DIR)/bin/eu/translation_de.o $(BUILD_DIR)/bin/eu/translation_fr.o
|
||||
endif
|
||||
else
|
||||
$(BUILD_DIR)/src/menu/file_select.o: $(BUILD_DIR)/include/text_strings.h
|
||||
$(BUILD_DIR)/src/menu/star_select.o: $(BUILD_DIR)/include/text_strings.h
|
||||
$(BUILD_DIR)/src/game/ingame_menu.o: $(BUILD_DIR)/include/text_strings.h
|
||||
$(BUILD_DIR)/src/game/options_menu.o: $(BUILD_DIR)/include/text_strings.h
|
||||
ifeq ($(DISCORDRPC),1)
|
||||
$(BUILD_DIR)/src/pc/discord/discordrpc.o: $(BUILD_DIR)/include/text_strings.h
|
||||
endif
|
||||
endif
|
||||
|
||||
################################################################
|
||||
|
@ -924,7 +1044,7 @@ $(BUILD_DIR)/%.o: %.s
|
|||
|
||||
|
||||
|
||||
$(EXE): $(O_FILES) $(MIO0_FILES:.mio0=.o) $(SOUND_OBJ_FILES) $(ULTRA_O_FILES) $(GODDARD_O_FILES)
|
||||
$(EXE): $(O_FILES) $(MIO0_FILES:.mio0=.o) $(SOUND_OBJ_FILES) $(ULTRA_O_FILES) $(GODDARD_O_FILES) $(BUILD_DIR)/$(RPC_LIBS)
|
||||
$(LD) -L $(BUILD_DIR) -o $@ $(O_FILES) $(SOUND_OBJ_FILES) $(ULTRA_O_FILES) $(GODDARD_O_FILES) $(LDFLAGS)
|
||||
|
||||
.PHONY: all clean distclean default diff test load libultra res
|
||||
|
|
|
@ -7,7 +7,7 @@ Run `./extract_assets.py --clean && make clean` or `make distclean` to remove RO
|
|||
|
||||
Please contribute **first** to the [nightly branch](https://github.com/sm64pc/sm64pc/tree/nightly/). New functionality will be merged to master once they're considered to be well-tested.
|
||||
|
||||
*Read this in other languages: [Español](README_es_ES.md) [简体中文](README_zh_CN.md).*
|
||||
*Read this in other languages: [Español](README_es_ES.md), [Português](README_pt_BR.md) or [简体中文](README_zh_CN.md).*
|
||||
|
||||
## Features
|
||||
|
||||
|
|
|
@ -0,0 +1,33 @@
|
|||
# sm64pc
|
||||
Adaptação em OpenGL de [n64decomp/sm64](https://github.com/n64decomp/sm64).
|
||||
|
||||
Sinta-se livre para reportar bugs [aqui](https://github.com/sm64pc/sm64pc/issues) e contribuir, mas tenha em mente que não
|
||||
aceitamos compartilhamento de conteúdo protegido com direitos autorais.
|
||||
|
||||
Se necessário, rode `./extract_assets.py --clean && make clean` ou `make distclean` para remover conteúdos advindos da ROM do jogo.
|
||||
Este port é possível graças à [Emill](https://github.com/Emill), [n64-fast32-engine](https://github.com/Emill/n64-fast3d-engine/), e, é claro, ao
|
||||
time do [n64decomp](https://github.com/n64decomp).
|
||||
|
||||
Em caso de contribuições, crie _pull requests_ apenas para a [branch nightly](https://github.com/sm64pc/sm64pc/tree/nightly/).
|
||||
Novas funcionalidades serão adicionadas à branch master quando forem consideradas bem testadas.
|
||||
|
||||
*Leia isso em outras linguas: [English](README.md) [简体中文](README_zh_CN.md).*
|
||||
|
||||
## Recursos
|
||||
|
||||
* Renderização nativa. Você agora pode jogar SM64 no PC sem precisar de emulador.
|
||||
* Proporção de tela e resolução variáveis. O jogo renderiza corretamente em basicamente qualquer tamanho de janela.
|
||||
* Suporte a entradas de controle através de `xinput`. Tal como usando DualShock 4 em distribuições Linux.
|
||||
* Controle de câmera com analógico ou mouse. (Ative com `make BETTERCAMERA=1`.)
|
||||
* Uma opção para desativar distância de renderização. (Ative com `make NODRAWINGDISTANCE=1`.)
|
||||
* Remapeamento de controles _in-game_.
|
||||
* Pule as cenas introdutórias da Peach e Lakitu com usando a opção `--skip-intro` ao executar o jogo na linha de comando.
|
||||
* Menu de cheats nas opções. (Ative com `--cheats`)
|
||||
** Note que se algum cheat pedir pelo botão "L", o botão em questão é o "L" do N64. Certifique-se de que este está mapeado, caso necessário.
|
||||
|
||||
## Compilação
|
||||
Para instruções de compilaçao, consulte a [wiki](https://github.com/sm64pc/sm64pc/wiki).
|
||||
|
||||
## Para usuários de Windows
|
||||
|
||||
**Certifique-se de que você tem o [MXE](mxe.cc) antes de tentar compilar em Windows. Siga o guia na Wiki.**
|
|
@ -357,7 +357,7 @@ static const Vtx chuckya_seg8_vertex_0800A680[] = {
|
|||
const Gfx chuckya_seg8_dl_0800A700[] = {
|
||||
gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, chuckya_seg8_texture_08006778),
|
||||
gsDPLoadSync(),
|
||||
gsDPLoadBlock(G_TX_LOADTILE, 0, 0, 32 * 32 - 1, CALC_DXT(32, G_IM_SIZ_16b_BYTES)),
|
||||
gsDPLoadBlock(G_TX_LOADTILE, 0, 0, 32 * 64 - 1, CALC_DXT(32, G_IM_SIZ_16b_BYTES)),
|
||||
gsSPLight(&chuckya_seg8_lights_0800A668.l, 1),
|
||||
gsSPLight(&chuckya_seg8_lights_0800A668.a, 2),
|
||||
gsSPVertex(chuckya_seg8_vertex_0800A680, 8, 0),
|
||||
|
@ -375,7 +375,7 @@ const Gfx chuckya_seg8_dl_0800A758[] = {
|
|||
gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON),
|
||||
gsDPTileSync(),
|
||||
gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 8, 0, G_TX_RENDERTILE, 0, G_TX_CLAMP, 5, G_TX_NOLOD, G_TX_CLAMP, 5, G_TX_NOLOD),
|
||||
gsDPSetTileSize(0, 0, 0, (32 - 1) << G_TEXTURE_IMAGE_FRAC, (32 - 1) << G_TEXTURE_IMAGE_FRAC),
|
||||
gsDPSetTileSize(0, 0, 0, (32 - 1) << G_TEXTURE_IMAGE_FRAC, (64 - 1) << G_TEXTURE_IMAGE_FRAC),
|
||||
gsSPDisplayList(chuckya_seg8_dl_0800A700),
|
||||
gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_OFF),
|
||||
gsDPPipeSync(),
|
||||
|
|
|
@ -13,7 +13,7 @@ ALIGNED8 static const u8 exclamation_box_seg8_texture_08012E28[] = {
|
|||
|
||||
// 0x08013628
|
||||
ALIGNED8 static const u8 exclamation_box_seg8_texture_08013628[] = {
|
||||
#include "actors/exclamation_box/vanish_cap_box_sides.rgba16.inc.c"
|
||||
#include "actors/exclamation_box/vanish_cap_box_side.rgba16.inc.c"
|
||||
};
|
||||
|
||||
// 0x08014628
|
||||
|
@ -33,7 +33,7 @@ ALIGNED8 static const u8 exclamation_box_seg8_texture_08015E28[] = {
|
|||
|
||||
// 0x08016628
|
||||
ALIGNED8 static const u8 exclamation_box_seg8_texture_08016628[] = {
|
||||
#include "actors/exclamation_box/wing_cap_box_sides.rgba16.inc.c"
|
||||
#include "actors/exclamation_box/wing_cap_box_side.rgba16.inc.c"
|
||||
};
|
||||
|
||||
// 0x08017628
|
||||
|
|
|
@ -531,7 +531,7 @@ static const Vtx king_bobomb_seg5_vertex_0500B218[] = {
|
|||
const Gfx king_bobomb_seg5_dl_0500B278[] = {
|
||||
gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, king_bobomb_seg5_texture_05004878),
|
||||
gsDPLoadSync(),
|
||||
gsDPLoadBlock(G_TX_LOADTILE, 0, 0, 32 * 32 - 1, CALC_DXT(32, G_IM_SIZ_16b_BYTES)),
|
||||
gsDPLoadBlock(G_TX_LOADTILE, 0, 0, 32 * 64 - 1, CALC_DXT(32, G_IM_SIZ_16b_BYTES)),
|
||||
gsSPLight(&king_bobomb_seg5_lights_0500B200.l, 1),
|
||||
gsSPLight(&king_bobomb_seg5_lights_0500B200.a, 2),
|
||||
gsSPVertex(king_bobomb_seg5_vertex_0500B218, 6, 0),
|
||||
|
@ -548,7 +548,7 @@ const Gfx king_bobomb_seg5_dl_0500B2D0[] = {
|
|||
gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON),
|
||||
gsDPTileSync(),
|
||||
gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 8, 0, G_TX_RENDERTILE, 0, G_TX_CLAMP, 5, G_TX_NOLOD, G_TX_CLAMP, 5, G_TX_NOLOD),
|
||||
gsDPSetTileSize(0, 0, 0, (32 - 1) << G_TEXTURE_IMAGE_FRAC, (32 - 1) << G_TEXTURE_IMAGE_FRAC),
|
||||
gsDPSetTileSize(0, 0, 0, (32 - 1) << G_TEXTURE_IMAGE_FRAC, (64 - 1) << G_TEXTURE_IMAGE_FRAC),
|
||||
gsSPDisplayList(king_bobomb_seg5_dl_0500B278),
|
||||
gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_OFF),
|
||||
gsDPPipeSync(),
|
||||
|
|
|
@ -56,7 +56,7 @@ const Gfx star_seg3_dl_0302B870[] = {
|
|||
gsSPSetGeometryMode(G_TEXTURE_GEN),
|
||||
gsDPSetEnvColor(255, 255, 255, 255),
|
||||
gsDPSetCombineMode(G_CC_DECALFADE, G_CC_DECALFADE),
|
||||
gsDPLoadTextureBlock(star_seg3_texture_0302A6F0, G_IM_FMT_RGBA, G_IM_SIZ_16b, 32, 64, 0, G_TX_WRAP | G_TX_NOMIRROR, G_TX_WRAP | G_TX_NOMIRROR, 5, 6, G_TX_NOLOD, G_TX_NOLOD), //! Dimensions loaded as 32x64 despite this texture having only 32x32 dimensions, harmless due to environment mapping (G_TEXTURE_GEN & gsSPTexture values)
|
||||
gsDPLoadTextureBlock(star_seg3_texture_0302A6F0, G_IM_FMT_RGBA, G_IM_SIZ_16b, 32, 32, 0, G_TX_WRAP | G_TX_NOMIRROR, G_TX_WRAP | G_TX_NOMIRROR, 5, 6, G_TX_NOLOD, G_TX_NOLOD),
|
||||
gsSPTexture(0x07C0, 0x07C0, 0, G_TX_RENDERTILE, G_ON),
|
||||
gsSPDisplayList(star_seg3_dl_0302B7B0),
|
||||
gsDPPipeSync(),
|
||||
|
|
|
@ -151,9 +151,9 @@
|
|||
"actors/exclamation_box/metal_cap_box_front.rgba16.png": [32,32,2048,{"jp":[2032944,83496],"us":[2040320,83496],"eu":[1912288,83496],"sh":[1888800,83496]}],
|
||||
"actors/exclamation_box/metal_cap_box_side.rgba16.png": [64,32,4096,{"jp":[2032944,85544],"us":[2040320,85544],"eu":[1912288,85544],"sh":[1888800,85544]}],
|
||||
"actors/exclamation_box/vanish_cap_box_front.rgba16.png": [32,32,2048,{"jp":[2032944,77352],"us":[2040320,77352],"eu":[1912288,77352],"sh":[1888800,77352]}],
|
||||
"actors/exclamation_box/vanish_cap_box_sides.rgba16.png": [64,32,4096,{"jp":[2032944,79400],"us":[2040320,79400],"eu":[1912288,79400],"sh":[1888800,79400]}],
|
||||
"actors/exclamation_box/vanish_cap_box_side.rgba16.png": [32,64,4096,{"jp":[2032944,79400],"us":[2040320,79400],"eu":[1912288,79400],"sh":[1888800,79400]}],
|
||||
"actors/exclamation_box/wing_cap_box_front.rgba16.png": [32,32,2048,{"jp":[2032944,89640],"us":[2040320,89640],"eu":[1912288,89640],"sh":[1888800,89640]}],
|
||||
"actors/exclamation_box/wing_cap_box_sides.rgba16.png": [64,32,4096,{"jp":[2032944,91688],"us":[2040320,91688],"eu":[1912288,91688],"sh":[1888800,91688]}],
|
||||
"actors/exclamation_box/wing_cap_box_side.rgba16.png": [32,64,4096,{"jp":[2032944,91688],"us":[2040320,91688],"eu":[1912288,91688],"sh":[1888800,91688]}],
|
||||
"actors/exclamation_box_outline/exclamation_box_outline.rgba16.png": [32,32,2048,{"jp":[2032944,151912],"us":[2040320,151912],"eu":[1912288,151912],"sh":[1888800,151912]}],
|
||||
"actors/exclamation_box_outline/exclamation_point.rgba16.png": [16,32,1024,{"jp":[2032944,154240],"us":[2040320,154240],"eu":[1912288,154240],"sh":[1888800,154240]}],
|
||||
"actors/explosion/explosion_0.rgba16.png": [32,32,2048,{"jp":[2094912,2568],"us":[2102288,2568],"eu":[1974256,2568],"sh":[1950768,2568]}],
|
||||
|
|
4
build.sh
4
build.sh
|
@ -7,8 +7,8 @@ LIBAFLA=libaudiofile.la
|
|||
AUDDIR=./tools/audiofile-0.3.6
|
||||
|
||||
# Command line options
|
||||
OPTIONS=("Analog Camera" "No Draw Distance" "Text-saves" "Smoke Texture Fix" "Clean build")
|
||||
EXTRA=("BETTERCAMERA=1" "NODRAWINGDISTANCE=1" "TEXTSAVES=1" "TEXTURE_FIX=1" "clean")
|
||||
OPTIONS=("Analog Camera" "No Draw Distance" "Text-saves" "Smoke Texture Fix" "Release build" "Clean build")
|
||||
EXTRA=("BETTERCAMERA=1" "NODRAWINGDISTANCE=1" "TEXTSAVES=1" "TEXTURE_FIX=1" "DEBUG=0" "clean")
|
||||
|
||||
# Colors
|
||||
RED=$(tput setaf 1)
|
||||
|
|
|
@ -26,10 +26,6 @@ This allows you to draw 3D boxes for debugging purposes.
|
|||
Call the `debug_box` function whenever you want to draw one. `debug_box` by default takes two arguments: a center and bounds vec3f. This will draw a box starting from the point (center - bounds) to (center + bounds).
|
||||
Use `debug_box_rot` to draw a box rotated in the xz-plane. If you want to draw a box by specifying min and max points, use `debug_box_pos` instead.
|
||||
|
||||
## FPS Counter - `fps.patch`
|
||||
|
||||
This patch provides an in-game FPS counter to measure the frame rate.
|
||||
|
||||
## iQue Player Support - `ique_support.patch`
|
||||
|
||||
This enhancement allows the same ROM to work on both the Nintendo 64 and the iQue Player.
|
||||
|
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,459 @@
|
|||
//////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
//
|
||||
// File: D3D12Shader.h
|
||||
// Content: D3D12 Shader Types and APIs
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __D3D12SHADER_H__
|
||||
#define __D3D12SHADER_H__
|
||||
|
||||
#include "d3dcommon.h"
|
||||
|
||||
typedef enum D3D12_SHADER_VERSION_TYPE
|
||||
{
|
||||
D3D12_SHVER_PIXEL_SHADER = 0,
|
||||
D3D12_SHVER_VERTEX_SHADER = 1,
|
||||
D3D12_SHVER_GEOMETRY_SHADER = 2,
|
||||
|
||||
// D3D11 Shaders
|
||||
D3D12_SHVER_HULL_SHADER = 3,
|
||||
D3D12_SHVER_DOMAIN_SHADER = 4,
|
||||
D3D12_SHVER_COMPUTE_SHADER = 5,
|
||||
|
||||
D3D12_SHVER_RESERVED0 = 0xFFF0,
|
||||
} D3D12_SHADER_VERSION_TYPE;
|
||||
|
||||
#define D3D12_SHVER_GET_TYPE(_Version) \
|
||||
(((_Version) >> 16) & 0xffff)
|
||||
#define D3D12_SHVER_GET_MAJOR(_Version) \
|
||||
(((_Version) >> 4) & 0xf)
|
||||
#define D3D12_SHVER_GET_MINOR(_Version) \
|
||||
(((_Version) >> 0) & 0xf)
|
||||
|
||||
// Slot ID for library function return
|
||||
#define D3D_RETURN_PARAMETER_INDEX (-1)
|
||||
|
||||
typedef D3D_RESOURCE_RETURN_TYPE D3D12_RESOURCE_RETURN_TYPE;
|
||||
|
||||
typedef D3D_CBUFFER_TYPE D3D12_CBUFFER_TYPE;
|
||||
|
||||
|
||||
typedef struct _D3D12_SIGNATURE_PARAMETER_DESC
|
||||
{
|
||||
LPCSTR SemanticName; // Name of the semantic
|
||||
UINT SemanticIndex; // Index of the semantic
|
||||
UINT Register; // Number of member variables
|
||||
D3D_NAME SystemValueType;// A predefined system value, or D3D_NAME_UNDEFINED if not applicable
|
||||
D3D_REGISTER_COMPONENT_TYPE ComponentType; // Scalar type (e.g. uint, float, etc.)
|
||||
BYTE Mask; // Mask to indicate which components of the register
|
||||
// are used (combination of D3D10_COMPONENT_MASK values)
|
||||
BYTE ReadWriteMask; // Mask to indicate whether a given component is
|
||||
// never written (if this is an output signature) or
|
||||
// always read (if this is an input signature).
|
||||
// (combination of D3D_MASK_* values)
|
||||
UINT Stream; // Stream index
|
||||
D3D_MIN_PRECISION MinPrecision; // Minimum desired interpolation precision
|
||||
} D3D12_SIGNATURE_PARAMETER_DESC;
|
||||
|
||||
typedef struct _D3D12_SHADER_BUFFER_DESC
|
||||
{
|
||||
LPCSTR Name; // Name of the constant buffer
|
||||
D3D_CBUFFER_TYPE Type; // Indicates type of buffer content
|
||||
UINT Variables; // Number of member variables
|
||||
UINT Size; // Size of CB (in bytes)
|
||||
UINT uFlags; // Buffer description flags
|
||||
} D3D12_SHADER_BUFFER_DESC;
|
||||
|
||||
typedef struct _D3D12_SHADER_VARIABLE_DESC
|
||||
{
|
||||
LPCSTR Name; // Name of the variable
|
||||
UINT StartOffset; // Offset in constant buffer's backing store
|
||||
UINT Size; // Size of variable (in bytes)
|
||||
UINT uFlags; // Variable flags
|
||||
LPVOID DefaultValue; // Raw pointer to default value
|
||||
UINT StartTexture; // First texture index (or -1 if no textures used)
|
||||
UINT TextureSize; // Number of texture slots possibly used.
|
||||
UINT StartSampler; // First sampler index (or -1 if no textures used)
|
||||
UINT SamplerSize; // Number of sampler slots possibly used.
|
||||
} D3D12_SHADER_VARIABLE_DESC;
|
||||
|
||||
typedef struct _D3D12_SHADER_TYPE_DESC
|
||||
{
|
||||
D3D_SHADER_VARIABLE_CLASS Class; // Variable class (e.g. object, matrix, etc.)
|
||||
D3D_SHADER_VARIABLE_TYPE Type; // Variable type (e.g. float, sampler, etc.)
|
||||
UINT Rows; // Number of rows (for matrices, 1 for other numeric, 0 if not applicable)
|
||||
UINT Columns; // Number of columns (for vectors & matrices, 1 for other numeric, 0 if not applicable)
|
||||
UINT Elements; // Number of elements (0 if not an array)
|
||||
UINT Members; // Number of members (0 if not a structure)
|
||||
UINT Offset; // Offset from the start of structure (0 if not a structure member)
|
||||
LPCSTR Name; // Name of type, can be NULL
|
||||
} D3D12_SHADER_TYPE_DESC;
|
||||
|
||||
typedef D3D_TESSELLATOR_DOMAIN D3D12_TESSELLATOR_DOMAIN;
|
||||
|
||||
typedef D3D_TESSELLATOR_PARTITIONING D3D12_TESSELLATOR_PARTITIONING;
|
||||
|
||||
typedef D3D_TESSELLATOR_OUTPUT_PRIMITIVE D3D12_TESSELLATOR_OUTPUT_PRIMITIVE;
|
||||
|
||||
typedef struct _D3D12_SHADER_DESC
|
||||
{
|
||||
UINT Version; // Shader version
|
||||
LPCSTR Creator; // Creator string
|
||||
UINT Flags; // Shader compilation/parse flags
|
||||
|
||||
UINT ConstantBuffers; // Number of constant buffers
|
||||
UINT BoundResources; // Number of bound resources
|
||||
UINT InputParameters; // Number of parameters in the input signature
|
||||
UINT OutputParameters; // Number of parameters in the output signature
|
||||
|
||||
UINT InstructionCount; // Number of emitted instructions
|
||||
UINT TempRegisterCount; // Number of temporary registers used
|
||||
UINT TempArrayCount; // Number of temporary arrays used
|
||||
UINT DefCount; // Number of constant defines
|
||||
UINT DclCount; // Number of declarations (input + output)
|
||||
UINT TextureNormalInstructions; // Number of non-categorized texture instructions
|
||||
UINT TextureLoadInstructions; // Number of texture load instructions
|
||||
UINT TextureCompInstructions; // Number of texture comparison instructions
|
||||
UINT TextureBiasInstructions; // Number of texture bias instructions
|
||||
UINT TextureGradientInstructions; // Number of texture gradient instructions
|
||||
UINT FloatInstructionCount; // Number of floating point arithmetic instructions used
|
||||
UINT IntInstructionCount; // Number of signed integer arithmetic instructions used
|
||||
UINT UintInstructionCount; // Number of unsigned integer arithmetic instructions used
|
||||
UINT StaticFlowControlCount; // Number of static flow control instructions used
|
||||
UINT DynamicFlowControlCount; // Number of dynamic flow control instructions used
|
||||
UINT MacroInstructionCount; // Number of macro instructions used
|
||||
UINT ArrayInstructionCount; // Number of array instructions used
|
||||
UINT CutInstructionCount; // Number of cut instructions used
|
||||
UINT EmitInstructionCount; // Number of emit instructions used
|
||||
D3D_PRIMITIVE_TOPOLOGY GSOutputTopology; // Geometry shader output topology
|
||||
UINT GSMaxOutputVertexCount; // Geometry shader maximum output vertex count
|
||||
D3D_PRIMITIVE InputPrimitive; // GS/HS input primitive
|
||||
UINT PatchConstantParameters; // Number of parameters in the patch constant signature
|
||||
UINT cGSInstanceCount; // Number of Geometry shader instances
|
||||
UINT cControlPoints; // Number of control points in the HS->DS stage
|
||||
D3D_TESSELLATOR_OUTPUT_PRIMITIVE HSOutputPrimitive; // Primitive output by the tessellator
|
||||
D3D_TESSELLATOR_PARTITIONING HSPartitioning; // Partitioning mode of the tessellator
|
||||
D3D_TESSELLATOR_DOMAIN TessellatorDomain; // Domain of the tessellator (quad, tri, isoline)
|
||||
// instruction counts
|
||||
UINT cBarrierInstructions; // Number of barrier instructions in a compute shader
|
||||
UINT cInterlockedInstructions; // Number of interlocked instructions
|
||||
UINT cTextureStoreInstructions; // Number of texture writes
|
||||
} D3D12_SHADER_DESC;
|
||||
|
||||
typedef struct _D3D12_SHADER_INPUT_BIND_DESC
|
||||
{
|
||||
LPCSTR Name; // Name of the resource
|
||||
D3D_SHADER_INPUT_TYPE Type; // Type of resource (e.g. texture, cbuffer, etc.)
|
||||
UINT BindPoint; // Starting bind point
|
||||
UINT BindCount; // Number of contiguous bind points (for arrays)
|
||||
|
||||
UINT uFlags; // Input binding flags
|
||||
D3D_RESOURCE_RETURN_TYPE ReturnType; // Return type (if texture)
|
||||
D3D_SRV_DIMENSION Dimension; // Dimension (if texture)
|
||||
UINT NumSamples; // Number of samples (0 if not MS texture)
|
||||
UINT Space; // Register space
|
||||
UINT uID; // Range ID in the bytecode
|
||||
} D3D12_SHADER_INPUT_BIND_DESC;
|
||||
|
||||
#define D3D_SHADER_REQUIRES_DOUBLES 0x00000001
|
||||
#define D3D_SHADER_REQUIRES_EARLY_DEPTH_STENCIL 0x00000002
|
||||
#define D3D_SHADER_REQUIRES_UAVS_AT_EVERY_STAGE 0x00000004
|
||||
#define D3D_SHADER_REQUIRES_64_UAVS 0x00000008
|
||||
#define D3D_SHADER_REQUIRES_MINIMUM_PRECISION 0x00000010
|
||||
#define D3D_SHADER_REQUIRES_11_1_DOUBLE_EXTENSIONS 0x00000020
|
||||
#define D3D_SHADER_REQUIRES_11_1_SHADER_EXTENSIONS 0x00000040
|
||||
#define D3D_SHADER_REQUIRES_LEVEL_9_COMPARISON_FILTERING 0x00000080
|
||||
#define D3D_SHADER_REQUIRES_TILED_RESOURCES 0x00000100
|
||||
#define D3D_SHADER_REQUIRES_STENCIL_REF 0x00000200
|
||||
#define D3D_SHADER_REQUIRES_INNER_COVERAGE 0x00000400
|
||||
#define D3D_SHADER_REQUIRES_TYPED_UAV_LOAD_ADDITIONAL_FORMATS 0x00000800
|
||||
#define D3D_SHADER_REQUIRES_ROVS 0x00001000
|
||||
#define D3D_SHADER_REQUIRES_VIEWPORT_AND_RT_ARRAY_INDEX_FROM_ANY_SHADER_FEEDING_RASTERIZER 0x00002000
|
||||
|
||||
|
||||
typedef struct _D3D12_LIBRARY_DESC
|
||||
{
|
||||
LPCSTR Creator; // The name of the originator of the library.
|
||||
UINT Flags; // Compilation flags.
|
||||
UINT FunctionCount; // Number of functions exported from the library.
|
||||
} D3D12_LIBRARY_DESC;
|
||||
|
||||
typedef struct _D3D12_FUNCTION_DESC
|
||||
{
|
||||
UINT Version; // Shader version
|
||||
LPCSTR Creator; // Creator string
|
||||
UINT Flags; // Shader compilation/parse flags
|
||||
|
||||
UINT ConstantBuffers; // Number of constant buffers
|
||||
UINT BoundResources; // Number of bound resources
|
||||
|
||||
UINT InstructionCount; // Number of emitted instructions
|
||||
UINT TempRegisterCount; // Number of temporary registers used
|
||||
UINT TempArrayCount; // Number of temporary arrays used
|
||||
UINT DefCount; // Number of constant defines
|
||||
UINT DclCount; // Number of declarations (input + output)
|
||||
UINT TextureNormalInstructions; // Number of non-categorized texture instructions
|
||||
UINT TextureLoadInstructions; // Number of texture load instructions
|
||||
UINT TextureCompInstructions; // Number of texture comparison instructions
|
||||
UINT TextureBiasInstructions; // Number of texture bias instructions
|
||||
UINT TextureGradientInstructions; // Number of texture gradient instructions
|
||||
UINT FloatInstructionCount; // Number of floating point arithmetic instructions used
|
||||
UINT IntInstructionCount; // Number of signed integer arithmetic instructions used
|
||||
UINT UintInstructionCount; // Number of unsigned integer arithmetic instructions used
|
||||
UINT StaticFlowControlCount; // Number of static flow control instructions used
|
||||
UINT DynamicFlowControlCount; // Number of dynamic flow control instructions used
|
||||
UINT MacroInstructionCount; // Number of macro instructions used
|
||||
UINT ArrayInstructionCount; // Number of array instructions used
|
||||
UINT MovInstructionCount; // Number of mov instructions used
|
||||
UINT MovcInstructionCount; // Number of movc instructions used
|
||||
UINT ConversionInstructionCount; // Number of type conversion instructions used
|
||||
UINT BitwiseInstructionCount; // Number of bitwise arithmetic instructions used
|
||||
D3D_FEATURE_LEVEL MinFeatureLevel; // Min target of the function byte code
|
||||
UINT64 RequiredFeatureFlags; // Required feature flags
|
||||
|
||||
LPCSTR Name; // Function name
|
||||
INT FunctionParameterCount; // Number of logical parameters in the function signature (not including return)
|
||||
BOOL HasReturn; // TRUE, if function returns a value, false - it is a subroutine
|
||||
BOOL Has10Level9VertexShader; // TRUE, if there is a 10L9 VS blob
|
||||
BOOL Has10Level9PixelShader; // TRUE, if there is a 10L9 PS blob
|
||||
} D3D12_FUNCTION_DESC;
|
||||
|
||||
typedef struct _D3D12_PARAMETER_DESC
|
||||
{
|
||||
LPCSTR Name; // Parameter name.
|
||||
LPCSTR SemanticName; // Parameter semantic name (+index).
|
||||
D3D_SHADER_VARIABLE_TYPE Type; // Element type.
|
||||
D3D_SHADER_VARIABLE_CLASS Class; // Scalar/Vector/Matrix.
|
||||
UINT Rows; // Rows are for matrix parameters.
|
||||
UINT Columns; // Components or Columns in matrix.
|
||||
D3D_INTERPOLATION_MODE InterpolationMode; // Interpolation mode.
|
||||
D3D_PARAMETER_FLAGS Flags; // Parameter modifiers.
|
||||
|
||||
UINT FirstInRegister; // The first input register for this parameter.
|
||||
UINT FirstInComponent; // The first input register component for this parameter.
|
||||
UINT FirstOutRegister; // The first output register for this parameter.
|
||||
UINT FirstOutComponent; // The first output register component for this parameter.
|
||||
} D3D12_PARAMETER_DESC;
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
// Interfaces ////////////////////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
typedef interface ID3D12ShaderReflectionType ID3D12ShaderReflectionType;
|
||||
typedef interface ID3D12ShaderReflectionType *LPD3D12SHADERREFLECTIONTYPE;
|
||||
|
||||
typedef interface ID3D12ShaderReflectionVariable ID3D12ShaderReflectionVariable;
|
||||
typedef interface ID3D12ShaderReflectionVariable *LPD3D12SHADERREFLECTIONVARIABLE;
|
||||
|
||||
typedef interface ID3D12ShaderReflectionConstantBuffer ID3D12ShaderReflectionConstantBuffer;
|
||||
typedef interface ID3D12ShaderReflectionConstantBuffer *LPD3D12SHADERREFLECTIONCONSTANTBUFFER;
|
||||
|
||||
typedef interface ID3D12ShaderReflection ID3D12ShaderReflection;
|
||||
typedef interface ID3D12ShaderReflection *LPD3D12SHADERREFLECTION;
|
||||
|
||||
typedef interface ID3D12LibraryReflection ID3D12LibraryReflection;
|
||||
typedef interface ID3D12LibraryReflection *LPD3D12LIBRARYREFLECTION;
|
||||
|
||||
typedef interface ID3D12FunctionReflection ID3D12FunctionReflection;
|
||||
typedef interface ID3D12FunctionReflection *LPD3D12FUNCTIONREFLECTION;
|
||||
|
||||
typedef interface ID3D12FunctionParameterReflection ID3D12FunctionParameterReflection;
|
||||
typedef interface ID3D12FunctionParameterReflection *LPD3D12FUNCTIONPARAMETERREFLECTION;
|
||||
|
||||
|
||||
// {E913C351-783D-48CA-A1D1-4F306284AD56}
|
||||
interface DECLSPEC_UUID("E913C351-783D-48CA-A1D1-4F306284AD56") ID3D12ShaderReflectionType;
|
||||
DEFINE_GUID(IID_ID3D12ShaderReflectionType,
|
||||
0xe913c351, 0x783d, 0x48ca, 0xa1, 0xd1, 0x4f, 0x30, 0x62, 0x84, 0xad, 0x56);
|
||||
|
||||
#undef INTERFACE
|
||||
#define INTERFACE ID3D12ShaderReflectionType
|
||||
|
||||
DECLARE_INTERFACE(ID3D12ShaderReflectionType)
|
||||
{
|
||||
STDMETHOD(GetDesc)(THIS_ _Out_ D3D12_SHADER_TYPE_DESC *pDesc) PURE;
|
||||
|
||||
STDMETHOD_(ID3D12ShaderReflectionType*, GetMemberTypeByIndex)(THIS_ _In_ UINT Index) PURE;
|
||||
STDMETHOD_(ID3D12ShaderReflectionType*, GetMemberTypeByName)(THIS_ _In_ LPCSTR Name) PURE;
|
||||
STDMETHOD_(LPCSTR, GetMemberTypeName)(THIS_ _In_ UINT Index) PURE;
|
||||
|
||||
STDMETHOD(IsEqual)(THIS_ _In_ ID3D12ShaderReflectionType* pType) PURE;
|
||||
STDMETHOD_(ID3D12ShaderReflectionType*, GetSubType)(THIS) PURE;
|
||||
STDMETHOD_(ID3D12ShaderReflectionType*, GetBaseClass)(THIS) PURE;
|
||||
STDMETHOD_(UINT, GetNumInterfaces)(THIS) PURE;
|
||||
STDMETHOD_(ID3D12ShaderReflectionType*, GetInterfaceByIndex)(THIS_ _In_ UINT uIndex) PURE;
|
||||
STDMETHOD(IsOfType)(THIS_ _In_ ID3D12ShaderReflectionType* pType) PURE;
|
||||
STDMETHOD(ImplementsInterface)(THIS_ _In_ ID3D12ShaderReflectionType* pBase) PURE;
|
||||
};
|
||||
|
||||
// {8337A8A6-A216-444A-B2F4-314733A73AEA}
|
||||
interface DECLSPEC_UUID("8337A8A6-A216-444A-B2F4-314733A73AEA") ID3D12ShaderReflectionVariable;
|
||||
DEFINE_GUID(IID_ID3D12ShaderReflectionVariable,
|
||||
0x8337a8a6, 0xa216, 0x444a, 0xb2, 0xf4, 0x31, 0x47, 0x33, 0xa7, 0x3a, 0xea);
|
||||
|
||||
#undef INTERFACE
|
||||
#define INTERFACE ID3D12ShaderReflectionVariable
|
||||
|
||||
DECLARE_INTERFACE(ID3D12ShaderReflectionVariable)
|
||||
{
|
||||
STDMETHOD(GetDesc)(THIS_ _Out_ D3D12_SHADER_VARIABLE_DESC *pDesc) PURE;
|
||||
|
||||
STDMETHOD_(ID3D12ShaderReflectionType*, GetType)(THIS) PURE;
|
||||
STDMETHOD_(ID3D12ShaderReflectionConstantBuffer*, GetBuffer)(THIS) PURE;
|
||||
|
||||
STDMETHOD_(UINT, GetInterfaceSlot)(THIS_ _In_ UINT uArrayIndex) PURE;
|
||||
};
|
||||
|
||||
// {C59598B4-48B3-4869-B9B1-B1618B14A8B7}
|
||||
interface DECLSPEC_UUID("C59598B4-48B3-4869-B9B1-B1618B14A8B7") ID3D12ShaderReflectionConstantBuffer;
|
||||
DEFINE_GUID(IID_ID3D12ShaderReflectionConstantBuffer,
|
||||
0xc59598b4, 0x48b3, 0x4869, 0xb9, 0xb1, 0xb1, 0x61, 0x8b, 0x14, 0xa8, 0xb7);
|
||||
|
||||
#undef INTERFACE
|
||||
#define INTERFACE ID3D12ShaderReflectionConstantBuffer
|
||||
|
||||
DECLARE_INTERFACE(ID3D12ShaderReflectionConstantBuffer)
|
||||
{
|
||||
STDMETHOD(GetDesc)(THIS_ D3D12_SHADER_BUFFER_DESC *pDesc) PURE;
|
||||
|
||||
STDMETHOD_(ID3D12ShaderReflectionVariable*, GetVariableByIndex)(THIS_ _In_ UINT Index) PURE;
|
||||
STDMETHOD_(ID3D12ShaderReflectionVariable*, GetVariableByName)(THIS_ _In_ LPCSTR Name) PURE;
|
||||
};
|
||||
|
||||
// The ID3D12ShaderReflection IID may change from SDK version to SDK version
|
||||
// if the reflection API changes. This prevents new code with the new API
|
||||
// from working with an old binary. Recompiling with the new header
|
||||
// will pick up the new IID.
|
||||
|
||||
// {5A58797D-A72C-478D-8BA2-EFC6B0EFE88E}
|
||||
interface DECLSPEC_UUID("5A58797D-A72C-478D-8BA2-EFC6B0EFE88E") ID3D12ShaderReflection;
|
||||
DEFINE_GUID(IID_ID3D12ShaderReflection,
|
||||
0x5a58797d, 0xa72c, 0x478d, 0x8b, 0xa2, 0xef, 0xc6, 0xb0, 0xef, 0xe8, 0x8e);
|
||||
|
||||
#undef INTERFACE
|
||||
#define INTERFACE ID3D12ShaderReflection
|
||||
|
||||
DECLARE_INTERFACE_(ID3D12ShaderReflection, IUnknown)
|
||||
{
|
||||
STDMETHOD(QueryInterface)(THIS_ _In_ REFIID iid,
|
||||
_Out_ LPVOID *ppv) PURE;
|
||||
STDMETHOD_(ULONG, AddRef)(THIS) PURE;
|
||||
STDMETHOD_(ULONG, Release)(THIS) PURE;
|
||||
|
||||
STDMETHOD(GetDesc)(THIS_ _Out_ D3D12_SHADER_DESC *pDesc) PURE;
|
||||
|
||||
STDMETHOD_(ID3D12ShaderReflectionConstantBuffer*, GetConstantBufferByIndex)(THIS_ _In_ UINT Index) PURE;
|
||||
STDMETHOD_(ID3D12ShaderReflectionConstantBuffer*, GetConstantBufferByName)(THIS_ _In_ LPCSTR Name) PURE;
|
||||
|
||||
STDMETHOD(GetResourceBindingDesc)(THIS_ _In_ UINT ResourceIndex,
|
||||
_Out_ D3D12_SHADER_INPUT_BIND_DESC *pDesc) PURE;
|
||||
|
||||
STDMETHOD(GetInputParameterDesc)(THIS_ _In_ UINT ParameterIndex,
|
||||
_Out_ D3D12_SIGNATURE_PARAMETER_DESC *pDesc) PURE;
|
||||
STDMETHOD(GetOutputParameterDesc)(THIS_ _In_ UINT ParameterIndex,
|
||||
_Out_ D3D12_SIGNATURE_PARAMETER_DESC *pDesc) PURE;
|
||||
STDMETHOD(GetPatchConstantParameterDesc)(THIS_ _In_ UINT ParameterIndex,
|
||||
_Out_ D3D12_SIGNATURE_PARAMETER_DESC *pDesc) PURE;
|
||||
|
||||
STDMETHOD_(ID3D12ShaderReflectionVariable*, GetVariableByName)(THIS_ _In_ LPCSTR Name) PURE;
|
||||
|
||||
STDMETHOD(GetResourceBindingDescByName)(THIS_ _In_ LPCSTR Name,
|
||||
_Out_ D3D12_SHADER_INPUT_BIND_DESC *pDesc) PURE;
|
||||
|
||||
STDMETHOD_(UINT, GetMovInstructionCount)(THIS) PURE;
|
||||
STDMETHOD_(UINT, GetMovcInstructionCount)(THIS) PURE;
|
||||
STDMETHOD_(UINT, GetConversionInstructionCount)(THIS) PURE;
|
||||
STDMETHOD_(UINT, GetBitwiseInstructionCount)(THIS) PURE;
|
||||
|
||||
STDMETHOD_(D3D_PRIMITIVE, GetGSInputPrimitive)(THIS) PURE;
|
||||
STDMETHOD_(BOOL, IsSampleFrequencyShader)(THIS) PURE;
|
||||
|
||||
STDMETHOD_(UINT, GetNumInterfaceSlots)(THIS) PURE;
|
||||
STDMETHOD(GetMinFeatureLevel)(THIS_ _Out_ enum D3D_FEATURE_LEVEL* pLevel) PURE;
|
||||
|
||||
STDMETHOD_(UINT, GetThreadGroupSize)(THIS_
|
||||
_Out_opt_ UINT* pSizeX,
|
||||
_Out_opt_ UINT* pSizeY,
|
||||
_Out_opt_ UINT* pSizeZ) PURE;
|
||||
|
||||
STDMETHOD_(UINT64, GetRequiresFlags)(THIS) PURE;
|
||||
};
|
||||
|
||||
// {8E349D19-54DB-4A56-9DC9-119D87BDB804}
|
||||
interface DECLSPEC_UUID("8E349D19-54DB-4A56-9DC9-119D87BDB804") ID3D12LibraryReflection;
|
||||
DEFINE_GUID(IID_ID3D12LibraryReflection,
|
||||
0x8e349d19, 0x54db, 0x4a56, 0x9d, 0xc9, 0x11, 0x9d, 0x87, 0xbd, 0xb8, 0x4);
|
||||
|
||||
#undef INTERFACE
|
||||
#define INTERFACE ID3D12LibraryReflection
|
||||
|
||||
DECLARE_INTERFACE_(ID3D12LibraryReflection, IUnknown)
|
||||
{
|
||||
STDMETHOD(QueryInterface)(THIS_ _In_ REFIID iid, _Out_ LPVOID * ppv) PURE;
|
||||
STDMETHOD_(ULONG, AddRef)(THIS) PURE;
|
||||
STDMETHOD_(ULONG, Release)(THIS) PURE;
|
||||
|
||||
STDMETHOD(GetDesc)(THIS_ _Out_ D3D12_LIBRARY_DESC * pDesc) PURE;
|
||||
|
||||
STDMETHOD_(ID3D12FunctionReflection *, GetFunctionByIndex)(THIS_ _In_ INT FunctionIndex) PURE;
|
||||
};
|
||||
|
||||
// {1108795C-2772-4BA9-B2A8-D464DC7E2799}
|
||||
interface DECLSPEC_UUID("1108795C-2772-4BA9-B2A8-D464DC7E2799") ID3D12FunctionReflection;
|
||||
DEFINE_GUID(IID_ID3D12FunctionReflection,
|
||||
0x1108795c, 0x2772, 0x4ba9, 0xb2, 0xa8, 0xd4, 0x64, 0xdc, 0x7e, 0x27, 0x99);
|
||||
|
||||
#undef INTERFACE
|
||||
#define INTERFACE ID3D12FunctionReflection
|
||||
|
||||
DECLARE_INTERFACE(ID3D12FunctionReflection)
|
||||
{
|
||||
STDMETHOD(GetDesc)(THIS_ _Out_ D3D12_FUNCTION_DESC * pDesc) PURE;
|
||||
|
||||
STDMETHOD_(ID3D12ShaderReflectionConstantBuffer *, GetConstantBufferByIndex)(THIS_ _In_ UINT BufferIndex) PURE;
|
||||
STDMETHOD_(ID3D12ShaderReflectionConstantBuffer *, GetConstantBufferByName)(THIS_ _In_ LPCSTR Name) PURE;
|
||||
|
||||
STDMETHOD(GetResourceBindingDesc)(THIS_ _In_ UINT ResourceIndex,
|
||||
_Out_ D3D12_SHADER_INPUT_BIND_DESC * pDesc) PURE;
|
||||
|
||||
STDMETHOD_(ID3D12ShaderReflectionVariable *, GetVariableByName)(THIS_ _In_ LPCSTR Name) PURE;
|
||||
|
||||
STDMETHOD(GetResourceBindingDescByName)(THIS_ _In_ LPCSTR Name,
|
||||
_Out_ D3D12_SHADER_INPUT_BIND_DESC * pDesc) PURE;
|
||||
|
||||
// Use D3D_RETURN_PARAMETER_INDEX to get description of the return value.
|
||||
STDMETHOD_(ID3D12FunctionParameterReflection *, GetFunctionParameter)(THIS_ _In_ INT ParameterIndex) PURE;
|
||||
};
|
||||
|
||||
// {EC25F42D-7006-4F2B-B33E-02CC3375733F}
|
||||
interface DECLSPEC_UUID("EC25F42D-7006-4F2B-B33E-02CC3375733F") ID3D12FunctionParameterReflection;
|
||||
DEFINE_GUID(IID_ID3D12FunctionParameterReflection,
|
||||
0xec25f42d, 0x7006, 0x4f2b, 0xb3, 0x3e, 0x2, 0xcc, 0x33, 0x75, 0x73, 0x3f);
|
||||
|
||||
#undef INTERFACE
|
||||
#define INTERFACE ID3D12FunctionParameterReflection
|
||||
|
||||
DECLARE_INTERFACE(ID3D12FunctionParameterReflection)
|
||||
{
|
||||
STDMETHOD(GetDesc)(THIS_ _Out_ D3D12_PARAMETER_DESC * pDesc) PURE;
|
||||
};
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
// APIs //////////////////////////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif //__cplusplus
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif //__cplusplus
|
||||
|
||||
#endif //__D3D12SHADER_H__
|
||||
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,586 @@
|
|||
//////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
//
|
||||
// File: D3DCompiler.h
|
||||
// Content: D3D Compilation Types and APIs
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __D3DCOMPILER_H__
|
||||
#define __D3DCOMPILER_H__
|
||||
|
||||
#include <winapifamily.h>
|
||||
|
||||
// Current name of the DLL shipped in the same SDK as this header.
|
||||
|
||||
|
||||
|
||||
#define D3DCOMPILER_DLL_W L"d3dcompiler_47.dll"
|
||||
#define D3DCOMPILER_DLL_A "d3dcompiler_47.dll"
|
||||
|
||||
// Current HLSL compiler version.
|
||||
|
||||
#define D3D_COMPILER_VERSION 47
|
||||
|
||||
#ifdef UNICODE
|
||||
#define D3DCOMPILER_DLL D3DCOMPILER_DLL_W
|
||||
#else
|
||||
#define D3DCOMPILER_DLL D3DCOMPILER_DLL_A
|
||||
#endif
|
||||
|
||||
#include "d3d11shader.h"
|
||||
#include "d3d12shader.h"
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
// APIs //////////////////////////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif //__cplusplus
|
||||
|
||||
|
||||
#pragma region Application Family
|
||||
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP | WINAPI_PARTITION_GAMES)
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// D3DReadFileToBlob:
|
||||
// -----------------
|
||||
// Simple helper routine to read a file on disk into memory
|
||||
// for passing to other routines in this API.
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
HRESULT WINAPI
|
||||
D3DReadFileToBlob(_In_ LPCWSTR pFileName,
|
||||
_Out_ ID3DBlob** ppContents);
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// D3DWriteBlobToFile:
|
||||
// ------------------
|
||||
// Simple helper routine to write a memory blob to a file on disk.
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
HRESULT WINAPI
|
||||
D3DWriteBlobToFile(_In_ ID3DBlob* pBlob,
|
||||
_In_ LPCWSTR pFileName,
|
||||
_In_ BOOL bOverwrite);
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// D3DCOMPILE flags:
|
||||
// -----------------
|
||||
// D3DCOMPILE_DEBUG
|
||||
// Insert debug file/line/type/symbol information.
|
||||
//
|
||||
// D3DCOMPILE_SKIP_VALIDATION
|
||||
// Do not validate the generated code against known capabilities and
|
||||
// constraints. This option is only recommended when compiling shaders
|
||||
// you KNOW will work. (ie. have compiled before without this option.)
|
||||
// Shaders are always validated by D3D before they are set to the device.
|
||||
//
|
||||
// D3DCOMPILE_SKIP_OPTIMIZATION
|
||||
// Instructs the compiler to skip optimization steps during code generation.
|
||||
// Unless you are trying to isolate a problem in your code using this option
|
||||
// is not recommended.
|
||||
//
|
||||
// D3DCOMPILE_PACK_MATRIX_ROW_MAJOR
|
||||
// Unless explicitly specified, matrices will be packed in row-major order
|
||||
// on input and output from the shader.
|
||||
//
|
||||
// D3DCOMPILE_PACK_MATRIX_COLUMN_MAJOR
|
||||
// Unless explicitly specified, matrices will be packed in column-major
|
||||
// order on input and output from the shader. This is generally more
|
||||
// efficient, since it allows vector-matrix multiplication to be performed
|
||||
// using a series of dot-products.
|
||||
//
|
||||
// D3DCOMPILE_PARTIAL_PRECISION
|
||||
// Force all computations in resulting shader to occur at partial precision.
|
||||
// This may result in faster evaluation of shaders on some hardware.
|
||||
//
|
||||
// D3DCOMPILE_FORCE_VS_SOFTWARE_NO_OPT
|
||||
// Force compiler to compile against the next highest available software
|
||||
// target for vertex shaders. This flag also turns optimizations off,
|
||||
// and debugging on.
|
||||
//
|
||||
// D3DCOMPILE_FORCE_PS_SOFTWARE_NO_OPT
|
||||
// Force compiler to compile against the next highest available software
|
||||
// target for pixel shaders. This flag also turns optimizations off,
|
||||
// and debugging on.
|
||||
//
|
||||
// D3DCOMPILE_NO_PRESHADER
|
||||
// Disables Preshaders. Using this flag will cause the compiler to not
|
||||
// pull out static expression for evaluation on the host cpu
|
||||
//
|
||||
// D3DCOMPILE_AVOID_FLOW_CONTROL
|
||||
// Hint compiler to avoid flow-control constructs where possible.
|
||||
//
|
||||
// D3DCOMPILE_PREFER_FLOW_CONTROL
|
||||
// Hint compiler to prefer flow-control constructs where possible.
|
||||
//
|
||||
// D3DCOMPILE_ENABLE_STRICTNESS
|
||||
// By default, the HLSL/Effect compilers are not strict on deprecated syntax.
|
||||
// Specifying this flag enables the strict mode. Deprecated syntax may be
|
||||
// removed in a future release, and enabling syntax is a good way to make
|
||||
// sure your shaders comply to the latest spec.
|
||||
//
|
||||
// D3DCOMPILE_ENABLE_BACKWARDS_COMPATIBILITY
|
||||
// This enables older shaders to compile to 4_0 targets.
|
||||
//
|
||||
// D3DCOMPILE_DEBUG_NAME_FOR_SOURCE
|
||||
// This enables a debug name to be generated based on source information.
|
||||
// It requires D3DCOMPILE_DEBUG to be set, and is exclusive with
|
||||
// D3DCOMPILE_DEBUG_NAME_FOR_BINARY.
|
||||
//
|
||||
// D3DCOMPILE_DEBUG_NAME_FOR_BINARY
|
||||
// This enables a debug name to be generated based on compiled information.
|
||||
// It requires D3DCOMPILE_DEBUG to be set, and is exclusive with
|
||||
// D3DCOMPILE_DEBUG_NAME_FOR_SOURCE.
|
||||
//
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
#define D3DCOMPILE_DEBUG (1 << 0)
|
||||
#define D3DCOMPILE_SKIP_VALIDATION (1 << 1)
|
||||
#define D3DCOMPILE_SKIP_OPTIMIZATION (1 << 2)
|
||||
#define D3DCOMPILE_PACK_MATRIX_ROW_MAJOR (1 << 3)
|
||||
#define D3DCOMPILE_PACK_MATRIX_COLUMN_MAJOR (1 << 4)
|
||||
#define D3DCOMPILE_PARTIAL_PRECISION (1 << 5)
|
||||
#define D3DCOMPILE_FORCE_VS_SOFTWARE_NO_OPT (1 << 6)
|
||||
#define D3DCOMPILE_FORCE_PS_SOFTWARE_NO_OPT (1 << 7)
|
||||
#define D3DCOMPILE_NO_PRESHADER (1 << 8)
|
||||
#define D3DCOMPILE_AVOID_FLOW_CONTROL (1 << 9)
|
||||
#define D3DCOMPILE_PREFER_FLOW_CONTROL (1 << 10)
|
||||
#define D3DCOMPILE_ENABLE_STRICTNESS (1 << 11)
|
||||
#define D3DCOMPILE_ENABLE_BACKWARDS_COMPATIBILITY (1 << 12)
|
||||
#define D3DCOMPILE_IEEE_STRICTNESS (1 << 13)
|
||||
#define D3DCOMPILE_OPTIMIZATION_LEVEL0 (1 << 14)
|
||||
#define D3DCOMPILE_OPTIMIZATION_LEVEL1 0
|
||||
#define D3DCOMPILE_OPTIMIZATION_LEVEL2 ((1 << 14) | (1 << 15))
|
||||
#define D3DCOMPILE_OPTIMIZATION_LEVEL3 (1 << 15)
|
||||
#define D3DCOMPILE_RESERVED16 (1 << 16)
|
||||
#define D3DCOMPILE_RESERVED17 (1 << 17)
|
||||
#define D3DCOMPILE_WARNINGS_ARE_ERRORS (1 << 18)
|
||||
#define D3DCOMPILE_RESOURCES_MAY_ALIAS (1 << 19)
|
||||
#define D3DCOMPILE_ENABLE_UNBOUNDED_DESCRIPTOR_TABLES (1 << 20)
|
||||
#define D3DCOMPILE_ALL_RESOURCES_BOUND (1 << 21)
|
||||
#define D3DCOMPILE_DEBUG_NAME_FOR_SOURCE (1 << 22)
|
||||
#define D3DCOMPILE_DEBUG_NAME_FOR_BINARY (1 << 23)
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// D3DCOMPILE_EFFECT flags:
|
||||
// -------------------------------------
|
||||
// These flags are passed in when creating an effect, and affect
|
||||
// either compilation behavior or runtime effect behavior
|
||||
//
|
||||
// D3DCOMPILE_EFFECT_CHILD_EFFECT
|
||||
// Compile this .fx file to a child effect. Child effects have no
|
||||
// initializers for any shared values as these are initialied in the
|
||||
// master effect (pool).
|
||||
//
|
||||
// D3DCOMPILE_EFFECT_ALLOW_SLOW_OPS
|
||||
// By default, performance mode is enabled. Performance mode
|
||||
// disallows mutable state objects by preventing non-literal
|
||||
// expressions from appearing in state object definitions.
|
||||
// Specifying this flag will disable the mode and allow for mutable
|
||||
// state objects.
|
||||
//
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
#define D3DCOMPILE_EFFECT_CHILD_EFFECT (1 << 0)
|
||||
#define D3DCOMPILE_EFFECT_ALLOW_SLOW_OPS (1 << 1)
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// D3DCOMPILE Flags2:
|
||||
// -----------------
|
||||
// Root signature flags. (passed in Flags2)
|
||||
#define D3DCOMPILE_FLAGS2_FORCE_ROOT_SIGNATURE_LATEST 0
|
||||
#define D3DCOMPILE_FLAGS2_FORCE_ROOT_SIGNATURE_1_0 (1 << 4)
|
||||
#define D3DCOMPILE_FLAGS2_FORCE_ROOT_SIGNATURE_1_1 (1 << 5)
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// D3DCompile:
|
||||
// ----------
|
||||
// Compile source text into bytecode appropriate for the given target.
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
// D3D_COMPILE_STANDARD_FILE_INCLUDE can be passed for pInclude in any
|
||||
// API and indicates that a simple default include handler should be
|
||||
// used. The include handler will include files relative to the
|
||||
// current directory and files relative to the directory of the initial source
|
||||
// file. When used with APIs like D3DCompile pSourceName must be a
|
||||
// file name and the initial relative directory will be derived from it.
|
||||
#define D3D_COMPILE_STANDARD_FILE_INCLUDE ((ID3DInclude*)(UINT_PTR)1)
|
||||
|
||||
HRESULT WINAPI
|
||||
D3DCompile(_In_reads_bytes_(SrcDataSize) LPCVOID pSrcData,
|
||||
_In_ SIZE_T SrcDataSize,
|
||||
_In_opt_ LPCSTR pSourceName,
|
||||
_In_reads_opt_(_Inexpressible_(pDefines->Name != NULL)) CONST D3D_SHADER_MACRO* pDefines,
|
||||
_In_opt_ ID3DInclude* pInclude,
|
||||
_In_opt_ LPCSTR pEntrypoint,
|
||||
_In_ LPCSTR pTarget,
|
||||
_In_ UINT Flags1,
|
||||
_In_ UINT Flags2,
|
||||
_Out_ ID3DBlob** ppCode,
|
||||
_Always_(_Outptr_opt_result_maybenull_) ID3DBlob** ppErrorMsgs);
|
||||
|
||||
typedef HRESULT (WINAPI *pD3DCompile)
|
||||
(LPCVOID pSrcData,
|
||||
SIZE_T SrcDataSize,
|
||||
LPCSTR pFileName,
|
||||
CONST D3D_SHADER_MACRO* pDefines,
|
||||
ID3DInclude* pInclude,
|
||||
LPCSTR pEntrypoint,
|
||||
LPCSTR pTarget,
|
||||
UINT Flags1,
|
||||
UINT Flags2,
|
||||
ID3DBlob** ppCode,
|
||||
ID3DBlob** ppErrorMsgs);
|
||||
|
||||
#define D3DCOMPILE_SECDATA_MERGE_UAV_SLOTS 0x00000001
|
||||
#define D3DCOMPILE_SECDATA_PRESERVE_TEMPLATE_SLOTS 0x00000002
|
||||
#define D3DCOMPILE_SECDATA_REQUIRE_TEMPLATE_MATCH 0x00000004
|
||||
|
||||
HRESULT WINAPI
|
||||
D3DCompile2(_In_reads_bytes_(SrcDataSize) LPCVOID pSrcData,
|
||||
_In_ SIZE_T SrcDataSize,
|
||||
_In_opt_ LPCSTR pSourceName,
|
||||
_In_reads_opt_(_Inexpressible_(pDefines->Name != NULL)) CONST D3D_SHADER_MACRO* pDefines,
|
||||
_In_opt_ ID3DInclude* pInclude,
|
||||
_In_ LPCSTR pEntrypoint,
|
||||
_In_ LPCSTR pTarget,
|
||||
_In_ UINT Flags1,
|
||||
_In_ UINT Flags2,
|
||||
_In_ UINT SecondaryDataFlags,
|
||||
_In_reads_bytes_opt_(SecondaryDataSize) LPCVOID pSecondaryData,
|
||||
_In_ SIZE_T SecondaryDataSize,
|
||||
_Out_ ID3DBlob** ppCode,
|
||||
_Always_(_Outptr_opt_result_maybenull_) ID3DBlob** ppErrorMsgs);
|
||||
|
||||
HRESULT WINAPI
|
||||
D3DCompileFromFile(_In_ LPCWSTR pFileName,
|
||||
_In_reads_opt_(_Inexpressible_(pDefines->Name != NULL)) CONST D3D_SHADER_MACRO* pDefines,
|
||||
_In_opt_ ID3DInclude* pInclude,
|
||||
_In_ LPCSTR pEntrypoint,
|
||||
_In_ LPCSTR pTarget,
|
||||
_In_ UINT Flags1,
|
||||
_In_ UINT Flags2,
|
||||
_Out_ ID3DBlob** ppCode,
|
||||
_Always_(_Outptr_opt_result_maybenull_) ID3DBlob** ppErrorMsgs);
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// D3DPreprocess:
|
||||
// -------------
|
||||
// Process source text with the compiler's preprocessor and return
|
||||
// the resulting text.
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
HRESULT WINAPI
|
||||
D3DPreprocess(_In_reads_bytes_(SrcDataSize) LPCVOID pSrcData,
|
||||
_In_ SIZE_T SrcDataSize,
|
||||
_In_opt_ LPCSTR pSourceName,
|
||||
_In_opt_ CONST D3D_SHADER_MACRO* pDefines,
|
||||
_In_opt_ ID3DInclude* pInclude,
|
||||
_Out_ ID3DBlob** ppCodeText,
|
||||
_Always_(_Outptr_opt_result_maybenull_) ID3DBlob** ppErrorMsgs);
|
||||
|
||||
typedef HRESULT (WINAPI *pD3DPreprocess)
|
||||
(LPCVOID pSrcData,
|
||||
SIZE_T SrcDataSize,
|
||||
LPCSTR pFileName,
|
||||
CONST D3D_SHADER_MACRO* pDefines,
|
||||
ID3DInclude* pInclude,
|
||||
ID3DBlob** ppCodeText,
|
||||
ID3DBlob** ppErrorMsgs);
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// D3DGetDebugInfo:
|
||||
// -----------------------
|
||||
// Gets shader debug info. Debug info is generated by D3DCompile and is
|
||||
// embedded in the body of the shader.
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
HRESULT WINAPI
|
||||
D3DGetDebugInfo(_In_reads_bytes_(SrcDataSize) LPCVOID pSrcData,
|
||||
_In_ SIZE_T SrcDataSize,
|
||||
_Out_ ID3DBlob** ppDebugInfo);
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// D3DReflect:
|
||||
// ----------
|
||||
// Shader code contains metadata that can be inspected via the
|
||||
// reflection APIs.
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
HRESULT WINAPI
|
||||
D3DReflect(_In_reads_bytes_(SrcDataSize) LPCVOID pSrcData,
|
||||
_In_ SIZE_T SrcDataSize,
|
||||
_In_ REFIID pInterface,
|
||||
_Out_ void** ppReflector);
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// D3DReflectLibrary:
|
||||
// ----------
|
||||
// Library code contains metadata that can be inspected via the library
|
||||
// reflection APIs.
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
HRESULT WINAPI
|
||||
D3DReflectLibrary(__in_bcount(SrcDataSize) LPCVOID pSrcData,
|
||||
__in SIZE_T SrcDataSize,
|
||||
__in REFIID riid,
|
||||
__out LPVOID * ppReflector);
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// D3DDisassemble:
|
||||
// ----------------------
|
||||
// Takes a binary shader and returns a buffer containing text assembly.
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
#define D3D_DISASM_ENABLE_COLOR_CODE 0x00000001
|
||||
#define D3D_DISASM_ENABLE_DEFAULT_VALUE_PRINTS 0x00000002
|
||||
#define D3D_DISASM_ENABLE_INSTRUCTION_NUMBERING 0x00000004
|
||||
#define D3D_DISASM_ENABLE_INSTRUCTION_CYCLE 0x00000008
|
||||
#define D3D_DISASM_DISABLE_DEBUG_INFO 0x00000010
|
||||
#define D3D_DISASM_ENABLE_INSTRUCTION_OFFSET 0x00000020
|
||||
#define D3D_DISASM_INSTRUCTION_ONLY 0x00000040
|
||||
#define D3D_DISASM_PRINT_HEX_LITERALS 0x00000080
|
||||
|
||||
HRESULT WINAPI
|
||||
D3DDisassemble(_In_reads_bytes_(SrcDataSize) LPCVOID pSrcData,
|
||||
_In_ SIZE_T SrcDataSize,
|
||||
_In_ UINT Flags,
|
||||
_In_opt_ LPCSTR szComments,
|
||||
_Out_ ID3DBlob** ppDisassembly);
|
||||
|
||||
typedef HRESULT (WINAPI *pD3DDisassemble)
|
||||
(_In_reads_bytes_(SrcDataSize) LPCVOID pSrcData,
|
||||
_In_ SIZE_T SrcDataSize,
|
||||
_In_ UINT Flags,
|
||||
_In_opt_ LPCSTR szComments,
|
||||
_Out_ ID3DBlob** ppDisassembly);
|
||||
|
||||
HRESULT WINAPI
|
||||
D3DDisassembleRegion(_In_reads_bytes_(SrcDataSize) LPCVOID pSrcData,
|
||||
_In_ SIZE_T SrcDataSize,
|
||||
_In_ UINT Flags,
|
||||
_In_opt_ LPCSTR szComments,
|
||||
_In_ SIZE_T StartByteOffset,
|
||||
_In_ SIZE_T NumInsts,
|
||||
_Out_opt_ SIZE_T* pFinishByteOffset,
|
||||
_Out_ ID3DBlob** ppDisassembly);
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// Shader linking and Function Linking Graph (FLG) APIs
|
||||
//----------------------------------------------------------------------------
|
||||
HRESULT WINAPI
|
||||
D3DCreateLinker(__out interface ID3D11Linker ** ppLinker);
|
||||
|
||||
HRESULT WINAPI
|
||||
D3DLoadModule(_In_ LPCVOID pSrcData,
|
||||
_In_ SIZE_T cbSrcDataSize,
|
||||
_Out_ interface ID3D11Module ** ppModule);
|
||||
|
||||
HRESULT WINAPI
|
||||
D3DCreateFunctionLinkingGraph(_In_ UINT uFlags,
|
||||
_Out_ interface ID3D11FunctionLinkingGraph ** ppFunctionLinkingGraph);
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// D3DGetTraceInstructionOffsets:
|
||||
// -----------------------
|
||||
// Determines byte offsets for instructions within a shader blob.
|
||||
// This information is useful for going between trace instruction
|
||||
// indices and byte offsets that are used in debug information.
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
#define D3D_GET_INST_OFFSETS_INCLUDE_NON_EXECUTABLE 0x00000001
|
||||
|
||||
HRESULT WINAPI
|
||||
D3DGetTraceInstructionOffsets(_In_reads_bytes_(SrcDataSize) LPCVOID pSrcData,
|
||||
_In_ SIZE_T SrcDataSize,
|
||||
_In_ UINT Flags,
|
||||
_In_ SIZE_T StartInstIndex,
|
||||
_In_ SIZE_T NumInsts,
|
||||
_Out_writes_to_opt_(NumInsts, min(NumInsts, *pTotalInsts)) SIZE_T* pOffsets,
|
||||
_Out_opt_ SIZE_T* pTotalInsts);
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// D3DGetInputSignatureBlob:
|
||||
// -----------------------
|
||||
// Retrieve the input signature from a compilation result.
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
HRESULT WINAPI
|
||||
D3DGetInputSignatureBlob(_In_reads_bytes_(SrcDataSize) LPCVOID pSrcData,
|
||||
_In_ SIZE_T SrcDataSize,
|
||||
_Out_ ID3DBlob** ppSignatureBlob);
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// D3DGetOutputSignatureBlob:
|
||||
// -----------------------
|
||||
// Retrieve the output signature from a compilation result.
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
HRESULT WINAPI
|
||||
D3DGetOutputSignatureBlob(_In_reads_bytes_(SrcDataSize) LPCVOID pSrcData,
|
||||
_In_ SIZE_T SrcDataSize,
|
||||
_Out_ ID3DBlob** ppSignatureBlob);
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// D3DGetInputAndOutputSignatureBlob:
|
||||
// -----------------------
|
||||
// Retrieve the input and output signatures from a compilation result.
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
HRESULT WINAPI
|
||||
D3DGetInputAndOutputSignatureBlob(_In_reads_bytes_(SrcDataSize) LPCVOID pSrcData,
|
||||
_In_ SIZE_T SrcDataSize,
|
||||
_Out_ ID3DBlob** ppSignatureBlob);
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// D3DStripShader:
|
||||
// -----------------------
|
||||
// Removes unwanted blobs from a compilation result
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
typedef enum D3DCOMPILER_STRIP_FLAGS
|
||||
{
|
||||
D3DCOMPILER_STRIP_REFLECTION_DATA = 0x00000001,
|
||||
D3DCOMPILER_STRIP_DEBUG_INFO = 0x00000002,
|
||||
D3DCOMPILER_STRIP_TEST_BLOBS = 0x00000004,
|
||||
D3DCOMPILER_STRIP_PRIVATE_DATA = 0x00000008,
|
||||
D3DCOMPILER_STRIP_ROOT_SIGNATURE = 0x00000010,
|
||||
D3DCOMPILER_STRIP_FORCE_DWORD = 0x7fffffff,
|
||||
} D3DCOMPILER_STRIP_FLAGS;
|
||||
|
||||
HRESULT WINAPI
|
||||
D3DStripShader(_In_reads_bytes_(BytecodeLength) LPCVOID pShaderBytecode,
|
||||
_In_ SIZE_T BytecodeLength,
|
||||
_In_ UINT uStripFlags,
|
||||
_Out_ ID3DBlob** ppStrippedBlob);
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// D3DGetBlobPart:
|
||||
// -----------------------
|
||||
// Extracts information from a compilation result.
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
typedef enum D3D_BLOB_PART
|
||||
{
|
||||
D3D_BLOB_INPUT_SIGNATURE_BLOB,
|
||||
D3D_BLOB_OUTPUT_SIGNATURE_BLOB,
|
||||
D3D_BLOB_INPUT_AND_OUTPUT_SIGNATURE_BLOB,
|
||||
D3D_BLOB_PATCH_CONSTANT_SIGNATURE_BLOB,
|
||||
D3D_BLOB_ALL_SIGNATURE_BLOB,
|
||||
D3D_BLOB_DEBUG_INFO,
|
||||
D3D_BLOB_LEGACY_SHADER,
|
||||
D3D_BLOB_XNA_PREPASS_SHADER,
|
||||
D3D_BLOB_XNA_SHADER,
|
||||
D3D_BLOB_PDB,
|
||||
D3D_BLOB_PRIVATE_DATA,
|
||||
D3D_BLOB_ROOT_SIGNATURE,
|
||||
D3D_BLOB_DEBUG_NAME,
|
||||
|
||||
// Test parts are only produced by special compiler versions and so
|
||||
// are usually not present in shaders.
|
||||
D3D_BLOB_TEST_ALTERNATE_SHADER = 0x8000,
|
||||
D3D_BLOB_TEST_COMPILE_DETAILS,
|
||||
D3D_BLOB_TEST_COMPILE_PERF,
|
||||
D3D_BLOB_TEST_COMPILE_REPORT,
|
||||
} D3D_BLOB_PART;
|
||||
|
||||
HRESULT WINAPI
|
||||
D3DGetBlobPart(_In_reads_bytes_(SrcDataSize) LPCVOID pSrcData,
|
||||
_In_ SIZE_T SrcDataSize,
|
||||
_In_ D3D_BLOB_PART Part,
|
||||
_In_ UINT Flags,
|
||||
_Out_ ID3DBlob** ppPart);
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// D3DSetBlobPart:
|
||||
// -----------------------
|
||||
// Update information in a compilation result.
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
HRESULT WINAPI
|
||||
D3DSetBlobPart(_In_reads_bytes_(SrcDataSize) LPCVOID pSrcData,
|
||||
_In_ SIZE_T SrcDataSize,
|
||||
_In_ D3D_BLOB_PART Part,
|
||||
_In_ UINT Flags,
|
||||
_In_reads_bytes_(PartSize) LPCVOID pPart,
|
||||
_In_ SIZE_T PartSize,
|
||||
_Out_ ID3DBlob** ppNewShader);
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// D3DCreateBlob:
|
||||
// -----------------------
|
||||
// Create an ID3DBlob instance.
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
HRESULT WINAPI
|
||||
D3DCreateBlob(_In_ SIZE_T Size,
|
||||
_Out_ ID3DBlob** ppBlob);
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// D3DCompressShaders:
|
||||
// -----------------------
|
||||
// Compresses a set of shaders into a more compact form.
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
typedef struct _D3D_SHADER_DATA
|
||||
{
|
||||
LPCVOID pBytecode;
|
||||
SIZE_T BytecodeLength;
|
||||
} D3D_SHADER_DATA;
|
||||
|
||||
#define D3D_COMPRESS_SHADER_KEEP_ALL_PARTS 0x00000001
|
||||
|
||||
HRESULT WINAPI
|
||||
D3DCompressShaders(_In_ UINT uNumShaders,
|
||||
_In_reads_(uNumShaders) D3D_SHADER_DATA* pShaderData,
|
||||
_In_ UINT uFlags,
|
||||
_Out_ ID3DBlob** ppCompressedData);
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// D3DDecompressShaders:
|
||||
// -----------------------
|
||||
// Decompresses one or more shaders from a compressed set.
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
HRESULT WINAPI
|
||||
D3DDecompressShaders(_In_reads_bytes_(SrcDataSize) LPCVOID pSrcData,
|
||||
_In_ SIZE_T SrcDataSize,
|
||||
_In_ UINT uNumShaders,
|
||||
_In_ UINT uStartIndex,
|
||||
_In_reads_opt_(uNumShaders) UINT* pIndices,
|
||||
_In_ UINT uFlags,
|
||||
_Out_writes_(uNumShaders) ID3DBlob** ppShaders,
|
||||
_Out_opt_ UINT* pTotalShaders);
|
||||
|
||||
#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP | WINAPI_PARTITION_GAMES) */
|
||||
#pragma endregion
|
||||
|
||||
|
||||
#pragma region Desktop Family
|
||||
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// D3DDisassemble10Effect:
|
||||
// -----------------------
|
||||
// Takes a D3D10 effect interface and returns a
|
||||
// buffer containing text assembly.
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
HRESULT WINAPI
|
||||
D3DDisassemble10Effect(_In_ interface ID3D10Effect *pEffect,
|
||||
_In_ UINT Flags,
|
||||
_Out_ ID3DBlob** ppDisassembly);
|
||||
|
||||
#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) */
|
||||
#pragma endregion
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif //__cplusplus
|
||||
|
||||
#endif // #ifndef __D3DCOMPILER_H__
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -59,11 +59,15 @@
|
|||
|
||||
// Convenience macros for endian conversions
|
||||
#if IS_BIG_ENDIAN
|
||||
#define BE_TO_HOST16(x) (x)
|
||||
#define BE_TO_HOST32(x) (x)
|
||||
# define BE_TO_HOST16(x) (x)
|
||||
# define BE_TO_HOST32(x) (x)
|
||||
# define LE_TO_HOST16(x) BSWAP16(x)
|
||||
# define LE_TO_HOST32(x) BSWAP32(x)
|
||||
#else
|
||||
#define BE_TO_HOST16(x) BSWAP16(x)
|
||||
#define BE_TO_HOST32(x) BSWAP32(x)
|
||||
# define BE_TO_HOST16(x) BSWAP16(x)
|
||||
# define BE_TO_HOST32(x) BSWAP32(x)
|
||||
# define LE_TO_HOST16(x) (x)
|
||||
# define LE_TO_HOST32(x) (x)
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
|
@ -47,10 +47,15 @@
|
|||
#define TEXT_OPT_NEAREST _("NEAREST")
|
||||
#define TEXT_OPT_LINEAR _("LINEAR")
|
||||
#define TEXT_OPT_MVOLUME _("MASTER VOLUME")
|
||||
#define TEXT_OPT_MUSVOLUME _("MUSIC VOLUME")
|
||||
#define TEXT_OPT_SFXVOLUME _("SFX VOLUME")
|
||||
#define TEXT_OPT_ENVVOLUME _("ENV VOLUME")
|
||||
#define TEXT_OPT_VSYNC _("VERTICAL SYNC")
|
||||
#define TEXT_OPT_DOUBLE _("DOUBLE")
|
||||
#define TEXT_RESET_WINDOW _("RESET WINDOW")
|
||||
#define TEXT_OPT_HUD _("HUD")
|
||||
#define TEXT_OPT_THREEPT _("THREE POINT")
|
||||
#define TEXT_OPT_APPLY _("APPLY")
|
||||
#define TEXT_OPT_RESETWND _("RESET WINDOW")
|
||||
|
||||
#define TEXT_BIND_A _("A BUTTON")
|
||||
#define TEXT_BIND_B _("B BUTTON")
|
||||
|
@ -120,10 +125,15 @@
|
|||
#define TEXT_OPT_NEAREST _("Nearest")
|
||||
#define TEXT_OPT_LINEAR _("Linear")
|
||||
#define TEXT_OPT_MVOLUME _("Master Volume")
|
||||
#define TEXT_OPT_MUSVOLUME _("Music Volume")
|
||||
#define TEXT_OPT_SFXVOLUME _("Sfx Volume")
|
||||
#define TEXT_OPT_ENVVOLUME _("Env Volume")
|
||||
#define TEXT_OPT_VSYNC _("Vertical Sync")
|
||||
#define TEXT_OPT_DOUBLE _("Double")
|
||||
#define TEXT_RESET_WINDOW _("Reset Window")
|
||||
#define TEXT_OPT_HUD _("HUD")
|
||||
#define TEXT_OPT_THREEPT _("Three-point")
|
||||
#define TEXT_OPT_APPLY _("Apply")
|
||||
#define TEXT_OPT_RESETWND _("Reset Window")
|
||||
|
||||
#define TEXT_BIND_A _("A Button")
|
||||
#define TEXT_BIND_B _("B Button")
|
||||
|
|
|
@ -0,0 +1,724 @@
|
|||
/* tinfl.c v1.11 - public domain inflate with zlib header parsing/adler32 checking (inflate-only subset of miniz.c)
|
||||
See "unlicense" statement at the end of this file.
|
||||
Rich Geldreich <richgel99@gmail.com>, last updated May 20, 2011
|
||||
Implements RFC 1950: https://www.ietf.org/rfc/rfc1950.txt and RFC 1951: https://www.ietf.org/rfc/rfc1951.txt
|
||||
|
||||
The entire decompressor coroutine is implemented in tinfl_decompress(). The other functions are optional high-level helpers.
|
||||
*/
|
||||
#ifndef TINFL_HEADER_INCLUDED
|
||||
#define TINFL_HEADER_INCLUDED
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
typedef uint8_t mz_uint8;
|
||||
typedef int16_t mz_int16;
|
||||
typedef uint16_t mz_uint16;
|
||||
typedef uint32_t mz_uint32;
|
||||
typedef unsigned int mz_uint;
|
||||
typedef uint64_t mz_uint64;
|
||||
|
||||
/* For more compatibility with zlib, miniz.c uses unsigned long for some parameters/struct members. */
|
||||
typedef unsigned long mz_ulong;
|
||||
|
||||
/* Heap allocation callbacks. */
|
||||
typedef void *(*mz_alloc_func)(void *opaque, unsigned int items, unsigned int size);
|
||||
typedef void (*mz_free_func)(void *opaque, void *address);
|
||||
|
||||
#if defined(_M_IX86) || defined(_M_X64)
|
||||
/* Set MINIZ_USE_UNALIGNED_LOADS_AND_STORES to 1 if integer loads and stores to unaligned addresses are acceptable on the target platform (slightly faster). */
|
||||
#define MINIZ_USE_UNALIGNED_LOADS_AND_STORES 1
|
||||
/* Set MINIZ_LITTLE_ENDIAN to 1 if the processor is little endian. */
|
||||
#define MINIZ_LITTLE_ENDIAN 1
|
||||
#endif
|
||||
|
||||
#if defined(_WIN64) || defined(__MINGW64__) || defined(_LP64) || defined(__LP64__)
|
||||
/* Set MINIZ_HAS_64BIT_REGISTERS to 1 if the processor has 64-bit general purpose registers (enables 64-bit bitbuffer in inflator) */
|
||||
#define MINIZ_HAS_64BIT_REGISTERS 1
|
||||
#endif
|
||||
|
||||
/* Works around MSVC's spammy "warning C4127: conditional expression is constant" message. */
|
||||
#ifdef _MSC_VER
|
||||
#define MZ_MACRO_END while (0, 0)
|
||||
#else
|
||||
#define MZ_MACRO_END while (0)
|
||||
#endif
|
||||
|
||||
/* Decompression flags. */
|
||||
enum
|
||||
{
|
||||
TINFL_FLAG_PARSE_ZLIB_HEADER = 1,
|
||||
TINFL_FLAG_HAS_MORE_INPUT = 2,
|
||||
TINFL_FLAG_USING_NON_WRAPPING_OUTPUT_BUF = 4,
|
||||
TINFL_FLAG_COMPUTE_ADLER32 = 8
|
||||
};
|
||||
|
||||
struct tinfl_decompressor_tag; typedef struct tinfl_decompressor_tag tinfl_decompressor;
|
||||
|
||||
/* Max size of LZ dictionary. */
|
||||
#define TINFL_LZ_DICT_SIZE 32768
|
||||
|
||||
/* Return status. */
|
||||
typedef enum
|
||||
{
|
||||
TINFL_STATUS_BAD_PARAM = -3,
|
||||
TINFL_STATUS_ADLER32_MISMATCH = -2,
|
||||
TINFL_STATUS_FAILED = -1,
|
||||
TINFL_STATUS_DONE = 0,
|
||||
TINFL_STATUS_NEEDS_MORE_INPUT = 1,
|
||||
TINFL_STATUS_HAS_MORE_OUTPUT = 2
|
||||
} tinfl_status;
|
||||
|
||||
/* Initializes the decompressor to its initial state. */
|
||||
#define tinfl_init(r) do { (r)->m_state = 0; } MZ_MACRO_END
|
||||
#define tinfl_get_adler32(r) (r)->m_check_adler32
|
||||
|
||||
/* Main low-level decompressor coroutine function. This is the only function actually needed for decompression. All the other functions are just high-level helpers for improved usability. */
|
||||
/* This is a universal API, i.e. it can be used as a building block to build any desired higher level decompression API. In the limit case, it can be called once per every byte input or output. */
|
||||
static tinfl_status tinfl_decompress(tinfl_decompressor *r, const mz_uint8 *pIn_buf_next, size_t *pIn_buf_size, mz_uint8 *pOut_buf_start, mz_uint8 *pOut_buf_next, size_t *pOut_buf_size, const mz_uint32 decomp_flags);
|
||||
|
||||
/* Internal/private bits follow. */
|
||||
enum
|
||||
{
|
||||
TINFL_MAX_HUFF_TABLES = 3, TINFL_MAX_HUFF_SYMBOLS_0 = 288, TINFL_MAX_HUFF_SYMBOLS_1 = 32, TINFL_MAX_HUFF_SYMBOLS_2 = 19,
|
||||
TINFL_FAST_LOOKUP_BITS = 10, TINFL_FAST_LOOKUP_SIZE = 1 << TINFL_FAST_LOOKUP_BITS
|
||||
};
|
||||
|
||||
typedef struct
|
||||
{
|
||||
mz_uint8 m_code_size[TINFL_MAX_HUFF_SYMBOLS_0];
|
||||
mz_int16 m_look_up[TINFL_FAST_LOOKUP_SIZE], m_tree[TINFL_MAX_HUFF_SYMBOLS_0 * 2];
|
||||
} tinfl_huff_table;
|
||||
|
||||
#if MINIZ_HAS_64BIT_REGISTERS
|
||||
#define TINFL_USE_64BIT_BITBUF 1
|
||||
#endif
|
||||
|
||||
#if TINFL_USE_64BIT_BITBUF
|
||||
typedef mz_uint64 tinfl_bit_buf_t;
|
||||
#define TINFL_BITBUF_SIZE (64)
|
||||
#else
|
||||
typedef mz_uint32 tinfl_bit_buf_t;
|
||||
#define TINFL_BITBUF_SIZE (32)
|
||||
#endif
|
||||
|
||||
struct tinfl_decompressor_tag
|
||||
{
|
||||
mz_uint32 m_state, m_num_bits, m_zhdr0, m_zhdr1, m_z_adler32, m_final, m_type, m_check_adler32, m_dist, m_counter, m_num_extra, m_table_sizes[TINFL_MAX_HUFF_TABLES];
|
||||
tinfl_bit_buf_t m_bit_buf;
|
||||
size_t m_dist_from_out_buf_start;
|
||||
tinfl_huff_table m_tables[TINFL_MAX_HUFF_TABLES];
|
||||
mz_uint8 m_raw_header[4], m_len_codes[TINFL_MAX_HUFF_SYMBOLS_0 + TINFL_MAX_HUFF_SYMBOLS_1 + 137];
|
||||
};
|
||||
|
||||
#endif /* #ifdef TINFL_HEADER_INCLUDED */
|
||||
|
||||
/* ------------------- End of Header: Implementation follows. (If you only want the header, define MINIZ_HEADER_FILE_ONLY.) */
|
||||
|
||||
#ifndef TINFL_HEADER_FILE_ONLY
|
||||
|
||||
#ifdef MINIZ_NO_MALLOC
|
||||
#define MZ_MALLOC(x) NULL
|
||||
#define MZ_FREE(x) x, ((void)0)
|
||||
#define MZ_REALLOC(p, x) NULL
|
||||
#else
|
||||
#define MZ_MALLOC(x) malloc(x)
|
||||
#define MZ_FREE(x) free(x)
|
||||
#define MZ_REALLOC(p, x) realloc(p, x)
|
||||
#endif
|
||||
|
||||
#define MZ_MAX(a,b) (((a)>(b))?(a):(b))
|
||||
#define MZ_MIN(a,b) (((a)<(b))?(a):(b))
|
||||
#define MZ_CLEAR_OBJ(obj) memset(&(obj), 0, sizeof(obj))
|
||||
|
||||
#if MINIZ_USE_UNALIGNED_LOADS_AND_STORES && MINIZ_LITTLE_ENDIAN
|
||||
#define MZ_READ_LE16(p) *((const mz_uint16 *)(p))
|
||||
#define MZ_READ_LE32(p) *((const mz_uint32 *)(p))
|
||||
#else
|
||||
#define MZ_READ_LE16(p) ((mz_uint32)(((const mz_uint8 *)(p))[0]) | ((mz_uint32)(((const mz_uint8 *)(p))[1]) << 8U))
|
||||
#define MZ_READ_LE32(p) ((mz_uint32)(((const mz_uint8 *)(p))[0]) | ((mz_uint32)(((const mz_uint8 *)(p))[1]) << 8U) | ((mz_uint32)(((const mz_uint8 *)(p))[2]) << 16U) | ((mz_uint32)(((const mz_uint8 *)(p))[3]) << 24U))
|
||||
#endif
|
||||
|
||||
#define TINFL_MEMCPY(d, s, l) memcpy(d, s, l)
|
||||
#define TINFL_MEMSET(p, c, l) memset(p, c, l)
|
||||
|
||||
#define TINFL_CR_BEGIN switch(r->m_state) { case 0:
|
||||
#define TINFL_CR_RETURN(state_index, result) do { status = result; r->m_state = state_index; goto common_exit; case state_index:; } MZ_MACRO_END
|
||||
#define TINFL_CR_RETURN_FOREVER(state_index, result) do { for ( ; ; ) { TINFL_CR_RETURN(state_index, result); } } MZ_MACRO_END
|
||||
#define TINFL_CR_FINISH }
|
||||
|
||||
/* TODO: If the caller has indicated that there's no more input, and we attempt to read beyond the input buf, then something is wrong with the input because the inflator never */
|
||||
/* reads ahead more than it needs to. Currently TINFL_GET_BYTE() pads the end of the stream with 0's in this scenario. */
|
||||
#define TINFL_GET_BYTE(state_index, c) do { \
|
||||
if (pIn_buf_cur >= pIn_buf_end) { \
|
||||
for ( ; ; ) { \
|
||||
if (decomp_flags & TINFL_FLAG_HAS_MORE_INPUT) { \
|
||||
TINFL_CR_RETURN(state_index, TINFL_STATUS_NEEDS_MORE_INPUT); \
|
||||
if (pIn_buf_cur < pIn_buf_end) { \
|
||||
c = *pIn_buf_cur++; \
|
||||
break; \
|
||||
} \
|
||||
} else { \
|
||||
c = 0; \
|
||||
break; \
|
||||
} \
|
||||
} \
|
||||
} else c = *pIn_buf_cur++; } MZ_MACRO_END
|
||||
|
||||
#define TINFL_NEED_BITS(state_index, n) do { mz_uint c; TINFL_GET_BYTE(state_index, c); bit_buf |= (((tinfl_bit_buf_t)c) << num_bits); num_bits += 8; } while (num_bits < (mz_uint)(n))
|
||||
#define TINFL_SKIP_BITS(state_index, n) do { if (num_bits < (mz_uint)(n)) { TINFL_NEED_BITS(state_index, n); } bit_buf >>= (n); num_bits -= (n); } MZ_MACRO_END
|
||||
#define TINFL_GET_BITS(state_index, b, n) do { if (num_bits < (mz_uint)(n)) { TINFL_NEED_BITS(state_index, n); } b = bit_buf & ((1 << (n)) - 1); bit_buf >>= (n); num_bits -= (n); } MZ_MACRO_END
|
||||
|
||||
/* TINFL_HUFF_BITBUF_FILL() is only used rarely, when the number of bytes remaining in the input buffer falls below 2. */
|
||||
/* It reads just enough bytes from the input stream that are needed to decode the next Huffman code (and absolutely no more). It works by trying to fully decode a */
|
||||
/* Huffman code by using whatever bits are currently present in the bit buffer. If this fails, it reads another byte, and tries again until it succeeds or until the */
|
||||
/* bit buffer contains >=15 bits (deflate's max. Huffman code size). */
|
||||
#define TINFL_HUFF_BITBUF_FILL(state_index, pHuff) \
|
||||
do { \
|
||||
temp = (pHuff)->m_look_up[bit_buf & (TINFL_FAST_LOOKUP_SIZE - 1)]; \
|
||||
if (temp >= 0) { \
|
||||
code_len = temp >> 9; \
|
||||
if ((code_len) && (num_bits >= code_len)) \
|
||||
break; \
|
||||
} else if (num_bits > TINFL_FAST_LOOKUP_BITS) { \
|
||||
code_len = TINFL_FAST_LOOKUP_BITS; \
|
||||
do { \
|
||||
temp = (pHuff)->m_tree[~temp + ((bit_buf >> code_len++) & 1)]; \
|
||||
} while ((temp < 0) && (num_bits >= (code_len + 1))); if (temp >= 0) break; \
|
||||
} TINFL_GET_BYTE(state_index, c); bit_buf |= (((tinfl_bit_buf_t)c) << num_bits); num_bits += 8; \
|
||||
} while (num_bits < 15);
|
||||
|
||||
/* TINFL_HUFF_DECODE() decodes the next Huffman coded symbol. It's more complex than you would initially expect because the zlib API expects the decompressor to never read */
|
||||
/* beyond the final byte of the deflate stream. (In other words, when this macro wants to read another byte from the input, it REALLY needs another byte in order to fully */
|
||||
/* decode the next Huffman code.) Handling this properly is particularly important on raw deflate (non-zlib) streams, which aren't followed by a byte aligned adler-32. */
|
||||
/* The slow path is only executed at the very end of the input buffer. */
|
||||
#define TINFL_HUFF_DECODE(state_index, sym, pHuff) do { \
|
||||
int temp; mz_uint code_len, c; \
|
||||
if (num_bits < 15) { \
|
||||
if ((pIn_buf_end - pIn_buf_cur) < 2) { \
|
||||
TINFL_HUFF_BITBUF_FILL(state_index, pHuff); \
|
||||
} else { \
|
||||
bit_buf |= (((tinfl_bit_buf_t)pIn_buf_cur[0]) << num_bits) | (((tinfl_bit_buf_t)pIn_buf_cur[1]) << (num_bits + 8)); pIn_buf_cur += 2; num_bits += 16; \
|
||||
} \
|
||||
} \
|
||||
if ((temp = (pHuff)->m_look_up[bit_buf & (TINFL_FAST_LOOKUP_SIZE - 1)]) >= 0) \
|
||||
code_len = temp >> 9, temp &= 511; \
|
||||
else { \
|
||||
code_len = TINFL_FAST_LOOKUP_BITS; do { temp = (pHuff)->m_tree[~temp + ((bit_buf >> code_len++) & 1)]; } while (temp < 0); \
|
||||
} sym = temp; bit_buf >>= code_len; num_bits -= code_len; } MZ_MACRO_END
|
||||
|
||||
static void tinfl_def_free_func(void *opaque, void *address) {
|
||||
(void)opaque, (void)address;
|
||||
MZ_FREE(address);
|
||||
}
|
||||
|
||||
static void *tinfl_def_alloc_func(void *opaque, unsigned int items, unsigned int size) {
|
||||
(void)opaque, (void)items, (void)size;
|
||||
return MZ_MALLOC(items * size);
|
||||
}
|
||||
|
||||
static tinfl_status tinfl_decompress(tinfl_decompressor *r, const mz_uint8 *pIn_buf_next, size_t *pIn_buf_size, mz_uint8 *pOut_buf_start, mz_uint8 *pOut_buf_next, size_t *pOut_buf_size, const mz_uint32 decomp_flags)
|
||||
{
|
||||
static const int s_length_base[31] = { 3,4,5,6,7,8,9,10,11,13, 15,17,19,23,27,31,35,43,51,59, 67,83,99,115,131,163,195,227,258,0,0 };
|
||||
static const int s_length_extra[31]= { 0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0 };
|
||||
static const int s_dist_base[32] = { 1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193, 257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0};
|
||||
static const int s_dist_extra[32] = { 0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13};
|
||||
static const mz_uint8 s_length_dezigzag[19] = { 16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15 };
|
||||
static const int s_min_table_sizes[3] = { 257, 1, 4 };
|
||||
|
||||
tinfl_status status = TINFL_STATUS_FAILED; mz_uint32 num_bits, dist, counter, num_extra; tinfl_bit_buf_t bit_buf;
|
||||
const mz_uint8 *pIn_buf_cur = pIn_buf_next, *const pIn_buf_end = pIn_buf_next + *pIn_buf_size;
|
||||
mz_uint8 *pOut_buf_cur = pOut_buf_next, *const pOut_buf_end = pOut_buf_next + *pOut_buf_size;
|
||||
size_t out_buf_size_mask = (decomp_flags & TINFL_FLAG_USING_NON_WRAPPING_OUTPUT_BUF) ? (size_t)-1 : ((pOut_buf_next - pOut_buf_start) + *pOut_buf_size) - 1, dist_from_out_buf_start;
|
||||
|
||||
/* Ensure the output buffer's size is a power of 2, unless the output buffer is large enough to hold the entire output file (in which case it doesn't matter). */
|
||||
if (((out_buf_size_mask + 1) & out_buf_size_mask) || (pOut_buf_next < pOut_buf_start)) { *pIn_buf_size = *pOut_buf_size = 0; return TINFL_STATUS_BAD_PARAM; }
|
||||
|
||||
num_bits = r->m_num_bits; bit_buf = r->m_bit_buf; dist = r->m_dist; counter = r->m_counter; num_extra = r->m_num_extra; dist_from_out_buf_start = r->m_dist_from_out_buf_start;
|
||||
TINFL_CR_BEGIN
|
||||
|
||||
bit_buf = num_bits = dist = counter = num_extra = r->m_zhdr0 = r->m_zhdr1 = 0; r->m_z_adler32 = r->m_check_adler32 = 1;
|
||||
if (decomp_flags & TINFL_FLAG_PARSE_ZLIB_HEADER)
|
||||
{
|
||||
TINFL_GET_BYTE(1, r->m_zhdr0); TINFL_GET_BYTE(2, r->m_zhdr1);
|
||||
counter = (((r->m_zhdr0 * 256 + r->m_zhdr1) % 31 != 0) || (r->m_zhdr1 & 32) || ((r->m_zhdr0 & 15) != 8));
|
||||
if (!(decomp_flags & TINFL_FLAG_USING_NON_WRAPPING_OUTPUT_BUF)) counter |= (((1U << (8U + (r->m_zhdr0 >> 4))) > 32768U) || ((out_buf_size_mask + 1) < (size_t)(1U << (8U + (r->m_zhdr0 >> 4)))));
|
||||
if (counter) { TINFL_CR_RETURN_FOREVER(36, TINFL_STATUS_FAILED); }
|
||||
}
|
||||
|
||||
do
|
||||
{
|
||||
TINFL_GET_BITS(3, r->m_final, 3); r->m_type = r->m_final >> 1;
|
||||
if (r->m_type == 0)
|
||||
{
|
||||
TINFL_SKIP_BITS(5, num_bits & 7);
|
||||
for (counter = 0; counter < 4; ++counter) { if (num_bits) TINFL_GET_BITS(6, r->m_raw_header[counter], 8); else TINFL_GET_BYTE(7, r->m_raw_header[counter]); }
|
||||
if ((counter = (r->m_raw_header[0] | (r->m_raw_header[1] << 8))) != (mz_uint)(0xFFFF ^ (r->m_raw_header[2] | (r->m_raw_header[3] << 8)))) { TINFL_CR_RETURN_FOREVER(39, TINFL_STATUS_FAILED); }
|
||||
while ((counter) && (num_bits))
|
||||
{
|
||||
TINFL_GET_BITS(51, dist, 8);
|
||||
while (pOut_buf_cur >= pOut_buf_end) { TINFL_CR_RETURN(52, TINFL_STATUS_HAS_MORE_OUTPUT); }
|
||||
*pOut_buf_cur++ = (mz_uint8)dist;
|
||||
counter--;
|
||||
}
|
||||
while (counter)
|
||||
{
|
||||
size_t n; while (pOut_buf_cur >= pOut_buf_end) { TINFL_CR_RETURN(9, TINFL_STATUS_HAS_MORE_OUTPUT); }
|
||||
while (pIn_buf_cur >= pIn_buf_end)
|
||||
{
|
||||
if (decomp_flags & TINFL_FLAG_HAS_MORE_INPUT)
|
||||
{
|
||||
TINFL_CR_RETURN(38, TINFL_STATUS_NEEDS_MORE_INPUT);
|
||||
}
|
||||
else
|
||||
{
|
||||
TINFL_CR_RETURN_FOREVER(40, TINFL_STATUS_FAILED);
|
||||
}
|
||||
}
|
||||
n = MZ_MIN(MZ_MIN((size_t)(pOut_buf_end - pOut_buf_cur), (size_t)(pIn_buf_end - pIn_buf_cur)), counter);
|
||||
TINFL_MEMCPY(pOut_buf_cur, pIn_buf_cur, n); pIn_buf_cur += n; pOut_buf_cur += n; counter -= (mz_uint)n;
|
||||
}
|
||||
}
|
||||
else if (r->m_type == 3)
|
||||
{
|
||||
TINFL_CR_RETURN_FOREVER(10, TINFL_STATUS_FAILED);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (r->m_type == 1)
|
||||
{
|
||||
mz_uint8 *p = r->m_tables[0].m_code_size; mz_uint i;
|
||||
r->m_table_sizes[0] = 288; r->m_table_sizes[1] = 32; TINFL_MEMSET(r->m_tables[1].m_code_size, 5, 32);
|
||||
for ( i = 0; i <= 143; ++i) *p++ = 8;
|
||||
for ( ; i <= 255; ++i) *p++ = 9;
|
||||
for ( ; i <= 279; ++i) *p++ = 7;
|
||||
for ( ; i <= 287; ++i) *p++ = 8;
|
||||
}
|
||||
else
|
||||
{
|
||||
for (counter = 0; counter < 3; counter++) { TINFL_GET_BITS(11, r->m_table_sizes[counter], "\05\05\04"[counter]); r->m_table_sizes[counter] += s_min_table_sizes[counter]; }
|
||||
MZ_CLEAR_OBJ(r->m_tables[2].m_code_size); for (counter = 0; counter < r->m_table_sizes[2]; counter++) { mz_uint s; TINFL_GET_BITS(14, s, 3); r->m_tables[2].m_code_size[s_length_dezigzag[counter]] = (mz_uint8)s; }
|
||||
r->m_table_sizes[2] = 19;
|
||||
}
|
||||
for ( ; (int)r->m_type >= 0; r->m_type--)
|
||||
{
|
||||
int tree_next, tree_cur; tinfl_huff_table *pTable;
|
||||
mz_uint i, j, used_syms, total, sym_index, next_code[17], total_syms[16]; pTable = &r->m_tables[r->m_type]; MZ_CLEAR_OBJ(total_syms); MZ_CLEAR_OBJ(pTable->m_look_up); MZ_CLEAR_OBJ(pTable->m_tree);
|
||||
for (i = 0; i < r->m_table_sizes[r->m_type]; ++i) total_syms[pTable->m_code_size[i]]++;
|
||||
used_syms = 0, total = 0; next_code[0] = next_code[1] = 0;
|
||||
for (i = 1; i <= 15; ++i) { used_syms += total_syms[i]; next_code[i + 1] = (total = ((total + total_syms[i]) << 1)); }
|
||||
if ((65536 != total) && (used_syms > 1))
|
||||
{
|
||||
TINFL_CR_RETURN_FOREVER(35, TINFL_STATUS_FAILED);
|
||||
}
|
||||
for (tree_next = -1, sym_index = 0; sym_index < r->m_table_sizes[r->m_type]; ++sym_index)
|
||||
{
|
||||
mz_uint rev_code = 0, l, cur_code, code_size = pTable->m_code_size[sym_index]; if (!code_size) continue;
|
||||
cur_code = next_code[code_size]++; for (l = code_size; l > 0; l--, cur_code >>= 1) rev_code = (rev_code << 1) | (cur_code & 1);
|
||||
if (code_size <= TINFL_FAST_LOOKUP_BITS) { mz_int16 k = (mz_int16)((code_size << 9) | sym_index); while (rev_code < TINFL_FAST_LOOKUP_SIZE) { pTable->m_look_up[rev_code] = k; rev_code += (1 << code_size); } continue; }
|
||||
if (0 == (tree_cur = pTable->m_look_up[rev_code & (TINFL_FAST_LOOKUP_SIZE - 1)])) { pTable->m_look_up[rev_code & (TINFL_FAST_LOOKUP_SIZE - 1)] = (mz_int16)tree_next; tree_cur = tree_next; tree_next -= 2; }
|
||||
rev_code >>= (TINFL_FAST_LOOKUP_BITS - 1);
|
||||
for (j = code_size; j > (TINFL_FAST_LOOKUP_BITS + 1); j--)
|
||||
{
|
||||
tree_cur -= ((rev_code >>= 1) & 1);
|
||||
if (!pTable->m_tree[-tree_cur - 1]) { pTable->m_tree[-tree_cur - 1] = (mz_int16)tree_next; tree_cur = tree_next; tree_next -= 2; } else tree_cur = pTable->m_tree[-tree_cur - 1];
|
||||
}
|
||||
tree_cur -= ((rev_code >>= 1) & 1); pTable->m_tree[-tree_cur - 1] = (mz_int16)sym_index;
|
||||
}
|
||||
if (r->m_type == 2)
|
||||
{
|
||||
for (counter = 0; counter < (r->m_table_sizes[0] + r->m_table_sizes[1]); )
|
||||
{
|
||||
mz_uint s; TINFL_HUFF_DECODE(16, dist, &r->m_tables[2]); if (dist < 16) { r->m_len_codes[counter++] = (mz_uint8)dist; continue; }
|
||||
if ((dist == 16) && (!counter))
|
||||
{
|
||||
TINFL_CR_RETURN_FOREVER(17, TINFL_STATUS_FAILED);
|
||||
}
|
||||
num_extra = "\02\03\07"[dist - 16]; TINFL_GET_BITS(18, s, num_extra); s += "\03\03\013"[dist - 16];
|
||||
TINFL_MEMSET(r->m_len_codes + counter, (dist == 16) ? r->m_len_codes[counter - 1] : 0, s); counter += s;
|
||||
}
|
||||
if ((r->m_table_sizes[0] + r->m_table_sizes[1]) != counter)
|
||||
{
|
||||
TINFL_CR_RETURN_FOREVER(21, TINFL_STATUS_FAILED);
|
||||
}
|
||||
TINFL_MEMCPY(r->m_tables[0].m_code_size, r->m_len_codes, r->m_table_sizes[0]); TINFL_MEMCPY(r->m_tables[1].m_code_size, r->m_len_codes + r->m_table_sizes[0], r->m_table_sizes[1]);
|
||||
}
|
||||
}
|
||||
for ( ; ; )
|
||||
{
|
||||
mz_uint8 *pSrc;
|
||||
for ( ; ; )
|
||||
{
|
||||
if (((pIn_buf_end - pIn_buf_cur) < 4) || ((pOut_buf_end - pOut_buf_cur) < 2))
|
||||
{
|
||||
TINFL_HUFF_DECODE(23, counter, &r->m_tables[0]);
|
||||
if (counter >= 256)
|
||||
break;
|
||||
while (pOut_buf_cur >= pOut_buf_end) { TINFL_CR_RETURN(24, TINFL_STATUS_HAS_MORE_OUTPUT); }
|
||||
*pOut_buf_cur++ = (mz_uint8)counter;
|
||||
}
|
||||
else
|
||||
{
|
||||
int sym2; mz_uint code_len;
|
||||
#if TINFL_USE_64BIT_BITBUF
|
||||
if (num_bits < 30) { bit_buf |= (((tinfl_bit_buf_t)MZ_READ_LE32(pIn_buf_cur)) << num_bits); pIn_buf_cur += 4; num_bits += 32; }
|
||||
#else
|
||||
if (num_bits < 15) { bit_buf |= (((tinfl_bit_buf_t)MZ_READ_LE16(pIn_buf_cur)) << num_bits); pIn_buf_cur += 2; num_bits += 16; }
|
||||
#endif
|
||||
if ((sym2 = r->m_tables[0].m_look_up[bit_buf & (TINFL_FAST_LOOKUP_SIZE - 1)]) >= 0)
|
||||
code_len = sym2 >> 9;
|
||||
else
|
||||
{
|
||||
code_len = TINFL_FAST_LOOKUP_BITS; do { sym2 = r->m_tables[0].m_tree[~sym2 + ((bit_buf >> code_len++) & 1)]; } while (sym2 < 0);
|
||||
}
|
||||
counter = sym2; bit_buf >>= code_len; num_bits -= code_len;
|
||||
if (counter & 256)
|
||||
break;
|
||||
|
||||
#if !TINFL_USE_64BIT_BITBUF
|
||||
if (num_bits < 15) { bit_buf |= (((tinfl_bit_buf_t)MZ_READ_LE16(pIn_buf_cur)) << num_bits); pIn_buf_cur += 2; num_bits += 16; }
|
||||
#endif
|
||||
if ((sym2 = r->m_tables[0].m_look_up[bit_buf & (TINFL_FAST_LOOKUP_SIZE - 1)]) >= 0)
|
||||
code_len = sym2 >> 9;
|
||||
else
|
||||
{
|
||||
code_len = TINFL_FAST_LOOKUP_BITS; do { sym2 = r->m_tables[0].m_tree[~sym2 + ((bit_buf >> code_len++) & 1)]; } while (sym2 < 0);
|
||||
}
|
||||
bit_buf >>= code_len; num_bits -= code_len;
|
||||
|
||||
pOut_buf_cur[0] = (mz_uint8)counter;
|
||||
if (sym2 & 256)
|
||||
{
|
||||
pOut_buf_cur++;
|
||||
counter = sym2;
|
||||
break;
|
||||
}
|
||||
pOut_buf_cur[1] = (mz_uint8)sym2;
|
||||
pOut_buf_cur += 2;
|
||||
}
|
||||
}
|
||||
if ((counter &= 511) == 256) break;
|
||||
|
||||
num_extra = s_length_extra[counter - 257]; counter = s_length_base[counter - 257];
|
||||
if (num_extra) { mz_uint extra_bits; TINFL_GET_BITS(25, extra_bits, num_extra); counter += extra_bits; }
|
||||
|
||||
TINFL_HUFF_DECODE(26, dist, &r->m_tables[1]);
|
||||
num_extra = s_dist_extra[dist]; dist = s_dist_base[dist];
|
||||
if (num_extra) { mz_uint extra_bits; TINFL_GET_BITS(27, extra_bits, num_extra); dist += extra_bits; }
|
||||
|
||||
dist_from_out_buf_start = pOut_buf_cur - pOut_buf_start;
|
||||
if ((dist > dist_from_out_buf_start) && (decomp_flags & TINFL_FLAG_USING_NON_WRAPPING_OUTPUT_BUF))
|
||||
{
|
||||
TINFL_CR_RETURN_FOREVER(37, TINFL_STATUS_FAILED);
|
||||
}
|
||||
|
||||
pSrc = pOut_buf_start + ((dist_from_out_buf_start - dist) & out_buf_size_mask);
|
||||
|
||||
if ((MZ_MAX(pOut_buf_cur, pSrc) + counter) > pOut_buf_end)
|
||||
{
|
||||
while (counter--)
|
||||
{
|
||||
while (pOut_buf_cur >= pOut_buf_end) { TINFL_CR_RETURN(53, TINFL_STATUS_HAS_MORE_OUTPUT); }
|
||||
*pOut_buf_cur++ = pOut_buf_start[(dist_from_out_buf_start++ - dist) & out_buf_size_mask];
|
||||
}
|
||||
continue;
|
||||
}
|
||||
#if MINIZ_USE_UNALIGNED_LOADS_AND_STORES
|
||||
else if ((counter >= 9) && (counter <= dist))
|
||||
{
|
||||
const mz_uint8 *pSrc_end = pSrc + (counter & ~7);
|
||||
do
|
||||
{
|
||||
((mz_uint32 *)pOut_buf_cur)[0] = ((const mz_uint32 *)pSrc)[0];
|
||||
((mz_uint32 *)pOut_buf_cur)[1] = ((const mz_uint32 *)pSrc)[1];
|
||||
pOut_buf_cur += 8;
|
||||
} while ((pSrc += 8) < pSrc_end);
|
||||
if ((counter &= 7) < 3)
|
||||
{
|
||||
if (counter)
|
||||
{
|
||||
pOut_buf_cur[0] = pSrc[0];
|
||||
if (counter > 1)
|
||||
pOut_buf_cur[1] = pSrc[1];
|
||||
pOut_buf_cur += counter;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
do
|
||||
{
|
||||
pOut_buf_cur[0] = pSrc[0];
|
||||
pOut_buf_cur[1] = pSrc[1];
|
||||
pOut_buf_cur[2] = pSrc[2];
|
||||
pOut_buf_cur += 3; pSrc += 3;
|
||||
} while ((int)(counter -= 3) > 2);
|
||||
if ((int)counter > 0)
|
||||
{
|
||||
pOut_buf_cur[0] = pSrc[0];
|
||||
if ((int)counter > 1)
|
||||
pOut_buf_cur[1] = pSrc[1];
|
||||
pOut_buf_cur += counter;
|
||||
}
|
||||
}
|
||||
}
|
||||
} while (!(r->m_final & 1));
|
||||
if (decomp_flags & TINFL_FLAG_PARSE_ZLIB_HEADER)
|
||||
{
|
||||
TINFL_SKIP_BITS(32, num_bits & 7); for (counter = 0; counter < 4; ++counter) { mz_uint s; if (num_bits) TINFL_GET_BITS(41, s, 8); else TINFL_GET_BYTE(42, s); r->m_z_adler32 = (r->m_z_adler32 << 8) | s; }
|
||||
}
|
||||
TINFL_CR_RETURN_FOREVER(34, TINFL_STATUS_DONE);
|
||||
TINFL_CR_FINISH
|
||||
|
||||
common_exit:
|
||||
r->m_num_bits = num_bits; r->m_bit_buf = bit_buf; r->m_dist = dist; r->m_counter = counter; r->m_num_extra = num_extra; r->m_dist_from_out_buf_start = dist_from_out_buf_start;
|
||||
*pIn_buf_size = pIn_buf_cur - pIn_buf_next; *pOut_buf_size = pOut_buf_cur - pOut_buf_next;
|
||||
if ((decomp_flags & (TINFL_FLAG_PARSE_ZLIB_HEADER | TINFL_FLAG_COMPUTE_ADLER32)) && (status >= 0))
|
||||
{
|
||||
const mz_uint8 *ptr = pOut_buf_next; size_t buf_len = *pOut_buf_size;
|
||||
mz_uint32 i, s1 = r->m_check_adler32 & 0xffff, s2 = r->m_check_adler32 >> 16; size_t block_len = buf_len % 5552;
|
||||
while (buf_len)
|
||||
{
|
||||
for (i = 0; i + 7 < block_len; i += 8, ptr += 8)
|
||||
{
|
||||
s1 += ptr[0], s2 += s1; s1 += ptr[1], s2 += s1; s1 += ptr[2], s2 += s1; s1 += ptr[3], s2 += s1;
|
||||
s1 += ptr[4], s2 += s1; s1 += ptr[5], s2 += s1; s1 += ptr[6], s2 += s1; s1 += ptr[7], s2 += s1;
|
||||
}
|
||||
for ( ; i < block_len; ++i) s1 += *ptr++, s2 += s1;
|
||||
s1 %= 65521U, s2 %= 65521U; buf_len -= block_len; block_len = 5552;
|
||||
}
|
||||
r->m_check_adler32 = (s2 << 16) + s1; if ((status == TINFL_STATUS_DONE) && (decomp_flags & TINFL_FLAG_PARSE_ZLIB_HEADER) && (r->m_check_adler32 != r->m_z_adler32)) status = TINFL_STATUS_ADLER32_MISMATCH;
|
||||
}
|
||||
return status;
|
||||
}
|
||||
|
||||
/* Flush values. For typical usage you only need MZ_NO_FLUSH and MZ_FINISH. The other stuff is for advanced use. */
|
||||
enum { MZ_NO_FLUSH = 0, MZ_PARTIAL_FLUSH = 1, MZ_SYNC_FLUSH = 2, MZ_FULL_FLUSH = 3, MZ_FINISH = 4, MZ_BLOCK = 5 };
|
||||
|
||||
/* Return status codes. MZ_PARAM_ERROR is non-standard. */
|
||||
enum { MZ_OK = 0, MZ_STREAM_END = 1, MZ_NEED_DICT = 2, MZ_ERRNO = -1, MZ_STREAM_ERROR = -2, MZ_DATA_ERROR = -3, MZ_MEM_ERROR = -4, MZ_BUF_ERROR = -5, MZ_VERSION_ERROR = -6, MZ_PARAM_ERROR = -10000 };
|
||||
|
||||
/* Compression levels. */
|
||||
enum { MZ_NO_COMPRESSION = 0, MZ_BEST_SPEED = 1, MZ_BEST_COMPRESSION = 9, MZ_DEFAULT_COMPRESSION = -1 };
|
||||
|
||||
/* Window bits */
|
||||
#define MZ_DEFAULT_WINDOW_BITS 15
|
||||
|
||||
struct mz_internal_state;
|
||||
|
||||
/* Compression/decompression stream struct. */
|
||||
typedef struct mz_stream_s
|
||||
{
|
||||
const unsigned char *next_in; /* pointer to next byte to read */
|
||||
unsigned int avail_in; /* number of bytes available at next_in */
|
||||
mz_ulong total_in; /* total number of bytes consumed so far */
|
||||
|
||||
unsigned char *next_out; /* pointer to next byte to write */
|
||||
unsigned int avail_out; /* number of bytes that can be written to next_out */
|
||||
mz_ulong total_out; /* total number of bytes produced so far */
|
||||
|
||||
char *msg; /* error msg (unused) */
|
||||
struct mz_internal_state *state; /* internal state, allocated by zalloc/zfree */
|
||||
|
||||
mz_alloc_func zalloc; /* optional heap allocation function (defaults to malloc) */
|
||||
mz_free_func zfree; /* optional heap free function (defaults to free) */
|
||||
void *opaque; /* heap alloc function user pointer */
|
||||
|
||||
int data_type; /* data_type (unused) */
|
||||
mz_ulong adler; /* adler32 of the source or uncompressed data */
|
||||
mz_ulong reserved; /* not used */
|
||||
} mz_stream;
|
||||
|
||||
typedef mz_stream *mz_streamp;
|
||||
|
||||
|
||||
typedef struct
|
||||
{
|
||||
tinfl_decompressor m_decomp;
|
||||
mz_uint m_dict_ofs, m_dict_avail, m_first_call, m_has_flushed; int m_window_bits;
|
||||
mz_uint8 m_dict[TINFL_LZ_DICT_SIZE];
|
||||
tinfl_status m_last_status;
|
||||
} inflate_state;
|
||||
|
||||
static int mz_inflateInit2(mz_streamp pStream, int window_bits)
|
||||
{
|
||||
inflate_state *pDecomp;
|
||||
if (!pStream) return MZ_STREAM_ERROR;
|
||||
if ((window_bits != MZ_DEFAULT_WINDOW_BITS) && (-window_bits != MZ_DEFAULT_WINDOW_BITS)) return MZ_PARAM_ERROR;
|
||||
|
||||
pStream->data_type = 0;
|
||||
pStream->adler = 0;
|
||||
pStream->msg = NULL;
|
||||
pStream->total_in = 0;
|
||||
pStream->total_out = 0;
|
||||
pStream->reserved = 0;
|
||||
if (!pStream->zalloc) pStream->zalloc = tinfl_def_alloc_func;
|
||||
if (!pStream->zfree) pStream->zfree = tinfl_def_free_func;
|
||||
|
||||
pDecomp = (inflate_state*)pStream->zalloc(pStream->opaque, 1, sizeof(inflate_state));
|
||||
if (!pDecomp) return MZ_MEM_ERROR;
|
||||
|
||||
pStream->state = (struct mz_internal_state *)pDecomp;
|
||||
|
||||
tinfl_init(&pDecomp->m_decomp);
|
||||
pDecomp->m_dict_ofs = 0;
|
||||
pDecomp->m_dict_avail = 0;
|
||||
pDecomp->m_last_status = TINFL_STATUS_NEEDS_MORE_INPUT;
|
||||
pDecomp->m_first_call = 1;
|
||||
pDecomp->m_has_flushed = 0;
|
||||
pDecomp->m_window_bits = window_bits;
|
||||
|
||||
return MZ_OK;
|
||||
}
|
||||
|
||||
static int mz_inflate(mz_streamp pStream, int flush)
|
||||
{
|
||||
inflate_state* pState;
|
||||
mz_uint n, first_call, decomp_flags = TINFL_FLAG_COMPUTE_ADLER32;
|
||||
size_t in_bytes, out_bytes, orig_avail_in;
|
||||
tinfl_status status;
|
||||
|
||||
if ((!pStream) || (!pStream->state)) return MZ_STREAM_ERROR;
|
||||
if (flush == MZ_PARTIAL_FLUSH) flush = MZ_SYNC_FLUSH;
|
||||
if ((flush) && (flush != MZ_SYNC_FLUSH) && (flush != MZ_FINISH)) return MZ_STREAM_ERROR;
|
||||
|
||||
pState = (inflate_state*)pStream->state;
|
||||
if (pState->m_window_bits > 0) decomp_flags |= TINFL_FLAG_PARSE_ZLIB_HEADER;
|
||||
orig_avail_in = pStream->avail_in;
|
||||
|
||||
first_call = pState->m_first_call; pState->m_first_call = 0;
|
||||
if (pState->m_last_status < 0) return MZ_DATA_ERROR;
|
||||
|
||||
if (pState->m_has_flushed && (flush != MZ_FINISH)) return MZ_STREAM_ERROR;
|
||||
pState->m_has_flushed |= (flush == MZ_FINISH);
|
||||
|
||||
if ((flush == MZ_FINISH) && (first_call))
|
||||
{
|
||||
/* MZ_FINISH on the first call implies that the input and output buffers are large enough to hold the entire compressed/decompressed file. */
|
||||
decomp_flags |= TINFL_FLAG_USING_NON_WRAPPING_OUTPUT_BUF;
|
||||
in_bytes = pStream->avail_in; out_bytes = pStream->avail_out;
|
||||
status = tinfl_decompress(&pState->m_decomp, pStream->next_in, &in_bytes, pStream->next_out, pStream->next_out, &out_bytes, decomp_flags);
|
||||
pState->m_last_status = status;
|
||||
pStream->next_in += (mz_uint)in_bytes; pStream->avail_in -= (mz_uint)in_bytes; pStream->total_in += (mz_uint)in_bytes;
|
||||
pStream->adler = tinfl_get_adler32(&pState->m_decomp);
|
||||
pStream->next_out += (mz_uint)out_bytes; pStream->avail_out -= (mz_uint)out_bytes; pStream->total_out += (mz_uint)out_bytes;
|
||||
|
||||
if (status < 0)
|
||||
return MZ_DATA_ERROR;
|
||||
else if (status != TINFL_STATUS_DONE)
|
||||
{
|
||||
pState->m_last_status = TINFL_STATUS_FAILED;
|
||||
return MZ_BUF_ERROR;
|
||||
}
|
||||
return MZ_STREAM_END;
|
||||
}
|
||||
/* flush != MZ_FINISH then we must assume there's more input. */
|
||||
if (flush != MZ_FINISH) decomp_flags |= TINFL_FLAG_HAS_MORE_INPUT;
|
||||
|
||||
if (pState->m_dict_avail)
|
||||
{
|
||||
n = MZ_MIN(pState->m_dict_avail, pStream->avail_out);
|
||||
memcpy(pStream->next_out, pState->m_dict + pState->m_dict_ofs, n);
|
||||
pStream->next_out += n; pStream->avail_out -= n; pStream->total_out += n;
|
||||
pState->m_dict_avail -= n; pState->m_dict_ofs = (pState->m_dict_ofs + n) & (TINFL_LZ_DICT_SIZE - 1);
|
||||
return ((pState->m_last_status == TINFL_STATUS_DONE) && (!pState->m_dict_avail)) ? MZ_STREAM_END : MZ_OK;
|
||||
}
|
||||
|
||||
for ( ; ; )
|
||||
{
|
||||
in_bytes = pStream->avail_in;
|
||||
out_bytes = TINFL_LZ_DICT_SIZE - pState->m_dict_ofs;
|
||||
|
||||
status = tinfl_decompress(&pState->m_decomp, pStream->next_in, &in_bytes, pState->m_dict, pState->m_dict + pState->m_dict_ofs, &out_bytes, decomp_flags);
|
||||
pState->m_last_status = status;
|
||||
|
||||
pStream->next_in += (mz_uint)in_bytes; pStream->avail_in -= (mz_uint)in_bytes;
|
||||
pStream->total_in += (mz_uint)in_bytes; pStream->adler = tinfl_get_adler32(&pState->m_decomp);
|
||||
|
||||
pState->m_dict_avail = (mz_uint)out_bytes;
|
||||
|
||||
n = MZ_MIN(pState->m_dict_avail, pStream->avail_out);
|
||||
memcpy(pStream->next_out, pState->m_dict + pState->m_dict_ofs, n);
|
||||
pStream->next_out += n; pStream->avail_out -= n; pStream->total_out += n;
|
||||
pState->m_dict_avail -= n; pState->m_dict_ofs = (pState->m_dict_ofs + n) & (TINFL_LZ_DICT_SIZE - 1);
|
||||
|
||||
if (status < 0)
|
||||
return MZ_DATA_ERROR; /* Stream is corrupted (there could be some uncompressed data left in the output dictionary - oh well). */
|
||||
else if ((status == TINFL_STATUS_NEEDS_MORE_INPUT) && (!orig_avail_in))
|
||||
return MZ_BUF_ERROR; /* Signal caller that we can't make forward progress without supplying more input or by setting flush to MZ_FINISH. */
|
||||
else if (flush == MZ_FINISH)
|
||||
{
|
||||
/* The output buffer MUST be large to hold the remaining uncompressed data when flush==MZ_FINISH. */
|
||||
if (status == TINFL_STATUS_DONE)
|
||||
return pState->m_dict_avail ? MZ_BUF_ERROR : MZ_STREAM_END;
|
||||
/* status here must be TINFL_STATUS_HAS_MORE_OUTPUT, which means there's at least 1 more byte on the way. If there's no more room left in the output buffer then something is wrong. */
|
||||
else if (!pStream->avail_out)
|
||||
return MZ_BUF_ERROR;
|
||||
}
|
||||
else if ((status == TINFL_STATUS_DONE) || (!pStream->avail_in) || (!pStream->avail_out) || (pState->m_dict_avail))
|
||||
break;
|
||||
}
|
||||
|
||||
return ((status == TINFL_STATUS_DONE) && (!pState->m_dict_avail)) ? MZ_STREAM_END : MZ_OK;
|
||||
}
|
||||
|
||||
static int mz_inflateEnd(mz_streamp pStream)
|
||||
{
|
||||
if (!pStream)
|
||||
return MZ_STREAM_ERROR;
|
||||
if (pStream->state)
|
||||
{
|
||||
pStream->zfree(pStream->opaque, pStream->state);
|
||||
pStream->state = NULL;
|
||||
}
|
||||
return MZ_OK;
|
||||
}
|
||||
|
||||
/* make this a drop-in replacement for zlib... */
|
||||
#define voidpf void*
|
||||
#define uInt unsigned int
|
||||
#define z_stream mz_stream
|
||||
#define inflateInit2 mz_inflateInit2
|
||||
#define inflate mz_inflate
|
||||
#define inflateEnd mz_inflateEnd
|
||||
#define Z_SYNC_FLUSH MZ_SYNC_FLUSH
|
||||
#define Z_FINISH MZ_FINISH
|
||||
#define Z_OK MZ_OK
|
||||
#define Z_STREAM_END MZ_STREAM_END
|
||||
#define Z_NEED_DICT MZ_NEED_DICT
|
||||
#define Z_ERRNO MZ_ERRNO
|
||||
#define Z_STREAM_ERROR MZ_STREAM_ERROR
|
||||
#define Z_DATA_ERROR MZ_DATA_ERROR
|
||||
#define Z_MEM_ERROR MZ_MEM_ERROR
|
||||
#define Z_BUF_ERROR MZ_BUF_ERROR
|
||||
#define Z_VERSION_ERROR MZ_VERSION_ERROR
|
||||
#define MAX_WBITS 15
|
||||
|
||||
#endif /* #ifndef TINFL_HEADER_FILE_ONLY */
|
||||
|
||||
/*
|
||||
This is free and unencumbered software released into the public domain.
|
||||
|
||||
Anyone is free to copy, modify, publish, use, compile, sell, or
|
||||
distribute this software, either in source code form or as a compiled
|
||||
binary, for any purpose, commercial or non-commercial, and by any
|
||||
means.
|
||||
|
||||
In jurisdictions that recognize copyright laws, the author or authors
|
||||
of this software dedicate any and all copyright interest in the
|
||||
software to the public domain. We make this dedication for the benefit
|
||||
of the public at large and to the detriment of our heirs and
|
||||
successors. We intend this dedication to be an overt act of
|
||||
relinquishment in perpetuity of all present and future rights to this
|
||||
software under copyright law.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
|
||||
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||
OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
For more information, please refer to <https://unlicense.org/>
|
||||
*/
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -18,7 +18,8 @@ static void sequence_channel_process_sound(struct SequenceChannel *seqChannel, s
|
|||
s32 i;
|
||||
|
||||
if (seqChannel->changes.as_bitfields.volume || recalculateVolume) {
|
||||
channelVolume = seqChannel->volume * seqChannel->volumeScale * seqChannel->seqPlayer->appliedFadeVolume;
|
||||
channelVolume = seqChannel->volume * seqChannel->volumeScale *
|
||||
seqChannel->seqPlayer->appliedFadeVolume * seqChannel->seqPlayer->volumeScale;
|
||||
if (seqChannel->seqPlayer->muted && (seqChannel->muteBehavior & MUTE_BEHAVIOR_SOFTEN) != 0) {
|
||||
channelVolume = seqChannel->seqPlayer->muteVolumeScale * channelVolume;
|
||||
}
|
||||
|
@ -59,7 +60,8 @@ static void sequence_channel_process_sound(struct SequenceChannel *seqChannel) {
|
|||
f32 panFromChannel;
|
||||
s32 i;
|
||||
|
||||
channelVolume = seqChannel->volume * seqChannel->volumeScale * seqChannel->seqPlayer->fadeVolume;
|
||||
channelVolume = seqChannel->volume * seqChannel->volumeScale *
|
||||
seqChannel->seqPlayer->fadeVolume * seqChannel->seqPlayer->volumeScale;
|
||||
if (seqChannel->seqPlayer->muted && (seqChannel->muteBehavior & MUTE_BEHAVIOR_SOFTEN) != 0) {
|
||||
channelVolume *= seqChannel->seqPlayer->muteVolumeScale;
|
||||
}
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
#include "seq_ids.h"
|
||||
#include "dialog_ids.h"
|
||||
#include "level_table.h"
|
||||
#include "pc/configfile.h"
|
||||
|
||||
#ifdef VERSION_EU
|
||||
#define EU_FLOAT(x) x ## f
|
||||
|
@ -2061,6 +2062,10 @@ void play_dialog_sound(u8 dialogID) {
|
|||
#endif
|
||||
}
|
||||
|
||||
void set_sequence_player_volume(s32 player, f32 volume) {
|
||||
gSequencePlayers[player].volumeScale = volume;
|
||||
}
|
||||
|
||||
void play_music(u8 player, u16 seqArgs, u16 fadeTimer) {
|
||||
u8 seqId = seqArgs & 0xff;
|
||||
u8 priority = seqArgs >> 8;
|
||||
|
@ -2069,11 +2074,12 @@ void play_music(u8 player, u16 seqArgs, u16 fadeTimer) {
|
|||
|
||||
// Except for the background music player, we don't support queued
|
||||
// sequences. Just play them immediately, stopping any old sequence.
|
||||
|
||||
if (player != 0) {
|
||||
play_sequence(player, seqId, fadeTimer);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// Abort if the queue is already full.
|
||||
if (sBackgroundMusicQueueSize == MAX_BG_MUSIC_QUEUE_SIZE) {
|
||||
return;
|
||||
|
|
|
@ -37,6 +37,7 @@ void sound_banks_disable(u8 player, u16 bankMask);
|
|||
void sound_banks_enable(u8 player, u16 bankMask);
|
||||
void func_80320A4C(u8 bankIndex, u8 arg1);
|
||||
void play_dialog_sound(u8 dialogID);
|
||||
void set_sequence_player_volume(s32 player, f32 volume);
|
||||
void play_music(u8 player, u16 seqArgs, u16 fadeTimer);
|
||||
void stop_background_music(u16 seqId);
|
||||
void fadeout_background_music(u16 arg0, u16 fadeOut);
|
||||
|
|
|
@ -273,6 +273,7 @@ struct SequencePlayer
|
|||
#endif
|
||||
/*0x138, 0x140*/ uintptr_t bankDmaCurrDevAddr;
|
||||
/*0x13C, 0x144*/ ssize_t bankDmaRemaining;
|
||||
/* ext */ f32 volumeScale;
|
||||
}; // size = 0x140, 0x148 on EU
|
||||
|
||||
struct AdsrSettings
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
#include "seqplayer.h"
|
||||
|
||||
#include "../pc/platform.h"
|
||||
#include "../pc/fs/fs.h"
|
||||
|
||||
#define ALIGN16(val) (((val) + 0xF) & ~0xF)
|
||||
|
||||
|
@ -875,11 +876,8 @@ void load_sequence_internal(u32 player, u32 seqId, s32 loadAsync) {
|
|||
# include <stdio.h>
|
||||
# include <stdlib.h>
|
||||
static inline void *load_sound_res(const char *path) {
|
||||
void *data = sys_load_res(path);
|
||||
if (!data) {
|
||||
fprintf(stderr, "could not load sound data from '%s'\n", path);
|
||||
abort();
|
||||
}
|
||||
void *data = fs_load_file(path, NULL);
|
||||
if (!data) sys_fatal("could not load sound data from '%s'", path);
|
||||
// FIXME: figure out where it is safe to free this shit
|
||||
// can't free it immediately after in audio_init()
|
||||
return data;
|
||||
|
|
|
@ -2227,6 +2227,10 @@ void init_sequence_players(void) {
|
|||
#endif
|
||||
gSequencePlayers[i].bankDmaInProgress = FALSE;
|
||||
gSequencePlayers[i].seqDmaInProgress = FALSE;
|
||||
|
||||
// only set this once at the start so it doesn't spike later
|
||||
gSequencePlayers[i].volumeScale = 1.0f;
|
||||
|
||||
init_note_lists(&gSequencePlayers[i].notePool);
|
||||
init_sequence_player(i);
|
||||
}
|
||||
|
|
|
@ -9,6 +9,7 @@ void sequence_channel_disable(struct SequenceChannel *seqPlayer);
|
|||
void sequence_player_disable(struct SequencePlayer* seqPlayer);
|
||||
void audio_list_push_back(struct AudioListItem *list, struct AudioListItem *item);
|
||||
void *audio_list_pop_back(struct AudioListItem *list);
|
||||
void sequence_channel_set_volume(struct SequenceChannel *seqChannel, u8 volume);
|
||||
void process_sequences(s32 iterationsRemaining);
|
||||
void init_sequence_player(u32 player);
|
||||
void init_sequence_players(void);
|
||||
|
|
|
@ -15,6 +15,8 @@ struct AllocOnlyPool
|
|||
};
|
||||
|
||||
struct MemoryPool;
|
||||
struct MarioAnimation;
|
||||
struct Animation;
|
||||
|
||||
#ifndef INCLUDED_FROM_MEMORY_C
|
||||
// Declaring this variable extern puts it in the wrong place in the bss order
|
||||
|
@ -52,6 +54,7 @@ void *mem_pool_alloc(struct MemoryPool *pool, u32 size);
|
|||
void mem_pool_free(struct MemoryPool *pool, void *addr);
|
||||
|
||||
void *alloc_display_list(u32 size);
|
||||
|
||||
void func_80278A78(struct MarioAnimation *a, void *b, struct Animation *target);
|
||||
s32 load_patchable_table(struct MarioAnimation *a, u32 b);
|
||||
|
||||
|
|
|
@ -76,14 +76,19 @@ static const u8 optsVideoStr[][32] = {
|
|||
{ TEXT_OPT_TEXFILTER },
|
||||
{ TEXT_OPT_NEAREST },
|
||||
{ TEXT_OPT_LINEAR },
|
||||
{ TEXT_RESET_WINDOW },
|
||||
{ TEXT_OPT_RESETWND },
|
||||
{ TEXT_OPT_VSYNC },
|
||||
{ TEXT_OPT_DOUBLE },
|
||||
{ TEXT_OPT_HUD },
|
||||
{ TEXT_OPT_THREEPT },
|
||||
{ TEXT_OPT_APPLY },
|
||||
};
|
||||
|
||||
static const u8 optsAudioStr[][32] = {
|
||||
{ TEXT_OPT_MVOLUME },
|
||||
{ TEXT_OPT_MVOLUME },
|
||||
{ TEXT_OPT_MUSVOLUME },
|
||||
{ TEXT_OPT_SFXVOLUME },
|
||||
{ TEXT_OPT_ENVVOLUME },
|
||||
};
|
||||
|
||||
static const u8 optsCheatsStr[][64] = {
|
||||
|
@ -139,6 +144,7 @@ static const u8 optsBLJCheatStr[][32] = {
|
|||
static const u8 *filterChoices[] = {
|
||||
optsVideoStr[2],
|
||||
optsVideoStr[3],
|
||||
optsVideoStr[8],
|
||||
};
|
||||
|
||||
static const u8 *vsyncChoices[] = {
|
||||
|
@ -237,6 +243,10 @@ static void optvideo_reset_window(UNUSED struct Option *self, s32 arg) {
|
|||
}
|
||||
}
|
||||
|
||||
static void optvideo_apply(UNUSED struct Option *self, s32 arg) {
|
||||
if (!arg) configWindow.settings_changed = true;
|
||||
}
|
||||
|
||||
/* submenu option lists */
|
||||
|
||||
#ifdef BETTERCAMERA
|
||||
|
@ -278,12 +288,16 @@ static struct Option optsVideo[] = {
|
|||
DEF_OPT_TOGGLE( optsVideoStr[0], &configWindow.fullscreen ),
|
||||
DEF_OPT_CHOICE( optsVideoStr[5], &configWindow.vsync, vsyncChoices ),
|
||||
DEF_OPT_CHOICE( optsVideoStr[1], &configFiltering, filterChoices ),
|
||||
DEF_OPT_BUTTON( optsVideoStr[4], optvideo_reset_window ),
|
||||
DEF_OPT_TOGGLE( optsVideoStr[7], &configHUD ),
|
||||
DEF_OPT_BUTTON( optsVideoStr[4], optvideo_reset_window ),
|
||||
DEF_OPT_BUTTON( optsVideoStr[9], optvideo_apply ),
|
||||
};
|
||||
|
||||
static struct Option optsAudio[] = {
|
||||
DEF_OPT_SCROLL( optsAudioStr[0], &configMasterVolume, 0, MAX_VOLUME, 1 ),
|
||||
DEF_OPT_SCROLL( optsAudioStr[1], &configMusicVolume, 0, MAX_VOLUME, 1),
|
||||
DEF_OPT_SCROLL( optsAudioStr[2], &configSfxVolume, 0, MAX_VOLUME, 1),
|
||||
DEF_OPT_SCROLL( optsAudioStr[3], &configEnvVolume, 0, MAX_VOLUME, 1),
|
||||
};
|
||||
|
||||
static struct Option optsCheats[] = {
|
||||
|
|
|
@ -391,7 +391,6 @@ BAD_RETURN(s32) save_file_copy(s32 srcFileIndex, s32 destFileIndex) {
|
|||
|
||||
void save_file_load_all(void) {
|
||||
s32 file;
|
||||
s32 validSlots;
|
||||
|
||||
gMainMenuDataModified = FALSE;
|
||||
gSaveFileModified = FALSE;
|
||||
|
@ -405,6 +404,7 @@ void save_file_load_all(void) {
|
|||
gSaveFileModified = TRUE;
|
||||
gMainMenuDataModified = TRUE;
|
||||
#else
|
||||
s32 validSlots;
|
||||
read_eeprom_data(&gSaveBuffer, sizeof(gSaveBuffer));
|
||||
|
||||
if (save_file_need_bswap(&gSaveBuffer))
|
||||
|
|
|
@ -4,44 +4,40 @@
|
|||
#include "course_table.h"
|
||||
#include "pc/ini.h"
|
||||
#include "pc/platform.h"
|
||||
#include "pc/fs/fs.h"
|
||||
|
||||
#define FILENAME_FORMAT "%s/save_file_%d.sav"
|
||||
#define FILENAME_FORMAT "%s/sm64_save_file_%d.sav"
|
||||
#define NUM_COURSES 15
|
||||
#define NUM_BONUS_COURSES 10
|
||||
#define NUM_FLAGS 21
|
||||
#define NUM_CAP_ON 4
|
||||
|
||||
/* Flag keys */
|
||||
const char *sav_flags[NUM_FLAGS] = {
|
||||
"file_exists", "wing_cap", "metal_cap", "vanish_cap", "key_1", "key_2",
|
||||
"basement_door", "upstairs_door", "ddd_moved_back", "moat_drained",
|
||||
"pps_door", "wf_door", "ccm_door", "jrb_door", "bitdw_door",
|
||||
"bitfs_door", "", "", "", "", "50star_door"
|
||||
"bitfs_door", "", "", "", "", "50star_door" // 4 Cap flags are processed in their own section
|
||||
};
|
||||
|
||||
/* Main course keys */
|
||||
const char *sav_courses[NUM_COURSES] = {
|
||||
"bob", "wf", "jrb", "ccm", "bbh", "hmc", "lll",
|
||||
"ssl", "ddd", "sl", "wdw", "ttm", "thi", "ttc", "rr"
|
||||
};
|
||||
|
||||
/* Bonus courses keys (including Castle Course) */
|
||||
const char *sav_bonus_courses[NUM_BONUS_COURSES] = {
|
||||
"hub", "bitdw", "bitfs", "bits", "pss", "cotmc",
|
||||
"totwc", "vcutm", "wmotr", "sa",
|
||||
"bitdw", "bitfs", "bits", "pss", "cotmc",
|
||||
"totwc", "vcutm", "wmotr", "sa", "hub" // hub is Castle Grounds
|
||||
};
|
||||
|
||||
/* Mario's cap type keys */
|
||||
const char *cap_on_types[NUM_CAP_ON] = {
|
||||
"ground", "klepto", "ukiki", "mrblizzard"
|
||||
};
|
||||
|
||||
/* Sound modes */
|
||||
const char *sound_modes[3] = {
|
||||
"stereo", "mono", "headset"
|
||||
};
|
||||
|
||||
/* Get current timestamp */
|
||||
/* Get current timestamp string */
|
||||
static void get_timestamp(char* buffer) {
|
||||
time_t timer;
|
||||
struct tm* tm_info;
|
||||
|
@ -77,104 +73,107 @@ static u32 int_to_bin(u32 n) {
|
|||
}
|
||||
|
||||
/**
|
||||
* Write SaveFile and MainMenuSaveData structs to a text-based savefile.
|
||||
* Write SaveFile and MainMenuSaveData structs to a text-based savefile
|
||||
*/
|
||||
static s32 write_text_save(s32 fileIndex) {
|
||||
FILE* file;
|
||||
struct SaveFile *savedata;
|
||||
struct MainMenuSaveData *menudata;
|
||||
char filename[SYS_MAX_PATH] = { 0 };
|
||||
char value[SYS_MAX_PATH] = { 0 };
|
||||
char value[64];
|
||||
u32 i, bit, flags, coins, stars, starFlags;
|
||||
|
||||
/* Define savefile's name */
|
||||
if (snprintf(filename, sizeof(filename), FILENAME_FORMAT, sys_save_path(), fileIndex) < 0)
|
||||
if (snprintf(filename, sizeof(filename), FILENAME_FORMAT, fs_writepath, fileIndex) < 0)
|
||||
return -1;
|
||||
|
||||
file = fopen(filename, "wt");
|
||||
if (file == NULL)
|
||||
if (file == NULL) {
|
||||
printf("Savefile '%s' not found!\n", filename);
|
||||
return -1;
|
||||
else
|
||||
printf("Updating savefile in '%s'\n", filename);
|
||||
} else
|
||||
printf("Saving updated progress to '%s'\n", filename);
|
||||
|
||||
/* Write header */
|
||||
fprintf(file, "# Super Mario 64 save file\n");
|
||||
fprintf(file, "# Comment starts with #\n");
|
||||
fprintf(file, "# True = 1, False = 0\n");
|
||||
|
||||
/* Write current timestamp */
|
||||
get_timestamp(value);
|
||||
fprintf(file, "# %s\n", value);
|
||||
|
||||
/* Write MainMenuSaveData info */
|
||||
menudata = &gSaveBuffer.menuData[0];
|
||||
fprintf(file, "\n[menu]\n");
|
||||
fprintf(file, "coin_score_age = %d\n", menudata->coinScoreAges[fileIndex]);
|
||||
|
||||
/* Sound mode */
|
||||
if (menudata->soundMode == 0) {
|
||||
fprintf(file, "sound_mode = %s\n", sound_modes[0]); // stereo
|
||||
fprintf(file, "sound_mode = %s\n", sound_modes[0]); // stereo
|
||||
}
|
||||
else if (menudata->soundMode == 3) {
|
||||
fprintf(file, "sound_mode = %s\n", sound_modes[1]); // mono
|
||||
fprintf(file, "sound_mode = %s\n", sound_modes[1]); // mono
|
||||
}
|
||||
else if (menudata->soundMode == 1) {
|
||||
fprintf(file, "sound_mode = %s\n", sound_modes[2]); // headset
|
||||
fprintf(file, "sound_mode = %s\n", sound_modes[2]); // headset
|
||||
}
|
||||
else {
|
||||
printf("Undefined sound mode!");
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* Write all flags */
|
||||
fprintf(file, "\n[flags]\n");
|
||||
for (i = 1; i < NUM_FLAGS; i++) {
|
||||
if (strcmp(sav_flags[i], "")) {
|
||||
flags = save_file_get_flags();
|
||||
flags = (flags & (1 << i)); /* Get a specific bit */
|
||||
flags = (flags) ? 1 : 0; /* Determine if bit is set or not */
|
||||
flags = (flags & (1 << i)); // Get 'star' flag bit
|
||||
flags = (flags) ? 1 : 0;
|
||||
|
||||
fprintf(file, "%s = %d\n", sav_flags[i], flags);
|
||||
}
|
||||
}
|
||||
|
||||
/* Write coin count and star flags from each course (except Castle Grounds) */
|
||||
fprintf(file, "\n[courses]\n");
|
||||
for (i = 0; i < NUM_COURSES; i++) {
|
||||
stars = save_file_get_star_flags(fileIndex, i);
|
||||
coins = save_file_get_course_coin_score(fileIndex, i);
|
||||
starFlags = int_to_bin(stars); /* 63 -> 111111 */
|
||||
starFlags = int_to_bin(stars); // 63 -> 111111
|
||||
|
||||
fprintf(file, "%s = \"%d, %07d\"\n", sav_courses[i], coins, starFlags);
|
||||
}
|
||||
|
||||
/* Write star flags from each bonus cource (including Castle Grounds) */
|
||||
fprintf(file, "\n[bonus]\n");
|
||||
for (i = 0; i < NUM_BONUS_COURSES; i++) {
|
||||
if (i == 0) {
|
||||
stars = save_file_get_star_flags(fileIndex, -1);
|
||||
} else {
|
||||
stars = save_file_get_star_flags(fileIndex, i+14);
|
||||
}
|
||||
starFlags = int_to_bin(stars);
|
||||
char *format;
|
||||
|
||||
fprintf(file, "%s = %d\n", sav_bonus_courses[i], starFlags);
|
||||
if (i == NUM_BONUS_COURSES-1) {
|
||||
// Process Castle Grounds
|
||||
stars = save_file_get_star_flags(fileIndex, -1);
|
||||
format = "%05d";
|
||||
} else if (i == 3) {
|
||||
// Process Princess's Secret Slide
|
||||
stars = save_file_get_star_flags(fileIndex, 18);
|
||||
format = "%02d";
|
||||
} else {
|
||||
// Process bonus courses
|
||||
stars = save_file_get_star_flags(fileIndex, i+15);
|
||||
format = "%d";
|
||||
}
|
||||
|
||||
starFlags = int_to_bin(stars);
|
||||
if (sprintf(value, format, starFlags) < 0)
|
||||
return -1;
|
||||
fprintf(file, "%s = %s\n", sav_bonus_courses[i], value);
|
||||
}
|
||||
|
||||
/* Write who steal Mario's cap */
|
||||
fprintf(file, "\n[cap]\n");
|
||||
for (i = 0; i < NUM_CAP_ON; i++) {
|
||||
flags = save_file_get_flags(); // Read all flags
|
||||
bit = (1 << (i+16)); // Determine current flag
|
||||
flags = (flags & bit); // Get `cap` flag
|
||||
flags = (flags) ? 1 : 0; // Determine if bit is set or not
|
||||
flags = save_file_get_flags();
|
||||
bit = (1 << (i+16)); // Determine current flag
|
||||
flags = (flags & bit); // Get 'cap' flag bit
|
||||
flags = (flags) ? 1 : 0;
|
||||
if (flags) {
|
||||
fprintf(file, "type = %s\n", cap_on_types[i]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/* Write in what course and area Mario losted its cap, and cap's position */
|
||||
savedata = &gSaveBuffer.files[fileIndex][0];
|
||||
switch(savedata->capLevel) {
|
||||
case COURSE_SSL:
|
||||
|
@ -187,12 +186,13 @@ static s32 write_text_save(s32 fileIndex) {
|
|||
fprintf(file, "level = %s\n", "ttm");
|
||||
break;
|
||||
default:
|
||||
fprintf(file, "level = %s\n", "none");
|
||||
break;
|
||||
}
|
||||
fprintf(file, "area = %d\n", savedata->capArea);
|
||||
if (savedata->capLevel) {
|
||||
fprintf(file, "area = %d\n", savedata->capArea);
|
||||
}
|
||||
|
||||
/* Update a backup */
|
||||
// Backup is nessecary for saving recent progress after gameover
|
||||
bcopy(&gSaveBuffer.files[fileIndex][0], &gSaveBuffer.files[fileIndex][1],
|
||||
sizeof(gSaveBuffer.files[fileIndex][1]));
|
||||
|
||||
|
@ -201,22 +201,19 @@ static s32 write_text_save(s32 fileIndex) {
|
|||
}
|
||||
|
||||
/**
|
||||
* Read gSaveBuffer data from a text-based savefile.
|
||||
* Read gSaveBuffer data from a text-based savefile
|
||||
*/
|
||||
static s32 read_text_save(s32 fileIndex) {
|
||||
char filename[SYS_MAX_PATH] = { 0 };
|
||||
char temp[SYS_MAX_PATH] = { 0 };
|
||||
const char *value;
|
||||
ini_t *savedata;
|
||||
|
||||
u32 i, flag, coins, stars, starFlags;
|
||||
u32 capArea;
|
||||
|
||||
/* Define savefile's name */
|
||||
if (snprintf(filename, sizeof(filename), FILENAME_FORMAT, sys_save_path(), fileIndex) < 0)
|
||||
if (snprintf(filename, sizeof(filename), FILENAME_FORMAT, fs_writepath, fileIndex) < 0)
|
||||
return -1;
|
||||
|
||||
/* Try to open the file */
|
||||
savedata = ini_load(filename);
|
||||
if (savedata == NULL) {
|
||||
return -1;
|
||||
|
@ -224,7 +221,6 @@ static s32 read_text_save(s32 fileIndex) {
|
|||
printf("Loading savefile from '%s'\n", filename);
|
||||
}
|
||||
|
||||
/* Read coin score age for selected file and sound mode */
|
||||
ini_sget(savedata, "menu", "coin_score_age", "%d",
|
||||
&gSaveBuffer.menuData[0].coinScoreAges[fileIndex]);
|
||||
|
||||
|
@ -245,32 +241,28 @@ static s32 read_text_save(s32 fileIndex) {
|
|||
return -1;
|
||||
}
|
||||
|
||||
/* Parse main flags */
|
||||
for (i = 1; i < NUM_FLAGS; i++) {
|
||||
value = ini_get(savedata, "flags", sav_flags[i]);
|
||||
|
||||
if (value) {
|
||||
flag = strtol(value, &temp, 10);
|
||||
flag = value[0] - '0'; // Flag should be 0 or 1
|
||||
if (flag) {
|
||||
flag = 1 << i; /* Look #define in header.. */
|
||||
flag = 1 << i; // Flags defined in 'save_file' header
|
||||
gSaveBuffer.files[fileIndex][0].flags |= flag;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Parse coin and star values for each main course */
|
||||
for (i = 0; i < NUM_COURSES; i++) {
|
||||
value = ini_get(savedata, "courses", sav_courses[i]);
|
||||
if (value) {
|
||||
sscanf(value, "%d, %d", &coins, &stars);
|
||||
starFlags = bin_to_int(stars); /* 111111 -> 63 */
|
||||
starFlags = bin_to_int(stars); // 111111 -> 63
|
||||
|
||||
save_file_set_star_flags(fileIndex, i, starFlags);
|
||||
gSaveBuffer.files[fileIndex][0].courseCoinScores[i] = coins;
|
||||
}
|
||||
}
|
||||
|
||||
/* Parse star values for each bonus course */
|
||||
for (i = 0; i < NUM_BONUS_COURSES; i++) {
|
||||
value = ini_get(savedata, "bonus", sav_bonus_courses[i]);
|
||||
if (value) {
|
||||
|
@ -278,19 +270,18 @@ static s32 read_text_save(s32 fileIndex) {
|
|||
starFlags = bin_to_int(stars);
|
||||
|
||||
if (strlen(value) == 5) {
|
||||
/* Process Castle Grounds */
|
||||
// Process Castle Grounds
|
||||
save_file_set_star_flags(fileIndex, -1, starFlags);
|
||||
} else if (strlen(value) == 2) {
|
||||
/* Process Princess's Secret Slide */
|
||||
save_file_set_star_flags(fileIndex, COURSE_PSS, starFlags);
|
||||
// Process Princess's Secret Slide
|
||||
save_file_set_star_flags(fileIndex, 18, starFlags);
|
||||
} else {
|
||||
/* Process another shitty bonus course */
|
||||
// Process bonus courses
|
||||
save_file_set_star_flags(fileIndex, i+15, starFlags);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Find, who steal Mario's cap ... */
|
||||
for (i = 0; i < NUM_CAP_ON; i++) {
|
||||
value = ini_get(savedata, "cap", "type");
|
||||
if (value) {
|
||||
|
@ -302,20 +293,16 @@ static s32 read_text_save(s32 fileIndex) {
|
|||
}
|
||||
}
|
||||
|
||||
/* ... it's level ... */
|
||||
value = ini_get(savedata, "cap", "level");
|
||||
if (value) {
|
||||
if (strcmp(value, "ssl") == 0) {
|
||||
gSaveBuffer.files[fileIndex][0].capLevel = 8; // ssl
|
||||
gSaveBuffer.files[fileIndex][0].capLevel = COURSE_SSL; // ssl
|
||||
}
|
||||
else if (strcmp(value, "sl") == 0) {
|
||||
gSaveBuffer.files[fileIndex][0].capLevel = 10; // sl
|
||||
gSaveBuffer.files[fileIndex][0].capLevel = COURSE_SL; // sl
|
||||
}
|
||||
else if (strcmp(value, "ttm") == 0) {
|
||||
gSaveBuffer.files[fileIndex][0].capLevel = 12; // ttm
|
||||
}
|
||||
else if (strcmp(value, "none") == 0) {
|
||||
gSaveBuffer.files[fileIndex][0].capLevel = 0;
|
||||
gSaveBuffer.files[fileIndex][0].capLevel = COURSE_TTM; // ttm
|
||||
}
|
||||
else {
|
||||
printf("Invalid 'cap:level' flag!\n");
|
||||
|
@ -323,7 +310,6 @@ static s32 read_text_save(s32 fileIndex) {
|
|||
}
|
||||
}
|
||||
|
||||
/* ... and it's area */
|
||||
value = ini_get(savedata, "cap", "area");
|
||||
if (value) {
|
||||
sscanf(value, "%d", &capArea);
|
||||
|
@ -336,14 +322,13 @@ static s32 read_text_save(s32 fileIndex) {
|
|||
}
|
||||
}
|
||||
|
||||
/* Good, file exists for gSaveBuffer */
|
||||
// Good, file exists for gSaveBuffer
|
||||
gSaveBuffer.files[fileIndex][0].flags |= SAVE_FLAG_FILE_EXISTS;
|
||||
|
||||
/* Make a backup */
|
||||
// Backup is nessecary for saving recent progress after gameover
|
||||
bcopy(&gSaveBuffer.files[fileIndex][0], &gSaveBuffer.files[fileIndex][1],
|
||||
sizeof(gSaveBuffer.files[fileIndex][1]));
|
||||
|
||||
/* Cleaning up after ourselves */
|
||||
ini_free(savedata);
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
#ifdef AAPI_SDL2
|
||||
|
||||
#include <SDL2/SDL.h>
|
||||
|
||||
#include "audio_api.h"
|
||||
|
@ -57,4 +59,6 @@ struct AudioAPI audio_sdl = {
|
|||
audio_sdl_get_desired_buffered,
|
||||
audio_sdl_play,
|
||||
audio_sdl_shutdown
|
||||
};
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
#ifndef AUDIO_SDL_H
|
||||
#define AUDIO_SDL_H
|
||||
|
||||
#include "audio_api.h"
|
||||
|
||||
extern struct AudioAPI audio_sdl;
|
||||
|
||||
#endif
|
||||
|
|
|
@ -16,7 +16,7 @@ static void print_help(void) {
|
|||
printf("Super Mario 64 PC Port\n");
|
||||
printf("%-20s\tEnables the cheat menu.\n", "--cheats");
|
||||
printf("%-20s\tSaves the configuration file as CONFIGNAME.\n", "--configfile CONFIGNAME");
|
||||
printf("%-20s\tOverrides the default read-only data path ('!' expands to executable path).\n", "--datapath DATAPATH");
|
||||
printf("%-20s\tSets additional data directory name (only 'res' is used by default).\n", "--gamedir DIRNAME");
|
||||
printf("%-20s\tOverrides the default save/config path ('!' expands to executable path).\n", "--savepath SAVEPATH");
|
||||
printf("%-20s\tStarts the game in full screen mode.\n", "--fullscreen");
|
||||
printf("%-20s\tSkips the Peach and Castle intro when starting a new game.\n", "--skip-intro");
|
||||
|
@ -54,8 +54,8 @@ void parse_cli_opts(int argc, char* argv[]) {
|
|||
else if (strcmp(argv[i], "--configfile") == 0 && (i + 1) < argc)
|
||||
arg_string("--configfile", argv[++i], gCLIOpts.ConfigFile);
|
||||
|
||||
else if (strcmp(argv[i], "--datapath") == 0 && (i + 1) < argc)
|
||||
arg_string("--datapath", argv[++i], gCLIOpts.DataPath);
|
||||
else if (strcmp(argv[i], "--gamedir") == 0 && (i + 1) < argc)
|
||||
arg_string("--gamedir", argv[++i], gCLIOpts.GameDir);
|
||||
|
||||
else if (strcmp(argv[i], "--savepath") == 0 && (i + 1) < argc)
|
||||
arg_string("--savepath", argv[++i], gCLIOpts.SavePath);
|
||||
|
|
|
@ -8,7 +8,7 @@ struct PCCLIOptions {
|
|||
unsigned int FullScreen;
|
||||
char ConfigFile[SYS_MAX_PATH];
|
||||
char SavePath[SYS_MAX_PATH];
|
||||
char DataPath[SYS_MAX_PATH];
|
||||
char GameDir[SYS_MAX_PATH];
|
||||
};
|
||||
|
||||
extern struct PCCLIOptions gCLIOpts;
|
||||
|
|
|
@ -5,13 +5,14 @@
|
|||
#include <string.h>
|
||||
#include <assert.h>
|
||||
#include <ctype.h>
|
||||
#include <SDL2/SDL.h>
|
||||
|
||||
#include "platform.h"
|
||||
#include "configfile.h"
|
||||
#include "cliopts.h"
|
||||
#include "gfx/gfx_screen_config.h"
|
||||
#include "gfx/gfx_window_manager_api.h"
|
||||
#include "controller/controller_api.h"
|
||||
#include "fs/fs.h"
|
||||
|
||||
#define ARRAY_LEN(arr) (sizeof(arr) / sizeof(arr[0]))
|
||||
|
||||
|
@ -38,8 +39,8 @@ struct ConfigOption {
|
|||
|
||||
// Video/audio stuff
|
||||
ConfigWindow configWindow = {
|
||||
.x = SDL_WINDOWPOS_CENTERED,
|
||||
.y = SDL_WINDOWPOS_CENTERED,
|
||||
.x = WAPI_WIN_CENTERPOS,
|
||||
.y = WAPI_WIN_CENTERPOS,
|
||||
.w = DESIRED_SCREEN_WIDTH,
|
||||
.h = DESIRED_SCREEN_HEIGHT,
|
||||
.vsync = 1,
|
||||
|
@ -50,6 +51,9 @@ ConfigWindow configWindow = {
|
|||
};
|
||||
unsigned int configFiltering = 1; // 0=force nearest, 1=linear, (TODO) 2=three-point
|
||||
unsigned int configMasterVolume = MAX_VOLUME; // 0 - MAX_VOLUME
|
||||
unsigned int configMusicVolume = MAX_VOLUME;
|
||||
unsigned int configSfxVolume = MAX_VOLUME;
|
||||
unsigned int configEnvVolume = MAX_VOLUME;
|
||||
|
||||
// Keyboard mappings (VK_ values, by default keyboard/gamepad/mouse)
|
||||
unsigned int configKeyA[MAX_BINDS] = { 0x0026, 0x1000, 0x1103 };
|
||||
|
@ -85,6 +89,9 @@ bool configCameraMouse = false;
|
|||
#endif
|
||||
unsigned int configSkipIntro = 0;
|
||||
bool configHUD = true;
|
||||
#ifdef DISCORDRPC
|
||||
bool configDiscordRPC = true;
|
||||
#endif
|
||||
|
||||
static const struct ConfigOption options[] = {
|
||||
{.name = "fullscreen", .type = CONFIG_TYPE_BOOL, .boolValue = &configWindow.fullscreen},
|
||||
|
@ -95,6 +102,9 @@ static const struct ConfigOption options[] = {
|
|||
{.name = "vsync", .type = CONFIG_TYPE_UINT, .uintValue = &configWindow.vsync},
|
||||
{.name = "texture_filtering", .type = CONFIG_TYPE_UINT, .uintValue = &configFiltering},
|
||||
{.name = "master_volume", .type = CONFIG_TYPE_UINT, .uintValue = &configMasterVolume},
|
||||
{.name = "music_volume", .type = CONFIG_TYPE_UINT, .uintValue = &configMusicVolume},
|
||||
{.name = "sfx_volume", .type = CONFIG_TYPE_UINT, .uintValue = &configSfxVolume},
|
||||
{.name = "env_volume", .type = CONFIG_TYPE_UINT, .uintValue = &configEnvVolume},
|
||||
{.name = "key_a", .type = CONFIG_TYPE_BIND, .uintValue = configKeyA},
|
||||
{.name = "key_b", .type = CONFIG_TYPE_BIND, .uintValue = configKeyB},
|
||||
{.name = "key_start", .type = CONFIG_TYPE_BIND, .uintValue = configKeyStart},
|
||||
|
@ -126,11 +136,14 @@ static const struct ConfigOption options[] = {
|
|||
{.name = "bettercam_degrade", .type = CONFIG_TYPE_UINT, .uintValue = &configCameraDegrade},
|
||||
#endif
|
||||
{.name = "skip_intro", .type = CONFIG_TYPE_UINT, .uintValue = &configSkipIntro}, // Add this back!
|
||||
#ifdef DISCORDRPC
|
||||
{.name = "discordrpc_enable", .type = CONFIG_TYPE_BOOL, .boolValue = &configDiscordRPC},
|
||||
#endif
|
||||
};
|
||||
|
||||
// Reads an entire line from a file (excluding the newline character) and returns an allocated string
|
||||
// Returns NULL if no lines could be read from the file
|
||||
static char *read_file_line(FILE *file) {
|
||||
static char *read_file_line(fs_file_t *file) {
|
||||
char *buffer;
|
||||
size_t bufferSize = 8;
|
||||
size_t offset = 0; // offset in buffer to write
|
||||
|
@ -138,7 +151,7 @@ static char *read_file_line(FILE *file) {
|
|||
buffer = malloc(bufferSize);
|
||||
while (1) {
|
||||
// Read a line from the file
|
||||
if (fgets(buffer + offset, bufferSize - offset, file) == NULL) {
|
||||
if (fs_readline(file, buffer + offset, bufferSize - offset) == NULL) {
|
||||
free(buffer);
|
||||
return NULL; // Nothing could be read.
|
||||
}
|
||||
|
@ -151,7 +164,7 @@ static char *read_file_line(FILE *file) {
|
|||
break;
|
||||
}
|
||||
|
||||
if (feof(file)) // EOF was reached
|
||||
if (fs_eof(file)) // EOF was reached
|
||||
break;
|
||||
|
||||
// If no newline or EOF was reached, then the whole line wasn't read.
|
||||
|
@ -205,24 +218,17 @@ static unsigned int tokenize_string(char *str, int maxTokens, char **tokens) {
|
|||
|
||||
// Gets the config file path and caches it
|
||||
const char *configfile_name(void) {
|
||||
static char cfgpath[SYS_MAX_PATH] = { 0 };
|
||||
if (!cfgpath[0]) {
|
||||
if (gCLIOpts.ConfigFile[0])
|
||||
snprintf(cfgpath, sizeof(cfgpath), "%s", gCLIOpts.ConfigFile);
|
||||
else
|
||||
snprintf(cfgpath, sizeof(cfgpath), "%s/%s", sys_save_path(), CONFIGFILE_DEFAULT);
|
||||
}
|
||||
return cfgpath;
|
||||
return (gCLIOpts.ConfigFile[0]) ? gCLIOpts.ConfigFile : CONFIGFILE_DEFAULT;
|
||||
}
|
||||
|
||||
// Loads the config file specified by 'filename'
|
||||
void configfile_load(const char *filename) {
|
||||
FILE *file;
|
||||
fs_file_t *file;
|
||||
char *line;
|
||||
|
||||
printf("Loading configuration from '%s'\n", filename);
|
||||
|
||||
file = fopen(filename, "r");
|
||||
file = fs_open(filename);
|
||||
if (file == NULL) {
|
||||
// Create a new config file and save defaults
|
||||
printf("Config file '%s' not found. Creating it.\n", filename);
|
||||
|
@ -286,7 +292,7 @@ void configfile_load(const char *filename) {
|
|||
free(line);
|
||||
}
|
||||
|
||||
fclose(file);
|
||||
fs_close(file);
|
||||
}
|
||||
|
||||
// Writes the config file to 'filename'
|
||||
|
@ -295,7 +301,7 @@ void configfile_save(const char *filename) {
|
|||
|
||||
printf("Saving configuration to '%s'\n", filename);
|
||||
|
||||
file = fopen(filename, "w");
|
||||
file = fopen(fs_get_write_path(filename), "w");
|
||||
if (file == NULL) {
|
||||
// error
|
||||
return;
|
||||
|
|
|
@ -21,6 +21,9 @@ typedef struct {
|
|||
extern ConfigWindow configWindow;
|
||||
extern unsigned int configFiltering;
|
||||
extern unsigned int configMasterVolume;
|
||||
extern unsigned int configMusicVolume;
|
||||
extern unsigned int configSfxVolume;
|
||||
extern unsigned int configEnvVolume;
|
||||
extern unsigned int configKeyA[];
|
||||
extern unsigned int configKeyB[];
|
||||
extern unsigned int configKeyStart[];
|
||||
|
@ -52,6 +55,9 @@ extern bool configEnableCamera;
|
|||
extern bool configCameraMouse;
|
||||
#endif
|
||||
extern bool configHUD;
|
||||
#ifdef DISCORDRPC
|
||||
extern bool configDiscordRPC;
|
||||
#endif
|
||||
|
||||
void configfile_load(const char *filename);
|
||||
void configfile_save(const char *filename);
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
#ifdef CAPI_SDL2
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
|
@ -14,6 +16,7 @@
|
|||
#include "controller_sdl.h"
|
||||
#include "../configfile.h"
|
||||
#include "../platform.h"
|
||||
#include "../fs/fs.h"
|
||||
|
||||
#include "game/level_update.h"
|
||||
|
||||
|
@ -34,6 +37,7 @@ extern u8 newcam_mouse;
|
|||
#endif
|
||||
|
||||
static bool init_ok;
|
||||
static bool haptics_enabled;
|
||||
static SDL_GameController *sdl_cntrl;
|
||||
static SDL_Haptic *sdl_haptic;
|
||||
|
||||
|
@ -86,21 +90,25 @@ static void controller_sdl_bind(void) {
|
|||
}
|
||||
|
||||
static void controller_sdl_init(void) {
|
||||
if (SDL_Init(SDL_INIT_GAMECONTROLLER | SDL_INIT_EVENTS | SDL_INIT_HAPTIC) != 0) {
|
||||
if (SDL_Init(SDL_INIT_GAMECONTROLLER | SDL_INIT_EVENTS) != 0) {
|
||||
fprintf(stderr, "SDL init error: %s\n", SDL_GetError());
|
||||
return;
|
||||
}
|
||||
|
||||
haptics_enabled = (SDL_InitSubSystem(SDL_INIT_HAPTIC) == 0);
|
||||
|
||||
// try loading an external gamecontroller mapping file
|
||||
char gcpath[SYS_MAX_PATH];
|
||||
snprintf(gcpath, sizeof(gcpath), "%s/gamecontrollerdb.txt", sys_save_path());
|
||||
int nummaps = SDL_GameControllerAddMappingsFromFile(gcpath);
|
||||
if (nummaps < 0) {
|
||||
snprintf(gcpath, sizeof(gcpath), "%s/gamecontrollerdb.txt", sys_data_path());
|
||||
nummaps = SDL_GameControllerAddMappingsFromFile(gcpath);
|
||||
uint64_t gcsize = 0;
|
||||
void *gcdata = fs_load_file("gamecontrollerdb.txt", &gcsize);
|
||||
if (gcdata && gcsize) {
|
||||
SDL_RWops *rw = SDL_RWFromConstMem(gcdata, gcsize);
|
||||
if (rw) {
|
||||
int nummaps = SDL_GameControllerAddMappingsFromRW(rw, SDL_TRUE);
|
||||
if (nummaps >= 0)
|
||||
printf("loaded %d controller mappings from 'gamecontrollerdb.txt'\n", nummaps);
|
||||
}
|
||||
free(gcdata);
|
||||
}
|
||||
if (nummaps >= 0)
|
||||
printf("loaded %d controller mappings from '%s'\n", nummaps, gcpath);
|
||||
|
||||
#ifdef BETTERCAMERA
|
||||
if (newcam_mouse == 1)
|
||||
|
@ -114,6 +122,8 @@ static void controller_sdl_init(void) {
|
|||
}
|
||||
|
||||
static SDL_Haptic *controller_sdl_init_haptics(const int joy) {
|
||||
if (!haptics_enabled) return NULL;
|
||||
|
||||
SDL_Haptic *hap = SDL_HapticOpen(joy);
|
||||
if (!hap) return NULL;
|
||||
|
||||
|
@ -274,12 +284,18 @@ static void controller_sdl_shutdown(void) {
|
|||
SDL_GameControllerClose(sdl_cntrl);
|
||||
sdl_cntrl = NULL;
|
||||
}
|
||||
SDL_QuitSubSystem(SDL_INIT_GAMECONTROLLER);
|
||||
}
|
||||
|
||||
if (SDL_WasInit(SDL_INIT_HAPTIC)) {
|
||||
if (sdl_haptic) {
|
||||
SDL_HapticClose(sdl_haptic);
|
||||
sdl_haptic = NULL;
|
||||
}
|
||||
SDL_QuitSubSystem(SDL_INIT_GAMECONTROLLER);
|
||||
SDL_QuitSubSystem(SDL_INIT_HAPTIC);
|
||||
}
|
||||
|
||||
haptics_enabled = false;
|
||||
init_ok = false;
|
||||
}
|
||||
|
||||
|
@ -293,3 +309,5 @@ struct ControllerAPI controller_sdl = {
|
|||
controller_sdl_bind,
|
||||
controller_sdl_shutdown
|
||||
};
|
||||
|
||||
#endif // CAPI_SDL2
|
||||
|
|
|
@ -0,0 +1,289 @@
|
|||
#include <stdbool.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include <time.h>
|
||||
|
||||
#include "macros.h"
|
||||
#include "PR/ultratypes.h"
|
||||
#include "game/memory.h"
|
||||
#include "pc/configfile.h"
|
||||
#include "discordrpc.h"
|
||||
|
||||
#define DISCORDLIBFILE "libdiscord-rpc"
|
||||
|
||||
// Thanks Microsoft for being non posix compliant
|
||||
#if defined(_WIN32)
|
||||
# include <windows.h>
|
||||
# define DISCORDLIBEXT ".dll"
|
||||
# define dlopen(lib, flag) LoadLibrary(TEXT(lib))
|
||||
# define dlerror() ""
|
||||
# define dlsym(handle, func) (void *)GetProcAddress(handle, func)
|
||||
# define dlclose(handle) FreeLibrary(handle)
|
||||
#elif defined(__APPLE__)
|
||||
# include <dlfcn.h>
|
||||
# define DISCORDLIBEXT ".dylib"
|
||||
#elif defined(__linux__) || defined(__FreeBSD__) // lets make the bold assumption for FreeBSD
|
||||
# include <dlfcn.h>
|
||||
# define DISCORDLIBEXT ".so"
|
||||
#else
|
||||
# error Unknown System
|
||||
#endif
|
||||
|
||||
#define DISCORDLIB DISCORDLIBFILE DISCORDLIBEXT
|
||||
#define DISCORD_APP_ID "709083908708237342"
|
||||
#define DISCORD_UPDATE_RATE 5
|
||||
|
||||
extern s16 gCurrCourseNum;
|
||||
extern s16 gCurrActNum;
|
||||
extern u8 seg2_course_name_table[];
|
||||
extern u8 seg2_act_name_table[];
|
||||
|
||||
static time_t lastUpdatedTime;
|
||||
|
||||
static DiscordRichPresence discordRichPresence;
|
||||
static bool initd = false;
|
||||
|
||||
static void* handle;
|
||||
|
||||
void (*Discord_Initialize)(const char *, DiscordEventHandlers *, int, const char *);
|
||||
void (*Discord_Shutdown)(void);
|
||||
void (*Discord_ClearPresence)(void);
|
||||
void (*Discord_UpdatePresence)(DiscordRichPresence *);
|
||||
|
||||
static s16 lastCourseNum = -1;
|
||||
static s16 lastActNum = -1;
|
||||
|
||||
#ifdef VERSION_EU
|
||||
extern s32 gInGameLanguage;
|
||||
#endif
|
||||
|
||||
static char stage[188];
|
||||
static char act[188];
|
||||
|
||||
static char smallImageKey[5];
|
||||
static char largeImageKey[5];
|
||||
|
||||
static const char charset[0xFF+1] = {
|
||||
' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // 7
|
||||
' ', ' ', 'a', 'b', 'c', 'd', 'e', 'f', // 15
|
||||
'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', // 23
|
||||
'o', 'p', 'q', 'r', 's', 't', 'u', 'v', // 31
|
||||
'w', 'x', 'y', 'z', ' ', ' ', ' ', ' ', // 39
|
||||
' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // 49
|
||||
' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // 55
|
||||
' ', ' ', ' ', ' ', ' ', ' ', '\'', ' ', // 63
|
||||
' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // 71
|
||||
' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // 79
|
||||
' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // 87
|
||||
' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // 95
|
||||
' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // 103
|
||||
' ', ' ', ' ', ' ', ' ', ' ', ' ', ',', // 111
|
||||
' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // 119
|
||||
' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // 127
|
||||
' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // 135
|
||||
' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // 143
|
||||
' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // 151
|
||||
' ', ' ', ' ', ' ', ' ', ' ', ' ', '-', // 159
|
||||
' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // 167
|
||||
' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // 175
|
||||
' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // 183
|
||||
' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // 192
|
||||
' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // 199
|
||||
' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // 207
|
||||
' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // 215
|
||||
' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // 223
|
||||
' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // 231
|
||||
' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', // 239
|
||||
' ', ' ', '!', ' ', ' ', ' ', ' ', ' ', // 247
|
||||
' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ' // 255
|
||||
};
|
||||
|
||||
static void convertstring(const u8 *str, char* output) {
|
||||
s32 strPos = 0;
|
||||
bool capitalizeChar = true;
|
||||
|
||||
while (str[strPos] != 0xFF) {
|
||||
if (str[strPos] < 0xFF) {
|
||||
output[strPos] = charset[str[strPos]];
|
||||
|
||||
// if the char is a letter we can capatalize it
|
||||
if (capitalizeChar && 0x0A <= str[strPos] && str[strPos] <= 0x23) {
|
||||
output[strPos] -= ('a' - 'A');
|
||||
capitalizeChar = false;
|
||||
}
|
||||
|
||||
} else {
|
||||
output[strPos] = ' ';
|
||||
}
|
||||
|
||||
// decide if the next character should be capitalized
|
||||
switch (output[strPos]) {
|
||||
case ' ':
|
||||
if (str[strPos] != 158)
|
||||
fprintf(stdout, "Unknown Character (%i)\n", str[strPos]); // inform that an unknown char was found
|
||||
case '-':
|
||||
capitalizeChar = true;
|
||||
break;
|
||||
default:
|
||||
capitalizeChar = false;
|
||||
break;
|
||||
}
|
||||
|
||||
strPos++;
|
||||
}
|
||||
|
||||
output[strPos] = '\0';
|
||||
}
|
||||
|
||||
static void on_ready(UNUSED const DiscordUser* user) {
|
||||
discord_reset();
|
||||
}
|
||||
|
||||
static void init_discord(void) {
|
||||
DiscordEventHandlers handlers;
|
||||
memset(&handlers, 0, sizeof(handlers));
|
||||
handlers.ready = on_ready;
|
||||
|
||||
Discord_Initialize(DISCORD_APP_ID, &handlers, false, "");
|
||||
|
||||
initd = true;
|
||||
}
|
||||
|
||||
static void set_details(void) {
|
||||
if (lastCourseNum != gCurrCourseNum) {
|
||||
// If we are in in Course 0 we are in the castle which doesn't have a string
|
||||
if (gCurrCourseNum) {
|
||||
void **courseNameTbl;
|
||||
|
||||
#ifndef VERSION_EU
|
||||
courseNameTbl = segmented_to_virtual(seg2_course_name_table);
|
||||
#else
|
||||
switch (gInGameLanguage) {
|
||||
case LANGUAGE_ENGLISH:
|
||||
courseNameTbl = segmented_to_virtual(course_name_table_eu_en);
|
||||
break;
|
||||
case LANGUAGE_FRENCH:
|
||||
courseNameTbl = segmented_to_virtual(course_name_table_eu_fr);
|
||||
break;
|
||||
case LANGUAGE_GERMAN:
|
||||
courseNameTbl = segmented_to_virtual(course_name_table_eu_de);
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
u8 *courseName = segmented_to_virtual(courseNameTbl[gCurrCourseNum - 1]);
|
||||
|
||||
convertstring(&courseName[3], stage);
|
||||
} else {
|
||||
strcpy(stage, "Peach's Castle");
|
||||
}
|
||||
|
||||
lastCourseNum = gCurrCourseNum;
|
||||
}
|
||||
}
|
||||
|
||||
static void set_state(void) {
|
||||
if (lastActNum != gCurrActNum || lastCourseNum != gCurrCourseNum) {
|
||||
// when exiting a stage the act doesn't get reset
|
||||
if (gCurrActNum && gCurrCourseNum) {
|
||||
// any stage over 19 is a special stage without acts
|
||||
if (gCurrCourseNum < 19) {
|
||||
void **actNameTbl;
|
||||
#ifndef VERSION_EU
|
||||
actNameTbl = segmented_to_virtual(seg2_act_name_table);
|
||||
#else
|
||||
switch (gInGameLanguage) {
|
||||
case LANGUAGE_ENGLISH:
|
||||
actNameTbl = segmented_to_virtual(act_name_table_eu_en);
|
||||
break;
|
||||
case LANGUAGE_FRENCH:
|
||||
actNameTbl = segmented_to_virtual(act_name_table_eu_fr);
|
||||
break;
|
||||
case LANGUAGE_GERMAN:
|
||||
actNameTbl = segmented_to_virtual(act_name_table_eu_de);
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
u8 *actName = actName = segmented_to_virtual(actNameTbl[(gCurrCourseNum - 1) * 6 + gCurrActNum - 1]);
|
||||
|
||||
convertstring(actName, act);
|
||||
} else {
|
||||
act[0] = '\0';
|
||||
gCurrActNum = 0;
|
||||
}
|
||||
} else {
|
||||
act[0] = '\0';
|
||||
}
|
||||
|
||||
lastActNum = gCurrActNum;
|
||||
}
|
||||
}
|
||||
|
||||
void set_logo(void) {
|
||||
if (lastCourseNum)
|
||||
snprintf(largeImageKey, sizeof(largeImageKey), "%d", lastCourseNum);
|
||||
else
|
||||
strcpy(largeImageKey, "0");
|
||||
|
||||
/*
|
||||
if (lastActNum)
|
||||
snprintf(smallImageKey, sizeof(largeImageKey), "%d", lastActNum);
|
||||
else
|
||||
smallImageKey[0] = '\0';
|
||||
*/
|
||||
|
||||
discordRichPresence.largeImageKey = largeImageKey;
|
||||
//discordRichPresence.largeImageText = "";
|
||||
//discordRichPresence.smallImageKey = smallImageKey;
|
||||
//discordRichPresence.smallImageText = "";
|
||||
}
|
||||
|
||||
void discord_update_rich_presence(void) {
|
||||
if (!configDiscordRPC || !initd) return;
|
||||
if (time(NULL) < lastUpdatedTime + DISCORD_UPDATE_RATE) return;
|
||||
|
||||
lastUpdatedTime = time(NULL);
|
||||
|
||||
set_state();
|
||||
set_details();
|
||||
set_logo();
|
||||
Discord_UpdatePresence(&discordRichPresence);
|
||||
}
|
||||
|
||||
void discord_shutdown(void) {
|
||||
if (handle) {
|
||||
Discord_ClearPresence();
|
||||
Discord_Shutdown();
|
||||
dlclose(handle);
|
||||
}
|
||||
}
|
||||
|
||||
void discord_init(void) {
|
||||
if (configDiscordRPC) {
|
||||
handle = dlopen(DISCORDLIB, RTLD_LAZY);
|
||||
if (!handle) {
|
||||
fprintf(stderr, "Unable to load Discord\n%s\n", dlerror());
|
||||
return;
|
||||
}
|
||||
|
||||
Discord_Initialize = dlsym(handle, "Discord_Initialize");
|
||||
Discord_Shutdown = dlsym(handle, "Discord_Shutdown");
|
||||
Discord_ClearPresence = dlsym(handle, "Discord_ClearPresence");
|
||||
Discord_UpdatePresence = dlsym(handle, "Discord_UpdatePresence");
|
||||
|
||||
init_discord();
|
||||
|
||||
discordRichPresence.details = stage;
|
||||
discordRichPresence.state = act;
|
||||
|
||||
lastUpdatedTime = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void discord_reset(void) {
|
||||
memset( &discordRichPresence, 0, sizeof( discordRichPresence ) );
|
||||
|
||||
set_state();
|
||||
set_details();
|
||||
set_logo();
|
||||
Discord_UpdatePresence(&discordRichPresence);
|
||||
}
|
|
@ -0,0 +1,49 @@
|
|||
#ifndef DISCORDRPC_H
|
||||
#define DISCORDRPC_H
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
typedef struct DiscordRichPresence {
|
||||
const char* state; /* max 128 bytes */
|
||||
const char* details; /* max 128 bytes */
|
||||
int64_t startTimestamp;
|
||||
int64_t endTimestamp;
|
||||
const char* largeImageKey; /* max 32 bytes */
|
||||
const char* largeImageText; /* max 128 bytes */
|
||||
const char* smallImageKey; /* max 32 bytes */
|
||||
const char* smallImageText; /* max 128 bytes */
|
||||
const char* partyId; /* max 128 bytes */
|
||||
int partySize;
|
||||
int partyMax;
|
||||
const char* matchSecret; /* max 128 bytes */
|
||||
const char* joinSecret; /* max 128 bytes */
|
||||
const char* spectateSecret; /* max 128 bytes */
|
||||
int8_t instance;
|
||||
} DiscordRichPresence;
|
||||
|
||||
typedef struct DiscordUser {
|
||||
const char* userId;
|
||||
const char* username;
|
||||
const char* discriminator;
|
||||
const char* avatar;
|
||||
} DiscordUser;
|
||||
|
||||
typedef struct DiscordEventHandlers {
|
||||
void (*ready)(const DiscordUser* request);
|
||||
void (*disconnected)(int errorCode, const char* message);
|
||||
void (*errored)(int errorCode, const char* message);
|
||||
void (*joinGame)(const char* joinSecret);
|
||||
void (*spectateGame)(const char* spectateSecret);
|
||||
void (*joinRequest)(const DiscordUser* request);
|
||||
} DiscordEventHandlers;
|
||||
|
||||
#define DISCORD_REPLY_NO 0
|
||||
#define DISCORD_REPLY_YES 1
|
||||
#define DISCORD_REPLY_IGNORE 2
|
||||
|
||||
void discord_update_rich_presence(void);
|
||||
void discord_shutdown(void);
|
||||
void discord_init(void);
|
||||
void discord_reset(void);
|
||||
|
||||
#endif // DISCORDRPC_H
|
|
@ -0,0 +1,137 @@
|
|||
#include <stdlib.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "../platform.h"
|
||||
#include "fs.h"
|
||||
#include "dirtree.h"
|
||||
|
||||
static inline uint32_t dirtree_hash(const char *s, size_t len) {
|
||||
// djb hash
|
||||
uint32_t hash = 5381;
|
||||
while (len--) hash = ((hash << 5) + hash) ^ *(s++);
|
||||
return hash & (FS_NUMBUCKETS - 1);
|
||||
}
|
||||
|
||||
bool fs_dirtree_init(fs_dirtree_t *tree, const size_t entry_len) {
|
||||
memset(tree, 0, sizeof(*tree));
|
||||
|
||||
tree->root = malloc(entry_len);
|
||||
if (!tree->root) return false;
|
||||
|
||||
tree->root->name = ""; // root
|
||||
tree->root->is_dir = true;
|
||||
tree->entry_len = entry_len;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void fs_dirtree_free(fs_dirtree_t *tree) {
|
||||
if (!tree) return;
|
||||
if (tree->root) free(tree->root);
|
||||
for (int i = 0; i < FS_NUMBUCKETS; ++i) {
|
||||
fs_dirtree_entry_t *ent, *next;
|
||||
for (ent = tree->buckets[i]; ent; ent = next) {
|
||||
next = ent->next_hash;
|
||||
free(ent);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static inline fs_dirtree_entry_t *dirtree_add_ancestors(fs_dirtree_t *tree, char *name) {
|
||||
fs_dirtree_entry_t *ent = tree->root;
|
||||
|
||||
// look for parent directory
|
||||
char *last_sep = strrchr(name, '/');
|
||||
if (!last_sep) return ent;
|
||||
*last_sep = 0;
|
||||
ent = fs_dirtree_find(tree, name);
|
||||
|
||||
if (ent) {
|
||||
*last_sep = '/'; // put the separator back
|
||||
return ent; // parent directory already in tree
|
||||
}
|
||||
|
||||
// add the parent directory
|
||||
ent = fs_dirtree_add(tree, name, true);
|
||||
*last_sep = '/';
|
||||
|
||||
return ent;
|
||||
}
|
||||
|
||||
fs_dirtree_entry_t *fs_dirtree_add(fs_dirtree_t *tree, char *name, const bool is_dir) {
|
||||
fs_dirtree_entry_t *ent = fs_dirtree_find(tree, name);
|
||||
if (ent) return ent;
|
||||
|
||||
// add the parent directory into the tree first
|
||||
fs_dirtree_entry_t *parent = dirtree_add_ancestors(tree, name);
|
||||
if (!parent) return NULL;
|
||||
|
||||
// we'll plaster the name at the end of the allocated chunk, after the actual entry
|
||||
const size_t name_len = strlen(name);
|
||||
const size_t allocsize = tree->entry_len + name_len + 1;
|
||||
ent = calloc(1, allocsize);
|
||||
if (!ent) return NULL;
|
||||
|
||||
ent->name = (const char *)ent + tree->entry_len;
|
||||
strcpy((char *)ent->name, name);
|
||||
|
||||
const uint32_t hash = dirtree_hash(name, name_len);
|
||||
ent->next_hash = tree->buckets[hash];
|
||||
tree->buckets[hash] = ent;
|
||||
ent->next_sibling = parent->next_child;
|
||||
ent->is_dir = is_dir;
|
||||
parent->next_child = ent;
|
||||
|
||||
return ent;
|
||||
}
|
||||
|
||||
fs_dirtree_entry_t *fs_dirtree_find(fs_dirtree_t *tree, const char *name) {
|
||||
if (!name) return NULL;
|
||||
if (!*name) return tree->root;
|
||||
|
||||
const uint32_t hash = dirtree_hash(name, strlen(name));
|
||||
|
||||
fs_dirtree_entry_t *ent, *prev = NULL;
|
||||
for (ent = tree->buckets[hash]; ent; ent = ent->next_hash) {
|
||||
if (!strcmp(ent->name, name)) {
|
||||
// if this path is not in front of the hash list, move it to the front
|
||||
// in case of reccurring searches
|
||||
if (prev) {
|
||||
prev->next_hash = ent->next_hash;
|
||||
ent->next_hash = tree->buckets[hash];
|
||||
tree->buckets[hash] = ent;
|
||||
}
|
||||
return ent;
|
||||
}
|
||||
prev = ent;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static fs_walk_result_t dirtree_walk_impl(fs_dirtree_entry_t *ent, walk_fn_t walkfn, void *user, const bool recur) {
|
||||
fs_walk_result_t res = FS_WALK_SUCCESS;;
|
||||
ent = ent->next_child;
|
||||
while (ent && (res == FS_WALK_SUCCESS)) {
|
||||
if (ent->is_dir) {
|
||||
if (recur && ent->next_child)
|
||||
res = dirtree_walk_impl(ent, walkfn, user, recur);
|
||||
} else if (!walkfn(user, ent->name)) {
|
||||
res = FS_WALK_INTERRUPTED;
|
||||
break;
|
||||
}
|
||||
ent = ent->next_sibling;
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
fs_walk_result_t fs_dirtree_walk(void *pack, const char *base, walk_fn_t walkfn, void *user, const bool recur) {
|
||||
fs_dirtree_t *tree = (fs_dirtree_t *)pack;
|
||||
|
||||
fs_dirtree_entry_t *ent = fs_dirtree_find(tree, base);
|
||||
if (!ent) return FS_WALK_NOTFOUND;
|
||||
|
||||
return dirtree_walk_impl(ent, walkfn, user, recur);
|
||||
}
|
|
@ -0,0 +1,32 @@
|
|||
#ifndef _SM64_DIRTREE_H_
|
||||
#define _SM64_DIRTREE_H_
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
#include "fs.h"
|
||||
|
||||
#define FS_NUMBUCKETS 64
|
||||
|
||||
typedef struct fs_dirtree_entry_s {
|
||||
const char *name;
|
||||
bool is_dir;
|
||||
struct fs_dirtree_entry_s *next_hash, *next_child, *next_sibling;
|
||||
} fs_dirtree_entry_t;
|
||||
|
||||
typedef struct {
|
||||
fs_dirtree_entry_t *root;
|
||||
fs_dirtree_entry_t *buckets[FS_NUMBUCKETS];
|
||||
size_t entry_len;
|
||||
} fs_dirtree_t;
|
||||
|
||||
bool fs_dirtree_init(fs_dirtree_t *tree, const size_t entry_len);
|
||||
void fs_dirtree_free(fs_dirtree_t *tree);
|
||||
|
||||
fs_dirtree_entry_t *fs_dirtree_add(fs_dirtree_t *tree, char *name, const bool is_dir);
|
||||
fs_dirtree_entry_t *fs_dirtree_find(fs_dirtree_t *tree, const char *name);
|
||||
|
||||
// the first arg is void* so this could be used in walk() methods of various packtypes
|
||||
fs_walk_result_t fs_dirtree_walk(void *tree, const char *base, walk_fn_t walkfn, void *user, const bool recur);
|
||||
|
||||
#endif // _SM64_DIRTREE_H_
|
|
@ -0,0 +1,443 @@
|
|||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <stdbool.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <dirent.h>
|
||||
#include <ctype.h>
|
||||
#ifdef _WIN32
|
||||
#include <direct.h>
|
||||
#endif
|
||||
|
||||
#include "macros.h"
|
||||
#include "../platform.h"
|
||||
#include "fs.h"
|
||||
|
||||
char fs_gamedir[SYS_MAX_PATH] = "";
|
||||
char fs_writepath[SYS_MAX_PATH] = "";
|
||||
|
||||
struct fs_dir_s {
|
||||
void *pack;
|
||||
const char *realpath;
|
||||
fs_packtype_t *packer;
|
||||
struct fs_dir_s *prev, *next;
|
||||
};
|
||||
|
||||
extern fs_packtype_t fs_packtype_dir;
|
||||
extern fs_packtype_t fs_packtype_zip;
|
||||
|
||||
static fs_packtype_t *fs_packers[] = {
|
||||
&fs_packtype_dir,
|
||||
&fs_packtype_zip,
|
||||
};
|
||||
|
||||
static fs_dir_t *fs_searchpaths = NULL;
|
||||
|
||||
static inline fs_dir_t *fs_find_dir(const char *realpath) {
|
||||
for (fs_dir_t *dir = fs_searchpaths; dir; dir = dir->next)
|
||||
if (!sys_strcasecmp(realpath, dir->realpath))
|
||||
return dir;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static int mount_cmp(const void *p1, const void *p2) {
|
||||
const char *s1 = sys_file_name(*(const char **)p1);
|
||||
const char *s2 = sys_file_name(*(const char **)p2);
|
||||
|
||||
// check if one or both of these are basepacks
|
||||
const int plen = strlen(FS_BASEPACK_PREFIX);
|
||||
const bool is_base1 = !strncmp(s1, FS_BASEPACK_PREFIX, plen);
|
||||
const bool is_base2 = !strncmp(s2, FS_BASEPACK_PREFIX, plen);
|
||||
|
||||
// if both are basepacks, compare the postfixes only
|
||||
if (is_base1 && is_base2) return strcmp(s1 + plen, s2 + plen);
|
||||
// if only one is a basepack, it goes first
|
||||
if (is_base1) return -1;
|
||||
if (is_base2) return 1;
|
||||
// otherwise strcmp order
|
||||
return strcmp(s1, s2);
|
||||
}
|
||||
|
||||
static void scan_path_dir(const char *ropath, const char *dir) {
|
||||
char dirpath[SYS_MAX_PATH];
|
||||
snprintf(dirpath, sizeof(dirpath), "%s/%s", ropath, dir);
|
||||
|
||||
if (!fs_sys_dir_exists(dirpath)) return;
|
||||
|
||||
// since filename order in readdir() isn't guaranteed, collect paths and sort them in strcmp() order
|
||||
// (but with basepacks first)
|
||||
fs_pathlist_t plist = fs_sys_enumerate(dirpath, false);
|
||||
if (plist.paths) {
|
||||
qsort(plist.paths, plist.numpaths, sizeof(char *), mount_cmp);
|
||||
for (int i = 0; i < plist.numpaths; ++i)
|
||||
fs_mount(plist.paths[i]);
|
||||
fs_pathlist_free(&plist);
|
||||
}
|
||||
|
||||
// mount the directory itself
|
||||
fs_mount(dirpath);
|
||||
}
|
||||
|
||||
bool fs_init(const char **rodirs, const char *gamedir, const char *writepath) {
|
||||
char buf[SYS_MAX_PATH];
|
||||
|
||||
// expand and remember the write path
|
||||
strncpy(fs_writepath, fs_convert_path(buf, sizeof(buf), writepath), sizeof(fs_writepath));
|
||||
fs_writepath[sizeof(fs_writepath)-1] = 0;
|
||||
printf("fs: writepath set to `%s`\n", fs_writepath);
|
||||
|
||||
// remember the game directory name
|
||||
strncpy(fs_gamedir, gamedir, sizeof(fs_gamedir));
|
||||
fs_gamedir[sizeof(fs_gamedir)-1] = 0;
|
||||
printf("fs: gamedir set to `%s`\n", fs_gamedir);
|
||||
|
||||
// first, scan all possible paths and mount all basedirs in them
|
||||
for (const char **p = rodirs; p && *p; ++p)
|
||||
scan_path_dir(fs_convert_path(buf, sizeof(buf), *p), FS_BASEDIR);
|
||||
scan_path_dir(fs_writepath, FS_BASEDIR);
|
||||
|
||||
// then mount all the gamedirs in them, if the game dir isn't the same
|
||||
if (sys_strcasecmp(FS_BASEDIR, fs_gamedir)) {
|
||||
for (const char **p = rodirs; p && *p; ++p)
|
||||
scan_path_dir(fs_convert_path(buf, sizeof(buf), *p), fs_gamedir);
|
||||
scan_path_dir(fs_writepath, fs_gamedir);
|
||||
}
|
||||
|
||||
// as a special case, mount writepath itself
|
||||
fs_mount(fs_writepath);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool fs_mount(const char *realpath) {
|
||||
if (fs_find_dir(realpath))
|
||||
return false; // already mounted
|
||||
|
||||
const char *ext = sys_file_extension(realpath);
|
||||
void *pack = NULL;
|
||||
fs_packtype_t *packer = NULL;
|
||||
bool tried = false;
|
||||
for (unsigned int i = 0; i < sizeof(fs_packers) / sizeof(fs_packers[0]); ++i) {
|
||||
if (ext && sys_strcasecmp(ext, fs_packers[i]->extension))
|
||||
continue;
|
||||
tried = true;
|
||||
pack = fs_packers[i]->mount(realpath);
|
||||
if (pack) {
|
||||
packer = fs_packers[i];
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!pack || !packer) {
|
||||
if (tried)
|
||||
fprintf(stderr, "fs: could not mount '%s'\n", realpath);
|
||||
return false;
|
||||
}
|
||||
|
||||
fs_dir_t *dir = calloc(1, sizeof(fs_dir_t));
|
||||
if (!dir) {
|
||||
packer->unmount(pack);
|
||||
return false;
|
||||
}
|
||||
|
||||
dir->pack = pack;
|
||||
dir->realpath = sys_strdup(realpath);
|
||||
dir->packer = packer;
|
||||
dir->prev = NULL;
|
||||
dir->next = fs_searchpaths;
|
||||
if (fs_searchpaths)
|
||||
fs_searchpaths->prev = dir;
|
||||
fs_searchpaths = dir;
|
||||
|
||||
printf("fs: mounting '%s'\n", realpath);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool fs_unmount(const char *realpath) {
|
||||
fs_dir_t *dir = fs_find_dir(realpath);
|
||||
if (dir) {
|
||||
dir->packer->unmount(dir->pack);
|
||||
free((void *)dir->realpath);
|
||||
if (dir->prev) dir->prev->next = dir->next;
|
||||
if (dir->next) dir->next->prev = dir->prev;
|
||||
if (dir == fs_searchpaths) fs_searchpaths = dir->next;
|
||||
free(dir);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
fs_walk_result_t fs_walk(const char *base, walk_fn_t walkfn, void *user, const bool recur) {
|
||||
bool found = false;
|
||||
for (fs_dir_t *dir = fs_searchpaths; dir; dir = dir->next) {
|
||||
fs_walk_result_t res = dir->packer->walk(dir->pack, base, walkfn, user, recur);
|
||||
if (res == FS_WALK_INTERRUPTED)
|
||||
return res;
|
||||
if (res != FS_WALK_NOTFOUND)
|
||||
found = true;
|
||||
}
|
||||
return found ? FS_WALK_SUCCESS : FS_WALK_NOTFOUND;
|
||||
}
|
||||
|
||||
bool fs_is_file(const char *fname) {
|
||||
for (fs_dir_t *dir = fs_searchpaths; dir; dir = dir->next) {
|
||||
if (dir->packer->is_file(dir->pack, fname))
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool fs_is_dir(const char *fname) {
|
||||
for (fs_dir_t *dir = fs_searchpaths; dir; dir = dir->next) {
|
||||
if (dir->packer->is_dir(dir->pack, fname))
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
fs_file_t *fs_open(const char *vpath) {
|
||||
for (fs_dir_t *dir = fs_searchpaths; dir; dir = dir->next) {
|
||||
fs_file_t *f = dir->packer->open(dir->pack, vpath);
|
||||
if (f) {
|
||||
f->parent = dir;
|
||||
return f;
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void fs_close(fs_file_t *file) {
|
||||
if (!file) return;
|
||||
file->parent->packer->close(file->parent->pack, file);
|
||||
}
|
||||
|
||||
int64_t fs_read(fs_file_t *file, void *buf, const uint64_t size) {
|
||||
if (!file) return -1;
|
||||
return file->parent->packer->read(file->parent->pack, file, buf, size);
|
||||
}
|
||||
|
||||
bool fs_seek(fs_file_t *file, const int64_t ofs) {
|
||||
if (!file) return -1;
|
||||
return file->parent->packer->seek(file->parent->pack, file, ofs);
|
||||
}
|
||||
|
||||
int64_t fs_tell(fs_file_t *file) {
|
||||
if (!file) return -1;
|
||||
return file->parent->packer->tell(file->parent->pack, file);
|
||||
}
|
||||
|
||||
int64_t fs_size(fs_file_t *file) {
|
||||
if (!file) return -1;
|
||||
return file->parent->packer->size(file->parent->pack, file);
|
||||
}
|
||||
|
||||
bool fs_eof(fs_file_t *file) {
|
||||
if (!file) return true;
|
||||
return file->parent->packer->eof(file->parent->pack, file);
|
||||
}
|
||||
|
||||
struct matchdata_s {
|
||||
const char *prefix;
|
||||
size_t prefix_len;
|
||||
char *dst;
|
||||
size_t dst_len;
|
||||
};
|
||||
|
||||
static bool match_walk(void *user, const char *path) {
|
||||
struct matchdata_s *data = (struct matchdata_s *)user;
|
||||
if (!strncmp(path, data->prefix, data->prefix_len)) {
|
||||
// found our lad, copy path to destination and terminate
|
||||
strncpy(data->dst, path, data->dst_len);
|
||||
data->dst[data->dst_len - 1] = 0;
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
const char *fs_match(char *outname, const size_t outlen, const char *prefix) {
|
||||
struct matchdata_s data = {
|
||||
.prefix = prefix,
|
||||
.prefix_len = strlen(prefix),
|
||||
.dst = outname,
|
||||
.dst_len = outlen,
|
||||
};
|
||||
|
||||
if (fs_walk("", match_walk, &data, true) == FS_WALK_INTERRUPTED)
|
||||
return outname;
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static bool enumerate_walk(void *user, const char *path) {
|
||||
fs_pathlist_t *data = (fs_pathlist_t *)user;
|
||||
|
||||
if (data->listcap == data->numpaths) {
|
||||
data->listcap *= 2;
|
||||
char **newpaths = realloc(data->paths, data->listcap * sizeof(char *));
|
||||
if (!newpaths) return false;
|
||||
data->paths = newpaths;
|
||||
}
|
||||
|
||||
data->paths[data->numpaths++] = sys_strdup(path);
|
||||
return true;
|
||||
}
|
||||
|
||||
fs_pathlist_t fs_enumerate(const char *base, const bool recur) {
|
||||
char **paths = malloc(sizeof(char *) * 32);
|
||||
fs_pathlist_t pathlist = { paths, 0, 32 };
|
||||
|
||||
if (!paths) return pathlist;
|
||||
|
||||
if (fs_walk(base, enumerate_walk, &pathlist, recur) == FS_WALK_INTERRUPTED)
|
||||
fs_pathlist_free(&pathlist);
|
||||
|
||||
return pathlist;
|
||||
}
|
||||
|
||||
void fs_pathlist_free(fs_pathlist_t *pathlist) {
|
||||
if (!pathlist || !pathlist->paths) return;
|
||||
for (int i = 0; i < pathlist->numpaths; ++i)
|
||||
free(pathlist->paths[i]);
|
||||
free(pathlist->paths);
|
||||
pathlist->paths = NULL;
|
||||
pathlist->numpaths = 0;
|
||||
}
|
||||
|
||||
const char *fs_readline(fs_file_t *file, char *dst, uint64_t size) {
|
||||
int64_t rx = 0;
|
||||
char chr, *p;
|
||||
|
||||
// assume we got buffered input
|
||||
for (p = dst, size--; size > 0; size--) {
|
||||
if ((rx = fs_read(file, &chr, 1)) <= 0)
|
||||
break;
|
||||
*p++ = chr;
|
||||
if (chr == '\n')
|
||||
break;
|
||||
}
|
||||
|
||||
*p = 0;
|
||||
if (p == dst || rx <= 0)
|
||||
return NULL;
|
||||
|
||||
return p;
|
||||
}
|
||||
|
||||
void *fs_load_file(const char *vpath, uint64_t *outsize) {
|
||||
fs_file_t *f = fs_open(vpath);
|
||||
if (!f) return NULL;
|
||||
|
||||
int64_t size = fs_size(f);
|
||||
if (size <= 0) {
|
||||
fs_close(f);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void *buf = malloc(size);
|
||||
if (!buf) {
|
||||
fs_close(f);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
int64_t rx = fs_read(f, buf, size);
|
||||
fs_close(f);
|
||||
|
||||
if (rx < size) {
|
||||
free(buf);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (outsize) *outsize = size;
|
||||
return buf;
|
||||
}
|
||||
|
||||
const char *fs_get_write_path(const char *vpath) {
|
||||
static char path[SYS_MAX_PATH];
|
||||
snprintf(path, sizeof(path), "%s/%s", fs_writepath, vpath);
|
||||
return path;
|
||||
}
|
||||
|
||||
const char *fs_convert_path(char *buf, const size_t bufsiz, const char *path) {
|
||||
// ! means "executable directory"
|
||||
if (path[0] == '!') {
|
||||
snprintf(buf, bufsiz, "%s%s", sys_exe_path(), path + 1);
|
||||
} else {
|
||||
strncpy(buf, path, bufsiz);
|
||||
buf[bufsiz-1] = 0;
|
||||
}
|
||||
|
||||
// change all backslashes
|
||||
for (char *p = buf; *p; ++p)
|
||||
if (*p == '\\') *p = '/';
|
||||
|
||||
return buf;
|
||||
}
|
||||
|
||||
/* these operate on the real file system */
|
||||
|
||||
bool fs_sys_file_exists(const char *name) {
|
||||
struct stat st;
|
||||
return (stat(name, &st) == 0 && S_ISREG(st.st_mode));
|
||||
}
|
||||
|
||||
bool fs_sys_dir_exists(const char *name) {
|
||||
struct stat st;
|
||||
return (stat(name, &st) == 0 && S_ISDIR(st.st_mode));
|
||||
}
|
||||
|
||||
bool fs_sys_walk(const char *base, walk_fn_t walk, void *user, const bool recur) {
|
||||
char fullpath[SYS_MAX_PATH];
|
||||
DIR *dir;
|
||||
struct dirent *ent;
|
||||
|
||||
if (!(dir = opendir(base))) {
|
||||
fprintf(stderr, "fs_dir_walk(): could not open `%s`\n", base);
|
||||
return false;
|
||||
}
|
||||
|
||||
bool ret = true;
|
||||
|
||||
while ((ent = readdir(dir)) != NULL) {
|
||||
if (ent->d_name[0] == 0 || ent->d_name[0] == '.') continue; // skip ./.. and hidden files
|
||||
snprintf(fullpath, sizeof(fullpath), "%s/%s", base, ent->d_name);
|
||||
if (fs_sys_dir_exists(fullpath)) {
|
||||
if (recur) {
|
||||
if (!fs_sys_walk(fullpath, walk, user, recur)) {
|
||||
ret = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (!walk(user, fullpath)) {
|
||||
ret = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
closedir(dir);
|
||||
return ret;
|
||||
}
|
||||
|
||||
fs_pathlist_t fs_sys_enumerate(const char *base, const bool recur) {
|
||||
char **paths = malloc(sizeof(char *) * 32);
|
||||
fs_pathlist_t pathlist = { paths, 0, 32 };
|
||||
|
||||
if (!paths) return pathlist;
|
||||
|
||||
if (!fs_sys_walk(base, enumerate_walk, &pathlist, recur))
|
||||
fs_pathlist_free(&pathlist);
|
||||
|
||||
return pathlist;
|
||||
}
|
||||
|
||||
bool fs_sys_mkdir(const char *name) {
|
||||
#ifdef _WIN32
|
||||
return _mkdir(name) == 0;
|
||||
#else
|
||||
return mkdir(name, 0777) == 0;
|
||||
#endif
|
||||
}
|
|
@ -0,0 +1,135 @@
|
|||
#ifndef _SM64_FS_H_
|
||||
#define _SM64_FS_H_
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
#include <stddef.h>
|
||||
|
||||
#include "../platform.h"
|
||||
|
||||
// FS_BASEDIR is usually defined in the build script
|
||||
#ifndef FS_BASEDIR
|
||||
# define FS_BASEDIR "res"
|
||||
#endif
|
||||
|
||||
#ifndef FS_BASEPACK_PREFIX
|
||||
# define FS_BASEPACK_PREFIX "base"
|
||||
#endif
|
||||
|
||||
#define FS_TEXTUREDIR "gfx"
|
||||
#define FS_SOUNDDIR "sound"
|
||||
|
||||
extern char fs_gamedir[];
|
||||
extern char fs_writepath[];
|
||||
|
||||
// receives the full path
|
||||
// should return `true` if traversal should continue
|
||||
// first arg is user data
|
||||
typedef bool (*walk_fn_t)(void *, const char *);
|
||||
|
||||
typedef enum {
|
||||
FS_WALK_SUCCESS = 0,
|
||||
FS_WALK_INTERRUPTED = 1,
|
||||
FS_WALK_NOTFOUND = 2,
|
||||
FS_WALK_ERROR = 4,
|
||||
} fs_walk_result_t;
|
||||
|
||||
// opaque searchpath directory type
|
||||
typedef struct fs_dir_s fs_dir_t;
|
||||
|
||||
// virtual file handle
|
||||
typedef struct fs_file_s {
|
||||
void *handle; // opaque packtype-defined data
|
||||
fs_dir_t *parent; // directory containing this file
|
||||
} fs_file_t;
|
||||
|
||||
// list of paths; returned by fs_enumerate()
|
||||
typedef struct {
|
||||
char **paths;
|
||||
int numpaths;
|
||||
int listcap;
|
||||
} fs_pathlist_t;
|
||||
|
||||
typedef struct {
|
||||
const char *extension; // file extensions of this pack type
|
||||
|
||||
void *(*mount)(const char *rpath); // open and initialize pack at real path `rpath`
|
||||
void (*unmount)(void *pack); // free pack
|
||||
|
||||
// walks the specified directory inside this pack, calling walkfn for each file
|
||||
// returns FS_WALK_SUCCESS if the directory was successfully opened and walk() didn't ever return false
|
||||
// returns FS_WALK_INTERRUPTED if the traversal started but walk() returned false at some point
|
||||
// if recur is true, will recurse into subfolders
|
||||
fs_walk_result_t (*walk)(void *pack, const char *base, walk_fn_t walkfn, void *user, const bool recur);
|
||||
|
||||
bool (*is_file)(void *pack, const char *path); // returns true if `path` exists in this pack and is a file
|
||||
bool (*is_dir)(void *pack, const char *path); // returns true if `path` exists in this pack and is a directory
|
||||
|
||||
// file I/O functions; paths are virtual
|
||||
fs_file_t *(*open)(void *pack, const char *path); // opens a virtual file contained in this pack for reading, returns NULL in case of error
|
||||
int64_t (*read)(void *pack, fs_file_t *file, void *buf, const uint64_t size); // returns -1 in case of error
|
||||
bool (*seek)(void *pack, fs_file_t *file, const int64_t ofs); // returns true if seek succeeded
|
||||
int64_t (*tell)(void *pack, fs_file_t *file); // returns -1 in case of error, current virtual file position otherwise
|
||||
int64_t (*size)(void *pack, fs_file_t *file); // returns -1 in case of error, size of the (uncompressed) file otherwise
|
||||
bool (*eof)(void *pack, fs_file_t *file); // returns true if there's nothing more to read
|
||||
void (*close)(void *pack, fs_file_t *file); // closes a virtual file previously opened with ->open()
|
||||
} fs_packtype_t;
|
||||
|
||||
// takes the supplied NULL-terminated list of read-only directories and mounts all the packs in them,
|
||||
// then mounts the directories themselves, then mounts all the packs in `gamedir`, then mounts `gamedir` itself,
|
||||
// then does the same with `userdir`
|
||||
// initializes the `fs_gamedir` and `fs_userdir` variables
|
||||
bool fs_init(const char **rodirs, const char *gamedir, const char *userdir);
|
||||
|
||||
// mounts the pack at physical path `realpath` to the root of the filesystem
|
||||
// packs mounted later take priority over packs mounted earlier
|
||||
bool fs_mount(const char *realpath);
|
||||
|
||||
// removes the pack at physical path from the virtual filesystem
|
||||
bool fs_unmount(const char *realpath);
|
||||
|
||||
/* generalized filesystem functions that call matching packtype functions for each pack in the searchpath */
|
||||
|
||||
// FIXME: this can walk in unorthodox patterns, since it goes through mountpoints linearly
|
||||
fs_walk_result_t fs_walk(const char *base, walk_fn_t walkfn, void *user, const bool recur);
|
||||
|
||||
// returns a list of files in the `base` directory
|
||||
fs_pathlist_t fs_enumerate(const char *base, const bool recur);
|
||||
// call this on a list returned by fs_enumerate() to free it
|
||||
void fs_pathlist_free(fs_pathlist_t *pathlist);
|
||||
|
||||
bool fs_is_file(const char *fname);
|
||||
bool fs_is_dir(const char *fname);
|
||||
|
||||
fs_file_t *fs_open(const char *vpath);
|
||||
void fs_close(fs_file_t *file);
|
||||
int64_t fs_read(fs_file_t *file, void *buf, const uint64_t size);
|
||||
const char *fs_readline(fs_file_t *file, char *dst, const uint64_t size);
|
||||
bool fs_seek(fs_file_t *file, const int64_t ofs);
|
||||
int64_t fs_tell(fs_file_t *file);
|
||||
int64_t fs_size(fs_file_t *file);
|
||||
bool fs_eof(fs_file_t *file);
|
||||
|
||||
void *fs_load_file(const char *vpath, uint64_t *outsize);
|
||||
const char *fs_readline(fs_file_t *file, char *dst, uint64_t size);
|
||||
|
||||
// tries to find the first file with the filename that starts with `prefix`
|
||||
// puts full filename into `outname` and returns it or returns NULL if nothing matches
|
||||
const char *fs_match(char *outname, const size_t outlen, const char *prefix);
|
||||
|
||||
// takes a virtual path and prepends the write path to it
|
||||
const char *fs_get_write_path(const char *vpath);
|
||||
|
||||
// expands special chars in paths and changes backslashes to forward slashes
|
||||
const char *fs_convert_path(char *buf, const size_t bufsiz, const char *path);
|
||||
|
||||
/* these operate on the real filesystem and are used by fs_packtype_dir */
|
||||
|
||||
bool fs_sys_walk(const char *base, walk_fn_t walk, void *user, const bool recur);
|
||||
fs_pathlist_t fs_sys_enumerate(const char *base, const bool recur);
|
||||
bool fs_sys_file_exists(const char *name);
|
||||
bool fs_sys_dir_exists(const char *name);
|
||||
bool fs_sys_mkdir(const char *name); // creates with 0777 by default
|
||||
|
||||
#endif // _SM64_FS_H_
|
|
@ -0,0 +1,117 @@
|
|||
#include <stdlib.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
#include <stddef.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include "macros.h"
|
||||
#include "../platform.h"
|
||||
#include "fs.h"
|
||||
|
||||
static void *pack_dir_mount(const char *realpath) {
|
||||
if (!fs_sys_dir_exists(realpath))
|
||||
return NULL;
|
||||
// the pack is actually just the real folder path
|
||||
void *pack = (void *)sys_strdup(realpath);
|
||||
return pack;
|
||||
}
|
||||
|
||||
static void pack_dir_unmount(void *pack) {
|
||||
free(pack);
|
||||
}
|
||||
|
||||
struct walkdata_s {
|
||||
size_t baselen;
|
||||
walk_fn_t userwalk;
|
||||
void *userdata;
|
||||
};
|
||||
|
||||
// wrap the actual user walk function to return virtual paths instead of real paths
|
||||
static bool packdir_walkfn(void *userdata, const char *path) {
|
||||
struct walkdata_s *walk = (struct walkdata_s *)userdata;
|
||||
return walk->userwalk(walk->userdata, path + walk->baselen);
|
||||
}
|
||||
|
||||
static fs_walk_result_t pack_dir_walk(void *pack, const char *base, walk_fn_t walkfn, void *user, const bool recur) {
|
||||
char path[SYS_MAX_PATH];
|
||||
snprintf(path, SYS_MAX_PATH, "%s/%s", (const char *)pack, base);
|
||||
|
||||
if (!fs_sys_dir_exists(path))
|
||||
return FS_WALK_NOTFOUND;
|
||||
|
||||
struct walkdata_s walkdata = { strlen((const char *)pack) + 1, walkfn, user };
|
||||
return fs_sys_walk(path, packdir_walkfn, &walkdata, recur);
|
||||
}
|
||||
|
||||
static bool pack_dir_is_file(void *pack, const char *fname) {
|
||||
char path[SYS_MAX_PATH];
|
||||
snprintf(path, sizeof(path), "%s/%s", (const char *)pack, fname);
|
||||
return fs_sys_dir_exists(path);
|
||||
}
|
||||
|
||||
static bool pack_dir_is_dir(void *pack, const char *fname) {
|
||||
char path[SYS_MAX_PATH];
|
||||
snprintf(path, sizeof(path), "%s/%s", (const char *)pack, fname);
|
||||
return fs_sys_file_exists(path);
|
||||
}
|
||||
|
||||
static fs_file_t *pack_dir_open(void *pack, const char *vpath) {
|
||||
char path[SYS_MAX_PATH];
|
||||
snprintf(path, sizeof(path), "%s/%s", (const char *)pack, vpath);
|
||||
|
||||
FILE *f = fopen(path, "rb");
|
||||
if (!f) return NULL;
|
||||
|
||||
fs_file_t *fsfile = malloc(sizeof(fs_file_t));
|
||||
if (!fsfile) { fclose(f); return NULL; }
|
||||
|
||||
fsfile->parent = NULL;
|
||||
fsfile->handle = f;
|
||||
|
||||
return fsfile;
|
||||
}
|
||||
|
||||
static void pack_dir_close(UNUSED void *pack, fs_file_t *file) {
|
||||
fclose((FILE *)file->handle);
|
||||
free(file);
|
||||
}
|
||||
|
||||
static int64_t pack_dir_read(UNUSED void *pack, fs_file_t *file, void *buf, const uint64_t size) {
|
||||
return fread(buf, 1, size, (FILE *)file->handle);
|
||||
}
|
||||
|
||||
static bool pack_dir_seek(UNUSED void *pack, fs_file_t *file, const int64_t ofs) {
|
||||
return fseek((FILE *)file->handle, ofs, SEEK_SET) == 0;
|
||||
}
|
||||
|
||||
static int64_t pack_dir_tell(UNUSED void *pack, fs_file_t *file) {
|
||||
return ftell((FILE *)file->handle);
|
||||
}
|
||||
|
||||
static int64_t pack_dir_size(UNUSED void *pack, fs_file_t *file) {
|
||||
int64_t oldofs = ftell((FILE *)file->handle);
|
||||
fseek((FILE *)file->handle, 0, SEEK_END);
|
||||
int64_t size = ftell((FILE *)file->handle);
|
||||
fseek((FILE *)file->handle, oldofs, SEEK_SET);
|
||||
return size;
|
||||
}
|
||||
|
||||
static bool pack_dir_eof(UNUSED void *pack, fs_file_t *file) {
|
||||
return feof((FILE *)file->handle);
|
||||
}
|
||||
|
||||
fs_packtype_t fs_packtype_dir = {
|
||||
"",
|
||||
pack_dir_mount,
|
||||
pack_dir_unmount,
|
||||
pack_dir_walk,
|
||||
pack_dir_is_file,
|
||||
pack_dir_is_dir,
|
||||
pack_dir_open,
|
||||
pack_dir_read,
|
||||
pack_dir_seek,
|
||||
pack_dir_tell,
|
||||
pack_dir_size,
|
||||
pack_dir_eof,
|
||||
pack_dir_close,
|
||||
};
|
|
@ -0,0 +1,486 @@
|
|||
#include <stdlib.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
#include <stddef.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <tinfl.h>
|
||||
|
||||
#include "macros.h"
|
||||
#include "../platform.h"
|
||||
#include "fs.h"
|
||||
#include "dirtree.h"
|
||||
|
||||
#define ZIP_BUFSIZE 16384
|
||||
#define ZIP_EOCD_BUFSIZE 65578
|
||||
|
||||
#define ZIP_LFH_SIG 0x04034b50
|
||||
#define ZIP_CDH_SIG 0x02014b50
|
||||
#define ZIP_EOCD_SIG 0x06054b50
|
||||
|
||||
typedef struct {
|
||||
fs_dirtree_t tree; // this should always be first, so this could be used as a dirtree root
|
||||
const char *realpath; // physical path to the zip file
|
||||
FILE *zipf; // open zip file handle, if any
|
||||
} zip_pack_t;
|
||||
|
||||
typedef struct {
|
||||
fs_dirtree_entry_t tree; // this should always be first, so this could be used as a dirtree entry
|
||||
uint64_t ofs; // offset to compressed data in zip
|
||||
uint16_t bits; // general purpose zip flags
|
||||
uint16_t comptype; // compression method
|
||||
uint32_t crc; // CRC-32
|
||||
uint64_t comp_size; // size of compressed data in zip
|
||||
uint64_t uncomp_size; // size of decompressed data
|
||||
uint16_t attr_int; // internal attributes
|
||||
uint32_t attr_ext; // external attributes
|
||||
bool ofs_fixed; // if true, `ofs` points to the file data, otherwise to LFH
|
||||
} zip_entry_t;
|
||||
|
||||
typedef struct {
|
||||
zip_entry_t *entry; // the dirtree entry of this file
|
||||
uint32_t comp_pos; // read position in compressed data
|
||||
uint32_t uncomp_pos; // read position in uncompressed data
|
||||
uint8_t *buffer; // decompression buffer (if compressed)
|
||||
z_stream zstream; // tinfl zlib stream
|
||||
FILE *fstream; // duplicate of zipf of the parent zip file
|
||||
} zip_file_t;
|
||||
|
||||
static int64_t zip_find_eocd(FILE *f, int64_t *outlen) {
|
||||
// the EOCD is somewhere in the last 65557 bytes of the file
|
||||
// get the total file size
|
||||
fseek(f, 0, SEEK_END);
|
||||
const int64_t fsize = ftell(f);
|
||||
if (fsize <= 16) return -1; // probably not a zip
|
||||
|
||||
const int64_t rx = (fsize < ZIP_EOCD_BUFSIZE ? fsize : ZIP_EOCD_BUFSIZE);
|
||||
uint8_t *buf = malloc(rx);
|
||||
if (!buf) return -1;
|
||||
|
||||
// read that entire chunk and search for EOCD backwards from the end
|
||||
fseek(f, fsize - rx, SEEK_SET);
|
||||
if (fread(buf, rx, 1, f)) {
|
||||
for (int64_t i = rx - 8; i >= 0; --i) {
|
||||
if ((buf[i + 0] == 0x50) && (buf[i + 1] == 0x4B) &&
|
||||
(buf[i + 2] == 0x05) && (buf[i + 3] == 0x06)) {
|
||||
// gotem
|
||||
free(buf);
|
||||
if (outlen) *outlen = fsize;
|
||||
return fsize - rx + i;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
free(buf);
|
||||
return -1;
|
||||
}
|
||||
|
||||
static bool zip_parse_eocd(FILE *f, uint64_t *cdir_ofs, uint64_t *data_ofs, uint64_t *count) {
|
||||
int64_t fsize = 0;
|
||||
|
||||
// EOCD record struct
|
||||
struct eocd_s {
|
||||
uint32_t sig;
|
||||
uint16_t this_disk;
|
||||
uint16_t cdir_disk;
|
||||
uint16_t disk_entry_count;
|
||||
uint16_t total_entry_count;
|
||||
uint32_t cdir_size;
|
||||
uint32_t cdir_ofs;
|
||||
uint16_t comment_len;
|
||||
// zip comment follows
|
||||
} __attribute__((__packed__));
|
||||
struct eocd_s eocd;
|
||||
|
||||
// find the EOCD and seek to it
|
||||
int64_t pos = zip_find_eocd(f, &fsize);
|
||||
if (pos < 0) return false;
|
||||
fseek(f, pos, SEEK_SET);
|
||||
|
||||
// read it
|
||||
if (!fread(&eocd, sizeof(eocd), 1, f)) return false;
|
||||
|
||||
// double check the sig
|
||||
if (LE_TO_HOST32(eocd.sig) != ZIP_EOCD_SIG) return false;
|
||||
|
||||
// disks should all be 0
|
||||
if (eocd.this_disk || eocd.cdir_disk) return false;
|
||||
|
||||
// total entry count should be the same as disk entry count
|
||||
if (eocd.disk_entry_count != eocd.total_entry_count) return false;
|
||||
|
||||
*count = LE_TO_HOST16(eocd.total_entry_count);
|
||||
*cdir_ofs = LE_TO_HOST32(eocd.cdir_ofs);
|
||||
eocd.cdir_size = LE_TO_HOST32(eocd.cdir_size);
|
||||
|
||||
// end of central dir can't be before central dir
|
||||
if ((uint64_t)pos < *cdir_ofs + eocd.cdir_size) return false;
|
||||
|
||||
*data_ofs = (uint64_t)(pos - (*cdir_ofs + eocd.cdir_size));
|
||||
*cdir_ofs += *data_ofs;
|
||||
|
||||
// make sure end of comment matches end of file
|
||||
eocd.comment_len = LE_TO_HOST16(eocd.comment_len);
|
||||
return ((pos + 22 + eocd.comment_len) == fsize);
|
||||
}
|
||||
|
||||
static bool zip_fixup_offset(zip_file_t *zipfile) {
|
||||
// LFH record struct
|
||||
struct lfh_s {
|
||||
uint32_t sig;
|
||||
uint16_t version_required;
|
||||
uint16_t bits;
|
||||
uint16_t comptype;
|
||||
uint16_t mod_time;
|
||||
uint16_t mod_date;
|
||||
uint32_t crc;
|
||||
uint32_t comp_size;
|
||||
uint32_t uncomp_size;
|
||||
uint16_t fname_len;
|
||||
uint16_t extra_len;
|
||||
// file name, extra field and data follow
|
||||
} __attribute__((__packed__));
|
||||
|
||||
struct lfh_s lfh;
|
||||
|
||||
zip_entry_t *ent = zipfile->entry;
|
||||
|
||||
fseek(zipfile->fstream, ent->ofs, SEEK_SET);
|
||||
if (!fread(&lfh, sizeof(lfh), 1, zipfile->fstream)) return false;
|
||||
|
||||
// we only need these two
|
||||
lfh.fname_len = LE_TO_HOST16(lfh.fname_len);
|
||||
lfh.extra_len = LE_TO_HOST16(lfh.extra_len);
|
||||
|
||||
// ofs will now point to actual data
|
||||
ent->ofs += sizeof(lfh) + lfh.fname_len + lfh.extra_len;
|
||||
ent->ofs_fixed = true; // only need to do this once
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static zip_entry_t *zip_load_entry(FILE *f, fs_dirtree_t *tree, const uint64_t data_ofs) {
|
||||
// CDH record struct
|
||||
struct cdh_s {
|
||||
uint32_t sig;
|
||||
uint16_t version_used;
|
||||
uint16_t version_required;
|
||||
uint16_t bits;
|
||||
uint16_t comptype;
|
||||
uint16_t mod_time;
|
||||
uint16_t mod_date;
|
||||
uint32_t crc;
|
||||
uint32_t comp_size;
|
||||
uint32_t uncomp_size;
|
||||
uint16_t fname_len;
|
||||
uint16_t extra_len;
|
||||
uint16_t comment_len;
|
||||
uint16_t start_disk;
|
||||
uint16_t attr_int;
|
||||
uint32_t attr_ext;
|
||||
uint32_t lfh_ofs;
|
||||
// file name, extra field and comment follow
|
||||
} __attribute__((__packed__));
|
||||
|
||||
struct cdh_s cdh;
|
||||
zip_entry_t zipent;
|
||||
|
||||
memset(&zipent, 0, sizeof(zipent));
|
||||
|
||||
if (!fread(&cdh, sizeof(cdh), 1, f)) return NULL;
|
||||
|
||||
// check cdir entry header signature
|
||||
if (LE_TO_HOST32(cdh.sig) != ZIP_CDH_SIG) return NULL;
|
||||
|
||||
// byteswap and copy some important fields
|
||||
zipent.bits = LE_TO_HOST16(cdh.bits);
|
||||
zipent.comptype = LE_TO_HOST16(cdh.comptype);
|
||||
zipent.crc = LE_TO_HOST32(cdh.crc);
|
||||
zipent.comp_size = LE_TO_HOST32(cdh.comp_size);
|
||||
zipent.uncomp_size = LE_TO_HOST32(cdh.uncomp_size);
|
||||
zipent.ofs = LE_TO_HOST32(cdh.lfh_ofs);
|
||||
zipent.attr_int = LE_TO_HOST16(cdh.attr_int);
|
||||
zipent.attr_ext = LE_TO_HOST32(cdh.attr_ext);
|
||||
cdh.fname_len = LE_TO_HOST16(cdh.fname_len);
|
||||
cdh.comment_len = LE_TO_HOST16(cdh.comment_len);
|
||||
cdh.extra_len = LE_TO_HOST16(cdh.extra_len);
|
||||
|
||||
// read the name
|
||||
char *name = calloc(1, cdh.fname_len + 1);
|
||||
if (!name) return NULL;
|
||||
if (!fread(name, cdh.fname_len, 1, f)) { free(name); return NULL; }
|
||||
|
||||
// this is a directory if the name ends in a path separator
|
||||
bool is_dir = false;
|
||||
if (name[cdh.fname_len - 1] == '/') {
|
||||
is_dir = true;
|
||||
name[cdh.fname_len - 1] = 0;
|
||||
}
|
||||
name[cdh.fname_len] = 0;
|
||||
|
||||
// add to directory tree
|
||||
zip_entry_t *retent = (zip_entry_t *)fs_dirtree_add(tree, name, is_dir);
|
||||
free(name);
|
||||
if (!retent) return NULL;
|
||||
|
||||
// copy the data we read into the new entry
|
||||
zipent.tree = retent->tree;
|
||||
memcpy(retent, &zipent, sizeof(zipent));
|
||||
|
||||
// this points to the LFH now; will be fixed up on file open
|
||||
// while the CDH includes an "extra field length" field, it's usually different
|
||||
retent->ofs += data_ofs;
|
||||
|
||||
// skip to the next CDH
|
||||
fseek(f, cdh.extra_len + cdh.comment_len, SEEK_CUR);
|
||||
|
||||
return retent;
|
||||
}
|
||||
|
||||
static inline bool zip_load_entries(FILE *f, fs_dirtree_t *tree, const uint64_t cdir_ofs, const uint64_t data_ofs, const uint64_t count) {
|
||||
fseek(f, cdir_ofs, SEEK_SET);
|
||||
for (uint64_t i = 0; i < count; ++i) {
|
||||
if (!zip_load_entry(f, tree, data_ofs))
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
static inline bool is_zip(FILE *f) {
|
||||
uint32_t sig = 0;
|
||||
if (fread(&sig, sizeof(sig), 1, f)) {
|
||||
// the first LFH might be at the start of the zip
|
||||
if (LE_TO_HOST32(sig) == ZIP_LFH_SIG)
|
||||
return true;
|
||||
// no signature, might still be a zip because fuck you
|
||||
// the only way now is to try and find the end of central directory
|
||||
return zip_find_eocd(f, NULL) >= 0;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
static void *pack_zip_mount(const char *realpath) {
|
||||
uint64_t cdir_ofs, data_ofs, count;
|
||||
zip_pack_t *pack = NULL;
|
||||
FILE *f = NULL;
|
||||
|
||||
f = fopen(realpath, "rb");
|
||||
if (!f) goto _fail;
|
||||
|
||||
if (!is_zip(f)) goto _fail;
|
||||
|
||||
pack = calloc(1, sizeof(zip_pack_t));
|
||||
if (!pack) goto _fail;
|
||||
|
||||
if (!zip_parse_eocd(f, &cdir_ofs, &data_ofs, &count))
|
||||
goto _fail;
|
||||
|
||||
if (!fs_dirtree_init(&pack->tree, sizeof(zip_entry_t)))
|
||||
goto _fail;
|
||||
|
||||
if (!zip_load_entries(f, &pack->tree, cdir_ofs, data_ofs, count))
|
||||
goto _fail;
|
||||
|
||||
pack->realpath = sys_strdup(realpath);
|
||||
pack->zipf = f;
|
||||
|
||||
return pack;
|
||||
|
||||
_fail:
|
||||
if (f) fclose(f);
|
||||
if (pack) free(pack);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static void pack_zip_unmount(void *pack) {
|
||||
zip_pack_t *zip = (zip_pack_t *)pack;
|
||||
fs_dirtree_free(&zip->tree);
|
||||
if (zip->realpath) free((void *)zip->realpath);
|
||||
if (zip->zipf) fclose(zip->zipf);
|
||||
free(zip);
|
||||
}
|
||||
|
||||
static bool pack_zip_is_file(void *pack, const char *fname) {
|
||||
zip_entry_t *ent = (zip_entry_t *)fs_dirtree_find((fs_dirtree_t *)pack, fname);
|
||||
return ent && !ent->tree.is_dir;
|
||||
}
|
||||
|
||||
static bool pack_zip_is_dir(void *pack, const char *fname) {
|
||||
zip_entry_t *ent = (zip_entry_t *)fs_dirtree_find((fs_dirtree_t *)pack, fname);
|
||||
return ent && ent->tree.is_dir;
|
||||
}
|
||||
|
||||
static inline void pack_zip_close_zipfile(zip_file_t *zipfile) {
|
||||
if (zipfile->buffer) {
|
||||
inflateEnd(&zipfile->zstream);
|
||||
free(zipfile->buffer);
|
||||
}
|
||||
if (zipfile->fstream) fclose(zipfile->fstream);
|
||||
free(zipfile);
|
||||
}
|
||||
|
||||
static fs_file_t *pack_zip_open(void *pack, const char *vpath) {
|
||||
fs_file_t *fsfile = NULL;
|
||||
zip_file_t *zipfile = NULL;
|
||||
zip_pack_t *zip = (zip_pack_t *)pack;
|
||||
zip_entry_t *ent = (zip_entry_t *)fs_dirtree_find((fs_dirtree_t *)zip, vpath);
|
||||
if (!ent || ent->tree.is_dir) goto _fail; // we're expecting a fucking file here
|
||||
|
||||
zipfile = calloc(1, sizeof(zip_file_t));
|
||||
if (!zipfile) goto _fail;
|
||||
zipfile->entry = ent;
|
||||
|
||||
// obtain an additional file descriptor
|
||||
// fdopen(dup(fileno())) is not very portable and might not create separate state
|
||||
zipfile->fstream = fopen(zip->realpath, "rb");
|
||||
if (!zipfile->fstream) goto _fail;
|
||||
|
||||
// make ent->ofs point to the actual file data if it doesn't already
|
||||
if (!ent->ofs_fixed)
|
||||
if (!zip_fixup_offset(zipfile))
|
||||
goto _fail; // this shouldn't generally happen but oh well
|
||||
|
||||
// if there's compression, assume it's zlib
|
||||
if (ent->comptype != 0) {
|
||||
zipfile->buffer = malloc(ZIP_BUFSIZE);
|
||||
if (!zipfile->buffer)
|
||||
goto _fail;
|
||||
if (inflateInit2(&zipfile->zstream, -MAX_WBITS) != Z_OK)
|
||||
goto _fail;
|
||||
}
|
||||
|
||||
fsfile = malloc(sizeof(fs_file_t));
|
||||
if (!fsfile) goto _fail;
|
||||
fsfile->handle = zipfile;
|
||||
fsfile->parent = NULL;
|
||||
|
||||
// point to the start of the file data
|
||||
fseek(zipfile->fstream, ent->ofs, SEEK_SET);
|
||||
|
||||
return fsfile;
|
||||
|
||||
_fail:
|
||||
if (zipfile) pack_zip_close_zipfile(zipfile);
|
||||
if (fsfile) free(fsfile);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static void pack_zip_close(UNUSED void *pack, fs_file_t *file) {
|
||||
if (!file) return;
|
||||
|
||||
zip_file_t *zipfile = (zip_file_t *)file->handle;
|
||||
if (zipfile) pack_zip_close_zipfile(zipfile);
|
||||
|
||||
free(file);
|
||||
}
|
||||
|
||||
static int64_t pack_zip_read(UNUSED void *pack, fs_file_t *file, void *buf, const uint64_t size) {
|
||||
zip_file_t *zipfile = (zip_file_t *)file->handle;
|
||||
zip_entry_t *ent = zipfile->entry;
|
||||
|
||||
int64_t avail = ent->uncomp_size - zipfile->uncomp_pos;
|
||||
int64_t max_read = ((int64_t)size > avail) ? avail : (int64_t)size;
|
||||
int64_t rx = 0;
|
||||
int err = 0;
|
||||
|
||||
if (max_read == 0) return 0;
|
||||
|
||||
if (ent->comptype == 0) {
|
||||
// no compression, just read
|
||||
rx = fread(buf, 1, size, zipfile->fstream);
|
||||
} else {
|
||||
zipfile->zstream.next_out = buf;
|
||||
zipfile->zstream.avail_out = (unsigned int)max_read;
|
||||
while (rx < max_read) {
|
||||
const uint32_t before = (uint32_t)zipfile->zstream.total_out;
|
||||
// check if we ran out of compressed bytes and read more if we did
|
||||
if (zipfile->zstream.avail_in == 0) {
|
||||
int32_t comp_rx = ent->comp_size - zipfile->comp_pos;
|
||||
if (comp_rx > 0) {
|
||||
if (comp_rx > ZIP_BUFSIZE) comp_rx = ZIP_BUFSIZE;
|
||||
comp_rx = fread(zipfile->buffer, 1, comp_rx, zipfile->fstream);
|
||||
if (comp_rx == 0) break;
|
||||
zipfile->comp_pos += (uint32_t)comp_rx;
|
||||
zipfile->zstream.next_in = zipfile->buffer;
|
||||
zipfile->zstream.avail_in = (unsigned int)comp_rx;
|
||||
}
|
||||
}
|
||||
// inflate
|
||||
err = inflate(&zipfile->zstream, Z_SYNC_FLUSH);
|
||||
rx += zipfile->zstream.total_out - before;
|
||||
if (err != Z_OK) break;
|
||||
}
|
||||
}
|
||||
|
||||
zipfile->uncomp_pos += rx;
|
||||
return rx;
|
||||
}
|
||||
|
||||
static bool pack_zip_seek(UNUSED void *pack, fs_file_t *file, const int64_t ofs) {
|
||||
zip_file_t *zipfile = (zip_file_t *)file->handle;
|
||||
zip_entry_t *ent = zipfile->entry;
|
||||
uint8_t buf[512];
|
||||
|
||||
if (ofs > (int64_t)ent->uncomp_size) return false;
|
||||
|
||||
if (ent->comptype == 0) {
|
||||
if (fseek(zipfile->fstream, ofs + ent->ofs, SEEK_SET) == 0)
|
||||
zipfile->uncomp_pos = ofs;
|
||||
} else {
|
||||
// if seeking backwards, gotta redecode the stream from the start until that point
|
||||
// so we make a copy of the zstream and clear it with a new one
|
||||
if (ofs < zipfile->uncomp_pos) {
|
||||
z_stream zstream;
|
||||
memset(&zstream, 0, sizeof(zstream));
|
||||
if (inflateInit2(&zstream, -MAX_WBITS) != Z_OK)
|
||||
return false;
|
||||
// reset the underlying file handle back to the start
|
||||
if (fseek(zipfile->fstream, ent->ofs, SEEK_SET) != 0)
|
||||
return false;
|
||||
// free and replace the old one
|
||||
inflateEnd(&zipfile->zstream);
|
||||
memcpy(&zipfile->zstream, &zstream, sizeof(zstream));
|
||||
zipfile->uncomp_pos = zipfile->comp_pos = 0;
|
||||
}
|
||||
// continue decoding the stream until we hit the new offset
|
||||
while (zipfile->uncomp_pos != ofs) {
|
||||
uint32_t max_read = (uint32_t)(ofs - zipfile->uncomp_pos);
|
||||
if (max_read > sizeof(buf)) max_read = sizeof(buf);
|
||||
if (pack_zip_read(pack, file, buf, max_read) != max_read)
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static int64_t pack_zip_tell(UNUSED void *pack, fs_file_t *file) {
|
||||
return ((zip_file_t *)file->handle)->uncomp_pos;
|
||||
}
|
||||
|
||||
static int64_t pack_zip_size(UNUSED void *pack, fs_file_t *file) {
|
||||
zip_file_t *zipfile = (zip_file_t *)file->handle;
|
||||
return zipfile->entry->uncomp_size;
|
||||
}
|
||||
|
||||
static bool pack_zip_eof(UNUSED void *pack, fs_file_t *file) {
|
||||
zip_file_t *zipfile = (zip_file_t *)file->handle;
|
||||
return zipfile->uncomp_pos >= zipfile->entry->uncomp_size;
|
||||
}
|
||||
|
||||
fs_packtype_t fs_packtype_zip = {
|
||||
"zip",
|
||||
pack_zip_mount,
|
||||
pack_zip_unmount,
|
||||
fs_dirtree_walk,
|
||||
pack_zip_is_file,
|
||||
pack_zip_is_dir,
|
||||
pack_zip_open,
|
||||
pack_zip_read,
|
||||
pack_zip_seek,
|
||||
pack_zip_tell,
|
||||
pack_zip_size,
|
||||
pack_zip_eof,
|
||||
pack_zip_close,
|
||||
};
|
|
@ -23,3 +23,4 @@ enum {
|
|||
#define SHADER_OPT_ALPHA (1 << 24)
|
||||
#define SHADER_OPT_FOG (1 << 25)
|
||||
#define SHADER_OPT_TEXTURE_EDGE (1 << 26)
|
||||
#define SHADER_OPT_NOISE (1 << 27)
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,10 @@
|
|||
#ifndef GFX_DIRECT3D11_H
|
||||
#define GFX_DIRECT3D11_H
|
||||
|
||||
#include "gfx_window_manager_api.h"
|
||||
#include "gfx_rendering_api.h"
|
||||
|
||||
extern struct GfxWindowManagerAPI gfx_dxgi;
|
||||
extern struct GfxRenderingAPI gfx_d3d11_api;
|
||||
|
||||
#endif
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,10 @@
|
|||
#ifndef GFX_DIRECT3D12_H
|
||||
#define GFX_DIRECT3D12_H
|
||||
|
||||
#include "gfx_window_manager_api.h"
|
||||
#include "gfx_rendering_api.h"
|
||||
|
||||
extern struct GfxWindowManagerAPI gfx_dxgi;
|
||||
extern struct GfxRenderingAPI gfx_d3d12_api;
|
||||
|
||||
#endif
|
|
@ -0,0 +1,143 @@
|
|||
#if (defined(RAPI_D3D11) || defined(RAPI_D3D12)) && (defined(_WIN32) || defined(_WIN64))
|
||||
|
||||
#include <cstdio>
|
||||
|
||||
extern "C" {
|
||||
#include "../platform.h"
|
||||
}
|
||||
|
||||
#include "gfx_direct3d_common.h"
|
||||
#include "gfx_cc.h"
|
||||
|
||||
void ThrowIfFailed(HRESULT res) {
|
||||
if (FAILED(res))
|
||||
sys_fatal("error while initializing D3D:\nerror code 0x%08X", res);
|
||||
}
|
||||
|
||||
void ThrowIfFailed(HRESULT res, HWND h_wnd, const char *message) {
|
||||
if (FAILED(res))
|
||||
sys_fatal("%s\nerror code 0x%08X", message, res);
|
||||
}
|
||||
|
||||
void get_cc_features(uint32_t shader_id, CCFeatures *cc_features) {
|
||||
for (int i = 0; i < 4; i++) {
|
||||
cc_features->c[0][i] = (shader_id >> (i * 3)) & 7;
|
||||
cc_features->c[1][i] = (shader_id >> (12 + i * 3)) & 7;
|
||||
}
|
||||
|
||||
cc_features->opt_alpha = (shader_id & SHADER_OPT_ALPHA) != 0;
|
||||
cc_features->opt_fog = (shader_id & SHADER_OPT_FOG) != 0;
|
||||
cc_features->opt_texture_edge = (shader_id & SHADER_OPT_TEXTURE_EDGE) != 0;
|
||||
cc_features->opt_noise = (shader_id & SHADER_OPT_NOISE) != 0;
|
||||
|
||||
cc_features->used_textures[0] = false;
|
||||
cc_features->used_textures[1] = false;
|
||||
cc_features->num_inputs = 0;
|
||||
|
||||
for (int i = 0; i < 2; i++) {
|
||||
for (int j = 0; j < 4; j++) {
|
||||
if (cc_features->c[i][j] >= SHADER_INPUT_1 && cc_features->c[i][j] <= SHADER_INPUT_4) {
|
||||
if (cc_features->c[i][j] > cc_features->num_inputs) {
|
||||
cc_features->num_inputs = cc_features->c[i][j];
|
||||
}
|
||||
}
|
||||
if (cc_features->c[i][j] == SHADER_TEXEL0 || cc_features->c[i][j] == SHADER_TEXEL0A) {
|
||||
cc_features->used_textures[0] = true;
|
||||
}
|
||||
if (cc_features->c[i][j] == SHADER_TEXEL1) {
|
||||
cc_features->used_textures[1] = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
cc_features->do_single[0] = cc_features->c[0][2] == 0;
|
||||
cc_features->do_single[1] = cc_features->c[1][2] == 0;
|
||||
cc_features->do_multiply[0] = cc_features->c[0][1] == 0 && cc_features->c[0][3] == 0;
|
||||
cc_features->do_multiply[1] = cc_features->c[1][1] == 0 && cc_features->c[1][3] == 0;
|
||||
cc_features->do_mix[0] = cc_features->c[0][1] == cc_features->c[0][3];
|
||||
cc_features->do_mix[1] = cc_features->c[1][1] == cc_features->c[1][3];
|
||||
cc_features->color_alpha_same = (shader_id & 0xfff) == ((shader_id >> 12) & 0xfff);
|
||||
}
|
||||
|
||||
void append_str(char *buf, size_t *len, const char *str) {
|
||||
while (*str != '\0') buf[(*len)++] = *str++;
|
||||
}
|
||||
|
||||
void append_line(char *buf, size_t *len, const char *str) {
|
||||
while (*str != '\0') buf[(*len)++] = *str++;
|
||||
buf[(*len)++] = '\r';
|
||||
buf[(*len)++] = '\n';
|
||||
}
|
||||
|
||||
const char *shader_item_to_str(uint32_t item, bool with_alpha, bool only_alpha, bool inputs_have_alpha, bool hint_single_element) {
|
||||
if (!only_alpha) {
|
||||
switch (item) {
|
||||
default:
|
||||
case SHADER_0:
|
||||
return with_alpha ? "float4(0.0, 0.0, 0.0, 0.0)" : "float3(0.0, 0.0, 0.0)";
|
||||
case SHADER_INPUT_1:
|
||||
return with_alpha || !inputs_have_alpha ? "input.input1" : "input.input1.rgb";
|
||||
case SHADER_INPUT_2:
|
||||
return with_alpha || !inputs_have_alpha ? "input.input2" : "input.input2.rgb";
|
||||
case SHADER_INPUT_3:
|
||||
return with_alpha || !inputs_have_alpha ? "input.input3" : "input.input3.rgb";
|
||||
case SHADER_INPUT_4:
|
||||
return with_alpha || !inputs_have_alpha ? "input.input4" : "input.input4.rgb";
|
||||
case SHADER_TEXEL0:
|
||||
return with_alpha ? "texVal0" : "texVal0.rgb";
|
||||
case SHADER_TEXEL0A:
|
||||
return hint_single_element ? "texVal0.a" : (with_alpha ? "float4(texVal0.a, texVal0.a, texVal0.a, texVal0.a)" : "float3(texVal0.a, texVal0.a, texVal0.a)");
|
||||
case SHADER_TEXEL1:
|
||||
return with_alpha ? "texVal1" : "texVal1.rgb";
|
||||
}
|
||||
} else {
|
||||
switch (item) {
|
||||
default:
|
||||
case SHADER_0:
|
||||
return "0.0";
|
||||
case SHADER_INPUT_1:
|
||||
return "input.input1.a";
|
||||
case SHADER_INPUT_2:
|
||||
return "input.input2.a";
|
||||
case SHADER_INPUT_3:
|
||||
return "input.input3.a";
|
||||
case SHADER_INPUT_4:
|
||||
return "input.input4.a";
|
||||
case SHADER_TEXEL0:
|
||||
return "texVal0.a";
|
||||
case SHADER_TEXEL0A:
|
||||
return "texVal0.a";
|
||||
case SHADER_TEXEL1:
|
||||
return "texVal1.a";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void append_formula(char *buf, size_t *len, uint8_t c[2][4], bool do_single, bool do_multiply, bool do_mix, bool with_alpha, bool only_alpha, bool opt_alpha) {
|
||||
if (do_single) {
|
||||
append_str(buf, len, shader_item_to_str(c[only_alpha][3], with_alpha, only_alpha, opt_alpha, false));
|
||||
} else if (do_multiply) {
|
||||
append_str(buf, len, shader_item_to_str(c[only_alpha][0], with_alpha, only_alpha, opt_alpha, false));
|
||||
append_str(buf, len, " * ");
|
||||
append_str(buf, len, shader_item_to_str(c[only_alpha][2], with_alpha, only_alpha, opt_alpha, true));
|
||||
} else if (do_mix) {
|
||||
append_str(buf, len, "lerp(");
|
||||
append_str(buf, len, shader_item_to_str(c[only_alpha][1], with_alpha, only_alpha, opt_alpha, false));
|
||||
append_str(buf, len, ", ");
|
||||
append_str(buf, len, shader_item_to_str(c[only_alpha][0], with_alpha, only_alpha, opt_alpha, false));
|
||||
append_str(buf, len, ", ");
|
||||
append_str(buf, len, shader_item_to_str(c[only_alpha][2], with_alpha, only_alpha, opt_alpha, true));
|
||||
append_str(buf, len, ")");
|
||||
} else {
|
||||
append_str(buf, len, "(");
|
||||
append_str(buf, len, shader_item_to_str(c[only_alpha][0], with_alpha, only_alpha, opt_alpha, false));
|
||||
append_str(buf, len, " - ");
|
||||
append_str(buf, len, shader_item_to_str(c[only_alpha][1], with_alpha, only_alpha, opt_alpha, false));
|
||||
append_str(buf, len, ") * ");
|
||||
append_str(buf, len, shader_item_to_str(c[only_alpha][2], with_alpha, only_alpha, opt_alpha, true));
|
||||
append_str(buf, len, " + ");
|
||||
append_str(buf, len, shader_item_to_str(c[only_alpha][3], with_alpha, only_alpha, opt_alpha, false));
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
|
@ -0,0 +1,33 @@
|
|||
#if defined(RAPI_D3D11) || defined(RAPI_D3D12)
|
||||
|
||||
#ifndef GFX_DIRECT3D_COMMON_H
|
||||
#define GFX_DIRECT3D_COMMON_H
|
||||
|
||||
#include <stdint.h>
|
||||
#include <windows.h>
|
||||
|
||||
struct CCFeatures {
|
||||
uint8_t c[2][4];
|
||||
bool opt_alpha;
|
||||
bool opt_fog;
|
||||
bool opt_texture_edge;
|
||||
bool opt_noise;
|
||||
bool used_textures[2];
|
||||
uint32_t num_inputs;
|
||||
bool do_single[2];
|
||||
bool do_multiply[2];
|
||||
bool do_mix[2];
|
||||
bool color_alpha_same;
|
||||
};
|
||||
|
||||
void ThrowIfFailed(HRESULT res);
|
||||
void ThrowIfFailed(HRESULT res, HWND h_wnd, const char *message);
|
||||
void get_cc_features(uint32_t shader_id, CCFeatures *shader_features);
|
||||
void append_str(char *buf, size_t *len, const char *str);
|
||||
void append_line(char *buf, size_t *len, const char *str);
|
||||
const char *shader_item_to_str(uint32_t item, bool with_alpha, bool only_alpha, bool inputs_have_alpha, bool hint_single_element);
|
||||
void append_formula(char *buf, size_t *len, uint8_t c[2][4], bool do_single, bool do_multiply, bool do_mix, bool with_alpha, bool only_alpha, bool opt_alpha);
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
|
@ -1,41 +1,40 @@
|
|||
#ifndef LEGACY_GL
|
||||
#ifdef RAPI_GL
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
#ifndef _LANGUAGE_C
|
||||
#define _LANGUAGE_C
|
||||
# define _LANGUAGE_C
|
||||
#endif
|
||||
#include <PR/gbi.h>
|
||||
|
||||
#ifdef __MINGW32__
|
||||
#define FOR_WINDOWS 1
|
||||
# define FOR_WINDOWS 1
|
||||
#else
|
||||
#define FOR_WINDOWS 0
|
||||
# define FOR_WINDOWS 0
|
||||
#endif
|
||||
|
||||
#if FOR_WINDOWS || defined(OSX_BUILD)
|
||||
# define GLEW_STATIC
|
||||
# include <GL/glew.h>
|
||||
#endif
|
||||
|
||||
#if FOR_WINDOWS
|
||||
#define GLEW_STATIC
|
||||
#include <GL/glew.h>
|
||||
#include <SDL2/SDL.h>
|
||||
#define GL_GLEXT_PROTOTYPES 1
|
||||
#include <SDL2/SDL_opengl.h>
|
||||
|
||||
#else
|
||||
#include <SDL2/SDL.h>
|
||||
#define GL_GLEXT_PROTOTYPES 1
|
||||
|
||||
#ifdef OSX_BUILD
|
||||
#include <SDL2/SDL_opengl.h>
|
||||
#ifdef USE_GLES
|
||||
# include <SDL2/SDL_opengles2.h>
|
||||
#else
|
||||
#include <SDL2/SDL_opengles2.h>
|
||||
#endif
|
||||
|
||||
# include <SDL2/SDL_opengl.h>
|
||||
#endif
|
||||
|
||||
#include "../platform.h"
|
||||
#include "../configfile.h"
|
||||
#include "gfx_cc.h"
|
||||
#include "gfx_rendering_api.h"
|
||||
|
||||
#define TEX_CACHE_STEP 512
|
||||
|
||||
struct ShaderProgram {
|
||||
uint32_t shader_id;
|
||||
GLuint opengl_program_id;
|
||||
|
@ -43,14 +42,32 @@ struct ShaderProgram {
|
|||
bool used_textures[2];
|
||||
uint8_t num_floats;
|
||||
GLint attrib_locations[7];
|
||||
GLint uniform_locations[5];
|
||||
uint8_t attrib_sizes[7];
|
||||
uint8_t num_attribs;
|
||||
bool used_noise;
|
||||
};
|
||||
|
||||
struct GLTexture {
|
||||
GLuint gltex;
|
||||
GLfloat size[2];
|
||||
bool filter;
|
||||
};
|
||||
|
||||
static struct ShaderProgram shader_program_pool[64];
|
||||
static uint8_t shader_program_pool_size;
|
||||
static GLuint opengl_vbo;
|
||||
|
||||
static int tex_cache_size = 0;
|
||||
static int num_textures = 0;
|
||||
static struct GLTexture *tex_cache = NULL;
|
||||
|
||||
static struct ShaderProgram *opengl_prg = NULL;
|
||||
static struct GLTexture *opengl_tex[2];
|
||||
static int opengl_curtex = 0;
|
||||
|
||||
static uint32_t frame_count;
|
||||
|
||||
static bool gfx_opengl_z_is_from_0_to_1(void) {
|
||||
return false;
|
||||
}
|
||||
|
@ -61,22 +78,41 @@ static void gfx_opengl_vertex_array_set_attribs(struct ShaderProgram *prg) {
|
|||
|
||||
for (int i = 0; i < prg->num_attribs; i++) {
|
||||
glEnableVertexAttribArray(prg->attrib_locations[i]);
|
||||
glVertexAttribPointer(prg->attrib_locations[i], prg->attrib_sizes[i], GL_FLOAT, GL_FALSE, num_floats * sizeof(float), (void *)(pos * sizeof(float)));
|
||||
glVertexAttribPointer(prg->attrib_locations[i], prg->attrib_sizes[i], GL_FLOAT, GL_FALSE, num_floats * sizeof(float), (void *) (pos * sizeof(float)));
|
||||
pos += prg->attrib_sizes[i];
|
||||
}
|
||||
}
|
||||
|
||||
static inline void gfx_opengl_set_shader_uniforms(struct ShaderProgram *prg) {
|
||||
if (prg->used_noise)
|
||||
glUniform1f(prg->uniform_locations[4], (float)frame_count);
|
||||
}
|
||||
|
||||
static inline void gfx_opengl_set_texture_uniforms(struct ShaderProgram *prg, const int tile) {
|
||||
if (prg->used_textures[tile] && opengl_tex[tile]) {
|
||||
glUniform2f(prg->uniform_locations[tile*2 + 0], opengl_tex[tile]->size[0], opengl_tex[tile]->size[1]);
|
||||
glUniform1i(prg->uniform_locations[tile*2 + 1], opengl_tex[tile]->filter);
|
||||
}
|
||||
}
|
||||
|
||||
static void gfx_opengl_unload_shader(struct ShaderProgram *old_prg) {
|
||||
if (old_prg != NULL) {
|
||||
for (int i = 0; i < old_prg->num_attribs; i++) {
|
||||
for (int i = 0; i < old_prg->num_attribs; i++)
|
||||
glDisableVertexAttribArray(old_prg->attrib_locations[i]);
|
||||
}
|
||||
if (old_prg == opengl_prg)
|
||||
opengl_prg = NULL;
|
||||
} else {
|
||||
opengl_prg = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
static void gfx_opengl_load_shader(struct ShaderProgram *new_prg) {
|
||||
opengl_prg = new_prg;
|
||||
glUseProgram(new_prg->opengl_program_id);
|
||||
gfx_opengl_vertex_array_set_attribs(new_prg);
|
||||
gfx_opengl_set_shader_uniforms(new_prg);
|
||||
gfx_opengl_set_texture_uniforms(new_prg, 0);
|
||||
gfx_opengl_set_texture_uniforms(new_prg, 1);
|
||||
}
|
||||
|
||||
static void append_str(char *buf, size_t *len, const char *str) {
|
||||
|
@ -167,7 +203,13 @@ static struct ShaderProgram *gfx_opengl_create_and_load_new_shader(uint32_t shad
|
|||
bool opt_alpha = (shader_id & SHADER_OPT_ALPHA) != 0;
|
||||
bool opt_fog = (shader_id & SHADER_OPT_FOG) != 0;
|
||||
bool opt_texture_edge = (shader_id & SHADER_OPT_TEXTURE_EDGE) != 0;
|
||||
bool used_textures[2] = {0, 0};
|
||||
#ifdef USE_GLES
|
||||
bool opt_noise = false;
|
||||
#else
|
||||
bool opt_noise = (shader_id & SHADER_OPT_NOISE) != 0;
|
||||
#endif
|
||||
|
||||
bool used_textures[2] = { 0, 0 };
|
||||
int num_inputs = 0;
|
||||
for (int i = 0; i < 2; i++) {
|
||||
for (int j = 0; j < 4; j++) {
|
||||
|
@ -184,22 +226,22 @@ static struct ShaderProgram *gfx_opengl_create_and_load_new_shader(uint32_t shad
|
|||
}
|
||||
}
|
||||
}
|
||||
bool do_single[2] = {c[0][2] == 0, c[1][2] == 0};
|
||||
bool do_multiply[2] = {c[0][1] == 0 && c[0][3] == 0, c[1][1] == 0 && c[1][3] == 0};
|
||||
bool do_mix[2] = {c[0][1] == c[0][3], c[1][1] == c[1][3]};
|
||||
bool do_single[2] = { c[0][2] == 0, c[1][2] == 0 };
|
||||
bool do_multiply[2] = { c[0][1] == 0 && c[0][3] == 0, c[1][1] == 0 && c[1][3] == 0 };
|
||||
bool do_mix[2] = { c[0][1] == c[0][3], c[1][1] == c[1][3] };
|
||||
bool color_alpha_same = (shader_id & 0xfff) == ((shader_id >> 12) & 0xfff);
|
||||
|
||||
char vs_buf[1024];
|
||||
char fs_buf[1024];
|
||||
char fs_buf[2048];
|
||||
size_t vs_len = 0;
|
||||
size_t fs_len = 0;
|
||||
size_t num_floats = 4;
|
||||
|
||||
// Vertex shader
|
||||
#ifdef OSX_BUILD
|
||||
append_line(vs_buf, &vs_len, "");
|
||||
#else
|
||||
#ifdef USE_GLES
|
||||
append_line(vs_buf, &vs_len, "#version 100");
|
||||
#else
|
||||
append_line(vs_buf, &vs_len, "#version 120");
|
||||
#endif
|
||||
append_line(vs_buf, &vs_len, "attribute vec4 aVtxPos;");
|
||||
if (used_textures[0] || used_textures[1]) {
|
||||
|
@ -231,11 +273,11 @@ static struct ShaderProgram *gfx_opengl_create_and_load_new_shader(uint32_t shad
|
|||
append_line(vs_buf, &vs_len, "}");
|
||||
|
||||
// Fragment shader
|
||||
#ifdef OSX_BUILD
|
||||
append_line(fs_buf, &fs_len, "");
|
||||
#else
|
||||
#ifdef USE_GLES
|
||||
append_line(fs_buf, &fs_len, "#version 100");
|
||||
append_line(fs_buf, &fs_len, "precision mediump float;");
|
||||
#else
|
||||
append_line(fs_buf, &fs_len, "#version 120");
|
||||
#endif
|
||||
|
||||
if (used_textures[0] || used_textures[1]) {
|
||||
|
@ -249,19 +291,61 @@ static struct ShaderProgram *gfx_opengl_create_and_load_new_shader(uint32_t shad
|
|||
}
|
||||
if (used_textures[0]) {
|
||||
append_line(fs_buf, &fs_len, "uniform sampler2D uTex0;");
|
||||
append_line(fs_buf, &fs_len, "uniform vec2 uTex0Size;");
|
||||
append_line(fs_buf, &fs_len, "uniform bool uTex0Filter;");
|
||||
}
|
||||
if (used_textures[1]) {
|
||||
append_line(fs_buf, &fs_len, "uniform sampler2D uTex1;");
|
||||
append_line(fs_buf, &fs_len, "uniform vec2 uTex1Size;");
|
||||
append_line(fs_buf, &fs_len, "uniform bool uTex1Filter;");
|
||||
}
|
||||
|
||||
// 3 point texture filtering
|
||||
// Original author: ArthurCarvalho
|
||||
// Slightly modified GLSL implementation by twinaphex, mupen64plus-libretro project.
|
||||
|
||||
if (used_textures[0] || used_textures[1]) {
|
||||
if (configFiltering == 2) {
|
||||
append_line(fs_buf, &fs_len, "#define TEX_OFFSET(off) texture2D(tex, texCoord - (off)/texSize)");
|
||||
append_line(fs_buf, &fs_len, "vec4 filter3point(in sampler2D tex, in vec2 texCoord, in vec2 texSize) {");
|
||||
append_line(fs_buf, &fs_len, " vec2 offset = fract(texCoord*texSize - vec2(0.5));");
|
||||
append_line(fs_buf, &fs_len, " offset -= step(1.0, offset.x + offset.y);");
|
||||
append_line(fs_buf, &fs_len, " vec4 c0 = TEX_OFFSET(offset);");
|
||||
append_line(fs_buf, &fs_len, " vec4 c1 = TEX_OFFSET(vec2(offset.x - sign(offset.x), offset.y));");
|
||||
append_line(fs_buf, &fs_len, " vec4 c2 = TEX_OFFSET(vec2(offset.x, offset.y - sign(offset.y)));");
|
||||
append_line(fs_buf, &fs_len, " return c0 + abs(offset.x)*(c1-c0) + abs(offset.y)*(c2-c0);");
|
||||
append_line(fs_buf, &fs_len, "}");
|
||||
append_line(fs_buf, &fs_len, "vec4 sampleTex(in sampler2D tex, in vec2 uv, in vec2 texSize, in bool dofilter) {");
|
||||
append_line(fs_buf, &fs_len, "if (dofilter)");
|
||||
append_line(fs_buf, &fs_len, "return filter3point(tex, uv, texSize);");
|
||||
append_line(fs_buf, &fs_len, "else");
|
||||
append_line(fs_buf, &fs_len, "return texture2D(tex, uv);");
|
||||
append_line(fs_buf, &fs_len, "}");
|
||||
} else {
|
||||
append_line(fs_buf, &fs_len, "vec4 sampleTex(in sampler2D tex, in vec2 uv, in vec2 texSize, in bool dofilter) {");
|
||||
append_line(fs_buf, &fs_len, "return texture2D(tex, uv);");
|
||||
append_line(fs_buf, &fs_len, "}");
|
||||
}
|
||||
}
|
||||
|
||||
if (opt_alpha && opt_noise) {
|
||||
append_line(fs_buf, &fs_len, "uniform float frame_count;");
|
||||
|
||||
append_line(fs_buf, &fs_len, "float random(in vec3 value) {");
|
||||
append_line(fs_buf, &fs_len, " float random = dot(sin(value), vec3(12.9898, 78.233, 37.719));");
|
||||
append_line(fs_buf, &fs_len, " return fract(sin(random) * 143758.5453);");
|
||||
append_line(fs_buf, &fs_len, "}");
|
||||
}
|
||||
|
||||
append_line(fs_buf, &fs_len, "void main() {");
|
||||
|
||||
|
||||
if (used_textures[0]) {
|
||||
append_line(fs_buf, &fs_len, "vec4 texVal0 = texture2D(uTex0, vTexCoord);");
|
||||
append_line(fs_buf, &fs_len, "vec4 texVal0 = sampleTex(uTex0, vTexCoord, uTex0Size, uTex0Filter);");
|
||||
}
|
||||
if (used_textures[1]) {
|
||||
append_line(fs_buf, &fs_len, "vec4 texVal1 = texture2D(uTex1, vTexCoord);");
|
||||
append_line(fs_buf, &fs_len, "vec4 texVal1 = sampleTex(uTex1, vTexCoord, uTex1Size, uTex1Filter);");
|
||||
}
|
||||
|
||||
|
||||
append_str(fs_buf, &fs_len, opt_alpha ? "vec4 texel = " : "vec3 texel = ");
|
||||
if (!color_alpha_same && opt_alpha) {
|
||||
append_str(fs_buf, &fs_len, "vec4(");
|
||||
|
@ -273,7 +357,7 @@ static struct ShaderProgram *gfx_opengl_create_and_load_new_shader(uint32_t shad
|
|||
append_formula(fs_buf, &fs_len, c, do_single[0], do_multiply[0], do_mix[0], opt_alpha, false, opt_alpha);
|
||||
}
|
||||
append_line(fs_buf, &fs_len, ";");
|
||||
|
||||
|
||||
if (opt_texture_edge && opt_alpha) {
|
||||
append_line(fs_buf, &fs_len, "if (texel.a > 0.3) texel.a = 1.0; else discard;");
|
||||
}
|
||||
|
@ -285,27 +369,30 @@ static struct ShaderProgram *gfx_opengl_create_and_load_new_shader(uint32_t shad
|
|||
append_line(fs_buf, &fs_len, "texel = mix(texel, vFog.rgb, vFog.a);");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (opt_alpha && opt_noise)
|
||||
append_line(fs_buf, &fs_len, "texel.a *= floor(random(floor(vec3(gl_FragCoord.xy, frame_count))) + 0.5);");
|
||||
|
||||
if (opt_alpha) {
|
||||
append_line(fs_buf, &fs_len, "gl_FragColor = texel;");
|
||||
} else {
|
||||
append_line(fs_buf, &fs_len, "gl_FragColor = vec4(texel, 1.0);");
|
||||
}
|
||||
append_line(fs_buf, &fs_len, "}");
|
||||
|
||||
|
||||
vs_buf[vs_len] = '\0';
|
||||
fs_buf[fs_len] = '\0';
|
||||
|
||||
|
||||
/*puts("Vertex shader:");
|
||||
puts(vs_buf);
|
||||
puts("Fragment shader:");
|
||||
puts(fs_buf);
|
||||
puts("End");*/
|
||||
|
||||
const GLchar *sources[2] = {vs_buf, fs_buf};
|
||||
const GLint lengths[2] = {vs_len, fs_len};
|
||||
|
||||
const GLchar *sources[2] = { vs_buf, fs_buf };
|
||||
const GLint lengths[2] = { vs_len, fs_len };
|
||||
GLint success;
|
||||
|
||||
|
||||
GLuint vertex_shader = glCreateShader(GL_VERTEX_SHADER);
|
||||
glShaderSource(vertex_shader, 1, &sources[0], &lengths[0]);
|
||||
glCompileShader(vertex_shader);
|
||||
|
@ -317,9 +404,9 @@ static struct ShaderProgram *gfx_opengl_create_and_load_new_shader(uint32_t shad
|
|||
fprintf(stderr, "Vertex shader compilation failed\n");
|
||||
glGetShaderInfoLog(vertex_shader, max_length, &max_length, &error_log[0]);
|
||||
fprintf(stderr, "%s\n", &error_log[0]);
|
||||
abort();
|
||||
sys_fatal("vertex shader compilation failed (see terminal)");
|
||||
}
|
||||
|
||||
|
||||
GLuint fragment_shader = glCreateShader(GL_FRAGMENT_SHADER);
|
||||
glShaderSource(fragment_shader, 1, &sources[1], &lengths[1]);
|
||||
glCompileShader(fragment_shader);
|
||||
|
@ -331,33 +418,33 @@ static struct ShaderProgram *gfx_opengl_create_and_load_new_shader(uint32_t shad
|
|||
fprintf(stderr, "Fragment shader compilation failed\n");
|
||||
glGetShaderInfoLog(fragment_shader, max_length, &max_length, &error_log[0]);
|
||||
fprintf(stderr, "%s\n", &error_log[0]);
|
||||
abort();
|
||||
sys_fatal("fragment shader compilation failed (see terminal)");
|
||||
}
|
||||
|
||||
|
||||
GLuint shader_program = glCreateProgram();
|
||||
glAttachShader(shader_program, vertex_shader);
|
||||
glAttachShader(shader_program, fragment_shader);
|
||||
glLinkProgram(shader_program);
|
||||
|
||||
|
||||
size_t cnt = 0;
|
||||
|
||||
|
||||
struct ShaderProgram *prg = &shader_program_pool[shader_program_pool_size++];
|
||||
prg->attrib_locations[cnt] = glGetAttribLocation(shader_program, "aVtxPos");
|
||||
prg->attrib_sizes[cnt] = 4;
|
||||
++cnt;
|
||||
|
||||
|
||||
if (used_textures[0] || used_textures[1]) {
|
||||
prg->attrib_locations[cnt] = glGetAttribLocation(shader_program, "aTexCoord");
|
||||
prg->attrib_sizes[cnt] = 2;
|
||||
++cnt;
|
||||
}
|
||||
|
||||
|
||||
if (opt_fog) {
|
||||
prg->attrib_locations[cnt] = glGetAttribLocation(shader_program, "aFog");
|
||||
prg->attrib_sizes[cnt] = 4;
|
||||
++cnt;
|
||||
}
|
||||
|
||||
|
||||
for (int i = 0; i < num_inputs; i++) {
|
||||
char name[16];
|
||||
sprintf(name, "aInput%d", i + 1);
|
||||
|
@ -365,7 +452,7 @@ static struct ShaderProgram *gfx_opengl_create_and_load_new_shader(uint32_t shad
|
|||
prg->attrib_sizes[cnt] = opt_alpha ? 4 : 3;
|
||||
++cnt;
|
||||
}
|
||||
|
||||
|
||||
prg->shader_id = shader_id;
|
||||
prg->opengl_program_id = shader_program;
|
||||
prg->num_inputs = num_inputs;
|
||||
|
@ -373,18 +460,29 @@ static struct ShaderProgram *gfx_opengl_create_and_load_new_shader(uint32_t shad
|
|||
prg->used_textures[1] = used_textures[1];
|
||||
prg->num_floats = num_floats;
|
||||
prg->num_attribs = cnt;
|
||||
|
||||
|
||||
gfx_opengl_load_shader(prg);
|
||||
|
||||
|
||||
if (used_textures[0]) {
|
||||
GLint sampler_attrib = glGetUniformLocation(shader_program, "uTex0");
|
||||
glUniform1i(sampler_attrib, 0);
|
||||
GLint sampler_location = glGetUniformLocation(shader_program, "uTex0");
|
||||
prg->uniform_locations[0] = glGetUniformLocation(shader_program, "uTex0Size");
|
||||
prg->uniform_locations[1] = glGetUniformLocation(shader_program, "uTex0Filter");
|
||||
glUniform1i(sampler_location, 0);
|
||||
}
|
||||
if (used_textures[1]) {
|
||||
GLint sampler_attrib = glGetUniformLocation(shader_program, "uTex1");
|
||||
glUniform1i(sampler_attrib, 1);
|
||||
GLint sampler_location = glGetUniformLocation(shader_program, "uTex1");
|
||||
prg->uniform_locations[2] = glGetUniformLocation(shader_program, "uTex1Size");
|
||||
prg->uniform_locations[3] = glGetUniformLocation(shader_program, "uTex1Filter");
|
||||
glUniform1i(sampler_location, 1);
|
||||
}
|
||||
|
||||
|
||||
if (opt_alpha && opt_noise) {
|
||||
prg->uniform_locations[4] = glGetUniformLocation(shader_program, "frame_count");
|
||||
prg->used_noise = true;
|
||||
} else {
|
||||
prg->used_noise = false;
|
||||
}
|
||||
|
||||
return prg;
|
||||
}
|
||||
|
||||
|
@ -404,18 +502,30 @@ static void gfx_opengl_shader_get_info(struct ShaderProgram *prg, uint8_t *num_i
|
|||
}
|
||||
|
||||
static GLuint gfx_opengl_new_texture(void) {
|
||||
GLuint ret;
|
||||
glGenTextures(1, &ret);
|
||||
return ret;
|
||||
if (num_textures >= tex_cache_size) {
|
||||
tex_cache_size += TEX_CACHE_STEP;
|
||||
tex_cache = realloc(tex_cache, sizeof(struct GLTexture) * tex_cache_size);
|
||||
if (!tex_cache) sys_fatal("out of memory allocating texture cache");
|
||||
// invalidate these because they might be pointing to garbage now
|
||||
opengl_tex[0] = NULL;
|
||||
opengl_tex[1] = NULL;
|
||||
}
|
||||
glGenTextures(1, &tex_cache[num_textures].gltex);
|
||||
return num_textures++;
|
||||
}
|
||||
|
||||
static void gfx_opengl_select_texture(int tile, GLuint texture_id) {
|
||||
glActiveTexture(GL_TEXTURE0 + tile);
|
||||
glBindTexture(GL_TEXTURE_2D, texture_id);
|
||||
opengl_tex[tile] = tex_cache + texture_id;
|
||||
opengl_curtex = tile;
|
||||
glActiveTexture(GL_TEXTURE0 + tile);
|
||||
glBindTexture(GL_TEXTURE_2D, opengl_tex[tile]->gltex);
|
||||
gfx_opengl_set_texture_uniforms(opengl_prg, tile);
|
||||
}
|
||||
|
||||
static void gfx_opengl_upload_texture(uint8_t *rgba32_buf, int width, int height) {
|
||||
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, width, height, 0, GL_RGBA, GL_UNSIGNED_BYTE, rgba32_buf);
|
||||
opengl_tex[opengl_curtex]->size[0] = width;
|
||||
opengl_tex[opengl_curtex]->size[1] = height;
|
||||
}
|
||||
|
||||
static uint32_t gfx_cm_to_opengl(uint32_t val) {
|
||||
|
@ -432,6 +542,11 @@ static void gfx_opengl_set_sampler_parameters(int tile, bool linear_filter, uint
|
|||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, filter);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, gfx_cm_to_opengl(cms));
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, gfx_cm_to_opengl(cmt));
|
||||
opengl_curtex = tile;
|
||||
if (opengl_tex[tile]) {
|
||||
opengl_tex[tile]->filter = linear_filter;
|
||||
gfx_opengl_set_texture_uniforms(opengl_prg, tile);
|
||||
}
|
||||
}
|
||||
|
||||
static void gfx_opengl_set_depth_test(bool depth_test) {
|
||||
|
@ -478,14 +593,38 @@ static void gfx_opengl_draw_triangles(float buf_vbo[], size_t buf_vbo_len, size_
|
|||
glDrawArrays(GL_TRIANGLES, 0, 3 * buf_vbo_num_tris);
|
||||
}
|
||||
|
||||
static inline bool gl_get_version(int *major, int *minor, bool *is_es) {
|
||||
const char *vstr = (const char *)glGetString(GL_VERSION);
|
||||
if (!vstr || !vstr[0]) return false;
|
||||
|
||||
if (!strncmp(vstr, "OpenGL ES ", 10)) {
|
||||
vstr += 10;
|
||||
*is_es = true;
|
||||
} else if (!strncmp(vstr, "OpenGL ES-CM ", 13)) {
|
||||
vstr += 13;
|
||||
*is_es = true;
|
||||
}
|
||||
|
||||
return (sscanf(vstr, "%d.%d", major, minor) == 2);
|
||||
}
|
||||
|
||||
static void gfx_opengl_init(void) {
|
||||
#if FOR_WINDOWS
|
||||
glewInit();
|
||||
#if FOR_WINDOWS || defined(OSX_BUILD)
|
||||
GLenum err;
|
||||
if ((err = glewInit()) != GLEW_OK)
|
||||
sys_fatal("could not init GLEW:\n%s", glewGetErrorString(err));
|
||||
#endif
|
||||
|
||||
#ifdef OSX_BUILD
|
||||
glewInit();
|
||||
#endif
|
||||
tex_cache_size = TEX_CACHE_STEP;
|
||||
tex_cache = calloc(tex_cache_size, sizeof(struct GLTexture));
|
||||
if (!tex_cache) sys_fatal("out of memory allocating texture cache");
|
||||
|
||||
// check GL version
|
||||
int vmajor, vminor;
|
||||
bool is_es = false;
|
||||
gl_get_version(&vmajor, &vminor, &is_es);
|
||||
if (vmajor < 2 && vminor < 1 && !is_es)
|
||||
sys_fatal("OpenGL 2.1+ is required.\nReported version: %s%d.%d", is_es ? "ES" : "", vmajor, vminor);
|
||||
|
||||
glGenBuffers(1, &opengl_vbo);
|
||||
|
||||
|
@ -496,6 +635,8 @@ static void gfx_opengl_init(void) {
|
|||
}
|
||||
|
||||
static void gfx_opengl_start_frame(void) {
|
||||
frame_count++;
|
||||
|
||||
glDisable(GL_SCISSOR_TEST);
|
||||
glDepthMask(GL_TRUE); // Must be set to clear Z-buffer
|
||||
glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
|
||||
|
@ -529,4 +670,4 @@ struct GfxRenderingAPI gfx_opengl_api = {
|
|||
gfx_opengl_shutdown
|
||||
};
|
||||
|
||||
#endif // !LEGACY_GL
|
||||
#endif // RAPI_GL
|
||||
|
|
|
@ -1,25 +1,25 @@
|
|||
#ifdef LEGACY_GL
|
||||
#ifdef RAPI_GL_LEGACY
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
#include <assert.h>
|
||||
|
||||
#ifndef _LANGUAGE_C
|
||||
#define _LANGUAGE_C
|
||||
# define _LANGUAGE_C
|
||||
#endif
|
||||
#include <PR/gbi.h>
|
||||
|
||||
#ifdef __MINGW32__
|
||||
#define FOR_WINDOWS 1
|
||||
# define FOR_WINDOWS 1
|
||||
#else
|
||||
#define FOR_WINDOWS 0
|
||||
# define FOR_WINDOWS 0
|
||||
#endif
|
||||
|
||||
#include <SDL2/SDL.h>
|
||||
|
||||
#if FOR_WINDOWS || defined(OSX_BUILD)
|
||||
#define GLEW_STATIC
|
||||
#include <GL/glew.h>
|
||||
# define GLEW_STATIC
|
||||
# include <GL/glew.h>
|
||||
#endif
|
||||
|
||||
#define GL_GLEXT_PROTOTYPES 1
|
||||
|
@ -40,6 +40,7 @@ static PFNMGLFOGCOORDPOINTERPROC mglFogCoordPointer = NULL;
|
|||
#define GL_FOG_COORD 0x8451
|
||||
#define GL_FOG_COORD_ARRAY 0x8457
|
||||
|
||||
#include "../platform.h"
|
||||
#include "gfx_cc.h"
|
||||
#include "gfx_rendering_api.h"
|
||||
#include "macros.h"
|
||||
|
@ -509,24 +510,25 @@ static inline bool gl_get_version(int *major, int *minor, bool *is_es) {
|
|||
|
||||
static void gfx_opengl_init(void) {
|
||||
#if FOR_WINDOWS || defined(OSX_BUILD)
|
||||
glewInit();
|
||||
GLenum err;
|
||||
if ((err = glewInit()) != GLEW_OK)
|
||||
sys_fatal("could not init GLEW:\n%s", glewGetErrorString(err));
|
||||
#endif
|
||||
|
||||
// check GL version
|
||||
int vmajor, vminor;
|
||||
bool is_es = false;
|
||||
gl_get_version(&vmajor, &vminor, &is_es);
|
||||
if (vmajor < 2 && vminor < 2 && !is_es) {
|
||||
fprintf(stderr, "OpenGL 1.2+ is required. Reported version: %s%d.%d\n", is_es ? "ES" : "", vmajor, vminor);
|
||||
abort();
|
||||
}
|
||||
if (vmajor < 2 && vminor < 2 && !is_es)
|
||||
sys_fatal("OpenGL 1.2+ is required.\nReported version: %s%d.%d", is_es ? "ES" : "", vmajor, vminor);
|
||||
|
||||
// check extensions that we need
|
||||
const bool supported =
|
||||
gl_check_ext("GL_ARB_multitexture") &&
|
||||
gl_check_ext("GL_ARB_texture_env_combine");
|
||||
|
||||
if (!supported) abort();
|
||||
if (!supported)
|
||||
sys_fatal("required GL extensions are not supported");
|
||||
|
||||
gl_adv_fog = false;
|
||||
|
||||
|
@ -601,4 +603,4 @@ struct GfxRenderingAPI gfx_opengl_api = {
|
|||
gfx_opengl_shutdown
|
||||
};
|
||||
|
||||
#endif // LEGACY_GL
|
||||
#endif // RAPI_GL_LEGACY
|
||||
|
|
|
@ -26,6 +26,7 @@
|
|||
|
||||
#include "../platform.h"
|
||||
#include "../configfile.h"
|
||||
#include "../fs/fs.h"
|
||||
|
||||
#define SUPPORT_CHECK(x) assert(x)
|
||||
|
||||
|
@ -494,6 +495,28 @@ static void import_texture_ci8(int tile) {
|
|||
|
||||
#else // EXTERNAL_DATA
|
||||
|
||||
static inline void load_texture(const char *fullpath) {
|
||||
int w, h;
|
||||
u64 imgsize = 0;
|
||||
u8 *imgdata = fs_load_file(fullpath, &imgsize);
|
||||
if (!imgdata) {
|
||||
fprintf(stderr, "could not open texture: `%s`\n", fullpath);
|
||||
return;
|
||||
}
|
||||
|
||||
// TODO: implement stbi_callbacks or some shit instead of loading the whole texture
|
||||
u8 *data = stbi_load_from_memory(imgdata, imgsize, &w, &h, NULL, 4);
|
||||
free(imgdata);
|
||||
if (!data) {
|
||||
fprintf(stderr, "could not load texture: `%s`\n", fullpath);
|
||||
return;
|
||||
}
|
||||
|
||||
gfx_rapi->upload_texture(data, w, h);
|
||||
stbi_image_free(data); // don't need this anymore
|
||||
}
|
||||
|
||||
|
||||
// this is taken straight from n64graphics
|
||||
static bool texname_to_texformat(const char *name, u8 *fmt, u8 *siz) {
|
||||
static const struct {
|
||||
|
@ -531,7 +554,7 @@ static bool texname_to_texformat(const char *name, u8 *fmt, u8 *siz) {
|
|||
// calls import_texture() on every texture in the res folder
|
||||
// we can get the format and size from the texture files
|
||||
// and then cache them using gfx_texture_cache_lookup
|
||||
static bool preload_texture(const char *path) {
|
||||
static bool preload_texture(void *user, const char *path) {
|
||||
// strip off the extension
|
||||
char texname[SYS_MAX_PATH];
|
||||
strncpy(texname, path, sizeof(texname));
|
||||
|
@ -546,55 +569,20 @@ static bool preload_texture(const char *path) {
|
|||
return true; // just skip it, might be a stray skybox or something
|
||||
}
|
||||
|
||||
// strip off the data path
|
||||
const char *datapath = sys_data_path();
|
||||
const unsigned int datalen = strlen(datapath);
|
||||
const char *actualname = (!strncmp(texname, datapath, datalen)) ?
|
||||
texname + datalen + 1 : texname;
|
||||
// skip any separators
|
||||
while (*actualname == '/' || *actualname == '\\') ++actualname;
|
||||
char *actualname = texname;
|
||||
// strip off the prefix // TODO: make a fs_ function for this shit
|
||||
if (!strncmp(FS_TEXTUREDIR "/", actualname, 4)) actualname += 4;
|
||||
// this will be stored in the hashtable, so make a copy
|
||||
actualname = sys_strdup(actualname);
|
||||
assert(actualname);
|
||||
|
||||
struct TextureHashmapNode *n;
|
||||
if (!gfx_texture_cache_lookup(0, &n, actualname, fmt, siz)) {
|
||||
// new texture, load it
|
||||
int w, h;
|
||||
u8 *data = stbi_load(path, &w, &h, NULL, 4);
|
||||
if (!data) {
|
||||
fprintf(stderr, "could not load texture: `%s`\n", path);
|
||||
return false;
|
||||
}
|
||||
// upload it
|
||||
gfx_rapi->upload_texture(data, w, h);
|
||||
stbi_image_free(data);
|
||||
}
|
||||
if (!gfx_texture_cache_lookup(0, &n, actualname, fmt, siz))
|
||||
load_texture(path); // new texture, load it
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static inline void load_texture(const char *name) {
|
||||
static char fpath[SYS_MAX_PATH];
|
||||
int w, h;
|
||||
const char *texname = name;
|
||||
|
||||
if (!texname[0]) {
|
||||
fprintf(stderr, "empty texture name at %p\n", texname);
|
||||
return;
|
||||
}
|
||||
|
||||
snprintf(fpath, sizeof(fpath), "%s/%s.png", sys_data_path(), texname);
|
||||
u8 *data = stbi_load(fpath, &w, &h, NULL, 4);
|
||||
if (!data) {
|
||||
fprintf(stderr, "could not load texture: `%s`\n", fpath);
|
||||
return;
|
||||
}
|
||||
|
||||
gfx_rapi->upload_texture(data, w, h);
|
||||
stbi_image_free(data); // don't need this anymore
|
||||
}
|
||||
|
||||
#endif // EXTERNAL_DATA
|
||||
|
||||
static void import_texture(int tile) {
|
||||
|
@ -614,7 +602,9 @@ static void import_texture(int tile) {
|
|||
#ifdef EXTERNAL_DATA
|
||||
// the "texture data" is actually a C string with the path to our texture in it
|
||||
// load it from an external image in our data path
|
||||
load_texture((const char*)rdp.loaded_texture[tile].addr);
|
||||
char texname[SYS_MAX_PATH];
|
||||
snprintf(texname, sizeof(texname), FS_TEXTUREDIR "/%s.png", (const char*)rdp.loaded_texture[tile].addr);
|
||||
load_texture(texname);
|
||||
#else
|
||||
// the texture data is actual texture data
|
||||
int t0 = get_time();
|
||||
|
@ -625,7 +615,7 @@ static void import_texture(int tile) {
|
|||
else if (siz == G_IM_SIZ_16b) {
|
||||
import_texture_rgba16(tile);
|
||||
} else {
|
||||
abort();
|
||||
sys_fatal("unsupported RGBA texture size: %u", siz);
|
||||
}
|
||||
} else if (fmt == G_IM_FMT_IA) {
|
||||
if (siz == G_IM_SIZ_4b) {
|
||||
|
@ -635,7 +625,7 @@ static void import_texture(int tile) {
|
|||
} else if (siz == G_IM_SIZ_16b) {
|
||||
import_texture_ia16(tile);
|
||||
} else {
|
||||
abort();
|
||||
sys_fatal("unsupported IA texture size: %u", siz);
|
||||
}
|
||||
} else if (fmt == G_IM_FMT_CI) {
|
||||
if (siz == G_IM_SIZ_4b) {
|
||||
|
@ -643,7 +633,7 @@ static void import_texture(int tile) {
|
|||
} else if (siz == G_IM_SIZ_8b) {
|
||||
import_texture_ci8(tile);
|
||||
} else {
|
||||
abort();
|
||||
sys_fatal("unsupported CI texture size: %u", siz);
|
||||
}
|
||||
} else if (fmt == G_IM_FMT_I) {
|
||||
if (siz == G_IM_SIZ_4b) {
|
||||
|
@ -651,10 +641,10 @@ static void import_texture(int tile) {
|
|||
} else if (siz == G_IM_SIZ_8b) {
|
||||
import_texture_i8(tile);
|
||||
} else {
|
||||
abort();
|
||||
sys_fatal("unsupported I texture size: %u", siz);
|
||||
}
|
||||
} else {
|
||||
abort();
|
||||
sys_fatal("unsupported texture format: %u", fmt);
|
||||
}
|
||||
int t1 = get_time();
|
||||
//printf("Time diff: %d\n", t1 - t0);
|
||||
|
@ -944,6 +934,7 @@ static void gfx_sp_tri1(uint8_t vtx1_idx, uint8_t vtx2_idx, uint8_t vtx3_idx) {
|
|||
bool use_alpha = (rdp.other_mode_l & (G_BL_A_MEM << 18)) == 0;
|
||||
bool use_fog = (rdp.other_mode_l >> 30) == G_BL_CLR_FOG;
|
||||
bool texture_edge = (rdp.other_mode_l & CVG_X_ALPHA) == CVG_X_ALPHA;
|
||||
bool use_noise = (rdp.other_mode_l & G_AC_DITHER) == G_AC_DITHER;
|
||||
|
||||
if (texture_edge) {
|
||||
use_alpha = true;
|
||||
|
@ -952,6 +943,7 @@ static void gfx_sp_tri1(uint8_t vtx1_idx, uint8_t vtx2_idx, uint8_t vtx3_idx) {
|
|||
if (use_alpha) cc_id |= SHADER_OPT_ALPHA;
|
||||
if (use_fog) cc_id |= SHADER_OPT_FOG;
|
||||
if (texture_edge) cc_id |= SHADER_OPT_TEXTURE_EDGE;
|
||||
if (use_noise) cc_id |= SHADER_OPT_NOISE;
|
||||
|
||||
if (!use_alpha) {
|
||||
cc_id &= ~0xfff000;
|
||||
|
@ -1726,10 +1718,10 @@ void gfx_get_dimensions(uint32_t *width, uint32_t *height) {
|
|||
gfx_wapi->get_dimensions(width, height);
|
||||
}
|
||||
|
||||
void gfx_init(struct GfxWindowManagerAPI *wapi, struct GfxRenderingAPI *rapi) {
|
||||
void gfx_init(struct GfxWindowManagerAPI *wapi, struct GfxRenderingAPI *rapi, const char *window_title) {
|
||||
gfx_wapi = wapi;
|
||||
gfx_rapi = rapi;
|
||||
gfx_wapi->init();
|
||||
gfx_wapi->init(window_title);
|
||||
gfx_rapi->init();
|
||||
|
||||
// Used in the 120 star TAS
|
||||
|
@ -1758,18 +1750,18 @@ void gfx_init(struct GfxWindowManagerAPI *wapi, struct GfxRenderingAPI *rapi) {
|
|||
0x05200200,
|
||||
0x03200200
|
||||
};
|
||||
for (size_t i = 0; i < sizeof(precomp_shaders) / sizeof(uint32_t); i++) {
|
||||
|
||||
for (size_t i = 0; i < sizeof(precomp_shaders) / sizeof(uint32_t); i++)
|
||||
gfx_lookup_or_create_shader_program(precomp_shaders[i]);
|
||||
}
|
||||
#ifdef EXTERNAL_DATA
|
||||
// preload all textures if needed
|
||||
if (configPrecacheRes) {
|
||||
printf("Precaching textures from `%s`\n", sys_data_path());
|
||||
sys_dir_walk(sys_data_path(), preload_texture, true);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef EXTERNAL_DATA
|
||||
void gfx_precache_textures(void) {
|
||||
// preload all textures
|
||||
fs_walk(FS_TEXTUREDIR, preload_texture, NULL, true);
|
||||
}
|
||||
#endif
|
||||
|
||||
void gfx_start_frame(void) {
|
||||
gfx_wapi->handle_events();
|
||||
gfx_wapi->get_dimensions(&gfx_current_dimensions.width, &gfx_current_dimensions.height);
|
||||
|
|
|
@ -11,10 +11,11 @@ struct GfxDimensions {
|
|||
|
||||
extern struct GfxDimensions gfx_current_dimensions;
|
||||
|
||||
void gfx_init(struct GfxWindowManagerAPI *wapi, struct GfxRenderingAPI *rapi);
|
||||
void gfx_init(struct GfxWindowManagerAPI *wapi, struct GfxRenderingAPI *rapi, const char *window_title);
|
||||
void gfx_start_frame(void);
|
||||
void gfx_run(Gfx *commands);
|
||||
void gfx_end_frame(void);
|
||||
void gfx_precache_textures(void);
|
||||
void gfx_shutdown(void);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
#ifdef WAPI_SDL2
|
||||
|
||||
#ifdef __MINGW32__
|
||||
#define FOR_WINDOWS 1
|
||||
#else
|
||||
|
@ -44,35 +46,37 @@ static const Uint32 FRAME_TIME = 1000 / FRAMERATE;
|
|||
static SDL_Window *wnd;
|
||||
static SDL_GLContext ctx = NULL;
|
||||
static int inverted_scancode_table[512];
|
||||
static Uint32 frame_start = 0;
|
||||
|
||||
const SDL_Scancode windows_scancode_table[] =
|
||||
{
|
||||
/* 0 1 2 3 4 5 6 7 */
|
||||
/* 8 9 A B C D E F */
|
||||
SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_ESCAPE, SDL_SCANCODE_1, SDL_SCANCODE_2, SDL_SCANCODE_3, SDL_SCANCODE_4, SDL_SCANCODE_5, SDL_SCANCODE_6, /* 0 */
|
||||
SDL_SCANCODE_7, SDL_SCANCODE_8, SDL_SCANCODE_9, SDL_SCANCODE_0, SDL_SCANCODE_MINUS, SDL_SCANCODE_EQUALS, SDL_SCANCODE_BACKSPACE, SDL_SCANCODE_TAB, /* 0 */
|
||||
static kb_callback_t kb_key_down = NULL;
|
||||
static kb_callback_t kb_key_up = NULL;
|
||||
static void (*kb_all_keys_up)(void) = NULL;
|
||||
|
||||
SDL_SCANCODE_Q, SDL_SCANCODE_W, SDL_SCANCODE_E, SDL_SCANCODE_R, SDL_SCANCODE_T, SDL_SCANCODE_Y, SDL_SCANCODE_U, SDL_SCANCODE_I, /* 1 */
|
||||
SDL_SCANCODE_O, SDL_SCANCODE_P, SDL_SCANCODE_LEFTBRACKET, SDL_SCANCODE_RIGHTBRACKET, SDL_SCANCODE_RETURN, SDL_SCANCODE_LCTRL, SDL_SCANCODE_A, SDL_SCANCODE_S, /* 1 */
|
||||
const SDL_Scancode windows_scancode_table[] = {
|
||||
/* 0 1 2 3 4 5 6 7 */
|
||||
/* 8 9 A B C D E F */
|
||||
SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_ESCAPE, SDL_SCANCODE_1, SDL_SCANCODE_2, SDL_SCANCODE_3, SDL_SCANCODE_4, SDL_SCANCODE_5, SDL_SCANCODE_6, /* 0 */
|
||||
SDL_SCANCODE_7, SDL_SCANCODE_8, SDL_SCANCODE_9, SDL_SCANCODE_0, SDL_SCANCODE_MINUS, SDL_SCANCODE_EQUALS, SDL_SCANCODE_BACKSPACE, SDL_SCANCODE_TAB, /* 0 */
|
||||
|
||||
SDL_SCANCODE_D, SDL_SCANCODE_F, SDL_SCANCODE_G, SDL_SCANCODE_H, SDL_SCANCODE_J, SDL_SCANCODE_K, SDL_SCANCODE_L, SDL_SCANCODE_SEMICOLON, /* 2 */
|
||||
SDL_SCANCODE_APOSTROPHE, SDL_SCANCODE_GRAVE, SDL_SCANCODE_LSHIFT, SDL_SCANCODE_BACKSLASH, SDL_SCANCODE_Z, SDL_SCANCODE_X, SDL_SCANCODE_C, SDL_SCANCODE_V, /* 2 */
|
||||
SDL_SCANCODE_Q, SDL_SCANCODE_W, SDL_SCANCODE_E, SDL_SCANCODE_R, SDL_SCANCODE_T, SDL_SCANCODE_Y, SDL_SCANCODE_U, SDL_SCANCODE_I, /* 1 */
|
||||
SDL_SCANCODE_O, SDL_SCANCODE_P, SDL_SCANCODE_LEFTBRACKET, SDL_SCANCODE_RIGHTBRACKET, SDL_SCANCODE_RETURN, SDL_SCANCODE_LCTRL, SDL_SCANCODE_A, SDL_SCANCODE_S, /* 1 */
|
||||
|
||||
SDL_SCANCODE_B, SDL_SCANCODE_N, SDL_SCANCODE_M, SDL_SCANCODE_COMMA, SDL_SCANCODE_PERIOD, SDL_SCANCODE_SLASH, SDL_SCANCODE_RSHIFT, SDL_SCANCODE_PRINTSCREEN,/* 3 */
|
||||
SDL_SCANCODE_LALT, SDL_SCANCODE_SPACE, SDL_SCANCODE_CAPSLOCK, SDL_SCANCODE_F1, SDL_SCANCODE_F2, SDL_SCANCODE_F3, SDL_SCANCODE_F4, SDL_SCANCODE_F5, /* 3 */
|
||||
SDL_SCANCODE_D, SDL_SCANCODE_F, SDL_SCANCODE_G, SDL_SCANCODE_H, SDL_SCANCODE_J, SDL_SCANCODE_K, SDL_SCANCODE_L, SDL_SCANCODE_SEMICOLON, /* 2 */
|
||||
SDL_SCANCODE_APOSTROPHE, SDL_SCANCODE_GRAVE, SDL_SCANCODE_LSHIFT, SDL_SCANCODE_BACKSLASH, SDL_SCANCODE_Z, SDL_SCANCODE_X, SDL_SCANCODE_C, SDL_SCANCODE_V, /* 2 */
|
||||
|
||||
SDL_SCANCODE_F6, SDL_SCANCODE_F7, SDL_SCANCODE_F8, SDL_SCANCODE_F9, SDL_SCANCODE_F10, SDL_SCANCODE_NUMLOCKCLEAR, SDL_SCANCODE_SCROLLLOCK, SDL_SCANCODE_HOME, /* 4 */
|
||||
SDL_SCANCODE_UP, SDL_SCANCODE_PAGEUP, SDL_SCANCODE_KP_MINUS, SDL_SCANCODE_LEFT, SDL_SCANCODE_KP_5, SDL_SCANCODE_RIGHT, SDL_SCANCODE_KP_PLUS, SDL_SCANCODE_END, /* 4 */
|
||||
SDL_SCANCODE_B, SDL_SCANCODE_N, SDL_SCANCODE_M, SDL_SCANCODE_COMMA, SDL_SCANCODE_PERIOD, SDL_SCANCODE_SLASH, SDL_SCANCODE_RSHIFT, SDL_SCANCODE_PRINTSCREEN,/* 3 */
|
||||
SDL_SCANCODE_LALT, SDL_SCANCODE_SPACE, SDL_SCANCODE_CAPSLOCK, SDL_SCANCODE_F1, SDL_SCANCODE_F2, SDL_SCANCODE_F3, SDL_SCANCODE_F4, SDL_SCANCODE_F5, /* 3 */
|
||||
|
||||
SDL_SCANCODE_DOWN, SDL_SCANCODE_PAGEDOWN, SDL_SCANCODE_INSERT, SDL_SCANCODE_DELETE, SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_NONUSBACKSLASH,SDL_SCANCODE_F11, /* 5 */
|
||||
SDL_SCANCODE_F12, SDL_SCANCODE_PAUSE, SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_LGUI, SDL_SCANCODE_RGUI, SDL_SCANCODE_APPLICATION, SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_UNKNOWN, /* 5 */
|
||||
SDL_SCANCODE_F6, SDL_SCANCODE_F7, SDL_SCANCODE_F8, SDL_SCANCODE_F9, SDL_SCANCODE_F10, SDL_SCANCODE_NUMLOCKCLEAR, SDL_SCANCODE_SCROLLLOCK, SDL_SCANCODE_HOME, /* 4 */
|
||||
SDL_SCANCODE_UP, SDL_SCANCODE_PAGEUP, SDL_SCANCODE_KP_MINUS, SDL_SCANCODE_LEFT, SDL_SCANCODE_KP_5, SDL_SCANCODE_RIGHT, SDL_SCANCODE_KP_PLUS, SDL_SCANCODE_END, /* 4 */
|
||||
|
||||
SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_F13, SDL_SCANCODE_F14, SDL_SCANCODE_F15, SDL_SCANCODE_F16, /* 6 */
|
||||
SDL_SCANCODE_F17, SDL_SCANCODE_F18, SDL_SCANCODE_F19, SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_UNKNOWN, /* 6 */
|
||||
SDL_SCANCODE_DOWN, SDL_SCANCODE_PAGEDOWN, SDL_SCANCODE_INSERT, SDL_SCANCODE_DELETE, SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_NONUSBACKSLASH, SDL_SCANCODE_F11, /* 5 */
|
||||
SDL_SCANCODE_F12, SDL_SCANCODE_PAUSE, SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_LGUI, SDL_SCANCODE_RGUI, SDL_SCANCODE_APPLICATION, SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_UNKNOWN, /* 5 */
|
||||
|
||||
SDL_SCANCODE_INTERNATIONAL2, SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_INTERNATIONAL1, SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_UNKNOWN, /* 7 */
|
||||
SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_INTERNATIONAL4, SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_INTERNATIONAL5, SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_INTERNATIONAL3, SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_UNKNOWN /* 7 */
|
||||
SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_F13, SDL_SCANCODE_F14, SDL_SCANCODE_F15, SDL_SCANCODE_F16, /* 6 */
|
||||
SDL_SCANCODE_F17, SDL_SCANCODE_F18, SDL_SCANCODE_F19, SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_UNKNOWN, /* 6 */
|
||||
|
||||
SDL_SCANCODE_INTERNATIONAL2, SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_INTERNATIONAL1, SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_UNKNOWN, /* 7 */
|
||||
SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_INTERNATIONAL4, SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_INTERNATIONAL5, SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_INTERNATIONAL3, SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_UNKNOWN /* 7 */
|
||||
};
|
||||
|
||||
const SDL_Scancode scancode_rmapping_extended[][2] = {
|
||||
|
@ -97,10 +101,12 @@ const SDL_Scancode scancode_rmapping_nonextended[][2] = {
|
|||
{SDL_SCANCODE_KP_MULTIPLY, SDL_SCANCODE_PRINTSCREEN}
|
||||
};
|
||||
|
||||
#define IS_FULLSCREEN (SDL_GetWindowFlags(wnd) & SDL_WINDOW_FULLSCREEN_DESKTOP)
|
||||
#define IS_FULLSCREEN() ((SDL_GetWindowFlags(wnd) & SDL_WINDOW_FULLSCREEN_DESKTOP) != 0)
|
||||
|
||||
static void gfx_sdl_set_fullscreen() {
|
||||
if (configWindow.fullscreen == IS_FULLSCREEN)
|
||||
if (configWindow.reset)
|
||||
configWindow.fullscreen = false;
|
||||
if (configWindow.fullscreen == IS_FULLSCREEN())
|
||||
return;
|
||||
if (configWindow.fullscreen) {
|
||||
SDL_SetWindowFullscreen(wnd, SDL_WINDOW_FULLSCREEN_DESKTOP);
|
||||
|
@ -112,31 +118,29 @@ static void gfx_sdl_set_fullscreen() {
|
|||
}
|
||||
}
|
||||
|
||||
static void gfx_sdl_reset_dimension_and_pos() {
|
||||
if (configWindow.exiting_fullscreen) {
|
||||
static void gfx_sdl_reset_dimension_and_pos(void) {
|
||||
if (configWindow.exiting_fullscreen)
|
||||
configWindow.exiting_fullscreen = false;
|
||||
} else if (configWindow.reset) {
|
||||
configWindow.x = SDL_WINDOWPOS_CENTERED;
|
||||
configWindow.y = SDL_WINDOWPOS_CENTERED;
|
||||
|
||||
if (configWindow.reset) {
|
||||
configWindow.x = WAPI_WIN_CENTERPOS;
|
||||
configWindow.y = WAPI_WIN_CENTERPOS;
|
||||
configWindow.w = DESIRED_SCREEN_WIDTH;
|
||||
configWindow.h = DESIRED_SCREEN_HEIGHT;
|
||||
configWindow.reset = false;
|
||||
|
||||
if (IS_FULLSCREEN) {
|
||||
configWindow.fullscreen = false;
|
||||
return;
|
||||
}
|
||||
} else if (!configWindow.settings_changed) {
|
||||
return;
|
||||
}
|
||||
|
||||
configWindow.settings_changed = false;
|
||||
int xpos = (configWindow.x == WAPI_WIN_CENTERPOS) ? SDL_WINDOWPOS_CENTERED : configWindow.x;
|
||||
int ypos = (configWindow.y == WAPI_WIN_CENTERPOS) ? SDL_WINDOWPOS_CENTERED : configWindow.y;
|
||||
|
||||
SDL_SetWindowSize(wnd, configWindow.w, configWindow.h);
|
||||
SDL_SetWindowPosition(wnd, configWindow.x, configWindow.y);
|
||||
SDL_SetWindowPosition(wnd, xpos, ypos);
|
||||
SDL_GL_SetSwapInterval(configWindow.vsync); // in case vsync changed
|
||||
}
|
||||
|
||||
static void gfx_sdl_init(void) {
|
||||
static void gfx_sdl_init(const char *window_title) {
|
||||
SDL_Init(SDL_INIT_VIDEO);
|
||||
|
||||
SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, 24);
|
||||
|
@ -151,25 +155,12 @@ static void gfx_sdl_init(void) {
|
|||
//SDL_GL_SetAttribute(SDL_GL_MULTISAMPLEBUFFERS, 1);
|
||||
//SDL_GL_SetAttribute(SDL_GL_MULTISAMPLESAMPLES, 4);
|
||||
|
||||
if (gCLIOpts.FullScreen == 1)
|
||||
configWindow.fullscreen = true;
|
||||
else if (gCLIOpts.FullScreen == 2)
|
||||
configWindow.fullscreen = false;
|
||||
|
||||
char window_title[96] =
|
||||
#ifndef USE_GLES
|
||||
"Super Mario 64 PC port (OpenGL)";
|
||||
#else
|
||||
"Super Mario 64 PC port (OpenGL_ES2)";
|
||||
#endif
|
||||
|
||||
#ifdef NIGHTLY
|
||||
strcat(window_title, " nightly " GIT_HASH);
|
||||
#endif
|
||||
int xpos = (configWindow.x == WAPI_WIN_CENTERPOS) ? SDL_WINDOWPOS_CENTERED : configWindow.x;
|
||||
int ypos = (configWindow.y == WAPI_WIN_CENTERPOS) ? SDL_WINDOWPOS_CENTERED : configWindow.y;
|
||||
|
||||
wnd = SDL_CreateWindow(
|
||||
window_title,
|
||||
configWindow.x, configWindow.y, configWindow.w, configWindow.h,
|
||||
xpos, ypos, configWindow.w, configWindow.h,
|
||||
SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN | SDL_WINDOW_RESIZABLE
|
||||
);
|
||||
ctx = SDL_GL_CreateContext(wnd);
|
||||
|
@ -193,14 +184,11 @@ static void gfx_sdl_init(void) {
|
|||
}
|
||||
|
||||
static void gfx_sdl_main_loop(void (*run_one_game_iter)(void)) {
|
||||
Uint32 t;
|
||||
while (1) {
|
||||
t = SDL_GetTicks();
|
||||
run_one_game_iter();
|
||||
t = SDL_GetTicks() - t;
|
||||
if (t < FRAME_TIME && configWindow.vsync <= 1)
|
||||
SDL_Delay(FRAME_TIME - t);
|
||||
}
|
||||
Uint32 t = SDL_GetTicks();
|
||||
run_one_game_iter();
|
||||
t = SDL_GetTicks() - t;
|
||||
if (t < FRAME_TIME && configWindow.vsync <= 1)
|
||||
SDL_Delay(FRAME_TIME - t);
|
||||
}
|
||||
|
||||
static void gfx_sdl_get_dimensions(uint32_t *width, uint32_t *height) {
|
||||
|
@ -216,18 +204,20 @@ static int translate_scancode(int scancode) {
|
|||
}
|
||||
|
||||
static void gfx_sdl_onkeydown(int scancode) {
|
||||
keyboard_on_key_down(translate_scancode(scancode));
|
||||
if (kb_key_down)
|
||||
kb_key_down(translate_scancode(scancode));
|
||||
|
||||
const Uint8 *state = SDL_GetKeyboardState(NULL);
|
||||
|
||||
if (state[SDL_SCANCODE_LALT] && state[SDL_SCANCODE_RETURN])
|
||||
if (state[SDL_SCANCODE_LALT] && state[SDL_SCANCODE_RETURN]) {
|
||||
configWindow.fullscreen = !configWindow.fullscreen;
|
||||
else if (state[SDL_SCANCODE_ESCAPE] && configWindow.fullscreen)
|
||||
configWindow.fullscreen = false;
|
||||
configWindow.settings_changed = true;
|
||||
}
|
||||
}
|
||||
|
||||
static void gfx_sdl_onkeyup(int scancode) {
|
||||
keyboard_on_key_up(translate_scancode(scancode));
|
||||
if (kb_key_up)
|
||||
kb_key_up(translate_scancode(scancode));
|
||||
}
|
||||
|
||||
static void gfx_sdl_handle_events(void) {
|
||||
|
@ -244,11 +234,13 @@ static void gfx_sdl_handle_events(void) {
|
|||
break;
|
||||
#endif
|
||||
case SDL_WINDOWEVENT: // TODO: Check if this makes sense to be included in the Web build
|
||||
if (!(IS_FULLSCREEN || configWindow.exiting_fullscreen)) {
|
||||
if (!IS_FULLSCREEN()) {
|
||||
switch (event.window.event) {
|
||||
case SDL_WINDOWEVENT_MOVED:
|
||||
configWindow.x = event.window.data1;
|
||||
configWindow.y = event.window.data2;
|
||||
if (!configWindow.exiting_fullscreen) {
|
||||
if (event.window.data1 >= 0) configWindow.x = event.window.data1;
|
||||
if (event.window.data2 >= 0) configWindow.y = event.window.data2;
|
||||
}
|
||||
break;
|
||||
case SDL_WINDOWEVENT_SIZE_CHANGED:
|
||||
configWindow.w = event.window.data1;
|
||||
|
@ -263,12 +255,20 @@ static void gfx_sdl_handle_events(void) {
|
|||
}
|
||||
}
|
||||
|
||||
gfx_sdl_reset_dimension_and_pos();
|
||||
gfx_sdl_set_fullscreen();
|
||||
if (configWindow.settings_changed) {
|
||||
gfx_sdl_set_fullscreen();
|
||||
gfx_sdl_reset_dimension_and_pos();
|
||||
configWindow.settings_changed = false;
|
||||
}
|
||||
}
|
||||
|
||||
static void gfx_sdl_set_keyboard_callbacks(kb_callback_t on_key_down, kb_callback_t on_key_up, void (*on_all_keys_up)(void)) {
|
||||
kb_key_down = on_key_down;
|
||||
kb_key_up = on_key_up;
|
||||
kb_all_keys_up = on_all_keys_up;
|
||||
}
|
||||
|
||||
static bool gfx_sdl_start_frame(void) {
|
||||
frame_start = SDL_GetTicks();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -294,6 +294,7 @@ static void gfx_sdl_shutdown(void) {
|
|||
|
||||
struct GfxWindowManagerAPI gfx_sdl = {
|
||||
gfx_sdl_init,
|
||||
gfx_sdl_set_keyboard_callbacks,
|
||||
gfx_sdl_main_loop,
|
||||
gfx_sdl_get_dimensions,
|
||||
gfx_sdl_handle_events,
|
||||
|
@ -303,3 +304,5 @@ struct GfxWindowManagerAPI gfx_sdl = {
|
|||
gfx_sdl_get_time,
|
||||
gfx_sdl_shutdown
|
||||
};
|
||||
|
||||
#endif // BACKEND_WM
|
||||
|
|
|
@ -4,8 +4,14 @@
|
|||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
// special value for window position that signifies centered position
|
||||
#define WAPI_WIN_CENTERPOS 0xFFFFFFFF
|
||||
|
||||
typedef bool (*kb_callback_t)(int code);
|
||||
|
||||
struct GfxWindowManagerAPI {
|
||||
void (*init)(void);
|
||||
void (*init)(const char *window_title);
|
||||
void (*set_keyboard_callbacks)(kb_callback_t on_key_down, kb_callback_t on_key_up, void (*on_all_keys_up)(void));
|
||||
void (*main_loop)(void (*run_one_game_iter)(void));
|
||||
void (*get_dimensions)(uint32_t *width, uint32_t *height);
|
||||
void (*handle_events)(void);
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#ifdef TARGET_WEB
|
||||
#include <emscripten.h>
|
||||
|
@ -12,6 +13,8 @@
|
|||
|
||||
#include "gfx/gfx_pc.h"
|
||||
#include "gfx/gfx_opengl.h"
|
||||
#include "gfx/gfx_direct3d11.h"
|
||||
#include "gfx/gfx_direct3d12.h"
|
||||
#include "gfx/gfx_sdl.h"
|
||||
|
||||
#include "audio/audio_api.h"
|
||||
|
@ -22,10 +25,17 @@
|
|||
#include "cliopts.h"
|
||||
#include "configfile.h"
|
||||
#include "controller/controller_api.h"
|
||||
#include "controller/controller_keyboard.h"
|
||||
#include "fs/fs.h"
|
||||
|
||||
#include "game/game_init.h"
|
||||
#include "game/main.h"
|
||||
#include "game/thread6.h"
|
||||
|
||||
#ifdef DISCORDRPC
|
||||
#include "pc/discord/discordrpc.h"
|
||||
#endif
|
||||
|
||||
OSMesg D_80339BEC;
|
||||
OSMesgQueue gSIEventMesgQueue;
|
||||
|
||||
|
@ -65,10 +75,16 @@ void send_display_list(struct SPTask *spTask) {
|
|||
#define printf
|
||||
|
||||
void produce_one_frame(void) {
|
||||
|
||||
gfx_start_frame();
|
||||
|
||||
set_sequence_player_volume(SEQ_PLAYER_LEVEL, (f32)configMusicVolume / 127.0f);
|
||||
set_sequence_player_volume(SEQ_PLAYER_SFX, (f32)configSfxVolume / 127.0f);
|
||||
set_sequence_player_volume(SEQ_PLAYER_ENV, (f32)configEnvVolume / 127.0f);
|
||||
|
||||
game_loop_one_iteration();
|
||||
thread6_rumble_loop(NULL);
|
||||
|
||||
|
||||
int samples_left = audio_api->buffered();
|
||||
u32 num_audio_samples = samples_left < audio_api->get_desired_buffered() ? 544 : 528;
|
||||
//printf("Audio samples: %d %u\n", samples_left, num_audio_samples);
|
||||
|
@ -88,7 +104,7 @@ void produce_one_frame(void) {
|
|||
audio_buffer[i] = ((s32)audio_buffer[i] * mod) >> VOLUME_SHIFT;
|
||||
|
||||
audio_api->play((u8*)audio_buffer, 2 * num_audio_samples * 4);
|
||||
|
||||
|
||||
gfx_end_frame();
|
||||
}
|
||||
|
||||
|
@ -100,6 +116,9 @@ void audio_shutdown(void) {
|
|||
}
|
||||
|
||||
void game_deinit(void) {
|
||||
#ifdef DISCORDRPC
|
||||
discord_shutdown();
|
||||
#endif
|
||||
configfile_save(configfile_name());
|
||||
controller_shutdown();
|
||||
audio_shutdown();
|
||||
|
@ -153,11 +172,51 @@ void main_func(void) {
|
|||
main_pool_init(pool, pool + sizeof(pool) / sizeof(pool[0]));
|
||||
gEffectsMemoryPool = mem_pool_init(0x4000, MEMORY_POOL_LEFT);
|
||||
|
||||
const char *gamedir = gCLIOpts.GameDir[0] ? gCLIOpts.GameDir : FS_BASEDIR;
|
||||
const char *userpath = gCLIOpts.SavePath[0] ? gCLIOpts.SavePath : sys_user_path();
|
||||
fs_init(sys_ropaths, gamedir, userpath);
|
||||
|
||||
configfile_load(configfile_name());
|
||||
|
||||
if (gCLIOpts.FullScreen == 1)
|
||||
configWindow.fullscreen = true;
|
||||
else if (gCLIOpts.FullScreen == 2)
|
||||
configWindow.fullscreen = false;
|
||||
|
||||
#if defined(WAPI_SDL1) || defined(WAPI_SDL2)
|
||||
wm_api = &gfx_sdl;
|
||||
#elif defined(WAPI_DXGI)
|
||||
wm_api = &gfx_dxgi;
|
||||
#else
|
||||
#error No window API!
|
||||
#endif
|
||||
|
||||
#if defined(RAPI_D3D11)
|
||||
rendering_api = &gfx_d3d11_api;
|
||||
# define RAPI_NAME "DirectX 11"
|
||||
#elif defined(RAPI_D3D12)
|
||||
rendering_api = &gfx_d3d12_api;
|
||||
# define RAPI_NAME "DirectX 12"
|
||||
#elif defined(RAPI_GL) || defined(RAPI_GL_LEGACY)
|
||||
rendering_api = &gfx_opengl_api;
|
||||
gfx_init(wm_api, rendering_api);
|
||||
# ifdef USE_GLES
|
||||
# define RAPI_NAME "OpenGL ES"
|
||||
# else
|
||||
# define RAPI_NAME "OpenGL"
|
||||
# endif
|
||||
#else
|
||||
#error No rendering API!
|
||||
#endif
|
||||
|
||||
char window_title[96] =
|
||||
"Super Mario 64 PC port (" RAPI_NAME ")"
|
||||
#ifdef NIGHTLY
|
||||
" nightly " GIT_HASH
|
||||
#endif
|
||||
;
|
||||
|
||||
gfx_init(wm_api, rendering_api, window_title);
|
||||
wm_api->set_keyboard_callbacks(keyboard_on_key_down, keyboard_on_key_up, keyboard_on_all_keys_up);
|
||||
|
||||
if (audio_api == NULL && audio_sdl.init())
|
||||
audio_api = &audio_sdl;
|
||||
|
@ -170,14 +229,32 @@ void main_func(void) {
|
|||
sound_init();
|
||||
|
||||
thread5_game_loop(NULL);
|
||||
|
||||
|
||||
inited = true;
|
||||
|
||||
#ifdef EXTERNAL_DATA
|
||||
// precache data if needed
|
||||
if (configPrecacheRes) {
|
||||
fprintf(stdout, "precaching data\n");
|
||||
fflush(stdout);
|
||||
gfx_precache_textures();
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef DISCORDRPC
|
||||
discord_init();
|
||||
#endif
|
||||
|
||||
#ifdef TARGET_WEB
|
||||
emscripten_set_main_loop(em_main_loop, 0, 0);
|
||||
request_anim_frame(on_anim_frame);
|
||||
#else
|
||||
wm_api->main_loop(produce_one_frame);
|
||||
while (true) {
|
||||
wm_api->main_loop(produce_one_frame);
|
||||
#ifdef DISCORDRPC
|
||||
discord_update_rich_presence();
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
|
@ -1,17 +1,26 @@
|
|||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdarg.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <dirent.h>
|
||||
#include <ctype.h>
|
||||
#ifdef _WIN32
|
||||
#include <direct.h>
|
||||
#endif
|
||||
|
||||
#include "cliopts.h"
|
||||
#include "fs/fs.h"
|
||||
|
||||
/* NULL terminated list of platform specific read-only data paths */
|
||||
/* priority is top first */
|
||||
const char *sys_ropaths[] = {
|
||||
".", // working directory
|
||||
"!", // executable directory
|
||||
#if defined(__linux__) || defined(__unix__)
|
||||
// some common UNIX directories for read only stuff
|
||||
"/usr/local/share/sm64pc",
|
||||
"/usr/share/sm64pc",
|
||||
"/opt/sm64pc",
|
||||
#endif
|
||||
NULL,
|
||||
};
|
||||
|
||||
/* these are not available on some platforms, so might as well */
|
||||
|
||||
|
@ -40,207 +49,85 @@ int sys_strcasecmp(const char *s1, const char *s2) {
|
|||
return result;
|
||||
}
|
||||
|
||||
/* file system stuff */
|
||||
|
||||
bool sys_file_exists(const char *name) {
|
||||
struct stat st;
|
||||
return (stat(name, &st) == 0 && S_ISREG(st.st_mode));
|
||||
const char *sys_file_extension(const char *fpath) {
|
||||
const char *fname = sys_file_name(fpath);
|
||||
const char *dot = strrchr(fname, '.');
|
||||
if (!dot || !dot[1]) return NULL; // no dot
|
||||
if (dot == fname) return NULL; // dot is the first char (e.g. .local)
|
||||
return dot + 1;
|
||||
}
|
||||
|
||||
bool sys_dir_exists(const char *name) {
|
||||
struct stat st;
|
||||
return (stat(name, &st) == 0 && S_ISDIR(st.st_mode));
|
||||
const char *sys_file_name(const char *fpath) {
|
||||
const char *sep1 = strrchr(fpath, '/');
|
||||
const char *sep2 = strrchr(fpath, '\\');
|
||||
const char *sep = sep1 > sep2 ? sep1 : sep2;
|
||||
if (!sep) return fpath;
|
||||
return sep + 1;
|
||||
}
|
||||
|
||||
bool sys_dir_walk(const char *base, walk_fn_t walk, const bool recur) {
|
||||
char fullpath[SYS_MAX_PATH];
|
||||
DIR *dir;
|
||||
struct dirent *ent;
|
||||
/* this calls a platform-specific impl function after forming the error message */
|
||||
|
||||
if (!(dir = opendir(base))) {
|
||||
fprintf(stderr, "sys_dir_walk(): could not open `%s`\n", base);
|
||||
return false;
|
||||
}
|
||||
static void sys_fatal_impl(const char *msg) __attribute__ ((noreturn));
|
||||
|
||||
bool ret = true;
|
||||
|
||||
while ((ent = readdir(dir)) != NULL) {
|
||||
if (ent->d_name[0] == 0 || ent->d_name[0] == '.') continue; // skip ./.. and hidden files
|
||||
snprintf(fullpath, sizeof(fullpath), "%s/%s", base, ent->d_name);
|
||||
if (sys_dir_exists(fullpath)) {
|
||||
if (recur) {
|
||||
if (!sys_dir_walk(fullpath, walk, recur)) {
|
||||
ret = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (!walk(fullpath)) {
|
||||
ret = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
closedir(dir);
|
||||
return ret;
|
||||
void sys_fatal(const char *fmt, ...) {
|
||||
static char msg[2048];
|
||||
va_list args;
|
||||
va_start(args, fmt);
|
||||
vsnprintf(msg, sizeof(msg), fmt, args);
|
||||
va_end(args);
|
||||
fflush(stdout); // push all crap out
|
||||
sys_fatal_impl(msg);
|
||||
}
|
||||
|
||||
void *sys_load_res(const char *name) {
|
||||
char path[SYS_MAX_PATH] = { 0 };
|
||||
snprintf(path, sizeof(path), "%s/%s", sys_data_path(), name);
|
||||
|
||||
FILE *f = fopen(path, "rb");
|
||||
if (!f) return NULL;
|
||||
|
||||
fseek(f, 0, SEEK_END);
|
||||
size_t size = ftell(f);
|
||||
fseek(f, 0, SEEK_SET);
|
||||
|
||||
void *buf = malloc(size);
|
||||
if (!buf) {
|
||||
fclose(f);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
fread(buf, 1, size, f);
|
||||
fclose(f);
|
||||
|
||||
return buf;
|
||||
}
|
||||
|
||||
bool sys_mkdir(const char *name) {
|
||||
#ifdef _WIN32
|
||||
return _mkdir(name) == 0;
|
||||
#else
|
||||
return mkdir(name, 0777) == 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
#if USE_SDL
|
||||
#ifdef HAVE_SDL2
|
||||
|
||||
// we can just ask SDL for most of this shit if we have it
|
||||
#include <SDL2/SDL.h>
|
||||
|
||||
const char *sys_data_path(void) {
|
||||
const char *sys_user_path(void) {
|
||||
static char path[SYS_MAX_PATH] = { 0 };
|
||||
|
||||
if (!path[0]) {
|
||||
// prefer the override, if it is set
|
||||
// "!" expands to executable path
|
||||
if (gCLIOpts.DataPath[0]) {
|
||||
if (gCLIOpts.DataPath[0] == '!')
|
||||
snprintf(path, sizeof(path), "%s%s", sys_exe_path(), gCLIOpts.DataPath + 1);
|
||||
else
|
||||
snprintf(path, sizeof(path), "%s", gCLIOpts.DataPath);
|
||||
if (sys_dir_exists(path)) return path;
|
||||
printf("Warning: Specified data path ('%s') doesn't exist\n", path);
|
||||
}
|
||||
|
||||
// then the executable directory
|
||||
snprintf(path, sizeof(path), "%s/" DATADIR, sys_exe_path());
|
||||
if (sys_dir_exists(path)) return path;
|
||||
|
||||
// then the save path
|
||||
snprintf(path, sizeof(path), "%s/" DATADIR, sys_save_path());
|
||||
if (sys_dir_exists(path)) return path;
|
||||
|
||||
#if defined(__linux__) || defined(__unix__)
|
||||
// on Linux/BSD try some common paths for read-only data
|
||||
const char *try[] = {
|
||||
"/usr/local/share/sm64pc/" DATADIR,
|
||||
"/usr/share/sm64pc/" DATADIR,
|
||||
"/opt/sm64pc/" DATADIR,
|
||||
};
|
||||
for (unsigned i = 0; i < sizeof(try) / sizeof(try[0]); ++i) {
|
||||
if (sys_dir_exists(try[i])) {
|
||||
strcpy(path, try[i]);
|
||||
return path;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
// hope for the best
|
||||
strcpy(path, "./" DATADIR);
|
||||
// get it from SDL
|
||||
char *sdlpath = SDL_GetPrefPath("", "sm64pc");
|
||||
if (sdlpath) {
|
||||
const unsigned int len = strlen(sdlpath);
|
||||
strncpy(path, sdlpath, sizeof(path));
|
||||
path[sizeof(path)-1] = 0;
|
||||
SDL_free(sdlpath);
|
||||
if (path[len-1] == '/' || path[len-1] == '\\')
|
||||
path[len-1] = 0; // strip the trailing separator
|
||||
if (!fs_sys_dir_exists(path) && !fs_sys_mkdir(path))
|
||||
path[0] = 0;
|
||||
}
|
||||
|
||||
return path;
|
||||
}
|
||||
|
||||
const char *sys_save_path(void) {
|
||||
static char path[SYS_MAX_PATH] = { 0 };
|
||||
|
||||
if (!path[0]) {
|
||||
// if the override is set, use that
|
||||
// "!" expands to executable path
|
||||
if (gCLIOpts.SavePath[0]) {
|
||||
if (gCLIOpts.SavePath[0] == '!')
|
||||
snprintf(path, sizeof(path), "%s%s", sys_exe_path(), gCLIOpts.SavePath + 1);
|
||||
else
|
||||
snprintf(path, sizeof(path), "%s", gCLIOpts.SavePath);
|
||||
if (!sys_dir_exists(path) && !sys_mkdir(path)) {
|
||||
printf("Warning: Specified save path ('%s') doesn't exist and can't be created\n", path);
|
||||
path[0] = 0; // doesn't exist and no write access
|
||||
}
|
||||
}
|
||||
|
||||
// didn't work? get it from SDL
|
||||
if (!path[0]) {
|
||||
char *sdlpath = SDL_GetPrefPath("", "sm64pc");
|
||||
if (sdlpath) {
|
||||
const unsigned int len = strlen(sdlpath);
|
||||
strncpy(path, sdlpath, sizeof(path));
|
||||
path[sizeof(path)-1] = 0;
|
||||
SDL_free(sdlpath);
|
||||
if (path[len-1] == '/' || path[len-1] == '\\')
|
||||
path[len-1] = 0; // strip the trailing separator
|
||||
if (!sys_dir_exists(path) && !sys_mkdir(path))
|
||||
path[0] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
// if all else fails, just store near the EXE
|
||||
if (!path[0])
|
||||
strcpy(path, sys_exe_path());
|
||||
|
||||
printf("Save path set to '%s'\n", path);
|
||||
}
|
||||
|
||||
return path;
|
||||
}
|
||||
|
||||
const char *sys_exe_path(void) {
|
||||
static char path[SYS_MAX_PATH] = { 0 };
|
||||
|
||||
if (!path[0]) {
|
||||
char *sdlpath = SDL_GetBasePath();
|
||||
if (sdlpath) {
|
||||
// use the SDL path if it exists
|
||||
const unsigned int len = strlen(sdlpath);
|
||||
strncpy(path, sdlpath, sizeof(path));
|
||||
path[sizeof(path)-1] = 0;
|
||||
SDL_free(sdlpath);
|
||||
if (path[len-1] == '/' || path[len-1] == '\\')
|
||||
path[len-1] = 0; // strip the trailing separator
|
||||
} else {
|
||||
// hope for the best
|
||||
strcpy(path, ".");
|
||||
}
|
||||
printf("Executable path set to '%s'\n", path);
|
||||
char *sdlpath = SDL_GetBasePath();
|
||||
if (sdlpath && sdlpath[0]) {
|
||||
// use the SDL path if it exists
|
||||
const unsigned int len = strlen(sdlpath);
|
||||
strncpy(path, sdlpath, sizeof(path));
|
||||
path[sizeof(path)-1] = 0;
|
||||
SDL_free(sdlpath);
|
||||
if (path[len-1] == '/' || path[len-1] == '\\')
|
||||
path[len-1] = 0; // strip the trailing separator
|
||||
}
|
||||
|
||||
return path;
|
||||
}
|
||||
|
||||
static void sys_fatal_impl(const char *msg) {
|
||||
SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR , "Fatal error", msg, NULL);
|
||||
fprintf(stderr, "FATAL ERROR:\n%s\n", msg);
|
||||
fflush(stderr);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
#warning "You might want to implement these functions for your platform"
|
||||
|
||||
const char *sys_data_path(void) {
|
||||
return ".";
|
||||
}
|
||||
|
||||
const char *sys_save_path(void) {
|
||||
const char *sys_user_path(void) {
|
||||
return ".";
|
||||
}
|
||||
|
||||
|
@ -248,4 +135,10 @@ const char *sys_exe_path(void) {
|
|||
return ".";
|
||||
}
|
||||
|
||||
static void sys_fatal_impl(const char *msg) {
|
||||
fprintf(stderr, "FATAL ERROR:\n%s\n", msg);
|
||||
fflush(stderr);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
#endif // platform switch
|
||||
|
|
|
@ -7,29 +7,23 @@
|
|||
|
||||
/* Platform-specific functions and whatnot */
|
||||
|
||||
#define DATADIR "res"
|
||||
#define SYS_MAX_PATH 1024 // FIXME: define this on different platforms
|
||||
|
||||
// NULL terminated list of platform specific read-only data paths
|
||||
extern const char *sys_ropaths[];
|
||||
|
||||
// crossplatform impls of misc stuff
|
||||
char *sys_strdup(const char *src);
|
||||
char *sys_strlwr(char *src);
|
||||
int sys_strcasecmp(const char *s1, const char *s2);
|
||||
|
||||
// filesystem stuff
|
||||
bool sys_mkdir(const char *name); // creates with 0777 by default
|
||||
bool sys_file_exists(const char *name);
|
||||
bool sys_dir_exists(const char *name);
|
||||
void *sys_load_res(const char *name);
|
||||
|
||||
// receives the full path
|
||||
// should return `true` if traversal should continue
|
||||
typedef bool (*walk_fn_t)(const char *);
|
||||
// returns `true` if the directory was successfully opened and walk() didn't ever return false
|
||||
bool sys_dir_walk(const char *base, walk_fn_t walk, const bool recur);
|
||||
|
||||
// path stuff
|
||||
const char *sys_data_path(void);
|
||||
const char *sys_save_path(void);
|
||||
const char *sys_user_path(void);
|
||||
const char *sys_exe_path(void);
|
||||
const char *sys_file_extension(const char *fpath);
|
||||
const char *sys_file_name(const char *fpath);
|
||||
|
||||
// shows an error message in some way and terminates the game
|
||||
void sys_fatal(const char *fmt, ...) __attribute__ ((noreturn));
|
||||
|
||||
#endif // _SM64_PLATFORM_H_
|
||||
|
|
|
@ -3,6 +3,9 @@
|
|||
#include "lib/src/libultra_internal.h"
|
||||
#include "macros.h"
|
||||
#include "platform.h"
|
||||
#include "fs/fs.h"
|
||||
|
||||
#define SAVE_FILENAME "sm64_save_file.bin"
|
||||
|
||||
#ifdef TARGET_WEB
|
||||
#include <emscripten.h>
|
||||
|
@ -120,17 +123,15 @@ s32 osEepromLongRead(UNUSED OSMesgQueue *mq, u8 address, u8 *buffer, int nbytes)
|
|||
ret = 0;
|
||||
}
|
||||
#else
|
||||
char save_path[SYS_MAX_PATH] = { 0 };
|
||||
snprintf(save_path, sizeof(save_path), "%s/sm64_save_file.bin", sys_save_path());
|
||||
FILE *fp = fopen(save_path, "rb");
|
||||
fs_file_t *fp = fs_open(SAVE_FILENAME);
|
||||
if (fp == NULL) {
|
||||
return -1;
|
||||
}
|
||||
if (fread(content, 1, 512, fp) == 512) {
|
||||
if (fs_read(fp, content, 512) == 512) {
|
||||
memcpy(buffer, content + address * 8, nbytes);
|
||||
ret = 0;
|
||||
}
|
||||
fclose(fp);
|
||||
fs_close(fp);
|
||||
#endif
|
||||
return ret;
|
||||
}
|
||||
|
@ -152,9 +153,7 @@ s32 osEepromLongWrite(UNUSED OSMesgQueue *mq, u8 address, u8 *buffer, int nbytes
|
|||
}, content);
|
||||
s32 ret = 0;
|
||||
#else
|
||||
char save_path[SYS_MAX_PATH] = { 0 };
|
||||
snprintf(save_path, sizeof(save_path), "%s/sm64_save_file.bin", sys_save_path());
|
||||
FILE *fp = fopen(save_path, "wb");
|
||||
FILE *fp = fopen(fs_get_write_path(SAVE_FILENAME), "wb");
|
||||
if (fp == NULL) {
|
||||
return -1;
|
||||
}
|
||||
|
|
|
@ -1,17 +1,26 @@
|
|||
UNAME := $(shell uname)
|
||||
DEBUG ?= 0
|
||||
|
||||
ifeq ($(UNAME),Darwin)
|
||||
OSX_BUILD := -DOSX_BUILD
|
||||
OSX_BUILD := -DOSX_BUILD
|
||||
endif
|
||||
|
||||
ifeq ($(DEBUG),1)
|
||||
OPT_FLAG := -g
|
||||
else
|
||||
OPT_FLAG := -O2
|
||||
endif
|
||||
|
||||
CC := gcc
|
||||
CFLAGS := -Llib -Iinclude -I../include -I . -Wall -Wextra -Wno-unused-parameter $(OSX_BUILD) -pedantic -std=c99 -O3 -s
|
||||
CXX := g++
|
||||
CFLAGS := -Llib -Iinclude -I../include -I . -Wall -Wextra -Wno-unused-parameter $(OSX_BUILD) -pedantic -std=c99 $(OPT_FLAG) -s
|
||||
PROGRAMS := n64graphics n64graphics_ci mio0 n64cksum textconv patch_libultra_math iplfontutil aifc_decode aiff_extract_codebook vadpcm_enc tabledesign extract_data_for_mio skyconv
|
||||
|
||||
n64graphics_SOURCES := n64graphics.c utils.c
|
||||
n64graphics_CFLAGS := -DN64GRAPHICS_STANDALONE
|
||||
|
||||
n64graphics_ci_SOURCES := n64graphics_ci_dir/n64graphics_ci.c n64graphics_ci_dir/exoquant/exoquant.c n64graphics_ci_dir/utils.c
|
||||
n64graphics_ci_CFLAGS := -O2 # 3s faster compile time
|
||||
n64graphics_ci_CFLAGS := $(OPT_FLAG)
|
||||
|
||||
mio0_SOURCES := libmio0.c
|
||||
mio0_CFLAGS := -DMIO0_STANDALONE
|
||||
|
@ -22,33 +31,44 @@ textconv_SOURCES := textconv.c utf8.c hashtable.c
|
|||
patch_libultra_math_SOURCES := patch_libultra_math.c
|
||||
|
||||
iplfontutil_SOURCES := iplfontutil.c
|
||||
iplfontutil_CFLAGS := -O2 # faster compile time
|
||||
iplfontutil_CFLAGS := $(OPT_FLAG)
|
||||
|
||||
aifc_decode_SOURCES := aifc_decode.c
|
||||
aifc_decode_CFLAGS := -O2 # both runs and compiles faster than -O3
|
||||
aifc_decode_CFLAGS := $(OPT_FLAG)
|
||||
|
||||
aiff_extract_codebook_SOURCES := aiff_extract_codebook.c
|
||||
|
||||
tabledesign_SOURCES := sdk-tools/tabledesign/codebook.c sdk-tools/tabledesign/estimate.c sdk-tools/tabledesign/print.c sdk-tools/tabledesign/tabledesign.c
|
||||
tabledesign_CFLAGS := -Wno-uninitialized -laudiofile -lstdc++
|
||||
tabledesign_CFLAGS := -Wno-uninitialized -Iaudiofile -Laudiofile -laudiofile -lstdc++ -lm
|
||||
|
||||
vadpcm_enc_SOURCES := sdk-tools/adpcm/vadpcm_enc.c sdk-tools/adpcm/vpredictor.c sdk-tools/adpcm/quant.c sdk-tools/adpcm/util.c sdk-tools/adpcm/vencode.c
|
||||
vadpcm_enc_CFLAGS := -Wno-unused-result -Wno-uninitialized -Wno-sign-compare -Wno-absolute-value
|
||||
|
||||
extract_data_for_mio_SOURCES := extract_data_for_mio.c
|
||||
extract_data_for_mio_CFLAGS := -O2
|
||||
extract_data_for_mio_CFLAGS := $(OPT_FLAG)
|
||||
|
||||
skyconv_SOURCES := skyconv.c n64graphics.c utils.c
|
||||
skyconv_CFLAGS := -O2 -lm
|
||||
skyconv_CFLAGS := $(OPT_FLAG) -lm
|
||||
|
||||
all: $(PROGRAMS)
|
||||
LIBAUDIOFILE := audiofile/libaudiofile.a
|
||||
|
||||
all: $(LIBAUDIOFILE) $(PROGRAMS)
|
||||
|
||||
$(LIBAUDIOFILE):
|
||||
@$(MAKE) -C audiofile
|
||||
|
||||
clean:
|
||||
$(RM) $(PROGRAMS)
|
||||
$(RM) gen_asset_list
|
||||
$(MAKE) -C audiofile clean
|
||||
|
||||
define COMPILE
|
||||
$(1): $($1_SOURCES)
|
||||
$(CC) $(CFLAGS) $(OSX_BUILD) $$^ -lm -o $$@ $($1_CFLAGS)
|
||||
endef
|
||||
|
||||
# Separate build for debugging gen_asset_list.cpp
|
||||
gen_asset_list:
|
||||
$(CXX) -std=c++17 gen_asset_list.cpp -lstdc++fs $(OPT_FLAG) -Wall -o gen_asset_list
|
||||
|
||||
$(foreach p,$(PROGRAMS),$(eval $(call COMPILE,$(p))))
|
||||
|
|
|
@ -19,11 +19,19 @@ typedef unsigned int u32;
|
|||
typedef unsigned long long u64;
|
||||
typedef float f32;
|
||||
|
||||
#define bswap16(x) __builtin_bswap16(x)
|
||||
#define bswap32(x) __builtin_bswap32(x)
|
||||
#define BSWAP16(x) x = __builtin_bswap16(x)
|
||||
#define BSWAP32(x) x = __builtin_bswap32(x)
|
||||
#define BSWAP16_MANY(x, n) for (s32 _i = 0; _i < n; _i++) BSWAP16((x)[_i])
|
||||
#if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
|
||||
# define bswap16(x) (x)
|
||||
# define bswap32(x) (x)
|
||||
# define BSWAP16(x)
|
||||
# define BSWAP32(x)
|
||||
# define BSWAP16_MANY(x, n)
|
||||
#else
|
||||
# define bswap16(x) __builtin_bswap16(x)
|
||||
# define bswap32(x) __builtin_bswap32(x)
|
||||
# define BSWAP16(x) x = __builtin_bswap16(x)
|
||||
# define BSWAP32(x) x = __builtin_bswap32(x)
|
||||
# define BSWAP16_MANY(x, n) for (s32 _i = 0; _i < n; _i++) BSWAP16((x)[_i])
|
||||
#endif
|
||||
|
||||
#define NORETURN __attribute__((noreturn))
|
||||
#define UNUSED __attribute__((unused))
|
||||
|
|
|
@ -15,8 +15,13 @@ typedef int s32;
|
|||
typedef unsigned char u8;
|
||||
typedef unsigned int u32;
|
||||
|
||||
#define BSWAP16(x) x = __builtin_bswap16(x)
|
||||
#define BSWAP32(x) x = __builtin_bswap32(x)
|
||||
#if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
|
||||
# define BSWAP16(x)
|
||||
# define BSWAP32(x)
|
||||
#else
|
||||
# define BSWAP16(x) x = __builtin_bswap16(x)
|
||||
# define BSWAP32(x) x = __builtin_bswap32(x)
|
||||
#endif
|
||||
|
||||
#define NORETURN __attribute__((noreturn))
|
||||
#define UNUSED __attribute__((unused))
|
||||
|
|
|
@ -1,25 +0,0 @@
|
|||
Thanks to all who have contributed patches for the Audio File Library:
|
||||
* Jason Allen
|
||||
* Julien Boulnois
|
||||
* Davy Durham
|
||||
* Bruce Forsberg
|
||||
* Fabrizio Gennari
|
||||
* Simon Kagedal
|
||||
* Thomas Klausner
|
||||
* Daniel Kobras
|
||||
* Michael Krause
|
||||
* Wim Lewis
|
||||
* Eric Mitchell
|
||||
* Cristian Morales Vega
|
||||
* Mark Murnane
|
||||
* Michael Palimaka
|
||||
* Jean-Francois Panisset
|
||||
* Axel Roebel
|
||||
* Matthias Rumpke
|
||||
* Chris Wolf
|
||||
|
||||
Thanks to Douglas Scott of SGI for helping me understand the tricky parts
|
||||
of the Audio File Library API. Thanks to Chris Pirazzi and Scott Porter
|
||||
of SGI for creating the Audio File Library in the first place.
|
||||
|
||||
Thanks also to all who have reported bugs.
|
|
@ -1,5 +0,0 @@
|
|||
Audio File Library Authors
|
||||
|
||||
Michael Pruett <michael@68k.org>
|
||||
|
||||
Chris Pirazzi, Scott Porter, and Doug Scott
|
|
@ -1,502 +0,0 @@
|
|||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
Version 2.1, February 1999
|
||||
|
||||
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
[This is the first released version of the Lesser GPL. It also counts
|
||||
as the successor of the GNU Library Public License, version 2, hence
|
||||
the version number 2.1.]
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
Licenses are intended to guarantee your freedom to share and change
|
||||
free software--to make sure the software is free for all its users.
|
||||
|
||||
This license, the Lesser General Public License, applies to some
|
||||
specially designated software packages--typically libraries--of the
|
||||
Free Software Foundation and other authors who decide to use it. You
|
||||
can use it too, but we suggest you first think carefully about whether
|
||||
this license or the ordinary General Public License is the better
|
||||
strategy to use in any particular case, based on the explanations below.
|
||||
|
||||
When we speak of free software, we are referring to freedom of use,
|
||||
not price. Our General Public Licenses are designed to make sure that
|
||||
you have the freedom to distribute copies of free software (and charge
|
||||
for this service if you wish); that you receive source code or can get
|
||||
it if you want it; that you can change the software and use pieces of
|
||||
it in new free programs; and that you are informed that you can do
|
||||
these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
distributors to deny you these rights or to ask you to surrender these
|
||||
rights. These restrictions translate to certain responsibilities for
|
||||
you if you distribute copies of the library or if you modify it.
|
||||
|
||||
For example, if you distribute copies of the library, whether gratis
|
||||
or for a fee, you must give the recipients all the rights that we gave
|
||||
you. You must make sure that they, too, receive or can get the source
|
||||
code. If you link other code with the library, you must provide
|
||||
complete object files to the recipients, so that they can relink them
|
||||
with the library after making changes to the library and recompiling
|
||||
it. And you must show them these terms so they know their rights.
|
||||
|
||||
We protect your rights with a two-step method: (1) we copyright the
|
||||
library, and (2) we offer you this license, which gives you legal
|
||||
permission to copy, distribute and/or modify the library.
|
||||
|
||||
To protect each distributor, we want to make it very clear that
|
||||
there is no warranty for the free library. Also, if the library is
|
||||
modified by someone else and passed on, the recipients should know
|
||||
that what they have is not the original version, so that the original
|
||||
author's reputation will not be affected by problems that might be
|
||||
introduced by others.
|
||||
|
||||
Finally, software patents pose a constant threat to the existence of
|
||||
any free program. We wish to make sure that a company cannot
|
||||
effectively restrict the users of a free program by obtaining a
|
||||
restrictive license from a patent holder. Therefore, we insist that
|
||||
any patent license obtained for a version of the library must be
|
||||
consistent with the full freedom of use specified in this license.
|
||||
|
||||
Most GNU software, including some libraries, is covered by the
|
||||
ordinary GNU General Public License. This license, the GNU Lesser
|
||||
General Public License, applies to certain designated libraries, and
|
||||
is quite different from the ordinary General Public License. We use
|
||||
this license for certain libraries in order to permit linking those
|
||||
libraries into non-free programs.
|
||||
|
||||
When a program is linked with a library, whether statically or using
|
||||
a shared library, the combination of the two is legally speaking a
|
||||
combined work, a derivative of the original library. The ordinary
|
||||
General Public License therefore permits such linking only if the
|
||||
entire combination fits its criteria of freedom. The Lesser General
|
||||
Public License permits more lax criteria for linking other code with
|
||||
the library.
|
||||
|
||||
We call this license the "Lesser" General Public License because it
|
||||
does Less to protect the user's freedom than the ordinary General
|
||||
Public License. It also provides other free software developers Less
|
||||
of an advantage over competing non-free programs. These disadvantages
|
||||
are the reason we use the ordinary General Public License for many
|
||||
libraries. However, the Lesser license provides advantages in certain
|
||||
special circumstances.
|
||||
|
||||
For example, on rare occasions, there may be a special need to
|
||||
encourage the widest possible use of a certain library, so that it becomes
|
||||
a de-facto standard. To achieve this, non-free programs must be
|
||||
allowed to use the library. A more frequent case is that a free
|
||||
library does the same job as widely used non-free libraries. In this
|
||||
case, there is little to gain by limiting the free library to free
|
||||
software only, so we use the Lesser General Public License.
|
||||
|
||||
In other cases, permission to use a particular library in non-free
|
||||
programs enables a greater number of people to use a large body of
|
||||
free software. For example, permission to use the GNU C Library in
|
||||
non-free programs enables many more people to use the whole GNU
|
||||
operating system, as well as its variant, the GNU/Linux operating
|
||||
system.
|
||||
|
||||
Although the Lesser General Public License is Less protective of the
|
||||
users' freedom, it does ensure that the user of a program that is
|
||||
linked with the Library has the freedom and the wherewithal to run
|
||||
that program using a modified version of the Library.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow. Pay close attention to the difference between a
|
||||
"work based on the library" and a "work that uses the library". The
|
||||
former contains code derived from the library, whereas the latter must
|
||||
be combined with the library in order to run.
|
||||
|
||||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License Agreement applies to any software library or other
|
||||
program which contains a notice placed by the copyright holder or
|
||||
other authorized party saying it may be distributed under the terms of
|
||||
this Lesser General Public License (also called "this License").
|
||||
Each licensee is addressed as "you".
|
||||
|
||||
A "library" means a collection of software functions and/or data
|
||||
prepared so as to be conveniently linked with application programs
|
||||
(which use some of those functions and data) to form executables.
|
||||
|
||||
The "Library", below, refers to any such software library or work
|
||||
which has been distributed under these terms. A "work based on the
|
||||
Library" means either the Library or any derivative work under
|
||||
copyright law: that is to say, a work containing the Library or a
|
||||
portion of it, either verbatim or with modifications and/or translated
|
||||
straightforwardly into another language. (Hereinafter, translation is
|
||||
included without limitation in the term "modification".)
|
||||
|
||||
"Source code" for a work means the preferred form of the work for
|
||||
making modifications to it. For a library, complete source code means
|
||||
all the source code for all modules it contains, plus any associated
|
||||
interface definition files, plus the scripts used to control compilation
|
||||
and installation of the library.
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running a program using the Library is not restricted, and output from
|
||||
such a program is covered only if its contents constitute a work based
|
||||
on the Library (independent of the use of the Library in a tool for
|
||||
writing it). Whether that is true depends on what the Library does
|
||||
and what the program that uses the Library does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Library's
|
||||
complete source code as you receive it, in any medium, provided that
|
||||
you conspicuously and appropriately publish on each copy an
|
||||
appropriate copyright notice and disclaimer of warranty; keep intact
|
||||
all the notices that refer to this License and to the absence of any
|
||||
warranty; and distribute a copy of this License along with the
|
||||
Library.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy,
|
||||
and you may at your option offer warranty protection in exchange for a
|
||||
fee.
|
||||
|
||||
2. You may modify your copy or copies of the Library or any portion
|
||||
of it, thus forming a work based on the Library, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
|
||||
a) The modified work must itself be a software library.
|
||||
|
||||
b) You must cause the files modified to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
c) You must cause the whole of the work to be licensed at no
|
||||
charge to all third parties under the terms of this License.
|
||||
|
||||
d) If a facility in the modified Library refers to a function or a
|
||||
table of data to be supplied by an application program that uses
|
||||
the facility, other than as an argument passed when the facility
|
||||
is invoked, then you must make a good faith effort to ensure that,
|
||||
in the event an application does not supply such function or
|
||||
table, the facility still operates, and performs whatever part of
|
||||
its purpose remains meaningful.
|
||||
|
||||
(For example, a function in a library to compute square roots has
|
||||
a purpose that is entirely well-defined independent of the
|
||||
application. Therefore, Subsection 2d requires that any
|
||||
application-supplied function or table used by this function must
|
||||
be optional: if the application does not supply it, the square
|
||||
root function must still compute square roots.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Library,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Library, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote
|
||||
it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
collective works based on the Library.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Library
|
||||
with the Library (or with a work based on the Library) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
|
||||
3. You may opt to apply the terms of the ordinary GNU General Public
|
||||
License instead of this License to a given copy of the Library. To do
|
||||
this, you must alter all the notices that refer to this License, so
|
||||
that they refer to the ordinary GNU General Public License, version 2,
|
||||
instead of to this License. (If a newer version than version 2 of the
|
||||
ordinary GNU General Public License has appeared, then you can specify
|
||||
that version instead if you wish.) Do not make any other change in
|
||||
these notices.
|
||||
|
||||
Once this change is made in a given copy, it is irreversible for
|
||||
that copy, so the ordinary GNU General Public License applies to all
|
||||
subsequent copies and derivative works made from that copy.
|
||||
|
||||
This option is useful when you wish to copy part of the code of
|
||||
the Library into a program that is not a library.
|
||||
|
||||
4. You may copy and distribute the Library (or a portion or
|
||||
derivative of it, under Section 2) in object code or executable form
|
||||
under the terms of Sections 1 and 2 above provided that you accompany
|
||||
it with the complete corresponding machine-readable source code, which
|
||||
must be distributed under the terms of Sections 1 and 2 above on a
|
||||
medium customarily used for software interchange.
|
||||
|
||||
If distribution of object code is made by offering access to copy
|
||||
from a designated place, then offering equivalent access to copy the
|
||||
source code from the same place satisfies the requirement to
|
||||
distribute the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
5. A program that contains no derivative of any portion of the
|
||||
Library, but is designed to work with the Library by being compiled or
|
||||
linked with it, is called a "work that uses the Library". Such a
|
||||
work, in isolation, is not a derivative work of the Library, and
|
||||
therefore falls outside the scope of this License.
|
||||
|
||||
However, linking a "work that uses the Library" with the Library
|
||||
creates an executable that is a derivative of the Library (because it
|
||||
contains portions of the Library), rather than a "work that uses the
|
||||
library". The executable is therefore covered by this License.
|
||||
Section 6 states terms for distribution of such executables.
|
||||
|
||||
When a "work that uses the Library" uses material from a header file
|
||||
that is part of the Library, the object code for the work may be a
|
||||
derivative work of the Library even though the source code is not.
|
||||
Whether this is true is especially significant if the work can be
|
||||
linked without the Library, or if the work is itself a library. The
|
||||
threshold for this to be true is not precisely defined by law.
|
||||
|
||||
If such an object file uses only numerical parameters, data
|
||||
structure layouts and accessors, and small macros and small inline
|
||||
functions (ten lines or less in length), then the use of the object
|
||||
file is unrestricted, regardless of whether it is legally a derivative
|
||||
work. (Executables containing this object code plus portions of the
|
||||
Library will still fall under Section 6.)
|
||||
|
||||
Otherwise, if the work is a derivative of the Library, you may
|
||||
distribute the object code for the work under the terms of Section 6.
|
||||
Any executables containing that work also fall under Section 6,
|
||||
whether or not they are linked directly with the Library itself.
|
||||
|
||||
6. As an exception to the Sections above, you may also combine or
|
||||
link a "work that uses the Library" with the Library to produce a
|
||||
work containing portions of the Library, and distribute that work
|
||||
under terms of your choice, provided that the terms permit
|
||||
modification of the work for the customer's own use and reverse
|
||||
engineering for debugging such modifications.
|
||||
|
||||
You must give prominent notice with each copy of the work that the
|
||||
Library is used in it and that the Library and its use are covered by
|
||||
this License. You must supply a copy of this License. If the work
|
||||
during execution displays copyright notices, you must include the
|
||||
copyright notice for the Library among them, as well as a reference
|
||||
directing the user to the copy of this License. Also, you must do one
|
||||
of these things:
|
||||
|
||||
a) Accompany the work with the complete corresponding
|
||||
machine-readable source code for the Library including whatever
|
||||
changes were used in the work (which must be distributed under
|
||||
Sections 1 and 2 above); and, if the work is an executable linked
|
||||
with the Library, with the complete machine-readable "work that
|
||||
uses the Library", as object code and/or source code, so that the
|
||||
user can modify the Library and then relink to produce a modified
|
||||
executable containing the modified Library. (It is understood
|
||||
that the user who changes the contents of definitions files in the
|
||||
Library will not necessarily be able to recompile the application
|
||||
to use the modified definitions.)
|
||||
|
||||
b) Use a suitable shared library mechanism for linking with the
|
||||
Library. A suitable mechanism is one that (1) uses at run time a
|
||||
copy of the library already present on the user's computer system,
|
||||
rather than copying library functions into the executable, and (2)
|
||||
will operate properly with a modified version of the library, if
|
||||
the user installs one, as long as the modified version is
|
||||
interface-compatible with the version that the work was made with.
|
||||
|
||||
c) Accompany the work with a written offer, valid for at
|
||||
least three years, to give the same user the materials
|
||||
specified in Subsection 6a, above, for a charge no more
|
||||
than the cost of performing this distribution.
|
||||
|
||||
d) If distribution of the work is made by offering access to copy
|
||||
from a designated place, offer equivalent access to copy the above
|
||||
specified materials from the same place.
|
||||
|
||||
e) Verify that the user has already received a copy of these
|
||||
materials or that you have already sent this user a copy.
|
||||
|
||||
For an executable, the required form of the "work that uses the
|
||||
Library" must include any data and utility programs needed for
|
||||
reproducing the executable from it. However, as a special exception,
|
||||
the materials to be distributed need not include anything that is
|
||||
normally distributed (in either source or binary form) with the major
|
||||
components (compiler, kernel, and so on) of the operating system on
|
||||
which the executable runs, unless that component itself accompanies
|
||||
the executable.
|
||||
|
||||
It may happen that this requirement contradicts the license
|
||||
restrictions of other proprietary libraries that do not normally
|
||||
accompany the operating system. Such a contradiction means you cannot
|
||||
use both them and the Library together in an executable that you
|
||||
distribute.
|
||||
|
||||
7. You may place library facilities that are a work based on the
|
||||
Library side-by-side in a single library together with other library
|
||||
facilities not covered by this License, and distribute such a combined
|
||||
library, provided that the separate distribution of the work based on
|
||||
the Library and of the other library facilities is otherwise
|
||||
permitted, and provided that you do these two things:
|
||||
|
||||
a) Accompany the combined library with a copy of the same work
|
||||
based on the Library, uncombined with any other library
|
||||
facilities. This must be distributed under the terms of the
|
||||
Sections above.
|
||||
|
||||
b) Give prominent notice with the combined library of the fact
|
||||
that part of it is a work based on the Library, and explaining
|
||||
where to find the accompanying uncombined form of the same work.
|
||||
|
||||
8. You may not copy, modify, sublicense, link with, or distribute
|
||||
the Library except as expressly provided under this License. Any
|
||||
attempt otherwise to copy, modify, sublicense, link with, or
|
||||
distribute the Library is void, and will automatically terminate your
|
||||
rights under this License. However, parties who have received copies,
|
||||
or rights, from you under this License will not have their licenses
|
||||
terminated so long as such parties remain in full compliance.
|
||||
|
||||
9. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Library or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Library (or any work based on the
|
||||
Library), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Library or works based on it.
|
||||
|
||||
10. Each time you redistribute the Library (or any work based on the
|
||||
Library), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute, link with or modify the Library
|
||||
subject to these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties with
|
||||
this License.
|
||||
|
||||
11. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Library at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Library by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Library.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under any
|
||||
particular circumstance, the balance of the section is intended to apply,
|
||||
and the section as a whole is intended to apply in other circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing
|
||||
to distribute software through any other system and a licensee cannot
|
||||
impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
12. If the distribution and/or use of the Library is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Library under this License may add
|
||||
an explicit geographical distribution limitation excluding those countries,
|
||||
so that distribution is permitted only in or among countries not thus
|
||||
excluded. In such case, this License incorporates the limitation as if
|
||||
written in the body of this License.
|
||||
|
||||
13. The Free Software Foundation may publish revised and/or new
|
||||
versions of the Lesser General Public License from time to time.
|
||||
Such new versions will be similar in spirit to the present version,
|
||||
but may differ in detail to address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Library
|
||||
specifies a version number of this License which applies to it and
|
||||
"any later version", you have the option of following the terms and
|
||||
conditions either of that version or of any later version published by
|
||||
the Free Software Foundation. If the Library does not specify a
|
||||
license version number, you may choose any version ever published by
|
||||
the Free Software Foundation.
|
||||
|
||||
14. If you wish to incorporate parts of the Library into other free
|
||||
programs whose distribution conditions are incompatible with these,
|
||||
write to the author to ask for permission. For software which is
|
||||
copyrighted by the Free Software Foundation, write to the Free
|
||||
Software Foundation; we sometimes make exceptions for this. Our
|
||||
decision will be guided by the two goals of preserving the free status
|
||||
of all derivatives of our free software and of promoting the sharing
|
||||
and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
|
||||
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
|
||||
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
|
||||
OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
|
||||
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
|
||||
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
|
||||
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
|
||||
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
|
||||
AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
|
||||
FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
|
||||
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
|
||||
LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
|
||||
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
|
||||
FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
|
||||
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
|
||||
DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Libraries
|
||||
|
||||
If you develop a new library, and you want it to be of the greatest
|
||||
possible use to the public, we recommend making it free software that
|
||||
everyone can redistribute and change. You can do so by permitting
|
||||
redistribution under these terms (or, alternatively, under the terms of the
|
||||
ordinary General Public License).
|
||||
|
||||
To apply these terms, attach the following notices to the library. It is
|
||||
safest to attach them to the start of each source file to most effectively
|
||||
convey the exclusion of warranty; and each file should have at least the
|
||||
"copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the library's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or your
|
||||
school, if any, to sign a "copyright disclaimer" for the library, if
|
||||
necessary. Here is a sample; alter the names:
|
||||
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the
|
||||
library `Frob' (a library for tweaking knobs) written by James Random Hacker.
|
||||
|
||||
<signature of Ty Coon>, 1 April 1990
|
||||
Ty Coon, President of Vice
|
||||
|
||||
That's all there is to it!
|
|
@ -1,339 +0,0 @@
|
|||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 2, June 1991
|
||||
|
||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
License is intended to guarantee your freedom to share and change free
|
||||
software--to make sure the software is free for all its users. This
|
||||
General Public License applies to most of the Free Software
|
||||
Foundation's software and to any other program whose authors commit to
|
||||
using it. (Some other Free Software Foundation software is covered by
|
||||
the GNU Lesser General Public License instead.) You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
this service if you wish), that you receive source code or can get it
|
||||
if you want it, that you can change the software or use pieces of it
|
||||
in new free programs; and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
anyone to deny you these rights or to ask you to surrender the rights.
|
||||
These restrictions translate to certain responsibilities for you if you
|
||||
distribute copies of the software, or if you modify it.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must give the recipients all the rights that
|
||||
you have. You must make sure that they, too, receive or can get the
|
||||
source code. And you must show them these terms so they know their
|
||||
rights.
|
||||
|
||||
We protect your rights with two steps: (1) copyright the software, and
|
||||
(2) offer you this license which gives you legal permission to copy,
|
||||
distribute and/or modify the software.
|
||||
|
||||
Also, for each author's protection and ours, we want to make certain
|
||||
that everyone understands that there is no warranty for this free
|
||||
software. If the software is modified by someone else and passed on, we
|
||||
want its recipients to know that what they have is not the original, so
|
||||
that any problems introduced by others will not reflect on the original
|
||||
authors' reputations.
|
||||
|
||||
Finally, any free program is threatened constantly by software
|
||||
patents. We wish to avoid the danger that redistributors of a free
|
||||
program will individually obtain patent licenses, in effect making the
|
||||
program proprietary. To prevent this, we have made it clear that any
|
||||
patent must be licensed for everyone's free use or not licensed at all.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License applies to any program or other work which contains
|
||||
a notice placed by the copyright holder saying it may be distributed
|
||||
under the terms of this General Public License. The "Program", below,
|
||||
refers to any such program or work, and a "work based on the Program"
|
||||
means either the Program or any derivative work under copyright law:
|
||||
that is to say, a work containing the Program or a portion of it,
|
||||
either verbatim or with modifications and/or translated into another
|
||||
language. (Hereinafter, translation is included without limitation in
|
||||
the term "modification".) Each licensee is addressed as "you".
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running the Program is not restricted, and the output from the Program
|
||||
is covered only if its contents constitute a work based on the
|
||||
Program (independent of having been made by running the Program).
|
||||
Whether that is true depends on what the Program does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Program's
|
||||
source code as you receive it, in any medium, provided that you
|
||||
conspicuously and appropriately publish on each copy an appropriate
|
||||
copyright notice and disclaimer of warranty; keep intact all the
|
||||
notices that refer to this License and to the absence of any warranty;
|
||||
and give any other recipients of the Program a copy of this License
|
||||
along with the Program.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy, and
|
||||
you may at your option offer warranty protection in exchange for a fee.
|
||||
|
||||
2. You may modify your copy or copies of the Program or any portion
|
||||
of it, thus forming a work based on the Program, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
|
||||
a) You must cause the modified files to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
b) You must cause any work that you distribute or publish, that in
|
||||
whole or in part contains or is derived from the Program or any
|
||||
part thereof, to be licensed as a whole at no charge to all third
|
||||
parties under the terms of this License.
|
||||
|
||||
c) If the modified program normally reads commands interactively
|
||||
when run, you must cause it, when started running for such
|
||||
interactive use in the most ordinary way, to print or display an
|
||||
announcement including an appropriate copyright notice and a
|
||||
notice that there is no warranty (or else, saying that you provide
|
||||
a warranty) and that users may redistribute the program under
|
||||
these conditions, and telling the user how to view a copy of this
|
||||
License. (Exception: if the Program itself is interactive but
|
||||
does not normally print such an announcement, your work based on
|
||||
the Program is not required to print an announcement.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Program,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Program, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
collective works based on the Program.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Program
|
||||
with the Program (or with a work based on the Program) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
|
||||
3. You may copy and distribute the Program (or a work based on it,
|
||||
under Section 2) in object code or executable form under the terms of
|
||||
Sections 1 and 2 above provided that you also do one of the following:
|
||||
|
||||
a) Accompany it with the complete corresponding machine-readable
|
||||
source code, which must be distributed under the terms of Sections
|
||||
1 and 2 above on a medium customarily used for software interchange; or,
|
||||
|
||||
b) Accompany it with a written offer, valid for at least three
|
||||
years, to give any third party, for a charge no more than your
|
||||
cost of physically performing source distribution, a complete
|
||||
machine-readable copy of the corresponding source code, to be
|
||||
distributed under the terms of Sections 1 and 2 above on a medium
|
||||
customarily used for software interchange; or,
|
||||
|
||||
c) Accompany it with the information you received as to the offer
|
||||
to distribute corresponding source code. (This alternative is
|
||||
allowed only for noncommercial distribution and only if you
|
||||
received the program in object code or executable form with such
|
||||
an offer, in accord with Subsection b above.)
|
||||
|
||||
The source code for a work means the preferred form of the work for
|
||||
making modifications to it. For an executable work, complete source
|
||||
code means all the source code for all modules it contains, plus any
|
||||
associated interface definition files, plus the scripts used to
|
||||
control compilation and installation of the executable. However, as a
|
||||
special exception, the source code distributed need not include
|
||||
anything that is normally distributed (in either source or binary
|
||||
form) with the major components (compiler, kernel, and so on) of the
|
||||
operating system on which the executable runs, unless that component
|
||||
itself accompanies the executable.
|
||||
|
||||
If distribution of executable or object code is made by offering
|
||||
access to copy from a designated place, then offering equivalent
|
||||
access to copy the source code from the same place counts as
|
||||
distribution of the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
4. You may not copy, modify, sublicense, or distribute the Program
|
||||
except as expressly provided under this License. Any attempt
|
||||
otherwise to copy, modify, sublicense or distribute the Program is
|
||||
void, and will automatically terminate your rights under this License.
|
||||
However, parties who have received copies, or rights, from you under
|
||||
this License will not have their licenses terminated so long as such
|
||||
parties remain in full compliance.
|
||||
|
||||
5. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Program or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Program (or any work based on the
|
||||
Program), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Program or works based on it.
|
||||
|
||||
6. Each time you redistribute the Program (or any work based on the
|
||||
Program), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute or modify the Program subject to
|
||||
these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties to
|
||||
this License.
|
||||
|
||||
7. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Program at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Program by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Program.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under
|
||||
any particular circumstance, the balance of the section is intended to
|
||||
apply and the section as a whole is intended to apply in other
|
||||
circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system, which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing
|
||||
to distribute software through any other system and a licensee cannot
|
||||
impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
8. If the distribution and/or use of the Program is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Program under this License
|
||||
may add an explicit geographical distribution limitation excluding
|
||||
those countries, so that distribution is permitted only in or among
|
||||
countries not thus excluded. In such case, this License incorporates
|
||||
the limitation as if written in the body of this License.
|
||||
|
||||
9. The Free Software Foundation may publish revised and/or new versions
|
||||
of the General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Program
|
||||
specifies a version number of this License which applies to it and "any
|
||||
later version", you have the option of following the terms and conditions
|
||||
either of that version or of any later version published by the Free
|
||||
Software Foundation. If the Program does not specify a version number of
|
||||
this License, you may choose any version ever published by the Free Software
|
||||
Foundation.
|
||||
|
||||
10. If you wish to incorporate parts of the Program into other free
|
||||
programs whose distribution conditions are different, write to the author
|
||||
to ask for permission. For software which is copyrighted by the Free
|
||||
Software Foundation, write to the Free Software Foundation; we sometimes
|
||||
make exceptions for this. Our decision will be guided by the two goals
|
||||
of preserving the free status of all derivatives of our free software and
|
||||
of promoting the sharing and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
|
||||
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
|
||||
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
|
||||
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
|
||||
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
|
||||
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
|
||||
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
|
||||
REPAIR OR CORRECTION.
|
||||
|
||||
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
|
||||
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
|
||||
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
|
||||
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
|
||||
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
|
||||
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
|
||||
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
convey the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along
|
||||
with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program is interactive, make it output a short notice like this
|
||||
when it starts in an interactive mode:
|
||||
|
||||
Gnomovision version 69, Copyright (C) year name of author
|
||||
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, the commands you use may
|
||||
be called something other than `show w' and `show c'; they could even be
|
||||
mouse-clicks or menu items--whatever suits your program.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or your
|
||||
school, if any, to sign a "copyright disclaimer" for the program, if
|
||||
necessary. Here is a sample; alter the names:
|
||||
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
|
||||
`Gnomovision' (which makes passes at compilers) written by James Hacker.
|
||||
|
||||
<signature of Ty Coon>, 1 April 1989
|
||||
Ty Coon, President of Vice
|
||||
|
||||
This General Public License does not permit incorporating your program into
|
||||
proprietary programs. If your program is a subroutine library, you may
|
||||
consider it more useful to permit linking proprietary applications with the
|
||||
library. If this is what you want to do, use the GNU Lesser General
|
||||
Public License instead of this License.
|
File diff suppressed because it is too large
Load Diff
|
@ -1,182 +0,0 @@
|
|||
Basic Installation
|
||||
==================
|
||||
|
||||
These are generic installation instructions.
|
||||
|
||||
The `configure' shell script attempts to guess correct values for
|
||||
various system-dependent variables used during compilation. It uses
|
||||
those values to create a `Makefile' in each directory of the package.
|
||||
It may also create one or more `.h' files containing system-dependent
|
||||
definitions. Finally, it creates a shell script `config.status' that
|
||||
you can run in the future to recreate the current configuration, a file
|
||||
`config.cache' that saves the results of its tests to speed up
|
||||
reconfiguring, and a file `config.log' containing compiler output
|
||||
(useful mainly for debugging `configure').
|
||||
|
||||
If you need to do unusual things to compile the package, please try
|
||||
to figure out how `configure' could check whether to do them, and mail
|
||||
diffs or instructions to the address given in the `README' so they can
|
||||
be considered for the next release. If at some point `config.cache'
|
||||
contains results you don't want to keep, you may remove or edit it.
|
||||
|
||||
The file `configure.in' is used to create `configure' by a program
|
||||
called `autoconf'. You only need `configure.in' if you want to change
|
||||
it or regenerate `configure' using a newer version of `autoconf'.
|
||||
|
||||
The simplest way to compile this package is:
|
||||
|
||||
1. `cd' to the directory containing the package's source code and type
|
||||
`./configure' to configure the package for your system. If you're
|
||||
using `csh' on an old version of System V, you might need to type
|
||||
`sh ./configure' instead to prevent `csh' from trying to execute
|
||||
`configure' itself.
|
||||
|
||||
Running `configure' takes awhile. While running, it prints some
|
||||
messages telling which features it is checking for.
|
||||
|
||||
2. Type `make' to compile the package.
|
||||
|
||||
3. Optionally, type `make check' to run any self-tests that come with
|
||||
the package.
|
||||
|
||||
4. Type `make install' to install the programs and any data files and
|
||||
documentation.
|
||||
|
||||
5. You can remove the program binaries and object files from the
|
||||
source code directory by typing `make clean'. To also remove the
|
||||
files that `configure' created (so you can compile the package for
|
||||
a different kind of computer), type `make distclean'. There is
|
||||
also a `make maintainer-clean' target, but that is intended mainly
|
||||
for the package's developers. If you use it, you may have to get
|
||||
all sorts of other programs in order to regenerate files that came
|
||||
with the distribution.
|
||||
|
||||
Compilers and Options
|
||||
=====================
|
||||
|
||||
Some systems require unusual options for compilation or linking that
|
||||
the `configure' script does not know about. You can give `configure'
|
||||
initial values for variables by setting them in the environment. Using
|
||||
a Bourne-compatible shell, you can do that on the command line like
|
||||
this:
|
||||
CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure
|
||||
|
||||
Or on systems that have the `env' program, you can do it like this:
|
||||
env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure
|
||||
|
||||
Compiling For Multiple Architectures
|
||||
====================================
|
||||
|
||||
You can compile the package for more than one kind of computer at the
|
||||
same time, by placing the object files for each architecture in their
|
||||
own directory. To do this, you must use a version of `make' that
|
||||
supports the `VPATH' variable, such as GNU `make'. `cd' to the
|
||||
directory where you want the object files and executables to go and run
|
||||
the `configure' script. `configure' automatically checks for the
|
||||
source code in the directory that `configure' is in and in `..'.
|
||||
|
||||
If you have to use a `make' that does not supports the `VPATH'
|
||||
variable, you have to compile the package for one architecture at a time
|
||||
in the source code directory. After you have installed the package for
|
||||
one architecture, use `make distclean' before reconfiguring for another
|
||||
architecture.
|
||||
|
||||
Installation Names
|
||||
==================
|
||||
|
||||
By default, `make install' will install the package's files in
|
||||
`/usr/local/bin', `/usr/local/man', etc. You can specify an
|
||||
installation prefix other than `/usr/local' by giving `configure' the
|
||||
option `--prefix=PATH'.
|
||||
|
||||
You can specify separate installation prefixes for
|
||||
architecture-specific files and architecture-independent files. If you
|
||||
give `configure' the option `--exec-prefix=PATH', the package will use
|
||||
PATH as the prefix for installing programs and libraries.
|
||||
Documentation and other data files will still use the regular prefix.
|
||||
|
||||
In addition, if you use an unusual directory layout you can give
|
||||
options like `--bindir=PATH' to specify different values for particular
|
||||
kinds of files. Run `configure --help' for a list of the directories
|
||||
you can set and what kinds of files go in them.
|
||||
|
||||
If the package supports it, you can cause programs to be installed
|
||||
with an extra prefix or suffix on their names by giving `configure' the
|
||||
option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
|
||||
|
||||
Optional Features
|
||||
=================
|
||||
|
||||
Some packages pay attention to `--enable-FEATURE' options to
|
||||
`configure', where FEATURE indicates an optional part of the package.
|
||||
They may also pay attention to `--with-PACKAGE' options, where PACKAGE
|
||||
is something like `gnu-as' or `x' (for the X Window System). The
|
||||
`README' should mention any `--enable-' and `--with-' options that the
|
||||
package recognizes.
|
||||
|
||||
For packages that use the X Window System, `configure' can usually
|
||||
find the X include and library files automatically, but if it doesn't,
|
||||
you can use the `configure' options `--x-includes=DIR' and
|
||||
`--x-libraries=DIR' to specify their locations.
|
||||
|
||||
Specifying the System Type
|
||||
==========================
|
||||
|
||||
There may be some features `configure' can not figure out
|
||||
automatically, but needs to determine by the type of host the package
|
||||
will run on. Usually `configure' can figure that out, but if it prints
|
||||
a message saying it can not guess the host type, give it the
|
||||
`--host=TYPE' option. TYPE can either be a short name for the system
|
||||
type, such as `sun4', or a canonical name with three fields:
|
||||
CPU-COMPANY-SYSTEM
|
||||
|
||||
See the file `config.sub' for the possible values of each field. If
|
||||
`config.sub' isn't included in this package, then this package doesn't
|
||||
need to know the host type.
|
||||
|
||||
If you are building compiler tools for cross-compiling, you can also
|
||||
use the `--target=TYPE' option to select the type of system they will
|
||||
produce code for and the `--build=TYPE' option to select the type of
|
||||
system on which you are compiling the package.
|
||||
|
||||
Sharing Defaults
|
||||
================
|
||||
|
||||
If you want to set default values for `configure' scripts to share,
|
||||
you can create a site shell script called `config.site' that gives
|
||||
default values for variables like `CC', `cache_file', and `prefix'.
|
||||
`configure' looks for `PREFIX/share/config.site' if it exists, then
|
||||
`PREFIX/etc/config.site' if it exists. Or, you can set the
|
||||
`CONFIG_SITE' environment variable to the location of the site script.
|
||||
A warning: not all `configure' scripts look for a site script.
|
||||
|
||||
Operation Controls
|
||||
==================
|
||||
|
||||
`configure' recognizes the following options to control how it
|
||||
operates.
|
||||
|
||||
`--cache-file=FILE'
|
||||
Use and save the results of the tests in FILE instead of
|
||||
`./config.cache'. Set FILE to `/dev/null' to disable caching, for
|
||||
debugging `configure'.
|
||||
|
||||
`--help'
|
||||
Print a summary of the options to `configure', and exit.
|
||||
|
||||
`--quiet'
|
||||
`--silent'
|
||||
`-q'
|
||||
Do not print messages saying which checks are being made. To
|
||||
suppress all normal output, redirect it to `/dev/null' (any error
|
||||
messages will still be shown).
|
||||
|
||||
`--srcdir=DIR'
|
||||
Look for the package's source code in directory DIR. Usually
|
||||
`configure' can determine that directory automatically.
|
||||
|
||||
`--version'
|
||||
Print the version of Autoconf used to generate the `configure'
|
||||
script, and exit.
|
||||
|
||||
`configure' also accepts some other, not widely useful, options.
|
|
@ -1,898 +0,0 @@
|
|||
# Makefile.in generated by automake 1.11.6 from Makefile.am.
|
||||
# Makefile. Generated from Makefile.in by configure.
|
||||
|
||||
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
|
||||
# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software
|
||||
# Foundation, Inc.
|
||||
# This Makefile.in is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
|
||||
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
# PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
|
||||
|
||||
am__make_dryrun = \
|
||||
{ \
|
||||
am__dry=no; \
|
||||
case $$MAKEFLAGS in \
|
||||
*\\[\ \ ]*) \
|
||||
echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \
|
||||
| grep '^AM OK$$' >/dev/null || am__dry=yes;; \
|
||||
*) \
|
||||
for am__flg in $$MAKEFLAGS; do \
|
||||
case $$am__flg in \
|
||||
*=*|--*) ;; \
|
||||
*n*) am__dry=yes; break;; \
|
||||
esac; \
|
||||
done;; \
|
||||
esac; \
|
||||
test $$am__dry = yes; \
|
||||
}
|
||||
pkgdatadir = $(datadir)/audiofile
|
||||
pkgincludedir = $(includedir)/audiofile
|
||||
pkglibdir = $(libdir)/audiofile
|
||||
pkglibexecdir = $(libexecdir)/audiofile
|
||||
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
|
||||
install_sh_DATA = $(install_sh) -c -m 644
|
||||
install_sh_PROGRAM = $(install_sh) -c
|
||||
install_sh_SCRIPT = $(install_sh) -c
|
||||
INSTALL_HEADER = $(INSTALL_DATA)
|
||||
transform = $(program_transform_name)
|
||||
NORMAL_INSTALL = :
|
||||
PRE_INSTALL = :
|
||||
POST_INSTALL = :
|
||||
NORMAL_UNINSTALL = :
|
||||
PRE_UNINSTALL = :
|
||||
POST_UNINSTALL = :
|
||||
build_triplet = x86_64-w64-mingw32
|
||||
host_triplet = x86_64-w64-mingw32
|
||||
subdir = .
|
||||
DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \
|
||||
$(srcdir)/Makefile.in $(srcdir)/audiofile-uninstalled.pc.in \
|
||||
$(srcdir)/audiofile.pc.in $(srcdir)/audiofile.spec.in \
|
||||
$(srcdir)/config.h.in $(top_srcdir)/configure AUTHORS COPYING \
|
||||
ChangeLog INSTALL NEWS TODO config.guess config.sub depcomp \
|
||||
install-sh ltmain.sh missing
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
am__aclocal_m4_deps = $(top_srcdir)/configure.ac
|
||||
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
|
||||
$(ACLOCAL_M4)
|
||||
am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
|
||||
configure.lineno config.status.lineno
|
||||
mkinstalldirs = $(install_sh) -d
|
||||
CONFIG_HEADER = config.h
|
||||
CONFIG_CLEAN_FILES = audiofile.spec audiofile.pc \
|
||||
audiofile-uninstalled.pc
|
||||
CONFIG_CLEAN_VPATH_FILES =
|
||||
SOURCES =
|
||||
DIST_SOURCES =
|
||||
RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
|
||||
html-recursive info-recursive install-data-recursive \
|
||||
install-dvi-recursive install-exec-recursive \
|
||||
install-html-recursive install-info-recursive \
|
||||
install-pdf-recursive install-ps-recursive install-recursive \
|
||||
installcheck-recursive installdirs-recursive pdf-recursive \
|
||||
ps-recursive uninstall-recursive
|
||||
am__can_run_installinfo = \
|
||||
case $$AM_UPDATE_INFO_DIR in \
|
||||
n|no|NO) false;; \
|
||||
*) (install-info --version) >/dev/null 2>&1;; \
|
||||
esac
|
||||
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
|
||||
am__vpath_adj = case $$p in \
|
||||
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
|
||||
*) f=$$p;; \
|
||||
esac;
|
||||
am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
|
||||
am__install_max = 40
|
||||
am__nobase_strip_setup = \
|
||||
srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
|
||||
am__nobase_strip = \
|
||||
for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
|
||||
am__nobase_list = $(am__nobase_strip_setup); \
|
||||
for p in $$list; do echo "$$p $$p"; done | \
|
||||
sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
|
||||
$(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
|
||||
if (++n[$$2] == $(am__install_max)) \
|
||||
{ print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
|
||||
END { for (dir in files) print dir, files[dir] }'
|
||||
am__base_list = \
|
||||
sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
|
||||
sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
|
||||
am__uninstall_files_from_dir = { \
|
||||
test -z "$$files" \
|
||||
|| { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
|
||||
|| { echo " ( cd '$$dir' && rm -f" $$files ")"; \
|
||||
$(am__cd) "$$dir" && rm -f $$files; }; \
|
||||
}
|
||||
am__installdirs = "$(DESTDIR)$(pkgconfigdir)"
|
||||
DATA = $(pkgconfig_DATA)
|
||||
RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
|
||||
distclean-recursive maintainer-clean-recursive
|
||||
AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
|
||||
$(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \
|
||||
distdir dist dist-all distcheck
|
||||
ETAGS = etags
|
||||
CTAGS = ctags
|
||||
DIST_SUBDIRS = $(SUBDIRS)
|
||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||
distdir = $(PACKAGE)-$(VERSION)
|
||||
top_distdir = $(distdir)
|
||||
am__remove_distdir = \
|
||||
if test -d "$(distdir)"; then \
|
||||
find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \
|
||||
&& rm -rf "$(distdir)" \
|
||||
|| { sleep 5 && rm -rf "$(distdir)"; }; \
|
||||
else :; fi
|
||||
am__relativize = \
|
||||
dir0=`pwd`; \
|
||||
sed_first='s,^\([^/]*\)/.*$$,\1,'; \
|
||||
sed_rest='s,^[^/]*/*,,'; \
|
||||
sed_last='s,^.*/\([^/]*\)$$,\1,'; \
|
||||
sed_butlast='s,/*[^/]*$$,,'; \
|
||||
while test -n "$$dir1"; do \
|
||||
first=`echo "$$dir1" | sed -e "$$sed_first"`; \
|
||||
if test "$$first" != "."; then \
|
||||
if test "$$first" = ".."; then \
|
||||
dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
|
||||
dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
|
||||
else \
|
||||
first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
|
||||
if test "$$first2" = "$$first"; then \
|
||||
dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
|
||||
else \
|
||||
dir2="../$$dir2"; \
|
||||
fi; \
|
||||
dir0="$$dir0"/"$$first"; \
|
||||
fi; \
|
||||
fi; \
|
||||
dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
|
||||
done; \
|
||||
reldir="$$dir2"
|
||||
DIST_ARCHIVES = $(distdir).tar.gz
|
||||
GZIP_ENV = --best
|
||||
distuninstallcheck_listfiles = find . -type f -print
|
||||
am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \
|
||||
| sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$'
|
||||
distcleancheck_listfiles = find . -type f -print
|
||||
A2X =
|
||||
ACLOCAL = ${SHELL} /i/Development/sm64pc/tools/audiofile-0.3.6/missing --run aclocal-1.11
|
||||
AMTAR = $${TAR-tar}
|
||||
AR = ar
|
||||
ASCIIDOC =
|
||||
AUDIOFILE_VERSION = 0.3.6
|
||||
AUDIOFILE_VERSION_INFO = 1:0:0
|
||||
AUTOCONF = ${SHELL} /i/Development/sm64pc/tools/audiofile-0.3.6/missing --run autoconf
|
||||
AUTOHEADER = ${SHELL} /i/Development/sm64pc/tools/audiofile-0.3.6/missing --run autoheader
|
||||
AUTOMAKE = ${SHELL} /i/Development/sm64pc/tools/audiofile-0.3.6/missing --run automake-1.11
|
||||
AWK = gawk
|
||||
CC = gcc
|
||||
CCDEPMODE = depmode=gcc3
|
||||
CFLAGS = -g -O2
|
||||
COVERAGE_CFLAGS =
|
||||
COVERAGE_LIBS =
|
||||
CPP = gcc -E
|
||||
CPPFLAGS =
|
||||
CXX = g++
|
||||
CXXCPP = g++ -E
|
||||
CXXDEPMODE = depmode=gcc3
|
||||
CXXFLAGS = -g -O2
|
||||
CYGPATH_W = cygpath -w
|
||||
DEFS = -DHAVE_CONFIG_H
|
||||
DEPDIR = .deps
|
||||
DLLTOOL = dlltool
|
||||
DSYMUTIL =
|
||||
DUMPBIN =
|
||||
ECHO_C =
|
||||
ECHO_N = -n
|
||||
ECHO_T =
|
||||
EGREP = /usr/bin/grep -E
|
||||
EXEEXT = .exe
|
||||
FGREP = /usr/bin/grep -F
|
||||
FLAC_CFLAGS =
|
||||
FLAC_LIBS =
|
||||
GENHTML =
|
||||
GREP = /usr/bin/grep
|
||||
INSTALL = /usr/bin/install -c
|
||||
INSTALL_DATA = ${INSTALL} -m 644
|
||||
INSTALL_PROGRAM = ${INSTALL}
|
||||
INSTALL_SCRIPT = ${INSTALL}
|
||||
INSTALL_STRIP_PROGRAM = $(install_sh) -c -s
|
||||
LCOV =
|
||||
LD = I:/Development/MSYS2/mingw64/x86_64-w64-mingw32/bin/ld.exe
|
||||
LDFLAGS =
|
||||
LIBOBJS =
|
||||
LIBS = -lstdc++
|
||||
LIBTOOL = $(SHELL) $(top_builddir)/libtool
|
||||
LIPO =
|
||||
LN_S = cp -pR
|
||||
LTLIBOBJS =
|
||||
LT_SYS_LIBRARY_PATH =
|
||||
MAKEINFO = ${SHELL} /i/Development/sm64pc/tools/audiofile-0.3.6/missing --run makeinfo
|
||||
MANIFEST_TOOL = :
|
||||
MKDIR_P = /usr/bin/mkdir -p
|
||||
NM = /mingw64/bin/nm -B
|
||||
NMEDIT =
|
||||
OBJDUMP = objdump
|
||||
OBJEXT = o
|
||||
OTOOL =
|
||||
OTOOL64 =
|
||||
PACKAGE = audiofile
|
||||
PACKAGE_BUGREPORT =
|
||||
PACKAGE_NAME = audiofile
|
||||
PACKAGE_STRING = audiofile 0.3.6
|
||||
PACKAGE_TARNAME = audiofile
|
||||
PACKAGE_URL =
|
||||
PACKAGE_VERSION = 0.3.6
|
||||
PATH_SEPARATOR = :
|
||||
PKG_CONFIG = /mingw64/bin/pkg-config
|
||||
PKG_CONFIG_LIBDIR =
|
||||
PKG_CONFIG_PATH = /mingw64/lib/pkgconfig:/mingw64/share/pkgconfig
|
||||
RANLIB = ranlib
|
||||
SED = /usr/bin/sed
|
||||
SET_MAKE =
|
||||
SHELL = /bin/sh
|
||||
STRIP = strip
|
||||
TEST_BIN =
|
||||
VALGRIND =
|
||||
VERSION = 0.3.6
|
||||
WERROR_CFLAGS =
|
||||
abs_builddir = /i/Development/sm64pc/tools/audiofile-0.3.6
|
||||
abs_srcdir = /i/Development/sm64pc/tools/audiofile-0.3.6
|
||||
abs_top_builddir = /i/Development/sm64pc/tools/audiofile-0.3.6
|
||||
abs_top_srcdir = /i/Development/sm64pc/tools/audiofile-0.3.6
|
||||
ac_ct_AR = ar
|
||||
ac_ct_CC = gcc
|
||||
ac_ct_CXX = g++
|
||||
ac_ct_DUMPBIN =
|
||||
am__include = include
|
||||
am__leading_dot = .
|
||||
am__quote =
|
||||
am__tar = $${TAR-tar} chof - "$$tardir"
|
||||
am__untar = $${TAR-tar} xf -
|
||||
bindir = ${exec_prefix}/bin
|
||||
build = x86_64-w64-mingw32
|
||||
build_alias = x86_64-w64-mingw32
|
||||
build_cpu = x86_64
|
||||
build_os = mingw32
|
||||
build_vendor = w64
|
||||
builddir = .
|
||||
datadir = ${datarootdir}
|
||||
datarootdir = ${prefix}/share
|
||||
docdir = ${datarootdir}/doc/${PACKAGE_TARNAME}
|
||||
dvidir = ${docdir}
|
||||
exec_prefix = ${prefix}
|
||||
host = x86_64-w64-mingw32
|
||||
host_alias =
|
||||
host_cpu = x86_64
|
||||
host_os = mingw32
|
||||
host_vendor = w64
|
||||
htmldir = ${docdir}
|
||||
includedir = ${prefix}/include
|
||||
infodir = ${datarootdir}/info
|
||||
install_sh = ${SHELL} /i/Development/sm64pc/tools/audiofile-0.3.6/install-sh
|
||||
libdir = ${exec_prefix}/lib
|
||||
libexecdir = ${exec_prefix}/libexec
|
||||
localedir = ${datarootdir}/locale
|
||||
localstatedir = ${prefix}/var
|
||||
mandir = ${datarootdir}/man
|
||||
mkdir_p = /usr/bin/mkdir -p
|
||||
oldincludedir = /usr/include
|
||||
pdfdir = ${docdir}
|
||||
prefix = /mingw64
|
||||
program_transform_name = s,x,x,
|
||||
psdir = ${docdir}
|
||||
sbindir = ${exec_prefix}/sbin
|
||||
sharedstatedir = ${prefix}/com
|
||||
srcdir = .
|
||||
sysconfdir = ${prefix}/etc
|
||||
target_alias =
|
||||
top_build_prefix =
|
||||
top_builddir = .
|
||||
top_srcdir = .
|
||||
SUBDIRS = gtest libaudiofile sfcommands test examples docs
|
||||
EXTRA_DIST = \
|
||||
ACKNOWLEDGEMENTS \
|
||||
NOTES \
|
||||
README \
|
||||
TODO \
|
||||
COPYING.GPL \
|
||||
configure configure.ac \
|
||||
audiofile.spec.in \
|
||||
audiofile.pc.in \
|
||||
audiofile-uninstalled.pc.in
|
||||
|
||||
pkgconfigdir = $(libdir)/pkgconfig
|
||||
pkgconfig_DATA = audiofile.pc
|
||||
all: config.h
|
||||
$(MAKE) $(AM_MAKEFLAGS) all-recursive
|
||||
|
||||
.SUFFIXES:
|
||||
am--refresh: Makefile
|
||||
@:
|
||||
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
|
||||
@for dep in $?; do \
|
||||
case '$(am__configure_deps)' in \
|
||||
*$$dep*) \
|
||||
echo ' cd $(srcdir) && $(AUTOMAKE) --gnu'; \
|
||||
$(am__cd) $(srcdir) && $(AUTOMAKE) --gnu \
|
||||
&& exit 0; \
|
||||
exit 1;; \
|
||||
esac; \
|
||||
done; \
|
||||
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \
|
||||
$(am__cd) $(top_srcdir) && \
|
||||
$(AUTOMAKE) --gnu Makefile
|
||||
.PRECIOUS: Makefile
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
@case '$?' in \
|
||||
*config.status*) \
|
||||
echo ' $(SHELL) ./config.status'; \
|
||||
$(SHELL) ./config.status;; \
|
||||
*) \
|
||||
echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \
|
||||
esac;
|
||||
|
||||
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
|
||||
$(SHELL) ./config.status --recheck
|
||||
|
||||
$(top_srcdir)/configure: $(am__configure_deps)
|
||||
$(am__cd) $(srcdir) && $(AUTOCONF)
|
||||
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
|
||||
$(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
|
||||
$(am__aclocal_m4_deps):
|
||||
|
||||
config.h: stamp-h1
|
||||
@if test ! -f $@; then rm -f stamp-h1; else :; fi
|
||||
@if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) stamp-h1; else :; fi
|
||||
|
||||
stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status
|
||||
@rm -f stamp-h1
|
||||
cd $(top_builddir) && $(SHELL) ./config.status config.h
|
||||
$(srcdir)/config.h.in: $(am__configure_deps)
|
||||
($(am__cd) $(top_srcdir) && $(AUTOHEADER))
|
||||
rm -f stamp-h1
|
||||
touch $@
|
||||
|
||||
distclean-hdr:
|
||||
-rm -f config.h stamp-h1
|
||||
audiofile.spec: $(top_builddir)/config.status $(srcdir)/audiofile.spec.in
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $@
|
||||
audiofile.pc: $(top_builddir)/config.status $(srcdir)/audiofile.pc.in
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $@
|
||||
audiofile-uninstalled.pc: $(top_builddir)/config.status $(srcdir)/audiofile-uninstalled.pc.in
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $@
|
||||
|
||||
mostlyclean-libtool:
|
||||
-rm -f *.lo
|
||||
|
||||
clean-libtool:
|
||||
-rm -rf .libs _libs
|
||||
|
||||
distclean-libtool:
|
||||
-rm -f libtool config.lt
|
||||
install-pkgconfigDATA: $(pkgconfig_DATA)
|
||||
@$(NORMAL_INSTALL)
|
||||
@list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \
|
||||
if test -n "$$list"; then \
|
||||
echo " $(MKDIR_P) '$(DESTDIR)$(pkgconfigdir)'"; \
|
||||
$(MKDIR_P) "$(DESTDIR)$(pkgconfigdir)" || exit 1; \
|
||||
fi; \
|
||||
for p in $$list; do \
|
||||
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
|
||||
echo "$$d$$p"; \
|
||||
done | $(am__base_list) | \
|
||||
while read files; do \
|
||||
echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pkgconfigdir)'"; \
|
||||
$(INSTALL_DATA) $$files "$(DESTDIR)$(pkgconfigdir)" || exit $$?; \
|
||||
done
|
||||
|
||||
uninstall-pkgconfigDATA:
|
||||
@$(NORMAL_UNINSTALL)
|
||||
@list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \
|
||||
files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
|
||||
dir='$(DESTDIR)$(pkgconfigdir)'; $(am__uninstall_files_from_dir)
|
||||
|
||||
# This directory's subdirectories are mostly independent; you can cd
|
||||
# into them and run `make' without going through this Makefile.
|
||||
# To change the values of `make' variables: instead of editing Makefiles,
|
||||
# (1) if the variable is set in `config.status', edit `config.status'
|
||||
# (which will cause the Makefiles to be regenerated when you run `make');
|
||||
# (2) otherwise, pass the desired values on the `make' command line.
|
||||
$(RECURSIVE_TARGETS):
|
||||
@fail= failcom='exit 1'; \
|
||||
for f in x $$MAKEFLAGS; do \
|
||||
case $$f in \
|
||||
*=* | --[!k]*);; \
|
||||
*k*) failcom='fail=yes';; \
|
||||
esac; \
|
||||
done; \
|
||||
dot_seen=no; \
|
||||
target=`echo $@ | sed s/-recursive//`; \
|
||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||
echo "Making $$target in $$subdir"; \
|
||||
if test "$$subdir" = "."; then \
|
||||
dot_seen=yes; \
|
||||
local_target="$$target-am"; \
|
||||
else \
|
||||
local_target="$$target"; \
|
||||
fi; \
|
||||
($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|
||||
|| eval $$failcom; \
|
||||
done; \
|
||||
if test "$$dot_seen" = "no"; then \
|
||||
$(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
|
||||
fi; test -z "$$fail"
|
||||
|
||||
$(RECURSIVE_CLEAN_TARGETS):
|
||||
@fail= failcom='exit 1'; \
|
||||
for f in x $$MAKEFLAGS; do \
|
||||
case $$f in \
|
||||
*=* | --[!k]*);; \
|
||||
*k*) failcom='fail=yes';; \
|
||||
esac; \
|
||||
done; \
|
||||
dot_seen=no; \
|
||||
case "$@" in \
|
||||
distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
|
||||
*) list='$(SUBDIRS)' ;; \
|
||||
esac; \
|
||||
rev=''; for subdir in $$list; do \
|
||||
if test "$$subdir" = "."; then :; else \
|
||||
rev="$$subdir $$rev"; \
|
||||
fi; \
|
||||
done; \
|
||||
rev="$$rev ."; \
|
||||
target=`echo $@ | sed s/-recursive//`; \
|
||||
for subdir in $$rev; do \
|
||||
echo "Making $$target in $$subdir"; \
|
||||
if test "$$subdir" = "."; then \
|
||||
local_target="$$target-am"; \
|
||||
else \
|
||||
local_target="$$target"; \
|
||||
fi; \
|
||||
($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|
||||
|| eval $$failcom; \
|
||||
done && test -z "$$fail"
|
||||
tags-recursive:
|
||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||
test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
|
||||
done
|
||||
ctags-recursive:
|
||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||
test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
|
||||
done
|
||||
|
||||
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
|
||||
END { if (nonempty) { for (i in files) print i; }; }'`; \
|
||||
mkid -fID $$unique
|
||||
tags: TAGS
|
||||
|
||||
TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
set x; \
|
||||
here=`pwd`; \
|
||||
if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
|
||||
include_option=--etags-include; \
|
||||
empty_fix=.; \
|
||||
else \
|
||||
include_option=--include; \
|
||||
empty_fix=; \
|
||||
fi; \
|
||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||
if test "$$subdir" = .; then :; else \
|
||||
test ! -f $$subdir/TAGS || \
|
||||
set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
|
||||
fi; \
|
||||
done; \
|
||||
list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
|
||||
END { if (nonempty) { for (i in files) print i; }; }'`; \
|
||||
shift; \
|
||||
if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
|
||||
test -n "$$unique" || unique=$$empty_fix; \
|
||||
if test $$# -gt 0; then \
|
||||
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
|
||||
"$$@" $$unique; \
|
||||
else \
|
||||
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
|
||||
$$unique; \
|
||||
fi; \
|
||||
fi
|
||||
ctags: CTAGS
|
||||
CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
|
||||
END { if (nonempty) { for (i in files) print i; }; }'`; \
|
||||
test -z "$(CTAGS_ARGS)$$unique" \
|
||||
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
|
||||
$$unique
|
||||
|
||||
GTAGS:
|
||||
here=`$(am__cd) $(top_builddir) && pwd` \
|
||||
&& $(am__cd) $(top_srcdir) \
|
||||
&& gtags -i $(GTAGS_ARGS) "$$here"
|
||||
|
||||
distclean-tags:
|
||||
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
|
||||
|
||||
distdir: $(DISTFILES)
|
||||
$(am__remove_distdir)
|
||||
test -d "$(distdir)" || mkdir "$(distdir)"
|
||||
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||
list='$(DISTFILES)'; \
|
||||
dist_files=`for file in $$list; do echo $$file; done | \
|
||||
sed -e "s|^$$srcdirstrip/||;t" \
|
||||
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
|
||||
case $$dist_files in \
|
||||
*/*) $(MKDIR_P) `echo "$$dist_files" | \
|
||||
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
|
||||
sort -u` ;; \
|
||||
esac; \
|
||||
for file in $$dist_files; do \
|
||||
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
|
||||
if test -d $$d/$$file; then \
|
||||
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
|
||||
if test -d "$(distdir)/$$file"; then \
|
||||
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
|
||||
fi; \
|
||||
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
|
||||
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
|
||||
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
|
||||
fi; \
|
||||
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
|
||||
else \
|
||||
test -f "$(distdir)/$$file" \
|
||||
|| cp -p $$d/$$file "$(distdir)/$$file" \
|
||||
|| exit 1; \
|
||||
fi; \
|
||||
done
|
||||
@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
|
||||
if test "$$subdir" = .; then :; else \
|
||||
$(am__make_dryrun) \
|
||||
|| test -d "$(distdir)/$$subdir" \
|
||||
|| $(MKDIR_P) "$(distdir)/$$subdir" \
|
||||
|| exit 1; \
|
||||
dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
|
||||
$(am__relativize); \
|
||||
new_distdir=$$reldir; \
|
||||
dir1=$$subdir; dir2="$(top_distdir)"; \
|
||||
$(am__relativize); \
|
||||
new_top_distdir=$$reldir; \
|
||||
echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
|
||||
echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
|
||||
($(am__cd) $$subdir && \
|
||||
$(MAKE) $(AM_MAKEFLAGS) \
|
||||
top_distdir="$$new_top_distdir" \
|
||||
distdir="$$new_distdir" \
|
||||
am__remove_distdir=: \
|
||||
am__skip_length_check=: \
|
||||
am__skip_mode_fix=: \
|
||||
distdir) \
|
||||
|| exit 1; \
|
||||
fi; \
|
||||
done
|
||||
$(MAKE) $(AM_MAKEFLAGS) \
|
||||
top_distdir="$(top_distdir)" distdir="$(distdir)" \
|
||||
dist-hook
|
||||
-test -n "$(am__skip_mode_fix)" \
|
||||
|| find "$(distdir)" -type d ! -perm -755 \
|
||||
-exec chmod u+rwx,go+rx {} \; -o \
|
||||
! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
|
||||
! -type d ! -perm -400 -exec chmod a+r {} \; -o \
|
||||
! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \
|
||||
|| chmod -R a+r "$(distdir)"
|
||||
dist-gzip: distdir
|
||||
tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
|
||||
$(am__remove_distdir)
|
||||
|
||||
dist-bzip2: distdir
|
||||
tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2
|
||||
$(am__remove_distdir)
|
||||
|
||||
dist-lzip: distdir
|
||||
tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz
|
||||
$(am__remove_distdir)
|
||||
|
||||
dist-lzma: distdir
|
||||
tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma
|
||||
$(am__remove_distdir)
|
||||
|
||||
dist-xz: distdir
|
||||
tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz
|
||||
$(am__remove_distdir)
|
||||
|
||||
dist-tarZ: distdir
|
||||
tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
|
||||
$(am__remove_distdir)
|
||||
|
||||
dist-shar: distdir
|
||||
shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
|
||||
$(am__remove_distdir)
|
||||
|
||||
dist-zip: distdir
|
||||
-rm -f $(distdir).zip
|
||||
zip -rq $(distdir).zip $(distdir)
|
||||
$(am__remove_distdir)
|
||||
|
||||
dist dist-all: distdir
|
||||
tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
|
||||
$(am__remove_distdir)
|
||||
|
||||
# This target untars the dist file and tries a VPATH configuration. Then
|
||||
# it guarantees that the distribution is self-contained by making another
|
||||
# tarfile.
|
||||
distcheck: dist
|
||||
case '$(DIST_ARCHIVES)' in \
|
||||
*.tar.gz*) \
|
||||
GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\
|
||||
*.tar.bz2*) \
|
||||
bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\
|
||||
*.tar.lzma*) \
|
||||
lzma -dc $(distdir).tar.lzma | $(am__untar) ;;\
|
||||
*.tar.lz*) \
|
||||
lzip -dc $(distdir).tar.lz | $(am__untar) ;;\
|
||||
*.tar.xz*) \
|
||||
xz -dc $(distdir).tar.xz | $(am__untar) ;;\
|
||||
*.tar.Z*) \
|
||||
uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
|
||||
*.shar.gz*) \
|
||||
GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\
|
||||
*.zip*) \
|
||||
unzip $(distdir).zip ;;\
|
||||
esac
|
||||
chmod -R a-w $(distdir); chmod u+w $(distdir)
|
||||
mkdir $(distdir)/_build
|
||||
mkdir $(distdir)/_inst
|
||||
chmod a-w $(distdir)
|
||||
test -d $(distdir)/_build || exit 0; \
|
||||
dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
|
||||
&& dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
|
||||
&& am__cwd=`pwd` \
|
||||
&& $(am__cd) $(distdir)/_build \
|
||||
&& ../configure --srcdir=.. --prefix="$$dc_install_base" \
|
||||
$(AM_DISTCHECK_CONFIGURE_FLAGS) \
|
||||
$(DISTCHECK_CONFIGURE_FLAGS) \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) dvi \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) check \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) install \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) installcheck \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) uninstall \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \
|
||||
distuninstallcheck \
|
||||
&& chmod -R a-w "$$dc_install_base" \
|
||||
&& ({ \
|
||||
(cd ../.. && umask 077 && mkdir "$$dc_destdir") \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \
|
||||
distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \
|
||||
} || { rm -rf "$$dc_destdir"; exit 1; }) \
|
||||
&& rm -rf "$$dc_destdir" \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) dist \
|
||||
&& rm -rf $(DIST_ARCHIVES) \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) distcleancheck \
|
||||
&& cd "$$am__cwd" \
|
||||
|| exit 1
|
||||
$(am__remove_distdir)
|
||||
@(echo "$(distdir) archives ready for distribution: "; \
|
||||
list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
|
||||
sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x'
|
||||
distuninstallcheck:
|
||||
@test -n '$(distuninstallcheck_dir)' || { \
|
||||
echo 'ERROR: trying to run $@ with an empty' \
|
||||
'$$(distuninstallcheck_dir)' >&2; \
|
||||
exit 1; \
|
||||
}; \
|
||||
$(am__cd) '$(distuninstallcheck_dir)' || { \
|
||||
echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \
|
||||
exit 1; \
|
||||
}; \
|
||||
test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \
|
||||
|| { echo "ERROR: files left after uninstall:" ; \
|
||||
if test -n "$(DESTDIR)"; then \
|
||||
echo " (check DESTDIR support)"; \
|
||||
fi ; \
|
||||
$(distuninstallcheck_listfiles) ; \
|
||||
exit 1; } >&2
|
||||
distcleancheck: distclean
|
||||
@if test '$(srcdir)' = . ; then \
|
||||
echo "ERROR: distcleancheck can only run from a VPATH build" ; \
|
||||
exit 1 ; \
|
||||
fi
|
||||
@test `$(distcleancheck_listfiles) | wc -l` -eq 0 \
|
||||
|| { echo "ERROR: files left in build directory after distclean:" ; \
|
||||
$(distcleancheck_listfiles) ; \
|
||||
exit 1; } >&2
|
||||
check-am: all-am
|
||||
check: check-recursive
|
||||
all-am: Makefile $(DATA) config.h
|
||||
installdirs: installdirs-recursive
|
||||
installdirs-am:
|
||||
for dir in "$(DESTDIR)$(pkgconfigdir)"; do \
|
||||
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
|
||||
done
|
||||
install: install-recursive
|
||||
install-exec: install-exec-recursive
|
||||
install-data: install-data-recursive
|
||||
uninstall: uninstall-recursive
|
||||
|
||||
install-am: all-am
|
||||
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
|
||||
|
||||
installcheck: installcheck-recursive
|
||||
install-strip:
|
||||
if test -z '$(STRIP)'; then \
|
||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
||||
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
||||
install; \
|
||||
else \
|
||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
||||
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
||||
"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
|
||||
fi
|
||||
mostlyclean-generic:
|
||||
|
||||
clean-generic:
|
||||
|
||||
distclean-generic:
|
||||
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
|
||||
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
|
||||
|
||||
maintainer-clean-generic:
|
||||
@echo "This command is intended for maintainers to use"
|
||||
@echo "it deletes files that may require special tools to rebuild."
|
||||
clean-local:
|
||||
clean: clean-recursive
|
||||
|
||||
clean-am: clean-generic clean-libtool clean-local mostlyclean-am
|
||||
|
||||
distclean: distclean-recursive
|
||||
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
|
||||
-rm -f Makefile
|
||||
distclean-am: clean-am distclean-generic distclean-hdr \
|
||||
distclean-libtool distclean-tags
|
||||
|
||||
dvi: dvi-recursive
|
||||
|
||||
dvi-am:
|
||||
|
||||
html: html-recursive
|
||||
|
||||
html-am:
|
||||
|
||||
info: info-recursive
|
||||
|
||||
info-am:
|
||||
|
||||
install-data-am: install-pkgconfigDATA
|
||||
|
||||
install-dvi: install-dvi-recursive
|
||||
|
||||
install-dvi-am:
|
||||
|
||||
install-exec-am:
|
||||
|
||||
install-html: install-html-recursive
|
||||
|
||||
install-html-am:
|
||||
|
||||
install-info: install-info-recursive
|
||||
|
||||
install-info-am:
|
||||
|
||||
install-man:
|
||||
|
||||
install-pdf: install-pdf-recursive
|
||||
|
||||
install-pdf-am:
|
||||
|
||||
install-ps: install-ps-recursive
|
||||
|
||||
install-ps-am:
|
||||
|
||||
installcheck-am:
|
||||
|
||||
maintainer-clean: maintainer-clean-recursive
|
||||
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
|
||||
-rm -rf $(top_srcdir)/autom4te.cache
|
||||
-rm -f Makefile
|
||||
maintainer-clean-am: distclean-am maintainer-clean-generic
|
||||
|
||||
mostlyclean: mostlyclean-recursive
|
||||
|
||||
mostlyclean-am: mostlyclean-generic mostlyclean-libtool
|
||||
|
||||
pdf: pdf-recursive
|
||||
|
||||
pdf-am:
|
||||
|
||||
ps: ps-recursive
|
||||
|
||||
ps-am:
|
||||
|
||||
uninstall-am: uninstall-pkgconfigDATA
|
||||
|
||||
.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) all \
|
||||
ctags-recursive install-am install-strip tags-recursive
|
||||
|
||||
.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
|
||||
all all-am am--refresh check check-am clean clean-generic \
|
||||
clean-libtool clean-local ctags ctags-recursive dist dist-all \
|
||||
dist-bzip2 dist-gzip dist-hook dist-lzip dist-lzma dist-shar \
|
||||
dist-tarZ dist-xz dist-zip distcheck distclean \
|
||||
distclean-generic distclean-hdr distclean-libtool \
|
||||
distclean-tags distcleancheck distdir distuninstallcheck dvi \
|
||||
dvi-am html html-am info info-am install install-am \
|
||||
install-data install-data-am install-dvi install-dvi-am \
|
||||
install-exec install-exec-am install-html install-html-am \
|
||||
install-info install-info-am install-man install-pdf \
|
||||
install-pdf-am install-pkgconfigDATA install-ps install-ps-am \
|
||||
install-strip installcheck installcheck-am installdirs \
|
||||
installdirs-am maintainer-clean maintainer-clean-generic \
|
||||
mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \
|
||||
ps ps-am tags tags-recursive uninstall uninstall-am \
|
||||
uninstall-pkgconfigDATA
|
||||
|
||||
|
||||
dist-hook: audiofile.spec
|
||||
cp audiofile.spec $(distdir)
|
||||
|
||||
#coverage:
|
||||
# $(MAKE) coverage-reset
|
||||
# $(MAKE) check
|
||||
# $(MAKE) coverage-report
|
||||
|
||||
#coverage-reset:
|
||||
# $(LCOV) --base-directory=. --directory ./libaudiofile --zerocounters
|
||||
|
||||
#coverage-report:
|
||||
# $(LCOV) --directory ./libaudiofile \
|
||||
# --capture \
|
||||
# --output-file ./lcov.info
|
||||
|
||||
# $(LCOV) --directory ./libaudiofile \
|
||||
# --output-file ./lcov.info \
|
||||
# --remove ./lcov.info \
|
||||
# "/usr/include/*" "gtest/*" "*/UT_*"
|
||||
|
||||
# $(mkdir_p) ./coverage
|
||||
# git_commit=`GIT_DIR=./.git git log -1 --pretty=format:%h 2>/dev/null`; \
|
||||
# $(GENHTML) --title "audiofile 0.3.6 $$git_commit" \
|
||||
# --output-directory ./coverage ./lcov.info
|
||||
# @echo
|
||||
# @echo 'lcov report can be found here:'
|
||||
# @echo 'file:///i/Development/sm64pc/tools/audiofile-0.3.6/coverage/index.html'
|
||||
# @echo
|
||||
|
||||
#clean-local:
|
||||
# -rm -rf coverage
|
||||
|
||||
#.PHONY: coverage-reset coverage coverage-report
|
||||
coverage:
|
||||
@echo "Code coverage is not enabled."
|
||||
@exit 1
|
||||
|
||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||
.NOEXPORT:
|
|
@ -1,58 +0,0 @@
|
|||
## Process this file with automake to produce Makefile.in
|
||||
|
||||
SUBDIRS = gtest libaudiofile sfcommands test examples docs
|
||||
|
||||
EXTRA_DIST = \
|
||||
ACKNOWLEDGEMENTS \
|
||||
NOTES \
|
||||
README \
|
||||
TODO \
|
||||
COPYING.GPL \
|
||||
configure configure.ac \
|
||||
audiofile.spec.in \
|
||||
audiofile.pc.in \
|
||||
audiofile-uninstalled.pc.in
|
||||
|
||||
pkgconfigdir = $(libdir)/pkgconfig
|
||||
pkgconfig_DATA = audiofile.pc
|
||||
|
||||
dist-hook: audiofile.spec
|
||||
cp audiofile.spec $(distdir)
|
||||
|
||||
if ENABLE_COVERAGE
|
||||
coverage:
|
||||
$(MAKE) coverage-reset
|
||||
$(MAKE) check
|
||||
$(MAKE) coverage-report
|
||||
|
||||
coverage-reset:
|
||||
$(LCOV) --base-directory=@top_srcdir@ --directory @top_srcdir@/libaudiofile --zerocounters
|
||||
|
||||
coverage-report:
|
||||
$(LCOV) --directory @top_srcdir@/libaudiofile \
|
||||
--capture \
|
||||
--output-file @top_builddir@/lcov.info
|
||||
|
||||
$(LCOV) --directory @top_srcdir@/libaudiofile \
|
||||
--output-file @top_builddir@/lcov.info \
|
||||
--remove @top_builddir@/lcov.info \
|
||||
"/usr/include/*" "gtest/*" "*/UT_*"
|
||||
|
||||
$(mkdir_p) @top_builddir@/coverage
|
||||
git_commit=`GIT_DIR=@top_srcdir@/.git git log -1 --pretty=format:%h 2>/dev/null`; \
|
||||
$(GENHTML) --title "@PACKAGE@ @VERSION@ $$git_commit" \
|
||||
--output-directory @top_builddir@/coverage @top_builddir@/lcov.info
|
||||
@echo
|
||||
@echo 'lcov report can be found here:'
|
||||
@echo 'file://@abs_top_builddir@/coverage/index.html'
|
||||
@echo
|
||||
|
||||
clean-local:
|
||||
-rm -rf coverage
|
||||
|
||||
.PHONY: coverage-reset coverage coverage-report
|
||||
else
|
||||
coverage:
|
||||
@echo "Code coverage is not enabled."
|
||||
@exit 1
|
||||
endif
|
|
@ -1,898 +0,0 @@
|
|||
# Makefile.in generated by automake 1.11.6 from Makefile.am.
|
||||
# @configure_input@
|
||||
|
||||
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
|
||||
# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software
|
||||
# Foundation, Inc.
|
||||
# This Makefile.in is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
|
||||
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
# PARTICULAR PURPOSE.
|
||||
|
||||
@SET_MAKE@
|
||||
|
||||
VPATH = @srcdir@
|
||||
am__make_dryrun = \
|
||||
{ \
|
||||
am__dry=no; \
|
||||
case $$MAKEFLAGS in \
|
||||
*\\[\ \ ]*) \
|
||||
echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \
|
||||
| grep '^AM OK$$' >/dev/null || am__dry=yes;; \
|
||||
*) \
|
||||
for am__flg in $$MAKEFLAGS; do \
|
||||
case $$am__flg in \
|
||||
*=*|--*) ;; \
|
||||
*n*) am__dry=yes; break;; \
|
||||
esac; \
|
||||
done;; \
|
||||
esac; \
|
||||
test $$am__dry = yes; \
|
||||
}
|
||||
pkgdatadir = $(datadir)/@PACKAGE@
|
||||
pkgincludedir = $(includedir)/@PACKAGE@
|
||||
pkglibdir = $(libdir)/@PACKAGE@
|
||||
pkglibexecdir = $(libexecdir)/@PACKAGE@
|
||||
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
|
||||
install_sh_DATA = $(install_sh) -c -m 644
|
||||
install_sh_PROGRAM = $(install_sh) -c
|
||||
install_sh_SCRIPT = $(install_sh) -c
|
||||
INSTALL_HEADER = $(INSTALL_DATA)
|
||||
transform = $(program_transform_name)
|
||||
NORMAL_INSTALL = :
|
||||
PRE_INSTALL = :
|
||||
POST_INSTALL = :
|
||||
NORMAL_UNINSTALL = :
|
||||
PRE_UNINSTALL = :
|
||||
POST_UNINSTALL = :
|
||||
build_triplet = @build@
|
||||
host_triplet = @host@
|
||||
subdir = .
|
||||
DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \
|
||||
$(srcdir)/Makefile.in $(srcdir)/audiofile-uninstalled.pc.in \
|
||||
$(srcdir)/audiofile.pc.in $(srcdir)/audiofile.spec.in \
|
||||
$(srcdir)/config.h.in $(top_srcdir)/configure AUTHORS COPYING \
|
||||
ChangeLog INSTALL NEWS TODO config.guess config.sub depcomp \
|
||||
install-sh ltmain.sh missing
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
am__aclocal_m4_deps = $(top_srcdir)/configure.ac
|
||||
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
|
||||
$(ACLOCAL_M4)
|
||||
am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
|
||||
configure.lineno config.status.lineno
|
||||
mkinstalldirs = $(install_sh) -d
|
||||
CONFIG_HEADER = config.h
|
||||
CONFIG_CLEAN_FILES = audiofile.spec audiofile.pc \
|
||||
audiofile-uninstalled.pc
|
||||
CONFIG_CLEAN_VPATH_FILES =
|
||||
SOURCES =
|
||||
DIST_SOURCES =
|
||||
RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
|
||||
html-recursive info-recursive install-data-recursive \
|
||||
install-dvi-recursive install-exec-recursive \
|
||||
install-html-recursive install-info-recursive \
|
||||
install-pdf-recursive install-ps-recursive install-recursive \
|
||||
installcheck-recursive installdirs-recursive pdf-recursive \
|
||||
ps-recursive uninstall-recursive
|
||||
am__can_run_installinfo = \
|
||||
case $$AM_UPDATE_INFO_DIR in \
|
||||
n|no|NO) false;; \
|
||||
*) (install-info --version) >/dev/null 2>&1;; \
|
||||
esac
|
||||
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
|
||||
am__vpath_adj = case $$p in \
|
||||
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
|
||||
*) f=$$p;; \
|
||||
esac;
|
||||
am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
|
||||
am__install_max = 40
|
||||
am__nobase_strip_setup = \
|
||||
srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
|
||||
am__nobase_strip = \
|
||||
for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
|
||||
am__nobase_list = $(am__nobase_strip_setup); \
|
||||
for p in $$list; do echo "$$p $$p"; done | \
|
||||
sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
|
||||
$(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
|
||||
if (++n[$$2] == $(am__install_max)) \
|
||||
{ print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
|
||||
END { for (dir in files) print dir, files[dir] }'
|
||||
am__base_list = \
|
||||
sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
|
||||
sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
|
||||
am__uninstall_files_from_dir = { \
|
||||
test -z "$$files" \
|
||||
|| { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
|
||||
|| { echo " ( cd '$$dir' && rm -f" $$files ")"; \
|
||||
$(am__cd) "$$dir" && rm -f $$files; }; \
|
||||
}
|
||||
am__installdirs = "$(DESTDIR)$(pkgconfigdir)"
|
||||
DATA = $(pkgconfig_DATA)
|
||||
RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
|
||||
distclean-recursive maintainer-clean-recursive
|
||||
AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
|
||||
$(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \
|
||||
distdir dist dist-all distcheck
|
||||
ETAGS = etags
|
||||
CTAGS = ctags
|
||||
DIST_SUBDIRS = $(SUBDIRS)
|
||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||
distdir = $(PACKAGE)-$(VERSION)
|
||||
top_distdir = $(distdir)
|
||||
am__remove_distdir = \
|
||||
if test -d "$(distdir)"; then \
|
||||
find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \
|
||||
&& rm -rf "$(distdir)" \
|
||||
|| { sleep 5 && rm -rf "$(distdir)"; }; \
|
||||
else :; fi
|
||||
am__relativize = \
|
||||
dir0=`pwd`; \
|
||||
sed_first='s,^\([^/]*\)/.*$$,\1,'; \
|
||||
sed_rest='s,^[^/]*/*,,'; \
|
||||
sed_last='s,^.*/\([^/]*\)$$,\1,'; \
|
||||
sed_butlast='s,/*[^/]*$$,,'; \
|
||||
while test -n "$$dir1"; do \
|
||||
first=`echo "$$dir1" | sed -e "$$sed_first"`; \
|
||||
if test "$$first" != "."; then \
|
||||
if test "$$first" = ".."; then \
|
||||
dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
|
||||
dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
|
||||
else \
|
||||
first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
|
||||
if test "$$first2" = "$$first"; then \
|
||||
dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
|
||||
else \
|
||||
dir2="../$$dir2"; \
|
||||
fi; \
|
||||
dir0="$$dir0"/"$$first"; \
|
||||
fi; \
|
||||
fi; \
|
||||
dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
|
||||
done; \
|
||||
reldir="$$dir2"
|
||||
DIST_ARCHIVES = $(distdir).tar.gz
|
||||
GZIP_ENV = --best
|
||||
distuninstallcheck_listfiles = find . -type f -print
|
||||
am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \
|
||||
| sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$'
|
||||
distcleancheck_listfiles = find . -type f -print
|
||||
A2X = @A2X@
|
||||
ACLOCAL = @ACLOCAL@
|
||||
AMTAR = @AMTAR@
|
||||
AR = @AR@
|
||||
ASCIIDOC = @ASCIIDOC@
|
||||
AUDIOFILE_VERSION = @AUDIOFILE_VERSION@
|
||||
AUDIOFILE_VERSION_INFO = @AUDIOFILE_VERSION_INFO@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
AWK = @AWK@
|
||||
CC = @CC@
|
||||
CCDEPMODE = @CCDEPMODE@
|
||||
CFLAGS = @CFLAGS@
|
||||
COVERAGE_CFLAGS = @COVERAGE_CFLAGS@
|
||||
COVERAGE_LIBS = @COVERAGE_LIBS@
|
||||
CPP = @CPP@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CXX = @CXX@
|
||||
CXXCPP = @CXXCPP@
|
||||
CXXDEPMODE = @CXXDEPMODE@
|
||||
CXXFLAGS = @CXXFLAGS@
|
||||
CYGPATH_W = @CYGPATH_W@
|
||||
DEFS = @DEFS@
|
||||
DEPDIR = @DEPDIR@
|
||||
DLLTOOL = @DLLTOOL@
|
||||
DSYMUTIL = @DSYMUTIL@
|
||||
DUMPBIN = @DUMPBIN@
|
||||
ECHO_C = @ECHO_C@
|
||||
ECHO_N = @ECHO_N@
|
||||
ECHO_T = @ECHO_T@
|
||||
EGREP = @EGREP@
|
||||
EXEEXT = @EXEEXT@
|
||||
FGREP = @FGREP@
|
||||
FLAC_CFLAGS = @FLAC_CFLAGS@
|
||||
FLAC_LIBS = @FLAC_LIBS@
|
||||
GENHTML = @GENHTML@
|
||||
GREP = @GREP@
|
||||
INSTALL = @INSTALL@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
|
||||
LCOV = @LCOV@
|
||||
LD = @LD@
|
||||
LDFLAGS = @LDFLAGS@
|
||||
LIBOBJS = @LIBOBJS@
|
||||
LIBS = @LIBS@
|
||||
LIBTOOL = @LIBTOOL@
|
||||
LIPO = @LIPO@
|
||||
LN_S = @LN_S@
|
||||
LTLIBOBJS = @LTLIBOBJS@
|
||||
LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
MANIFEST_TOOL = @MANIFEST_TOOL@
|
||||
MKDIR_P = @MKDIR_P@
|
||||
NM = @NM@
|
||||
NMEDIT = @NMEDIT@
|
||||
OBJDUMP = @OBJDUMP@
|
||||
OBJEXT = @OBJEXT@
|
||||
OTOOL = @OTOOL@
|
||||
OTOOL64 = @OTOOL64@
|
||||
PACKAGE = @PACKAGE@
|
||||
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
|
||||
PACKAGE_NAME = @PACKAGE_NAME@
|
||||
PACKAGE_STRING = @PACKAGE_STRING@
|
||||
PACKAGE_TARNAME = @PACKAGE_TARNAME@
|
||||
PACKAGE_URL = @PACKAGE_URL@
|
||||
PACKAGE_VERSION = @PACKAGE_VERSION@
|
||||
PATH_SEPARATOR = @PATH_SEPARATOR@
|
||||
PKG_CONFIG = @PKG_CONFIG@
|
||||
PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
|
||||
PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
|
||||
RANLIB = @RANLIB@
|
||||
SED = @SED@
|
||||
SET_MAKE = @SET_MAKE@
|
||||
SHELL = @SHELL@
|
||||
STRIP = @STRIP@
|
||||
TEST_BIN = @TEST_BIN@
|
||||
VALGRIND = @VALGRIND@
|
||||
VERSION = @VERSION@
|
||||
WERROR_CFLAGS = @WERROR_CFLAGS@
|
||||
abs_builddir = @abs_builddir@
|
||||
abs_srcdir = @abs_srcdir@
|
||||
abs_top_builddir = @abs_top_builddir@
|
||||
abs_top_srcdir = @abs_top_srcdir@
|
||||
ac_ct_AR = @ac_ct_AR@
|
||||
ac_ct_CC = @ac_ct_CC@
|
||||
ac_ct_CXX = @ac_ct_CXX@
|
||||
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
|
||||
am__include = @am__include@
|
||||
am__leading_dot = @am__leading_dot@
|
||||
am__quote = @am__quote@
|
||||
am__tar = @am__tar@
|
||||
am__untar = @am__untar@
|
||||
bindir = @bindir@
|
||||
build = @build@
|
||||
build_alias = @build_alias@
|
||||
build_cpu = @build_cpu@
|
||||
build_os = @build_os@
|
||||
build_vendor = @build_vendor@
|
||||
builddir = @builddir@
|
||||
datadir = @datadir@
|
||||
datarootdir = @datarootdir@
|
||||
docdir = @docdir@
|
||||
dvidir = @dvidir@
|
||||
exec_prefix = @exec_prefix@
|
||||
host = @host@
|
||||
host_alias = @host_alias@
|
||||
host_cpu = @host_cpu@
|
||||
host_os = @host_os@
|
||||
host_vendor = @host_vendor@
|
||||
htmldir = @htmldir@
|
||||
includedir = @includedir@
|
||||
infodir = @infodir@
|
||||
install_sh = @install_sh@
|
||||
libdir = @libdir@
|
||||
libexecdir = @libexecdir@
|
||||
localedir = @localedir@
|
||||
localstatedir = @localstatedir@
|
||||
mandir = @mandir@
|
||||
mkdir_p = @mkdir_p@
|
||||
oldincludedir = @oldincludedir@
|
||||
pdfdir = @pdfdir@
|
||||
prefix = @prefix@
|
||||
program_transform_name = @program_transform_name@
|
||||
psdir = @psdir@
|
||||
sbindir = @sbindir@
|
||||
sharedstatedir = @sharedstatedir@
|
||||
srcdir = @srcdir@
|
||||
sysconfdir = @sysconfdir@
|
||||
target_alias = @target_alias@
|
||||
top_build_prefix = @top_build_prefix@
|
||||
top_builddir = @top_builddir@
|
||||
top_srcdir = @top_srcdir@
|
||||
SUBDIRS = gtest libaudiofile sfcommands test examples docs
|
||||
EXTRA_DIST = \
|
||||
ACKNOWLEDGEMENTS \
|
||||
NOTES \
|
||||
README \
|
||||
TODO \
|
||||
COPYING.GPL \
|
||||
configure configure.ac \
|
||||
audiofile.spec.in \
|
||||
audiofile.pc.in \
|
||||
audiofile-uninstalled.pc.in
|
||||
|
||||
pkgconfigdir = $(libdir)/pkgconfig
|
||||
pkgconfig_DATA = audiofile.pc
|
||||
all: config.h
|
||||
$(MAKE) $(AM_MAKEFLAGS) all-recursive
|
||||
|
||||
.SUFFIXES:
|
||||
am--refresh: Makefile
|
||||
@:
|
||||
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
|
||||
@for dep in $?; do \
|
||||
case '$(am__configure_deps)' in \
|
||||
*$$dep*) \
|
||||
echo ' cd $(srcdir) && $(AUTOMAKE) --gnu'; \
|
||||
$(am__cd) $(srcdir) && $(AUTOMAKE) --gnu \
|
||||
&& exit 0; \
|
||||
exit 1;; \
|
||||
esac; \
|
||||
done; \
|
||||
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \
|
||||
$(am__cd) $(top_srcdir) && \
|
||||
$(AUTOMAKE) --gnu Makefile
|
||||
.PRECIOUS: Makefile
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
@case '$?' in \
|
||||
*config.status*) \
|
||||
echo ' $(SHELL) ./config.status'; \
|
||||
$(SHELL) ./config.status;; \
|
||||
*) \
|
||||
echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \
|
||||
esac;
|
||||
|
||||
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
|
||||
$(SHELL) ./config.status --recheck
|
||||
|
||||
$(top_srcdir)/configure: $(am__configure_deps)
|
||||
$(am__cd) $(srcdir) && $(AUTOCONF)
|
||||
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
|
||||
$(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
|
||||
$(am__aclocal_m4_deps):
|
||||
|
||||
config.h: stamp-h1
|
||||
@if test ! -f $@; then rm -f stamp-h1; else :; fi
|
||||
@if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) stamp-h1; else :; fi
|
||||
|
||||
stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status
|
||||
@rm -f stamp-h1
|
||||
cd $(top_builddir) && $(SHELL) ./config.status config.h
|
||||
$(srcdir)/config.h.in: $(am__configure_deps)
|
||||
($(am__cd) $(top_srcdir) && $(AUTOHEADER))
|
||||
rm -f stamp-h1
|
||||
touch $@
|
||||
|
||||
distclean-hdr:
|
||||
-rm -f config.h stamp-h1
|
||||
audiofile.spec: $(top_builddir)/config.status $(srcdir)/audiofile.spec.in
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $@
|
||||
audiofile.pc: $(top_builddir)/config.status $(srcdir)/audiofile.pc.in
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $@
|
||||
audiofile-uninstalled.pc: $(top_builddir)/config.status $(srcdir)/audiofile-uninstalled.pc.in
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $@
|
||||
|
||||
mostlyclean-libtool:
|
||||
-rm -f *.lo
|
||||
|
||||
clean-libtool:
|
||||
-rm -rf .libs _libs
|
||||
|
||||
distclean-libtool:
|
||||
-rm -f libtool config.lt
|
||||
install-pkgconfigDATA: $(pkgconfig_DATA)
|
||||
@$(NORMAL_INSTALL)
|
||||
@list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \
|
||||
if test -n "$$list"; then \
|
||||
echo " $(MKDIR_P) '$(DESTDIR)$(pkgconfigdir)'"; \
|
||||
$(MKDIR_P) "$(DESTDIR)$(pkgconfigdir)" || exit 1; \
|
||||
fi; \
|
||||
for p in $$list; do \
|
||||
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
|
||||
echo "$$d$$p"; \
|
||||
done | $(am__base_list) | \
|
||||
while read files; do \
|
||||
echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pkgconfigdir)'"; \
|
||||
$(INSTALL_DATA) $$files "$(DESTDIR)$(pkgconfigdir)" || exit $$?; \
|
||||
done
|
||||
|
||||
uninstall-pkgconfigDATA:
|
||||
@$(NORMAL_UNINSTALL)
|
||||
@list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \
|
||||
files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
|
||||
dir='$(DESTDIR)$(pkgconfigdir)'; $(am__uninstall_files_from_dir)
|
||||
|
||||
# This directory's subdirectories are mostly independent; you can cd
|
||||
# into them and run `make' without going through this Makefile.
|
||||
# To change the values of `make' variables: instead of editing Makefiles,
|
||||
# (1) if the variable is set in `config.status', edit `config.status'
|
||||
# (which will cause the Makefiles to be regenerated when you run `make');
|
||||
# (2) otherwise, pass the desired values on the `make' command line.
|
||||
$(RECURSIVE_TARGETS):
|
||||
@fail= failcom='exit 1'; \
|
||||
for f in x $$MAKEFLAGS; do \
|
||||
case $$f in \
|
||||
*=* | --[!k]*);; \
|
||||
*k*) failcom='fail=yes';; \
|
||||
esac; \
|
||||
done; \
|
||||
dot_seen=no; \
|
||||
target=`echo $@ | sed s/-recursive//`; \
|
||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||
echo "Making $$target in $$subdir"; \
|
||||
if test "$$subdir" = "."; then \
|
||||
dot_seen=yes; \
|
||||
local_target="$$target-am"; \
|
||||
else \
|
||||
local_target="$$target"; \
|
||||
fi; \
|
||||
($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|
||||
|| eval $$failcom; \
|
||||
done; \
|
||||
if test "$$dot_seen" = "no"; then \
|
||||
$(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
|
||||
fi; test -z "$$fail"
|
||||
|
||||
$(RECURSIVE_CLEAN_TARGETS):
|
||||
@fail= failcom='exit 1'; \
|
||||
for f in x $$MAKEFLAGS; do \
|
||||
case $$f in \
|
||||
*=* | --[!k]*);; \
|
||||
*k*) failcom='fail=yes';; \
|
||||
esac; \
|
||||
done; \
|
||||
dot_seen=no; \
|
||||
case "$@" in \
|
||||
distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
|
||||
*) list='$(SUBDIRS)' ;; \
|
||||
esac; \
|
||||
rev=''; for subdir in $$list; do \
|
||||
if test "$$subdir" = "."; then :; else \
|
||||
rev="$$subdir $$rev"; \
|
||||
fi; \
|
||||
done; \
|
||||
rev="$$rev ."; \
|
||||
target=`echo $@ | sed s/-recursive//`; \
|
||||
for subdir in $$rev; do \
|
||||
echo "Making $$target in $$subdir"; \
|
||||
if test "$$subdir" = "."; then \
|
||||
local_target="$$target-am"; \
|
||||
else \
|
||||
local_target="$$target"; \
|
||||
fi; \
|
||||
($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|
||||
|| eval $$failcom; \
|
||||
done && test -z "$$fail"
|
||||
tags-recursive:
|
||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||
test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
|
||||
done
|
||||
ctags-recursive:
|
||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||
test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
|
||||
done
|
||||
|
||||
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
|
||||
END { if (nonempty) { for (i in files) print i; }; }'`; \
|
||||
mkid -fID $$unique
|
||||
tags: TAGS
|
||||
|
||||
TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
set x; \
|
||||
here=`pwd`; \
|
||||
if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
|
||||
include_option=--etags-include; \
|
||||
empty_fix=.; \
|
||||
else \
|
||||
include_option=--include; \
|
||||
empty_fix=; \
|
||||
fi; \
|
||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||
if test "$$subdir" = .; then :; else \
|
||||
test ! -f $$subdir/TAGS || \
|
||||
set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
|
||||
fi; \
|
||||
done; \
|
||||
list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
|
||||
END { if (nonempty) { for (i in files) print i; }; }'`; \
|
||||
shift; \
|
||||
if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
|
||||
test -n "$$unique" || unique=$$empty_fix; \
|
||||
if test $$# -gt 0; then \
|
||||
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
|
||||
"$$@" $$unique; \
|
||||
else \
|
||||
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
|
||||
$$unique; \
|
||||
fi; \
|
||||
fi
|
||||
ctags: CTAGS
|
||||
CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
|
||||
END { if (nonempty) { for (i in files) print i; }; }'`; \
|
||||
test -z "$(CTAGS_ARGS)$$unique" \
|
||||
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
|
||||
$$unique
|
||||
|
||||
GTAGS:
|
||||
here=`$(am__cd) $(top_builddir) && pwd` \
|
||||
&& $(am__cd) $(top_srcdir) \
|
||||
&& gtags -i $(GTAGS_ARGS) "$$here"
|
||||
|
||||
distclean-tags:
|
||||
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
|
||||
|
||||
distdir: $(DISTFILES)
|
||||
$(am__remove_distdir)
|
||||
test -d "$(distdir)" || mkdir "$(distdir)"
|
||||
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||
list='$(DISTFILES)'; \
|
||||
dist_files=`for file in $$list; do echo $$file; done | \
|
||||
sed -e "s|^$$srcdirstrip/||;t" \
|
||||
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
|
||||
case $$dist_files in \
|
||||
*/*) $(MKDIR_P) `echo "$$dist_files" | \
|
||||
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
|
||||
sort -u` ;; \
|
||||
esac; \
|
||||
for file in $$dist_files; do \
|
||||
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
|
||||
if test -d $$d/$$file; then \
|
||||
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
|
||||
if test -d "$(distdir)/$$file"; then \
|
||||
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
|
||||
fi; \
|
||||
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
|
||||
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
|
||||
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
|
||||
fi; \
|
||||
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
|
||||
else \
|
||||
test -f "$(distdir)/$$file" \
|
||||
|| cp -p $$d/$$file "$(distdir)/$$file" \
|
||||
|| exit 1; \
|
||||
fi; \
|
||||
done
|
||||
@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
|
||||
if test "$$subdir" = .; then :; else \
|
||||
$(am__make_dryrun) \
|
||||
|| test -d "$(distdir)/$$subdir" \
|
||||
|| $(MKDIR_P) "$(distdir)/$$subdir" \
|
||||
|| exit 1; \
|
||||
dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
|
||||
$(am__relativize); \
|
||||
new_distdir=$$reldir; \
|
||||
dir1=$$subdir; dir2="$(top_distdir)"; \
|
||||
$(am__relativize); \
|
||||
new_top_distdir=$$reldir; \
|
||||
echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
|
||||
echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
|
||||
($(am__cd) $$subdir && \
|
||||
$(MAKE) $(AM_MAKEFLAGS) \
|
||||
top_distdir="$$new_top_distdir" \
|
||||
distdir="$$new_distdir" \
|
||||
am__remove_distdir=: \
|
||||
am__skip_length_check=: \
|
||||
am__skip_mode_fix=: \
|
||||
distdir) \
|
||||
|| exit 1; \
|
||||
fi; \
|
||||
done
|
||||
$(MAKE) $(AM_MAKEFLAGS) \
|
||||
top_distdir="$(top_distdir)" distdir="$(distdir)" \
|
||||
dist-hook
|
||||
-test -n "$(am__skip_mode_fix)" \
|
||||
|| find "$(distdir)" -type d ! -perm -755 \
|
||||
-exec chmod u+rwx,go+rx {} \; -o \
|
||||
! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
|
||||
! -type d ! -perm -400 -exec chmod a+r {} \; -o \
|
||||
! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \
|
||||
|| chmod -R a+r "$(distdir)"
|
||||
dist-gzip: distdir
|
||||
tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
|
||||
$(am__remove_distdir)
|
||||
|
||||
dist-bzip2: distdir
|
||||
tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2
|
||||
$(am__remove_distdir)
|
||||
|
||||
dist-lzip: distdir
|
||||
tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz
|
||||
$(am__remove_distdir)
|
||||
|
||||
dist-lzma: distdir
|
||||
tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma
|
||||
$(am__remove_distdir)
|
||||
|
||||
dist-xz: distdir
|
||||
tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz
|
||||
$(am__remove_distdir)
|
||||
|
||||
dist-tarZ: distdir
|
||||
tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
|
||||
$(am__remove_distdir)
|
||||
|
||||
dist-shar: distdir
|
||||
shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
|
||||
$(am__remove_distdir)
|
||||
|
||||
dist-zip: distdir
|
||||
-rm -f $(distdir).zip
|
||||
zip -rq $(distdir).zip $(distdir)
|
||||
$(am__remove_distdir)
|
||||
|
||||
dist dist-all: distdir
|
||||
tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
|
||||
$(am__remove_distdir)
|
||||
|
||||
# This target untars the dist file and tries a VPATH configuration. Then
|
||||
# it guarantees that the distribution is self-contained by making another
|
||||
# tarfile.
|
||||
distcheck: dist
|
||||
case '$(DIST_ARCHIVES)' in \
|
||||
*.tar.gz*) \
|
||||
GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\
|
||||
*.tar.bz2*) \
|
||||
bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\
|
||||
*.tar.lzma*) \
|
||||
lzma -dc $(distdir).tar.lzma | $(am__untar) ;;\
|
||||
*.tar.lz*) \
|
||||
lzip -dc $(distdir).tar.lz | $(am__untar) ;;\
|
||||
*.tar.xz*) \
|
||||
xz -dc $(distdir).tar.xz | $(am__untar) ;;\
|
||||
*.tar.Z*) \
|
||||
uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
|
||||
*.shar.gz*) \
|
||||
GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\
|
||||
*.zip*) \
|
||||
unzip $(distdir).zip ;;\
|
||||
esac
|
||||
chmod -R a-w $(distdir); chmod u+w $(distdir)
|
||||
mkdir $(distdir)/_build
|
||||
mkdir $(distdir)/_inst
|
||||
chmod a-w $(distdir)
|
||||
test -d $(distdir)/_build || exit 0; \
|
||||
dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
|
||||
&& dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
|
||||
&& am__cwd=`pwd` \
|
||||
&& $(am__cd) $(distdir)/_build \
|
||||
&& ../configure --srcdir=.. --prefix="$$dc_install_base" \
|
||||
$(AM_DISTCHECK_CONFIGURE_FLAGS) \
|
||||
$(DISTCHECK_CONFIGURE_FLAGS) \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) dvi \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) check \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) install \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) installcheck \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) uninstall \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \
|
||||
distuninstallcheck \
|
||||
&& chmod -R a-w "$$dc_install_base" \
|
||||
&& ({ \
|
||||
(cd ../.. && umask 077 && mkdir "$$dc_destdir") \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \
|
||||
distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \
|
||||
} || { rm -rf "$$dc_destdir"; exit 1; }) \
|
||||
&& rm -rf "$$dc_destdir" \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) dist \
|
||||
&& rm -rf $(DIST_ARCHIVES) \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) distcleancheck \
|
||||
&& cd "$$am__cwd" \
|
||||
|| exit 1
|
||||
$(am__remove_distdir)
|
||||
@(echo "$(distdir) archives ready for distribution: "; \
|
||||
list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
|
||||
sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x'
|
||||
distuninstallcheck:
|
||||
@test -n '$(distuninstallcheck_dir)' || { \
|
||||
echo 'ERROR: trying to run $@ with an empty' \
|
||||
'$$(distuninstallcheck_dir)' >&2; \
|
||||
exit 1; \
|
||||
}; \
|
||||
$(am__cd) '$(distuninstallcheck_dir)' || { \
|
||||
echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \
|
||||
exit 1; \
|
||||
}; \
|
||||
test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \
|
||||
|| { echo "ERROR: files left after uninstall:" ; \
|
||||
if test -n "$(DESTDIR)"; then \
|
||||
echo " (check DESTDIR support)"; \
|
||||
fi ; \
|
||||
$(distuninstallcheck_listfiles) ; \
|
||||
exit 1; } >&2
|
||||
distcleancheck: distclean
|
||||
@if test '$(srcdir)' = . ; then \
|
||||
echo "ERROR: distcleancheck can only run from a VPATH build" ; \
|
||||
exit 1 ; \
|
||||
fi
|
||||
@test `$(distcleancheck_listfiles) | wc -l` -eq 0 \
|
||||
|| { echo "ERROR: files left in build directory after distclean:" ; \
|
||||
$(distcleancheck_listfiles) ; \
|
||||
exit 1; } >&2
|
||||
check-am: all-am
|
||||
check: check-recursive
|
||||
all-am: Makefile $(DATA) config.h
|
||||
installdirs: installdirs-recursive
|
||||
installdirs-am:
|
||||
for dir in "$(DESTDIR)$(pkgconfigdir)"; do \
|
||||
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
|
||||
done
|
||||
install: install-recursive
|
||||
install-exec: install-exec-recursive
|
||||
install-data: install-data-recursive
|
||||
uninstall: uninstall-recursive
|
||||
|
||||
install-am: all-am
|
||||
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
|
||||
|
||||
installcheck: installcheck-recursive
|
||||
install-strip:
|
||||
if test -z '$(STRIP)'; then \
|
||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
||||
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
||||
install; \
|
||||
else \
|
||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
||||
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
||||
"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
|
||||
fi
|
||||
mostlyclean-generic:
|
||||
|
||||
clean-generic:
|
||||
|
||||
distclean-generic:
|
||||
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
|
||||
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
|
||||
|
||||
maintainer-clean-generic:
|
||||
@echo "This command is intended for maintainers to use"
|
||||
@echo "it deletes files that may require special tools to rebuild."
|
||||
@ENABLE_COVERAGE_FALSE@clean-local:
|
||||
clean: clean-recursive
|
||||
|
||||
clean-am: clean-generic clean-libtool clean-local mostlyclean-am
|
||||
|
||||
distclean: distclean-recursive
|
||||
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
|
||||
-rm -f Makefile
|
||||
distclean-am: clean-am distclean-generic distclean-hdr \
|
||||
distclean-libtool distclean-tags
|
||||
|
||||
dvi: dvi-recursive
|
||||
|
||||
dvi-am:
|
||||
|
||||
html: html-recursive
|
||||
|
||||
html-am:
|
||||
|
||||
info: info-recursive
|
||||
|
||||
info-am:
|
||||
|
||||
install-data-am: install-pkgconfigDATA
|
||||
|
||||
install-dvi: install-dvi-recursive
|
||||
|
||||
install-dvi-am:
|
||||
|
||||
install-exec-am:
|
||||
|
||||
install-html: install-html-recursive
|
||||
|
||||
install-html-am:
|
||||
|
||||
install-info: install-info-recursive
|
||||
|
||||
install-info-am:
|
||||
|
||||
install-man:
|
||||
|
||||
install-pdf: install-pdf-recursive
|
||||
|
||||
install-pdf-am:
|
||||
|
||||
install-ps: install-ps-recursive
|
||||
|
||||
install-ps-am:
|
||||
|
||||
installcheck-am:
|
||||
|
||||
maintainer-clean: maintainer-clean-recursive
|
||||
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
|
||||
-rm -rf $(top_srcdir)/autom4te.cache
|
||||
-rm -f Makefile
|
||||
maintainer-clean-am: distclean-am maintainer-clean-generic
|
||||
|
||||
mostlyclean: mostlyclean-recursive
|
||||
|
||||
mostlyclean-am: mostlyclean-generic mostlyclean-libtool
|
||||
|
||||
pdf: pdf-recursive
|
||||
|
||||
pdf-am:
|
||||
|
||||
ps: ps-recursive
|
||||
|
||||
ps-am:
|
||||
|
||||
uninstall-am: uninstall-pkgconfigDATA
|
||||
|
||||
.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) all \
|
||||
ctags-recursive install-am install-strip tags-recursive
|
||||
|
||||
.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
|
||||
all all-am am--refresh check check-am clean clean-generic \
|
||||
clean-libtool clean-local ctags ctags-recursive dist dist-all \
|
||||
dist-bzip2 dist-gzip dist-hook dist-lzip dist-lzma dist-shar \
|
||||
dist-tarZ dist-xz dist-zip distcheck distclean \
|
||||
distclean-generic distclean-hdr distclean-libtool \
|
||||
distclean-tags distcleancheck distdir distuninstallcheck dvi \
|
||||
dvi-am html html-am info info-am install install-am \
|
||||
install-data install-data-am install-dvi install-dvi-am \
|
||||
install-exec install-exec-am install-html install-html-am \
|
||||
install-info install-info-am install-man install-pdf \
|
||||
install-pdf-am install-pkgconfigDATA install-ps install-ps-am \
|
||||
install-strip installcheck installcheck-am installdirs \
|
||||
installdirs-am maintainer-clean maintainer-clean-generic \
|
||||
mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \
|
||||
ps ps-am tags tags-recursive uninstall uninstall-am \
|
||||
uninstall-pkgconfigDATA
|
||||
|
||||
|
||||
dist-hook: audiofile.spec
|
||||
cp audiofile.spec $(distdir)
|
||||
|
||||
@ENABLE_COVERAGE_TRUE@coverage:
|
||||
@ENABLE_COVERAGE_TRUE@ $(MAKE) coverage-reset
|
||||
@ENABLE_COVERAGE_TRUE@ $(MAKE) check
|
||||
@ENABLE_COVERAGE_TRUE@ $(MAKE) coverage-report
|
||||
|
||||
@ENABLE_COVERAGE_TRUE@coverage-reset:
|
||||
@ENABLE_COVERAGE_TRUE@ $(LCOV) --base-directory=@top_srcdir@ --directory @top_srcdir@/libaudiofile --zerocounters
|
||||
|
||||
@ENABLE_COVERAGE_TRUE@coverage-report:
|
||||
@ENABLE_COVERAGE_TRUE@ $(LCOV) --directory @top_srcdir@/libaudiofile \
|
||||
@ENABLE_COVERAGE_TRUE@ --capture \
|
||||
@ENABLE_COVERAGE_TRUE@ --output-file @top_builddir@/lcov.info
|
||||
|
||||
@ENABLE_COVERAGE_TRUE@ $(LCOV) --directory @top_srcdir@/libaudiofile \
|
||||
@ENABLE_COVERAGE_TRUE@ --output-file @top_builddir@/lcov.info \
|
||||
@ENABLE_COVERAGE_TRUE@ --remove @top_builddir@/lcov.info \
|
||||
@ENABLE_COVERAGE_TRUE@ "/usr/include/*" "gtest/*" "*/UT_*"
|
||||
|
||||
@ENABLE_COVERAGE_TRUE@ $(mkdir_p) @top_builddir@/coverage
|
||||
@ENABLE_COVERAGE_TRUE@ git_commit=`GIT_DIR=@top_srcdir@/.git git log -1 --pretty=format:%h 2>/dev/null`; \
|
||||
@ENABLE_COVERAGE_TRUE@ $(GENHTML) --title "@PACKAGE@ @VERSION@ $$git_commit" \
|
||||
@ENABLE_COVERAGE_TRUE@ --output-directory @top_builddir@/coverage @top_builddir@/lcov.info
|
||||
@ENABLE_COVERAGE_TRUE@ @echo
|
||||
@ENABLE_COVERAGE_TRUE@ @echo 'lcov report can be found here:'
|
||||
@ENABLE_COVERAGE_TRUE@ @echo 'file://@abs_top_builddir@/coverage/index.html'
|
||||
@ENABLE_COVERAGE_TRUE@ @echo
|
||||
|
||||
@ENABLE_COVERAGE_TRUE@clean-local:
|
||||
@ENABLE_COVERAGE_TRUE@ -rm -rf coverage
|
||||
|
||||
@ENABLE_COVERAGE_TRUE@.PHONY: coverage-reset coverage coverage-report
|
||||
@ENABLE_COVERAGE_FALSE@coverage:
|
||||
@ENABLE_COVERAGE_FALSE@ @echo "Code coverage is not enabled."
|
||||
@ENABLE_COVERAGE_FALSE@ @exit 1
|
||||
|
||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||
.NOEXPORT:
|
|
@ -1,53 +0,0 @@
|
|||
Changes for Audio File Library version 0.3.6:
|
||||
|
||||
* Implement FLAC and ALAC encoding and decoding.
|
||||
* Update license to LGPL 2.1.
|
||||
|
||||
Changes for Audio File Library version 0.3.5:
|
||||
|
||||
* Implement IMA ADPCM encoding and decoding for AIFF-C, CAF, and WAVE files.
|
||||
* Implement Microsoft ADPCM encoding for WAVE files.
|
||||
* Fix calculation of IRCAM frame size.
|
||||
* Record marker comments in WAVE files.
|
||||
* Improve validation of compressed audio formats.
|
||||
* Add support for building without documentation.
|
||||
|
||||
Changes for Audio File Library version 0.3.4:
|
||||
|
||||
* Use hidden visibility for internal symbols.
|
||||
* Add support for Sample Vision format.
|
||||
* Update license for extended-precision floating-point conversion routines.
|
||||
|
||||
Changes for Audio File Library version 0.3.3:
|
||||
|
||||
* Update library's soname version.
|
||||
* Link against libm.
|
||||
|
||||
Changes for Audio File Library version 0.3.2:
|
||||
|
||||
* Fix initialization of byte order in Creative Voice File format.
|
||||
* Fix calculation of frame count in NIST SPHERE sound files.
|
||||
* Remove duplicate definition of AFvirtualfile.
|
||||
* Don't treat compiler warnings as errors by default.
|
||||
|
||||
Changes for Audio File Library version 0.3.1:
|
||||
|
||||
* Fix installation of man pages.
|
||||
* Add support for Creative Voice File format.
|
||||
* Support u-law and A-law compression in Core Audio Format files.
|
||||
|
||||
Changes for Audio File Library version 0.3.0:
|
||||
|
||||
* Define AFframecount and AFfileoffset as 64-bit integers regardless of
|
||||
whether system specifies off_t as 64 bits.
|
||||
* Added support for Core Audio Format.
|
||||
* Added support for extensible WAVE format files.
|
||||
* Fixed leak of miscellaneous data buffers. (Thanks to Stefano Magni
|
||||
for finding and fixing this problem.)
|
||||
* Fixed default mapping between integer and floating-point audio data.
|
||||
* Fix handling of NeXT sound files with unspecified or inconsistent length.
|
||||
* Added support for miscellaneous data in IFF/8SVX files.
|
||||
* Added support for byte-swapped IRCAM sound files.
|
||||
* Refactored file parsing and writing.
|
||||
* Refactored audio conversion.
|
||||
* Updated and expanded documentation.
|
|
@ -1,41 +0,0 @@
|
|||
Audio File Library 0.3.6
|
||||
Development Notes
|
||||
Michael Pruett <michael@68k.org>
|
||||
|
||||
----
|
||||
|
||||
Large file support is now enabled by default on all systems. This change
|
||||
has no effect on systems where off_t is always 64 bits (e.g. IRIX,
|
||||
FreeBSD, NetBSD, OpenBSD, Mac OS X).
|
||||
|
||||
Many compressed data formats are not supported. This is currently the
|
||||
most important issue to address.
|
||||
|
||||
Error handling is at the present quite robust, but more work can always
|
||||
be done in this area.
|
||||
|
||||
SGI's Audio File Library on IRIX implements the following formats which
|
||||
this version of the library does not:
|
||||
|
||||
MPEG1 audio bitstream
|
||||
Sound Designer II
|
||||
SoundFont2
|
||||
|
||||
I plan to implement some of these as time permits. Sound Designer
|
||||
II is out of the question because of its dependency upon Macintosh
|
||||
resource forks. Handling these files on Unix systems is simply not
|
||||
worth the effort.
|
||||
|
||||
----
|
||||
|
||||
This version of the Audio File Library has been tested under the following
|
||||
operating environments:
|
||||
|
||||
i686-pc-linux-gnu / Ubuntu 12.10 (gcc 4.7.2)
|
||||
x86_64-pc-linux-gnu / Ubuntu 12.10 (gcc 4.7.2)
|
||||
x86_64-pc-linux-gnu / Ubuntu 12.10 (clang 3.0)
|
||||
armv6l-raspberrypi-linux-gnueabihf / Raspbian Wheezy (gcc 4.6.3)
|
||||
i386-apple-darwin10.8.0 / Mac OS X 10.6.8 (gcc 4.2.1)
|
||||
x86_64-apple-darwin10.8.0 / Mac OS X 10.6.8 (gcc 4.2.1)
|
||||
i386-pc-freebsd9.1 / FreeBSD 9.1 (gcc 4.2.1)
|
||||
sparc64-sun-freebsd9.1 / FreeBSD 9.1 (gcc 4.2.1)
|
|
@ -1,64 +0,0 @@
|
|||
Audio File Library
|
||||
Version 0.3.6
|
||||
Wednesday, 6 March 2013
|
||||
|
||||
Copyright (C) 1998-2000, 2003-2004, 2010-2013 Michael Pruett
|
||||
Copyright (C) 2000-2001 Silicon Graphics, Inc.
|
||||
|
||||
michael@68k.org
|
||||
http://audiofile.68k.org/
|
||||
|
||||
----
|
||||
|
||||
The Audio File Library handles reading and writing audio files in many
|
||||
common formats.
|
||||
|
||||
Key goals of the Audio File Library are file format transparency and data
|
||||
format transparency. The same calls for opening a file, accessing and
|
||||
manipulating audio metadata (e.g. sample rate, sample format, textual
|
||||
information, MIDI parameters), and reading and writing sample data will
|
||||
work with any supported audio file format. Likewise, the format of the
|
||||
audio data presented to the application need not be tied to the format
|
||||
of the data contained in the file.
|
||||
|
||||
The following file formats are currently supported:
|
||||
* AIFF/AIFF-C
|
||||
* WAVE
|
||||
* NeXT .snd/Sun .au
|
||||
* Berkeley/IRCAM/CARL Sound File
|
||||
* Audio Visual Research
|
||||
* Amiga IFF/8SVX
|
||||
* Sample Vision
|
||||
* Creative Voice File
|
||||
* NIST SPHERE
|
||||
* Core Audio Format
|
||||
* FLAC
|
||||
|
||||
The following compression formats are currently supported:
|
||||
* G.711 mu-law and A-law
|
||||
* IMA ADPCM
|
||||
* Microsoft ADPCM
|
||||
* FLAC
|
||||
* Apple Lossless Audio Codec
|
||||
|
||||
The Audio File Library itself is available under the GNU Lesser General
|
||||
Public License, and the programs in this package are available under the
|
||||
GNU General Public License. The two licenses are included in the files
|
||||
COPYING and COPYING.GPL, respectively.
|
||||
|
||||
----
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the
|
||||
Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301 USA
|
|
@ -1,32 +0,0 @@
|
|||
Audio File Library
|
||||
To Do List
|
||||
|
||||
Michael Pruett <michael@68k.org>
|
||||
|
||||
Short-term
|
||||
----------
|
||||
|
||||
Handle more compressed data formats, most importantly Ogg Vorbis.
|
||||
GSM 06.10 would also be nice.
|
||||
|
||||
Handle sample rate conversion.
|
||||
|
||||
More comprehensive tests should be developed to stress-test the
|
||||
library. Tests are needed most for the following sets of functions:
|
||||
* af{Get,Set}VirtualChannels/afSetChannelMatrix
|
||||
* afGetSampleFormat/af{Get,Set}VirtualSampleFormat
|
||||
* af{Get,Set}Loop{IDs,Mode,Count,Start,End,StartFrame,EndFrame,Track}
|
||||
|
||||
Support for auxiliary data in IRCAM files (maximum amplitude, comments,
|
||||
etc.) should be added.
|
||||
|
||||
Long-term
|
||||
---------
|
||||
|
||||
It would be nice to support some more file formats.
|
||||
|
||||
Add locale support for error messages.
|
||||
|
||||
Whenever a compression format is requested, the library should scan
|
||||
through /usr/lib/audiofile/*.so to see if any DSOs support the requested
|
||||
format.
|
File diff suppressed because it is too large
Load Diff
|
@ -1,6 +0,0 @@
|
|||
Name: audiofile
|
||||
Description: audiofile
|
||||
Requires:
|
||||
Version: 0.3.6
|
||||
Libs: ${pc_top_builddir}/${pcfiledir}/libaudiofile/libaudiofile.la -lm
|
||||
Cflags: -I${pc_top_builddir}/${pcfiledir}/libaudiofile
|
|
@ -1,6 +0,0 @@
|
|||
Name: audiofile
|
||||
Description: audiofile
|
||||
Requires:
|
||||
Version: @VERSION@
|
||||
Libs: ${pc_top_builddir}/${pcfiledir}/libaudiofile/libaudiofile.la -lm
|
||||
Cflags: -I${pc_top_builddir}/${pcfiledir}/libaudiofile
|
|
@ -1,12 +0,0 @@
|
|||
prefix=/mingw64
|
||||
exec_prefix=${prefix}
|
||||
libdir=${exec_prefix}/lib
|
||||
includedir=${prefix}/include
|
||||
|
||||
Name: audiofile
|
||||
Description: audiofile
|
||||
Requires:
|
||||
Version: 0.3.6
|
||||
Libs: -L${libdir} -laudiofile
|
||||
Libs.private: -lm
|
||||
Cflags: -I${includedir}
|
|
@ -1,12 +0,0 @@
|
|||
prefix=@prefix@
|
||||
exec_prefix=@exec_prefix@
|
||||
libdir=@libdir@
|
||||
includedir=@includedir@
|
||||
|
||||
Name: audiofile
|
||||
Description: audiofile
|
||||
Requires:
|
||||
Version: @VERSION@
|
||||
Libs: -L${libdir} -laudiofile
|
||||
Libs.private: -lm
|
||||
Cflags: -I${includedir}
|
|
@ -1,69 +0,0 @@
|
|||
%define ver 0.3.6
|
||||
%define RELEASE 1
|
||||
%define rel %{?CUSTOM_RELEASE} %{!?CUSTOM_RELEASE:%RELEASE}
|
||||
%define prefix /usr
|
||||
|
||||
Summary: A library to handle various audio file formats.
|
||||
Name: audiofile
|
||||
Version: %ver
|
||||
Release: %rel
|
||||
Copyright: LGPL
|
||||
Group: Libraries/Sound
|
||||
Source: ftp://ftp.gnome.org/pub/GNOME/sources/audiofile/audiofile-%{PACKAGE_VERSION}.tar.gz
|
||||
URL: http://www.68k.org/~michael/audiofile/
|
||||
BuildRoot:/var/tmp/audiofile-%{PACKAGE_VERSION}-root
|
||||
Docdir: %{prefix}/doc
|
||||
Obsoletes: libaudiofile
|
||||
|
||||
%description
|
||||
The Audio File Library provides an elegant API for accessing a variety
|
||||
of audio file formats, such as AIFF/AIFF-C, WAVE, and NeXT/Sun
|
||||
.snd/.au, in a manner independent of file and data formats.
|
||||
|
||||
%package devel
|
||||
Summary: Library, headers, etc. to develop with the Audio File Library.
|
||||
Group: Libraries
|
||||
|
||||
%description devel
|
||||
Library, header files, etc. for developing applications with the Audio
|
||||
File Library.
|
||||
|
||||
%prep
|
||||
%setup
|
||||
|
||||
%build
|
||||
CFLAGS="$RPM_OPT_FLAGS" ./configure --prefix=%prefix
|
||||
make $MAKE_FLAGS
|
||||
|
||||
%install
|
||||
|
||||
rm -rf $RPM_BUILD_ROOT
|
||||
mkdir -p $RPM_BUILD_ROOT
|
||||
|
||||
#
|
||||
# makefile is broken, sets exec_prefix explicitely.
|
||||
#
|
||||
make exec_prefix=$RPM_BUILD_ROOT/%{prefix} prefix=$RPM_BUILD_ROOT/%{prefix} install
|
||||
|
||||
%clean
|
||||
rm -rf $RPM_BUILD_ROOT
|
||||
|
||||
%changelog
|
||||
|
||||
* Fri Nov 20 1998 Michael Fulbright <drmike@redhat.com>
|
||||
- First try at a spec file
|
||||
|
||||
%files
|
||||
%defattr(-, root, root)
|
||||
%doc COPYING TODO README ChangeLog docs
|
||||
%{prefix}/bin/*
|
||||
%{prefix}/lib/lib*.so.*
|
||||
|
||||
%files devel
|
||||
%defattr(-, root, root)
|
||||
%{prefix}/lib/lib*.so
|
||||
%{prefix}/lib/*.a
|
||||
%{prefix}/lib/*.la
|
||||
%{prefix}/lib/pkgconfig/*.pc
|
||||
%{prefix}/include/*
|
||||
%{prefix}/share/aclocal/*
|
|
@ -1,69 +0,0 @@
|
|||
%define ver @VERSION@
|
||||
%define RELEASE 1
|
||||
%define rel %{?CUSTOM_RELEASE} %{!?CUSTOM_RELEASE:%RELEASE}
|
||||
%define prefix /usr
|
||||
|
||||
Summary: A library to handle various audio file formats.
|
||||
Name: audiofile
|
||||
Version: %ver
|
||||
Release: %rel
|
||||
Copyright: LGPL
|
||||
Group: Libraries/Sound
|
||||
Source: ftp://ftp.gnome.org/pub/GNOME/sources/audiofile/audiofile-%{PACKAGE_VERSION}.tar.gz
|
||||
URL: http://www.68k.org/~michael/audiofile/
|
||||
BuildRoot:/var/tmp/audiofile-%{PACKAGE_VERSION}-root
|
||||
Docdir: %{prefix}/doc
|
||||
Obsoletes: libaudiofile
|
||||
|
||||
%description
|
||||
The Audio File Library provides an elegant API for accessing a variety
|
||||
of audio file formats, such as AIFF/AIFF-C, WAVE, and NeXT/Sun
|
||||
.snd/.au, in a manner independent of file and data formats.
|
||||
|
||||
%package devel
|
||||
Summary: Library, headers, etc. to develop with the Audio File Library.
|
||||
Group: Libraries
|
||||
|
||||
%description devel
|
||||
Library, header files, etc. for developing applications with the Audio
|
||||
File Library.
|
||||
|
||||
%prep
|
||||
%setup
|
||||
|
||||
%build
|
||||
CFLAGS="$RPM_OPT_FLAGS" ./configure --prefix=%prefix
|
||||
make $MAKE_FLAGS
|
||||
|
||||
%install
|
||||
|
||||
rm -rf $RPM_BUILD_ROOT
|
||||
mkdir -p $RPM_BUILD_ROOT
|
||||
|
||||
#
|
||||
# makefile is broken, sets exec_prefix explicitely.
|
||||
#
|
||||
make exec_prefix=$RPM_BUILD_ROOT/%{prefix} prefix=$RPM_BUILD_ROOT/%{prefix} install
|
||||
|
||||
%clean
|
||||
rm -rf $RPM_BUILD_ROOT
|
||||
|
||||
%changelog
|
||||
|
||||
* Fri Nov 20 1998 Michael Fulbright <drmike@redhat.com>
|
||||
- First try at a spec file
|
||||
|
||||
%files
|
||||
%defattr(-, root, root)
|
||||
%doc COPYING TODO README ChangeLog docs
|
||||
%{prefix}/bin/*
|
||||
%{prefix}/lib/lib*.so.*
|
||||
|
||||
%files devel
|
||||
%defattr(-, root, root)
|
||||
%{prefix}/lib/lib*.so
|
||||
%{prefix}/lib/*.a
|
||||
%{prefix}/lib/*.la
|
||||
%{prefix}/lib/pkgconfig/*.pc
|
||||
%{prefix}/include/*
|
||||
%{prefix}/share/aclocal/*
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -1,300 +0,0 @@
|
|||
# This file was generated.
|
||||
# It contains the lists of macros which have been traced.
|
||||
# It can be safely removed.
|
||||
|
||||
@request = (
|
||||
bless( [
|
||||
'0',
|
||||
1,
|
||||
[
|
||||
'/usr/share/autoconf'
|
||||
],
|
||||
[
|
||||
'/usr/share/autoconf/autoconf/autoconf.m4f',
|
||||
'aclocal.m4',
|
||||
'configure.ac'
|
||||
],
|
||||
{
|
||||
'AM_MAINTAINER_MODE' => 1,
|
||||
'AC_CANONICAL_TARGET' => 1,
|
||||
'm4_pattern_allow' => 1,
|
||||
'AM_PROG_FC_C_O' => 1,
|
||||
'include' => 1,
|
||||
'AC_CANONICAL_SYSTEM' => 1,
|
||||
'AH_OUTPUT' => 1,
|
||||
'AC_REQUIRE_AUX_FILE' => 1,
|
||||
'AM_SILENT_RULES' => 1,
|
||||
'AC_CANONICAL_BUILD' => 1,
|
||||
'AC_INIT' => 1,
|
||||
'_AM_SUBST_NOTMAKE' => 1,
|
||||
'AC_CONFIG_SUBDIRS' => 1,
|
||||
'AM_PROG_F77_C_O' => 1,
|
||||
'm4_pattern_forbid' => 1,
|
||||
'LT_INIT' => 1,
|
||||
'AM_PROG_AR' => 1,
|
||||
'_AM_COND_ENDIF' => 1,
|
||||
'AC_CONFIG_LINKS' => 1,
|
||||
'AC_SUBST_TRACE' => 1,
|
||||
'AC_FC_PP_DEFINE' => 1,
|
||||
'_AM_COND_IF' => 1,
|
||||
'AM_NLS' => 1,
|
||||
'LT_SUPPORTED_TAG' => 1,
|
||||
'AM_POT_TOOLS' => 1,
|
||||
'sinclude' => 1,
|
||||
'AC_DEFINE_TRACE_LITERAL' => 1,
|
||||
'AM_PROG_CC_C_O' => 1,
|
||||
'LT_CONFIG_LTDL_DIR' => 1,
|
||||
'_AM_COND_ELSE' => 1,
|
||||
'AM_CONDITIONAL' => 1,
|
||||
'_m4_warn' => 1,
|
||||
'AM_INIT_AUTOMAKE' => 1,
|
||||
'AC_SUBST' => 1,
|
||||
'AM_PROG_MOC' => 1,
|
||||
'AM_GNU_GETTEXT' => 1,
|
||||
'AC_FC_SRCEXT' => 1,
|
||||
'AM_XGETTEXT_OPTION' => 1,
|
||||
'AC_FC_FREEFORM' => 1,
|
||||
'AC_FC_PP_SRCEXT' => 1,
|
||||
'AM_GNU_GETTEXT_INTL_SUBDIR' => 1,
|
||||
'AC_PROG_LIBTOOL' => 1,
|
||||
'AM_PATH_GUILE' => 1,
|
||||
'AC_CONFIG_LIBOBJ_DIR' => 1,
|
||||
'AC_CONFIG_FILES' => 1,
|
||||
'AM_ENABLE_MULTILIB' => 1,
|
||||
'_AM_MAKEFILE_INCLUDE' => 1,
|
||||
'm4_sinclude' => 1,
|
||||
'AC_CANONICAL_HOST' => 1,
|
||||
'm4_include' => 1,
|
||||
'AM_PROG_CXX_C_O' => 1,
|
||||
'AC_CONFIG_HEADERS' => 1,
|
||||
'AC_CONFIG_AUX_DIR' => 1,
|
||||
'AM_AUTOMAKE_VERSION' => 1,
|
||||
'_LT_AC_TAGCONFIG' => 1,
|
||||
'AC_LIBSOURCE' => 1,
|
||||
'AM_MAKEFILE_INCLUDE' => 1
|
||||
}
|
||||
], 'Autom4te::Request' ),
|
||||
bless( [
|
||||
'1',
|
||||
1,
|
||||
[
|
||||
'/usr/share/autoconf'
|
||||
],
|
||||
[
|
||||
'/usr/share/autoconf/autoconf/autoconf.m4f',
|
||||
'/usr/share/aclocal/libtool.m4',
|
||||
'/usr/share/aclocal/ltargz.m4',
|
||||
'/usr/share/aclocal/ltdl.m4',
|
||||
'/usr/share/aclocal/ltoptions.m4',
|
||||
'/usr/share/aclocal/ltsugar.m4',
|
||||
'/usr/share/aclocal/ltversion.m4',
|
||||
'/usr/share/aclocal/lt~obsolete.m4',
|
||||
'/mingw64/share/aclocal/pkg.m4',
|
||||
'/usr/share/aclocal-1.11/amversion.m4',
|
||||
'/usr/share/aclocal-1.11/auxdir.m4',
|
||||
'/usr/share/aclocal-1.11/cond.m4',
|
||||
'/usr/share/aclocal-1.11/depend.m4',
|
||||
'/usr/share/aclocal-1.11/depout.m4',
|
||||
'/usr/share/aclocal-1.11/init.m4',
|
||||
'/usr/share/aclocal-1.11/install-sh.m4',
|
||||
'/usr/share/aclocal-1.11/lead-dot.m4',
|
||||
'/usr/share/aclocal-1.11/make.m4',
|
||||
'/usr/share/aclocal-1.11/missing.m4',
|
||||
'/usr/share/aclocal-1.11/mkdirp.m4',
|
||||
'/usr/share/aclocal-1.11/options.m4',
|
||||
'/usr/share/aclocal-1.11/runlog.m4',
|
||||
'/usr/share/aclocal-1.11/sanity.m4',
|
||||
'/usr/share/aclocal-1.11/silent.m4',
|
||||
'/usr/share/aclocal-1.11/strip.m4',
|
||||
'/usr/share/aclocal-1.11/substnot.m4',
|
||||
'/usr/share/aclocal-1.11/tar.m4',
|
||||
'configure.ac'
|
||||
],
|
||||
{
|
||||
'AC_LTDL_SYMBOL_USCORE' => 1,
|
||||
'AC_LIBTOOL_CXX' => 1,
|
||||
'_LT_AC_LANG_F77' => 1,
|
||||
'LT_FUNC_ARGZ' => 1,
|
||||
'LTDL_CONVENIENCE' => 1,
|
||||
'AC_LIBTOOL_LINKER_OPTION' => 1,
|
||||
'AC_LIBTOOL_F77' => 1,
|
||||
'AC_LTDL_DLLIB' => 1,
|
||||
'_LT_WITH_SYSROOT' => 1,
|
||||
'_LT_AC_LANG_C_CONFIG' => 1,
|
||||
'AM_PROG_NM' => 1,
|
||||
'AC_PROG_NM' => 1,
|
||||
'LT_OUTPUT' => 1,
|
||||
'_AM_MANGLE_OPTION' => 1,
|
||||
'_LTDL_SETUP' => 1,
|
||||
'PKG_INSTALLDIR' => 1,
|
||||
'_AM_IF_OPTION' => 1,
|
||||
'LT_PROG_GCJ' => 1,
|
||||
'LTSUGAR_VERSION' => 1,
|
||||
'LT_SYS_DLOPEN_SELF' => 1,
|
||||
'AM_ENABLE_STATIC' => 1,
|
||||
'AC_ENABLE_STATIC' => 1,
|
||||
'_AM_DEPENDENCIES' => 1,
|
||||
'_AM_SET_OPTIONS' => 1,
|
||||
'AC_LIBTOOL_SYS_LIB_STRIP' => 1,
|
||||
'PKG_CHECK_VAR' => 1,
|
||||
'AC_LTDL_ENABLE_INSTALL' => 1,
|
||||
'AM_AUTOMAKE_VERSION' => 1,
|
||||
'AC_PROG_LD_GNU' => 1,
|
||||
'_LT_LINKER_BOILERPLATE' => 1,
|
||||
'AM_SUBST_NOTMAKE' => 1,
|
||||
'LT_LIB_M' => 1,
|
||||
'_AC_AM_CONFIG_HEADER_HOOK' => 1,
|
||||
'PKG_NOARCH_INSTALLDIR' => 1,
|
||||
'LT_PATH_NM' => 1,
|
||||
'AC_PATH_MAGIC' => 1,
|
||||
'AC_LIBTOOL_GCJ' => 1,
|
||||
'_LT_DLL_DEF_P' => 1,
|
||||
'AC_LIBTOOL_SYS_OLD_ARCHIVE' => 1,
|
||||
'AM_MISSING_HAS_RUN' => 1,
|
||||
'AC_LIBTOOL_RC' => 1,
|
||||
'_LT_PROG_CXX' => 1,
|
||||
'_AM_PROG_TAR' => 1,
|
||||
'AC_LIB_LTDL' => 1,
|
||||
'_AM_SUBST_NOTMAKE' => 1,
|
||||
'm4_pattern_allow' => 1,
|
||||
'LTOPTIONS_VERSION' => 1,
|
||||
'include' => 1,
|
||||
'AC_LIBTOOL_SYS_DYNAMIC_LINKER' => 1,
|
||||
'AC_CHECK_LIBM' => 1,
|
||||
'LT_SUPPORTED_TAG' => 1,
|
||||
'AC_LTDL_SYS_DLOPEN_DEPLIBS' => 1,
|
||||
'AC_LIBTOOL_LANG_GCJ_CONFIG' => 1,
|
||||
'm4_pattern_forbid' => 1,
|
||||
'_LT_AC_FILE_LTDLL_C' => 1,
|
||||
'AM_DEP_TRACK' => 1,
|
||||
'AC_LIBTOOL_PROG_LD_SHLIBS' => 1,
|
||||
'AC_LIBTOOL_PROG_CC_C_O' => 1,
|
||||
'LTOBSOLETE_VERSION' => 1,
|
||||
'LT_AC_PROG_SED' => 1,
|
||||
'_LT_COMPILER_OPTION' => 1,
|
||||
'AM_CONDITIONAL' => 1,
|
||||
'LT_PROG_RC' => 1,
|
||||
'_LT_AC_TAGVAR' => 1,
|
||||
'LT_FUNC_DLSYM_USCORE' => 1,
|
||||
'_LT_PATH_TOOL_PREFIX' => 1,
|
||||
'LT_SYS_DLOPEN_DEPLIBS' => 1,
|
||||
'AC_LIBTOOL_OBJDIR' => 1,
|
||||
'_LT_PROG_F77' => 1,
|
||||
'AM_INIT_AUTOMAKE' => 1,
|
||||
'm4_include' => 1,
|
||||
'_LT_AC_LANG_CXX_CONFIG' => 1,
|
||||
'AM_OUTPUT_DEPENDENCY_COMMANDS' => 1,
|
||||
'LT_SYS_MODULE_EXT' => 1,
|
||||
'_LT_AC_TAGCONFIG' => 1,
|
||||
'AC_LIBTOOL_COMPILER_OPTION' => 1,
|
||||
'LT_SYS_MODULE_PATH' => 1,
|
||||
'_LT_AC_LANG_GCJ' => 1,
|
||||
'AM_PROG_INSTALL_SH' => 1,
|
||||
'LTDL_INSTALLABLE' => 1,
|
||||
'LTVERSION_VERSION' => 1,
|
||||
'AM_PROG_LD' => 1,
|
||||
'AC_PROG_LD' => 1,
|
||||
'AC_LTDL_SHLIBEXT' => 1,
|
||||
'AC_LIBTOOL_DLOPEN_SELF' => 1,
|
||||
'AC_LIBLTDL_INSTALLABLE' => 1,
|
||||
'_LT_AC_LOCK' => 1,
|
||||
'AC_LTDL_DLSYM_USCORE' => 1,
|
||||
'AM_SILENT_RULES' => 1,
|
||||
'AM_DISABLE_STATIC' => 1,
|
||||
'AC_DISABLE_STATIC' => 1,
|
||||
'AM_ENABLE_SHARED' => 1,
|
||||
'_AM_SET_OPTION' => 1,
|
||||
'AC_LIBTOOL_POSTDEP_PREDEP' => 1,
|
||||
'AC_ENABLE_SHARED' => 1,
|
||||
'_LT_AC_TRY_DLOPEN_SELF' => 1,
|
||||
'AC_LIBLTDL_CONVENIENCE' => 1,
|
||||
'AU_DEFUN' => 1,
|
||||
'AC_LIBTOOL_SYS_HARD_LINK_LOCKS' => 1,
|
||||
'AC_LIBTOOL_PROG_COMPILER_PIC' => 1,
|
||||
'_LT_REQUIRED_DARWIN_CHECKS' => 1,
|
||||
'AC_LTDL_PREOPEN' => 1,
|
||||
'LT_AC_PROG_RC' => 1,
|
||||
'_AC_PROG_LIBTOOL' => 1,
|
||||
'LT_AC_PROG_GCJ' => 1,
|
||||
'AC_LIBTOOL_WIN32_DLL' => 1,
|
||||
'AM_RUN_LOG' => 1,
|
||||
'AM_DISABLE_SHARED' => 1,
|
||||
'AM_SET_LEADING_DOT' => 1,
|
||||
'LT_LIB_DLLOAD' => 1,
|
||||
'AC_DISABLE_SHARED' => 1,
|
||||
'_LT_AC_LANG_RC_CONFIG' => 1,
|
||||
'_LT_PROG_ECHO_BACKSLASH' => 1,
|
||||
'LT_CONFIG_LTDL_DIR' => 1,
|
||||
'LT_PATH_LD' => 1,
|
||||
'LT_LANG' => 1,
|
||||
'_LT_PROG_FC' => 1,
|
||||
'PKG_PROG_PKG_CONFIG' => 1,
|
||||
'AM_SET_DEPDIR' => 1,
|
||||
'AC_LIBTOOL_LANG_CXX_CONFIG' => 1,
|
||||
'_m4_warn' => 1,
|
||||
'_LT_AC_LANG_F77_CONFIG' => 1,
|
||||
'LTDL_INIT' => 1,
|
||||
'AC_LTDL_SHLIBPATH' => 1,
|
||||
'AM_PROG_INSTALL_STRIP' => 1,
|
||||
'AM_PROG_MKDIR_P' => 1,
|
||||
'_AM_AUTOCONF_VERSION' => 1,
|
||||
'AC_LIBTOOL_LANG_C_CONFIG' => 1,
|
||||
'_LT_AC_SHELL_INIT' => 1,
|
||||
'PKG_CHECK_MODULES_STATIC' => 1,
|
||||
'AC_LTDL_OBJDIR' => 1,
|
||||
'AC_DEPLIBS_CHECK_METHOD' => 1,
|
||||
'_LT_AC_PROG_ECHO_BACKSLASH' => 1,
|
||||
'_LT_PREPARE_SED_QUOTE_VARS' => 1,
|
||||
'_LT_COMPILER_BOILERPLATE' => 1,
|
||||
'AC_PROG_EGREP' => 1,
|
||||
'AM_AUX_DIR_EXPAND' => 1,
|
||||
'AC_LTDL_SYSSEARCHPATH' => 1,
|
||||
'_LT_LINKER_OPTION' => 1,
|
||||
'_LT_LIBOBJ' => 1,
|
||||
'LT_PROG_GO' => 1,
|
||||
'LT_AC_PROG_EGREP' => 1,
|
||||
'PKG_CHECK_EXISTS' => 1,
|
||||
'_LT_PROG_LTMAIN' => 1,
|
||||
'AC_LIBTOOL_DLOPEN' => 1,
|
||||
'AM_MISSING_PROG' => 1,
|
||||
'_LT_AC_LANG_GCJ_CONFIG' => 1,
|
||||
'_LT_AC_SYS_COMPILER' => 1,
|
||||
'AC_LIBTOOL_PICMODE' => 1,
|
||||
'_LT_AC_CHECK_DLFCN' => 1,
|
||||
'AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH' => 1,
|
||||
'LT_INIT' => 1,
|
||||
'_LT_AC_LANG_CXX' => 1,
|
||||
'AM_SET_CURRENT_AUTOMAKE_VERSION' => 1,
|
||||
'LT_SYS_DLSEARCH_PATH' => 1,
|
||||
'AC_DISABLE_FAST_INSTALL' => 1,
|
||||
'AC_LIBTOOL_LANG_RC_CONFIG' => 1,
|
||||
'AM_SANITY_CHECK' => 1,
|
||||
'AC_WITH_LTDL' => 1,
|
||||
'AC_PROG_LIBTOOL' => 1,
|
||||
'AM_PROG_LIBTOOL' => 1,
|
||||
'AC_LIBTOOL_PROG_COMPILER_NO_RTTI' => 1,
|
||||
'AM_MAKE_INCLUDE' => 1,
|
||||
'PKG_CHECK_MODULES' => 1,
|
||||
'AC_PATH_TOOL_PREFIX' => 1,
|
||||
'AC_DEFUN_ONCE' => 1,
|
||||
'_LT_AC_PROG_CXXCPP' => 1,
|
||||
'AC_LIBTOOL_CONFIG' => 1,
|
||||
'AC_LIBTOOL_SETUP' => 1,
|
||||
'LT_CMD_MAX_LEN' => 1,
|
||||
'_PKG_SHORT_ERRORS_SUPPORTED' => 1,
|
||||
'_LT_AC_SYS_LIBPATH_AIX' => 1,
|
||||
'AC_PROG_LD_RELOAD_FLAG' => 1,
|
||||
'AC_LIBTOOL_SYS_MAX_CMD_LEN' => 1,
|
||||
'AC_LIBTOOL_LANG_F77_CONFIG' => 1,
|
||||
'LT_SYS_SYMBOL_USCORE' => 1,
|
||||
'AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE' => 1,
|
||||
'AC_LIBTOOL_FC' => 1,
|
||||
'AC_DEFUN' => 1,
|
||||
'AC_ENABLE_FAST_INSTALL' => 1,
|
||||
'_AM_OUTPUT_DEPENDENCY_COMMANDS' => 1,
|
||||
'LT_WITH_LTDL' => 1,
|
||||
'_LT_CC_BASENAME' => 1
|
||||
}
|
||||
], 'Autom4te::Request' )
|
||||
);
|
||||
|
|
@ -1,728 +0,0 @@
|
|||
m4trace:configure.ac:2: -1- AC_INIT([audiofile], [0.3.6])
|
||||
m4trace:configure.ac:2: -1- m4_pattern_forbid([^_?A[CHUM]_])
|
||||
m4trace:configure.ac:2: -1- m4_pattern_forbid([_AC_])
|
||||
m4trace:configure.ac:2: -1- m4_pattern_forbid([^LIBOBJS$], [do not use LIBOBJS directly, use AC_LIBOBJ (see section `AC_LIBOBJ vs LIBOBJS'])
|
||||
m4trace:configure.ac:2: -1- m4_pattern_allow([^AS_FLAGS$])
|
||||
m4trace:configure.ac:2: -1- m4_pattern_forbid([^_?m4_])
|
||||
m4trace:configure.ac:2: -1- m4_pattern_forbid([^dnl$])
|
||||
m4trace:configure.ac:2: -1- m4_pattern_forbid([^_?AS_])
|
||||
m4trace:configure.ac:2: -1- AC_SUBST([SHELL])
|
||||
m4trace:configure.ac:2: -1- AC_SUBST_TRACE([SHELL])
|
||||
m4trace:configure.ac:2: -1- m4_pattern_allow([^SHELL$])
|
||||
m4trace:configure.ac:2: -1- AC_SUBST([PATH_SEPARATOR])
|
||||
m4trace:configure.ac:2: -1- AC_SUBST_TRACE([PATH_SEPARATOR])
|
||||
m4trace:configure.ac:2: -1- m4_pattern_allow([^PATH_SEPARATOR$])
|
||||
m4trace:configure.ac:2: -1- AC_SUBST([PACKAGE_NAME], [m4_ifdef([AC_PACKAGE_NAME], ['AC_PACKAGE_NAME'])])
|
||||
m4trace:configure.ac:2: -1- AC_SUBST_TRACE([PACKAGE_NAME])
|
||||
m4trace:configure.ac:2: -1- m4_pattern_allow([^PACKAGE_NAME$])
|
||||
m4trace:configure.ac:2: -1- AC_SUBST([PACKAGE_TARNAME], [m4_ifdef([AC_PACKAGE_TARNAME], ['AC_PACKAGE_TARNAME'])])
|
||||
m4trace:configure.ac:2: -1- AC_SUBST_TRACE([PACKAGE_TARNAME])
|
||||
m4trace:configure.ac:2: -1- m4_pattern_allow([^PACKAGE_TARNAME$])
|
||||
m4trace:configure.ac:2: -1- AC_SUBST([PACKAGE_VERSION], [m4_ifdef([AC_PACKAGE_VERSION], ['AC_PACKAGE_VERSION'])])
|
||||
m4trace:configure.ac:2: -1- AC_SUBST_TRACE([PACKAGE_VERSION])
|
||||
m4trace:configure.ac:2: -1- m4_pattern_allow([^PACKAGE_VERSION$])
|
||||
m4trace:configure.ac:2: -1- AC_SUBST([PACKAGE_STRING], [m4_ifdef([AC_PACKAGE_STRING], ['AC_PACKAGE_STRING'])])
|
||||
m4trace:configure.ac:2: -1- AC_SUBST_TRACE([PACKAGE_STRING])
|
||||
m4trace:configure.ac:2: -1- m4_pattern_allow([^PACKAGE_STRING$])
|
||||
m4trace:configure.ac:2: -1- AC_SUBST([PACKAGE_BUGREPORT], [m4_ifdef([AC_PACKAGE_BUGREPORT], ['AC_PACKAGE_BUGREPORT'])])
|
||||
m4trace:configure.ac:2: -1- AC_SUBST_TRACE([PACKAGE_BUGREPORT])
|
||||
m4trace:configure.ac:2: -1- m4_pattern_allow([^PACKAGE_BUGREPORT$])
|
||||
m4trace:configure.ac:2: -1- AC_SUBST([PACKAGE_URL], [m4_ifdef([AC_PACKAGE_URL], ['AC_PACKAGE_URL'])])
|
||||
m4trace:configure.ac:2: -1- AC_SUBST_TRACE([PACKAGE_URL])
|
||||
m4trace:configure.ac:2: -1- m4_pattern_allow([^PACKAGE_URL$])
|
||||
m4trace:configure.ac:2: -1- AC_SUBST([exec_prefix], [NONE])
|
||||
m4trace:configure.ac:2: -1- AC_SUBST_TRACE([exec_prefix])
|
||||
m4trace:configure.ac:2: -1- m4_pattern_allow([^exec_prefix$])
|
||||
m4trace:configure.ac:2: -1- AC_SUBST([prefix], [NONE])
|
||||
m4trace:configure.ac:2: -1- AC_SUBST_TRACE([prefix])
|
||||
m4trace:configure.ac:2: -1- m4_pattern_allow([^prefix$])
|
||||
m4trace:configure.ac:2: -1- AC_SUBST([program_transform_name], [s,x,x,])
|
||||
m4trace:configure.ac:2: -1- AC_SUBST_TRACE([program_transform_name])
|
||||
m4trace:configure.ac:2: -1- m4_pattern_allow([^program_transform_name$])
|
||||
m4trace:configure.ac:2: -1- AC_SUBST([bindir], ['${exec_prefix}/bin'])
|
||||
m4trace:configure.ac:2: -1- AC_SUBST_TRACE([bindir])
|
||||
m4trace:configure.ac:2: -1- m4_pattern_allow([^bindir$])
|
||||
m4trace:configure.ac:2: -1- AC_SUBST([sbindir], ['${exec_prefix}/sbin'])
|
||||
m4trace:configure.ac:2: -1- AC_SUBST_TRACE([sbindir])
|
||||
m4trace:configure.ac:2: -1- m4_pattern_allow([^sbindir$])
|
||||
m4trace:configure.ac:2: -1- AC_SUBST([libexecdir], ['${exec_prefix}/libexec'])
|
||||
m4trace:configure.ac:2: -1- AC_SUBST_TRACE([libexecdir])
|
||||
m4trace:configure.ac:2: -1- m4_pattern_allow([^libexecdir$])
|
||||
m4trace:configure.ac:2: -1- AC_SUBST([datarootdir], ['${prefix}/share'])
|
||||
m4trace:configure.ac:2: -1- AC_SUBST_TRACE([datarootdir])
|
||||
m4trace:configure.ac:2: -1- m4_pattern_allow([^datarootdir$])
|
||||
m4trace:configure.ac:2: -1- AC_SUBST([datadir], ['${datarootdir}'])
|
||||
m4trace:configure.ac:2: -1- AC_SUBST_TRACE([datadir])
|
||||
m4trace:configure.ac:2: -1- m4_pattern_allow([^datadir$])
|
||||
m4trace:configure.ac:2: -1- AC_SUBST([sysconfdir], ['${prefix}/etc'])
|
||||
m4trace:configure.ac:2: -1- AC_SUBST_TRACE([sysconfdir])
|
||||
m4trace:configure.ac:2: -1- m4_pattern_allow([^sysconfdir$])
|
||||
m4trace:configure.ac:2: -1- AC_SUBST([sharedstatedir], ['${prefix}/com'])
|
||||
m4trace:configure.ac:2: -1- AC_SUBST_TRACE([sharedstatedir])
|
||||
m4trace:configure.ac:2: -1- m4_pattern_allow([^sharedstatedir$])
|
||||
m4trace:configure.ac:2: -1- AC_SUBST([localstatedir], ['${prefix}/var'])
|
||||
m4trace:configure.ac:2: -1- AC_SUBST_TRACE([localstatedir])
|
||||
m4trace:configure.ac:2: -1- m4_pattern_allow([^localstatedir$])
|
||||
m4trace:configure.ac:2: -1- AC_SUBST([includedir], ['${prefix}/include'])
|
||||
m4trace:configure.ac:2: -1- AC_SUBST_TRACE([includedir])
|
||||
m4trace:configure.ac:2: -1- m4_pattern_allow([^includedir$])
|
||||
m4trace:configure.ac:2: -1- AC_SUBST([oldincludedir], ['/usr/include'])
|
||||
m4trace:configure.ac:2: -1- AC_SUBST_TRACE([oldincludedir])
|
||||
m4trace:configure.ac:2: -1- m4_pattern_allow([^oldincludedir$])
|
||||
m4trace:configure.ac:2: -1- AC_SUBST([docdir], [m4_ifset([AC_PACKAGE_TARNAME],
|
||||
['${datarootdir}/doc/${PACKAGE_TARNAME}'],
|
||||
['${datarootdir}/doc/${PACKAGE}'])])
|
||||
m4trace:configure.ac:2: -1- AC_SUBST_TRACE([docdir])
|
||||
m4trace:configure.ac:2: -1- m4_pattern_allow([^docdir$])
|
||||
m4trace:configure.ac:2: -1- AC_SUBST([infodir], ['${datarootdir}/info'])
|
||||
m4trace:configure.ac:2: -1- AC_SUBST_TRACE([infodir])
|
||||
m4trace:configure.ac:2: -1- m4_pattern_allow([^infodir$])
|
||||
m4trace:configure.ac:2: -1- AC_SUBST([htmldir], ['${docdir}'])
|
||||
m4trace:configure.ac:2: -1- AC_SUBST_TRACE([htmldir])
|
||||
m4trace:configure.ac:2: -1- m4_pattern_allow([^htmldir$])
|
||||
m4trace:configure.ac:2: -1- AC_SUBST([dvidir], ['${docdir}'])
|
||||
m4trace:configure.ac:2: -1- AC_SUBST_TRACE([dvidir])
|
||||
m4trace:configure.ac:2: -1- m4_pattern_allow([^dvidir$])
|
||||
m4trace:configure.ac:2: -1- AC_SUBST([pdfdir], ['${docdir}'])
|
||||
m4trace:configure.ac:2: -1- AC_SUBST_TRACE([pdfdir])
|
||||
m4trace:configure.ac:2: -1- m4_pattern_allow([^pdfdir$])
|
||||
m4trace:configure.ac:2: -1- AC_SUBST([psdir], ['${docdir}'])
|
||||
m4trace:configure.ac:2: -1- AC_SUBST_TRACE([psdir])
|
||||
m4trace:configure.ac:2: -1- m4_pattern_allow([^psdir$])
|
||||
m4trace:configure.ac:2: -1- AC_SUBST([libdir], ['${exec_prefix}/lib'])
|
||||
m4trace:configure.ac:2: -1- AC_SUBST_TRACE([libdir])
|
||||
m4trace:configure.ac:2: -1- m4_pattern_allow([^libdir$])
|
||||
m4trace:configure.ac:2: -1- AC_SUBST([localedir], ['${datarootdir}/locale'])
|
||||
m4trace:configure.ac:2: -1- AC_SUBST_TRACE([localedir])
|
||||
m4trace:configure.ac:2: -1- m4_pattern_allow([^localedir$])
|
||||
m4trace:configure.ac:2: -1- AC_SUBST([mandir], ['${datarootdir}/man'])
|
||||
m4trace:configure.ac:2: -1- AC_SUBST_TRACE([mandir])
|
||||
m4trace:configure.ac:2: -1- m4_pattern_allow([^mandir$])
|
||||
m4trace:configure.ac:2: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_NAME])
|
||||
m4trace:configure.ac:2: -1- m4_pattern_allow([^PACKAGE_NAME$])
|
||||
m4trace:configure.ac:2: -1- AH_OUTPUT([PACKAGE_NAME], [/* Define to the full name of this package. */
|
||||
@%:@undef PACKAGE_NAME])
|
||||
m4trace:configure.ac:2: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_TARNAME])
|
||||
m4trace:configure.ac:2: -1- m4_pattern_allow([^PACKAGE_TARNAME$])
|
||||
m4trace:configure.ac:2: -1- AH_OUTPUT([PACKAGE_TARNAME], [/* Define to the one symbol short name of this package. */
|
||||
@%:@undef PACKAGE_TARNAME])
|
||||
m4trace:configure.ac:2: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_VERSION])
|
||||
m4trace:configure.ac:2: -1- m4_pattern_allow([^PACKAGE_VERSION$])
|
||||
m4trace:configure.ac:2: -1- AH_OUTPUT([PACKAGE_VERSION], [/* Define to the version of this package. */
|
||||
@%:@undef PACKAGE_VERSION])
|
||||
m4trace:configure.ac:2: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_STRING])
|
||||
m4trace:configure.ac:2: -1- m4_pattern_allow([^PACKAGE_STRING$])
|
||||
m4trace:configure.ac:2: -1- AH_OUTPUT([PACKAGE_STRING], [/* Define to the full name and version of this package. */
|
||||
@%:@undef PACKAGE_STRING])
|
||||
m4trace:configure.ac:2: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_BUGREPORT])
|
||||
m4trace:configure.ac:2: -1- m4_pattern_allow([^PACKAGE_BUGREPORT$])
|
||||
m4trace:configure.ac:2: -1- AH_OUTPUT([PACKAGE_BUGREPORT], [/* Define to the address where bug reports for this package should be sent. */
|
||||
@%:@undef PACKAGE_BUGREPORT])
|
||||
m4trace:configure.ac:2: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_URL])
|
||||
m4trace:configure.ac:2: -1- m4_pattern_allow([^PACKAGE_URL$])
|
||||
m4trace:configure.ac:2: -1- AH_OUTPUT([PACKAGE_URL], [/* Define to the home page for this package. */
|
||||
@%:@undef PACKAGE_URL])
|
||||
m4trace:configure.ac:2: -1- AC_SUBST([DEFS])
|
||||
m4trace:configure.ac:2: -1- AC_SUBST_TRACE([DEFS])
|
||||
m4trace:configure.ac:2: -1- m4_pattern_allow([^DEFS$])
|
||||
m4trace:configure.ac:2: -1- AC_SUBST([ECHO_C])
|
||||
m4trace:configure.ac:2: -1- AC_SUBST_TRACE([ECHO_C])
|
||||
m4trace:configure.ac:2: -1- m4_pattern_allow([^ECHO_C$])
|
||||
m4trace:configure.ac:2: -1- AC_SUBST([ECHO_N])
|
||||
m4trace:configure.ac:2: -1- AC_SUBST_TRACE([ECHO_N])
|
||||
m4trace:configure.ac:2: -1- m4_pattern_allow([^ECHO_N$])
|
||||
m4trace:configure.ac:2: -1- AC_SUBST([ECHO_T])
|
||||
m4trace:configure.ac:2: -1- AC_SUBST_TRACE([ECHO_T])
|
||||
m4trace:configure.ac:2: -1- m4_pattern_allow([^ECHO_T$])
|
||||
m4trace:configure.ac:2: -1- AC_SUBST([LIBS])
|
||||
m4trace:configure.ac:2: -1- AC_SUBST_TRACE([LIBS])
|
||||
m4trace:configure.ac:2: -1- m4_pattern_allow([^LIBS$])
|
||||
m4trace:configure.ac:2: -1- AC_SUBST([build_alias])
|
||||
m4trace:configure.ac:2: -1- AC_SUBST_TRACE([build_alias])
|
||||
m4trace:configure.ac:2: -1- m4_pattern_allow([^build_alias$])
|
||||
m4trace:configure.ac:2: -1- AC_SUBST([host_alias])
|
||||
m4trace:configure.ac:2: -1- AC_SUBST_TRACE([host_alias])
|
||||
m4trace:configure.ac:2: -1- m4_pattern_allow([^host_alias$])
|
||||
m4trace:configure.ac:2: -1- AC_SUBST([target_alias])
|
||||
m4trace:configure.ac:2: -1- AC_SUBST_TRACE([target_alias])
|
||||
m4trace:configure.ac:2: -1- m4_pattern_allow([^target_alias$])
|
||||
m4trace:configure.ac:9: -1- AC_SUBST([AUDIOFILE_VERSION])
|
||||
m4trace:configure.ac:9: -1- AC_SUBST_TRACE([AUDIOFILE_VERSION])
|
||||
m4trace:configure.ac:9: -1- m4_pattern_allow([^AUDIOFILE_VERSION$])
|
||||
m4trace:configure.ac:10: -1- AC_SUBST([AUDIOFILE_VERSION_INFO])
|
||||
m4trace:configure.ac:10: -1- AC_SUBST_TRACE([AUDIOFILE_VERSION_INFO])
|
||||
m4trace:configure.ac:10: -1- m4_pattern_allow([^AUDIOFILE_VERSION_INFO$])
|
||||
m4trace:configure.ac:12: -1- AM_INIT_AUTOMAKE([$PACKAGE_NAME], [$PACKAGE_VERSION])
|
||||
m4trace:configure.ac:12: -1- m4_pattern_allow([^AM_[A-Z]+FLAGS$])
|
||||
m4trace:configure.ac:12: -1- AM_AUTOMAKE_VERSION([1.11.6])
|
||||
m4trace:configure.ac:12: -1- AC_REQUIRE_AUX_FILE([install-sh])
|
||||
m4trace:configure.ac:12: -1- AC_SUBST([INSTALL_PROGRAM])
|
||||
m4trace:configure.ac:12: -1- AC_SUBST_TRACE([INSTALL_PROGRAM])
|
||||
m4trace:configure.ac:12: -1- m4_pattern_allow([^INSTALL_PROGRAM$])
|
||||
m4trace:configure.ac:12: -1- AC_SUBST([INSTALL_SCRIPT])
|
||||
m4trace:configure.ac:12: -1- AC_SUBST_TRACE([INSTALL_SCRIPT])
|
||||
m4trace:configure.ac:12: -1- m4_pattern_allow([^INSTALL_SCRIPT$])
|
||||
m4trace:configure.ac:12: -1- AC_SUBST([INSTALL_DATA])
|
||||
m4trace:configure.ac:12: -1- AC_SUBST_TRACE([INSTALL_DATA])
|
||||
m4trace:configure.ac:12: -1- m4_pattern_allow([^INSTALL_DATA$])
|
||||
m4trace:configure.ac:12: -1- AC_SUBST([am__isrc], [' -I$(srcdir)'])
|
||||
m4trace:configure.ac:12: -1- AC_SUBST_TRACE([am__isrc])
|
||||
m4trace:configure.ac:12: -1- m4_pattern_allow([^am__isrc$])
|
||||
m4trace:configure.ac:12: -1- _AM_SUBST_NOTMAKE([am__isrc])
|
||||
m4trace:configure.ac:12: -1- AC_SUBST([CYGPATH_W])
|
||||
m4trace:configure.ac:12: -1- AC_SUBST_TRACE([CYGPATH_W])
|
||||
m4trace:configure.ac:12: -1- m4_pattern_allow([^CYGPATH_W$])
|
||||
m4trace:configure.ac:12: -1- AC_SUBST([PACKAGE], [$PACKAGE_NAME])
|
||||
m4trace:configure.ac:12: -1- AC_SUBST_TRACE([PACKAGE])
|
||||
m4trace:configure.ac:12: -1- m4_pattern_allow([^PACKAGE$])
|
||||
m4trace:configure.ac:12: -1- AC_SUBST([VERSION], [$PACKAGE_VERSION])
|
||||
m4trace:configure.ac:12: -1- AC_SUBST_TRACE([VERSION])
|
||||
m4trace:configure.ac:12: -1- m4_pattern_allow([^VERSION$])
|
||||
m4trace:configure.ac:12: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE])
|
||||
m4trace:configure.ac:12: -1- m4_pattern_allow([^PACKAGE$])
|
||||
m4trace:configure.ac:12: -1- AH_OUTPUT([PACKAGE], [/* Name of package */
|
||||
@%:@undef PACKAGE])
|
||||
m4trace:configure.ac:12: -1- AC_DEFINE_TRACE_LITERAL([VERSION])
|
||||
m4trace:configure.ac:12: -1- m4_pattern_allow([^VERSION$])
|
||||
m4trace:configure.ac:12: -1- AH_OUTPUT([VERSION], [/* Version number of package */
|
||||
@%:@undef VERSION])
|
||||
m4trace:configure.ac:12: -1- AC_REQUIRE_AUX_FILE([missing])
|
||||
m4trace:configure.ac:12: -1- AC_SUBST([ACLOCAL])
|
||||
m4trace:configure.ac:12: -1- AC_SUBST_TRACE([ACLOCAL])
|
||||
m4trace:configure.ac:12: -1- m4_pattern_allow([^ACLOCAL$])
|
||||
m4trace:configure.ac:12: -1- AC_SUBST([AUTOCONF])
|
||||
m4trace:configure.ac:12: -1- AC_SUBST_TRACE([AUTOCONF])
|
||||
m4trace:configure.ac:12: -1- m4_pattern_allow([^AUTOCONF$])
|
||||
m4trace:configure.ac:12: -1- AC_SUBST([AUTOMAKE])
|
||||
m4trace:configure.ac:12: -1- AC_SUBST_TRACE([AUTOMAKE])
|
||||
m4trace:configure.ac:12: -1- m4_pattern_allow([^AUTOMAKE$])
|
||||
m4trace:configure.ac:12: -1- AC_SUBST([AUTOHEADER])
|
||||
m4trace:configure.ac:12: -1- AC_SUBST_TRACE([AUTOHEADER])
|
||||
m4trace:configure.ac:12: -1- m4_pattern_allow([^AUTOHEADER$])
|
||||
m4trace:configure.ac:12: -1- AC_SUBST([MAKEINFO])
|
||||
m4trace:configure.ac:12: -1- AC_SUBST_TRACE([MAKEINFO])
|
||||
m4trace:configure.ac:12: -1- m4_pattern_allow([^MAKEINFO$])
|
||||
m4trace:configure.ac:12: -1- AC_SUBST([install_sh])
|
||||
m4trace:configure.ac:12: -1- AC_SUBST_TRACE([install_sh])
|
||||
m4trace:configure.ac:12: -1- m4_pattern_allow([^install_sh$])
|
||||
m4trace:configure.ac:12: -1- AC_SUBST([STRIP])
|
||||
m4trace:configure.ac:12: -1- AC_SUBST_TRACE([STRIP])
|
||||
m4trace:configure.ac:12: -1- m4_pattern_allow([^STRIP$])
|
||||
m4trace:configure.ac:12: -1- AC_SUBST([INSTALL_STRIP_PROGRAM])
|
||||
m4trace:configure.ac:12: -1- AC_SUBST_TRACE([INSTALL_STRIP_PROGRAM])
|
||||
m4trace:configure.ac:12: -1- m4_pattern_allow([^INSTALL_STRIP_PROGRAM$])
|
||||
m4trace:configure.ac:12: -1- AC_REQUIRE_AUX_FILE([install-sh])
|
||||
m4trace:configure.ac:12: -1- AC_SUBST([MKDIR_P])
|
||||
m4trace:configure.ac:12: -1- AC_SUBST_TRACE([MKDIR_P])
|
||||
m4trace:configure.ac:12: -1- m4_pattern_allow([^MKDIR_P$])
|
||||
m4trace:configure.ac:12: -1- AC_SUBST([mkdir_p], ["$MKDIR_P"])
|
||||
m4trace:configure.ac:12: -1- AC_SUBST_TRACE([mkdir_p])
|
||||
m4trace:configure.ac:12: -1- m4_pattern_allow([^mkdir_p$])
|
||||
m4trace:configure.ac:12: -1- AC_SUBST([AWK])
|
||||
m4trace:configure.ac:12: -1- AC_SUBST_TRACE([AWK])
|
||||
m4trace:configure.ac:12: -1- m4_pattern_allow([^AWK$])
|
||||
m4trace:configure.ac:12: -1- AC_SUBST([SET_MAKE])
|
||||
m4trace:configure.ac:12: -1- AC_SUBST_TRACE([SET_MAKE])
|
||||
m4trace:configure.ac:12: -1- m4_pattern_allow([^SET_MAKE$])
|
||||
m4trace:configure.ac:12: -1- AC_SUBST([am__leading_dot])
|
||||
m4trace:configure.ac:12: -1- AC_SUBST_TRACE([am__leading_dot])
|
||||
m4trace:configure.ac:12: -1- m4_pattern_allow([^am__leading_dot$])
|
||||
m4trace:configure.ac:12: -1- AC_SUBST([AMTAR], ['$${TAR-tar}'])
|
||||
m4trace:configure.ac:12: -1- AC_SUBST_TRACE([AMTAR])
|
||||
m4trace:configure.ac:12: -1- m4_pattern_allow([^AMTAR$])
|
||||
m4trace:configure.ac:12: -1- AC_SUBST([am__tar])
|
||||
m4trace:configure.ac:12: -1- AC_SUBST_TRACE([am__tar])
|
||||
m4trace:configure.ac:12: -1- m4_pattern_allow([^am__tar$])
|
||||
m4trace:configure.ac:12: -1- AC_SUBST([am__untar])
|
||||
m4trace:configure.ac:12: -1- AC_SUBST_TRACE([am__untar])
|
||||
m4trace:configure.ac:12: -1- m4_pattern_allow([^am__untar$])
|
||||
m4trace:configure.ac:13: -1- AC_CONFIG_HEADERS([config.h])
|
||||
m4trace:configure.ac:16: -1- AC_SUBST([CC])
|
||||
m4trace:configure.ac:16: -1- AC_SUBST_TRACE([CC])
|
||||
m4trace:configure.ac:16: -1- m4_pattern_allow([^CC$])
|
||||
m4trace:configure.ac:16: -1- AC_SUBST([CFLAGS])
|
||||
m4trace:configure.ac:16: -1- AC_SUBST_TRACE([CFLAGS])
|
||||
m4trace:configure.ac:16: -1- m4_pattern_allow([^CFLAGS$])
|
||||
m4trace:configure.ac:16: -1- AC_SUBST([LDFLAGS])
|
||||
m4trace:configure.ac:16: -1- AC_SUBST_TRACE([LDFLAGS])
|
||||
m4trace:configure.ac:16: -1- m4_pattern_allow([^LDFLAGS$])
|
||||
m4trace:configure.ac:16: -1- AC_SUBST([LIBS])
|
||||
m4trace:configure.ac:16: -1- AC_SUBST_TRACE([LIBS])
|
||||
m4trace:configure.ac:16: -1- m4_pattern_allow([^LIBS$])
|
||||
m4trace:configure.ac:16: -1- AC_SUBST([CPPFLAGS])
|
||||
m4trace:configure.ac:16: -1- AC_SUBST_TRACE([CPPFLAGS])
|
||||
m4trace:configure.ac:16: -1- m4_pattern_allow([^CPPFLAGS$])
|
||||
m4trace:configure.ac:16: -1- AC_SUBST([CC])
|
||||
m4trace:configure.ac:16: -1- AC_SUBST_TRACE([CC])
|
||||
m4trace:configure.ac:16: -1- m4_pattern_allow([^CC$])
|
||||
m4trace:configure.ac:16: -1- AC_SUBST([CC])
|
||||
m4trace:configure.ac:16: -1- AC_SUBST_TRACE([CC])
|
||||
m4trace:configure.ac:16: -1- m4_pattern_allow([^CC$])
|
||||
m4trace:configure.ac:16: -1- AC_SUBST([CC])
|
||||
m4trace:configure.ac:16: -1- AC_SUBST_TRACE([CC])
|
||||
m4trace:configure.ac:16: -1- m4_pattern_allow([^CC$])
|
||||
m4trace:configure.ac:16: -1- AC_SUBST([CC])
|
||||
m4trace:configure.ac:16: -1- AC_SUBST_TRACE([CC])
|
||||
m4trace:configure.ac:16: -1- m4_pattern_allow([^CC$])
|
||||
m4trace:configure.ac:16: -1- AC_SUBST([ac_ct_CC])
|
||||
m4trace:configure.ac:16: -1- AC_SUBST_TRACE([ac_ct_CC])
|
||||
m4trace:configure.ac:16: -1- m4_pattern_allow([^ac_ct_CC$])
|
||||
m4trace:configure.ac:16: -1- AC_SUBST([EXEEXT], [$ac_cv_exeext])
|
||||
m4trace:configure.ac:16: -1- AC_SUBST_TRACE([EXEEXT])
|
||||
m4trace:configure.ac:16: -1- m4_pattern_allow([^EXEEXT$])
|
||||
m4trace:configure.ac:16: -1- AC_SUBST([OBJEXT], [$ac_cv_objext])
|
||||
m4trace:configure.ac:16: -1- AC_SUBST_TRACE([OBJEXT])
|
||||
m4trace:configure.ac:16: -1- m4_pattern_allow([^OBJEXT$])
|
||||
m4trace:configure.ac:16: -1- AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])
|
||||
m4trace:configure.ac:16: -1- AC_SUBST_TRACE([DEPDIR])
|
||||
m4trace:configure.ac:16: -1- m4_pattern_allow([^DEPDIR$])
|
||||
m4trace:configure.ac:16: -1- AC_SUBST([am__include])
|
||||
m4trace:configure.ac:16: -1- AC_SUBST_TRACE([am__include])
|
||||
m4trace:configure.ac:16: -1- m4_pattern_allow([^am__include$])
|
||||
m4trace:configure.ac:16: -1- AC_SUBST([am__quote])
|
||||
m4trace:configure.ac:16: -1- AC_SUBST_TRACE([am__quote])
|
||||
m4trace:configure.ac:16: -1- m4_pattern_allow([^am__quote$])
|
||||
m4trace:configure.ac:16: -1- AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
|
||||
m4trace:configure.ac:16: -1- AC_SUBST([AMDEP_TRUE])
|
||||
m4trace:configure.ac:16: -1- AC_SUBST_TRACE([AMDEP_TRUE])
|
||||
m4trace:configure.ac:16: -1- m4_pattern_allow([^AMDEP_TRUE$])
|
||||
m4trace:configure.ac:16: -1- AC_SUBST([AMDEP_FALSE])
|
||||
m4trace:configure.ac:16: -1- AC_SUBST_TRACE([AMDEP_FALSE])
|
||||
m4trace:configure.ac:16: -1- m4_pattern_allow([^AMDEP_FALSE$])
|
||||
m4trace:configure.ac:16: -1- _AM_SUBST_NOTMAKE([AMDEP_TRUE])
|
||||
m4trace:configure.ac:16: -1- _AM_SUBST_NOTMAKE([AMDEP_FALSE])
|
||||
m4trace:configure.ac:16: -1- AC_SUBST([AMDEPBACKSLASH])
|
||||
m4trace:configure.ac:16: -1- AC_SUBST_TRACE([AMDEPBACKSLASH])
|
||||
m4trace:configure.ac:16: -1- m4_pattern_allow([^AMDEPBACKSLASH$])
|
||||
m4trace:configure.ac:16: -1- _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])
|
||||
m4trace:configure.ac:16: -1- AC_SUBST([am__nodep])
|
||||
m4trace:configure.ac:16: -1- AC_SUBST_TRACE([am__nodep])
|
||||
m4trace:configure.ac:16: -1- m4_pattern_allow([^am__nodep$])
|
||||
m4trace:configure.ac:16: -1- _AM_SUBST_NOTMAKE([am__nodep])
|
||||
m4trace:configure.ac:16: -1- AC_SUBST([CCDEPMODE], [depmode=$am_cv_CC_dependencies_compiler_type])
|
||||
m4trace:configure.ac:16: -1- AC_SUBST_TRACE([CCDEPMODE])
|
||||
m4trace:configure.ac:16: -1- m4_pattern_allow([^CCDEPMODE$])
|
||||
m4trace:configure.ac:16: -1- AM_CONDITIONAL([am__fastdepCC], [
|
||||
test "x$enable_dependency_tracking" != xno \
|
||||
&& test "$am_cv_CC_dependencies_compiler_type" = gcc3])
|
||||
m4trace:configure.ac:16: -1- AC_SUBST([am__fastdepCC_TRUE])
|
||||
m4trace:configure.ac:16: -1- AC_SUBST_TRACE([am__fastdepCC_TRUE])
|
||||
m4trace:configure.ac:16: -1- m4_pattern_allow([^am__fastdepCC_TRUE$])
|
||||
m4trace:configure.ac:16: -1- AC_SUBST([am__fastdepCC_FALSE])
|
||||
m4trace:configure.ac:16: -1- AC_SUBST_TRACE([am__fastdepCC_FALSE])
|
||||
m4trace:configure.ac:16: -1- m4_pattern_allow([^am__fastdepCC_FALSE$])
|
||||
m4trace:configure.ac:16: -1- _AM_SUBST_NOTMAKE([am__fastdepCC_TRUE])
|
||||
m4trace:configure.ac:16: -1- _AM_SUBST_NOTMAKE([am__fastdepCC_FALSE])
|
||||
m4trace:configure.ac:17: -1- AC_SUBST([CXX])
|
||||
m4trace:configure.ac:17: -1- AC_SUBST_TRACE([CXX])
|
||||
m4trace:configure.ac:17: -1- m4_pattern_allow([^CXX$])
|
||||
m4trace:configure.ac:17: -1- AC_SUBST([CXXFLAGS])
|
||||
m4trace:configure.ac:17: -1- AC_SUBST_TRACE([CXXFLAGS])
|
||||
m4trace:configure.ac:17: -1- m4_pattern_allow([^CXXFLAGS$])
|
||||
m4trace:configure.ac:17: -1- AC_SUBST([LDFLAGS])
|
||||
m4trace:configure.ac:17: -1- AC_SUBST_TRACE([LDFLAGS])
|
||||
m4trace:configure.ac:17: -1- m4_pattern_allow([^LDFLAGS$])
|
||||
m4trace:configure.ac:17: -1- AC_SUBST([LIBS])
|
||||
m4trace:configure.ac:17: -1- AC_SUBST_TRACE([LIBS])
|
||||
m4trace:configure.ac:17: -1- m4_pattern_allow([^LIBS$])
|
||||
m4trace:configure.ac:17: -1- AC_SUBST([CPPFLAGS])
|
||||
m4trace:configure.ac:17: -1- AC_SUBST_TRACE([CPPFLAGS])
|
||||
m4trace:configure.ac:17: -1- m4_pattern_allow([^CPPFLAGS$])
|
||||
m4trace:configure.ac:17: -1- AC_SUBST([CXX])
|
||||
m4trace:configure.ac:17: -1- AC_SUBST_TRACE([CXX])
|
||||
m4trace:configure.ac:17: -1- m4_pattern_allow([^CXX$])
|
||||
m4trace:configure.ac:17: -1- AC_SUBST([ac_ct_CXX])
|
||||
m4trace:configure.ac:17: -1- AC_SUBST_TRACE([ac_ct_CXX])
|
||||
m4trace:configure.ac:17: -1- m4_pattern_allow([^ac_ct_CXX$])
|
||||
m4trace:configure.ac:17: -1- AC_SUBST([CXXDEPMODE], [depmode=$am_cv_CXX_dependencies_compiler_type])
|
||||
m4trace:configure.ac:17: -1- AC_SUBST_TRACE([CXXDEPMODE])
|
||||
m4trace:configure.ac:17: -1- m4_pattern_allow([^CXXDEPMODE$])
|
||||
m4trace:configure.ac:17: -1- AM_CONDITIONAL([am__fastdepCXX], [
|
||||
test "x$enable_dependency_tracking" != xno \
|
||||
&& test "$am_cv_CXX_dependencies_compiler_type" = gcc3])
|
||||
m4trace:configure.ac:17: -1- AC_SUBST([am__fastdepCXX_TRUE])
|
||||
m4trace:configure.ac:17: -1- AC_SUBST_TRACE([am__fastdepCXX_TRUE])
|
||||
m4trace:configure.ac:17: -1- m4_pattern_allow([^am__fastdepCXX_TRUE$])
|
||||
m4trace:configure.ac:17: -1- AC_SUBST([am__fastdepCXX_FALSE])
|
||||
m4trace:configure.ac:17: -1- AC_SUBST_TRACE([am__fastdepCXX_FALSE])
|
||||
m4trace:configure.ac:17: -1- m4_pattern_allow([^am__fastdepCXX_FALSE$])
|
||||
m4trace:configure.ac:17: -1- _AM_SUBST_NOTMAKE([am__fastdepCXX_TRUE])
|
||||
m4trace:configure.ac:17: -1- _AM_SUBST_NOTMAKE([am__fastdepCXX_FALSE])
|
||||
m4trace:configure.ac:19: -1- _m4_warn([obsolete], [The macro `AM_PROG_LIBTOOL' is obsolete.
|
||||
You should run autoupdate.], [aclocal.m4:122: AM_PROG_LIBTOOL is expanded from...
|
||||
configure.ac:19: the top level])
|
||||
m4trace:configure.ac:19: -1- LT_INIT
|
||||
m4trace:configure.ac:19: -1- m4_pattern_forbid([^_?LT_[A-Z_]+$])
|
||||
m4trace:configure.ac:19: -1- m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])
|
||||
m4trace:configure.ac:19: -1- AC_REQUIRE_AUX_FILE([ltmain.sh])
|
||||
m4trace:configure.ac:19: -1- AC_SUBST([LIBTOOL])
|
||||
m4trace:configure.ac:19: -1- AC_SUBST_TRACE([LIBTOOL])
|
||||
m4trace:configure.ac:19: -1- m4_pattern_allow([^LIBTOOL$])
|
||||
m4trace:configure.ac:19: -1- AC_CANONICAL_HOST
|
||||
m4trace:configure.ac:19: -1- AC_CANONICAL_BUILD
|
||||
m4trace:configure.ac:19: -1- AC_REQUIRE_AUX_FILE([config.sub])
|
||||
m4trace:configure.ac:19: -1- AC_REQUIRE_AUX_FILE([config.guess])
|
||||
m4trace:configure.ac:19: -1- AC_SUBST([build], [$ac_cv_build])
|
||||
m4trace:configure.ac:19: -1- AC_SUBST_TRACE([build])
|
||||
m4trace:configure.ac:19: -1- m4_pattern_allow([^build$])
|
||||
m4trace:configure.ac:19: -1- AC_SUBST([build_cpu], [$[1]])
|
||||
m4trace:configure.ac:19: -1- AC_SUBST_TRACE([build_cpu])
|
||||
m4trace:configure.ac:19: -1- m4_pattern_allow([^build_cpu$])
|
||||
m4trace:configure.ac:19: -1- AC_SUBST([build_vendor], [$[2]])
|
||||
m4trace:configure.ac:19: -1- AC_SUBST_TRACE([build_vendor])
|
||||
m4trace:configure.ac:19: -1- m4_pattern_allow([^build_vendor$])
|
||||
m4trace:configure.ac:19: -1- AC_SUBST([build_os])
|
||||
m4trace:configure.ac:19: -1- AC_SUBST_TRACE([build_os])
|
||||
m4trace:configure.ac:19: -1- m4_pattern_allow([^build_os$])
|
||||
m4trace:configure.ac:19: -1- AC_SUBST([host], [$ac_cv_host])
|
||||
m4trace:configure.ac:19: -1- AC_SUBST_TRACE([host])
|
||||
m4trace:configure.ac:19: -1- m4_pattern_allow([^host$])
|
||||
m4trace:configure.ac:19: -1- AC_SUBST([host_cpu], [$[1]])
|
||||
m4trace:configure.ac:19: -1- AC_SUBST_TRACE([host_cpu])
|
||||
m4trace:configure.ac:19: -1- m4_pattern_allow([^host_cpu$])
|
||||
m4trace:configure.ac:19: -1- AC_SUBST([host_vendor], [$[2]])
|
||||
m4trace:configure.ac:19: -1- AC_SUBST_TRACE([host_vendor])
|
||||
m4trace:configure.ac:19: -1- m4_pattern_allow([^host_vendor$])
|
||||
m4trace:configure.ac:19: -1- AC_SUBST([host_os])
|
||||
m4trace:configure.ac:19: -1- AC_SUBST_TRACE([host_os])
|
||||
m4trace:configure.ac:19: -1- m4_pattern_allow([^host_os$])
|
||||
m4trace:configure.ac:19: -1- AC_SUBST([SED])
|
||||
m4trace:configure.ac:19: -1- AC_SUBST_TRACE([SED])
|
||||
m4trace:configure.ac:19: -1- m4_pattern_allow([^SED$])
|
||||
m4trace:configure.ac:19: -1- AC_SUBST([GREP])
|
||||
m4trace:configure.ac:19: -1- AC_SUBST_TRACE([GREP])
|
||||
m4trace:configure.ac:19: -1- m4_pattern_allow([^GREP$])
|
||||
m4trace:configure.ac:19: -1- AC_SUBST([EGREP])
|
||||
m4trace:configure.ac:19: -1- AC_SUBST_TRACE([EGREP])
|
||||
m4trace:configure.ac:19: -1- m4_pattern_allow([^EGREP$])
|
||||
m4trace:configure.ac:19: -1- AC_SUBST([FGREP])
|
||||
m4trace:configure.ac:19: -1- AC_SUBST_TRACE([FGREP])
|
||||
m4trace:configure.ac:19: -1- m4_pattern_allow([^FGREP$])
|
||||
m4trace:configure.ac:19: -1- AC_SUBST([GREP])
|
||||
m4trace:configure.ac:19: -1- AC_SUBST_TRACE([GREP])
|
||||
m4trace:configure.ac:19: -1- m4_pattern_allow([^GREP$])
|
||||
m4trace:configure.ac:19: -1- AC_SUBST([LD])
|
||||
m4trace:configure.ac:19: -1- AC_SUBST_TRACE([LD])
|
||||
m4trace:configure.ac:19: -1- m4_pattern_allow([^LD$])
|
||||
m4trace:configure.ac:19: -1- AC_SUBST([DUMPBIN])
|
||||
m4trace:configure.ac:19: -1- AC_SUBST_TRACE([DUMPBIN])
|
||||
m4trace:configure.ac:19: -1- m4_pattern_allow([^DUMPBIN$])
|
||||
m4trace:configure.ac:19: -1- AC_SUBST([ac_ct_DUMPBIN])
|
||||
m4trace:configure.ac:19: -1- AC_SUBST_TRACE([ac_ct_DUMPBIN])
|
||||
m4trace:configure.ac:19: -1- m4_pattern_allow([^ac_ct_DUMPBIN$])
|
||||
m4trace:configure.ac:19: -1- AC_SUBST([DUMPBIN])
|
||||
m4trace:configure.ac:19: -1- AC_SUBST_TRACE([DUMPBIN])
|
||||
m4trace:configure.ac:19: -1- m4_pattern_allow([^DUMPBIN$])
|
||||
m4trace:configure.ac:19: -1- AC_SUBST([NM])
|
||||
m4trace:configure.ac:19: -1- AC_SUBST_TRACE([NM])
|
||||
m4trace:configure.ac:19: -1- m4_pattern_allow([^NM$])
|
||||
m4trace:configure.ac:19: -1- AC_SUBST([LN_S], [$as_ln_s])
|
||||
m4trace:configure.ac:19: -1- AC_SUBST_TRACE([LN_S])
|
||||
m4trace:configure.ac:19: -1- m4_pattern_allow([^LN_S$])
|
||||
m4trace:configure.ac:19: -1- AC_SUBST([OBJDUMP])
|
||||
m4trace:configure.ac:19: -1- AC_SUBST_TRACE([OBJDUMP])
|
||||
m4trace:configure.ac:19: -1- m4_pattern_allow([^OBJDUMP$])
|
||||
m4trace:configure.ac:19: -1- AC_SUBST([OBJDUMP])
|
||||
m4trace:configure.ac:19: -1- AC_SUBST_TRACE([OBJDUMP])
|
||||
m4trace:configure.ac:19: -1- m4_pattern_allow([^OBJDUMP$])
|
||||
m4trace:configure.ac:19: -1- AC_SUBST([DLLTOOL])
|
||||
m4trace:configure.ac:19: -1- AC_SUBST_TRACE([DLLTOOL])
|
||||
m4trace:configure.ac:19: -1- m4_pattern_allow([^DLLTOOL$])
|
||||
m4trace:configure.ac:19: -1- AC_SUBST([DLLTOOL])
|
||||
m4trace:configure.ac:19: -1- AC_SUBST_TRACE([DLLTOOL])
|
||||
m4trace:configure.ac:19: -1- m4_pattern_allow([^DLLTOOL$])
|
||||
m4trace:configure.ac:19: -1- AC_SUBST([AR])
|
||||
m4trace:configure.ac:19: -1- AC_SUBST_TRACE([AR])
|
||||
m4trace:configure.ac:19: -1- m4_pattern_allow([^AR$])
|
||||
m4trace:configure.ac:19: -1- AC_SUBST([ac_ct_AR])
|
||||
m4trace:configure.ac:19: -1- AC_SUBST_TRACE([ac_ct_AR])
|
||||
m4trace:configure.ac:19: -1- m4_pattern_allow([^ac_ct_AR$])
|
||||
m4trace:configure.ac:19: -1- AC_SUBST([STRIP])
|
||||
m4trace:configure.ac:19: -1- AC_SUBST_TRACE([STRIP])
|
||||
m4trace:configure.ac:19: -1- m4_pattern_allow([^STRIP$])
|
||||
m4trace:configure.ac:19: -1- AC_SUBST([RANLIB])
|
||||
m4trace:configure.ac:19: -1- AC_SUBST_TRACE([RANLIB])
|
||||
m4trace:configure.ac:19: -1- m4_pattern_allow([^RANLIB$])
|
||||
m4trace:configure.ac:19: -1- m4_pattern_allow([LT_OBJDIR])
|
||||
m4trace:configure.ac:19: -1- AC_DEFINE_TRACE_LITERAL([LT_OBJDIR])
|
||||
m4trace:configure.ac:19: -1- m4_pattern_allow([^LT_OBJDIR$])
|
||||
m4trace:configure.ac:19: -1- AH_OUTPUT([LT_OBJDIR], [/* Define to the sub-directory where libtool stores uninstalled libraries. */
|
||||
@%:@undef LT_OBJDIR])
|
||||
m4trace:configure.ac:19: -1- LT_SUPPORTED_TAG([CC])
|
||||
m4trace:configure.ac:19: -1- AC_SUBST([MANIFEST_TOOL])
|
||||
m4trace:configure.ac:19: -1- AC_SUBST_TRACE([MANIFEST_TOOL])
|
||||
m4trace:configure.ac:19: -1- m4_pattern_allow([^MANIFEST_TOOL$])
|
||||
m4trace:configure.ac:19: -1- AC_SUBST([DSYMUTIL])
|
||||
m4trace:configure.ac:19: -1- AC_SUBST_TRACE([DSYMUTIL])
|
||||
m4trace:configure.ac:19: -1- m4_pattern_allow([^DSYMUTIL$])
|
||||
m4trace:configure.ac:19: -1- AC_SUBST([NMEDIT])
|
||||
m4trace:configure.ac:19: -1- AC_SUBST_TRACE([NMEDIT])
|
||||
m4trace:configure.ac:19: -1- m4_pattern_allow([^NMEDIT$])
|
||||
m4trace:configure.ac:19: -1- AC_SUBST([LIPO])
|
||||
m4trace:configure.ac:19: -1- AC_SUBST_TRACE([LIPO])
|
||||
m4trace:configure.ac:19: -1- m4_pattern_allow([^LIPO$])
|
||||
m4trace:configure.ac:19: -1- AC_SUBST([OTOOL])
|
||||
m4trace:configure.ac:19: -1- AC_SUBST_TRACE([OTOOL])
|
||||
m4trace:configure.ac:19: -1- m4_pattern_allow([^OTOOL$])
|
||||
m4trace:configure.ac:19: -1- AC_SUBST([OTOOL64])
|
||||
m4trace:configure.ac:19: -1- AC_SUBST_TRACE([OTOOL64])
|
||||
m4trace:configure.ac:19: -1- m4_pattern_allow([^OTOOL64$])
|
||||
m4trace:configure.ac:19: -1- AC_SUBST([LT_SYS_LIBRARY_PATH])
|
||||
m4trace:configure.ac:19: -1- AC_SUBST_TRACE([LT_SYS_LIBRARY_PATH])
|
||||
m4trace:configure.ac:19: -1- m4_pattern_allow([^LT_SYS_LIBRARY_PATH$])
|
||||
m4trace:configure.ac:19: -1- AH_OUTPUT([HAVE_DLFCN_H], [/* Define to 1 if you have the <dlfcn.h> header file. */
|
||||
@%:@undef HAVE_DLFCN_H])
|
||||
m4trace:configure.ac:19: -1- AC_SUBST([CPP])
|
||||
m4trace:configure.ac:19: -1- AC_SUBST_TRACE([CPP])
|
||||
m4trace:configure.ac:19: -1- m4_pattern_allow([^CPP$])
|
||||
m4trace:configure.ac:19: -1- AC_SUBST([CPPFLAGS])
|
||||
m4trace:configure.ac:19: -1- AC_SUBST_TRACE([CPPFLAGS])
|
||||
m4trace:configure.ac:19: -1- m4_pattern_allow([^CPPFLAGS$])
|
||||
m4trace:configure.ac:19: -1- AC_SUBST([CPP])
|
||||
m4trace:configure.ac:19: -1- AC_SUBST_TRACE([CPP])
|
||||
m4trace:configure.ac:19: -1- m4_pattern_allow([^CPP$])
|
||||
m4trace:configure.ac:19: -1- AC_DEFINE_TRACE_LITERAL([STDC_HEADERS])
|
||||
m4trace:configure.ac:19: -1- m4_pattern_allow([^STDC_HEADERS$])
|
||||
m4trace:configure.ac:19: -1- AH_OUTPUT([STDC_HEADERS], [/* Define to 1 if you have the ANSI C header files. */
|
||||
@%:@undef STDC_HEADERS])
|
||||
m4trace:configure.ac:19: -1- AH_OUTPUT([HAVE_SYS_TYPES_H], [/* Define to 1 if you have the <sys/types.h> header file. */
|
||||
@%:@undef HAVE_SYS_TYPES_H])
|
||||
m4trace:configure.ac:19: -1- AH_OUTPUT([HAVE_SYS_STAT_H], [/* Define to 1 if you have the <sys/stat.h> header file. */
|
||||
@%:@undef HAVE_SYS_STAT_H])
|
||||
m4trace:configure.ac:19: -1- AH_OUTPUT([HAVE_STDLIB_H], [/* Define to 1 if you have the <stdlib.h> header file. */
|
||||
@%:@undef HAVE_STDLIB_H])
|
||||
m4trace:configure.ac:19: -1- AH_OUTPUT([HAVE_STRING_H], [/* Define to 1 if you have the <string.h> header file. */
|
||||
@%:@undef HAVE_STRING_H])
|
||||
m4trace:configure.ac:19: -1- AH_OUTPUT([HAVE_MEMORY_H], [/* Define to 1 if you have the <memory.h> header file. */
|
||||
@%:@undef HAVE_MEMORY_H])
|
||||
m4trace:configure.ac:19: -1- AH_OUTPUT([HAVE_STRINGS_H], [/* Define to 1 if you have the <strings.h> header file. */
|
||||
@%:@undef HAVE_STRINGS_H])
|
||||
m4trace:configure.ac:19: -1- AH_OUTPUT([HAVE_INTTYPES_H], [/* Define to 1 if you have the <inttypes.h> header file. */
|
||||
@%:@undef HAVE_INTTYPES_H])
|
||||
m4trace:configure.ac:19: -1- AH_OUTPUT([HAVE_STDINT_H], [/* Define to 1 if you have the <stdint.h> header file. */
|
||||
@%:@undef HAVE_STDINT_H])
|
||||
m4trace:configure.ac:19: -1- AH_OUTPUT([HAVE_UNISTD_H], [/* Define to 1 if you have the <unistd.h> header file. */
|
||||
@%:@undef HAVE_UNISTD_H])
|
||||
m4trace:configure.ac:19: -1- AC_DEFINE_TRACE_LITERAL([HAVE_DLFCN_H])
|
||||
m4trace:configure.ac:19: -1- m4_pattern_allow([^HAVE_DLFCN_H$])
|
||||
m4trace:configure.ac:19: -1- LT_SUPPORTED_TAG([CXX])
|
||||
m4trace:configure.ac:19: -1- AC_SUBST([CXXCPP])
|
||||
m4trace:configure.ac:19: -1- AC_SUBST_TRACE([CXXCPP])
|
||||
m4trace:configure.ac:19: -1- m4_pattern_allow([^CXXCPP$])
|
||||
m4trace:configure.ac:19: -1- AC_SUBST([CPPFLAGS])
|
||||
m4trace:configure.ac:19: -1- AC_SUBST_TRACE([CPPFLAGS])
|
||||
m4trace:configure.ac:19: -1- m4_pattern_allow([^CPPFLAGS$])
|
||||
m4trace:configure.ac:19: -1- AC_SUBST([CXXCPP])
|
||||
m4trace:configure.ac:19: -1- AC_SUBST_TRACE([CXXCPP])
|
||||
m4trace:configure.ac:19: -1- m4_pattern_allow([^CXXCPP$])
|
||||
m4trace:configure.ac:19: -1- AC_SUBST([LD])
|
||||
m4trace:configure.ac:19: -1- AC_SUBST_TRACE([LD])
|
||||
m4trace:configure.ac:19: -1- m4_pattern_allow([^LD$])
|
||||
m4trace:configure.ac:19: -1- AC_SUBST([LT_SYS_LIBRARY_PATH])
|
||||
m4trace:configure.ac:19: -1- AC_SUBST_TRACE([LT_SYS_LIBRARY_PATH])
|
||||
m4trace:configure.ac:19: -1- m4_pattern_allow([^LT_SYS_LIBRARY_PATH$])
|
||||
m4trace:configure.ac:22: -1- AC_DEFINE_TRACE_LITERAL([STDC_HEADERS])
|
||||
m4trace:configure.ac:22: -1- m4_pattern_allow([^STDC_HEADERS$])
|
||||
m4trace:configure.ac:22: -1- AH_OUTPUT([STDC_HEADERS], [/* Define to 1 if you have the ANSI C header files. */
|
||||
@%:@undef STDC_HEADERS])
|
||||
m4trace:configure.ac:23: -1- AH_OUTPUT([HAVE_FCNTL_H], [/* Define to 1 if you have the <fcntl.h> header file. */
|
||||
@%:@undef HAVE_FCNTL_H])
|
||||
m4trace:configure.ac:23: -1- AH_OUTPUT([HAVE_UNISTD_H], [/* Define to 1 if you have the <unistd.h> header file. */
|
||||
@%:@undef HAVE_UNISTD_H])
|
||||
m4trace:configure.ac:26: -1- AC_DEFINE_TRACE_LITERAL([const])
|
||||
m4trace:configure.ac:26: -1- m4_pattern_allow([^const$])
|
||||
m4trace:configure.ac:26: -1- AH_OUTPUT([const], [/* Define to empty if `const\' does not conform to ANSI C. */
|
||||
@%:@undef const])
|
||||
m4trace:configure.ac:27: -1- AH_OUTPUT([WORDS_BIGENDIAN], [/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
|
||||
significant byte first (like Motorola and SPARC, unlike Intel). */
|
||||
#if defined AC_APPLE_UNIVERSAL_BUILD
|
||||
# if defined __BIG_ENDIAN__
|
||||
# define WORDS_BIGENDIAN 1
|
||||
# endif
|
||||
#else
|
||||
# ifndef WORDS_BIGENDIAN
|
||||
# undef WORDS_BIGENDIAN
|
||||
# endif
|
||||
#endif])
|
||||
m4trace:configure.ac:27: -1- AC_DEFINE_TRACE_LITERAL([WORDS_BIGENDIAN])
|
||||
m4trace:configure.ac:27: -1- m4_pattern_allow([^WORDS_BIGENDIAN$])
|
||||
m4trace:configure.ac:27: -1- AC_DEFINE_TRACE_LITERAL([AC_APPLE_UNIVERSAL_BUILD])
|
||||
m4trace:configure.ac:27: -1- m4_pattern_allow([^AC_APPLE_UNIVERSAL_BUILD$])
|
||||
m4trace:configure.ac:27: -1- AH_OUTPUT([AC_APPLE_UNIVERSAL_BUILD], [/* Define if building universal (internal helper macro) */
|
||||
@%:@undef AC_APPLE_UNIVERSAL_BUILD])
|
||||
m4trace:configure.ac:30: -1- AC_DEFINE_TRACE_LITERAL([_FILE_OFFSET_BITS])
|
||||
m4trace:configure.ac:30: -1- m4_pattern_allow([^_FILE_OFFSET_BITS$])
|
||||
m4trace:configure.ac:30: -1- AH_OUTPUT([_FILE_OFFSET_BITS], [/* Number of bits in a file offset, on hosts where this is settable. */
|
||||
@%:@undef _FILE_OFFSET_BITS])
|
||||
m4trace:configure.ac:30: -1- AC_DEFINE_TRACE_LITERAL([_LARGE_FILES])
|
||||
m4trace:configure.ac:30: -1- m4_pattern_allow([^_LARGE_FILES$])
|
||||
m4trace:configure.ac:30: -1- AH_OUTPUT([_LARGE_FILES], [/* Define for large files, on AIX-style hosts. */
|
||||
@%:@undef _LARGE_FILES])
|
||||
m4trace:configure.ac:30: -1- AH_OUTPUT([_DARWIN_USE_64_BIT_INODE], [/* Enable large inode numbers on Mac OS X 10.5. */
|
||||
#ifndef _DARWIN_USE_64_BIT_INODE
|
||||
# define _DARWIN_USE_64_BIT_INODE 1
|
||||
#endif])
|
||||
m4trace:configure.ac:31: -1- AC_DEFINE_TRACE_LITERAL([off_t])
|
||||
m4trace:configure.ac:31: -1- m4_pattern_allow([^off_t$])
|
||||
m4trace:configure.ac:31: -1- AH_OUTPUT([off_t], [/* Define to `long int\' if <sys/types.h> does not define. */
|
||||
@%:@undef off_t])
|
||||
m4trace:configure.ac:32: -1- AC_DEFINE_TRACE_LITERAL([size_t])
|
||||
m4trace:configure.ac:32: -1- m4_pattern_allow([^size_t$])
|
||||
m4trace:configure.ac:32: -1- AH_OUTPUT([size_t], [/* Define to `unsigned int\' if <sys/types.h> does not define. */
|
||||
@%:@undef size_t])
|
||||
m4trace:configure.ac:54: -1- AC_SUBST([TEST_BIN])
|
||||
m4trace:configure.ac:54: -1- AC_SUBST_TRACE([TEST_BIN])
|
||||
m4trace:configure.ac:54: -1- m4_pattern_allow([^TEST_BIN$])
|
||||
m4trace:configure.ac:60: -1- AM_CONDITIONAL([ENABLE_WERROR], [test "$enable_werror" = "yes"])
|
||||
m4trace:configure.ac:60: -1- AC_SUBST([ENABLE_WERROR_TRUE])
|
||||
m4trace:configure.ac:60: -1- AC_SUBST_TRACE([ENABLE_WERROR_TRUE])
|
||||
m4trace:configure.ac:60: -1- m4_pattern_allow([^ENABLE_WERROR_TRUE$])
|
||||
m4trace:configure.ac:60: -1- AC_SUBST([ENABLE_WERROR_FALSE])
|
||||
m4trace:configure.ac:60: -1- AC_SUBST_TRACE([ENABLE_WERROR_FALSE])
|
||||
m4trace:configure.ac:60: -1- m4_pattern_allow([^ENABLE_WERROR_FALSE$])
|
||||
m4trace:configure.ac:60: -1- _AM_SUBST_NOTMAKE([ENABLE_WERROR_TRUE])
|
||||
m4trace:configure.ac:60: -1- _AM_SUBST_NOTMAKE([ENABLE_WERROR_FALSE])
|
||||
m4trace:configure.ac:62: -1- AC_SUBST([WERROR_CFLAGS])
|
||||
m4trace:configure.ac:62: -1- AC_SUBST_TRACE([WERROR_CFLAGS])
|
||||
m4trace:configure.ac:62: -1- m4_pattern_allow([^WERROR_CFLAGS$])
|
||||
m4trace:configure.ac:70: -1- AM_CONDITIONAL([ENABLE_COVERAGE], [test "$enable_coverage" = "yes"])
|
||||
m4trace:configure.ac:70: -1- AC_SUBST([ENABLE_COVERAGE_TRUE])
|
||||
m4trace:configure.ac:70: -1- AC_SUBST_TRACE([ENABLE_COVERAGE_TRUE])
|
||||
m4trace:configure.ac:70: -1- m4_pattern_allow([^ENABLE_COVERAGE_TRUE$])
|
||||
m4trace:configure.ac:70: -1- AC_SUBST([ENABLE_COVERAGE_FALSE])
|
||||
m4trace:configure.ac:70: -1- AC_SUBST_TRACE([ENABLE_COVERAGE_FALSE])
|
||||
m4trace:configure.ac:70: -1- m4_pattern_allow([^ENABLE_COVERAGE_FALSE$])
|
||||
m4trace:configure.ac:70: -1- _AM_SUBST_NOTMAKE([ENABLE_COVERAGE_TRUE])
|
||||
m4trace:configure.ac:70: -1- _AM_SUBST_NOTMAKE([ENABLE_COVERAGE_FALSE])
|
||||
m4trace:configure.ac:72: -1- AC_SUBST([COVERAGE_CFLAGS])
|
||||
m4trace:configure.ac:72: -1- AC_SUBST_TRACE([COVERAGE_CFLAGS])
|
||||
m4trace:configure.ac:72: -1- m4_pattern_allow([^COVERAGE_CFLAGS$])
|
||||
m4trace:configure.ac:72: -1- AC_SUBST([COVERAGE_LIBS])
|
||||
m4trace:configure.ac:72: -1- AC_SUBST_TRACE([COVERAGE_LIBS])
|
||||
m4trace:configure.ac:72: -1- m4_pattern_allow([^COVERAGE_LIBS$])
|
||||
m4trace:configure.ac:72: -1- AC_SUBST([LCOV])
|
||||
m4trace:configure.ac:72: -1- AC_SUBST_TRACE([LCOV])
|
||||
m4trace:configure.ac:72: -1- m4_pattern_allow([^LCOV$])
|
||||
m4trace:configure.ac:72: -1- AC_SUBST([GENHTML])
|
||||
m4trace:configure.ac:72: -1- AC_SUBST_TRACE([GENHTML])
|
||||
m4trace:configure.ac:72: -1- m4_pattern_allow([^GENHTML$])
|
||||
m4trace:configure.ac:72: -1- AC_SUBST([LCOV])
|
||||
m4trace:configure.ac:72: -1- AC_SUBST_TRACE([LCOV])
|
||||
m4trace:configure.ac:72: -1- m4_pattern_allow([^LCOV$])
|
||||
m4trace:configure.ac:72: -1- AC_SUBST([GENHTML])
|
||||
m4trace:configure.ac:72: -1- AC_SUBST_TRACE([GENHTML])
|
||||
m4trace:configure.ac:72: -1- m4_pattern_allow([^GENHTML$])
|
||||
m4trace:configure.ac:91: -1- AM_CONDITIONAL([ENABLE_VALGRIND], [test "$enable_valgrind" = "yes"])
|
||||
m4trace:configure.ac:91: -1- AC_SUBST([ENABLE_VALGRIND_TRUE])
|
||||
m4trace:configure.ac:91: -1- AC_SUBST_TRACE([ENABLE_VALGRIND_TRUE])
|
||||
m4trace:configure.ac:91: -1- m4_pattern_allow([^ENABLE_VALGRIND_TRUE$])
|
||||
m4trace:configure.ac:91: -1- AC_SUBST([ENABLE_VALGRIND_FALSE])
|
||||
m4trace:configure.ac:91: -1- AC_SUBST_TRACE([ENABLE_VALGRIND_FALSE])
|
||||
m4trace:configure.ac:91: -1- m4_pattern_allow([^ENABLE_VALGRIND_FALSE$])
|
||||
m4trace:configure.ac:91: -1- _AM_SUBST_NOTMAKE([ENABLE_VALGRIND_TRUE])
|
||||
m4trace:configure.ac:91: -1- _AM_SUBST_NOTMAKE([ENABLE_VALGRIND_FALSE])
|
||||
m4trace:configure.ac:93: -1- AC_SUBST([VALGRIND])
|
||||
m4trace:configure.ac:93: -1- AC_SUBST_TRACE([VALGRIND])
|
||||
m4trace:configure.ac:93: -1- m4_pattern_allow([^VALGRIND$])
|
||||
m4trace:configure.ac:93: -1- AC_SUBST([VALGRIND])
|
||||
m4trace:configure.ac:93: -1- AC_SUBST_TRACE([VALGRIND])
|
||||
m4trace:configure.ac:93: -1- m4_pattern_allow([^VALGRIND$])
|
||||
m4trace:configure.ac:106: -1- AM_CONDITIONAL([ENABLE_DOCUMENTATION], [test "$enable_documentation" = "yes"])
|
||||
m4trace:configure.ac:106: -1- AC_SUBST([ENABLE_DOCUMENTATION_TRUE])
|
||||
m4trace:configure.ac:106: -1- AC_SUBST_TRACE([ENABLE_DOCUMENTATION_TRUE])
|
||||
m4trace:configure.ac:106: -1- m4_pattern_allow([^ENABLE_DOCUMENTATION_TRUE$])
|
||||
m4trace:configure.ac:106: -1- AC_SUBST([ENABLE_DOCUMENTATION_FALSE])
|
||||
m4trace:configure.ac:106: -1- AC_SUBST_TRACE([ENABLE_DOCUMENTATION_FALSE])
|
||||
m4trace:configure.ac:106: -1- m4_pattern_allow([^ENABLE_DOCUMENTATION_FALSE$])
|
||||
m4trace:configure.ac:106: -1- _AM_SUBST_NOTMAKE([ENABLE_DOCUMENTATION_TRUE])
|
||||
m4trace:configure.ac:106: -1- _AM_SUBST_NOTMAKE([ENABLE_DOCUMENTATION_FALSE])
|
||||
m4trace:configure.ac:108: -1- AC_SUBST([A2X])
|
||||
m4trace:configure.ac:108: -1- AC_SUBST_TRACE([A2X])
|
||||
m4trace:configure.ac:108: -1- m4_pattern_allow([^A2X$])
|
||||
m4trace:configure.ac:108: -1- AC_SUBST([ASCIIDOC])
|
||||
m4trace:configure.ac:108: -1- AC_SUBST_TRACE([ASCIIDOC])
|
||||
m4trace:configure.ac:108: -1- m4_pattern_allow([^ASCIIDOC$])
|
||||
m4trace:configure.ac:130: -1- m4_pattern_forbid([^_?PKG_[A-Z_]+$])
|
||||
m4trace:configure.ac:130: -1- m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$])
|
||||
m4trace:configure.ac:130: -1- m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$])
|
||||
m4trace:configure.ac:130: -1- AC_SUBST([PKG_CONFIG])
|
||||
m4trace:configure.ac:130: -1- AC_SUBST_TRACE([PKG_CONFIG])
|
||||
m4trace:configure.ac:130: -1- m4_pattern_allow([^PKG_CONFIG$])
|
||||
m4trace:configure.ac:130: -1- AC_SUBST([PKG_CONFIG_PATH])
|
||||
m4trace:configure.ac:130: -1- AC_SUBST_TRACE([PKG_CONFIG_PATH])
|
||||
m4trace:configure.ac:130: -1- m4_pattern_allow([^PKG_CONFIG_PATH$])
|
||||
m4trace:configure.ac:130: -1- AC_SUBST([PKG_CONFIG_LIBDIR])
|
||||
m4trace:configure.ac:130: -1- AC_SUBST_TRACE([PKG_CONFIG_LIBDIR])
|
||||
m4trace:configure.ac:130: -1- m4_pattern_allow([^PKG_CONFIG_LIBDIR$])
|
||||
m4trace:configure.ac:130: -1- AC_SUBST([PKG_CONFIG])
|
||||
m4trace:configure.ac:130: -1- AC_SUBST_TRACE([PKG_CONFIG])
|
||||
m4trace:configure.ac:130: -1- m4_pattern_allow([^PKG_CONFIG$])
|
||||
m4trace:configure.ac:137: -1- AC_SUBST([FLAC_CFLAGS])
|
||||
m4trace:configure.ac:137: -1- AC_SUBST_TRACE([FLAC_CFLAGS])
|
||||
m4trace:configure.ac:137: -1- m4_pattern_allow([^FLAC_CFLAGS$])
|
||||
m4trace:configure.ac:137: -1- AC_SUBST([FLAC_LIBS])
|
||||
m4trace:configure.ac:137: -1- AC_SUBST_TRACE([FLAC_LIBS])
|
||||
m4trace:configure.ac:137: -1- m4_pattern_allow([^FLAC_LIBS$])
|
||||
m4trace:configure.ac:147: -1- AC_SUBST([FLAC_CFLAGS])
|
||||
m4trace:configure.ac:147: -1- AC_SUBST_TRACE([FLAC_CFLAGS])
|
||||
m4trace:configure.ac:147: -1- m4_pattern_allow([^FLAC_CFLAGS$])
|
||||
m4trace:configure.ac:148: -1- AC_SUBST([FLAC_LIBS])
|
||||
m4trace:configure.ac:148: -1- AC_SUBST_TRACE([FLAC_LIBS])
|
||||
m4trace:configure.ac:148: -1- m4_pattern_allow([^FLAC_LIBS$])
|
||||
m4trace:configure.ac:150: -1- AM_CONDITIONAL([ENABLE_FLAC], [test "$enable_flac" = "yes"])
|
||||
m4trace:configure.ac:150: -1- AC_SUBST([ENABLE_FLAC_TRUE])
|
||||
m4trace:configure.ac:150: -1- AC_SUBST_TRACE([ENABLE_FLAC_TRUE])
|
||||
m4trace:configure.ac:150: -1- m4_pattern_allow([^ENABLE_FLAC_TRUE$])
|
||||
m4trace:configure.ac:150: -1- AC_SUBST([ENABLE_FLAC_FALSE])
|
||||
m4trace:configure.ac:150: -1- AC_SUBST_TRACE([ENABLE_FLAC_FALSE])
|
||||
m4trace:configure.ac:150: -1- m4_pattern_allow([^ENABLE_FLAC_FALSE$])
|
||||
m4trace:configure.ac:150: -1- _AM_SUBST_NOTMAKE([ENABLE_FLAC_TRUE])
|
||||
m4trace:configure.ac:150: -1- _AM_SUBST_NOTMAKE([ENABLE_FLAC_FALSE])
|
||||
m4trace:configure.ac:152: -1- AC_DEFINE_TRACE_LITERAL([ENABLE_FLAC])
|
||||
m4trace:configure.ac:152: -1- m4_pattern_allow([^ENABLE_FLAC$])
|
||||
m4trace:configure.ac:152: -1- AH_OUTPUT([ENABLE_FLAC], [/* Whether FLAC is enabled. */
|
||||
@%:@undef ENABLE_FLAC])
|
||||
m4trace:configure.ac:154: -1- AC_DEFINE_TRACE_LITERAL([ENABLE_FLAC])
|
||||
m4trace:configure.ac:154: -1- m4_pattern_allow([^ENABLE_FLAC$])
|
||||
m4trace:configure.ac:154: -1- AH_OUTPUT([ENABLE_FLAC], [/* Whether FLAC is enabled. */
|
||||
@%:@undef ENABLE_FLAC])
|
||||
m4trace:configure.ac:157: -1- AC_CONFIG_FILES([
|
||||
audiofile.spec
|
||||
audiofile.pc
|
||||
audiofile-uninstalled.pc
|
||||
sfcommands/Makefile
|
||||
test/Makefile
|
||||
gtest/Makefile
|
||||
examples/Makefile
|
||||
libaudiofile/Makefile
|
||||
libaudiofile/alac/Makefile
|
||||
libaudiofile/modules/Makefile
|
||||
docs/Makefile
|
||||
Makefile])
|
||||
m4trace:configure.ac:170: -1- AC_SUBST([LIB@&t@OBJS], [$ac_libobjs])
|
||||
m4trace:configure.ac:170: -1- AC_SUBST_TRACE([LIB@&t@OBJS])
|
||||
m4trace:configure.ac:170: -1- m4_pattern_allow([^LIB@&t@OBJS$])
|
||||
m4trace:configure.ac:170: -1- AC_SUBST([LTLIBOBJS], [$ac_ltlibobjs])
|
||||
m4trace:configure.ac:170: -1- AC_SUBST_TRACE([LTLIBOBJS])
|
||||
m4trace:configure.ac:170: -1- m4_pattern_allow([^LTLIBOBJS$])
|
||||
m4trace:configure.ac:170: -1- AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])
|
||||
m4trace:configure.ac:170: -1- AC_SUBST([am__EXEEXT_TRUE])
|
||||
m4trace:configure.ac:170: -1- AC_SUBST_TRACE([am__EXEEXT_TRUE])
|
||||
m4trace:configure.ac:170: -1- m4_pattern_allow([^am__EXEEXT_TRUE$])
|
||||
m4trace:configure.ac:170: -1- AC_SUBST([am__EXEEXT_FALSE])
|
||||
m4trace:configure.ac:170: -1- AC_SUBST_TRACE([am__EXEEXT_FALSE])
|
||||
m4trace:configure.ac:170: -1- m4_pattern_allow([^am__EXEEXT_FALSE$])
|
||||
m4trace:configure.ac:170: -1- _AM_SUBST_NOTMAKE([am__EXEEXT_TRUE])
|
||||
m4trace:configure.ac:170: -1- _AM_SUBST_NOTMAKE([am__EXEEXT_FALSE])
|
||||
m4trace:configure.ac:170: -1- AC_SUBST_TRACE([top_builddir])
|
||||
m4trace:configure.ac:170: -1- AC_SUBST_TRACE([top_build_prefix])
|
||||
m4trace:configure.ac:170: -1- AC_SUBST_TRACE([srcdir])
|
||||
m4trace:configure.ac:170: -1- AC_SUBST_TRACE([abs_srcdir])
|
||||
m4trace:configure.ac:170: -1- AC_SUBST_TRACE([top_srcdir])
|
||||
m4trace:configure.ac:170: -1- AC_SUBST_TRACE([abs_top_srcdir])
|
||||
m4trace:configure.ac:170: -1- AC_SUBST_TRACE([builddir])
|
||||
m4trace:configure.ac:170: -1- AC_SUBST_TRACE([abs_builddir])
|
||||
m4trace:configure.ac:170: -1- AC_SUBST_TRACE([abs_top_builddir])
|
||||
m4trace:configure.ac:170: -1- AC_SUBST_TRACE([INSTALL])
|
||||
m4trace:configure.ac:170: -1- AC_SUBST_TRACE([MKDIR_P])
|
||||
m4trace:configure.ac:170: -1- AC_REQUIRE_AUX_FILE([ltmain.sh])
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -1,103 +0,0 @@
|
|||
/* config.h. Generated from config.h.in by configure. */
|
||||
/* config.h.in. Generated from configure.ac by autoheader. */
|
||||
|
||||
/* Define if building universal (internal helper macro) */
|
||||
/* #undef AC_APPLE_UNIVERSAL_BUILD */
|
||||
|
||||
/* Whether FLAC is enabled. */
|
||||
#define ENABLE_FLAC 0
|
||||
|
||||
/* Define to 1 if you have the <dlfcn.h> header file. */
|
||||
/* #undef HAVE_DLFCN_H */
|
||||
|
||||
/* Define to 1 if you have the <fcntl.h> header file. */
|
||||
#define HAVE_FCNTL_H 1
|
||||
|
||||
/* Define to 1 if you have the <inttypes.h> header file. */
|
||||
#define HAVE_INTTYPES_H 1
|
||||
|
||||
/* Define to 1 if you have the <memory.h> header file. */
|
||||
#define HAVE_MEMORY_H 1
|
||||
|
||||
/* Define to 1 if you have the <stdint.h> header file. */
|
||||
#define HAVE_STDINT_H 1
|
||||
|
||||
/* Define to 1 if you have the <stdlib.h> header file. */
|
||||
#define HAVE_STDLIB_H 1
|
||||
|
||||
/* Define to 1 if you have the <strings.h> header file. */
|
||||
#define HAVE_STRINGS_H 1
|
||||
|
||||
/* Define to 1 if you have the <string.h> header file. */
|
||||
#define HAVE_STRING_H 1
|
||||
|
||||
/* Define to 1 if you have the <sys/stat.h> header file. */
|
||||
#define HAVE_SYS_STAT_H 1
|
||||
|
||||
/* Define to 1 if you have the <sys/types.h> header file. */
|
||||
#define HAVE_SYS_TYPES_H 1
|
||||
|
||||
/* Define to 1 if you have the <unistd.h> header file. */
|
||||
#define HAVE_UNISTD_H 1
|
||||
|
||||
/* Define to the sub-directory where libtool stores uninstalled libraries. */
|
||||
#define LT_OBJDIR ".libs/"
|
||||
|
||||
/* Name of package */
|
||||
#define PACKAGE "audiofile"
|
||||
|
||||
/* Define to the address where bug reports for this package should be sent. */
|
||||
#define PACKAGE_BUGREPORT ""
|
||||
|
||||
/* Define to the full name of this package. */
|
||||
#define PACKAGE_NAME "audiofile"
|
||||
|
||||
/* Define to the full name and version of this package. */
|
||||
#define PACKAGE_STRING "audiofile 0.3.6"
|
||||
|
||||
/* Define to the one symbol short name of this package. */
|
||||
#define PACKAGE_TARNAME "audiofile"
|
||||
|
||||
/* Define to the home page for this package. */
|
||||
#define PACKAGE_URL ""
|
||||
|
||||
/* Define to the version of this package. */
|
||||
#define PACKAGE_VERSION "0.3.6"
|
||||
|
||||
/* Define to 1 if you have the ANSI C header files. */
|
||||
#define STDC_HEADERS 1
|
||||
|
||||
/* Version number of package */
|
||||
#define VERSION "0.3.6"
|
||||
|
||||
/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
|
||||
significant byte first (like Motorola and SPARC, unlike Intel). */
|
||||
#if defined AC_APPLE_UNIVERSAL_BUILD
|
||||
# if defined __BIG_ENDIAN__
|
||||
# define WORDS_BIGENDIAN 1
|
||||
# endif
|
||||
#else
|
||||
# ifndef WORDS_BIGENDIAN
|
||||
/* # undef WORDS_BIGENDIAN */
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* Enable large inode numbers on Mac OS X 10.5. */
|
||||
#ifndef _DARWIN_USE_64_BIT_INODE
|
||||
# define _DARWIN_USE_64_BIT_INODE 1
|
||||
#endif
|
||||
|
||||
/* Number of bits in a file offset, on hosts where this is settable. */
|
||||
#define _FILE_OFFSET_BITS 64
|
||||
|
||||
/* Define for large files, on AIX-style hosts. */
|
||||
/* #undef _LARGE_FILES */
|
||||
|
||||
/* Define to empty if `const' does not conform to ANSI C. */
|
||||
/* #undef const */
|
||||
|
||||
/* Define to `long int' if <sys/types.h> does not define. */
|
||||
/* #undef off_t */
|
||||
|
||||
/* Define to `unsigned int' if <sys/types.h> does not define. */
|
||||
/* #undef size_t */
|
|
@ -1,102 +0,0 @@
|
|||
/* config.h.in. Generated from configure.ac by autoheader. */
|
||||
|
||||
/* Define if building universal (internal helper macro) */
|
||||
#undef AC_APPLE_UNIVERSAL_BUILD
|
||||
|
||||
/* Whether FLAC is enabled. */
|
||||
#undef ENABLE_FLAC
|
||||
|
||||
/* Define to 1 if you have the <dlfcn.h> header file. */
|
||||
#undef HAVE_DLFCN_H
|
||||
|
||||
/* Define to 1 if you have the <fcntl.h> header file. */
|
||||
#undef HAVE_FCNTL_H
|
||||
|
||||
/* Define to 1 if you have the <inttypes.h> header file. */
|
||||
#undef HAVE_INTTYPES_H
|
||||
|
||||
/* Define to 1 if you have the <memory.h> header file. */
|
||||
#undef HAVE_MEMORY_H
|
||||
|
||||
/* Define to 1 if you have the <stdint.h> header file. */
|
||||
#undef HAVE_STDINT_H
|
||||
|
||||
/* Define to 1 if you have the <stdlib.h> header file. */
|
||||
#undef HAVE_STDLIB_H
|
||||
|
||||
/* Define to 1 if you have the <strings.h> header file. */
|
||||
#undef HAVE_STRINGS_H
|
||||
|
||||
/* Define to 1 if you have the <string.h> header file. */
|
||||
#undef HAVE_STRING_H
|
||||
|
||||
/* Define to 1 if you have the <sys/stat.h> header file. */
|
||||
#undef HAVE_SYS_STAT_H
|
||||
|
||||
/* Define to 1 if you have the <sys/types.h> header file. */
|
||||
#undef HAVE_SYS_TYPES_H
|
||||
|
||||
/* Define to 1 if you have the <unistd.h> header file. */
|
||||
#undef HAVE_UNISTD_H
|
||||
|
||||
/* Define to the sub-directory where libtool stores uninstalled libraries. */
|
||||
#undef LT_OBJDIR
|
||||
|
||||
/* Name of package */
|
||||
#undef PACKAGE
|
||||
|
||||
/* Define to the address where bug reports for this package should be sent. */
|
||||
#undef PACKAGE_BUGREPORT
|
||||
|
||||
/* Define to the full name of this package. */
|
||||
#undef PACKAGE_NAME
|
||||
|
||||
/* Define to the full name and version of this package. */
|
||||
#undef PACKAGE_STRING
|
||||
|
||||
/* Define to the one symbol short name of this package. */
|
||||
#undef PACKAGE_TARNAME
|
||||
|
||||
/* Define to the home page for this package. */
|
||||
#undef PACKAGE_URL
|
||||
|
||||
/* Define to the version of this package. */
|
||||
#undef PACKAGE_VERSION
|
||||
|
||||
/* Define to 1 if you have the ANSI C header files. */
|
||||
#undef STDC_HEADERS
|
||||
|
||||
/* Version number of package */
|
||||
#undef VERSION
|
||||
|
||||
/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
|
||||
significant byte first (like Motorola and SPARC, unlike Intel). */
|
||||
#if defined AC_APPLE_UNIVERSAL_BUILD
|
||||
# if defined __BIG_ENDIAN__
|
||||
# define WORDS_BIGENDIAN 1
|
||||
# endif
|
||||
#else
|
||||
# ifndef WORDS_BIGENDIAN
|
||||
# undef WORDS_BIGENDIAN
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* Enable large inode numbers on Mac OS X 10.5. */
|
||||
#ifndef _DARWIN_USE_64_BIT_INODE
|
||||
# define _DARWIN_USE_64_BIT_INODE 1
|
||||
#endif
|
||||
|
||||
/* Number of bits in a file offset, on hosts where this is settable. */
|
||||
#undef _FILE_OFFSET_BITS
|
||||
|
||||
/* Define for large files, on AIX-style hosts. */
|
||||
#undef _LARGE_FILES
|
||||
|
||||
/* Define to empty if `const' does not conform to ANSI C. */
|
||||
#undef const
|
||||
|
||||
/* Define to `long int' if <sys/types.h> does not define. */
|
||||
#undef off_t
|
||||
|
||||
/* Define to `unsigned int' if <sys/types.h> does not define. */
|
||||
#undef size_t
|
|
@ -1,103 +0,0 @@
|
|||
/* config.h.in. Generated from configure.ac by autoheader. */
|
||||
|
||||
/* Define if building universal (internal helper macro) */
|
||||
#undef AC_APPLE_UNIVERSAL_BUILD
|
||||
|
||||
/* Whether FLAC is enabled. */
|
||||
#undef ENABLE_FLAC
|
||||
|
||||
/* Define to 1 if you have the <dlfcn.h> header file. */
|
||||
#undef HAVE_DLFCN_H
|
||||
|
||||
/* Define to 1 if you have the <fcntl.h> header file. */
|
||||
#undef HAVE_FCNTL_H
|
||||
|
||||
/* Define to 1 if you have the <inttypes.h> header file. */
|
||||
#undef HAVE_INTTYPES_H
|
||||
|
||||
/* Define to 1 if you have the <memory.h> header file. */
|
||||
#undef HAVE_MEMORY_H
|
||||
|
||||
/* Define to 1 if you have the <stdint.h> header file. */
|
||||
#undef HAVE_STDINT_H
|
||||
|
||||
/* Define to 1 if you have the <stdlib.h> header file. */
|
||||
#undef HAVE_STDLIB_H
|
||||
|
||||
/* Define to 1 if you have the <strings.h> header file. */
|
||||
#undef HAVE_STRINGS_H
|
||||
|
||||
/* Define to 1 if you have the <string.h> header file. */
|
||||
#undef HAVE_STRING_H
|
||||
|
||||
/* Define to 1 if you have the <sys/stat.h> header file. */
|
||||
#undef HAVE_SYS_STAT_H
|
||||
|
||||
/* Define to 1 if you have the <sys/types.h> header file. */
|
||||
#undef HAVE_SYS_TYPES_H
|
||||
|
||||
/* Define to 1 if you have the <unistd.h> header file. */
|
||||
#undef HAVE_UNISTD_H
|
||||
|
||||
/* Define to the sub-directory in which libtool stores uninstalled libraries.
|
||||
*/
|
||||
#undef LT_OBJDIR
|
||||
|
||||
/* Name of package */
|
||||
#undef PACKAGE
|
||||
|
||||
/* Define to the address where bug reports for this package should be sent. */
|
||||
#undef PACKAGE_BUGREPORT
|
||||
|
||||
/* Define to the full name of this package. */
|
||||
#undef PACKAGE_NAME
|
||||
|
||||
/* Define to the full name and version of this package. */
|
||||
#undef PACKAGE_STRING
|
||||
|
||||
/* Define to the one symbol short name of this package. */
|
||||
#undef PACKAGE_TARNAME
|
||||
|
||||
/* Define to the home page for this package. */
|
||||
#undef PACKAGE_URL
|
||||
|
||||
/* Define to the version of this package. */
|
||||
#undef PACKAGE_VERSION
|
||||
|
||||
/* Define to 1 if you have the ANSI C header files. */
|
||||
#undef STDC_HEADERS
|
||||
|
||||
/* Version number of package */
|
||||
#undef VERSION
|
||||
|
||||
/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
|
||||
significant byte first (like Motorola and SPARC, unlike Intel). */
|
||||
#if defined AC_APPLE_UNIVERSAL_BUILD
|
||||
# if defined __BIG_ENDIAN__
|
||||
# define WORDS_BIGENDIAN 1
|
||||
# endif
|
||||
#else
|
||||
# ifndef WORDS_BIGENDIAN
|
||||
# undef WORDS_BIGENDIAN
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* Enable large inode numbers on Mac OS X 10.5. */
|
||||
#ifndef _DARWIN_USE_64_BIT_INODE
|
||||
# define _DARWIN_USE_64_BIT_INODE 1
|
||||
#endif
|
||||
|
||||
/* Number of bits in a file offset, on hosts where this is settable. */
|
||||
#undef _FILE_OFFSET_BITS
|
||||
|
||||
/* Define for large files, on AIX-style hosts. */
|
||||
#undef _LARGE_FILES
|
||||
|
||||
/* Define to empty if `const' does not conform to ANSI C. */
|
||||
#undef const
|
||||
|
||||
/* Define to `long int' if <sys/types.h> does not define. */
|
||||
#undef off_t
|
||||
|
||||
/* Define to `unsigned int' if <sys/types.h> does not define. */
|
||||
#undef size_t
|
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue