| @@ -1,51 +1,46 @@ | | | @@ -1,51 +1,46 @@ |
1 | # $NetBSD: xorg-version.mk,v 1.2 2011/09/09 09:08:07 abs Exp $ | | 1 | # $NetBSD: xorg-version.mk,v 1.2.12.1 2013/01/24 10:40:07 spz Exp $ |
2 | # | | 2 | # |
3 | # This Makefile fragment is included by Makefiles that need to access | | 3 | # This Makefile fragment is included by Makefiles that need to access |
4 | # the X11_TYPE and version number of an X.org distribution. | | 4 | # the X11_TYPE and version number of an X.org distribution. |
5 | # | | 5 | # |
6 | # The following variables are provided by this file: | | 6 | # The following variables are provided by this file: |
7 | # | | 7 | # |
8 | # BUILTIN_X11_TYPE.xorg is the X11_TYPE of the X.org distribution | | 8 | # BUILTIN_X11_TYPE.xorg is the X11_TYPE of the X.org distribution |
9 | # and is simply "xorg". | | 9 | # and is simply "xorg". |
10 | # | | 10 | # |
11 | # BUILTIN_X11_VERSION.xorg is the version number of the X.org | | 11 | # BUILTIN_X11_VERSION.xorg is the version number of the X.org |
12 | # distribution detected on the system. | | 12 | # distribution detected on the system. |
13 | # | | 13 | # |
14 | | | 14 | |
15 | BUILTIN_X11_TYPE.xorg= xorg | | 15 | BUILTIN_X11_TYPE.xorg= xorg |
16 | | | 16 | |
17 | BUILTIN_FIND_FILES_VAR:= CF_XORG CF_XORG_VERSION CF_VERSION_OLD XQUARTZ | | 17 | BUILTIN_FIND_FILES_VAR:= CF_XORG CF_XORG_VERSION CF_VERSION_OLD XQUARTZ |
18 | BUILTIN_FIND_FILES.CF_XORG= ${X11BASE}/lib/X11/config/xorg.cf | | 18 | BUILTIN_FIND_FILES.CF_XORG= ${X11BASE}/lib/X11/config/xorg.cf |
19 | BUILTIN_FIND_FILES.CF_XORG_VERSION= ${X11BASE}/lib/X11/config/xorgversion.def | | 19 | BUILTIN_FIND_FILES.CF_XORG_VERSION= ${X11BASE}/lib/X11/config/xorgversion.def |
20 | BUILTIN_FIND_FILES.CF_VERSION_OLD= ${X11BASE}/lib/X11/config/version.def | | 20 | BUILTIN_FIND_FILES.CF_VERSION_OLD= ${X11BASE}/lib/X11/config/version.def |
21 | BUILTIN_FIND_FILES.XQUARTZ= ${X11BASE}/bin/Xquartz | | | |
22 | .include "../../mk/buildlink3/find-files.mk" | | 21 | .include "../../mk/buildlink3/find-files.mk" |
23 | | | 22 | |
24 | .if !defined(BUILTIN_XORG_VERSION_FILE) | | 23 | .if !defined(BUILTIN_XORG_VERSION_FILE) |
25 | BUILTIN_XORG_VERSION_FILE= __nonexistent__ | | 24 | BUILTIN_XORG_VERSION_FILE= __nonexistent__ |
26 | . if exists(${CF_XORG_VERSION}) | | 25 | . if exists(${CF_XORG_VERSION}) |
27 | BUILTIN_XORG_VERSION_FILE= ${CF_XORG_VERSION} | | 26 | BUILTIN_XORG_VERSION_FILE= ${CF_XORG_VERSION} |
28 | . elif exists(${CF_VERSION_OLD}) | | 27 | . elif exists(${CF_VERSION_OLD}) |
29 | BUILTIN_XORG_VERSION_FILE= ${CF_VERSION_OLD} | | 28 | BUILTIN_XORG_VERSION_FILE= ${CF_VERSION_OLD} |
30 | . endif | | 29 | . endif |
31 | .endif | | 30 | .endif |
32 | MAKEVARS+= BUILTIN_XORG_VERSION_FILE | | 31 | MAKEVARS+= BUILTIN_XORG_VERSION_FILE |
33 | | | 32 | |
34 | .if !defined(BUILTIN_X11_VERSION.xorg) | | 33 | .if !defined(BUILTIN_X11_VERSION.xorg) |
35 | . if exists(${XQUARTZ}) | | 34 | . if exists(${BUILTIN_XORG_VERSION_FILE}) |
36 | BUILTIN_X11_VERSION.xorg!= \ | | | |
37 | ${XQUARTZ} -version 2>&1 | \ | | | |
38 | ${AWK} '/X.org Release / { print $$3 }' | | | |
39 | . elif exists(${BUILTIN_XORG_VERSION_FILE}) | | | |
40 | BUILTIN_X11_VERSION.xorg!= \ | | 35 | BUILTIN_X11_VERSION.xorg!= \ |
41 | ${AWK} '/\#define[ ]*XORG_VERSION_MAJOR/ { M = $$3 } \ | | 36 | ${AWK} '/\#define[ ]*XORG_VERSION_MAJOR/ { M = $$3 } \ |
42 | /\#define[ ]*XORG_VERSION_MINOR/ { m = "."$$3 } \ | | 37 | /\#define[ ]*XORG_VERSION_MINOR/ { m = "."$$3 } \ |
43 | /\#define[ ]*XORG_VERSION_PATCH/ { p = "."$$3 } \ | | 38 | /\#define[ ]*XORG_VERSION_PATCH/ { p = "."$$3 } \ |
44 | /\#define[ ]*XORG_VERSION_SNAP/ { s = "."$$3 } \ | | 39 | /\#define[ ]*XORG_VERSION_SNAP/ { s = "."$$3 } \ |
45 | END { if (s == ".0") s = ""; \ | | 40 | END { if (s == ".0") s = ""; \ |
46 | if (p == ".0" && s == "") p = ""; \ | | 41 | if (p == ".0" && s == "") p = ""; \ |
47 | printf "%s%s%s%s\n", M, m, p, s }' \ | | 42 | printf "%s%s%s%s\n", M, m, p, s }' \ |
48 | ${BUILTIN_XORG_VERSION_FILE} | | 43 | ${BUILTIN_XORG_VERSION_FILE} |
49 | . endif | | 44 | . endif |
50 | .endif | | 45 | .endif |
51 | MAKEVARS+= BUILTIN_X11_VERSION.xorg | | 46 | MAKEVARS+= BUILTIN_X11_VERSION.xorg |