update changelog
[platform/upstream/acl.git] / m4 / package_globals.m4
1 dnl Copyright (C) 2003, 2005, 2006, 2007  Silicon Graphics, Inc.
2 dnl
3 dnl This program is free software: you can redistribute it and/or modify it
4 dnl under the terms of the GNU General Public License as published by
5 dnl the Free Software Foundation, either version 2 of the License, or
6 dnl (at your option) any later version.
7 dnl
8 dnl This program is distributed in the hope that it will be useful,
9 dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
10 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11 dnl GNU General Public License for more details.
12 dnl
13 dnl You should have received a copy of the GNU General Public License
14 dnl along with this program.  If not, see <http://www.gnu.org/licenses/>.
15 #
16 # Generic macro, sets up all of the global packaging variables.
17 # The following environment variables may be set to override defaults:
18 #   DEBUG OPTIMIZER MALLOCLIB PLATFORM DISTRIBUTION INSTALL_USER INSTALL_GROUP
19 #   BUILD_VERSION
20 #
21 AC_DEFUN([AC_PACKAGE_GLOBALS],
22   [ pkg_name="$1"
23     AC_SUBST(pkg_name)
24
25     AC_PROG_CC
26
27     . ./VERSION
28     pkg_version=${PKG_MAJOR}.${PKG_MINOR}.${PKG_REVISION}
29     AC_SUBST(pkg_version)
30     pkg_release=$PKG_BUILD
31     test -z "$BUILD_VERSION" || pkg_release="$BUILD_VERSION"
32     AC_SUBST(pkg_release)
33
34     DEBUG=${DEBUG:-'-DDEBUG'}           dnl  -DNDEBUG
35     debug_build="$DEBUG"
36     AC_SUBST(debug_build)
37
38     OPTIMIZER=${OPTIMIZER:-'-g -O2'}
39     opt_build="$OPTIMIZER"
40     AC_SUBST(opt_build)
41
42     MALLOCLIB=${MALLOCLIB:-''}          dnl  /usr/lib/libefence.a
43     malloc_lib="$MALLOCLIB"
44     AC_SUBST(malloc_lib)
45
46     pkg_user=`id -u -n`
47     test -z "$INSTALL_USER" || pkg_user="$INSTALL_USER"
48     AC_SUBST(pkg_user)
49
50     pkg_group=`id -g -n`
51     test -z "$INSTALL_GROUP" || pkg_group="$INSTALL_GROUP"
52     AC_SUBST(pkg_group)
53
54     pkg_distribution=`uname -s`
55     test -z "$DISTRIBUTION" || pkg_distribution="$DISTRIBUTION"
56     AC_SUBST(pkg_distribution)
57
58     pkg_platform=`uname -s | tr 'A-Z' 'a-z' | sed -e 's/irix64/irix/'`
59     test -z "$PLATFORM" || pkg_platform="$PLATFORM"
60     AC_SUBST(pkg_platform)
61   ])