aboutsummaryrefslogtreecommitdiff
path: root/m4/arc-gnome.m4
blob: 82bd51028b9a422a347e2c5a452c7c4001503e71 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# ARC_GNOME()
# ---------------
AC_DEFUN([ARC_GNOME], [
    GNOMEDIR="$srcdir/common/gtk-3.0"

    PKG_CHECK_EXISTS(
        [gtk+-3.0],
        [GNOME_VERSION=`$PKG_CONFIG --modversion gtk+-3.0`],
        [GNOME_VERSION=`ls -1 "$GNOMEDIR" | tail -1`]
    )
    AC_ARG_WITH(
        [gnome],
        [AS_HELP_STRING(
            [--with-gnome],
            [GNOME minor version]
        )],
        [GNOME_VERSION="$withval"]
    )

    # Trim version extras
    GNOME_VERSION=`echo $GNOME_VERSION | cut -d. -f-2`

    # Extra major and minor version components
    GNOME_VERSMJR=`echo $GNOME_VERSION | cut -d. -f1`
    GNOME_VERSMNR=`echo $GNOME_VERSION | cut -d. -f2`

    # Evenize the minor version for stable versions
    AS_IF(
        [test `expr $GNOME_VERSMNR % 2` != "0"],
        [GNOME_VERSION="$GNOME_VERSMJR.`expr $GNOME_VERSMNR + 1`"]
    )
    AS_IF(
        [! test -e "$GNOMEDIR/$GNOME_VERSION"],
        [AC_MSG_ERROR([invalid GNOME version: $GNOME_VERSION])]
    )
    AC_SUBST([GNOME_VERSION])
])