https://sourceforge.net/p/xine/tickets/22/ https://bugs.gentoo.org/899872 Fix C compatibility issues in the configure script This is necessary to avoid incorrectly failing probes due to expected compiler errors. Include for the exit function, and for the strdup function. Use fake prototypes to avoid implicit function declarations in the xine_* function probes. --- a/configure.ac +++ b/configure.ac @@ -198,6 +198,7 @@ if test "$ac_cv_header_sys_shm_h" = "yes"; then AC_MSG_CHECKING(whether shmctl IPC_RMID allowes subsequent attaches) AC_TRY_RUN([ + #include #include #include #include --- a/m4/aa.m4 +++ b/m4/aa.m4 @@ -52,6 +52,7 @@ #include #include #include +#include int main () { int major, minor; --- a/m4/_xine.m4 +++ b/m4/_xine.m4 @@ -218,7 +218,7 @@ CFLAGS="$CFLAGS $XINE_CFLAGS" LIBS="$LIBS $XINE_LIBS" AC_LINK_IFELSE( - [AC_LANG_PROGRAM([],[xine_open_cloexec();])], + [AC_LANG_PROGRAM([char xine_open_cloexec(void);],[xine_open_cloexec();])], [AC_DEFINE([HAVE_XINE_OPEN_CLOEXEC], [1], [Define if xine-lib supports xine_open_cloexec]) AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no])]) @@ -234,7 +234,7 @@ CFLAGS="$CFLAGS $XINE_CFLAGS" LIBS="$LIBS $XINE_LIBS" AC_LINK_IFELSE( - [AC_LANG_PROGRAM([],[xine_socket_cloexec();])], + [AC_LANG_PROGRAM([char xine_socket_cloexec(void);],[xine_socket_cloexec();])], [AC_DEFINE([HAVE_XINE_SOCKET_CLOEXEC], [1], [Define if xine-lib supports xine_socket_cloexec]) AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no])]) @@ -250,7 +250,7 @@ CFLAGS="$CFLAGS $XINE_CFLAGS" LIBS="$LIBS $XINE_LIBS" AC_LINK_IFELSE( - [AC_LANG_PROGRAM([ + [AC_LANG_PROGRAM([char xine_list_next_value(void); ],[ xine_list_next_value (); ])], --- a/configure.ac +++ b/configure.ac @@ -641,7 +641,8 @@ dnl dnl Check for clock_gettime() in librt dnl AC_MSG_CHECKING(whether librt is needed) -AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include + #include #include ]], [[#if _POSIX_TIMERS > 0 struct timespec ts;