2015-08-09 13:09:07 +03:00
|
|
|
# $NetBSD: xorg-pkg-ver.mk,v 1.8 2015/08/09 10:09:07 aymeric Exp $
|
2015-07-19 22:49:17 +03:00
|
|
|
|
|
|
|
# when including this make sure PROG is set so that $X11SRCDIR.$PROG
|
2015-07-20 05:07:36 +03:00
|
|
|
# is a valid setting. set XORG_PKG_VER_PROG if PROG is wrong.
|
2015-07-20 07:10:40 +03:00
|
|
|
# set XORG_PKG_VER_CONFIG_PATH if "configure" at the top-level is wrong.
|
2015-07-19 22:49:17 +03:00
|
|
|
|
2015-07-20 05:07:36 +03:00
|
|
|
XORG_PKG_VER_PROG?= ${PROG}
|
|
|
|
|
2015-07-20 07:10:40 +03:00
|
|
|
XORG_PKG_VER_CONFIG_PATH?= configure
|
|
|
|
_XORG_PKG_CONFIGURE_PATH= ${X11SRCDIR.${XORG_PKG_VER_PROG}}/${XORG_PKG_VER_CONFIG_PATH}
|
|
|
|
|
2015-07-20 05:07:36 +03:00
|
|
|
.if exists(${X11SRCDIR.${XORG_PKG_VER_PROG}}/configure)
|
2015-07-19 22:49:17 +03:00
|
|
|
XORG_PKG_PACKAGE_VERSION!= \
|
2015-08-09 13:09:07 +03:00
|
|
|
${TOOL_AWK} -F= '/^PACKAGE_VERSION=/ { \
|
2015-07-19 22:49:17 +03:00
|
|
|
match($$2, "([0-9]+\\.)+[0-9]+"); \
|
|
|
|
version = substr($$2, RSTART, RLENGTH); \
|
|
|
|
print version; \
|
|
|
|
exit 0; \
|
2015-07-20 05:07:36 +03:00
|
|
|
}' ${X11SRCDIR.${XORG_PKG_VER_PROG}}/configure
|
2015-07-19 22:49:17 +03:00
|
|
|
.if !empty(XORG_PKG_PACKAGE_VERSION)
|
|
|
|
CPPFLAGS+= -DPACKAGE_VERSION=\"${XORG_PKG_PACKAGE_VERSION:Q}\"
|
2015-07-22 10:58:00 +03:00
|
|
|
CPPFLAGS+= -DVERSION=\"${XORG_PKG_PACKAGE_VERSION:Q}\"
|
2015-07-19 22:49:17 +03:00
|
|
|
.endif
|
|
|
|
|
|
|
|
XORG_PKG_PACKAGE_STRING!= \
|
2015-08-09 13:09:07 +03:00
|
|
|
${TOOL_AWK} -F= '/^PACKAGE_STRING=/ { \
|
2015-08-09 02:06:36 +03:00
|
|
|
match($$2, "[-_a-zA-Z]+[ ]+([0-9]+\\.)+[0-9]+"); \
|
2015-07-19 22:49:17 +03:00
|
|
|
string = substr($$2, RSTART, RLENGTH); \
|
|
|
|
print string; \
|
|
|
|
exit 0; \
|
2015-07-20 05:07:36 +03:00
|
|
|
}' ${X11SRCDIR.${XORG_PKG_VER_PROG}}/configure
|
2015-07-19 22:49:17 +03:00
|
|
|
.if !empty(XORG_PKG_PACKAGE_STRING)
|
|
|
|
CPPFLAGS+= -DPACKAGE_STRING=\"${XORG_PKG_PACKAGE_STRING:Q}\"
|
|
|
|
.endif
|
|
|
|
|
2015-07-21 02:50:22 +03:00
|
|
|
XORG_PKG_PACKAGE_NAME!= \
|
2015-08-09 13:09:07 +03:00
|
|
|
${TOOL_AWK} -F= '/^PACKAGE_NAME=/ { \
|
2015-08-09 02:06:36 +03:00
|
|
|
match($$2, "'"'"'[-_a-zA-Z0-9]+'"'"'"); \
|
2015-07-21 02:50:22 +03:00
|
|
|
name = substr($$2, RSTART, RLENGTH); \
|
|
|
|
print name; \
|
|
|
|
exit 0; \
|
|
|
|
}' ${X11SRCDIR.${XORG_PKG_VER_PROG}}/configure
|
|
|
|
.if !empty(XORG_PKG_PACKAGE_NAME)
|
|
|
|
CPPFLAGS+= -DPACKAGE_NAME=\"${XORG_PKG_PACKAGE_NAME:Q}\"
|
|
|
|
.endif
|
|
|
|
|
2015-07-19 22:49:17 +03:00
|
|
|
.endif
|