]> git.sesse.net Git - vlc/blobdiff - configure.ac
loader: fix a warning
[vlc] / configure.ac
index 66661342fc65d5f266bc49997fb0c0508b9e9c5b..684ea97d00114633bf6bceaf0c400a63350eef8a 100644 (file)
@@ -470,14 +470,14 @@ CPPFLAGS_save="${CPPFLAGS_save} -DSYS_`echo ${SYS} | sed -e 's/-.*//' | tr 'abcd
 dnl Check for system libs needed
 need_libc=false
 
-AC_CHECK_FUNCS(gettimeofday strtod strtol strtof strtoll strtoull strsep isatty vasprintf asprintf swab sigrelse getpwuid memalign posix_memalign if_nametoindex atoll getenv putenv setenv gmtime_r ctime_r localtime_r lrintf daemon scandir fork bsearch lstat strlcpy)
-
 dnl Check for usual libc functions
-AC_CHECK_FUNCS(strdup strndup strnlen atof)
+AC_CHECK_FUNCS([gettimeofday strtod strtol strtof strtoll strtoull strsep isatty vasprintf asprintf swab sigrelse getpwuid 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])
 AC_CHECK_FUNCS(strcasecmp,,[AC_CHECK_FUNCS(stricmp)])
 AC_CHECK_FUNCS(strncasecmp,,[AC_CHECK_FUNCS(strnicmp)])
 AC_CHECK_FUNCS(strcasestr,,[AC_CHECK_FUNCS(stristr)])
 
