build: expose automake conditionals for cogl winsys

Expose the ./configured window system/backend options to the Cogl
automake files via some new SUPPORT_XYZ conditionals.
This commit is contained in:
Robert Bragg 2009-10-08 12:08:21 +01:00
parent a29d1b799a
commit f2f2e9b7e6
3 changed files with 42 additions and 16 deletions

View File

@ -20,7 +20,7 @@ DISTCLEANFILES =
EXTRA_DIST = EXTRA_DIST =
BUILT_SOURCES = BUILT_SOURCES =
if WINSYS_WIN32 if SUPPORT_WIN32
# Ideally this resources stuff would go in win32/ but libtool doesn't # Ideally this resources stuff would go in win32/ but libtool doesn't
# seem to pass on the -Wl argument when linking a convenience library # seem to pass on the -Wl argument when linking a convenience library
@ -35,7 +35,7 @@ win32/resources.o : $(srcdir)/win32/invisible-cursor.cur
win32_resources = win32/resources.o win32_resources = win32/resources.o
win32_resources_ldflag = -Wl,win32/resources.o win32_resources_ldflag = -Wl,win32/resources.o
endif # WINSYS_WIN32 endif # SUPPORT_WIN32
INCLUDES = \ INCLUDES = \
-I$(top_srcdir) \ -I$(top_srcdir) \

View File

@ -71,20 +71,8 @@ cogl_public_h = \
$(srcdir)/cogl.h \ $(srcdir)/cogl.h \
$(NULL) $(NULL)
# windowing system; all sources have to be distributed, but we'll
# compile just the one we need
cogl_winsys_sources = \
$(srcdir)/winsys/cogl-eglnative.c \
$(srcdir)/winsys/cogl-eglx.c \
$(srcdir)/winsys/cogl-glx.c \
$(srcdir)/winsys/cogl-osx.c \
$(srcdir)/winsys/cogl-sdl.c \
$(srcdir)/winsys/cogl-win32.c \
$(NULL)
cogl_sources_c = \ cogl_sources_c = \
$(srcdir)/winsys/cogl-winsys.h \ $(srcdir)/winsys/cogl-winsys.h \
$(srcdir)/winsys/cogl-@COGL_WINSYS@.c \
$(srcdir)/cogl-handle.h \ $(srcdir)/cogl-handle.h \
$(srcdir)/cogl-context.h \ $(srcdir)/cogl-context.h \
$(srcdir)/cogl-context.c \ $(srcdir)/cogl-context.c \
@ -161,7 +149,31 @@ libclutter_cogl_la_LIBADD = -lm $(CLUTTER_LIBS) $(top_builddir)/clutter/cogl/cog
libclutter_cogl_la_SOURCES = $(BUILT_SOURCES) $(cogl_sources_c) libclutter_cogl_la_SOURCES = $(BUILT_SOURCES) $(cogl_sources_c)
EXTRA_DIST += $(cogl_winsys_sources) if SUPPORT_GLX
libclutter_cogl_la_SOURCES += \
$(srcdir)/winsys/cogl-glx.c
endif
if SUPPORT_EGL_PLATFORM_POWERVR_X11
libclutter_cogl_la_SOURCES += \
$(srcdir)/winsys/cogl-eglx.c
endif
if SUPPORT_EGL_PLATFORM_POWERVR_NULL
libclutter_cogl_la_SOURCES += \
$(srcdir)/winsys/cogl-eglnative.c
endif
if SUPPORT_EGL_PLATFORM_FRUITY
libclutter_cogl_la_SOURCES += \
$(srcdir)/winsys/cogl-fruity.c
endif
if SUPPORT_WIN32
libclutter_cogl_la_SOURCES += \
$(srcdir)/winsys/cogl-win32.c
endif
if SUPPORT_OSX
libclutter_cogl_la_SOURCES += \
$(srcdir)/winsys/cogl-osx.c
endif
EXTRA_DIST += stb_image.c EXTRA_DIST += stb_image.c
# COGL installed headers # COGL installed headers

View File

@ -351,7 +351,21 @@ AS_CASE([$CLUTTER_WINSYS],
[AC_MSG_ERROR([Invalid backend for Clutter: use glx, osx, win32, eglx, eglnative or fruity])] [AC_MSG_ERROR([Invalid backend for Clutter: use glx, osx, win32, eglx, eglnative or fruity])]
) )
AM_CONDITIONAL(WINSYS_WIN32, [test "x$CLUTTER_WINSYS" = "xwin32"]) # winsys conditionals for use in automake files...
AM_CONDITIONAL(SUPPORT_GLX, [test "x$CLUTTER_WINSYS" = "xglx"])
AM_CONDITIONAL(SUPPORT_X11, [test "x$CLUTTER_WINSYS" = "xglx" -o \
"x$CLUTTER_WINSYS" = "xeglx"])
AM_CONDITIONAL(SUPPORT_XLIB, [test "x$CLUTTER_WINSYS" = "xglx" -o \
"x$CLUTTER_WINSYS" = "xeglx"])
AM_CONDITIONAL(SUPPORT_EGL,
[test "x$CLUTTER_WINSYS" = "xeglx" -o \
"x$CLUTTER_WINSYS" = "xeglnative" -o \
"x$CLUTTER_WINSYS" = "xfruity"])
AM_CONDITIONAL(SUPPORT_EGL_PLATFORM_POWERVR_X11, [test "x$CLUTTER_WINSYS" = "xeglx"])
AM_CONDITIONAL(SUPPORT_EGL_PLATFORM_POWERVR_NULL, [test "x$CLUTTER_WINSYS" = "xeglnative"])
AM_CONDITIONAL(SUPPORT_EGL_PLATFORM_FRUITY, [test "x$CLUTTER_WINSYS" = "xfruity"])
AM_CONDITIONAL(SUPPORT_OSX, [test "x$CLUTTER_WINSYS" = "xosx"])
AM_CONDITIONAL(SUPPORT_WIN32, [test "x$CLUTTER_WINSYS" = "xwin32"])
# at this point we must have a GL header to check # at this point we must have a GL header to check
AS_IF([test "x$clutter_gl_header" = "x"], [AC_MSG_ERROR([Internal error: no GL header set])]) AS_IF([test "x$clutter_gl_header" = "x"], [AC_MSG_ERROR([Internal error: no GL header set])])