Statistics
| Branch: | Tag: | Revision:

root / snf-image-host / configure.ac @ 53a5929f

History | View | Annotate | Download (5.3 kB)

1
AC_PREREQ(2.59)
2
AC_INIT(snf-image, 0.6, synnefo@lists.grnet.gr)
3

    
4
AC_CONFIG_AUX_DIR(autotools)
5
AC_CONFIG_SRCDIR(configure)
6

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

    
10
AC_ARG_ENABLE([network_backend],
11
   AS_HELP_STRING([--enable-network-backend],
12
    [enable support for network-hosted images
13
    (this depends on cURL)])
14
)
15

    
16
# --with-progress-monitor
17
AC_ARG_WITH([progress-monitor],
18
  [AS_HELP_STRING([--with-progress-monitor=PRGRM],
19
    [name of the progress-monitor program []])],
20
    [if test "$withval" != "yes" -a "$withval" != "no"; then
21
         AC_PATH_PROG(PROGRESS_MONITOR, ["$withval"], [], [$PATH:/usr/sbin:/sbin])
22
         if test -z "$PROGRESS_MONITOR" ; then
23
             AC_MSG_FAILURE([Could not find progress-monitor: $withval.])
24
         fi
25
     elif test "$withval" != "no"; then
26
         AC_MSG_ERROR([you must specify a value for progress-monitor if --with-progress-monitor is specified])
27
    fi]
28
)
29

    
30
# --with-unattend-file
31
AC_ARG_WITH([unattend-file],
32
  [AS_HELP_STRING([--with-unattend-file=UNATTEND_PATH],
33
    [path to unattend.xml windows setup file []])],
34
    [if test "$withval" != "yes" -a "$withval" != "no"; then
35
	AC_SUBST(UNATTEND, "$withval")
36
        AC_MSG_NOTICE(using unattend file: $withval)
37
     elif test "$withval" != "no"; then
38
         AC_MSG_ERROR([you must specify an Unattend.xml file if --with-unattend-file is specified])
39
    fi]
40
)
41

    
42
# --with-multistrap-config
43
AC_ARG_WITH([multistrap-config],
44
  [AS_HELP_STRING([--with-multistrap-config=MULTISTRAP_CONFIG_PATH],
45
      [path to a multistrap configuration file
46
      [SYSCONFDIR/snf-image/multistrap.conf]]
47
    )],
48
    [if test "$withval" != "yes" -a "$withval" != "no"; then
49
	multistrap_config="$withval"
50
        AC_MSG_NOTICE(using multistrap configuration file: $withval)
51
     elif test "$withval" != "no"; then
52
         AC_MSG_ERROR([you must specify an configuration file if --with-multistrap-config is specified])
53
    fi],
54
    [multistrap_config="$sysconfdir/snf-image/multistrap.conf"]
55
)
56
AC_SUBST(MULTISTRAP_CONFIG, $multistrap_config)
57

    
58
# --with-helper-dir
59
AC_ARG_WITH([helper-dir],
60
    [AS_HELP_STRING([--with-helper-dir=DIR],
61
        [top-level directory to host the helper VM
62
        [LOCALSTATEDIR/lib/snf-image/helper]]
63
    )],
64
    [helper_dir="$withval"],
65
    [helper_dir="$localstatedir/lib/snf-image/helper"])
66
AC_SUBST(HELPER_DIR, $helper_dir)
67

    
68
# --with-helper-cache-dir
69
AC_ARG_WITH([helper-cache-dir],
70
    [AS_HELP_STRING([--with-helper-cache-dir=DIR],
71
        [top-level directory to host the helper VM cache files
72
        [LOCALSTATEDIR/cache/snf-image/helper]]
73
    )],
74
    [helper_cache_dir="$withval"],
75
    [helper_cache_dir="$localstatedir/cache/snf-image/helper"])
76
AC_SUBST(HELPER_CACHE_DIR, $helper_cache_dir)
77

    
78
# --with-helper-img
79
AC_ARG_WITH([helper-img],
80
    [AS_HELP_STRING([--with-helper-img=IMG_PATH],
81
        [Path to helper VM image [HELPERDIR/image]]
82
    )],
83
    [helper_img="$withval"],
84
    [helper_img="$helper_dir/image"])
85
AC_SUBST(HELPER_IMG, $helper_img)
86

    
87
# --with-helper-kernel
88
AC_ARG_WITH([helper-kernel],
89
    [AS_HELP_STRING([--with-helper-kernel=KERNEL_PATH],
90
        [Path to the helper VM kernel [HELPERDIR/kernel]]
91
    )],
92
    [helper_ernel="$withval"],
93
    [helper_kernel="$helper_dir/kernel"])
94
AC_SUBST(HELPER_KERNEL, ${helper_kernel})
95

    
96
# --with-helper-initrd..
97
AC_ARG_WITH([helper-initrd],
98
    [AS_HELP_STRING([--with-helper-initrd=INITRD_PATH],
99
        [Path to the helper VM initial ramdist [HELPERDIR/initrd]]
100
    )],
101
    [helper_initrd="$withval"],
102
    [helper_initrd="$helper_dir/initrd"])
103
AC_SUBST(HELPER_INITRD, ${helper_initrd})
104

    
105
# --with-os-dir=...
106
AC_ARG_WITH([os-dir],
107
    [AS_HELP_STRING([--with-os-dir=DIR],
108
        [top-level OS directory under which to install [DATADIR/ganeti/os]]
109
    )],
110
    [os_dir="$withval"],
111
    [os_dir="$datadir/ganeti/os"])
112
AC_SUBST(OS_DIR, $os_dir)
113

    
114
# --with-default-dir=...
115
AC_ARG_WITH([default-dir],
116
    [AS_HELP_STRING([--with-default-dir=DIR],
117
        [top-level default config directory under which to install]
118
        [ [SYSCONFDIR/default]]
119
    )],
120
    [default_dir="$withval"],
121
    [default_dir="$sysconfdir/default"])
122
AC_SUBST(DEFAULT_DIR, $default_dir)
123

    
124
# Check common programs
125
AC_PROG_INSTALL
126
AC_PROG_LN_S
127
AC_PROG_AWK
128
AC_PROG_MKDIR_P
129

    
130
AC_PATH_PROG(LOSETUP, [losetup], [], [$PATH:/usr/sbin:/sbin])
131
if test -z "$LOSETUP" ; then
132
  AC_MSG_ERROR([losetup not found in $PATH:/usr/sbin:/sbin])
133
fi
134

    
135
AC_PATH_PROG(KPARTX, [kpartx], [], [$PATH:/usr/sbin:/sbin])
136
if test -z "$KPARTX" ; then
137
  AC_MSG_ERROR([kpartx not found in $PATH:/usr/sbin:/sbin])
138
fi
139

    
140
AC_PATH_PROG(SFDISK, [sfdisk], [], [$PATH:/usr/sbin:/sbin])
141
if test -z "$SFDISK" ; then
142
  AC_MSG_ERROR([sfdisk not found in $PATH:/usr/sbin:/sbin])
143
fi
144

    
145
AC_PATH_PROG(QEMU_IMG, [qemu-img], [], [$PATH:/usr/sbin:/sbin])
146
if test -z "$QEMU_IMG" ; then
147
  AC_MSG_ERROR([qemu-img not found in $PATH:/usr/sbin:/sbin])
148
fi
149

    
150
AC_PATH_PROG(INSTALL_MBR, [install-mbr], [], [$PATH:/usr/sbin:/sbin])
151
if test -z "$INSTALL_MBR" ; then
152
  AC_MSG_ERROR([install-mbr not found in $PATH:/usr/sbin:/sbin])
153
fi
154

    
155
AC_PATH_PROG(TIMEOUT, [timeout], [], [$PATH:/usr/sbin:/sbin])
156
if test -z "$TIMEOUT" ; then
157
  AC_MSG_ERROR([timeout not found in $PATH:/usr/sbin:/sbin])
158
fi
159

    
160
AC_PATH_PROG(CURL, [curl], [], [$PATH:/usr/sbin:/sbin])
161
if test -z "$CURL" ; then
162
  AC_MSG_ERROR([curl not found in $PATH:/usr/sbin:/sbin])
163
fi
164

    
165
AC_CONFIG_FILES([
166
    Makefile
167
])
168

    
169
AC_OUTPUT
170

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