Statistics
| Branch: | Tag: | Revision:

root / snf-image-host / configure.ac @ 2187080b

History | View | Annotate | Download (5.7 kB)

1
AC_PREREQ(2.59)
2
AC_INIT(snf-image, 0.6.5, 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-multistrap-aptprefdir
59
AC_ARG_WITH([multistrap-aptprefdir],
60
  [AS_HELP_STRING([--with-multistrap-aptprefdir=MULTISTRAP_APTPREFDIR],
61
      [path to a directory where preferences files for apt are hosted. Those files will be used during multistrap
62
      [SYSCONFDIR/snf-image/apt.pref.d]]
63
    )],
64
    [if test "$withval" != "yes" -a "$withval" != "no"; then
65
	multistrap_aptprefdir="$withval"
66
        AC_MSG_NOTICE(using apt preferences directory for multistrap: $withval)
67
     elif test "$withval" != "no"; then
68
         AC_MSG_ERROR([you must specify a directory if --with-multistrap-aptprefdir is specified])
69
    fi],
70
    [multistrap_aptprefdir="$sysconfdir/snf-image/apt.pref.d"]
71
)
72
AC_SUBST(MULTISTRAP_APTPREFDIR, $multistrap_aptprefdir)
73

    
74
# --with-helper-dir
75
AC_ARG_WITH([helper-dir],
76
    [AS_HELP_STRING([--with-helper-dir=DIR],
77
        [top-level directory to host the helper VM
78
        [LOCALSTATEDIR/lib/snf-image/helper]]
79
    )],
80
    [helper_dir="$withval"],
81
    [helper_dir="$localstatedir/lib/snf-image/helper"])
82
AC_SUBST(HELPER_DIR, $helper_dir)
83

    
84
# --with-helper-img
85
AC_ARG_WITH([helper-img],
86
    [AS_HELP_STRING([--with-helper-img=IMG_PATH],
87
        [Path to helper VM image [HELPERDIR/image]]
88
    )],
89
    [helper_img="$withval"],
90
    [helper_img="$helper_dir/image"])
91
AC_SUBST(HELPER_IMG, $helper_img)
92

    
93
# --with-helper-kernel
94
AC_ARG_WITH([helper-kernel],
95
    [AS_HELP_STRING([--with-helper-kernel=KERNEL_PATH],
96
        [Path to the helper VM kernel [HELPERDIR/kernel]]
97
    )],
98
    [helper_ernel="$withval"],
99
    [helper_kernel="$helper_dir/kernel"])
100
AC_SUBST(HELPER_KERNEL, ${helper_kernel})
101

    
102
# --with-helper-initrd..
103
AC_ARG_WITH([helper-initrd],
104
    [AS_HELP_STRING([--with-helper-initrd=INITRD_PATH],
105
        [Path to the helper VM initial ramdist [HELPERDIR/initrd]]
106
    )],
107
    [helper_initrd="$withval"],
108
    [helper_initrd="$helper_dir/initrd"])
109
AC_SUBST(HELPER_INITRD, ${helper_initrd})
110

    
111
# --with-os-dir=...
112
AC_ARG_WITH([os-dir],
113
    [AS_HELP_STRING([--with-os-dir=DIR],
114
        [top-level OS directory under which to install [DATADIR/ganeti/os]]
115
    )],
116
    [os_dir="$withval"],
117
    [os_dir="$datadir/ganeti/os"])
118
AC_SUBST(OS_DIR, $os_dir)
119

    
120
# --with-default-dir=...
121
AC_ARG_WITH([default-dir],
122
    [AS_HELP_STRING([--with-default-dir=DIR],
123
        [top-level default config directory under which to install]
124
        [ [SYSCONFDIR/default]]
125
    )],
126
    [default_dir="$withval"],
127
    [default_dir="$sysconfdir/default"])
128
AC_SUBST(DEFAULT_DIR, $default_dir)
129

    
130
# Check common programs
131
AC_PROG_INSTALL
132
AC_PROG_LN_S
133
AC_PROG_AWK
134
AC_PROG_MKDIR_P
135

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

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

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

    
151
AC_PATH_PROG(QEMU_IMG, [qemu-img], [], [$PATH:/usr/sbin:/sbin])
152
if test -z "$QEMU_IMG" ; then
153
  AC_MSG_ERROR([qemu-img not found in $PATH:/usr/sbin:/sbin])
154
fi
155

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

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

    
166
AC_PATH_PROG(CURL, [curl], [], [$PATH:/usr/sbin:/sbin])
167
if test -z "$CURL" ; then
168
  AC_MSG_ERROR([curl not found in $PATH:/usr/sbin:/sbin])
169
fi
170

    
171
AC_CONFIG_FILES([
172
    Makefile
173
])
174

    
175
AC_OUTPUT
176

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