1085.1.4
by Monty Taylor
pandora-build v1 |
1 |
dnl Copyright (C) 2009 Sun Microsystems |
2 |
dnl This file is free software; Sun Microsystems |
|
3 |
dnl gives unlimited permission to copy and/or distribute it, |
|
4 |
dnl with or without modifications, as long as this notice is preserved. |
|
5 |
||
1085.1.3
by Monty Taylor
Split out warnings - start using the pandora build system. |
6 |
AC_DEFUN([PANDORA_BUILDING_FROM_VC],[ |
7 |
||
8 |
ac_cv_building_from_vc=no
|
|
9 |
||
10 |
AS_IF([test -d "${srcdir}/.bzr"],[ |
|
11 |
ac_cv_building_from_bzr=yes
|
|
12 |
ac_cv_building_from_vc=yes
|
|
13 |
],[ |
|
14 |
ac_cv_building_from_bzr=no
|
|
15 |
]) |
|
16 |
||
17 |
AS_IF([test -d "${srcdir}/.svn"],[ |
|
18 |
ac_cv_building_from_svn=yes
|
|
19 |
ac_cv_building_from_vc=yes
|
|
20 |
],[ |
|
21 |
ac_cv_building_from_svn=no
|
|
22 |
]) |
|
23 |
||
24 |
AS_IF([test -d "${srcdir}/.hg"],[ |
|
25 |
ac_cv_building_from_hg=yes
|
|
26 |
ac_cv_building_from_vc=yes
|
|
27 |
],[ |
|
28 |
ac_cv_building_from_hg=no
|
|
29 |
]) |
|
30 |
||
1093.9.23
by Monty Taylor
pandora-build v0.49 |
31 |
AS_IF([test -d "${srcdir}/.git"],[ |
32 |
ac_cv_building_from_git=yes
|
|
33 |
ac_cv_building_from_vc=yes
|
|
34 |
],[ |
|
35 |
ac_cv_building_from_git=no
|
|
36 |
]) |
|
37 |
||
38 |
||
1085.1.3
by Monty Taylor
Split out warnings - start using the pandora build system. |
39 |
]) |
1085.1.4
by Monty Taylor
pandora-build v1 |
40 |
|
1126.6.1
by Monty Taylor
pandora-build v0.58 |
41 |
dnl Takes one argument which is the prefix to append |
42 |
AC_DEFUN([PANDORA_EXPORT_BZR_INFO],[ |
|
1126.7.2
by mordred
pandora-build v0.59 - fixed for old autoconf. |
43 |
m4_ifval(m4_normalize([$1]),[ |
44 |
m4_define([PEBI_PREFIX],[]) |
|
45 |
],[ |
|
1126.6.1
by Monty Taylor
pandora-build v0.58 |
46 |
m4_define([PEBI_PREFIX],m4_toupper(m4_normalize($1))[_]) |
47 |
]) |
|
48 |
||
49 |
AC_DEFINE(PEBI_PREFIX[BZR_REVID], ["BZR_REVID"], [bzr revision ID]) |
|
50 |
AC_DEFINE(PEBI_PREFIX[BZR_BRANCH], ["BZR_BRANCH"], [bzr branch name]) |
|
51 |
AC_DEFINE(PEBI_PREFIX[RELEASE_DATE], ["RELEASE_DATE"], [Release date based on the date of the repo checkout]) |
|
52 |
AC_DEFINE(PEBI_PREFIX[RELEASE_VERSION], ["RELEASE_VERSION"], [$1 version number formatted for display]) |
|
53 |
AC_DEFINE(PEBI_PREFIX[RELEASE_COMMENT], ["RELEASE_COMMENT"], [Set to trunk if the branch is the main $1 branch]) |
|
54 |
AC_DEFINE(PEBI_PREFIX[RELEASE_ID], [RELEASE_ID], [$1 version number formatted for numerical comparison]) |
|
1192.3.6
by Monty Taylor
pandora-build v0.67 - Support configure-time bzr version checking. |
55 |
]) |
56 |
||
57 |
AC_DEFUN([_PANDORA_READ_FROM_FILE],[ |
|
58 |
$1=`grep $1 $2 | cut -f2 -d=`
|
|
59 |
]) |
|
60 |
||
61 |
AC_DEFUN([PANDORA_VC_VERSION],[ |
|
62 |
AC_REQUIRE([PANDORA_BUILDING_FROM_VC]) |
|
63 |
||
64 |
PANDORA_RELEASE_DATE=`date +%Y.%m` |
|
65 |
PANDORA_RELEASE_NODOTS_DATE=`date +%Y%m` |
|
66 |
||
67 |
dnl Set some defaults |
|
68 |
PANDORA_VC_REVNO="0" |
|
69 |
PANDORA_VC_REVID="unknown" |
|
70 |
PANDORA_VC_BRANCH="bzr-export" |
|
71 |
||
72 |
AS_IF([test -f ${srcdir}/config/bzr_revinfo],[ |
|
73 |
_PANDORA_READ_FROM_FILE([PANDORA_VC_REVNO],${srcdir}/config/bzr_revinfo) |
|
74 |
_PANDORA_READ_FROM_FILE([PANDORA_VC_REVID],${srcdir}/config/bzr_revinfo) |
|
75 |
_PANDORA_READ_FROM_FILE([PANDORA_VC_BRANCH], |
|
76 |
${srcdir}/config/bzr_revinfo) |
|
77 |
_PANDORA_READ_FROM_FILE([PANDORA_RELEASE_DATE], |
|
78 |
${srcdir}/config/bzr_revinfo) |
|
79 |
_PANDORA_READ_FROM_FILE([PANDORA_RELEASE_NODOTS_DATE], |
|
80 |
${srcdir}/config/bzr_revinfo) |
|
81 |
_PANDORA_READ_FROM_FILE([PANDORA_RELEASE_COMMENT], |
|
82 |
${srcdir}/config/bzr_revinfo) |
|
83 |
]) |
|
84 |
AS_IF([test "${ac_cv_building_from_bzr}" = "yes"],[ |
|
85 |
dnl echo "Grabbing changelog and version information from bzr"
|
|
86 |
dnl bzr log --short > ChangeLog || touch ChangeLog
|
|
1192.3.7
by Monty Taylor
Added code necessary for building plugins dynamically. |
87 |
PANDORA_BZR_REVNO=`bzr revno`
|
88 |
AS_IF([test "x$PANDORA_BZR_REVNO" != "${PANDORA_VC_REVNO}"],[ |
|
89 |
PANDORA_VC_REVNO="${PANDORA_BZR_REVNO}"
|
|
1192.3.6
by Monty Taylor
pandora-build v0.67 - Support configure-time bzr version checking. |
90 |
PANDORA_VC_REVID=`bzr log -r-1 --show-ids | grep revision-id | awk '{print $[]2}' | head -1` |
91 |
PANDORA_VC_BRANCH=`bzr nick` |
|
92 |
AS_IF([test "x${PANDORA_VC_BRANCH}" != "${PACKAGE}"],[ |
|
93 |
PANDORA_RELEASE_COMMENT="${PANDORA_VC_BRANCH}"
|
|
94 |
],[ |
|
95 |
PANDORA_RELEASE_COMMENT="trunk"
|
|
96 |
]) |
|
97 |
]) |
|
98 |
]) |
|
1192.3.7
by Monty Taylor
Added code necessary for building plugins dynamically. |
99 |
AS_IF([! test -d config],[mkdir -p config]) |
100 |
cat > "config/bzr_revinfo" <<EOF |
|
1192.3.6
by Monty Taylor
pandora-build v0.67 - Support configure-time bzr version checking. |
101 |
PANDORA_VC_REVNO=${PANDORA_VC_REVNO} |
102 |
PANDORA_VC_REVID=${PANDORA_VC_REVID} |
|
103 |
PANDORA_VC_BRANCH=${PANDORA_VC_BRANCH} |
|
104 |
PANDORA_RELEASE_DATE=${PANDORA_RELEASE_DATE} |
|
105 |
PANDORA_RELEASE_NODOTS_DATE=${PANDORA_RELEASE_NODOTS_DATE} |
|
106 |
PANDORA_RELEASE_COMMENT=${PANDORA_RELEASE_COMMENT} |
|
107 |
EOF
|
|
108 |
|
|
109 |
PANDORA_RELEASE_VERSION="${PANDORA_RELEASE_DATE}.${PANDORA_VC_REVNO}" |
|
110 |
PANDORA_RELEASE_ID="${PANDORA_RELEASE_NODOTS_DATE}${PANDORA_VC_REVNO}" |
|
111 |
||
112 |
VERSION="${PANDORA_RELEASE_VERSION}" |
|
1192.3.7
by Monty Taylor
Added code necessary for building plugins dynamically. |
113 |
AC_DEFINE_UNQUOTED([PANDORA_RELEASE_VERSION],["${PANDORA_RELEASE_VERSION}"], |
114 |
[The real version of the software]) |
|
1192.3.6
by Monty Taylor
pandora-build v0.67 - Support configure-time bzr version checking. |
115 |
AC_SUBST(PANDORA_VC_REVNO) |
116 |
AC_SUBST(PANDORA_VC_REVID) |
|
117 |
AC_SUBST(PANDORA_VC_BRANCH) |
|
118 |
AC_SUBST(PANDORA_RELEASE_DATE) |
|
119 |
AC_SUBST(PANDORA_RELEASE_NODOTS_DATE) |
|
120 |
AC_SUBST(PANDORA_RELEASE_COMMENT) |
|
121 |
AC_SUBST(PANDORA_RELEASE_VERSION) |
|
122 |
AC_SUBST(PANDORA_RELEASE_ID) |
|
123 |
]) |