summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArfrever Frehtes Taifersar Arahesis <arfrever@gentoo.org>2009-09-02 17:19:12 +0000
committerArfrever Frehtes Taifersar Arahesis <arfrever@gentoo.org>2009-09-02 17:19:12 +0000
commitd6a3fde6c3d69fbba4a4e54daaf6c049146f9fcd (patch)
tree7afe647c2599d5183c1e7b4d0a1f671ca69bb69e
parentAdd 'install' rule. (diff)
downloadeselect-python-d6a3fde6c3d69fbba4a4e54daaf6c049146f9fcd.tar.gz
eselect-python-d6a3fde6c3d69fbba4a4e54daaf6c049146f9fcd.tar.bz2
eselect-python-d6a3fde6c3d69fbba4a4e54daaf6c049146f9fcd.zip
Fix building with old versions of sys-libs/glibc.
-rw-r--r--configure.ac20
1 files changed, 19 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac
index 77bd840..f25ae5e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -7,8 +7,26 @@ AC_PROG_CC
AC_PATH_PROG(INSTALL, install)
MKDIR="${MKDIR:-${INSTALL} -d}"
+AC_USE_SYSTEM_EXTENSIONS
+
# strndup() was introduced in POSIX.1-2008.
-AC_CHECK_FUNCS([strndup])
+AC_MSG_CHECKING([for strndup])
+old_CFLAGS="${CFLAGS}"
+CFLAGS="${CFLAGS} -Wall -Werror -Wextra"
+AC_LINK_IFELSE(
+[#include <string.h>
+int main()
+{
+ strndup("", 0);
+ return 0;
+}], [have_strndup="1"], [have_strndup="0"])
+if test "${have_strndup}" = "1"; then
+ AC_MSG_RESULT([yes])
+ AC_DEFINE([HAVE_STRNDUP], [1], [Define to 1 if you have the 'strndup' function.])
+else
+ AC_MSG_RESULT([no])
+fi
+CFLAGS="${old_CFLAGS}"
AC_SUBST([ASFLAGS])
AC_SUBST([MKDIR])