Skip to content
Snippets Groups Projects
Commit 9bf6c8cb authored by deuce's avatar deuce
Browse files

Auto-detect presence of used X headers and set NO_X if they're not present.

Move X_HEADERS and X_PATH macros into Common.gmake rather than GNUmakefile
for no good reason.
parent 48aeda45
No related branches found
No related tags found
No related merge requests found
X_PATH ?= /usr/X11R6
X_HEADERS ?= $(X_PATH)$(DIRSEP)include
X_PRESENT = $(shell if [ ! \( -f $(X_HEADERS)$(DIRSEP)X11$(DIRSEP)Xlib.h -a -f $(X_HEADERS)$(DIRSEP)X11$(DIRSEP)Xutil.h -a -f $(X_HEADERS)$(DIRSEP)X11$(DIRSEP)keysym.h -a -f $(X_HEADERS)$(DIRSEP)X11$(DIRSEP)Xatom.h \) ] ; then echo NO ; else echo YES ; fi )
ifeq ($(X_PRESENT),NO)
NO_X=1
else
endif
ifeq ($(os),sunos) ifeq ($(os),sunos)
CIOLIB-MT_LIBS += $(UL_PRE)curses$(UL_SUF) CIOLIB-MT_LIBS += $(UL_PRE)curses$(UL_SUF)
else else
...@@ -5,7 +13,7 @@ else ...@@ -5,7 +13,7 @@ else
endif endif
ifndef NO_X ifndef NO_X
ifdef STATIC ifdef STATIC
CIOLIB-MT_LIBS += -L/usr/X11R6/lib -lX11 CIOLIB-MT_LIBS += -L$(X_PATH)$(DIRSEP)lib -lX11
else else
ifeq ($(os),linux) ifeq ($(os),linux)
CIOLIB-MT_LIBS += $(UL_PRE)dl$(UL_SUF) CIOLIB-MT_LIBS += $(UL_PRE)dl$(UL_SUF)
......
...@@ -3,15 +3,11 @@ SRC_ROOT = .. ...@@ -3,15 +3,11 @@ SRC_ROOT = ..
include $(SRC_ROOT)/build/Common.gmake # defines clean and output directory rules include $(SRC_ROOT)/build/Common.gmake # defines clean and output directory rules
CFLAGS += $(XPDEV-MT_CFLAGS) $(CIOLIB-MT_CFLAGS) CFLAGS += $(XPDEV-MT_CFLAGS) $(CIOLIB-MT_CFLAGS)
X_HEADERS ?= /usr/X11R6/include
OBJS += $(MTOBJODIR)$(DIRSEP)curs_cio$(OFILE) OBJS += $(MTOBJODIR)$(DIRSEP)curs_cio$(OFILE)
ifdef NO_X ifdef NO_X
CFLAGS += -DNO_X CFLAGS += -DNO_X
else else
ifdef X_PATH
X_HEADERS ?= $(X_PATH)$(DIRSEP)include
endif
CFLAGS += -I$(X_HEADERS) CFLAGS += -I$(X_HEADERS)
OBJS += $(MTOBJODIR)$(DIRSEP)console$(OFILE) \ OBJS += $(MTOBJODIR)$(DIRSEP)console$(OFILE) \
$(MTOBJODIR)$(DIRSEP)x_cio$(OFILE) $(MTOBJODIR)$(DIRSEP)x_cio$(OFILE)
...@@ -22,7 +18,7 @@ endif ...@@ -22,7 +18,7 @@ endif
$(MTOBJODIR)$(DIRSEP)console$(OFILE).static: $(MTOBJODIR)$(DIRSEP)console$(OFILE).static:
$(QUIET)$(DELETE) $(MTOBJODIR)$(DIRSEP)console$(OFILE)* $(QUIET)$(DELETE) $(MTOBJODIR)$(DIRSEP)console$(OFILE)*
$(QUIET)touch $(MTOBJODIR)$(DIRSEP)console$(OFILE).static $(QUIET)touch $(MTOBJODIR)$(DIRSEP)console$(OFILE).static
$(MTOBJODIR)$(DIRSEP)console$(OFILE).dynamic: $(MTOBJODIR)$(DIRSEP)console$(OFILE).dynamic:
$(QUIET)$(DELETE) $(MTOBJODIR)$(DIRSEP)console$(OFILE)* $(QUIET)$(DELETE) $(MTOBJODIR)$(DIRSEP)console$(OFILE)*
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment