[vlc-commits] OSX: make BGHUDAppKit and Sparkle optional

Rafaël Carré git at videolan.org
Thu Nov 24 00:52:38 CET 2011


vlc | branch: master | Rafaël Carré <funman at videolan.org> | Wed Nov 23 18:52:21 2011 -0500| [2d1811bf8a3f6637886e467844129727ba690da5] | committer: Rafaël Carré

OSX: make BGHUDAppKit and Sparkle optional

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=2d1811bf8a3f6637886e467844129727ba690da5
---

 configure.ac                      |   31 ++++++++++++++-----------------
 modules/gui/macosx/intf.m         |   10 +++++++++-
 modules/gui/macosx/simple_prefs.m |   10 +++++++++-
 3 files changed, 32 insertions(+), 19 deletions(-)

diff --git a/configure.ac b/configure.ac
index dd25e2b..8b2a350 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3750,26 +3750,23 @@ dnl  MacOS X gui module
 dnl
 AC_ARG_ENABLE(macosx,
   [  --enable-macosx         Mac OS X gui support (default enabled on Mac OS X)])
-if test "x${enable_macosx}" != "xno" &&
-(test "${SYS}" = "darwin" || test "${enable_macosx}" = "yes")
+if test "x${enable_macosx}" != "xno" -a "${SYS}" = "darwin"
 then
-  VLC_ADD_LIBS([macosx minimal_macosx],[-Wl,-framework,Cocoa])
-  VLC_ADD_LIBS([macosx minimal_macosx],[-Wl,-framework,OpenGL])
-  VLC_ADD_LIBS([macosx minimal_macosx],            [-Wl,-framework,Carbon])
-  VLC_ADD_LIBS([macosx minimal_macosx],            [-Wl,-framework,CoreServices])
-  VLC_ADD_LIBS([macosx minimal_macosx],            [-Wl,-framework,AGL])
-  VLC_ADD_LIBS([macosx],                           [-Wl,-framework,QTKit])
-  VLC_ADD_LIBS([macosx],                           [-Wl,-framework,IOKit])
-  VLC_ADD_LIBS([macosx],                           [-F${CONTRIB_DIR}/Sparkle -Wl,-framework,Sparkle])
-  VLC_ADD_OBJCFLAGS([macosx],                         [-F${CONTRIB_DIR}/Sparkle])
-  VLC_ADD_LIBS([macosx],                           [-F${CONTRIB_DIR}/BGHUDAppKit -Wl,-framework,BGHUDAppKit])
-  VLC_ADD_OBJCFLAGS([macosx],                         [-F${CONTRIB_DIR}/BGHUDAppKit])
-  dnl For bug report
-  VLC_ADD_LIBS([macosx],                           [-Wl,-framework,AddressBook])
-  VLC_ADD_LIBS([macosx],                           [-Wl,-framework,WebKit])
+  VLC_ADD_LIBS([macosx minimal_macosx], [-Wl,-framework,Cocoa -Wl,-framework,OpenGL -Wl,-framework,Carbon -Wl,-framework,CoreServices -Wl,-framework,AGL])
   VLC_ADD_OBJCFLAGS([macosx minimal_macosx], [-fobjc-exceptions] )
-
   VLC_ADD_PLUGIN([macosx minimal_macosx])
+
+  VLC_ADD_LIBS([macosx], [-Wl,-framework,QTKit -Wl,-framework,IOKit -Wl,-framework,AddressBook -Wl,-framework,WebKit])
+  AC_CHECK_HEADERS(Sparkle/Sparkle.h, [
+    VLC_ADD_LIBS([macosx], [-F${CONTRIB_DIR}/Sparkle -Wl,-framework,Sparkle])
+    VLC_ADD_OBJCFLAGS([macosx], [-F${CONTRIB_DIR}/Sparkle])
+  ])
+  if test -d ${CONTRIB_DIR}/BGHUDAppKit
+  then
+      VLC_ADD_LIBS([macosx], [-F${CONTRIB_DIR}/BGHUDAppKit -Wl,-framework,BGHUDAppKit])
+      VLC_ADD_OBJCFLAGS([macosx], [-F${CONTRIB_DIR}/BGHUDAppKit])
+  fi
+
 fi
 
 dnl
