summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stone <daniel@fooishbar.org>2013-05-22 18:03:19 +0300
committerKristian Høgsberg <krh@bitplanet.net>2013-06-05 01:16:34 -0400
commitc228e23b055f54d29f2df839cf76a2660917b9f6 (patch)
tree6f810a3fd6061b2dadb8cc654a795530654debf1
parent5238b683e20e619cca92eea2691ba7ca947ead84 (diff)
downloadweston-c228e23b055f54d29f2df839cf76a2660917b9f6.tar.gz
weston-c228e23b055f54d29f2df839cf76a2660917b9f6.tar.bz2
weston-c228e23b055f54d29f2df839cf76a2660917b9f6.zip
configure.ac: Enable AC_USE_SYSTEM_EXTENSIONS
AC_USE_SYSTEM_EXTENSIONS enables _XOPEN_SOURCE, _GNU_SOURCE and similar macros to expose the largest extent of functionality supported by the underlying system. This is required since these macros are often limiting rather than merely additive, e.g. _XOPEN_SOURCE will actually on some systems hide declarations which are not part of the X/Open spec. Since this goes into config.h rather than the command line, ensure all source is consistently including config.h before anything else, including system libraries. This doesn't need to be guarded by a HAVE_CONFIG_H ifdef, which was only ever a hangover from the X.Org modular transition. Signed-off-by: Daniel Stone <daniel@fooishbar.org> [pq: rebased and converted more files]
-rw-r--r--clients/window.c4
-rw-r--r--configure.ac2
-rw-r--r--shared/cairo-util.c2
-rw-r--r--shared/config-parser.c3
-rw-r--r--shared/image-loader.c2
-rw-r--r--shared/matrix.c2
-rw-r--r--shared/option-parser.c2
-rw-r--r--shared/os-compatibility.c2
-rw-r--r--src/animation.c2
-rw-r--r--src/bindings.c2
-rw-r--r--src/clipboard.c2
-rw-r--r--src/cms-helper.c4
-rw-r--r--src/cms-static.c5
-rw-r--r--src/compositor-drm.c6
-rw-r--r--src/compositor-fbdev.c2
-rw-r--r--src/compositor-headless.c4
-rw-r--r--src/compositor-rdp.c4
-rw-r--r--src/compositor-rpi.c4
-rw-r--r--src/compositor-wayland.c5
-rw-r--r--src/compositor-x11.c4
-rw-r--r--src/compositor.c2
-rw-r--r--src/evdev-touchpad.c2
-rw-r--r--src/evdev.c2
-rw-r--r--src/filter.c2
-rw-r--r--src/gl-renderer.c2
-rw-r--r--src/gl-renderer.h7
-rw-r--r--src/launcher-util.c2
-rw-r--r--src/libbacklight.c2
-rw-r--r--src/log.c2
-rw-r--r--src/noop-renderer.c2
-rw-r--r--src/pixman-renderer.c2
-rw-r--r--src/rpi-renderer.c4
-rw-r--r--src/screenshooter.c2
-rw-r--r--src/shell.c2
-rw-r--r--src/tablet-shell.c2
-rw-r--r--src/text-backend.c2
-rw-r--r--src/tty.c2
-rw-r--r--src/udev-seat.c2
-rw-r--r--src/weston-launch.c2
-rw-r--r--src/xwayland/launcher.c2
-rw-r--r--src/xwayland/selection.c2
-rw-r--r--src/xwayland/window-manager.c2
-rw-r--r--src/zoom.c2
43 files changed, 62 insertions, 54 deletions
diff --git a/clients/window.c b/clients/window.c
index e0d658a4..c13d2070 100644
--- a/clients/window.c
+++ b/clients/window.c
@@ -21,9 +21,7 @@
* OF THIS SOFTWARE.
*/
-#define _GNU_SOURCE
-
-#include "../config.h"
+#include "config.h"
#include <stdint.h>
#include <stdio.h>
diff --git a/configure.ac b/configure.ac
index 8d36915e..b6252218 100644
--- a/configure.ac
+++ b/configure.ac
@@ -18,6 +18,8 @@ AC_SUBST([WESTON_VERSION], [weston_version])
AC_CONFIG_HEADERS([config.h])
+AC_USE_SYSTEM_EXTENSIONS
+
AM_INIT_AUTOMAKE([1.11 parallel-tests foreign no-dist-gzip dist-xz color-tests])
AM_SILENT_RULES([yes])
diff --git a/shared/cairo-util.c b/shared/cairo-util.c
index 8b41f413..c3a966a3 100644
--- a/shared/cairo-util.c
+++ b/shared/cairo-util.c
@@ -21,7 +21,7 @@
* OF THIS SOFTWARE.
*/
-#include "../config.h"
+#include "config.h"
#include <stdint.h>
#include <stdlib.h>
diff --git a/shared/config-parser.c b/shared/config-parser.c
index 1d88eed0..0ff96eeb 100644
--- a/shared/config-parser.c
+++ b/shared/config-parser.c
@@ -20,7 +20,8 @@
* OF THIS SOFTWARE.
*/
-#define _GNU_SOURCE /* for stchrnul() */
+#include "config.h"
+
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
diff --git a/shared/image-loader.c b/shared/image-loader.c
index 9f65dead..35dadd3d 100644
--- a/shared/image-loader.c
+++ b/shared/image-loader.c
@@ -21,7 +21,7 @@
* OF THIS SOFTWARE.
*/
-#include "../config.h"
+#include "config.h"
#include <stdlib.h>
#include <stdio.h>
diff --git a/shared/matrix.c b/shared/matrix.c
index 3ff4089a..4f0b6b79 100644
--- a/shared/matrix.c
+++ b/shared/matrix.c
@@ -21,6 +21,8 @@
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
+#include "config.h"
+
#include <float.h>
#include <string.h>
#include <stdlib.h>
diff --git a/shared/option-parser.c b/shared/option-parser.c
index a7e497ff..c00349a8 100644
--- a/shared/option-parser.c
+++ b/shared/option-parser.c
@@ -20,6 +20,8 @@
* OF THIS SOFTWARE.
*/
+#include "config.h"
+
#include <stdlib.h>
#include <stdint.h>
#include <stdio.h>
diff --git a/shared/os-compatibility.c b/shared/os-compatibility.c
index 21d4d029..4f96dd4c 100644
--- a/shared/os-compatibility.c
+++ b/shared/os-compatibility.c
@@ -20,7 +20,7 @@
* OF THIS SOFTWARE.
*/
-#define _GNU_SOURCE
+#include "config.h"
#include <sys/types.h>
#include <sys/socket.h>
diff --git a/src/animation.c b/src/animation.c
index e947d723..b9d0f8ab 100644
--- a/src/animation.c
+++ b/src/animation.c
@@ -20,6 +20,8 @@
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
+#include "config.h"
+
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
diff --git a/src/bindings.c b/src/bindings.c
index e548ff13..558208ce 100644
--- a/src/bindings.c
+++ b/src/bindings.c
@@ -20,6 +20,8 @@
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
+#include "config.h"
+
#include <stdlib.h>
#include "compositor.h"
diff --git a/src/clipboard.c b/src/clipboard.c
index 11edc712..eb0b2309 100644
--- a/src/clipboard.c
+++ b/src/clipboard.c
@@ -20,7 +20,7 @@
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-#define _GNU_SOURCE
+#include "config.h"
#include <stdlib.h>
#include <string.h>
diff --git a/src/cms-helper.c b/src/cms-helper.c
index 2c7b57f0..c063c773 100644
--- a/src/cms-helper.c
+++ b/src/cms-helper.c
@@ -20,9 +20,7 @@
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "config.h"
#include <stdlib.h>
#include <string.h>
diff --git a/src/cms-static.c b/src/cms-static.c
index 53f2f84a..8a36ed9b 100644
--- a/src/cms-static.c
+++ b/src/cms-static.c
@@ -20,11 +20,8 @@
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "config.h"
-#define _GNU_SOURCE
#include <stdlib.h>
#include <string.h>
diff --git a/src/compositor-drm.c b/src/compositor-drm.c
index beb6ba56..76d08102 100644
--- a/src/compositor-drm.c
+++ b/src/compositor-drm.c
@@ -21,11 +21,7 @@
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#define _GNU_SOURCE
+#include "config.h"
#include <errno.h>
#include <stdlib.h>
diff --git a/src/compositor-fbdev.c b/src/compositor-fbdev.c
index 352969ff..9c3d17e0 100644
--- a/src/compositor-fbdev.c
+++ b/src/compositor-fbdev.c
@@ -23,7 +23,7 @@
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-#define _GNU_SOURCE
+#include "config.h"
#include <errno.h>
#include <stdlib.h>
diff --git a/src/compositor-headless.c b/src/compositor-headless.c
index c9194d0c..dd332422 100644
--- a/src/compositor-headless.c
+++ b/src/compositor-headless.c
@@ -21,9 +21,7 @@
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "config.h"
#include <stdlib.h>
#include <string.h>
diff --git a/src/compositor-rdp.c b/src/compositor-rdp.c
index 93c3c161..1a973d2e 100644
--- a/src/compositor-rdp.c
+++ b/src/compositor-rdp.c
@@ -20,9 +20,7 @@
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "config.h"
#include <stdlib.h>
#include <string.h>
diff --git a/src/compositor-rpi.c b/src/compositor-rpi.c
index b4dc9962..af62b30f 100644
--- a/src/compositor-rpi.c
+++ b/src/compositor-rpi.c
@@ -22,7 +22,7 @@
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-#define _GNU_SOURCE
+#include "config.h"
#include <errno.h>
#include <stdlib.h>
@@ -35,8 +35,6 @@
#include <libudev.h>
-#include "config.h"
-
#ifdef HAVE_BCM_HOST
# include <bcm_host.h>
#else
diff --git a/src/compositor-wayland.c b/src/compositor-wayland.c
index 9489161e..f3a98a87 100644
--- a/src/compositor-wayland.c
+++ b/src/compositor-wayland.c
@@ -20,12 +20,9 @@
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "config.h"
#include <stddef.h>
-#define _GNU_SOURCE
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
diff --git a/src/compositor-x11.c b/src/compositor-x11.c
index f17edb4a..5a0bcf0d 100644
--- a/src/compositor-x11.c
+++ b/src/compositor-x11.c
@@ -22,9 +22,7 @@
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "config.h"
#include <assert.h>
#include <stddef.h>
diff --git a/src/compositor.c b/src/compositor.c
index 37fce0a5..099600dd 100644
--- a/src/compositor.c
+++ b/src/compositor.c
@@ -22,8 +22,6 @@
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-#define _GNU_SOURCE
-
#include "config.h"
#include <fcntl.h>
diff --git a/src/evdev-touchpad.c b/src/evdev-touchpad.c
index 4f9bb033..a21ae0b2 100644
--- a/src/evdev-touchpad.c
+++ b/src/evdev-touchpad.c
@@ -20,6 +20,8 @@
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
+#include "config.h"
+
#include <stdlib.h>
#include <math.h>
#include <string.h>
diff --git a/src/evdev.c b/src/evdev.c
index 9289b1cd..122a2d9b 100644
--- a/src/evdev.c
+++ b/src/evdev.c
@@ -20,6 +20,8 @@
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
+#include "config.h"
+
#include <stdlib.h>
#include <string.h>
#include <linux/input.h>
diff --git a/src/filter.c b/src/filter.c
index 91e588d2..a55ebf27 100644
--- a/src/filter.c
+++ b/src/filter.c
@@ -20,6 +20,8 @@
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
+#include "config.h"
+
#include <stdlib.h>
#include <stdint.h>
#include <limits.h>
diff --git a/src/gl-renderer.c b/src/gl-renderer.c
index 4b449d13..d783a0ba 100644
--- a/src/gl-renderer.c
+++ b/src/gl-renderer.c
@@ -20,7 +20,7 @@
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-#define _GNU_SOURCE
+#include "config.h"
#include <GLES2/gl2.h>
#include <GLES2/gl2ext.h>
diff --git a/src/gl-renderer.h b/src/gl-renderer.h
index a2e86909..4919a1ea 100644
--- a/src/gl-renderer.h
+++ b/src/gl-renderer.h
@@ -20,10 +20,9 @@
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-#include "compositor.h"
+#include "config.h"
+
+#include "compositor.h"
#ifdef ENABLE_EGL
diff --git a/src/launcher-util.c b/src/launcher-util.c
index 9196e4f3..6f6ee116 100644
--- a/src/launcher-util.c
+++ b/src/launcher-util.c
@@ -20,6 +20,8 @@
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
+#include "config.h"
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
diff --git a/src/libbacklight.c b/src/libbacklight.c
index 98a20beb..b3acc63f 100644
--- a/src/libbacklight.c
+++ b/src/libbacklight.c
@@ -29,7 +29,7 @@
* Tiago Vignatti <vignatti@freedesktop.org>
*/
-#define _GNU_SOURCE
+#include "config.h"
#include "libbacklight.h"
#include <stdio.h>
diff --git a/src/log.c b/src/log.c
index e5430d68..1c05e25a 100644
--- a/src/log.c
+++ b/src/log.c
@@ -20,6 +20,8 @@
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
+#include "config.h"
+
#include <stdio.h>
#include <stdarg.h>
#include <stdlib.h>
diff --git a/src/noop-renderer.c b/src/noop-renderer.c
index a0b16797..c0765f26 100644
--- a/src/noop-renderer.c
+++ b/src/noop-renderer.c
@@ -20,7 +20,7 @@
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-#define _GNU_SOURCE
+#include "config.h"
#include <stdlib.h>
diff --git a/src/pixman-renderer.c b/src/pixman-renderer.c
index 2c423908..0bae1a48 100644
--- a/src/pixman-renderer.c
+++ b/src/pixman-renderer.c
@@ -21,7 +21,7 @@
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-#define _GNU_SOURCE
+#include "config.h"
#include <errno.h>
#include <stdlib.h>
diff --git a/src/rpi-renderer.c b/src/rpi-renderer.c
index e429d2ef..c3611854 100644
--- a/src/rpi-renderer.c
+++ b/src/rpi-renderer.c
@@ -20,12 +20,12 @@
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
+#include "config.h"
+
#include <stdlib.h>
#include <assert.h>
#include <string.h>
-#include "config.h"
-
#ifdef HAVE_BCM_HOST
# include <bcm_host.h>
#else
diff --git a/src/screenshooter.c b/src/screenshooter.c
index 83ad1922..3a4f6c23 100644
--- a/src/screenshooter.c
+++ b/src/screenshooter.c
@@ -20,6 +20,8 @@
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
+#include "config.h"
+
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
diff --git a/src/shell.c b/src/shell.c
index ebeef55f..3d10eef6 100644
--- a/src/shell.c
+++ b/src/shell.c
@@ -21,6 +21,8 @@
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
+#include "config.h"
+
#include <stdlib.h>
#include <stdio.h>
#include <stdbool.h>
diff --git a/src/tablet-shell.c b/src/tablet-shell.c
index cae8acfd..91fbaede 100644
--- a/src/tablet-shell.c
+++ b/src/tablet-shell.c
@@ -20,6 +20,8 @@
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
+#include "config.h"
+
#include <sys/wait.h>
#include <unistd.h>
#include <stdlib.h>
diff --git a/src/text-backend.c b/src/text-backend.c
index c6d8e9e6..3d365278 100644
--- a/src/text-backend.c
+++ b/src/text-backend.c
@@ -21,6 +21,8 @@
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
+#include "config.h"
+
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
diff --git a/src/tty.c b/src/tty.c
index 05e5e20f..2324f6c3 100644
--- a/src/tty.c
+++ b/src/tty.c
@@ -20,6 +20,8 @@
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
+#include "config.h"
+
#include <termios.h>
#include <stdio.h>
#include <stdlib.h>
diff --git a/src/udev-seat.c b/src/udev-seat.c
index 927bb7a4..a8790b3f 100644
--- a/src/udev-seat.c
+++ b/src/udev-seat.c
@@ -20,6 +20,8 @@
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
+#include "config.h"
+
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
diff --git a/src/weston-launch.c b/src/weston-launch.c
index ad774762..de4e7058 100644
--- a/src/weston-launch.c
+++ b/src/weston-launch.c
@@ -20,8 +20,6 @@
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-#define _GNU_SOURCE
-
#include "config.h"
#include <stdio.h>
diff --git a/src/xwayland/launcher.c b/src/xwayland/launcher.c
index 664cf6ca..a8ad4780 100644
--- a/src/xwayland/launcher.c
+++ b/src/xwayland/launcher.c
@@ -20,7 +20,7 @@
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-#define _GNU_SOURCE
+#include "config.h"
#include <stdlib.h>
#include <stdio.h>
diff --git a/src/xwayland/selection.c b/src/xwayland/selection.c
index 69665b73..66cb5fea 100644
--- a/src/xwayland/selection.c
+++ b/src/xwayland/selection.c
@@ -20,7 +20,7 @@
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-#define _GNU_SOURCE
+#include "config.h"
#include <stdlib.h>
#include <string.h>
diff --git a/src/xwayland/window-manager.c b/src/xwayland/window-manager.c
index b4b0a83a..366f2e04 100644
--- a/src/xwayland/window-manager.c
+++ b/src/xwayland/window-manager.c
@@ -20,7 +20,7 @@
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-#define _GNU_SOURCE
+#include "config.h"
#include <stdlib.h>
#include <stdio.h>
diff --git a/src/zoom.c b/src/zoom.c
index ccc5d492..292aed6c 100644
--- a/src/zoom.c
+++ b/src/zoom.c
@@ -20,6 +20,8 @@
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
+#include "config.h"
+
#include <stdlib.h>
#include "compositor.h"