summaryrefslogtreecommitdiff
blob: 19ab82960fd4d691377c57594fe636f3909c629f (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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
From b2e7a0b5db67dd276b09a151cf8a4aa3b58409fb Mon Sep 17 00:00:00 2001
From: Gilles Dartiguelongue <eva@gentoo.org>
Date: Sun, 13 Aug 2017 11:28:19 +0200
Subject: [PATCH] Allow selecting specific gmime version

---
 configure.ac | 69 ++++++++++++++++++++++++++++++------------------------------
 1 file changed, 34 insertions(+), 35 deletions(-)

diff --git a/configure.ac b/configure.ac
index dda59f7..f92bbf5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -74,47 +74,46 @@ pkg_modules="glib-2.0 >= $GLIB_REQS libxml-2.0 gthread-2.0 gio-2.0 >= $GIO_REQS
 ##################################
 # Checking libgmime dependency
 ##################################
+GMIME=""
 gmime_message=""
 
-AC_ARG_ENABLE(gmime-i-know-what-im-doing,
-	      AS_HELP_STRING([--disable-gmime-i-know-what-im-doing],
-			     [Disable libgmime (Unsupported, breaks Podcast support).]),
-			     [enable_gmime=no],
-			     [enable_gmime=yes])
-
-if test "x$enable_gmime" = "xyes" ; then
-   have_gmime3=no
-   PKG_CHECK_MODULES(GMIME,
-                     gmime-3.0,
-                     [have_gmime=yes have_gmime3=yes GMIME=gmime-3.0],
-                     [have_gmime=no])
-
-   if test "x$have_gmime" = "xno" ; then
-       PKG_CHECK_MODULES(GMIME,
-                         gmime-2.6,
-                         [have_gmime=yes GMIME=gmime-2.6],
-                         [have_gmime=no])
-   fi
-
-   if test "x$have_gmime" = "xyes" ; then
-      AC_SUBST(GMIME, $GMIME)
-      AC_SUBST(USEGMIME, yes)
-      AC_DEFINE(HAVE_GMIME, 1, [GMime available in the system])
-      if test "x$have_gmime3" = xyes ; then
-        AC_DEFINE(HAVE_GMIME3, 1, [GMime 3.0 available in the system])
-      fi
-      pkg_modules="$pkg_modules $GMIME"
-   else
-      AC_MSG_ERROR([libgmime is required to compile totem-pl-parser.])
-   fi
-else
-   AC_SUBST(USEGMIME, no)
-   gmime_message="
+AC_ARG_ENABLE(gmime,
+	      AS_HELP_STRING([--enable-gmime=2.6|3.0|auto|no],
+			     [Which gmime version to compile against. Disabling libgmime is unsupported and breaks Podcast support.]),
+			     [],
+			     [enable_gmime=auto])
+
+AS_IF([test "x$enable_gmime" = "x2.6"],
+      [PKG_CHECK_MODULES(GMIME, [gmime-2.6], [GMIME=gmime-2.6])],
+      [test "x$enable_gmime" = "x3.0"],
+      [PKG_CHECK_MODULES(GMIME, [gmime-3.0], [GMIME=gmime-3.0])],
+      [test "x$enable_gmime" = "xauto" -o "x$enable_gmime" = "xyes"],
+      [PKG_CHECK_MODULES(GMIME, [gmime-3.0],
+                         [GMIME=gmime-3.0],
+                         [PKG_CHECK_MODULES(GMIME, [gmime-2.6], [GMIME=gmime-2.6])])],
+      [test "x$enable_gmime" = "xno"],
+      [],
+      # else
+      [AC_MSG_ERROR([invalid gmime version specified])]
+)
+
+AS_IF([test "x$enable_gmime" = "xno"],
+      [
+        AC_SUBST(USEGMIME, no)
+        gmime_message="
  **************************************************************
  Compiling totem-pl-parser without libgmime.
  This will break podcast support and is completely unsupported.
  **************************************************************"
-fi
+      ], [
+        AC_SUBST(GMIME, $GMIME)
+        AC_SUBST(USEGMIME, yes)
+        AC_DEFINE(HAVE_GMIME, 1, [GMime available in the system])
+        AS_IF([test "$xGMIME" = "xgmime-3.0"],
+              [AC_DEFINE(HAVE_GMIME3, 1, [GMime 3.0 available in the system])])
+        pkg_modules="$pkg_modules $GMIME"
+      ]
+)
 
 ##################################
 # Checking quvi dependency
-- 
2.14.0