build: Make sure AC_INCLUDES_DEFAULT is used

Without using AC_INCLUDES_DEFAULT explicitly,
certain platforms will complain that the header
was found, but not usable by the compiler.
This happens for instance on Solaris where certain
headers are needed to pull in proper defines.

Also upgrade to newer autoconf syntax and use proper quoting.

https://bugzilla.gnome.org/show_bug.cgi?id=667293
This commit is contained in:
Idar Tollefsen 2012-01-01 16:38:08 +01:00 committed by Tim-Philipp Müller
parent c3ec487098
commit e6d6cbf5e3
2 changed files with 17 additions and 15 deletions

View file

@ -302,40 +302,40 @@ dnl check if we have ANSI C header files
AC_HEADER_STDC
dnl Check for ucontext.h
AC_CHECK_HEADERS([ucontext.h])
AC_CHECK_HEADERS([ucontext.h], [], [], [AC_INCLUDES_DEFAULT])
dnl Check for sys/socket.h
AC_CHECK_HEADERS([sys/socket.h], HAVE_SYS_SOCKET_H=yes)
AC_CHECK_HEADERS([sys/socket.h], [HAVE_SYS_SOCKET_H=yes], [HAVE_SYS_SOCKET_H=no], [AC_INCLUDES_DEFAULT])
AM_CONDITIONAL(HAVE_SYS_SOCKET_H, test "x$HAVE_SYS_SOCKET_H" = "xyes")
dnl check for sys/times.h for tests/examples/adapter/
AC_CHECK_HEADERS([sys/times.h], HAVE_SYS_TIMES_H=yes)
AC_CHECK_HEADERS([unistd.h], HAVE_UNISTD_H=yes)
AC_CHECK_HEADERS([sys/times.h], [HAVE_SYS_TIMES_H=yes], [HAVE_SYS_TIME_H=no], [AC_INCLUDES_DEFAULT])
AC_CHECK_HEADERS([unistd.h], [HAVE_UNISTD_H=yes], [HAVE_UNISTD_H=no], [AC_INCLUDES_DEFAULT])
AM_CONDITIONAL(HAVE_SYS_TIMES_H_AND_UNISTD_H, test "x$HAVE_SYS_TIMES_H" = "xyes" -a "x$HAVE_UNISTD_H" = "xyes")
dnl Check for process.h for getpid() on win32
AC_CHECK_HEADERS([process.h])
AC_CHECK_HEADERS([process.h], [], [], [AC_INCLUDES_DEFAULT])
dnl Check for sys/utsname.h for uname
AC_CHECK_HEADERS([sys/utsname.h])
AC_CHECK_HEADERS([sys/utsname.h], [], [], [AC_INCLUDES_DEFAULT])
dnl Check for stdio_ext.f for __fbufsize
AC_CHECK_HEADERS([stdio_ext.h])
AC_CHECK_HEADERS([stdio_ext.h], [], [], [AC_INCLUDES_DEFAULT])
dnl check for pthreads
AC_CHECK_HEADERS([pthread.h], HAVE_PTHREAD_H=yes)
AC_CHECK_HEADERS([pthread.h], [HAVE_PTHREAD_H=yes], [HAVE_PTHREAD_H=no], [AC_INCLUDES_DEFAULT])
AM_CONDITIONAL(HAVE_PTHREAD_H, test "x$HAVE_PTHREAD_H" = "xyes")
dnl check for sys/prctl for setting thread name on Linux
AC_CHECK_HEADERS([sys/prctl.h], HAVE_SYS_PRCTL_H=yes)
AC_CHECK_HEADERS([sys/prctl.h], [], [], [AC_INCLUDES_DEFAULT])
dnl Check for valgrind.h
dnl separate from HAVE_VALGRIND because you can have the program, but not
dnl the dev package
AC_CHECK_HEADERS([valgrind/valgrind.h], HAVE_VALGRIND_H=yes)
AC_CHECK_HEADERS([valgrind/valgrind.h], [], [], [AC_INCLUDES_DEFAULT])
dnl used in gst/gstpoll.c
AC_CHECK_HEADERS([winsock2.h], HAVE_WINSOCK2_H=yes)
AC_CHECK_HEADERS([winsock2.h], [HAVE_WINSOCK2_H=yes], [HAVE_WINSOCK2_H=no], [AC_INCLUDES_DEFAULT])
AM_CONDITIONAL(HAVE_WINSOCK2_H, test "x$HAVE_WINSOCK2_H" = "xyes")
if test "x$HAVE_WINSOCK2_H" = "xyes"; then
WIN32_LIBS="-lws2_32"
@ -414,12 +414,12 @@ AC_CHECK_FUNCS([fgetpos])
AC_CHECK_FUNCS([fsetpos])
dnl check for poll(), ppoll() and pselect()
AC_CHECK_HEADERS([sys/poll.h], [], [], [AC_INCLUDES_DEFAULT])
AC_CHECK_HEADERS([poll.h], [], [], [AC_INCLUDES_DEFAULT])
AC_CHECK_FUNCS([poll])
AC_CHECK_FUNCS([ppoll])
AC_CHECK_FUNCS([pselect])
AC_CHECK_HEADERS([sys/poll.h])
dnl ****************************************
dnl *** GLib POLL* compatibility defines ***
dnl ****************************************
@ -428,10 +428,12 @@ AC_MSG_CHECKING([for broken poll])
AC_RUN_IFELSE([AC_LANG_SOURCE([[
#include <stdlib.h>
#include <fcntl.h>
#include <poll.h>
#ifdef HAVE_SYS_POLL_H
#include <sys/poll.h>
#endif
#ifdef HAVE_POLL_H
#include <poll.h>
#endif
int main(void) {
struct pollfd fds[1];
int fd;

View file

@ -16,7 +16,7 @@ AC_SUBST(CHECK_MICRO_VERSION)
AC_SUBST(CHECK_VERSION)
dnl Checks for header files and declarations
AC_CHECK_HEADERS([unistd.h sys/wait.h sys/time.h])
AC_CHECK_HEADERS([unistd.h sys/wait.h sys/time.h], [], [], [AC_INCLUDES_DEFAULT])
AC_CHECK_FUNCS([localtime_r])