X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=configure.ac;h=069a5a28927128375ae6619f93f87be6687c66ce;hb=f31407eb6b2ef1b97e54abacc73367235a06ace8;hp=e3fad557b08bed5de08b602fa8acef010849403d;hpb=3c7cb1679764fa0a10adf3d93b46723a97647992;p=vlc diff --git a/configure.ac b/configure.ac index e3fad557b0..069a5a2892 100644 --- a/configure.ac +++ b/configure.ac @@ -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 ]) + AS_IF([test "${SYS}" = "linux"], [ AC_CHECK_FUNCS(tee) ]) @@ -526,16 +526,21 @@ AC_CHECK_HEADERS(zlib.h, [ ]) dnl Check for socklen_t -AC_CACHE_CHECK([for socklen_t], ac_cv_type_socklen_t, - [AC_TRY_COMPILE( - [#include - #include ], - [socklen_t len = 42; return len;], - ac_cv_type_socklen_t=yes, - ac_cv_type_socklen_t=no)]) -if test "${ac_cv_type_socklen_t}" != "no"; then - AC_DEFINE(HAVE_SOCKLEN_T, 1, [Define if defines socklen_t.]) -fi +AH_TEMPLATE(socklen_t, [Define to `int' if does not define.]) +AC_CACHE_CHECK([for socklen_t in sys/socket.h], +ac_cv_type_socklen_t, +[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([ +[#include +#ifdef WIN32 +# include +# include +#else +# include +#endif]], [[socklen_t len; len = 0;]])], +ac_cv_type_socklen_t=yes, +ac_cv_type_socklen_t=no)]) +AS_IF([test "$ac_cv_type_socklen_t" = no], + [AC_DEFINE(socklen_t, int)]) dnl Check for struct sockaddr_storage AH_TEMPLATE(sockaddr_storage, [Define to `sockaddr' if does not define.]) @@ -759,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 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 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) @@ -786,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 - #endif + #include ]) if test "${SYS}" != "mingw32" -a "${SYS}" != "mingwce"; then AC_CHECK_HEADERS(machine/param.h sys/shm.h) @@ -801,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 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 @@ -969,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], @@ -1117,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 - #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], @@ -6063,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])