AC_PROG_MKDIR_P
AC_PROG_LN_S
+AX_C___ATTRIBUTE__
+AS_IF([test "x$ax_cv___attribute__" = "xyes"],
+ [:],
+ [AC_MSG_ERROR([The compiler does not support __attribute__ extensions])])
+
+AX_PTHREAD(,[AC_MSG_ERROR([Could not configure pthreads support])])
+LIBS="$PTHREAD_LIBS $LIBS"
+CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
+CC="$PTHREAD_CC"
+
# Check linker option
AX_APPEND_LINK_FLAGS([-Wl,--no-as-needed], [LD_NO_AS_NEEDED])
AC_SUBST([LD_NO_AS_NEEDED])
-AC_CHECK_HEADERS([fcntl.h limits.h netdb.h netinet/in.h stddef.h sys/socket.h])
+AC_HEADER_STDBOOL
+AC_CHECK_HEADERS([ \
+ fcntl.h \
+ float.h \
+ libintl.h \
+ limits.h \
+ malloc.h \
+ netdb.h \
+ netinet/in.h \
+ stddef.h \
+ sys/socket.h \
+])
if test ! -f "$srcdir/formats/ctf/metadata/ctf-parser.h"; then
if test x"$YACC" != "xbison -y"; then
AC_TYPE_SIZE_T
# Checks for library functions.
+AC_FUNC_ALLOCA
+AC_FUNC_FORK
AC_FUNC_MALLOC
+AC_FUNC_MKTIME
AC_FUNC_MMAP
-AC_CHECK_FUNCS([gettimeofday munmap strtoul])
+AC_FUNC_REALLOC
+AC_FUNC_STRERROR_R
+AC_CHECK_FUNCS([ \
+ atexit \
+ dirfd \
+ dup2 \
+ ftruncate \
+ gethostbyname \
+ gethostname \
+ gettimeofday \
+ localtime_r \
+ memchr \
+ memset \
+ mkdir \
+ mkdtemp \
+ munmap \
+ rmdir \
+ setenv \
+ socket \
+ strchr \
+ strdup \
+ strerror \
+ strndup \
+ strnlen \
+ strrchr \
+ strtoul \
+ strtoull \
+ tzset \
+ uname \
+])
# Check for MinGW32.
MINGW32=no
]
)
+# Check for posix_fallocate
+AC_CHECK_LIB([c], [posix_fallocate],
+[
+ AC_DEFINE_UNQUOTED([BABELTRACE_HAVE_POSIX_FALLOCATE], 1, [Has posix_fallocate support.])
+]
+)
+
+# Check for faccessat
+AC_CHECK_LIB([c], [faccessat],
+[
+ AC_DEFINE_UNQUOTED([BABELTRACE_HAVE_FACCESSAT], 1, [Has faccessat support.])
+]
+)
+
AC_CHECK_LIB([popt], [poptGetContext], [],
[AC_MSG_ERROR([Cannot find popt.])]
)
-
# For Python
# SWIG version needed or newer:
swig_version=2.0.0
AC_SUBST(PACKAGE_LIBS)
LIBS="$LIBS $GMODULE_LIBS"
-PACKAGE_CFLAGS="$GMODULE_CFLAGS -Wall -Wformat -include config.h"
+PACKAGE_CFLAGS="$GMODULE_CFLAGS -Wall -Wformat"
AC_SUBST(PACKAGE_CFLAGS)
+DEFAULT_INCLUDES="-I\$(top_srcdir) -I\$(top_builddir) -I\$(top_builddir)/include -include config.h"
+AC_SUBST(DEFAULT_INCLUDES)
+
babeltraceincludedir="${includedir}/babeltrace"
AC_SUBST(babeltraceincludedir)