]> git.sesse.net Git - vlc/commitdiff
macosx: fixed execution of binaries linked against the 10.7 SDK on 10.6
authorFelix Paul Kühne <fkuehne@videolan.org>
Sun, 29 Jan 2012 12:58:03 +0000 (13:58 +0100)
committerFelix Paul Kühne <fkuehne@videolan.org>
Sun, 29 Jan 2012 12:58:03 +0000 (13:58 +0100)
configure.ac
include/vlc_fixups.h

index 4e8792a23121891b5589da6f796fe8d64d4d1e32..45cf0b83766ba0e1d6c06282378874e1149ef7c1 100644 (file)
@@ -154,7 +154,13 @@ 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 strndup strnlen])],)
 
     dnl
     dnl  Check for Mac OS X SDK settings
index 6b0b7bed9d6bc2a646cc8ed30f7e17605450483a..fbeccd6dd459795763420b31f940b31f775f0eb8 100644 (file)
@@ -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