Fix the GBM_MICRO macro

The version of gbm can sometimes be suffixed with ‘-devel’. This was
making the GBM_MICRO define come out as 0-devel which was generating a
warning when it was used in a #if check. This patch makes it chop off
anything after a ‘-’ using sed.

Reviewed-by: Robert Bragg <robert@linux.intel.com>

(cherry picked from commit 64472027fb5750971e94c0b4c6c624a39e5abe2f)
This commit is contained in:
Neil Roberts 2013-07-03 12:04:31 +01:00
parent 17e0cada45
commit f10c5818d3

View File

@ -1069,7 +1069,7 @@ AS_IF([test "x$enable_kms_egl_platform" = "xyes"],
GBM_VERSION=`$PKG_CONFIG --modversion gbm` GBM_VERSION=`$PKG_CONFIG --modversion gbm`
GBM_MAJOR=`echo $GBM_VERSION | cut -d'.' -f1` GBM_MAJOR=`echo $GBM_VERSION | cut -d'.' -f1`
GBM_MINOR=`echo $GBM_VERSION | cut -d'.' -f2` GBM_MINOR=`echo $GBM_VERSION | cut -d'.' -f2`
GBM_MICRO=`echo $GBM_VERSION | cut -d'.' -f3` GBM_MICRO=`echo $GBM_VERSION | cut -d'.' -f3 | sed 's/-.*//'`
AC_DEFINE_UNQUOTED([COGL_GBM_MAJOR], [$GBM_MAJOR], [The major version for libgbm]) AC_DEFINE_UNQUOTED([COGL_GBM_MAJOR], [$GBM_MAJOR], [The major version for libgbm])
AC_DEFINE_UNQUOTED([COGL_GBM_MINOR], [$GBM_MINOR], [The minor version for libgbm]) AC_DEFINE_UNQUOTED([COGL_GBM_MINOR], [$GBM_MINOR], [The minor version for libgbm])