]> git.sesse.net Git - vlc/blobdiff - configure.ac
Fix object leak (1 from my previous commit + 2 others)
[vlc] / configure.ac
index 5a1666a8fc069026365c6d90a7c42303e534358a..d0fe51fc81a3e86385140e49d8d4f4e5faadf245 100644 (file)
@@ -18,6 +18,7 @@ AC_PREREQ(2.59c)
 AC_CONFIG_SRCDIR(src/libvlc.c)
 AC_CONFIG_AUX_DIR(autotools)
 AC_CONFIG_MACRO_DIR(m4)
+AC_CONFIG_LIBOBJ_DIR(compat)
 AC_CANONICAL_BUILD
 AC_CANONICAL_HOST
 
@@ -453,6 +454,24 @@ AM_ICONV
 VLC_ADD_CFLAGS([libvlc],[${INCICONV}])
 VLC_ADD_LIBS([libvlc],[${LTLIBICONV}])
 
+dnl Check for broken versions of mingw-runtime compatability library
+if test "${SYS}" = "mingw32"
+then
+    AC_MSG_CHECKING(for broken mingw-runtime)
+    AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+#include <_mingw.h>
+#if (__MINGW32_MAJOR_VERSION == 3) && (__MINGW32_MINOR_VERSION < 14)
+# error Attempting to use mingw-runtime with broken vsnprintf support
+#endif
+        ]])],
+        [AC_MSG_RESULT([Ok])],
+        [AC_MSG_ERROR([Broken mingw-runtime, need > 3.13])],
+])
+    dnl force use of mingw provided c99 *printf over msvcrt
+    CPPFLAGS="${CPPFLAGS} -D__USE_MINGW_ANSI_STDIO=1"
+    CPPFLAGS_save="${CPPFLAGS_save} -D__USE_MINGW_ANSI_STDIO=1"
+fi
+
 dnl Check for the need to include the mingwex lib for mingw32
 if test "${SYS}" = "mingw32"
 then
@@ -532,12 +551,11 @@ dnl Check for system libs needed
 need_libc=false
 
 dnl Check for usual libc functions
-AC_CHECK_FUNCS([gettimeofday strtod strtol strtof strtoll strtoull strsep isatty vasprintf asprintf swab sigrelse getpwuid_r memalign posix_memalign if_nametoindex atoll getenv putenv setenv gmtime_r ctime_r localtime_r lrintf daemon scandir fork bsearch lstat strlcpy strdup strndup strnlen atof lldiv posix_fadvise posix_madvise uselocale])
-AC_CHECK_FUNCS(strcasecmp,,[AC_CHECK_FUNCS(stricmp)])
-AC_CHECK_FUNCS(strncasecmp,,[AC_CHECK_FUNCS(strnicmp)])
-AC_CHECK_FUNCS(strcasestr,,[AC_CHECK_FUNCS(stristr)])
+AC_CHECK_FUNCS([gettimeofday isatty swab sigrelse getpwuid_r memalign posix_memalign if_nametoindex getenv putenv setenv ctime_r lrintf daemon fork lstat posix_fadvise posix_madvise uselocale])
 AC_FUNC_ALLOCA
 AC_CHECK_FUNCS(fcntl)
+AC_REPLACE_FUNCS([asprintf atof atoll gmtime_r lldiv localtime_r rewind strcasecmp strcasestr strdup strlcpy strncasecmp strndup strnlen strsep strtof strtoll vasprintf])
+AC_CHECK_FUNCS([stricmp strnicmp])
 
 dnl Check for Linux system calls
 AC_CHECK_FUNCS([vmsplice])
@@ -829,8 +847,8 @@ AC_EGREP_HEADER(strncasecmp,strings.h,[
   AC_MSG_RESULT(no)])
 
 dnl Check for headers
-AC_CHECK_HEADERS(time.h errno.h stdint.h getopt.h strings.h locale.h)
-AC_CHECK_HEADERS(sys/sockio.h fcntl.h sys/types.h sys/time.h sys/times.h sys/ioctl.h sys/stat.h xlocale.h)
+AC_CHECK_HEADERS(getopt.h strings.h locale.h)
+AC_CHECK_HEADERS(fcntl.h sys/types.h sys/time.h sys/times.h sys/ioctl.h sys/stat.h xlocale.h)
 AC_CHECK_HEADERS([arpa/inet.h netinet/in.h netinet/udplite.h sys/eventfd.h])
 AC_CHECK_HEADERS([net/if.h], [], [],
   [
@@ -5946,6 +5964,7 @@ AC_CONFIG_FILES([
   share/Makefile
   share/vlc_win32_rc.rc
   share/libvlc_win32_rc.rc
+  compat/Makefile
   src/Makefile
   src/test/Makefile
   bin/Makefile