From 896830e23e8f94b17bdf386c191a885c972ea8a8 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Tue, 26 Sep 2017 23:45:31 +0200 Subject: gl: Remove GLFW and reinstate FreeGLUT. GLFW doesn't build on Visual Studio 2005 anymore, and I don't have time to keep up with the changes. So, we're switching back to FreeGLUT, which is more stable. I've added the two missing features that made us switch to GLFW in the first place: input methods and system clipboard support. If MuPDF is compiled with our version of FreeGLUT, we now use these functions: * glutKeyboardExtFunc * glutSetClipboard * glutGetClipboard --- Makethird | 157 ++++++++++++++++++++++++++++---------------------------------- 1 file changed, 71 insertions(+), 86 deletions(-) (limited to 'Makethird') diff --git a/Makethird b/Makethird index a226249c..f83be6cc 100644 --- a/Makethird +++ b/Makethird @@ -18,7 +18,7 @@ OPENJPEG_DIR := thirdparty/openjpeg/src/lib/openjp2 ZLIB_DIR := thirdparty/zlib CURL_DIR := thirdparty/curl -GLFW_DIR := thirdparty/glfw +GLUT_DIR := thirdparty/freeglut # --- MuJS --- @@ -659,92 +659,77 @@ CURL_CFLAGS := $(SYS_CURL_CFLAGS) CURL_LIBS := $(SYS_CURL_LIBS) endif -# --- GLFW --- - -ifneq "$(wildcard $(GLFW_DIR)/README.md)" "" - -GLFW_LIB := $(OUT)/libglfw.a -GLFW_OUT := $(OUT)/thirdparty/glfw - -ifeq "$(OS)" "MACOS" - -GLFW_SRC := \ - cocoa_init.m \ - cocoa_joystick.m \ - cocoa_monitor.m \ - cocoa_time.c \ - cocoa_window.m \ - context.c \ - init.c \ - input.c \ - monitor.c \ - nsgl_context.m \ - posix_tls.c \ - vulkan.c \ - window.c - -$(GLFW_OUT)/%.o: $(GLFW_DIR)/src/%.m | $(GLFW_OUT) - $(CC_CMD) -D_GLFW_COCOA -D_GLFW_USE_MENUBAR -D_GLFW_USE_RETINA -Wno-deprecated-declarations -$(GLFW_OUT)/%.o: $(GLFW_DIR)/src/%.c | $(GLFW_OUT) - $(CC_CMD) -D_GLFW_COCOA -D_GLFW_USE_MENUBAR -D_GLFW_USE_RETINA - -GLFW_OBJ := $(addprefix $(GLFW_OUT)/, $(GLFW_SRC)) -GLFW_OBJ := $(GLFW_OBJ:%.c=%.o) -GLFW_OBJ := $(GLFW_OBJ:%.m=%.o) - -$(GLFW_LIB): $(GLFW_OBJ) -GLFW_LIBS := -framework OpenGL -framework IOKit -framework CoreVideo -framework Cocoa - -else - -GLFW_SRC := \ - context.c \ - egl_context.c \ - glx_context.c \ - init.c \ - input.c \ - linux_joystick.c \ - monitor.c \ - posix_time.c \ - posix_tls.c \ - vulkan.c \ - window.c \ - x11_init.c \ - x11_monitor.c \ - x11_window.c \ - xkb_unicode.c - -$(GLFW_OUT)/%.o: $(GLFW_DIR)/src/%.c | $(GLFW_OUT) - $(CC_CMD) -D_GLFW_X11 -$(GLFW_LIB): $(addprefix $(GLFW_OUT)/, $(GLFW_SRC:%.c=%.o)) -GLFW_LIBS := -lGL -ldl -lX11 -lXcursor -lXrandr -lXinerama -lpthread - -endif - -GLFW_CFLAGS := -I$(GLFW_DIR)/include -$(GLFW_OUT): +# --- FreeGLUT --- + +ifneq "$(wildcard $(GLUT_DIR)/README)" "" + +HAVE_GLUT := yes + +GLUT_LIB := $(OUT)/libfreeglut.a +GLUT_OUT := $(OUT)/freeglut +GLUT_SRC := \ + fg_callbacks.c \ + fg_cursor.c \ + fg_display.c \ + fg_ext.c \ + fg_font.c \ + fg_font_data.c \ + fg_gamemode.c \ + fg_geometry.c \ + fg_gl2.c \ + fg_init.c \ + fg_input_devices.c \ + fg_joystick.c \ + fg_main.c \ + fg_menu.c \ + fg_misc.c \ + fg_overlay.c \ + fg_spaceball.c \ + fg_state.c \ + fg_stroke_mono_roman.c \ + fg_stroke_roman.c \ + fg_structure.c \ + fg_teapot.c \ + fg_videoresize.c \ + fg_window.c + +GLUT_X11_SRC := \ + fg_cursor_x11.c \ + fg_display_x11_glx.c \ + fg_ext_x11.c \ + fg_gamemode_x11.c \ + fg_glutfont_definitions_x11.c \ + fg_init_x11.c \ + fg_input_devices_x11.c \ + fg_joystick_x11.c \ + fg_main_x11.c \ + fg_menu_x11.c \ + fg_spaceball_x11.c \ + fg_state_x11.c \ + fg_state_x11_glx.c \ + fg_structure_x11.c \ + fg_window_x11.c \ + fg_window_x11_glx.c \ + fg_xinput_x11.c + +GLUT_OBJ := $(addprefix $(GLUT_OUT)/, $(GLUT_SRC:%.c=%.o)) +GLUT_OBJ += $(addprefix $(GLUT_OUT)/, $(GLUT_X11_SRC:%.c=%.o)) + +$(GLUT_LIB): $(GLUT_OBJ) +$(GLUT_OUT): $(MKDIR_CMD) - -GLFW_SRC_UNUSED := \ - mir_init.c \ - mir_monitor.c \ - mir_window.c \ - wgl_context.c \ - win32_init.c \ - win32_joystick.c \ - win32_monitor.c \ - win32_time.c \ - win32_tls.c \ - win32_window.c \ - wl_init.c \ - wl_monitor.c \ - wl_window.c \ - -HAVE_GLFW := yes - -else ifeq "$(HAVE_GLFW)" "yes" -GLFW_CFLAGS := $(SYS_GLFW_CFLAGS) -GLFW_LIBS := $(SYS_GLFW_LIBS) +$(GLUT_OUT)/%.o: $(GLUT_DIR)/src/%.c | $(GLUT_OUT) + $(CC_CMD) -I$(GLUT_DIR)/include -I$(GLUT_DIR)/src -Wno-unused-const-variable \ + -DHAVE_UNISTD_H -DHAVE_STDINT_H -DHAVE_X11_EXTENSIONS_XRANDR_H +$(GLUT_OUT)/%.o: $(GLUT_DIR)/src/x11/%.c | $(GLUT_OUT) + $(CC_CMD) -I$(GLUT_DIR)/include -I$(GLUT_DIR)/src \ + -DHAVE_UNISTD_H -DHAVE_STDINT_H -DHAVE_X11_EXTENSIONS_XRANDR_H + +GLUT_CFLAGS := -I$(GLUT_DIR)/include +GLUT_LIBS := -lGL -lX11 -lXrandr +else +GLUT_CFLAGS := $(SYS_GLUT_CFLAGS) +GLUT_LIBS := $(SYS_GLUT_LIBS) endif # --- X11 --- -- cgit v1.2.3