Merge pull request #1651 from tanderson92/pkgconfig
Respect EXEC_PREFIX and a users' choice of PKG_CONFIG.
This commit is contained in:
commit
7b68577901
14
common.mk
14
common.mk
@ -2,9 +2,13 @@ UNAME=$(shell uname)
|
|||||||
DEBUG=1
|
DEBUG=1
|
||||||
INSTALL=install
|
INSTALL=install
|
||||||
LN=ln
|
LN=ln
|
||||||
|
PKG_CONFIG=pkg-config
|
||||||
ifndef PREFIX
|
ifndef PREFIX
|
||||||
PREFIX=/usr
|
PREFIX=/usr
|
||||||
endif
|
endif
|
||||||
|
ifndef EXEC_PREFIX
|
||||||
|
EXEC_PREFIX=$(PREFIX)
|
||||||
|
endif
|
||||||
ifndef SYSCONFDIR
|
ifndef SYSCONFDIR
|
||||||
ifeq ($(PREFIX),/usr)
|
ifeq ($(PREFIX),/usr)
|
||||||
SYSCONFDIR=/etc
|
SYSCONFDIR=/etc
|
||||||
@ -59,7 +63,7 @@ I3_CPPFLAGS += -DI3__FILE__=__FILE__
|
|||||||
|
|
||||||
## Libraries flags
|
## Libraries flags
|
||||||
|
|
||||||
ifeq ($(shell which pkg-config 2>/dev/null 1>/dev/null || echo 1),1)
|
ifeq ($(shell which $(PKG_CONFIG) 2>/dev/null 1>/dev/null || echo 1),1)
|
||||||
$(error "pkg-config was not found")
|
$(error "pkg-config was not found")
|
||||||
endif
|
endif
|
||||||
|
|
||||||
@ -73,15 +77,15 @@ endif
|
|||||||
#
|
#
|
||||||
# We redirect stderr to /dev/null because pkg-config prints an error if support
|
# We redirect stderr to /dev/null because pkg-config prints an error if support
|
||||||
# for gnome-config was enabled but gnome-config is not actually installed.
|
# for gnome-config was enabled but gnome-config is not actually installed.
|
||||||
cflags_for_lib = $(shell pkg-config --silence-errors --cflags $(1) 2>/dev/null)
|
cflags_for_lib = $(shell $(PKG_CONFIG) --silence-errors --cflags $(1) 2>/dev/null)
|
||||||
ldflags_for_lib = $(shell pkg-config --exists 2>/dev/null $(1) && pkg-config --libs $(1) 2>/dev/null || echo -l$(2))
|
ldflags_for_lib = $(shell $(PKG_CONFIG) --exists 2>/dev/null $(1) && $(PKG_CONFIG) --libs $(1) 2>/dev/null || echo -l$(2))
|
||||||
|
|
||||||
# XCB common stuff
|
# XCB common stuff
|
||||||
XCB_CFLAGS := $(call cflags_for_lib, xcb)
|
XCB_CFLAGS := $(call cflags_for_lib, xcb)
|
||||||
XCB_CFLAGS += $(call cflags_for_lib, xcb-event)
|
XCB_CFLAGS += $(call cflags_for_lib, xcb-event)
|
||||||
XCB_LIBS := $(call ldflags_for_lib, xcb,xcb)
|
XCB_LIBS := $(call ldflags_for_lib, xcb,xcb)
|
||||||
XCB_LIBS += $(call ldflags_for_lib, xcb-event,xcb-event)
|
XCB_LIBS += $(call ldflags_for_lib, xcb-event,xcb-event)
|
||||||
ifeq ($(shell pkg-config --exists xcb-util 2>/dev/null || echo 1),1)
|
ifeq ($(shell $(PKG_CONFIG) --exists xcb-util 2>/dev/null || echo 1),1)
|
||||||
XCB_CFLAGS += $(call cflags_for_lib, xcb-atom)
|
XCB_CFLAGS += $(call cflags_for_lib, xcb-atom)
|
||||||
XCB_CFLAGS += $(call cflags_for_lib, xcb-aux)
|
XCB_CFLAGS += $(call cflags_for_lib, xcb-aux)
|
||||||
XCB_LIBS += $(call ldflags_for_lib, xcb-atom,xcb-atom)
|
XCB_LIBS += $(call ldflags_for_lib, xcb-atom,xcb-atom)
|
||||||
@ -124,7 +128,7 @@ LIBEV_LIBS := $(call ldflags_for_lib, libev,ev)
|
|||||||
|
|
||||||
# libpcre
|
# libpcre
|
||||||
PCRE_CFLAGS := $(call cflags_for_lib, libpcre)
|
PCRE_CFLAGS := $(call cflags_for_lib, libpcre)
|
||||||
ifeq ($(shell pkg-config --atleast-version=8.10 libpcre 2>/dev/null && echo 1),1)
|
ifeq ($(shell $(PKG_CONFIG) --atleast-version=8.10 libpcre 2>/dev/null && echo 1),1)
|
||||||
I3_CPPFLAGS += -DPCRE_HAS_UCP=1
|
I3_CPPFLAGS += -DPCRE_HAS_UCP=1
|
||||||
endif
|
endif
|
||||||
PCRE_LIBS := $(call ldflags_for_lib, libpcre,pcre)
|
PCRE_LIBS := $(call ldflags_for_lib, libpcre,pcre)
|
||||||
|
@ -20,8 +20,8 @@ i3-config-wizard/i3-config-wizard: libi3.a $(i3_config_wizard_OBJECTS)
|
|||||||
|
|
||||||
install-i3-config-wizard: i3-config-wizard/i3-config-wizard
|
install-i3-config-wizard: i3-config-wizard/i3-config-wizard
|
||||||
echo "[i3-config-wizard] Install"
|
echo "[i3-config-wizard] Install"
|
||||||
$(INSTALL) -d -m 0755 $(DESTDIR)$(PREFIX)/bin
|
$(INSTALL) -d -m 0755 $(DESTDIR)$(EXEC_PREFIX)/bin
|
||||||
$(INSTALL) -m 0755 i3-config-wizard/i3-config-wizard $(DESTDIR)$(PREFIX)/bin/
|
$(INSTALL) -m 0755 i3-config-wizard/i3-config-wizard $(DESTDIR)$(EXEC_PREFIX)/bin/
|
||||||
|
|
||||||
clean-i3-config-wizard:
|
clean-i3-config-wizard:
|
||||||
echo "[i3-config-wizard] Clean"
|
echo "[i3-config-wizard] Clean"
|
||||||
|
@ -20,8 +20,8 @@ i3-dump-log/i3-dump-log: libi3.a $(i3_dump_log_OBJECTS)
|
|||||||
|
|
||||||
install-i3-dump-log: i3-dump-log/i3-dump-log
|
install-i3-dump-log: i3-dump-log/i3-dump-log
|
||||||
echo "[i3-dump-log] Install"
|
echo "[i3-dump-log] Install"
|
||||||
$(INSTALL) -d -m 0755 $(DESTDIR)$(PREFIX)/bin
|
$(INSTALL) -d -m 0755 $(DESTDIR)$(EXEC_PREFIX)/bin
|
||||||
$(INSTALL) -m 0755 i3-dump-log/i3-dump-log $(DESTDIR)$(PREFIX)/bin/
|
$(INSTALL) -m 0755 i3-dump-log/i3-dump-log $(DESTDIR)$(EXEC_PREFIX)/bin/
|
||||||
|
|
||||||
clean-i3-dump-log:
|
clean-i3-dump-log:
|
||||||
echo "[i3-dump-log] Clean"
|
echo "[i3-dump-log] Clean"
|
||||||
|
@ -20,8 +20,8 @@ i3-input/i3-input: libi3.a $(i3_input_OBJECTS)
|
|||||||
|
|
||||||
install-i3-input: i3-input/i3-input
|
install-i3-input: i3-input/i3-input
|
||||||
echo "[i3-input] Install"
|
echo "[i3-input] Install"
|
||||||
$(INSTALL) -d -m 0755 $(DESTDIR)$(PREFIX)/bin
|
$(INSTALL) -d -m 0755 $(DESTDIR)$(EXEC_PREFIX)/bin
|
||||||
$(INSTALL) -m 0755 i3-input/i3-input $(DESTDIR)$(PREFIX)/bin/
|
$(INSTALL) -m 0755 i3-input/i3-input $(DESTDIR)$(EXEC_PREFIX)/bin/
|
||||||
|
|
||||||
clean-i3-input:
|
clean-i3-input:
|
||||||
echo "[i3-input] Clean"
|
echo "[i3-input] Clean"
|
||||||
|
@ -20,8 +20,8 @@ i3-msg/i3-msg: libi3.a $(i3_msg_OBJECTS)
|
|||||||
|
|
||||||
install-i3-msg: i3-msg/i3-msg
|
install-i3-msg: i3-msg/i3-msg
|
||||||
echo "[i3-msg] Install"
|
echo "[i3-msg] Install"
|
||||||
$(INSTALL) -d -m 0755 $(DESTDIR)$(PREFIX)/bin
|
$(INSTALL) -d -m 0755 $(DESTDIR)$(EXEC_PREFIX)/bin
|
||||||
$(INSTALL) -m 0755 i3-msg/i3-msg $(DESTDIR)$(PREFIX)/bin/
|
$(INSTALL) -m 0755 i3-msg/i3-msg $(DESTDIR)$(EXEC_PREFIX)/bin/
|
||||||
|
|
||||||
clean-i3-msg:
|
clean-i3-msg:
|
||||||
echo "[i3-msg] Clean"
|
echo "[i3-msg] Clean"
|
||||||
|
@ -20,8 +20,8 @@ i3-nagbar/i3-nagbar: libi3.a $(i3_nagbar_OBJECTS)
|
|||||||
|
|
||||||
install-i3-nagbar: i3-nagbar/i3-nagbar
|
install-i3-nagbar: i3-nagbar/i3-nagbar
|
||||||
echo "[i3-nagbar] Install"
|
echo "[i3-nagbar] Install"
|
||||||
$(INSTALL) -d -m 0755 $(DESTDIR)$(PREFIX)/bin
|
$(INSTALL) -d -m 0755 $(DESTDIR)$(EXEC_PREFIX)/bin
|
||||||
$(INSTALL) -m 0755 i3-nagbar/i3-nagbar $(DESTDIR)$(PREFIX)/bin/
|
$(INSTALL) -m 0755 i3-nagbar/i3-nagbar $(DESTDIR)$(EXEC_PREFIX)/bin/
|
||||||
|
|
||||||
clean-i3-nagbar:
|
clean-i3-nagbar:
|
||||||
echo "[i3-nagbar] Clean"
|
echo "[i3-nagbar] Clean"
|
||||||
|
@ -20,8 +20,8 @@ i3bar/i3bar: libi3.a $(i3bar_OBJECTS)
|
|||||||
|
|
||||||
install-i3bar: i3bar/i3bar
|
install-i3bar: i3bar/i3bar
|
||||||
echo "[i3bar] Install"
|
echo "[i3bar] Install"
|
||||||
$(INSTALL) -d -m 0755 $(DESTDIR)$(PREFIX)/bin
|
$(INSTALL) -d -m 0755 $(DESTDIR)$(EXEC_PREFIX)/bin
|
||||||
$(INSTALL) -m 0755 i3bar/i3bar $(DESTDIR)$(PREFIX)/bin/
|
$(INSTALL) -m 0755 i3bar/i3bar $(DESTDIR)$(EXEC_PREFIX)/bin/
|
||||||
|
|
||||||
clean-i3bar:
|
clean-i3bar:
|
||||||
echo "[i3bar] Clean"
|
echo "[i3bar] Clean"
|
||||||
|
22
src/i3.mk
22
src/i3.mk
@ -74,25 +74,25 @@ i3: libi3.a $(i3_OBJECTS)
|
|||||||
|
|
||||||
install-i3: i3
|
install-i3: i3
|
||||||
echo "[i3] Install"
|
echo "[i3] Install"
|
||||||
$(INSTALL) -d -m 0755 $(DESTDIR)$(PREFIX)/bin
|
$(INSTALL) -d -m 0755 $(DESTDIR)$(EXEC_PREFIX)/bin
|
||||||
$(INSTALL) -d -m 0755 $(DESTDIR)$(SYSCONFDIR)/i3
|
$(INSTALL) -d -m 0755 $(DESTDIR)$(SYSCONFDIR)/i3
|
||||||
$(INSTALL) -d -m 0755 $(DESTDIR)$(PREFIX)/include/i3
|
$(INSTALL) -d -m 0755 $(DESTDIR)$(EXEC_PREFIX)/include/i3
|
||||||
$(INSTALL) -d -m 0755 $(DESTDIR)$(PREFIX)/share/xsessions
|
$(INSTALL) -d -m 0755 $(DESTDIR)$(PREFIX)/share/xsessions
|
||||||
$(INSTALL) -d -m 0755 $(DESTDIR)$(PREFIX)/share/applications
|
$(INSTALL) -d -m 0755 $(DESTDIR)$(PREFIX)/share/applications
|
||||||
$(INSTALL) -m 0755 i3 $(DESTDIR)$(PREFIX)/bin/
|
$(INSTALL) -m 0755 i3 $(DESTDIR)$(EXEC_PREFIX)/bin/
|
||||||
$(LN) -sf i3 $(DESTDIR)$(PREFIX)/bin/i3-with-shmlog
|
$(LN) -sf i3 $(DESTDIR)$(EXEC_PREFIX)/bin/i3-with-shmlog
|
||||||
$(INSTALL) -m 0755 i3-migrate-config-to-v4 $(DESTDIR)$(PREFIX)/bin/
|
$(INSTALL) -m 0755 i3-migrate-config-to-v4 $(DESTDIR)$(EXEC_PREFIX)/bin/
|
||||||
$(INSTALL) -m 0755 i3-sensible-editor $(DESTDIR)$(PREFIX)/bin/
|
$(INSTALL) -m 0755 i3-sensible-editor $(DESTDIR)$(EXEC_PREFIX)/bin/
|
||||||
$(INSTALL) -m 0755 i3-sensible-pager $(DESTDIR)$(PREFIX)/bin/
|
$(INSTALL) -m 0755 i3-sensible-pager $(DESTDIR)$(EXEC_PREFIX)/bin/
|
||||||
$(INSTALL) -m 0755 i3-sensible-terminal $(DESTDIR)$(PREFIX)/bin/
|
$(INSTALL) -m 0755 i3-sensible-terminal $(DESTDIR)$(EXEC_PREFIX)/bin/
|
||||||
$(INSTALL) -m 0755 i3-save-tree $(DESTDIR)$(PREFIX)/bin/
|
$(INSTALL) -m 0755 i3-save-tree $(DESTDIR)$(EXEC_PREFIX)/bin/
|
||||||
$(INSTALL) -m 0755 i3-dmenu-desktop $(DESTDIR)$(PREFIX)/bin/
|
$(INSTALL) -m 0755 i3-dmenu-desktop $(DESTDIR)$(EXEC_PREFIX)/bin/
|
||||||
test -e $(DESTDIR)$(SYSCONFDIR)/i3/config || $(INSTALL) -m 0644 i3.config $(DESTDIR)$(SYSCONFDIR)/i3/config
|
test -e $(DESTDIR)$(SYSCONFDIR)/i3/config || $(INSTALL) -m 0644 i3.config $(DESTDIR)$(SYSCONFDIR)/i3/config
|
||||||
test -e $(DESTDIR)$(SYSCONFDIR)/i3/config.keycodes || $(INSTALL) -m 0644 i3.config.keycodes $(DESTDIR)$(SYSCONFDIR)/i3/config.keycodes
|
test -e $(DESTDIR)$(SYSCONFDIR)/i3/config.keycodes || $(INSTALL) -m 0644 i3.config.keycodes $(DESTDIR)$(SYSCONFDIR)/i3/config.keycodes
|
||||||
$(INSTALL) -m 0644 i3.xsession.desktop $(DESTDIR)$(PREFIX)/share/xsessions/i3.desktop
|
$(INSTALL) -m 0644 i3.xsession.desktop $(DESTDIR)$(PREFIX)/share/xsessions/i3.desktop
|
||||||
$(INSTALL) -m 0644 i3-with-shmlog.xsession.desktop $(DESTDIR)$(PREFIX)/share/xsessions/i3-with-shmlog.desktop
|
$(INSTALL) -m 0644 i3-with-shmlog.xsession.desktop $(DESTDIR)$(PREFIX)/share/xsessions/i3-with-shmlog.desktop
|
||||||
$(INSTALL) -m 0644 i3.applications.desktop $(DESTDIR)$(PREFIX)/share/applications/i3.desktop
|
$(INSTALL) -m 0644 i3.applications.desktop $(DESTDIR)$(PREFIX)/share/applications/i3.desktop
|
||||||
$(INSTALL) -m 0644 include/i3/ipc.h $(DESTDIR)$(PREFIX)/include/i3/
|
$(INSTALL) -m 0644 include/i3/ipc.h $(DESTDIR)$(EXEC_PREFIX)/include/i3/
|
||||||
|
|
||||||
clean-i3:
|
clean-i3:
|
||||||
echo "[i3] Clean"
|
echo "[i3] Clean"
|
||||||
|
Loading…
Reference in New Issue
Block a user