summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLucas Stach <l.stach@pengutronix.de>2015-05-06 12:46:29 +0200
committerRussell King <rmk@arm.linux.org.uk>2015-09-15 17:49:50 +0100
commit166338269d01e33cdec6f303168261f4b8633d6e (patch)
treee40dc15d9a85ae182e7484194b42a6c7350cc44d
parentc3aae712e4d81db6982d2ee6194ffad41228d35e (diff)
make sure that system strndup doesn't collide with X.Org server version
The X.Org server has fallback implementaion of strndup() whose prototype gets pulled in by various X headers. This collides with the systems libc strndup if this is provided. Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Signed-off-by: Russell King <rmk@arm.linux.org.uk>
-rw-r--r--common/drawable_desc.c4
-rw-r--r--common/get_first_pixel.c4
-rw-r--r--common/picture_desc.c4
-rw-r--r--common/picture_solid.c4
-rw-r--r--common/transform.c4
-rw-r--r--configure.ac4
6 files changed, 24 insertions, 0 deletions
diff --git a/common/drawable_desc.c b/common/drawable_desc.c
index a7e4237..2813ebf 100644
--- a/common/drawable_desc.c
+++ b/common/drawable_desc.c
@@ -1,3 +1,7 @@
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#include <stdio.h>
#include "pixmaputil.h"
diff --git a/common/get_first_pixel.c b/common/get_first_pixel.c
index 662ab65..c1d837d 100644
--- a/common/get_first_pixel.c
+++ b/common/get_first_pixel.c
@@ -1,3 +1,7 @@
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#include "pixmapstr.h"
#include "pixmaputil.h"
diff --git a/common/picture_desc.c b/common/picture_desc.c
index 8ffbc84..3daf00d 100644
--- a/common/picture_desc.c
+++ b/common/picture_desc.c
@@ -1,3 +1,7 @@
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#include "picturestr.h"
#include "pixmaputil.h"
#include "pictureutil.h"
diff --git a/common/picture_solid.c b/common/picture_solid.c
index 88e23ab..e06e0d8 100644
--- a/common/picture_solid.c
+++ b/common/picture_solid.c
@@ -1,3 +1,7 @@
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#include "picturestr.h"
#include "pixmapstr.h"
#include "pictureutil.h"
diff --git a/common/transform.c b/common/transform.c
index 07c79be..1a62f06 100644
--- a/common/transform.c
+++ b/common/transform.c
@@ -1,3 +1,7 @@
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#include "picturestr.h"
#include "pictureutil.h"
diff --git a/configure.ac b/configure.ac
index e5cfc5d..9b13c22 100644
--- a/configure.ac
+++ b/configure.ac
@@ -52,6 +52,10 @@ m4_ifndef([XORG_DRIVER_CHECK_EXT],
Hint: either install from source, git://anongit.freedesktop.org/xorg/xserver or,
depending on your distribution, try package 'xserver-xorg-dev' or 'xorg-x11-server-devel'])])
+# Make sure to not include fallback X.Org strndup if libc provides it
+AC_CHECK_FUNCS([strndup], [HAVE_STRNDUP=yes], [HAVE_STRNDUP=no])
+AM_CONDITIONAL(NEED_STRNDUP, [test x$HAVE_STRNDUP = xno])
+
# Checks for programs.
AC_DISABLE_STATIC
AC_PROG_LIBTOOL