[vlc-commits] macosx: fixed execution of binaries linked against the 10.7 SDK on 10.6

Felix Paul Kühne git at videolan.org
Sun Jan 29 19:07:27 CET 2012


vlc/vlc-2.0 | branch: master | Felix Paul Kühne <fkuehne at videolan.org> | Sun Jan 29 13:58:03 2012 +0100| [dd39bba006417f612599ee13bc77874185943d8c] | committer: Jean-Baptiste Kempf

macosx: fixed execution of binaries linked against the 10.7 SDK on 10.6
(cherry picked from commit 49972383e28d67ebd9657d9101f77b2216aeb24e)
(cherry picked from commit 89c3a705cec6568f98ae70eec998ab9635078466)

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

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

 configure.ac         |   10 +++++++++-
 include/vlc_fixups.h |   11 +++--------
 2 files changed, 12 insertions(+), 9 deletions(-)

diff --git a/configure.ac b/configure.ac
index c7345cc..8a139d7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -162,7 +162,15 @@ case "${host_os}" in
     VLC_ADD_LIBS([libvlccore],[-Wl,-framework,CoreFoundation])
 
     dnl Allow binaries created on Lion to run on earlier releases
-    AC_LIBOBJ([getdelim])
+    AC_EGREP_CPP(yes,
+           [#import <Cocoa/Cocoa.h>
+            #ifdef MAC_OS_X_VERSION_10_7
+            yes
+            #endif],
+            [AC_MSG_RESULT([yes])
+            AC_LIBOBJ([getdelim])
+            AC_LIBOBJ([strndup])
+            AC_LIBOBJ([strnlen])],)
 
     dnl
     dnl  Check for Mac OS X SDK settings
diff --git a/include/vlc_fixups.h b/include/vlc_fixups.h
index 086aac2..15ebb4c 100644
--- a/include/vlc_fixups.h
+++ b/include/vlc_fixups.h
@@ -44,8 +44,7 @@ typedef struct
 #endif
 
 #if !defined (HAVE_REWIND) || \
-    !defined (HAVE_GETDELIM) || \
-    defined (__APPLE__)
+    !defined (HAVE_GETDELIM)
 # include <stdio.h> /* FILE */
 #endif
 
@@ -59,7 +58,7 @@ typedef struct
 # include <stdarg.h> /* va_list */
 #endif
 
-#if !defined (HAVE_GETDELIM) || defined (__APPLE__) || \
+#if !defined (HAVE_GETDELIM) || \
     !defined (HAVE_GETPID)   || \
     !defined (HAVE_SWAB)
 # include <sys/types.h> /* ssize_t, pid_t */
@@ -89,11 +88,7 @@ int putc_unlocked (int, FILE *);
 int putchar_unlocked (int);
 #endif
 
-/* we always need our implementation on Darwin, since native support for getline
- * was added lately to Darwin 11 (OS X Lion) only.
- * However, we want binaries created on this OS to be executable on previous
- * releases. */
-#if !defined HAVE_GETDELIM
+#ifndef HAVE_GETDELIM
 ssize_t getdelim (char **, size_t *, int, FILE *);
 ssize_t getline (char **, size_t *, FILE *);
 #endif



More information about the vlc-commits mailing list