summaryrefslogtreecommitdiff
blob: fa65c8c99241532ea912c4ad669f1215325aff01 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
From e02c2e1e79a3687865266bdbd28318b263f9b381 Mon Sep 17 00:00:00 2001
From: Gilles Dartiguelongue <eva@gentoo.org>
Date: Sat, 8 Aug 2009 23:34:01 +0200
Subject: [PATCH] Make startup-notification non-automagic

See description at http://www.gentoo.org/proj/en/qa/automagic.xml

This patch makes startup-notification properly switchable at configure
time while retaining auto-detection capability.

Gentoo: https://bugs.gentoo.org/show_bug.cgi?id=278464
---
 configure.in |   30 +++++++++++++++++++++---------
 1 files changed, 21 insertions(+), 9 deletions(-)

diff --git a/configure.in b/configure.in
index 731ac3f..75fad2d 100644
--- a/configure.in
+++ b/configure.in
@@ -82,15 +82,27 @@ AC_SUBST(wncklocaledir)
 
 AC_PATH_PROG(PKG_CONFIG, pkg-config)
 
-AC_MSG_CHECKING([if building with libstartup-notification])
-STARTUP_NOTIFICATION_REQUIRED=0.4
-if $PKG_CONFIG --atleast-version $STARTUP_NOTIFICATION_REQUIRED libstartup-notification-1.0; then
-  AC_MSG_RESULT([yes])
-  AC_DEFINE_UNQUOTED(HAVE_STARTUP_NOTIFICATION, 1, [Define if you have libstartup-notification])
-  STARTUP_NOTIFICATION_PACKAGE=libstartup-notification-1.0
-else
-  AC_MSG_RESULT([no])
-  STARTUP_NOTIFICATION_PACKAGE=
+AC_ARG_ENABLE(startup-notification,
+              [AC_HELP_STRING([--enable-startup-notification],
+                              [startup notification library @<:@default=auto@:>@])],,
+              [enable_startup_notification=auto])
+
+STARTUP_NOTIFICATION_PACKAGE=
+if test "$enable_startup_notification" != "no"; then
+   STARTUP_NOTIFICATION_REQUIRED=0.4
+   PKG_CHECK_MODULES(STARTUP_NOTIFICATION,
+      [libstartup-notification-1.0 >= $STARTUP_NOTIFICATION_REQUIRED],
+      [have_sn=yes]
+      [have_sn=no])
+
+   if test "$have_sn" = "no" -a "$enable_start_notification" = "yes"; then
+      AC_MSG_ERROR([startup-notification support required but not found])
+   fi
+
+   if test "$have_sn" = "yes"; then
+      AC_DEFINE_UNQUOTED(HAVE_STARTUP_NOTIFICATION, 1, [Define if you have libstartup-notification])
+      STARTUP_NOTIFICATION_PACKAGE=libstartup-notification-1.0
+   fi
 fi
 AC_SUBST(STARTUP_NOTIFICATION_PACKAGE)
 
-- 
1.6.3.3