Skip to content

Commit 9460b11

Browse files
committed
Don't define package/module version in multiple files
Now configure.ac is the only place to define version. Pass the version via Makefile and compiler command line args -Dfoo=bar.
1 parent 312708c commit 9460b11

File tree

6 files changed

+19
-5
lines changed

6 files changed

+19
-5
lines changed

configure.ac

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
11
# Process this file with autoconf to produce a configure script
22

33
AC_PREREQ(2.65)
4-
# don't forget to also change version in module/rdp.h
4+
# package version must be x.y.z
55
AC_INIT([xorgxrdp], [0.2.5], [[email protected]])
6+
package_version_major=$(echo ${PACKAGE_VERSION}|cut -d. -f1)
7+
package_version_minor=$(echo ${PACKAGE_VERSION}|cut -d. -f2)
8+
package_version_patchlevel=$(echo ${PACKAGE_VERSION}|cut -d. -f3)
9+
AC_SUBST([package_version_major], [${package_version_major}])
10+
AC_SUBST([package_version_minor], [${package_version_minor}])
11+
AC_SUBST([package_version_patchlevel], [${package_version_patchlevel}])
612
AC_CONFIG_HEADERS(config_ac.h:config_ac-h.in)
713
AM_INIT_AUTOMAKE([1.11 foreign parallel-tests])
814
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])

module/Makefile.am

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ endif
1818
AM_CFLAGS = \
1919
$(XORG_SERVER_CFLAGS) \
2020
$(XRDP_CFLAGS) \
21+
-DPACKAGE_VERSION_MAJOR=@package_version_major@ \
22+
-DPACKAGE_VERSION_MINOR=@package_version_minor@ \
23+
-DPACKAGE_VERSION_PATCHLEVEL=@package_version_patchlevel@ \
2124
-I$(top_srcdir)/module \
2225
$(EXTRA_FLAGS)
2326

module/rdp.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,6 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
4141
#define XRDP_KEYB_NAME "XRDPKEYB"
4242
#define XRDP_VERSION 1000
4343

44-
#define PACKAGE_VERSION_MAJOR 0
45-
#define PACKAGE_VERSION_MINOR 2
46-
#define PACKAGE_VERSION_PATCHLEVEL 5
47-
4844
#define COLOR8(r, g, b) \
4945
((((r) >> 5) << 0) | (((g) >> 5) << 3) | (((b) >> 6) << 6))
5046
#define COLOR15(r, g, b) \

xrdpdev/Makefile.am

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ EXTRA_DIST =
33
AM_CFLAGS = \
44
$(XORG_SERVER_CFLAGS) \
55
$(XRDP_CFLAGS) \
6+
-DPACKAGE_VERSION_MAJOR=@package_version_major@ \
7+
-DPACKAGE_VERSION_MINOR=@package_version_minor@ \
8+
-DPACKAGE_VERSION_PATCHLEVEL=@package_version_patchlevel@ \
69
-I$(top_srcdir)/module
710

811
xrdpdev_drv_la_LTLIBRARIES = xrdpdev_drv.la

xrdpkeyb/Makefile.am

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ EXTRA_DIST =
33
AM_CFLAGS = \
44
$(XORG_SERVER_CFLAGS) \
55
$(XRDP_CFLAGS) \
6+
-DPACKAGE_VERSION_MAJOR=@package_version_major@ \
7+
-DPACKAGE_VERSION_MINOR=@package_version_minor@ \
8+
-DPACKAGE_VERSION_PATCHLEVEL=@package_version_patchlevel@ \
69
-I$(top_srcdir)/module
710

811
xrdpkeyb_drv_la_LTLIBRARIES = xrdpkeyb_drv.la

xrdpmouse/Makefile.am

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ EXTRA_DIST =
33
AM_CFLAGS = \
44
$(XORG_SERVER_CFLAGS) \
55
$(XRDP_CFLAGS) \
6+
-DPACKAGE_VERSION_MAJOR=@package_version_major@ \
7+
-DPACKAGE_VERSION_MINOR=@package_version_minor@ \
8+
-DPACKAGE_VERSION_PATCHLEVEL=@package_version_patchlevel@ \
69
-I$(top_srcdir)/module
710

811
xrdpmouse_drv_la_LTLIBRARIES = xrdpmouse_drv.la

0 commit comments

Comments
 (0)