Drop debian/ directory
[platform/upstream/ltrace.git] / configure.ac
index 20c84f4..da3b4cb 100644 (file)
@@ -1,6 +1,6 @@
 # -*- Autoconf -*-
 # This file is part of ltrace.
-# Copyright (C) 2010,2012 Petr Machata, Red Hat Inc.
+# Copyright (C) 2010,2012,2013 Petr Machata, Red Hat Inc.
 # Copyright (C) 2010,2011 Joe Damato
 # Copyright (C) 2010 Marc Kleine-Budde
 # Copyright (C) 2010 Zachary T Welch
 # 02110-1301 USA
 
 # Process this file with autoconf to produce a configure script.
-AC_PREREQ(2.65)
+AC_PREREQ([2.65])
 
-AC_INIT([ltrace],[0.7.2],[ltrace-devel@lists.alioth.debian.org])
+AC_INIT([ltrace],[0.7.91],[ltrace-devel@lists.alioth.debian.org],
+       [ltrace],[http://ltrace.alioth.debian.org/])
 AC_CONFIG_HEADERS([config.h])
 AC_CONFIG_SRCDIR(libltrace.c)
 AC_CONFIG_MACRO_DIR([config/m4])
@@ -32,7 +33,8 @@ AC_CANONICAL_BUILD
 AC_CANONICAL_HOST
 
 case "${host_os}" in
-    linux-gnu*)        HOST_OS="linux-gnu" ;;
+    linux-gnu*) HOST_OS="linux-gnu" ;;
+    linux-uclibc*) HOST_OS="linux-gnu" ;;
     *)         AC_MSG_ERROR([unkown host-os ${host_os}]) ;;
 esac
 AC_SUBST(HOST_OS)
@@ -40,7 +42,6 @@ AC_SUBST(HOST_OS)
 case "${host_cpu}" in
     arm*|sa110)                HOST_CPU="arm" ;;
     cris*)             HOST_CPU="cris" ;;
-    mips*el)           HOST_CPU="mipsel" ;;
     mips*)             HOST_CPU="mips" ;;
     powerpc|powerpc64) HOST_CPU="ppc" ;;
     sun4u|sparc64)     HOST_CPU="sparc" ;;
@@ -57,6 +58,15 @@ LT_INIT
 AM_INIT_AUTOMAKE([foreign no-exeext dist-bzip2])
 AM_MAINTAINER_MODE
 
+#
+# We use stat(2).  Even though we don't care about the file size or
+# inode number, stat will fail with EOVERFLOW if either of these
+# exceeds 32 bits.  We therefore ask for stat64 if available.  Do this
+# test as soon as possible, as large file support may influence
+# whether other headers are available.
+#
+AC_SYS_LARGEFILE
+
 AC_ARG_WITH([libelf],
   AS_HELP_STRING([--with-libelf], [Prefix of libelf headers/library]),
   [case "${withval}" in
@@ -215,6 +225,8 @@ CPPFLAGS="${saved_CPPFLAGS}"
 LDFLAGS="${saved_LDFLAGS}"
 
 AM_CPPFLAGS=" \
+       -DSYSCONFDIR="'\"$(sysconfdir)\"'" \
+       -DPKGDATADIR="'\"$(pkgdatadir)\"'" \
        ${AM_CPPFLAGS} \
        -I\$(top_srcdir)/sysdeps/${HOST_OS}/${HOST_CPU} \
        -I\$(top_srcdir)/sysdeps/${HOST_OS} \
@@ -245,23 +257,48 @@ AC_CHECK_SIZEOF([long])
 
 
 # Checks for library functions.
-AC_FUNC_ERROR_AT_LINE
 AC_FUNC_FORK
 AC_CHECK_FUNCS([ \
        alarm \
        atexit \
-       getcwd \
        gettimeofday \
        memset \
-       mkdir \
-       rmdir \
        strchr \
        strdup \
        strerror \
+       strsignal \
        strtol \
        strtoul \
 ])
 
+#
+# Define HAVE_OPEN_MEMSTREAM if open_memstream is available.  glibc
+# before 2.10, eglibc and uClibc all need _GNU_SOURCE defined for
+# open_memstream to become visible, so check for that as well.  If
+# unavailable, require that tmpfile be present.  There's no
+# HAVE_TMPFILE, as we plain require that to be present as a fallback.
+#
+AC_CHECK_FUNCS([open_memstream], [],
+       [AC_MSG_CHECKING([for open_memstream with _GNU_SOURCE])
+        AC_LINK_IFELSE(
+               [AC_LANG_PROGRAM([[#define _GNU_SOURCE 1
+                                  #include <stdio.h>]],
+                                [[char *buf; size_t sz;
+                                  return open_memstream(&buf, &sz) != 0;]])],
+
+                [AC_MSG_RESULT([yes])
+                 AC_DEFINE([HAVE_OPEN_MEMSTREAM], [1],
+                       [Define if open_memstream exists.])],
+
+                [AC_MSG_RESULT([no])
+                 AC_CHECK_FUNC([tmpfile], [],
+                       [AC_MSG_ERROR(
+                           [Either open_memstream or tmpfile required.])])])])
+
+#
+# Define HAVE_GETOPT_LONG if that is available.
+#
+AC_CHECK_HEADER([getopt.h], [AC_CHECK_FUNCS([getopt_long])])
 
 #
 # Debugging
@@ -314,7 +351,8 @@ AC_CONFIG_FILES([
        sysdeps/linux-gnu/cris/Makefile
        sysdeps/linux-gnu/ia64/Makefile
        sysdeps/linux-gnu/m68k/Makefile
-       sysdeps/linux-gnu/mipsel/Makefile
+       sysdeps/linux-gnu/metag/Makefile
+       sysdeps/linux-gnu/mips/Makefile
        sysdeps/linux-gnu/ppc/Makefile
        sysdeps/linux-gnu/s390/Makefile
        sysdeps/linux-gnu/sparc/Makefile