-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathconfigure.ac
168 lines (147 loc) · 5.34 KB
/
configure.ac
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
dnl configure.in for mmc-core project.
dnl (c) 2011 mandriva, http://www.mandriva.com
dnl
dnl This file is part of Mandriva Management Console (MMC).
dnl
dnl MMC is free software; you can redistribute it and/or modify
dnl it under the terms of the GNU General Public License as published by
dnl the Free Software Foundation; either version 2 of the License, or
dnl (at your option) any later version.
dnl
dnl MMC is distributed in the hope that it will be useful,
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
dnl GNU General Public License for more details.
dnl
dnl You should have received a copy of the GNU General Public License
dnl along with MMC. If not, see <http://www.gnu.org/licenses/>.
dnl Process this file with autoconf to produce a configure script.
dnl autoconf version
AC_PREREQ(2.59)
dnl autoconf initialization
define([project], [mmc-core])
define([gitversion], esyscmd([sh -c "which git > /dev/null && git describe 2> /dev/null | sed -e 's/]project[-\([^-]\+\)//' | tr -d '\n' || true"]))dnl
AC_INIT(project, [4.6.0], [http://www.siveo.net])
AC_DEFINE(GITVERSION, "gitversion", [Git version])
AC_CANONICAL_BUILD
AC_CANONICAL_HOST
AC_CANONICAL_TARGET
AM_INIT_AUTOMAKE([-Wno-portability foreign])
AM_CONFIG_HEADER(config.h)
m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES(yes)])
AC_CONFIG_MACRO_DIR([m4])
dnl check for programs
AC_PROG_MAKE_SET
AC_PROG_LN_S
dnl Check for GNU install (for file backup)
AC_MSG_CHECKING([for GNU install])
if $INSTALL --version | grep -q 'GNU coreutils'; then
AC_MSG_RESULT([yes])
else
AC_MSG_ERROR([Could not find GNU install])
fi
dnl Check for Python
AM_PATH_PYTHON([2.5])
# gettext: prepare the translation directories.
AM_PO_SUBDIRS
if test "x$USE_NLS" = "xyes"; then
AC_CHECK_PROG(HAVE_MSGFMT, msgfmt,yes,no)
if test "x$HAVE_MSGFMT" = "xno"; then
AC_MSG_ERROR([msgfmt not found. You need to install the 'gettext' package, or pass --enable-nls=no to configure.])
fi
fi
dnl
dnl --enable-systemd
dnl Install systemd services instead of init scripts
dnl
AC_ARG_ENABLE([systemd],
[AS_HELP_STRING([--enable-systemd],
[Install systemd services @<:@default=disable@:>@])])
AM_CONDITIONAL([ENABLE_SYSTEMD], [test "$enable_systemd" = "yes"])
dnl
dnl --disable-python
dnl Do not install Python files
dnl
AC_ARG_ENABLE([python],
[AS_HELP_STRING([--disable-python],
[Do not install Python files @<:@default=enable@:>@])],
[],
[enable_python="yes"])
AM_CONDITIONAL([ENABLE_PYTHON], [test "$enable_python" = "yes"])
dnl
dnl --disable-python-check
dnl Do not check python modules on configure
dnl
AC_ARG_ENABLE([python-check],
[AS_HELP_STRING([--disable-python-check],
[Do not check python modules on configure @<:@default=enable@:>@])],
[],
[enable_python_check="yes"])
AM_CONDITIONAL([ENABLE_PYTHON_CHECK], [test "$enable_python_check" = "yes"])
dnl Check for Python modules
if test "x$enable_python_check" = "xyes"; then
AX_PYTHON_MODULE([sqlalchemy], [1])
AX_PYTHON_MODULE([MySQLdb], [1])
AX_PYTHON_MODULE([ldap], [1])
AX_PYTHON_MODULE([OpenSSL], [1])
AX_PYTHON_MODULE([multiprocessing], [1])
AX_PYTHON_MODULE([gobject], [1])
fi
dnl
dnl --disable-conf
dnl Disable configuration files installation
dnl
AC_ARG_ENABLE([conf],
[AS_HELP_STRING([--disable-conf],
[Disable configuration files installation @<:@default=enable@:>@])],
[],
[enable_conf="yes"])
AM_CONDITIONAL([ENABLE_CONF], [test "$enable_conf" = "yes"])
dnl
dnl --disable-conf-backup
dnl Disable backup configuration file
dnl
AC_ARG_ENABLE([conf-backup],
[AS_HELP_STRING([--disable-conf-backup],
[Disable configuration files backup, if any @<:@default=enable@:>@])],
[],
[enable_conf_backup="yes"])
AM_CONDITIONAL([ENABLE_CONF_BACKUP], [test "$enable_conf_backup" = "yes"])
dnl
dnl --with-initdir
dnl Set path to init scripts directory
dnl Default to SYSCONFDIR/init.d
dnl
AC_ARG_WITH([initdir],
[AS_HELP_STRING([--with-initdir],
[path to init scripts directory @<:@default=SYSCONFDIR/init.d@:>@])],
[initdir="$withval"],
[initdir="${sysconfdir}/init.d"])
AC_SUBST([initdir])
dnl
dnl --with-systemddir
dnl Set path to systemd services directory
dnl Default to /lib/systemd/system
dnl
AC_ARG_WITH([systemddir],
[AS_HELP_STRING([--with-systemddir],
[path to systemd services directory @<:@default=/lib/systemd/system@:>@])],
[systemddir="$withval"],
[systemddir="/lib/systemd/system"])
AC_SUBST([systemddir])
dnl files to generate with automake
AC_CONFIG_FILES([Makefile])
AC_CONFIG_FILES([agent/Makefile])
AC_CONFIG_FILES([agent/bin/Makefile])
AC_CONFIG_FILES([agent/mmc/Makefile])
AC_CONFIG_FILES([agent/backup-tools/Makefile])
AC_CONFIG_FILES([agent/init/Makefile])
AC_CONFIG_FILES([agent/conf/Makefile])
AC_CONFIG_FILES([agent/contrib/Makefile])
AC_CONFIG_FILES([agent/man/Makefile])
AC_CONFIG_FILES([web/Makefile])
AC_CONFIG_FILES([web/confs/Makefile])
dnl write all stuff
AC_OUTPUT
dnl Warn user sysconfdir is not /etc, if necessary.
make confwarning