forked from openSUSE/snapper
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfigure.ac
125 lines (95 loc) · 4.14 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
AC_INIT(snapper/Snapper.h)
VERSION=`cat ./VERSION`
LIBVERSION=`cat ./LIBVERSION`
LIBVERSION_MAJOR=`cut -d . -f 1 ./LIBVERSION`
LIBVERSION_MINOR=`cut -d . -f 2 ./LIBVERSION`
LIBVERSION_PATCHLEVEL=`cut -d . -f 3 ./LIBVERSION`
LIBVERSION_CURRENT=`expr $LIBVERSION_MAJOR + $LIBVERSION_MINOR`
LIBVERSION_REVISON=`expr $LIBVERSION_PATCHLEVEL`
LIBVERSION_AGE=`expr $LIBVERSION_MINOR`
LIBVERSION_INFO=$LIBVERSION_CURRENT:$LIBVERSION_REVISON:$LIBVERSION_AGE
AM_INIT_AUTOMAKE(snapper, $VERSION)
AM_CONFIG_HEADER(config.h)
AC_DISABLE_STATIC
AC_PROG_CXX
AC_PROG_LIBTOOL
AM_PROG_LIBTOOL
AC_PREFIX_DEFAULT(/usr)
AC_PATH_PROG([CHSNAPBIN], [chsnap], [/sbin/chsnap])
AC_PATH_PROG([CPBIN], [cp], [/bin/cp])
AC_PATH_PROG([TOUCHBIN], [touch], [/usr/bin/touch])
AC_PATH_PROG([RMBIN], [rm], [/bin/rm])
AC_PATH_PROG([DIFFBIN], [diff], [/usr/bin/diff])
AC_PATH_PROG([CHATTRBIN], [chattr], [/usr/bin/chattr])
AC_PATH_PROG([LVCREATEBIN], [lvcreate], [/sbin/lvcreate])
AC_PATH_PROG([LVREMOVEBIN], [lvremove], [/sbin/lvremove])
AC_PATH_PROG([LVSBIN], [lvs], [/sbin/lvs])
AC_DEFINE_UNQUOTED([CHSNAPBIN], ["$CHSNAPBIN"], [Path of chsnap program.])
AC_DEFINE_UNQUOTED([CPBIN], ["$CPBIN"], [Path of cp program.])
AC_DEFINE_UNQUOTED([TOUCHBIN], ["$TOUCHBIN"], [Path of touch program.])
AC_DEFINE_UNQUOTED([RMBIN], ["$RMBIN"], [Path of rm program.])
AC_DEFINE_UNQUOTED([DIFFBIN], ["$DIFFBIN"], [Path of diff program.])
AC_DEFINE_UNQUOTED([CHATTRBIN], ["$CHATTRBIN"], [Path of chattr program.])
AC_DEFINE_UNQUOTED([LVCREATEBIN], ["$LVCREATEBIN"], [Path of lvcreate program.])
AC_DEFINE_UNQUOTED([LVREMOVEBIN], ["$LVREMOVEBIN"], [Path of lvremove program.])
AC_DEFINE_UNQUOTED([LVSBIN], ["$LVSBIN"], [Path of lvs program.])
dnl Automake 1.11 enables silent compilation
dnl Disable it by "configure --disable-silent-rules" or "make V=1"
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
CFLAGS="${CFLAGS} -Wall -Wformat=2 -Wmissing-prototypes"
CXXFLAGS="${CXXFLAGS} -std=c++0x -Wall -Wextra -Wformat=2 -Wnon-virtual-dtor -Wno-unused-parameter"
fillupdir=/var/adm/fillup-templates
AC_ARG_WITH([conf], AC_HELP_STRING([--with-conf], [Use a custom sysconfig directory (default is /etc/sysconfig)]),
[with_conf=$withval], [with_conf=no])
AS_IF([test "x$with_conf" != xno], [CPPFLAGS="${CPPFLAGS} -DCONFDIR='\"${with_conf}\"'"],
[CPPFLAGS="${CPPFLAGS} -DCONFDIR='\"/etc/sysconfig\"'"])
AC_ARG_ENABLE([btrfs], AC_HELP_STRING([--disable-btrfs],[Disable Btrfs internal snapshots support]),
[with_btrfs=$enableval],[with_btrfs=yes])
AM_CONDITIONAL(ENABLE_BTRFS, [test "x$with_btrfs" = "xyes"])
if test "x$with_btrfs" = "xyes"; then
AC_DEFINE(ENABLE_BTRFS, 1, [Enable Btrfs internal snapshots support])
fi
AC_ARG_ENABLE([ext4], AC_HELP_STRING([--disable-ext4],[Disable ext4 snapshots support]),
[with_ext4=$enableval],[with_ext4=yes])
AM_CONDITIONAL(ENABLE_EXT4, [test "x$with_ext4" = "xyes"])
if test "x$with_ext4" = "xyes"; then
AC_DEFINE(ENABLE_EXT4, 1, [Enable Ext4 snapshots support])
fi
AC_ARG_ENABLE([lvm], AC_HELP_STRING([--disable-lvm],[Disable LVM thinprovisioned snapshots support]),
[with_lvm=$enableval],[with_lvm=yes])
AM_CONDITIONAL(ENABLE_LVM, [test "x$with_lvm" = "xyes"])
if test "x$with_lvm" = "xyes"; then
AC_DEFINE(ENABLE_LVM, 1, [Enable LVM thin-provisioned snapshots support])
fi
if test "x$with_btrfs" != "xyes" -a "x$with_lvm" != "xyes" -a "x$with_ext4" != "xyes"; then
AC_MSG_ERROR([You have to enable at least one snapshot type (remove some --disable-xxx parameter)])
fi
AC_ARG_ENABLE([zypp], AC_HELP_STRING([--disable-zypp],[Disable zypp plugin support]),
[with_zypp=$enableval],[with_zypp=yes])
AM_CONDITIONAL(HAVE_ZYPP, [test "$with_zypp" != "no"])
AC_CHECK_LIB(btrfs, btrfs_read_and_process_send_stream)
PKG_CHECK_MODULES(DBUS, dbus-1)
AC_SUBST(VERSION)
AC_SUBST(LIBVERSION_MAJOR)
AC_SUBST(LIBVERSION_INFO)
AC_SUBST(docdir)
AC_SUBST(fillupdir)
AC_OUTPUT(
Makefile
snapper/Makefile
examples/Makefile
examples/C/Makefile
dbus/Makefile
server/Makefile
client/Makefile
client/utils/Makefile
scripts/Makefile
data/Makefile
doc/Makefile
doc/snapper.8:doc/snapper.8.in
doc/snapperd.8:doc/snapperd.8.in
po/Makefile
testsuite-real/Makefile
testsuite-cmp/Makefile
package/snapper.spec:snapper.spec.in
)