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
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)
CIOLIB-MT_LIBS += $(UL_PRE)curses$(UL_SUF)
else
......@@ -5,7 +13,7 @@ else
endif
ifndef NO_X
ifdef STATIC
CIOLIB-MT_LIBS += -L/usr/X11R6/lib -lX11
CIOLIB-MT_LIBS += -L$(X_PATH)$(DIRSEP)lib -lX11
else
ifeq ($(os),linux)
CIOLIB-MT_LIBS += $(UL_PRE)dl$(UL_SUF)
......
......@@ -3,15 +3,11 @@ SRC_ROOT = ..
include $(SRC_ROOT)/build/Common.gmake # defines clean and output directory rules
CFLAGS += $(XPDEV-MT_CFLAGS) $(CIOLIB-MT_CFLAGS)
X_HEADERS ?= /usr/X11R6/include
OBJS += $(MTOBJODIR)$(DIRSEP)curs_cio$(OFILE)
ifdef NO_X
CFLAGS += -DNO_X
else
ifdef X_PATH
X_HEADERS ?= $(X_PATH)$(DIRSEP)include
endif
CFLAGS += -I$(X_HEADERS)
OBJS += $(MTOBJODIR)$(DIRSEP)console$(OFILE) \
$(MTOBJODIR)$(DIRSEP)x_cio$(OFILE)
......@@ -22,7 +18,7 @@ endif
$(MTOBJODIR)$(DIRSEP)console$(OFILE).static:
$(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:
$(QUIET)$(DELETE) $(MTOBJODIR)$(DIRSEP)console$(OFILE)*
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment