configure.ac 4.6 KB
Newer Older
Nikos Skalkotos's avatar
Nikos Skalkotos committed
1
AC_PREREQ(2.59)
2
AC_INIT(snf-image, 0.3.3, synnefo@lists.grnet.gr)
Nikos Skalkotos's avatar
Nikos Skalkotos committed
3
4
5
6
7
8
9

AC_CONFIG_AUX_DIR(autotools)
AC_CONFIG_SRCDIR(configure)

AM_INIT_AUTOMAKE([1.9 foreign tar-ustar -Wall -Wno-portability])
AM_INIT_AUTOMAKE([subdir-objects])

10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
AC_ARG_ENABLE([pithos_backend],
   AS_HELP_STRING([--enable-pithos-backend],
    [enable support for pithos-hosted images])
)
AS_IF([test "x$enable_pithos_backend" = "xyes"],,
    [AC_MSG_NOTICE(pithos backend support not enabled)])
AM_CONDITIONAL(PITHOSIMGSUPPORT, [test "x$enable_pithos_backend" = "xyes"])

AC_ARG_ENABLE([network_backend],
   AS_HELP_STRING([--enable-network-backend],
    [enable support for network-hosted images
    (this depends on cURL)])
)
AS_IF([test "x$enable_network_backend" = "xyes"],,
    [AC_MSG_NOTICE(network backend support not enabled)])
AM_CONDITIONAL(NETWORKIMGSUPPORT, [test "x$enable_network_backend" = "xyes"])

Nikos Skalkotos's avatar
Nikos Skalkotos committed
27
28
29
30
31
32
# --with-progress-monitor
AC_ARG_WITH([progress-monitor],
  [AS_HELP_STRING([--with-progress-monitor=PRGRM_PATH],
    [path to progress-monitor program]
    [[snf-progress-monitor]])],
    [if test "$withval" = "yes" ; then
33
34
35
36
37
38
39
         AC_PATH_PROG(PROGRESS_MONITOR, [snf-progress-monitor], [], [$PATH:/usr/sbin:/sbin])
         if test -z "$PROGRESS_MONITOR" ; then
             AC_MSG_FAILURE([Could not find snf-progress-monitor.])
         fi
     else
         PROGRESS_MONITOR="$withval"
    fi],
Nikos Skalkotos's avatar
Nikos Skalkotos committed
40
41
42
43
44
   [AC_MSG_NOTICE(progress-monitor support not enabled)]
)

AM_CONDITIONAL(PROGMONSUPPORT, [test -n "$PROGRESS_MONITOR"])

45
46
47
48
49
# --with-helper-dir
AC_ARG_WITH([helper-dir],
    [AS_HELP_STRING([--with-helper-dir=DIR],
        [top-level directory to host the helper VM
        [LOCALSTATEDIR/lib/snf-image/helper]]
50
    )],
51
52
53
54
55
56
57
58
59
60
61
62
    [helper_dir="$withval"],
    [helper_dir="$localstatedir/lib/snf-image/helper"])
AC_SUBST(HELPER_DIR, $helper_dir)

# --with-helper-img
AC_ARG_WITH([helper-img],
    [AS_HELP_STRING([--with-helper-img=IMG_PATH],
        [Path to helper VM image [HELPERDIR/image]]
    )],
    [helper_img="$withval"],
    [helper_img="$helper_dir/image"])
AC_SUBST(HELPER_IMG, $helper_img)
63

64
# --with-helper-kernel
65
AC_ARG_WITH([helper-kernel],
66
    [AS_HELP_STRING([--with-helper-kernel=KERNEL_PATH],
67
        [Path to the helper VM kernel [HELPERDIR/kernel]]
68
69
    )],
    [helper_ernel="$withval"],
70
    [helper_kernel="$helper_dir/kernel"])
71
72
73
AC_SUBST(HELPER_KERNEL, ${helper_kernel})

# --with-helper-initrd..
74
AC_ARG_WITH([helper-initrd],
75
    [AS_HELP_STRING([--with-helper-initrd=INITRD_PATH],
76
        [Path to the helper VM initial ramdist [HELPERDIR/initrd]]
77
78
    )],
    [helper_initrd="$withval"],
79
    [helper_initrd="$helper_dir/initrd"])
