Configure build
This commit is contained in:
parent
e716ffd4a0
commit
000c7fbeea
6 changed files with 164 additions and 45 deletions
5
.gitignore
vendored
5
.gitignore
vendored
|
@ -1,3 +1,6 @@
|
||||||
/config/active.mk
|
/config/1-custom.mk
|
||||||
|
/config/2-generated.mk
|
||||||
|
/config/3-custom.mk
|
||||||
|
/config/5-custom.mk
|
||||||
/polytreewm
|
/polytreewm
|
||||||
/src/*.o
|
/src/*.o
|
||||||
|
|
38
Makefile
38
Makefile
|
@ -1,14 +1,17 @@
|
||||||
# PolytreeWM - tiling window manager
|
# PolytreeWM - tiling window manager
|
||||||
# See LICENSE file for copyright and license details.
|
# See LICENSE file for copyright and license details.
|
||||||
|
|
||||||
include config.mk
|
CONFIGMKS = \
|
||||||
|
config/1-custom.mk \
|
||||||
|
config/2-generated.mk \
|
||||||
|
config/3-custom.mk \
|
||||||
|
config/4-defvars.mk \
|
||||||
|
config/5-custom.mk
|
||||||
|
|
||||||
|
include $(CONFIGMKS)
|
||||||
|
|
||||||
VERSION = 6.2
|
VERSION = 6.2
|
||||||
|
|
||||||
CPPFLAGS += -DVERSION=\"$(VERSION)\" -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_POSIX_C_SOURCE=200809L
|
|
||||||
CFLAGS += $(CPPFLAGS) -std=c99 -Os -pedantic -Wall -Wno-deprecated-declarations
|
|
||||||
LDFLAGS +=
|
|
||||||
|
|
||||||
SRC = \
|
SRC = \
|
||||||
src/atoms.c \
|
src/atoms.c \
|
||||||
src/drw.c \
|
src/drw.c \
|
||||||
|
@ -57,23 +60,26 @@ polytreewm: ${OBJ}
|
||||||
${CC} -c $< -o $@ ${CFLAGS}
|
${CC} -c $< -o $@ ${CFLAGS}
|
||||||
|
|
||||||
dwm.o: ${DWM_SRC} ${DWM_HDR}
|
dwm.o: ${DWM_SRC} ${DWM_HDR}
|
||||||
${OBJ}: ${HDR}
|
${OBJ}: ${CONFIGMKS} ${HDR}
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -f polytreewm ${OBJ}
|
rm -f polytreewm ${OBJ}
|
||||||
|
|
||||||
install: all
|
distclean: clean
|
||||||
mkdir -p ${DESTDIR}${PREFIX}/bin
|
rm -f config/2-generated.mk
|
||||||
cp -f polytreewm ${DESTDIR}${PREFIX}/bin
|
|
||||||
chmod 755 ${DESTDIR}${PREFIX}/bin/polytreewm
|
|
||||||
|
|
||||||
mkdir -p ${DESTDIR}${MANPREFIX}/man1
|
install: all
|
||||||
sed "s/VERSION/${VERSION}/g" < polytreewm.1 > ${DESTDIR}${MANPREFIX}/man1/polytreewm.1
|
mkdir -p ${DESTDIR}${BINDIR}
|
||||||
chmod 644 ${DESTDIR}${MANPREFIX}/man1/polytreewm.1
|
cp -f polytreewm ${DESTDIR}${BINDIR}
|
||||||
|
chmod 755 ${DESTDIR}${BINDIR}/polytreewm
|
||||||
|
|
||||||
|
mkdir -p ${DESTDIR}${MANDIR}/man1
|
||||||
|
sed "s/VERSION/${VERSION}/g" < polytreewm.1 > ${DESTDIR}${MANDIR}/man1/polytreewm.1
|
||||||
|
chmod 644 ${DESTDIR}${MANDIR}/man1/polytreewm.1
|
||||||
|
|
||||||
uninstall:
|
uninstall:
|
||||||
rm -f \
|
rm -f \
|
||||||
${DESTDIR}${PREFIX}/bin/polytreewm \
|
${DESTDIR}${BINDIR}/polytreewm \
|
||||||
${DESTDIR}${MANPREFIX}/man1/polytreewm.1
|
${DESTDIR}${MANDIR}/man1/polytreewm.1
|
||||||
|
|
||||||
.PHONY: all options clean install uninstall
|
.PHONY: all options clean distclean install uninstall
|
||||||
|
|
23
config.mk
23
config.mk
|
@ -1,23 +0,0 @@
|
||||||
##########################
|
|
||||||
# Compiler, linker, etc. #
|
|
||||||
##########################
|
|
||||||
|
|
||||||
CC = cc
|
|
||||||
PKGCONFIG = pkg-config
|
|
||||||
|
|
||||||
#########
|
|
||||||
# Paths #
|
|
||||||
#########
|
|
||||||
|
|
||||||
PREFIX = /usr/local
|
|
||||||
MANPREFIX = $(PREFIX)/share/man
|
|
||||||
|
|
||||||
################
|
|
||||||
# Dependencies #
|
|
||||||
################
|
|
||||||
|
|
||||||
PKGS = fontconfig freetype2 x11 x11-xcb xcb xcb-res xft xinerama
|
|
||||||
|
|
||||||
CPPFLAGS = -DXINERAMA
|
|
||||||
CFLAGS = `$(PKGCONFIG) --cflags $(PKGS)`
|
|
||||||
LDFLAGS = `$(PKGCONFIG) --libs $(PKGS)`
|
|
15
config/4-defvars.mk
Normal file
15
config/4-defvars.mk
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
CC = cc
|
||||||
|
PKGCONFIG = pkg-config
|
||||||
|
|
||||||
|
PKGS += fontconfig freetype2 x11 x11-xcb xcb xcb-res xft
|
||||||
|
|
||||||
|
ifeq (yes,$(ENABLE_XINERAMA))
|
||||||
|
CPPFLAGS += -DENABLE_XINERAMA
|
||||||
|
PKGS += xinerama
|
||||||
|
endif
|
||||||
|
|
||||||
|
CFLAGS += `$(PKGCONFIG) --cflags $(PKGS)`
|
||||||
|
LDFLAGS += `$(PKGCONFIG) --libs $(PKGS)`
|
||||||
|
|
||||||
|
CPPFLAGS += -DVERSION=\"$(VERSION)\" -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_POSIX_C_SOURCE=200809L
|
||||||
|
CFLAGS += $(CPPFLAGS) -std=c99 -Os -pedantic -Wall -Wno-deprecated-declarations
|
118
configure
vendored
Executable file
118
configure
vendored
Executable file
|
@ -0,0 +1,118 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
help() {
|
||||||
|
cat <<HELP
|
||||||
|
This script tries to be similar to autotools' \`configure', but is different.
|
||||||
|
|
||||||
|
Usage: ./configure [OPTION]...
|
||||||
|
|
||||||
|
Defaults for the options are specified in brackets.
|
||||||
|
|
||||||
|
Configuration:
|
||||||
|
-h, --help Display this help and exit
|
||||||
|
|
||||||
|
Installation directories:
|
||||||
|
--prefix PREFIX install architecture-independent files in PREFIX
|
||||||
|
[/usr/local]
|
||||||
|
--exec-prefix EPREFIX install architecture-dependent files in EPREFIX
|
||||||
|
[PREFIX]
|
||||||
|
|
||||||
|
By default, \`make install' will install all the files in
|
||||||
|
\`/usr/local/bin', \`/usr/local/lib' etc. You can specify
|
||||||
|
an installation prefix other than \`/usr/local' using \`--prefix',
|
||||||
|
for instance \`--prefix \$HOME'.
|
||||||
|
|
||||||
|
For better control, use the options below.
|
||||||
|
|
||||||
|
File tuning of the installation directories:
|
||||||
|
--bindir DIR user executables [EPREFIX/bin]
|
||||||
|
--datarootdir DIR read-only arch.-independent data root [PREFIX/share]
|
||||||
|
--mandir DIR man documentation [DATAROOTDIR/man]
|
||||||
|
|
||||||
|
Optional Features:
|
||||||
|
--disable-xinerama disable Xinerama
|
||||||
|
HELP
|
||||||
|
}
|
||||||
|
|
||||||
|
prefix='/usr/local'
|
||||||
|
eprefix=''
|
||||||
|
bindir=''
|
||||||
|
datarootdir=''
|
||||||
|
mandir=''
|
||||||
|
enable_xinerama='yes'
|
||||||
|
|
||||||
|
while [ $# -gt 0 ]; do
|
||||||
|
case "$1" in
|
||||||
|
-h | -? | --help | -help | help)
|
||||||
|
help
|
||||||
|
exit
|
||||||
|
;;
|
||||||
|
--prefix)
|
||||||
|
shift
|
||||||
|
prefix="$1"
|
||||||
|
;;
|
||||||
|
--exec-prefix)
|
||||||
|
shift
|
||||||
|
eprefix="$1"
|
||||||
|
;;
|
||||||
|
--bindir)
|
||||||
|
shift
|
||||||
|
bindir="$1"
|
||||||
|
;;
|
||||||
|
--datarootdir)
|
||||||
|
shift
|
||||||
|
datarootdir="$1"
|
||||||
|
;;
|
||||||
|
--mandir)
|
||||||
|
shift
|
||||||
|
mandir="$1"
|
||||||
|
;;
|
||||||
|
--disable-xinerama)
|
||||||
|
enable_xinerama='no'
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
help
|
||||||
|
exit
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
shift
|
||||||
|
done
|
||||||
|
|
||||||
|
if [ "$eprefix" = '' ]; then
|
||||||
|
eprefix="$prefix"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$bindir" = '' ]; then
|
||||||
|
bindir="$eprefix/bin"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$datarootdir" = '' ]; then
|
||||||
|
datarootdir="$prefix/share"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$mandir" = '' ]; then
|
||||||
|
mandir="$datarootdir/man"
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "PREFIX = $prefix"
|
||||||
|
echo "EPREFIX = $eprefix"
|
||||||
|
echo "BINDIR = $bindir"
|
||||||
|
echo "DATAROOTDIR = $datarootdir"
|
||||||
|
echo "MANDIR = $mandir"
|
||||||
|
echo "ENABLE_XINERAMA = $enable_xinerama"
|
||||||
|
|
||||||
|
touch 'config/1-custom.mk'
|
||||||
|
touch 'config/3-custom.mk'
|
||||||
|
touch 'config/5-custom.mk'
|
||||||
|
|
||||||
|
rm -f 'config/2-generated.mk'
|
||||||
|
|
||||||
|
echo "PREFIX = $prefix" >> 'config/2-generated.mk'
|
||||||
|
echo "EPREFIX = $eprefix" >> 'config/2-generated.mk'
|
||||||
|
echo "BINDIR = $bindir" >> 'config/2-generated.mk'
|
||||||
|
echo "DATAROOTDIR = $datarootdir" >> 'config/2-generated.mk'
|
||||||
|
echo "MANDIR = $mandir" >> 'config/2-generated.mk'
|
||||||
|
echo "ENABLE_XINERAMA = $enable_xinerama" >> 'config/2-generated.mk'
|
12
src/dwm.c
12
src/dwm.c
|
@ -34,9 +34,9 @@
|
||||||
#include <X11/Xlib.h>
|
#include <X11/Xlib.h>
|
||||||
#include <X11/Xproto.h>
|
#include <X11/Xproto.h>
|
||||||
#include <X11/Xutil.h>
|
#include <X11/Xutil.h>
|
||||||
#ifdef XINERAMA
|
#ifdef ENABLE_XINERAMA
|
||||||
#include <X11/extensions/Xinerama.h>
|
#include <X11/extensions/Xinerama.h>
|
||||||
#endif /* XINERAMA */
|
#endif /* ENABLE_XINERAMA */
|
||||||
#include <X11/Xft/Xft.h>
|
#include <X11/Xft/Xft.h>
|
||||||
#include <X11/Xlib-xcb.h>
|
#include <X11/Xlib-xcb.h>
|
||||||
#include <xcb/res.h>
|
#include <xcb/res.h>
|
||||||
|
@ -1007,7 +1007,7 @@ incnmaster(const Arg *arg)
|
||||||
arrange(selmon);
|
arrange(selmon);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef XINERAMA
|
#ifdef ENABLE_XINERAMA
|
||||||
static int
|
static int
|
||||||
isuniquegeom(XineramaScreenInfo *unique, size_t n, XineramaScreenInfo *info)
|
isuniquegeom(XineramaScreenInfo *unique, size_t n, XineramaScreenInfo *info)
|
||||||
{
|
{
|
||||||
|
@ -1017,7 +1017,7 @@ isuniquegeom(XineramaScreenInfo *unique, size_t n, XineramaScreenInfo *info)
|
||||||
return 0;
|
return 0;
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
#endif /* XINERAMA */
|
#endif /* ENABLE_XINERAMA */
|
||||||
|
|
||||||
void
|
void
|
||||||
killclient(const Arg *arg)
|
killclient(const Arg *arg)
|
||||||
|
@ -2047,7 +2047,7 @@ updategeom(void)
|
||||||
{
|
{
|
||||||
int dirty = 0;
|
int dirty = 0;
|
||||||
|
|
||||||
#ifdef XINERAMA
|
#ifdef ENABLE_XINERAMA
|
||||||
if (XineramaIsActive(dpy)) {
|
if (XineramaIsActive(dpy)) {
|
||||||
int i, j, n, nn;
|
int i, j, n, nn;
|
||||||
Client *c;
|
Client *c;
|
||||||
|
@ -2102,7 +2102,7 @@ updategeom(void)
|
||||||
}
|
}
|
||||||
free(unique);
|
free(unique);
|
||||||
} else
|
} else
|
||||||
#endif /* XINERAMA */
|
#endif /* ENABLE_XINERAMA */
|
||||||
{ /* default monitor setup */
|
{ /* default monitor setup */
|
||||||
if (!mons)
|
if (!mons)
|
||||||
mons = createmon();
|
mons = createmon();
|
||||||
|
|
Loading…
Reference in a new issue