Allow driver version to be set from the makefile instead of

relying on parsing configure scripts.
This commit is contained in:
ahoka 2009-06-05 23:34:36 +00:00
parent f5b48500f1
commit b498a6e0b7

View File

@ -1,4 +1,4 @@
# $NetBSD: Makefile.xf86-driver,v 1.13 2008/10/19 22:05:20 apb Exp $
# $NetBSD: Makefile.xf86-driver,v 1.14 2009/06/05 23:34:36 ahoka Exp $
LIBISMODULE= yes
SHLIB_MAJOR= ${PACKAGE_MAJOR}
@ -9,6 +9,11 @@ SHLIB_MAJOR= ${PACKAGE_MAJOR}
LIB= ${DRIVER_NAME}
LIBDIR= ${X11USRLIBDIR}/modules/drivers
# Extract version from configure script if not set in makefile.
#
.if defined(DRIVER_VERSION)
PACKAGE_VERSION= ${DRIVER_VERSION}
.else
PRINT_PACKAGE_VERSION= ${TOOL_AWK} '/^PACKAGE_VERSION=/ { \
match($$1, "[0-9]+\\.[0-9]+\\.[0-9]+"); \
version = substr($$1, RSTART, RLENGTH); \
@ -16,6 +21,7 @@ PRINT_PACKAGE_VERSION= ${TOOL_AWK} '/^PACKAGE_VERSION=/ { \
${X11SRCDIR.${DRIVER}}/configure
PACKAGE_VERSION!= ${PRINT_PACKAGE_VERSION}
.endif
PACKAGE_MAJOR= ${PACKAGE_VERSION:R:R}
PACKAGE_MINOR= ${PACKAGE_VERSION:R:E}