Make selecting which multi-monitor selection to use simpler
Use a single MULTIMON variable which can be set to either xrandr, xinerama or none and replace the previous system which used 2 variables for each extension which were then added to CFLAGS and instead append xrandr or xinerama respectively to pkg_config_packs so their availability can be checked with pkg-config. The main advantage of this is that the extension can now be set from the command like like so 'MULTIMON=xinerama make'
This commit is contained in:
		
							parent
							
								
									43b4d4bb41
								
							
						
					
					
						commit
						3357743210
					
				
							
								
								
									
										29
									
								
								config.mk
									
									
									
									
									
								
							
							
						
						
									
										29
									
								
								config.mk
									
									
									
									
									
								
							| @ -8,13 +8,14 @@ ifeq ('',$(VERSION)) | |||||||
| VERSION := $(shell git describe --tags) | VERSION := $(shell git describe --tags) | ||||||
| endif | endif | ||||||
| 
 | 
 | ||||||
| # Xinerama, comment if you don't want it
 | # Specifies which X extension dunst should use for multi monitor support
 | ||||||
| #XINERAMALIBS  = -lXinerama
 | # Possible values are randr, xinerama or none
 | ||||||
| #XINERAMAFLAGS = -DXINERAMA
 | # * xrandr is the recommended/default value and should be the best option in most cases
 | ||||||
| 
 | # * xinerama is the legacy equivalent to randr but does not support some more
 | ||||||
| # RANDR, comment if you don't want it
 | #   advanced features like per-monitor dpi calculation it should probably one
 | ||||||
| XRANDRLIBS = -lXrandr | #   be used if xrandr cannot be used for some reason.
 | ||||||
| XRANDRFLAGS = -DXRANDR | # * none disables multi-monitor support and dunst will assume only one monitor.
 | ||||||
|  | MULTIMON ?= xrandr | ||||||
| 
 | 
 | ||||||
| # uncomment to disable parsing of dunstrc
 | # uncomment to disable parsing of dunstrc
 | ||||||
| # or use "CFLAGS=-DSTATIC_CONFIG make" to build
 | # or use "CFLAGS=-DSTATIC_CONFIG make" to build
 | ||||||
| @ -26,13 +27,21 @@ ifeq (${PKG_CONFIG}, ${EMPTY}) | |||||||
| endif | endif | ||||||
| 
 | 
 | ||||||
| # flags
 | # flags
 | ||||||
| CPPFLAGS += -D_DEFAULT_SOURCE -DVERSION=\"${VERSION}\" ${XRANDRFLAGS} ${XINERAMAFLAGS} ${INIFLAGS} | CPPFLAGS += -D_DEFAULT_SOURCE -DVERSION=\"${VERSION}\" | ||||||
| CFLAGS   += -g --std=gnu99 -pedantic -Wall -Wno-overlength-strings -Os ${STATIC} ${CPPFLAGS} ${EXTRACFLAGS} | CFLAGS   += -g --std=gnu99 -pedantic -Wall -Wno-overlength-strings -Os ${STATIC} ${CPPFLAGS} | ||||||
| 
 | 
 | ||||||
| pkg_config_packs := dbus-1 x11 xscrnsaver \
 | pkg_config_packs := dbus-1 x11 xscrnsaver \
 | ||||||
|                     "glib-2.0 >= 2.36" gio-2.0 \
 |                     "glib-2.0 >= 2.36" gio-2.0 \
 | ||||||
|                     pangocairo gdk-2.0 |                     pangocairo gdk-2.0 | ||||||
| 
 | 
 | ||||||
|  | ifeq ($(MULTIMON), xrandr) | ||||||
|  | pkg_config_packs += xrandr | ||||||
|  | CFLAGS += -DXRANDR | ||||||
|  | else ifeq ($(MULTIMON), xinerama) | ||||||
|  | pkg_config_packs += xinerama | ||||||
|  | CFLAGS += -DXINERAMA | ||||||
|  | endif | ||||||
|  | 
 | ||||||
| # check if we need libxdg-basedir
 | # check if we need libxdg-basedir
 | ||||||
| ifeq (,$(findstring STATIC_CONFIG,$(CFLAGS))) | ifeq (,$(findstring STATIC_CONFIG,$(CFLAGS))) | ||||||
| 	pkg_config_packs += libxdg-basedir | 	pkg_config_packs += libxdg-basedir | ||||||
| @ -41,7 +50,7 @@ endif | |||||||
| # includes and libs
 | # includes and libs
 | ||||||
| INCS := $(shell ${PKG_CONFIG} --cflags ${pkg_config_packs}) | INCS := $(shell ${PKG_CONFIG} --cflags ${pkg_config_packs}) | ||||||
| CFLAGS += ${INCS} | CFLAGS += ${INCS} | ||||||
| LDFLAGS += -lm -L${X11LIB} -lXss ${XRANDRLIBS} ${XINERAMALIBS} $(shell ${PKG_CONFIG} --libs ${pkg_config_packs}) | LDFLAGS += -lm -L${X11LIB} -lXss $(shell ${PKG_CONFIG} --libs ${pkg_config_packs}) | ||||||
| 
 | 
 | ||||||
| # only make this an fatal error when where not cleaning
 | # only make this an fatal error when where not cleaning
 | ||||||
| ifneq (clean, $(MAKECMDGOALS)) | ifneq (clean, $(MAKECMDGOALS)) | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Nikos Tsipinakis
						Nikos Tsipinakis