configure: support conditional compile of efl and extensions
authorU. Artie Eoff <ullysses.a.eoff@intel.com>
Wed, 27 Feb 2013 19:17:42 +0000 (11:17 -0800)
committerU. Artie Eoff <ullysses.a.eoff@intel.com>
Wed, 27 Feb 2013 19:17:42 +0000 (11:17 -0800)
Add --[disable|enable]-efl-tests to allow user to conditionally
compile the efl tests.  Without an explicit option specified by
the user, then autodetect whether efl tests can be compiled.

Add --[disable|enable]-weston-extensions to allow the user to
conditionally compile the weston wfits extension.  Without an
explicit option specified by the useer, then autodetect whether
the weston extensions can be compiled.

Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
configure.ac
src/Makefile.am
src/common/Makefile.am
src/core/Makefile.am
src/efl/Makefile.am
src/extensions/weston/Makefile.am

index dbb7656..6faff87 100644 (file)
@@ -1,7 +1,7 @@
 AC_PREREQ([2.64])
 
 AC_INIT([wayland-fits],
-        [0.99.0],
+        [0.99.1],
         [https://bugs.freedesktop.org/enter_bug.cgi?product=wayland],
         [wayland-fits],
         [http://wayland.freedesktop.org/])
@@ -21,15 +21,92 @@ LT_INIT
 
 LDFLAGS="-Wl,--no-as-needed"
 
-PKG_CHECK_MODULES([CHECK], [check >= 0.9.8])
-PKG_CHECK_MODULES(CAIRO, [cairo >= 1.10.0])
-PKG_CHECK_MODULES(WAYLAND, [wayland-client wayland-egl wayland-cursor])
-PKG_CHECK_MODULES(WAYLAND_SERVER, [wayland-server])
-PKG_CHECK_MODULES(WESTON, [weston >= 1.0.6])
-PKG_CHECK_MODULES(EFL, [elementary >= 1.7.6 ecore-wayland >= 1.7.6 evas-wayland-egl >= 1.7.6 evas-wayland-shm >= 1.7.6])
-PKG_CHECK_MODULES(PIXMAN, [pixman-1])
+# Required minimum versions for dependencies
+m4_define([check_req_version],         [0.9.8])
+m4_define([pixman1_req_version],       [0.29.3])
+m4_define([wayland_req_version],       [1.0.6])
+m4_define([weston_req_version],                [1.0.6])
+m4_define([efl_req_version],           [1.7.6])
 
-# TODO: Add support to conditionally build EFL suite, Core suite, etc...
+PKG_CHECK_MODULES([CHECK], [check >= check_req_version])
+PKG_CHECK_MODULES([WAYLAND],
+       [
+               wayland-client >= wayland_req_version
+               wayland-egl >= wayland_req_version
+               wayland-cursor >= wayland_req_version
+       ]
+)
+PKG_CHECK_MODULES(WAYLAND_SERVER, [wayland-server >= wayland_req_version])
+
+have_weston="no"
+want_weston_extensions="auto"
+AC_ARG_ENABLE([weston-extensions],
+       [AC_HELP_STRING([--disable-weston-extensions], [disable Weston extension support. @<:@default=detect@:>@])],
+       [want_weston_extensions=$enableval], [])
+
+if test "x$want_weston_extensions" != "xno"; then
+       PKG_CHECK_MODULES([WESTON],
+               [
+                       weston >= weston_req_version
+                       pixman-1 >= pixman1_req_version
+               ],
+               [
+                       AC_DEFINE(HAVE_WESTON, 1, [Support for Weston extensions])
+                       have_weston="yes"
+               ],
+               [have_weston="no"]
+       )
+else
+       have_weston="no"
+fi
+
+if test "x$want_weston_extensions" = "xyes" -a "x$have_weston" = "xno"; then
+       AC_MSG_ERROR([
+
+               weston extension support requested, but one of the following dependency requirements were not met:
+
+               weston >= weston_req_version
+               pixman >= pixman1_req_version
+       ])
+fi
+AM_CONDITIONAL([BUILD_WESTON_EXTENSIONS], [test x${have_weston} = xyes])
+
+have_efl="no"
+want_efl_tests="auto"
+AC_ARG_ENABLE([efl-tests],
+       [AC_HELP_STRING([--disable-efl-tests], [disable EFL Tests. @<:@default=detect@:>@])],
+       [want_efl_tests=$enableval], [])
+
+if test "x$want_efl_tests" != "xno"; then
+       PKG_CHECK_MODULES([EFL],
+               [
+                       elementary >= efl_req_version
+                       ecore-wayland >= efl_req_version
+                       evas-wayland-egl >= efl_req_version
+                       evas-wayland-shm >= efl_req_version
+               ],
+               [
+                       AC_DEFINE(HAVE_EFL, 1, [Support for EFL Tests])
+                       have_efl="yes"
+               ],
+               [have_efl="no"]
+       )
+else
+       have_efl="no"
+fi
+
+if test "x$want_efl_tests" = "xyes" -a "x$have_efl" = "xno"; then
+       AC_MSG_ERROR([
+
+               EFL tests requested, but one of the following dependency requirements were not met:
+
+               elementary >= efl_req_version
+               ecore-wayland >= efl_req_version
+               evas-wayland-egl >= efl_req_version
+               evas-wayland-shm >= efl_req_version
+       ])
+fi
+AM_CONDITIONAL([BUILD_EFL_TESTS], [test x$have_efl = xyes])
 
 WAYLAND_SCANNER_RULES(['$(top_srcdir)/src/extensions/protocol'])
 
index 7e069c7..0c7c8b6 100644 (file)
@@ -5,20 +5,23 @@ TESTS = wfits
 bin_PROGRAMS = ${TESTS}
 
 wfits_SOURCES = testmain.cpp
-wfits_LDADD = \
-       $(top_builddir)/src/common/libwfits-common.la \
-       $(top_builddir)/src/core/libwfits-core.la \
-       $(top_builddir)/src/efl/libwfits-efl.la \
-       -lboost_regex \
-       -lboost_filesystem \
-       -lboost_program_options \
-       @CHECK_LIBS@
+wfits_LDADD =                                                  \
+       $(top_builddir)/src/common/libwfits-common.la           \
+       $(top_builddir)/src/core/libwfits-core.la               \
+       -lboost_regex                                           \
+       -lboost_filesystem                                      \
+       -lboost_program_options                                 \
+       $(CHECK_LIBS)
 
-AM_CXXFLAGS = \
-       -Wno-strict-aliasing \
-       -Werror -Wall \
-       -Wno-unused-variable \
-       -Wno-unknown-pragmas \
-       -Wno-parentheses \
-       -std=gnu++0x \
-       @CHECK_CFLAGS@
+if BUILD_EFL_TESTS
+wfits_LDADD += $(top_builddir)/src/efl/libwfits-efl.la
+endif
+
+AM_CXXFLAGS =                  \
+       -Wno-strict-aliasing    \
+       -Werror -Wall           \
+       -Wno-unused-variable    \
+       -Wno-unknown-pragmas    \
+       -Wno-parentheses        \
+       -std=gnu++0x            \
+       $(CHECK_CFLAGS)
index dfccd9b..f0b1555 100644 (file)
@@ -4,8 +4,9 @@ libwfits_common_la_SOURCES =    \
        test.cpp                \
        harness.cpp
 
-libwfits_common_la_LIBADD = \
-       @CHECK_LIBS@
+libwfits_common_la_LIBADD =    \
+       $(CHECK_LIBS)           \
        -lboost_regex
 
-AM_CXXFLAGS = @CHECK_CFLAGS@
+AM_CXXFLAGS =                  \
+       $(CHECK_CFLAGS)
index 323087d..ccf4507 100644 (file)
@@ -20,13 +20,11 @@ libwfits_core_la_SOURCES =                                          \
        test_surface.cpp                                                \
        $(top_srcdir)/src/extensions/protocol/wayland-fits-protocol.c
 
-libwfits_core_la_LIBADD = \
-       $(top_builddir)/src/common/libwfits-common.la \
-       $(CAIRO_LIBS)           \
-       $(WAYLAND_LIBS)         \
-       @CHECK_LIBS@
+libwfits_core_la_LIBADD =                                              \
+       $(top_builddir)/src/common/libwfits-common.la                   \
+       $(WAYLAND_LIBS)                                                 \
+       $(CHECK_LIBS)
 
 AM_CXXFLAGS = \
-       $(CAIRO_CFLAGS)         \
        $(WAYLAND_CFLAGS)       \
-       @CHECK_CFLAGS@
+       $(CHECK_CFLAGS)
index d082574..fb08a82 100644 (file)
@@ -1,3 +1,5 @@
+if BUILD_EFL_TESTS
+
 MEDIA = \"$(abs_top_srcdir)/media\"
 
 INCLUDES = -I$(top_srcdir)/src
@@ -46,16 +48,16 @@ libwfits_efl_la_SOURCES = \
 
 libwfits_efl_la_LIBADD = \
        $(top_builddir)/src/common/libwfits-common.la \
-       $(CAIRO_LIBS)           \
        $(WAYLAND_LIBS)         \
-       @EFL_LIBS@              \
-       @CHECK_LIBS@
+       $(EFL_LIBS)             \
+       $(CHECK_LIBS)
 
 AM_CXXFLAGS = \
-       $(CAIRO_CFLAGS)         \
-       $(WAYLAND_CFLAGS)       \
        -DMEDIA_PATH=$(MEDIA)   \
-       @EFL_CFLAGS@            \
-       @CHECK_CFLAGS@
+       $(WAYLAND_CFLAGS)       \
+       $(EFL_CFLAGS)           \
+       $(CHECK_CFLAGS)         \
        -lboost_system          \
        -lboost_filesystem
+
+endif
index 13e1eef..27f6ef0 100644 (file)
@@ -1,19 +1,16 @@
+if BUILD_WESTON_EXTENSIONS
+
 INCLUDES = -I$(top_srcdir)/src
 
 moduledir = @libdir@/weston
 module_LTLIBRARIES =                           \
        $(weston_wfits)
 
-# AM_CFLAGS = $(GCC_CFLAGS)
-# AM_CPPFLAGS = -I$(top_srcdir)/src $(WAYLAND_SERVER_CFLAGS)
-# AM_LDFLAGS = -module -avoid-version -rpath $(libdir)
-
 weston_wfits = weston-wfits.la
 weston_wfits_la_CFLAGS =                       \
        $(GCC_CFLAGS)                           \
        $(WAYLAND_SERVER_CFLAGS)                \
-       $(WESTON_CFLAGS)                        \
-       $(PIXMAN_CFLAGS)
+       $(WESTON_CFLAGS)
 weston_wfits_la_LDFLAGS = -module -avoid-version
 weston_wfits_la_LIBADD =                       \
        $(WAYLAND_SERVER_LIBS)                  \
@@ -21,3 +18,5 @@ weston_wfits_la_LIBADD =                      \
 weston_wfits_la_SOURCES =                                              \
        weston-wfits.c                                                  \
        $(top_srcdir)/src/extensions/protocol/wayland-fits-protocol.c
+
+endif