]> git.sesse.net Git - vlc/commitdiff
OSX: make BGHUDAppKit and Sparkle optional
authorRafaël Carré <funman@videolan.org>
Wed, 23 Nov 2011 23:52:21 +0000 (18:52 -0500)
committerRafaël Carré <funman@videolan.org>
Wed, 23 Nov 2011 23:52:21 +0000 (18:52 -0500)
configure.ac
modules/gui/macosx/intf.m
modules/gui/macosx/simple_prefs.m

index dd25e2bc89fc74ec87aca89105632cdcd4c2b36c..8b2a35038d3caa8864fe944098de02b1b0a9c95a 100644 (file)
@@ -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
index c541ca8837d4802aa7d1c80a9a13cb2dcb1ca5ca..c71478690c38569a024bdc5f2b555f7d2ef5d54d 100644 (file)
 /*****************************************************************************
  * 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
index 43728ccd68c677f38e5043a5c19261751b910114..33747c4bfceaa81dd4b347fd8a4b4ebf2a6d3ff4 100644 (file)
@@ -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"
 #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) {