+AH_BOTTOM([#include <vlc_fixups.h>])
+
 AS_IF([test "${SYS}" = "linux"], [
   AC_CHECK_FUNCS(tee)
 ])
@@ -530,13 +530,12 @@ AH_TEMPLATE(socklen_t, [Define to `int' if <sys/socket.h> does not define.])
 AC_CACHE_CHECK([for socklen_t in sys/socket.h],
 ac_cv_type_socklen_t,
 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
-[#if HAVE_SYS_TYPES_H
-# include <sys/types.h>
-#endif
-#if HAVE_SYS_SOCKET_H
-# include <sys/socket.h>
-#elif HAVE_WINSOCK2_H
+[#include <sys/types.h>
+#ifdef WIN32
 # include <winsock2.h>
+# include <ws2tcpip.h>
+#else
+# include <sys/socket.h>
 #endif]], [[socklen_t len; len = 0;]])],
 ac_cv_type_socklen_t=yes,
 ac_cv_type_socklen_t=no)])
@@ -765,23 +764,9 @@ AC_CHECK_FUNCS(nanosleep,have_nanosleep=:,[
 if ${have_nanosleep}; then
   AC_DEFINE(HAVE_NANOSLEEP, 1, [Define if nanosleep is available.])
 fi
+fi # end "${SYS}" != "mingw32" -a "${SYS}" != "mingwce" 
 
 dnl Check for misc headers
-AC_MSG_CHECKING(for pthread_cond_t in pthread.h)
-AC_EGREP_HEADER(pthread_cond_t,pthread.h,[
-  AC_MSG_RESULT(yes)
-  AC_DEFINE(PTHREAD_COND_T_IN_PTHREAD_H, 1,
-            Define if <pthread.h> defines pthread_cond_t.)],[
-  AC_MSG_RESULT(no)])
-
-AC_MSG_CHECKING(for pthread_once in pthread.h)
-AC_EGREP_HEADER(pthread_once,pthread.h,[
-  AC_MSG_RESULT(yes)
-  AC_DEFINE(PTHREAD_ONCE_IN_PTHREAD_H, 1,
-            Define if <pthread.h> defines pthread_once.)],[
-  AC_MSG_RESULT(no)])
-fi # end "${SYS}" != "mingw32" -a "${SYS}" != "mingwce"
-
 AC_MSG_CHECKING(for strncasecmp in strings.h)
 AC_EGREP_HEADER(strncasecmp,strings.h,[
   AC_MSG_RESULT(yes)
@@ -792,12 +777,10 @@ AC_EGREP_HEADER(strncasecmp,strings.h,[
 dnl Check for headers
 AC_CHECK_HEADERS(signal.h time.h errno.h stdint.h stdbool.h getopt.h strings.h inttypes.h sys/int_types.h wchar.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)
-AC_CHECK_HEADERS([arpa/inet.h netinet/in.h sys/socket.h netinet/udplite.h])
+AC_CHECK_HEADERS([arpa/inet.h netinet/in.h netinet/udplite.h])
 AC_CHECK_HEADERS([net/if.h], [], [],
   [
-    #if HAVE_SYS_SOCKET_H
-    # include <sys/socket.h>
-    #endif
+    #include <sys/socket.h>
   ])
 if test "${SYS}" != "mingw32" -a "${SYS}" != "mingwce"; then
 AC_CHECK_HEADERS(machine/param.h sys/shm.h)
@@ -807,7 +790,12 @@ fi # end "${SYS}" != "mingw32" -a "${SYS}" != "mingwce"
 
 AC_HEADER_TIME
 
-AC_CHECK_TYPE(ssize_t, int)
+dnl LP64 adn LLP64 architectures had better define ssize_t by themselves...
+AH_TEMPLATE(ssize_t, [Define to `int' if <stddef.h> does not define.])
+AC_CHECK_TYPE(ssize_t,, [
+  AC_DEFINE(ssize_t, int)
+])
+
 AC_SEARCH_LIBS(poll, [poll], [AC_DEFINE(HAVE_POLL, 1, [Define to 1 if the OS is usabl... err, has poll().])])
 
 dnl Check for dirent
@@ -975,15 +963,17 @@ if test "${ac_cv_c_ntohl_sys_param_h}" != "no"; then
 fi
 CFLAGS="${CFLAGS_save}"
 
-RDC_PROG_CC_WFLAGS([all extra no-unused-parameter sign-compare undef pointer-arith bad-function-cast cast-align write-strings missing-prototypes volatile-register-var])
+RDC_PROG_CC_WFLAGS([all extra sign-compare undef pointer-arith bad-function-cast cast-align write-strings missing-prototypes volatile-register-var])
 RDC_PROG_CC_FLAGS_IFELSE([-pipe])
 
 dnl This helps detect broken plugins with undefined symbols
 dnl Better fail loudly at build-time than silenty at run-time.
 dnl Unfortunately, this sucks on FreeBSD (won't even link with -lc)
-dnl RDC_PROG_LINK_FLAGS_IFELSE([-Wl,-z,defs], [
-dnl   VLC_ADD_LDFLAGS([plugin],[-Wl,-z,defs])
-dnl ])
+if test `uname -s` != FreeBSD; then
+  RDC_PROG_LINK_FLAGS_IFELSE([-Wl,-z,defs], [
+    VLC_ADD_LDFLAGS([plugin],[-Wl,-z,defs])
+  ])
+fi
 
 dnl Check for various optimization flags
 AC_CACHE_CHECK([if \$CC accepts -Os],
@@ -1123,20 +1113,6 @@ dnl     VLC_ADD_LDFLAGS([plugin mozilla],[-shared])
 dnl   ])
 dnl ])
 
-dnl Check for variadic macros
-AC_CACHE_CHECK([for variadic cpp macros],
-    [ac_cv_cpp_variadic_macros],
-    [CFLAGS="${CFLAGS_save}"
-     AC_TRY_COMPILE(
-         [#include <stdio.h>
-          #define a(b,c...) printf(b,##c)],
-         [a("foo");a("%s","bar");a("%s%s","baz","quux");],
-         ac_cv_cpp_variadic_macros=yes,
-         ac_cv_cpp_variadic_macros=no)])
-if test "${ac_cv_cpp_variadic_macros}" != "no"; then
-    AC_DEFINE(HAVE_VARIADIC_MACROS, 1, Support for variadic macros)
-fi
-
 dnl Checks for __attribute__(aligned()) directive
 AC_CACHE_CHECK([__attribute__ ((aligned ())) support],
     [ac_cv_c_attribute_aligned],
@@ -3716,7 +3692,7 @@ dnl
 AC_ARG_ENABLE(dirac,
 [  --enable-dirac          experimental dirac codec (default disabled)])
 if test "${enable_dirac}" = "yes"; then
-  PKG_CHECK_MODULES(DIRAC,[dirac >= 0.8.0], [
+  PKG_CHECK_MODULES(DIRAC,[dirac >= 0.9.0], [
       VLC_ADD_PLUGINS([dirac])
       VLC_ADD_CFLAGS([dirac],[$DIRAC_CFLAGS])
       VLC_ADD_LIBS([dirac],[$DIRAC_LIBS -lstdc++]) ],[
@@ -6069,7 +6045,12 @@ AC_SUBST(VERSION_MAJOR)
 AC_SUBST(VERSION_MINOR)
 AC_SUBST(VERSION_REVISION)
 AC_DEFINE_UNQUOTED(VLC_COMPILE_BY, "`whoami`", [user who ran configure]) 
-AC_DEFINE_UNQUOTED(VLC_COMPILE_HOST, "`hostname -s`", [host which ran configure]) 
+if test "${SYS}" = "cygwin"
+then
+    AC_DEFINE_UNQUOTED(VLC_COMPILE_HOST, "`hostname`", [host which ran configure])
+else
+    AC_DEFINE_UNQUOTED(VLC_COMPILE_HOST, "`hostname -s`", [host which ran configure])
+fi
 AC_DEFINE_UNQUOTED(VLC_COMPILE_DOMAIN, "`dnsdomainname 2>/dev/null || domainname 2>/dev/null || echo unknown`", [domain of the host which ran configure]) 
 AC_DEFINE_UNQUOTED(VLC_COMPILER, "`$CC -v 2>&1 | tail -n 1`", [compiler])