Skip to content

Commit fbd571f

Browse files
Merge pull request #17 from TinyTrebuchet/issue#15
Use pkg-config variables instead of hardcoded paths
2 parents dc42844 + a84b018 commit fbd571f

File tree

3 files changed

+33
-21
lines changed

3 files changed

+33
-21
lines changed

.gitignore

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,23 @@
22
*/*~
33
*.o
44
*.pdf
5-
cups
65
.vscode/
76
.gdb_history
87
gmon.out
9-
Makefile.in
108
.gitignore
119
aclocal.m4
12-
Makefile
13-
*/Makefile
14-
depcomp
15-
install-sh
16-
missing
1710
aclocal.*
18-
compile
19-
autom4*
11+
autom4te.cache/
12+
build-aux/
13+
configure
2014
config.guess
2115
config.sub
2216
config.log
2317
config.status
24-
configure
25-
data/org.openprinting.Backend.CUPS.service
18+
Makefile
19+
Makefile.in
2620
src/.deps
21+
src/cups
22+
data/org.openprinting.Backend.CUPS.service
2723
tmp/
24+
*/Makefile

autogen.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#! /bin/sh
22

3-
aclocal \
3+
mkdir -p build-aux \
4+
&& aclocal \
45
&& automake --add-missing \
56
&& autoconf

configure.ac

Lines changed: 23 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,16 @@
33

44
AC_PREREQ([2.69])
55
AC_INIT([cpdb-backend-cups], [2.0b1], [https://github.com/OpenPrinting/cpdb-backend-cups/issues/], [cpdb-backend-cups], [https://github.com/OpenPrinting/cpdb-backend-cups])
6-
AM_INIT_AUTOMAKE([-Wall foreign])
6+
AC_CONFIG_AUX_DIR([build-aux])
77
AC_CONFIG_SRCDIR([src/print_backend_cups.c])
8+
AM_INIT_AUTOMAKE([-Wall foreign])
89

910
: ${CFLAGS=""}
1011
# Check for a C compiler
1112
AC_PROG_CC
1213

1314

14-
# Checks for backend library
15+
# Checks for backend library
1516
PKG_CHECK_MODULES([CPDB],[cpdb >= 2])
1617
PKG_CHECK_MODULES([GIO],[gio-2.0])
1718
PKG_CHECK_MODULES([GIOUNIX],[gio-unix-2.0])
@@ -27,15 +28,28 @@ AC_TYPE_SIZE_T
2728
AC_FUNC_MALLOC
2829

2930
# The Dbus service directory
30-
DBUS_SERVICES_DIR="/usr/share/dbus-1/services"
31-
AC_SUBST(DBUS_SERVICES_DIR)
31+
AC_MSG_CHECKING([dbus service file path])
32+
PKG_CHECK_VAR([DBUS_SERVICES_DIR], [dbus-1], [session_bus_services_dir],
33+
AC_MSG_RESULT($DBUS_SERVICES_DIR),
34+
AC_MSG_FAILURE([cannot locate session_bus_services_dir])
35+
)
3236

3337
# The info directory which will be read by the frontend
34-
INFO_DIR="/usr/share/print-backends"
35-
AC_SUBST(INFO_DIR)
38+
AC_MSG_CHECKING([CPDB backend info path])
39+
PKG_CHECK_VAR([INFO_DIR], [cpdb], [cpdb_backend_info_dir],
40+
AC_MSG_RESULT($INFO_DIR),
41+
AC_MSG_FAILURE([cannot locate cpdb_backend_info_dir])
42+
)
3643

3744
# The directory for the backend executables
38-
CPDB_BACKEND_DIR="$libdir/print-backends"
39-
AC_SUBST(CPDB_BACKEND_DIR)
45+
AC_MSG_CHECKING([CPDB backend executables path])
46+
PKG_CHECK_VAR([CPDB_BACKEND_DIR], [cpdb], [cpdb_backend_exec_dir],
47+
AC_MSG_RESULT($CPDB_BACKEND_DIR),
48+
AC_MSG_FAILURE([cannot locate cpdb_backend_exec_dir])
49+
)
50+
51+
AC_CONFIG_FILES([Makefile
52+
src/Makefile
53+
data/Makefile])
4054

41-
AC_OUTPUT([Makefile src/Makefile data/Makefile])
55+
AC_OUTPUT

0 commit comments

Comments
 (0)