]> git.sesse.net Git - vlc/blobdiff - configure.ac
Fix C++ linking
[vlc] / configure.ac
index 3dc383eadbe7b4f22744fc88e6f0eb7cd1ae7c61..85f314c67f869b263f18f6c3c0914d449d446981 100644 (file)
@@ -455,22 +455,23 @@ 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
+AS_IF([test "${SYS}" = "mingw32"], [
     AC_MSG_CHECKING(for broken mingw-runtime)
-    AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+    AC_PREPROC_IFELSE([
 #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])],
+], [
+        AC_MSG_RESULT([ok])
+], [
+        AC_MSG_RESULT([present])
+        AC_MSG_ERROR([LibVLC requires mingw-runtime version 3.13 or higher!])
 ])
     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"
@@ -551,13 +552,11 @@ dnl Check for system libs needed
 need_libc=false
 
 dnl Check for usual libc functions
-AC_CHECK_FUNCS([gettimeofday isatty swab sigrelse getpwuid_r memalign posix_memalign if_nametoindex getenv putenv setenv gmtime_r ctime_r localtime_r lrintf daemon fork bsearch lstat 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 lldiv strdup strlcpy strndup strnlen strsep strtof strtoll vasprintf])
+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])