summaryrefslogtreecommitdiff
path: root/media-tv/xbmc/files/xbmc-11.0-nomythtv.patch
blob: 09286dba0a87b7ee6d5704aedf97e36f1fdeaad7 (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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
http://trac.xbmc.org/ticket/11775

make mysql/mythtv support optional

--- a/Makefile.in
+++ b/Makefile.in
@@ -127,13 +127,17 @@ endif
 LIB_DIRS=\
 	lib/cximage-6.0 \
 	lib/libexif \
-	lib/cmyth \
 	lib/libhdhomerun \
 	lib/libid3tag \
 	lib/libapetag \
 	lib/cpluff \
 	lib/xbmc-dll-symbols
 
+ifeq (@BUILD_MYTHTV@,1)
+LIB_DIRS+=\
+	lib/cmyth
+endif
+
 SS_DIRS=
 ifeq (@USE_OPENGL@,1)
 SS_DIRS+= xbmc/screensavers/rsxs-0.9/xbmc
@@ -418,7 +422,10 @@ imagelib: dllloader
 	$(MAKE) -C lib/cximage-6.0
 
 codecs: papcodecs dvdpcodecs
-libs: cmyth libhdhomerun libid3tag imagelib libexif system/libcpluff-@ARCH@.so
+libs: libhdhomerun libid3tag imagelib libexif system/libcpluff-@ARCH@.so
+ifeq (@BUILD_MYTHTV@,1)
+libs: cmyth
+endif
 externals: codecs libs visualizations screensavers
 
 xcode_depends: \
--- a/configure.in
+++ b/configure.in
@@ -68,6 +68,9 @@ goom_enabled="== GOOM enabled. =="
 goom_disabled="== GOOM disabled. =="
 pulse_not_found="== Could not find libpulse. PulseAudio support disabled. =="
 pulse_disabled="== PulseAudio support manually disabled. =="
+mysql_not_found="Could not find libmysqlclient. MySQL (and MythTV) support disabled. =="
+mysql_disabled="== MySQL support disabled. =="
+mythtv_disabled="== MythTV support disabled. =="
 dvdcss_enabled="== DVDCSS support enabled. =="
 dvdcss_disabled="== DVDCSS support disabled. =="
 hal_not_found="== Could not find hal. HAL support disabled. =="
@@ -238,6 +241,18 @@ AC_ARG_ENABLE([ffmpeg_libvorbis],
   [use_ffmpeg_libvorbis=$enableval],
   [use_ffmpeg_libvorbis=no])
 
+AC_ARG_ENABLE([mysql],
+  [AS_HELP_STRING([--enable-mysql],
+  [enable MySQL support (default is auto)])],
+  [use_mysql=$enableval],
+  [use_mysql=auto])
+
+AC_ARG_ENABLE([mythtv],
+  [AS_HELP_STRING([--enable-mythtv],
+  [enable MythTV support (default is auto)])],
+  [use_mythtv=$enableval],
+  [use_mythtv=auto])
+
 AC_ARG_ENABLE([dvdcss],
   [AS_HELP_STRING([--enable-dvdcss],
   [enable DVDCSS support (default is yes)])],
@@ -563,14 +578,31 @@ else
 fi
 
 # platform common libraries
-AC_CHECK_PROG(MYSQL_CONFIG, mysql_config, "yes", "no")
-if test $MYSQL_CONFIG = "yes"; then
-  INCLUDES="$INCLUDES `mysql_config --include`"
-  MYSQL_LIBS=`mysql_config --libs`
-  LIBS="$LIBS $MYSQL_LIBS"
-  AC_SUBST(MYSQL_LIBS)
-else
-  AC_MSG_ERROR($missing_program)
+have_mysql=no
+if test "$use_mysql" != "no"; then
+  AC_CHECK_PROG(MYSQL_CONFIG, mysql_config, "yes", "no")
+  if test $MYSQL_CONFIG = "yes"; then
+    INCLUDES="$INCLUDES `mysql_config --include`"
+    MYSQL_LIBS=`mysql_config --libs`
+    LIBS="$LIBS $MYSQL_LIBS"
+    AC_SUBST(MYSQL_LIBS)
+    AC_CHECK_LIB([mysqlclient], [main], have_mysql=yes)
+  fi
+fi
+if test "$have_mysql" = "yes"; then
+  BUILD_MYTHTV=1
+  AC_DEFINE([BUILD_MYSQL], [1], [Define to 1 to build MySQL.])
+  if test "$use_mysql" != "no"; then
+    AC_DEFINE([BUILD_MYTHTV], [1], [Define to 1 to build mythtv.])
+  fi
+elif test "$use_mysql" = "yes" || test "$use_mythtv" = "yes"; then
+  AC_MSG_ERROR([$mysql_not_found])
+else
+  BUILD_MYTHTV=0
+  use_mysql=no
+  AC_MSG_NOTICE($mysql_disabled)
+  use_mythtv=no
+  AC_MSG_NOTICE($mythtv_disabled)
 fi
 AC_CHECK_HEADER([ass/ass.h],, AC_MSG_ERROR($missing_library))
 AC_CHECK_HEADER([mpeg2dec/mpeg2.h],, AC_MSG_ERROR($missing_library))
@@ -594,7 +625,6 @@ AC_CHECK_LIB([lzo2],        [main],, AC_MSG_ERROR($missing_library))
 AC_CHECK_LIB([z],           [main],, AC_MSG_ERROR($missing_library))
 AC_CHECK_LIB([crypto],      [main],, AC_MSG_ERROR($missing_library))
 AC_CHECK_LIB([ssl],         [main],, AC_MSG_ERROR($missing_library))
-AC_CHECK_LIB([mysqlclient], [main],, AC_MSG_ERROR($missing_library))
 AC_CHECK_LIB([ssh],         [sftp_tell64],, AC_MSG_RESULT([Could not find suitable version of libssh]))
 AC_CHECK_LIB([smbclient],   [main],, AC_MSG_ERROR($missing_library))
 AC_CHECK_LIB([bluetooth],   [hci_devid],, AC_MSG_RESULT([Could not find suitable version of libbluetooth]))
@@ -1319,6 +1349,18 @@ else
   final_message="$final_message\n  HAL Support:\tNo"
 fi
 
+if test "$use_mysql" = "yes"; then
+  final_message="$final_message\n  MySQL:\tYes"
+else
+  final_message="$final_message\n  MySQL:\tNo"
+fi
+
+if test "$use_mythtv" = "yes"; then
+  final_message="$final_message\n  MythTV:\tYes"
+else
+  final_message="$final_message\n  MythTV:\tNo"
+fi
+
 # DVDCSS
 if test "$use_dvdcss" = "yes"; then
   AC_MSG_NOTICE($dvdcss_enabled)
@@ -1490,6 +1532,8 @@ AC_SUBST(USE_EXTERNAL_FFMPEG)
 AC_SUBST(PYTHON_VERSION)
 AC_SUBST(OUTPUT_FILES)
 AC_SUBST(HAVE_XBMC_NONFREE)
+AC_SUBST(BUILD_MYSQL)
+AC_SUBST(BUILD_MYTHTV)
 AC_SUBST(USE_ASAP_CODEC)
 AC_SUBST(LIBCURL_BASENAME)
 AC_SUBST(LIBFLAC_BASENAME)
--- a/xbmc/dbwrappers/Database.cpp
+++ b/xbmc/dbwrappers/Database.cpp
@@ -29,7 +29,9 @@
 #include "utils/AutoPtrHandle.h"
 #include "utils/log.h"
 #include "utils/URIUtils.h"
+#ifdef BUILD_MYSQL
 #include "mysqldataset.h"
+#endif /* BUILD_MYSQL */
 #include "sqlitedataset.h"
 
 
@@ -266,6 +268,7 @@
 
   m_sqlite = true;
 
+#ifdef BUILD_MYSQL
   if ( dbSettings.type.Equals("mysql") )
   {
     // check we have all information before we cancel the fallback
@@ -276,7 +279,8 @@
       CLog::Log(LOGINFO, "Essential mysql database information is missing. Require at least host, user and pass defined.");
   }
   else
+#endif /* BUILD_MYSQL */
   {
     dbSettings.type = "sqlite3";
     dbSettings.host = _P(g_settings.GetDatabaseFolder());
     dbSettings.name = GetBaseDBName();
@@ -369,10 +373,12 @@
   {
     m_pDB.reset( new SqliteDatabase() ) ;
   }
+#ifdef BUILD_MYSQL
   else if (dbSettings.type.Equals("mysql"))
   {
     m_pDB.reset( new MysqlDatabase() ) ;
   }
+#endif /* BUILD_MYSQL */
   else
   {
     CLog::Log(LOGERROR, "Unable to determine database type: %s", dbSettings.type.c_str());
--- a/xbmc/dbwrappers/mysqldataset.cpp
+++ b/xbmc/dbwrappers/mysqldataset.cpp
@@ -23,9 +23,11 @@
 #include <string>
 #include <set>
 
+#include "system.h" // for GetLastError()
+#ifdef BUILD_MYSQL
+
 #include "mysqldataset.h"
 #include "utils/log.h"
-#include "system.h" // for GetLastError()
 #include "mysql/errmsg.h"
 #ifdef _WIN32
 #pragma comment(lib, "mysqlclient.lib")
@@ -1562,3 +1564,4 @@
 
 }//namespace
 
+#endif /* BUILD_MYSQL */