Skip to content

Commit 9a9be8f

Browse files
committed
configure.ac: Add configure option for CUPS SERVERBIN (fixes #234)
1 parent 7a1bf8d commit 9a9be8f

1 file changed

Lines changed: 25 additions & 2 deletions

File tree

configure.ac

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,31 @@ fi
3333
AC_SUBST(DESKTOPVENDOR)
3434
AC_SUBST(DESKTOPPREFIX)
3535

36-
cupsserverbindir="`cups-config --serverbin`"
36+
PKG_PROG_PKG_CONFIG
37+
38+
dnl Allow manual definition for CUPS SERVERBIN, if not defined, use value from pkg-config...
39+
AC_MSG_CHECKING([for CUPS SERVERBIN dir])
40+
AC_ARG_WITH([cups_serverbin_dir],
41+
AS_HELP_STRING([--with-cups-serverbin-dir], [set CUPS SERVERBIN dir, default=value from pkg-config]), [
42+
cupsserverbindir="$withval"
43+
AC_MSG_RESULT([$withval])
44+
], [
45+
AS_IF([test "x$PKG_CONFIG" != x], [
46+
AS_IF([$PKG_CONFIG --exists cups], [
47+
cupsserverbindir=$($PKG_CONFIG --variable=cups_serverbin cups)
48+
AC_MSG_RESULT([$cupsserverbindir])
49+
], [
50+
AC_MSG_ERROR([No CUPS pkgconfig file present and no CUPS SERVERBIN dir defined in configure options.])
51+
])
52+
], [
53+
AC_MSG_ERROR([No pkg-config present and no CUPS SERVERBIN dir defined in configure options.])
54+
])
55+
])
56+
57+
AS_IF([test "x$cupsserverbindir" = x], [
58+
AC_MSG_ERROR([No CUPS SERVERBIN dir defined in CUPS pkgconfig file or configure options.])
59+
])
60+
3761
AC_SUBST(cupsserverbindir)
3862

3963
PKG_CHECK_MODULES(GLIB, glib-2.0, has_glib=yes, has_glib=no)
@@ -66,7 +90,6 @@ if test "x$with_udev_rules" != xno -a "x$with_udevdir" != xno; then
6690
AM_PROG_CC_C_O
6791
fi
6892

69-
PKG_PROG_PKG_CONFIG
7093
AC_ARG_WITH([systemdsystemunitdir],
7194
AS_HELP_STRING([--with-systemdsystemunitdir=DIR], [Directory for systemd service files]),
7295
[], [with_systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd)])

0 commit comments

Comments
 (0)