-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.ac
96 lines (87 loc) · 2.64 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
# Configure autoconf
#
AC_INIT([sanbootable], [0.3], [[email protected]])
AC_CONFIG_SRCDIR([src/initramfs/iscsi.initramfs])
AC_CONFIG_AUX_DIR([build-aux])
AM_INIT_AUTOMAKE([foreign subdir-objects tar-ustar])
# Define distribution selections
#
AC_ARG_ENABLE([redhat],
AS_HELP_STRING([--enable-redhat],
[enable all Red Hat features]))
AC_ARG_ENABLE([ubuntu],
AS_HELP_STRING([--enable-ubuntu],
[enable all Ubuntu features]))
# Define individual feature selections
#
AC_ARG_ENABLE([finalrd],
AS_HELP_STRING([--disable-finalrd],
[disable finalrd hook]))
AC_ARG_ENABLE([grub-initrd-fallback],
AS_HELP_STRING([--disable-grub-initrd-fallback],
[disable GRUB initrd fallback hook]))
AC_ARG_ENABLE([initramfs],
AS_HELP_STRING([--disable-initramfs],
[disable initramfs hook]))
# Determine current distribution if none explicitly specified
#
AS_IF([test "x$enable_redhat$enable_ubuntu" = "x"], [
AS_IF([test -e /etc/lsb-release], [source /etc/lsb-release])
AS_IF(AS_EXECUTABLE_P([/usr/bin/lsb_release]),
[DISTRIB_ID=$(/usr/bin/lsb_release -s -i)])
AS_IF([test -e /etc/redhat-release], [default_redhat=yes])
AS_IF([test "x$DISTRIB_ID" = "xUbuntu"], [default_ubuntu=yes])
])
# Test for individual distribution selections
#
AS_IF([test "x$enable_redhat" = "x"],
[enable_redhat=$default_redhat])
AS_IF([test "x$enable_ubuntu" = "x"],
[enable_ubuntu=$default_ubuntu])
# Disable all features by default
#
default_dracut=no
default_finalrd=no
default_grub_initrd_fallback=no
default_initramfs=no
# Set feature defaults per distribution
#
AS_IF([test "x$enable_redhat" = "xyes"], [
default_dracut=yes
])
AS_IF([test "x$enable_ubuntu" = "xyes"], [
default_finalrd=yes
default_grub_initrd_fallback=yes
default_initramfs=yes
])
# Test for individual feature selections
#
AS_IF([test "x$enable_dracut" = "x"],
[enable_dracut=$default_dracut])
AS_IF([test "x$enable_finalrd" = "x"],
[enable_finalrd=$default_finalrd])
AS_IF([test "x$enable_grub_initrd_fallback" = "x"],
[enable_grub_initrd_fallback=$default_grub_initrd_fallback])
AS_IF([test "x$enable_initramfs" = "x"],
[enable_initramfs=$default_initramfs])
# Define automake conditionals
#
AM_CONDITIONAL([DRACUT],
[test "x$enable_dracut" = "xyes"])
AM_CONDITIONAL([FINALRD],
[test "x$enable_finalrd" = "xyes"])
AM_CONDITIONAL([GRUBINITRDFALLBACK],
[test "x$enable_grub_initrd_fallback" = "xyes"])
AM_CONDITIONAL([INITRAMFS],
[test "x$enable_initramfs" = "xyes"])
# Generate output files
#
AC_CONFIG_FILES([
Makefile
src/Makefile
src/dracut/Makefile
src/finalrd/Makefile
src/grub-initrd-fallback/Makefile
src/initramfs/Makefile
])
AC_OUTPUT