configure.in
changeset 10303 b326f93e1bc5
parent 10089 25fda20d0173
child 10304 ee83e0b4a36f
     1.1 --- a/configure.in	Thu Sep 01 01:22:58 2016 -0700
     1.2 +++ b/configure.in	Thu Jun 23 18:39:05 2016 +0800
     1.3 @@ -1201,9 +1201,11 @@
     1.4          if  test x$PKG_CONFIG != xno && \
     1.5              test x$video_opengl_egl = xyes && \
     1.6              test x$video_opengles_v2 = xyes; then
     1.7 -            if $PKG_CONFIG --exists wayland-client wayland-egl wayland-cursor egl xkbcommon ; then
     1.8 +            if $PKG_CONFIG --exists wayland-client wayland-scanner wayland-egl wayland-cursor egl xkbcommon ; then
     1.9                  WAYLAND_CFLAGS=`$PKG_CONFIG --cflags wayland-client wayland-egl wayland-cursor xkbcommon`
    1.10                  WAYLAND_LIBS=`$PKG_CONFIG --libs wayland-client wayland-egl wayland-cursor xkbcommon`
    1.11 +                WAYLAND_SCANNER=`$PKG_CONFIG --variable=wayland_scanner wayland-scanner`
    1.12 +                WAYLAND_CORE_PROTOCOL_DIR=`$PKG_CONFIG --variable=pkgdatadir wayland-client`
    1.13                  video_wayland=yes
    1.14              fi
    1.15          fi
    1.16 @@ -1215,7 +1217,7 @@
    1.17                  AC_DEFINE(SDL_VIDEO_DRIVER_WAYLAND_QT_TOUCH, 1, [ ])
    1.18              fi
    1.19              SOURCES="$SOURCES $srcdir/src/video/wayland/*.c"
    1.20 -            EXTRA_CFLAGS="$EXTRA_CFLAGS $WAYLAND_CFLAGS"
    1.21 +            EXTRA_CFLAGS="$EXTRA_CFLAGS $WAYLAND_CFLAGS -I\$(gen)"
    1.22              AC_ARG_ENABLE(wayland-shared,
    1.23  AC_HELP_STRING([--enable-wayland-shared], [dynamically load Wayland support [[default=maybe]]]),
    1.24                            , enable_wayland_shared=maybe)
    1.25 @@ -3481,6 +3483,33 @@
    1.26  fi
    1.27  SDLTEST_SOURCES="$srcdir/src/test/*.c"
    1.28  
    1.29 +if test x$video_wayland = xyes; then
    1.30 +    WAYLAND_CORE_PROTOCOL_SOURCE='$(gen)/wayland-protocol.c'
    1.31 +    WAYLAND_CORE_PROTOCOL_HEADER='$(gen)/wayland-client-protocol.h'
    1.32 +    GEN_SOURCES="$GEN_SOURCES $WAYLAND_CORE_PROTOCOL_SOURCE"
    1.33 +    GEN_HEADERS="$GEN_HEADERS $WAYLAND_CORE_PROTOCOL_HEADER"
    1.34 +
    1.35 +    WAYLAND_CORE_PROTOCOL_SOURCE_DEPENDS="
    1.36 +$WAYLAND_CORE_PROTOCOL_SOURCE: $WAYLAND_CORE_PROTOCOL_DIR/wayland.xml
    1.37 +	\$(SHELL) \$(auxdir)/mkinstalldirs \$(gen)
    1.38 +	\$(RUN_CMD_GEN)\$(WAYLAND_SCANNER) code \$< \$@"
    1.39 +
    1.40 +    WAYLAND_CORE_PROTOCOL_HEADER_DEPENDS="
    1.41 +$WAYLAND_CORE_PROTOCOL_HEADER: $WAYLAND_CORE_PROTOCOL_DIR/wayland.xml
    1.42 +	\$(SHELL) \$(auxdir)/mkinstalldirs \$(gen)
    1.43 +	\$(RUN_CMD_GEN)\$(WAYLAND_SCANNER) client-header \$< \$@"
    1.44 +
    1.45 +    WAYLAND_CORE_PROTOCOL_OBJECT="
    1.46 +\$(objects)/`echo $WAYLAND_CORE_PROTOCOL_SOURCE | sed 's/\$(gen)\/\(.*\).c$/\1.lo/'`: $WAYLAND_CORE_PROTOCOL_SOURCE
    1.47 +	\$(RUN_CMD_CC)\$(LIBTOOL) --tag=CC --mode=compile \$(CC) \$(CFLAGS) \$(EXTRA_CFLAGS) $DEPENDENCY_TRACKING_OPTIONS -c \$< -o \$@"
    1.48 +
    1.49 +    WAYLAND_PROTOCOLS_DEPENDS="
    1.50 +$WAYLAND_CORE_PROTOCOL_SOURCE_DEPENDS
    1.51 +$WAYLAND_CORE_PROTOCOL_HEADER_DEPENDS
    1.52 +$WAYLAND_CORE_PROTOCOL_OBJECT
    1.53 +"
    1.54 +fi
    1.55 +
    1.56  OBJECTS=`echo $SOURCES`
    1.57  DEPENDS=`echo $SOURCES | tr ' ' '\n'`
    1.58  for EXT in asm cc m c S; do
    1.59 @@ -3490,6 +3519,8 @@
    1.60  	\\$(RUN_CMD_CC)\\$(LIBTOOL) --tag=CC --mode=compile \\$(CC) \\$(CFLAGS) \\$(EXTRA_CFLAGS) $DEPENDENCY_TRACKING_OPTIONS -c \\$< -o \\$@,g"`
    1.61  done
    1.62  
    1.63 +GEN_OBJECTS=`echo "$GEN_SOURCES" | sed 's,[[^ ]]*/\([[^ ]]*\)\.c,$(objects)/\1.lo,g'`
    1.64 +
    1.65  VERSION_OBJECTS=`echo $VERSION_SOURCES`
    1.66  VERSION_DEPENDS=`echo $VERSION_SOURCES`
    1.67  VERSION_OBJECTS=`echo "$VERSION_OBJECTS" | sed 's,[[^ ]]*/\([[^ ]]*\)\.rc,$(objects)/\1.o,g'`
    1.68 @@ -3567,6 +3598,8 @@
    1.69  AC_SUBST(ac_aux_dir)
    1.70  AC_SUBST(INCLUDE)
    1.71  AC_SUBST(OBJECTS)
    1.72 +AC_SUBST(GEN_HEADERS)
    1.73 +AC_SUBST(GEN_OBJECTS)
    1.74  AC_SUBST(VERSION_OBJECTS)
    1.75  AC_SUBST(SDLMAIN_OBJECTS)
    1.76  AC_SUBST(SDLTEST_OBJECTS)
    1.77 @@ -3575,6 +3608,7 @@
    1.78  AC_SUBST(BUILD_LDFLAGS)
    1.79  AC_SUBST(EXTRA_LDFLAGS)
    1.80  AC_SUBST(WINDRES)
    1.81 +AC_SUBST(WAYLAND_SCANNER)
    1.82  
    1.83  cat >Makefile.rules <<__EOF__
    1.84  
    1.85 @@ -3587,6 +3621,7 @@
    1.86  $VERSION_DEPENDS
    1.87  $SDLMAIN_DEPENDS
    1.88  $SDLTEST_DEPENDS
    1.89 +$WAYLAND_PROTOCOLS_DEPENDS
    1.90  __EOF__
    1.91  
    1.92  AC_CONFIG_FILES([