diff options
author | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2018-11-11 15:50:21 +0100 |
---|---|---|
committer | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2018-11-11 15:50:21 +0100 |
commit | 1a429016cfea09abe0255dd85a3cff4c7811c287 (patch) | |
tree | 497238577dbeb74273b1289d9a290116202ddb2c | |
parent | 93c9b8862e68a5be51852dbaaf8d2e005c0b2b54 (diff) | |
parent | f78a8b3ebe524403a8e055d1dc7a5863e44bc886 (diff) | |
download | nx-libs-1a429016cfea09abe0255dd85a3cff4c7811c287.tar.gz nx-libs-1a429016cfea09abe0255dd85a3cff4c7811c287.tar.bz2 nx-libs-1a429016cfea09abe0255dd85a3cff4c7811c287.zip |
Merge branch 'uli42-pr/fix_font_defines_once_more2' into 3.6.x
Attributes GH PR #736: https://github.com/ArcticaProject/nx-libs/pull/736
-rw-r--r-- | Makefile | 105 | ||||
-rw-r--r-- | nx-X11/config/cf/nxcompile.def | 30 | ||||
-rw-r--r-- | nx-X11/config/cf/xorg.cf | 2 |
3 files changed, 83 insertions, 54 deletions
@@ -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 @@ -25,36 +26,13 @@ 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 ?= -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 = \ @@ -84,21 +62,22 @@ 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 - rm -Rf nx-X11/extras/Mesa/.pc/ - rm -f nx-X11/config/cf/nxversion.def + 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 test: echo "No testing for NX (redistributed)" @@ -106,16 +85,34 @@ 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 -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/ @@ -140,10 +137,10 @@ 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} + cd nxcomp && autoreconf -vfsi && (${CONFIGURE}) && ${MAKE} cd nxproxy && autoreconf -vfsi && (${CONFIGURE}) && ${MAKE} build-full: build-env @@ -164,8 +161,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} @@ -209,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 @@ -252,20 +249,20 @@ 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 $(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 diff --git a/nx-X11/config/cf/nxcompile.def b/nx-X11/config/cf/nxcompile.def new file mode 100644 index 000000000..ff11b5962 --- /dev/null +++ b/nx-X11/config/cf/nxcompile.def @@ -0,0 +1,30 @@ +/* + Rules to have a much cleaner compilation output + + derived from Imake.rules +*/ + +#define RemoveFileQuiet(file) @$(RM) -f file \&>/dev/null + +#define RunPrintIfFailed(cmd) @cmd || { echo failed command: cmd; exit 1; } + +#define ObjectCompile(options) RemoveFileQuiet($@) @@\ + ClearmakeOSName \ + @echo \ \ CC $*.c @@\ + RunPrintIfFailed($(CC) -c $(CFLAGS) options $*.c) + +#define NormalLibraryTarget(libname,objlist) @@\ +AllTarget(LibraryTargetName(libname)) @@\ + @@\ +LibraryTargetName(libname): objlist $(EXTRALIBRARYDEPS) @@\ + @echo \ \ CCLD $@ @@\ + RemoveFileQuiet($@) @@\ + RunPrintIfFailed(MakeLibrary($@,objlist)) @@\ + RunPrintIfFailed(RanLibrary($@)) @@\ + RunPrintIfFailed(_LinkBuildLibrary($@)) + +#define DependTarget() @@\ +DependDependency() @@\ + @@\ +depend:: @@\ + RunPrintIfFailed($(DEPEND) $(DEPENDFLAGS) -- $(ALLDEFINES) $(DEPEND_DEFINES) -- $(SRCS)) diff --git a/nx-X11/config/cf/xorg.cf b/nx-X11/config/cf/xorg.cf index 6f1f43018..f9928b928 100644 --- a/nx-X11/config/cf/xorg.cf +++ b/nx-X11/config/cf/xorg.cf @@ -52,6 +52,8 @@ XORG_VERSION_CURRENT = XorgVersion RELEASE_VERSION = ReleaseVersion #if NXAgentServer +#include "nxconfig.def" +#include "nxcompile.def" #include "nxversion.def" #if !defined(nxVersionString) && \ |