Merge Trond
[m6w6/libmemcached] / m4 / pandora_vc_build.m4
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
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
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
39 ])
40
41 dnl Takes one argument which is the prefix to append
42 AC_DEFUN([PANDORA_EXPORT_BZR_INFO],[
43 m4_ifval(m4_normalize([$1]),[
44 m4_define([PEBI_PREFIX],[])
45 ],[
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])
55
56 ])
57