configure: set HAVE_foo_PLATFORM as applicable
authorEmil Velikov <emil.velikov@collabora.com>
Mon, 5 Dec 2016 21:32:30 +0000 (21:32 +0000)
committerEmil Velikov <emil.l.velikov@gmail.com>
Fri, 19 May 2017 18:44:09 +0000 (19:44 +0100)
Rather than having multiple places that define the macros, do it just
once in configure. Makes existing code a bit shorter and easier to
manage as we fix the VL targets with follow-up commits.

Cc: mesa-stable@lists.freedesktop.org
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
configure.ac
src/egl/Makefile.am
src/gbm/Makefile.am

index f741efcb7c7f87187c968247af0e5e174a1fd11d..56521127b4c11cc0d69a83edd47ceda0bfd91239 100644 (file)
@@ -1684,22 +1684,27 @@ for plat in $platforms; do
                if test "x$WAYLAND_SCANNER" = "x:"; then
                        AC_MSG_ERROR([wayland-scanner is needed to compile the wayland platform])
                fi
+               DEFINES="$DEFINES -DHAVE_WAYLAND_PLATFORM"
                ;;
 
        x11)
                PKG_CHECK_MODULES([XCB_DRI2], [x11-xcb xcb xcb-dri2 >= $XCBDRI2_REQUIRED xcb-xfixes])
+               DEFINES="$DEFINES -DHAVE_X11_PLATFORM"
                ;;
 
        drm)
                test "x$enable_gbm" = "xno" &&
                        AC_MSG_ERROR([EGL platform drm needs gbm])
+               DEFINES="$DEFINES -DHAVE_DRM_PLATFORM"
                ;;
 
        surfaceless)
+               DEFINES="$DEFINES -DHAVE_SURFACELESS_PLATFORM"
                ;;
 
        android)
                PKG_CHECK_MODULES([ANDROID], [cutils hardware sync])
+               DEFINES="$DEFINES -DHAVE_ANDROID_PLATFORM"
                ;;
 
        *)
index 1fb568f6cf87b4d75ddcb517efa0362e9cc9106b..14fd77f14a968381d3a04ef3e5f0829bbb85a29d 100644 (file)
@@ -47,7 +47,6 @@ dri2_backend_FILES =
 dri3_backend_FILES =
 
 if HAVE_PLATFORM_X11
-AM_CFLAGS += -DHAVE_X11_PLATFORM
 AM_CFLAGS += $(XCB_DRI2_CFLAGS)
 libEGL_common_la_LIBADD += $(XCB_DRI2_LIBS)
 dri2_backend_FILES += drivers/dri2/platform_x11.c
@@ -62,7 +61,6 @@ endif
 endif
 
 if HAVE_PLATFORM_WAYLAND
-AM_CFLAGS += -DHAVE_WAYLAND_PLATFORM
 AM_CFLAGS += $(WAYLAND_CFLAGS)
 libEGL_common_la_LIBADD += $(WAYLAND_LIBS)
 libEGL_common_la_LIBADD += $(LIBDRM_LIBS)
@@ -71,18 +69,15 @@ dri2_backend_FILES += drivers/dri2/platform_wayland.c
 endif
 
 if HAVE_PLATFORM_DRM
-AM_CFLAGS += -DHAVE_DRM_PLATFORM
 libEGL_common_la_LIBADD += $(top_builddir)/src/gbm/libgbm.la
 dri2_backend_FILES += drivers/dri2/platform_drm.c
 endif
 
 if HAVE_PLATFORM_SURFACELESS
-AM_CFLAGS += -DHAVE_SURFACELESS_PLATFORM
 dri2_backend_FILES += drivers/dri2/platform_surfaceless.c
 endif
 
 if HAVE_PLATFORM_ANDROID
-AM_CFLAGS += -DHAVE_ANDROID_PLATFORM
 AM_CFLAGS += $(ANDROID_CFLAGS)
 libEGL_common_la_LIBADD += $(ANDROID_LIBS)
 dri2_backend_FILES += drivers/dri2/platform_android.c
index e34c1d4b1f5ec10e60c274b28160e88f2d20e856..60b09245065b448d1f711fe9ad76c30f786d660b 100644 (file)
@@ -28,7 +28,6 @@ libgbm_la_LIBADD = \
        $(DLOPEN_LIBS)
 
 if HAVE_PLATFORM_WAYLAND
-AM_CPPFLAGS = -DHAVE_WAYLAND_PLATFORM
 AM_CFLAGS += $(WAYLAND_CFLAGS)
 libgbm_la_LIBADD += $(top_builddir)/src/egl/wayland/wayland-drm/libwayland-drm.la $(WAYLAND_LIBS)
 endif