diff --git a/modules/gui/macosx/intf.m b/modules/gui/macosx/intf.m
index c541ca8..c714786 100644
--- a/modules/gui/macosx/intf.m
+++ b/modules/gui/macosx/intf.m
@@ -27,6 +27,10 @@
 /*****************************************************************************
  * Preamble
  *****************************************************************************/
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
 #include <stdlib.h>                                      /* malloc(), free() */
 #include <sys/param.h>                                    /* for MAXPATHLEN */
 #include <string.h>
@@ -58,7 +62,9 @@
 #import "TrackSynchronization.h"
 
 #import <AddressBook/AddressBook.h>         /* for crashlog send mechanism */
-#import <Sparkle/Sparkle.h>                 /* we're the update delegate */
+#ifdef HAVE_SPARKLE_SPARKLE_H
+# import <Sparkle/Sparkle.h>                 /* we're the update delegate */
+#endif
 
 /*****************************************************************************
  * Local prototypes.
@@ -756,6 +762,7 @@ static VLCMain *_o_sharedMainInstance = nil;
     [self setIntf:nil];
 }
 
+#ifdef HAVE_SPARKLE_SPARKLE_H
 #pragma mark -
 #pragma mark Sparkle delegate
 /* received directly before the update gets installed, so let's shut down a bit */
@@ -765,6 +772,7 @@ static VLCMain *_o_sharedMainInstance = nil;
     [o_remote stopListening: self];
     var_SetInteger( p_intf->p_libvlc, "key-action", ACTIONID_STOP );
 }
+#endif
 
 #pragma mark -
 #pragma mark Media Key support
diff --git a/modules/gui/macosx/simple_prefs.m b/modules/gui/macosx/simple_prefs.m
index 43728cc..33747c4 100644
--- a/modules/gui/macosx/simple_prefs.m
+++ b/modules/gui/macosx/simple_prefs.m
@@ -20,6 +20,9 @@
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
 *****************************************************************************/
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
 
 #import "CompatibilityFixes.h"
 #import "simple_prefs.h"
@@ -31,7 +34,10 @@
 #import "misc.h"
 #import "intf.h"
 #import "AppleRemote.h"
-#import <Sparkle/Sparkle.h>                        //for o_intf_last_update_lbl
+
+#ifdef HAVE_SPARKLE_SPARKLE_H
+# import <Sparkle/Sparkle.h>                        //for o_intf_last_update_lbl
+#endif
 
 static NSString* VLCSPrefsToolbarIdentifier = @"Our Simple Preferences Toolbar Identifier";
 static NSString* VLCIntfSettingToolbarIdentifier = @"Intf Settings Item Identifier";
@@ -453,9 +459,11 @@ static inline char * __config_GetLabel( vlc_object_t *p_this, const char *psz_na
     [self setupButton: o_intf_embedded_ckb forBoolValue: "embedded-video"];
 	[self setupButton: o_intf_appleremote_ckb forBoolValue: "macosx-appleremote"];
 	[self setupButton: o_intf_mediakeys_ckb forBoolValue: "macosx-mediakeys"];
+#ifdef HAVE_SPARKLE_SPARKLE_H
     if( [[SUUpdater sharedUpdater] lastUpdateCheckDate] != NULL )
         [o_intf_last_update_lbl setStringValue: [NSString stringWithFormat: _NS("Last check on: %@"), [[[SUUpdater sharedUpdater] lastUpdateCheckDate] descriptionWithLocale: [[NSUserDefaults standardUserDefaults] dictionaryRepresentation]]]];
     else
+#endif
         [o_intf_last_update_lbl setStringValue: _NS("No check was performed yet.")];
     psz_tmp = config_GetPsz( p_intf, "control" );
     if (psz_tmp) {



More information about the vlc-commits mailing list