diff options
author | Sebastian Rasmussen <sebras@gmail.com> | 2025-04-09 19:33:46 +0200 |
---|---|---|
committer | Sebastian Rasmussen <sebras@gmail.com> | 2025-04-09 23:55:16 +0200 |
commit | 9586102c806cc859d3d0e4de7e1cf65d1e414be2 (patch) | |
tree | 4d96cfe325b0a2cb35f13d51197743a7bbe404ad | |
parent | 631414cb25920fa1308f7b03c8fc6794c6683c10 (diff) |
Always get GL cflags/libs from the system.
-rw-r--r-- | Makelists | 5 | ||||
-rw-r--r-- | Makerules | 13 | ||||
-rw-r--r-- | Makethird | 8 |
3 files changed, 15 insertions, 11 deletions
@@ -362,6 +362,7 @@ GLUT_BUILD_CFLAGS += -Ithirdparty/freeglut/src GLUT_BUILD_CFLAGS += -DHAVE_UNISTD_H GLUT_BUILD_CFLAGS += -DHAVE_STDINT_H GLUT_BUILD_CFLAGS += -DHAVE_X11_EXTENSIONS_XRANDR_H +GLUT_BUILD_CFLAGS += $(SYS_GL_CFLAGS) GLUT_SRC += thirdparty/freeglut/src/fg_callbacks.c GLUT_SRC += thirdparty/freeglut/src/fg_cursor.c @@ -406,9 +407,7 @@ GLUT_SRC += thirdparty/freeglut/src/x11/fg_window_x11.c GLUT_SRC += thirdparty/freeglut/src/x11/fg_window_x11_glx.c GLUT_SRC += thirdparty/freeglut/src/x11/fg_xinput_x11.c -GLUT_LIBS += -lGL -GLUT_LIBS += -lX11 -GLUT_LIBS += -lXrandr +GLUT_LIBS += $(SYS_GL_LIBS) # --- LEPTONICA (optional, used by Tesseract) --- @@ -265,12 +265,17 @@ else HAVE_GLUT := yes ifeq ($(HAVE_GLUT),yes) - ifeq ($(shell pkg-config --exists glut gl && echo yes),yes) - SYS_GLUT_CFLAGS := $(shell pkg-config --cflags glut gl) - SYS_GLUT_LIBS := $(shell pkg-config --libs glut gl) + ifneq ($(shell pkg-config --exists gl x11 xrandr && echo yes),yes) + $(error GLUT depends on gl, x11 and xrandr from the system, but some are missing) + endif + SYS_GL_CFLAGS := $(shell pkg-config --cflags gl x11 xrandr) + SYS_GL_LIBS := $(shell pkg-config --libs gl x11 xrandr) + ifeq ($(shell pkg-config --exists glut && echo yes),yes) + SYS_GLUT_CFLAGS := $(shell pkg-config --cflags glut) + SYS_GLUT_LIBS := $(shell pkg-config --libs glut) else SYS_GLUT_CFLAGS := - SYS_GLUT_LIBS := -lglut -lGL + SYS_GLUT_LIBS := -lglut endif endif @@ -240,11 +240,11 @@ endif # --- FreeGLUT --- ifeq ($(USE_SYSTEM_GLUT),yes) - THIRD_GLUT_CFLAGS += $(SYS_GLUT_CFLAGS) - THIRD_GLUT_LIBS += $(SYS_GLUT_LIBS) + THIRD_GLUT_CFLAGS += $(SYS_GLUT_CFLAGS) $(SYS_GL_CFLAGS) + THIRD_GLUT_LIBS += $(SYS_GLUT_LIBS) $(SYS_GL_LIB)S else - THIRD_GLUT_CFLAGS += $(GLUT_CFLAGS) - THIRD_GLUT_LIBS += $(GLUT_LIBS) + THIRD_GLUT_CFLAGS += $(GLUT_CFLAGS) $(SYS_GL_CFLAGS) + THIRD_GLUT_LIBS += $(GLUT_LIBS) $(SYS_GL_LIBS) THIRD_GLUT_SRC += $(GLUT_SRC) $(OUT)/thirdparty/freeglut/%.o: thirdparty/freeglut/%.c $(CC_CMD) $(LIB_CFLAGS) $(GLUT_CFLAGS) $(GLUT_BUILD_CFLAGS) |