Skip to content

Commit d57fc02

Browse files
author
Joakim Repomaa
authored
generate and install a pkgconfig file on make install (#229)
1 parent e2057b4 commit d57fc02

File tree

3 files changed

+29
-1
lines changed

3 files changed

+29
-1
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
*.o
22
*.so*
33
*.1
4+
libxdo.pc
45
xdo_version.h
56
xdotool

Makefile

+11-1
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,15 @@ INSTALLBIN?=$(PREFIX)/bin
44
INSTALLLIB?=$(PREFIX)/lib
55
INSTALLMAN?=$(PREFIX)/man
66
INSTALLINCLUDE?=$(PREFIX)/include
7+
INSTALLPC?=$(PREFIX)/lib/pkgconfig
78
LDCONFIG?=ldconfig
89

910
DPREFIX=$(DESTDIR)$(PREFIX)
1011
DINSTALLBIN=$(DESTDIR)$(INSTALLBIN)
1112
DINSTALLLIB=$(DESTDIR)$(INSTALLLIB)
1213
DINSTALLMAN=$(DESTDIR)$(INSTALLMAN)
1314
DINSTALLINCLUDE=$(DESTDIR)$(INSTALLINCLUDE)
15+
DINSTALLPC=$(DESTDIR)$(INSTALLPC)
1416

1517
MAJOR=$(shell sh version.sh --major)
1618
VERSION=$(shell sh version.sh)
@@ -69,7 +71,7 @@ xdotool.static: xdotool.o $(CMDOBJS) xdo.o xdo_search.o
6971
$(CC) -o xdotool.static xdotool.o xdo.o xdo_search.o $(CMDOBJS) $(LDFLAGS) -lm $(XDOTOOL_LIBS) $(LIBXDO_LIBS)
7072

7173
.PHONY: install
72-
install: pre-install installlib installprog installman installheader post-install
74+
install: pre-install installlib installprog installman installheader installpc post-install
7375

7476
.PHONY: pre-install
7577
pre-install:
@@ -100,6 +102,11 @@ installheader: xdo.h
100102
install -d $(DINSTALLINCLUDE)
101103
install xdo.h $(DINSTALLINCLUDE)/xdo.h
102104

105+
.PHONY: installpc
106+
installpc: libxdo.pc
107+
install -d $(DINSTALLPC)
108+
install libxdo.pc $(DINSTALLPC)/libxdo.pc
109+
103110
.PHONY: installman
104111
installman: xdotool.1
105112
install -d $(DINSTALLMAN)/man1
@@ -142,6 +149,9 @@ libxdo.a: xdo.o xdo_search.o
142149
libxdo.$(VERLIBSUFFIX): libxdo.$(LIBSUFFIX)
143150
ln -s $< $@
144151

152+
libxdo.pc:
153+
sh pc.sh $(VERSION) $(INSTALLLIB) $(INSTALLINCLUDE) > libxdo.pc
154+
145155
# xdotool the binary requires libX11 now for XSelectInput and friends.
146156
# This requirement will go away once more things are refactored into
147157
# libxdo.

pc.sh

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/bin/sh
2+
3+
VERSION=$1
4+
LIBDIR=$2
5+
INCLUDEDIR=$3
6+
7+
cat <<ENDPC
8+
libdir=${LIBDIR}
9+
includedir=${INCLUDEDIR}
10+
11+
Name: libxdo
12+
Description: fake keyboard/mouse input, window management, and more
13+
Version: ${VERSION}
14+
Requires: x11
15+
Libs: -L\${libdir} -lxdo
16+
Cflags: -I\${includedir}
17+
ENDPC

0 commit comments

Comments
 (0)