From abf47feca16287f5380f129c4ddea0f2a5278d38 Mon Sep 17 00:00:00 2001 From: Ulrich Sibiller Date: Sat, 10 Nov 2018 14:46:23 +0100 Subject: Makefile: drop intermediate NX version vars --- Makefile | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 9213dda9c..ffd6322da 100644 --- a/Makefile +++ b/Makefile @@ -50,11 +50,6 @@ endif IMAKE_DEFINES ?= -NX_VERSION_MAJOR=$(shell ./version.sh 1) -NX_VERSION_MINOR=$(shell ./version.sh 2) -NX_VERSION_MICRO=$(shell ./version.sh 3) -NX_VERSION_PATCH=$(shell ./version.sh 4) - SHELL:=/bin/bash NX_X11_HEADERS = \ @@ -106,10 +101,10 @@ test: version: # prepare nx-X11/config/cf/nxversion.def sed \ - -e 's/###NX_VERSION_MAJOR###/$(NX_VERSION_MAJOR)/' \ - -e 's/###NX_VERSION_MINOR###/$(NX_VERSION_MINOR)/' \ - -e 's/###NX_VERSION_MICRO###/$(NX_VERSION_MICRO)/' \ - -e 's/###NX_VERSION_PATCH###/$(NX_VERSION_PATCH)/' \ + -e 's/###NX_VERSION_MAJOR###/$(shell ./version.sh 1)/' \ + -e 's/###NX_VERSION_MINOR###/$(shell ./version.sh 2)/' \ + -e 's/###NX_VERSION_MICRO###/$(shell ./version.sh 3)/' \ + -e 's/###NX_VERSION_PATCH###/$(shell ./version.sh 4)/' \ nx-X11/config/cf/nxversion.def.in \ > nx-X11/config/cf/nxversion.def -- cgit v1.2.3 From 77b3923129b2fd99f9c2232022a7a1ff438233fb Mon Sep 17 00:00:00 2001 From: Ulrich Sibiller Date: Sat, 10 Nov 2018 14:48:52 +0100 Subject: Makefile: Rework handling auto-determined values for imake create a new def file nxconfig.def and be fine. The settings in that file will be respected by all subsequent imake calls anywhere in the tree. --- Makefile | 49 +++++++++++++++++++++++++------------------------ 1 file changed, 25 insertions(+), 24 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index ffd6322da..f93fb28e3 100644 --- a/Makefile +++ b/Makefile @@ -25,27 +25,9 @@ USRLIBDIR ?= $(NXLIBDIR)/X11 INCLUDEDIR ?= $(PREFIX)/include CONFIGURE ?= ./configure --prefix="$(PREFIX)" -# use Xfont2 if available in the build env -FONT_DEFINES ?= $(shell pkg-config --modversion xfont2 1>/dev/null 2>/dev/null && echo "-DHAS_XFONT2") $(shell pkg-config --exists 'xfont < 1.4.2' 1>/dev/null 2>/dev/null && echo "-DLEGACY_XFONT1") -XFONTLIB ?= $(shell pkg-config --modversion xfont2 1>/dev/null 2>/dev/null && echo "-lXfont2" || echo "-lXfont") -IMAKE_FONT_DEFINES ?= $(shell pkg-config --modversion xfont2 1>/dev/null 2>/dev/null && echo "-DHasXfont2=YES" || echo "-DHasXfont2=NO") - -# Support older libXext versions. -XEXT_EXTRA_DEFINES ?= $(shell pkg-config --exists 'xextproto < 7.1.0' 1>/dev/null 2>/dev/null && echo "-DLEGACY_XEXT_PROTO") - # check if the xkbcomp devel pkg is available - we need it for the next step -HAS_XKBCOMP_DEVEL="yes" ifneq ($(shell pkg-config --exists xkbcomp && echo yes), yes) - $(warning xkbcomp devel package missing, using default values) - HAS_XKBCOMP_DEVEL="no" -endif - -# the system's directory with the xkb data files (this needs to be -# independent of Imake's ProjectRoot or the configure prefix.) -ifeq ($(HAS_XKBCOMP_DEVEL),yes) -XKB_SYS_DEFINES ?= -DSystemXkbConfigDir=$(shell pkg-config xkbcomp --variable=xkbconfigdir) -DSystemXkbBinDir=$(shell pkg-config xkbcomp --variable=prefix)/bin -else -XKB_SYS_DEFINES ?= -DSystemXkbConfigDir=/usr/share/X11/xkb -DSystemXkbBinDir=/usr/bin + $(warning xkbcomp devel package missing, using imake default values) endif IMAKE_DEFINES ?= @@ -94,6 +76,7 @@ distclean: clean if [ -x ./mesa-quilt ]; then ./mesa-quilt pop -a; fi rm -Rf nx-X11/extras/Mesa/.pc/ rm -f nx-X11/config/cf/nxversion.def + rm -f nx-X11/config/cf/nxconfig.def test: echo "No testing for NX (redistributed)" @@ -108,9 +91,27 @@ version: nx-X11/config/cf/nxversion.def.in \ > nx-X11/config/cf/nxversion.def -build-env: version +imakeconfig: + # auto-config some setting + + # check if system supports Xfont2 + (echo "#define HasXfont2 `pkg-config --exists xfont2 && echo YES || echo NO`") >nx-X11/config/cf/nxconfig.def + + # check if system has an _old_ release of Xfont1 + (echo "#define HasLegacyXfont1 `pkg-config --exists 'xfont < 1.4.2' && echo YES || echo NO`") >>nx-X11/config/cf/nxconfig.def + + # check if system has an _old_ release of XextProto + (echo "#define HasLegacyXextProto `pkg-config --exists 'xextproto < 7.1.0' && echo YES || echo NO`") >>nx-X11/config/cf/nxconfig.def + + # the system's directory with the xkb data and binary files (these + # needs to be independent of Imake's ProjectRoot or the configure + # prefix.) + (pkg-config --exists xkbcomp && echo "#define SystemXkbConfigDir `pkg-config xkbcomp --variable=xkbconfigdir`"; :) >>nx-X11/config/cf/nxconfig.def + (pkg-config --exists xkbcomp && echo "#define SystemXkbBinDir `pkg-config xkbcomp --variable=prefix`/bin"; :) >>nx-X11/config/cf/nxconfig.def + +build-env: version imakeconfig # prepare Makefiles and the nx-X11 symlinking magic - ${MAKE} -j1 -C nx-X11 BuildIncludes FONT_DEFINES="$(FONT_DEFINES)" XEXT_EXTRA_DEFINES="$(XEXT_EXTRA_DEFINES)" IMAKE_DEFINES="$(IMAKE_DEFINES) $(IMAKE_FONT_DEFINES) $(XKB_SYS_DEFINES)" + ${MAKE} -j1 -C nx-X11 BuildIncludes IMAKE_DEFINES="$(IMAKE_DEFINES)" # set up environment for libNX_X11 build (X11 header files) mkdir -p nx-X11/exports/include/nx-X11/ @@ -135,7 +136,7 @@ clean-env: version [ -d exports/include/nx-X11/Xtrans ] && $(RM_DIR) exports/include/nx-X11/Xtrans/ || : [ -d exports/include/nx-X11/ ] && $(RM_DIR) exports/include/nx-X11/ || : - ${MAKE} -j1 -C nx-X11 clean FONT_DEFINES="$(FONT_DEFINES)" XEXT_EXTRA_DEFINES="$(XEXT_EXTRA_DEFINES)" IMAKE_DEFINES="$(IMAKE_DEFINES) $(IMAKE_FONT_DEFINES) $(XKB_SYS_DEFINES)" + ${MAKE} -j1 -C nx-X11 clean IMAKE_DEFINES="$(IMAKE_DEFINES)" build-lite: cd nxcomp && autoreconf -vfsi && (${CONFIGURE}) && ${MAKE} @@ -159,8 +160,8 @@ build-full: build-env # build nxagent fourth ./mesa-quilt push -a - ${MAKE} -j1 -C nx-X11 BuildDependsOnly FONT_DEFINES="$(FONT_DEFINES)" XEXT_EXTRA_DEFINES="$(XEXT_EXTRA_DEFINES)" IMAKE_DEFINES="$(IMAKE_DEFINES) $(IMAKE_FONT_DEFINES) $(XKB_SYS_DEFINES)" - ${MAKE} -C nx-X11 World USRLIBDIR="$(USRLIBDIR)" SHLIBDIR="$(SHLIBDIR)" FONT_DEFINES="$(FONT_DEFINES)" XFONTLIB="$(XFONTLIB)" XEXT_EXTRA_DEFINES="$(XEXT_EXTRA_DEFINES)" IMAKE_DEFINES="$(IMAKE_DEFINES) $(IMAKE_FONT_DEFINES) $(XKB_SYS_DEFINES)" + ${MAKE} -j1 -C nx-X11 BuildDependsOnly IMAKE_DEFINES="$(IMAKE_DEFINES)" + ${MAKE} -C nx-X11 World USRLIBDIR="$(USRLIBDIR)" SHLIBDIR="$(SHLIBDIR)" IMAKE_DEFINES="$(IMAKE_DEFINES)" # build nxproxy fifth cd nxproxy && autoreconf -vfsi && (${CONFIGURE}) && ${MAKE} -- cgit v1.2.3 From 58615f9fc27e49066277ed419f76866711ef4e74 Mon Sep 17 00:00:00 2001 From: Ulrich Sibiller Date: Sat, 10 Nov 2018 14:26:15 +0100 Subject: Makefile: use (more) RM macros --- Makefile | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index f93fb28e3..9ea14c00e 100644 --- a/Makefile +++ b/Makefile @@ -14,6 +14,7 @@ SYMLINK_FILE=ln -f -s # helpers for "clean" and "uninstall" targets RM_FILE=rm -f RM_DIR=rmdir -p --ignore-fail-on-non-empty +RM_DIR_REC=rm -Rf ETCDIR_NX ?= /etc/nxagent PREFIX ?= /usr/local @@ -74,9 +75,9 @@ distclean: clean if test -f nxcompshad/Makefile; then ${MAKE} -C nxcompshad distclean; fi if test -d nx-X11; then ${MAKE} -C nx-X11 distclean; fi if [ -x ./mesa-quilt ]; then ./mesa-quilt pop -a; fi - rm -Rf nx-X11/extras/Mesa/.pc/ - rm -f nx-X11/config/cf/nxversion.def - rm -f nx-X11/config/cf/nxconfig.def + $(RM_DIR_REC) nx-X11/extras/Mesa/.pc/ + $(RM_FILE) nx-X11/config/cf/nxversion.def + $(RM_FILE) nx-X11/config/cf/nxconfig.def test: echo "No testing for NX (redistributed)" @@ -205,7 +206,7 @@ install-full: gzip $(DESTDIR)$(PREFIX)/share/man/man1/*.1 # create a clean nx-X11/.build-exports space - rm -Rf nx-X11/.build-exports + $(RM_DIR_REC) nx-X11/.build-exports mkdir -p nx-X11/.build-exports/include mkdir -p nx-X11/.build-exports/lib @@ -263,5 +264,5 @@ uninstall-full: $(RM_FILE) $(DESTDIR)$(PREFIX)/share/nx/VERSION.nxagent $(RM_DIR) $(DESTDIR)$(PREFIX)/share/nx/ - if test -d $(DESTDIR)$(NXLIBDIR); then rm -rf $(DESTDIR)$(NXLIBDIR); fi - if test -d $(DESTDIR)$(INCLUDEDIR)/nx; then rm -rf $(DESTDIR)$(INCLUDEDIR)/nx; fi + $(RM_DIR_REC) $(DESTDIR)$(NXLIBDIR) + $(RM_DIR_REC) $(DESTDIR)$(INCLUDEDIR)/nx -- cgit v1.2.3 From a93f64e4f48ac6e1d6926c8d5309fba53cdffd62 Mon Sep 17 00:00:00 2001 From: Ulrich Sibiller Date: Sat, 10 Nov 2018 14:26:49 +0100 Subject: Makefile: use test + && instead of if test/else/fi --- Makefile | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 9ea14c00e..9800f8313 100644 --- a/Makefile +++ b/Makefile @@ -62,19 +62,19 @@ NX_XTRANS_HEADERS = \ all: build clean: - if test -f nxcomp/Makefile; then ${MAKE} -C nxcomp clean; fi - if test -f nxproxy/Makefile; then ${MAKE} -C nxproxy clean; fi - if test -f nx-X11/lib/Makefile; then ${MAKE} -C nx-X11/lib clean; fi - if test -f nxcompshad/Makefile; then ${MAKE} -C nxcompshad clean; fi - if test -d nx-X11; then ${MAKE} clean-env; fi + test -f nxcomp/Makefile && ${MAKE} -C nxcomp clean + test -f nxproxy/Makefile && ${MAKE} -C nxproxy clean + test -f nx-X11/lib/Makefile && ${MAKE} -C nx-X11/lib clean + test -f nxcompshad/Makefile && ${MAKE} -C nxcompshad clean + test -d nx-X11 && ${MAKE} clean-env distclean: clean - if test -f nxcomp/Makefile; then ${MAKE} -C nxcomp distclean; fi - if test -f nxproxy/Makefile; then ${MAKE} -C nxproxy distclean; fi - if test -f nx-X11/lib/Makefile; then ${MAKE} -C nx-X11/lib distclean; fi - if test -f nxcompshad/Makefile; then ${MAKE} -C nxcompshad distclean; fi - if test -d nx-X11; then ${MAKE} -C nx-X11 distclean; fi - if [ -x ./mesa-quilt ]; then ./mesa-quilt pop -a; fi + test -f nxcomp/Makefile && ${MAKE} -C nxcomp distclean + test -f nxproxy/Makefile && ${MAKE} -C nxproxy distclean + test -f nx-X11/lib/Makefile && ${MAKE} -C nx-X11/lib distclean + test -f nxcompshad/Makefile && ${MAKE} -C nxcompshad distclean + test -d nx-X11 && ${MAKE} -C nx-X11 distclean + test -x ./mesa-quilt && ./mesa-quilt pop -a $(RM_DIR_REC) nx-X11/extras/Mesa/.pc/ $(RM_FILE) nx-X11/config/cf/nxversion.def $(RM_FILE) nx-X11/config/cf/nxconfig.def @@ -140,7 +140,7 @@ clean-env: version ${MAKE} -j1 -C nx-X11 clean IMAKE_DEFINES="$(IMAKE_DEFINES)" build-lite: - cd nxcomp && autoreconf -vfsi && (${CONFIGURE}) && ${MAKE} + cd nxcomp && autoreconf -vfsi && (${CONFIGURE}) && ${MAKE} cd nxproxy && autoreconf -vfsi && (${CONFIGURE}) && ${MAKE} build-full: build-env @@ -249,15 +249,15 @@ uninstall: [ ! -d nx-X11 ] || $(MAKE) uninstall-full uninstall-lite: - if test -f nxcomp/Makefile; then ${MAKE} -C nxcomp "$@"; fi - if test -f nxproxy/Makefile; then ${MAKE} -C nxproxy "$@"; fi + test -f nxcomp/Makefile && ${MAKE} -C nxcomp "$@" + test -f nxproxy/Makefile && ${MAKE} -C nxproxy "$@" $(RM_FILE) $(DESTDIR)$(PREFIX)/share/nx/VERSION.nxproxy $(RM_DIR) $(DESTDIR)$(PREFIX)/share/nx/ uninstall-full: - if test -f nxcompshad/Makefile; then ${MAKE} -C nxcompshad "$@"; fi - if test -f nx-X11/lib/Makefile; then ${MAKE} -C nx-X11/lib "$@"; fi + test -f nxcompshad/Makefile && ${MAKE} -C nxcompshad "$@" + test -f nx-X11/lib/Makefile && ${MAKE} -C nx-X11/lib "$@" $(RM_FILE) $(DESTDIR)$(BINDIR)/nxagent -- cgit v1.2.3