80
81
AC_SUBST(HELPER_INITRD, ${helper_initrd})

Nikos Skalkotos's avatar
Nikos Skalkotos committed
82
83
84
# --with-os-dir=...
AC_ARG_WITH([os-dir],
    [AS_HELP_STRING([--with-os-dir=DIR],
85
        [top-level OS directory under which to install [DATADIR/ganeti/os]]
Nikos Skalkotos's avatar
Nikos Skalkotos committed
86
87
88
89
90
91
92
93
94
    )],
    [os_dir="$withval"],
    [os_dir="$datadir/ganeti/os"])
AC_SUBST(OS_DIR, $os_dir)

# --with-default-dir=...
AC_ARG_WITH([default-dir],
    [AS_HELP_STRING([--with-default-dir=DIR],
        [top-level default config directory under which to install]
95
        [ [SYSCONFDIR/default]]
Nikos Skalkotos's avatar
Nikos Skalkotos committed
96
97
98
99
100
101
102
103
104
105
106
107
108
    )],
    [default_dir="$withval"],
    [default_dir="$sysconfdir/default"])
AC_SUBST(DEFAULT_DIR, $default_dir)

# Check common programs
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_AWK
AC_PROG_MKDIR_P

AC_PATH_PROG(LOSETUP, [losetup], [], [$PATH:/usr/sbin:/sbin])
if test -z "$LOSETUP" ; then
109
  AC_MSG_ERROR([losetup not found in $PATH:/usr/sbin:/sbin])
Nikos Skalkotos's avatar
Nikos Skalkotos committed
110
111
112
113
fi

AC_PATH_PROG(KPARTX, [kpartx], [], [$PATH:/usr/sbin:/sbin])
if test -z "$KPARTX" ; then
114
  AC_MSG_ERROR([kpartx not found in $PATH:/usr/sbin:/sbin])
Nikos Skalkotos's avatar
Nikos Skalkotos committed
115
116
117
118
fi

AC_PATH_PROG(SFDISK, [sfdisk], [], [$PATH:/usr/sbin:/sbin])
if test -z "$SFDISK" ; then
119
120
121
  AC_MSG_ERROR([sfdisk not found in $PATH:/usr/sbin:/sbin])
fi

122
123
124
125
126
AC_PATH_PROG(QEMU_IMG, [qemu-img], [], [$PATH:/usr/sbin:/sbin])
if test -z "$QEMU_IMG" ; then
  AC_MSG_ERROR([qemu-img not found in $PATH:/usr/sbin:/sbin])
fi

127
128
129
130
131
AC_PATH_PROG(INSTALL_MBR, [install-mbr], [], [$PATH:/usr/sbin:/sbin])
if test -z "$INSTALL_MBR" ; then
  AC_MSG_ERROR([install-mbr not found in $PATH:/usr/sbin:/sbin])
fi

132
133
134
AC_PATH_PROG(TIMELIMIT, [timelimit], [], [$PATH:/usr/sbin:/sbin])
if test -z "$TIMELIMIT" ; then
  AC_MSG_ERROR([timelimit not found in $PATH:/usr/sbin:/sbin])
Nikos Skalkotos's avatar
Nikos Skalkotos committed
135
136
fi

137
138
139
140
141
142
143
if test "x$enable_network_backend" = "xyes" ; then
  AC_PATH_PROG(CURL, [curl], [], [$PATH:/usr/sbin:/sbin])
    if test -z "$CURL" ; then
      AC_MSG_ERROR([curl is needed for network backend support but was not \
      found in $PATH:/usr/sbin:/sbin]
      [To disable network backend support ommit --enable-network-backend])
    fi
Nikos Skalkotos's avatar
Nikos Skalkotos committed
144
145
fi

Nikos Skalkotos's avatar
Nikos Skalkotos committed
146
147
148
149
150
151
152
153
AC_CONFIG_FILES([
    Makefile
])

AC_OUTPUT

# vim: set sta sts=4 shiftwidth=4 sw=4 et ai :