This repository has been archived by the owner on Mar 31, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
/
configure.ac
137 lines (122 loc) · 4.13 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
126
127
128
129
130
131
132
133
134
135
136
137
dnl Copyright (C) 2024 ChenPi11.
dnl This file is part of the MinimalLinux.
dnl
dnl MinimalLinux is free software: you can redistribute it and/or modify
dnl it under the terms of the GNU General Public License as published
dnl by the Free Software Foundation; either version 2 of the License,
dnl or (at your option) any later version.
dnl
dnl MinimalLinux is distributed in the hope that it will be useful,
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
dnl GNU General Public License for more details.
dnl
dnl You should have received a copy of the GNU General Public License
dnl along with this program. If not, see <https://www.gnu.org/licenses/>.
AC_PREREQ([2.64])
AC_INIT([MinimalLinux], [0.1])
AC_PROG_MAKE_SET
dnl Checks for basic programs.
AC_PROG_CC
AC_PATH_PROG([STRIP], [strip], [:])
dnl Checks for programs.
CL_PROG_CP
CL_PROG_LN
AC_PROG_LN_S
AC_PATH_PROG([CHMOD], [chmod])
AC_PATH_PROG([CHOWN], [chown])
AC_PATH_PROG([CPIO], [cpio])
AC_PATH_PROG([FDISK], [fdisk])
AC_PATH_PROG([FIND], [find])
AC_PATH_PROG([GRUB_INSTALL], [grub-install])
AC_PATH_PROG([KPARTX], [kpartx])
AC_PATH_PROG([LOSETUP], [losetup])
AC_PATH_PROG([MKDIR], [mkdir])
AC_PATH_PROG([MKFS_EXT2], [mkfs.ext2])
AC_PATH_PROG([MKNOD], [mknod])
AC_PATH_PROG([MOUNT], [mount])
AC_PATH_PROG([PATCH], [patch])
AC_PATH_PROG([PYTHON], [python])
if test -z "$PYTHON"; then
AC_PATH_PROG([PYTHON], [python3])
fi
AC_SUBST([PYTHON])
AC_PATH_PROG([QEMU_IMG], [qemu-img])
AC_PATH_PROG([RM], [rm])
AC_PATH_PROG([SUDO], [sudo])
AC_PATH_PROG([TAR], [tar])
AC_PATH_PROG([UMOUNT], [umount])
AC_PATH_PROG([WGET], [wget])
AC_PATH_PROG([XZ], [xz])
dnl Version options.
AC_ARG_WITH([busybox-version],
[AS_HELP_STRING([--with-busybox-version=X.X.X],
[define the version of BusyBox])],
[BUSYBOX_VERSION=$withval],
[BUSYBOX_VERSION=1.36.1]
)
AC_SUBST([BUSYBOX_VERSION])
AC_ARG_WITH([linux-version],
[AS_HELP_STRING([--with-linux-version=X.X.X],
[define the version of Linux kernel])],
[LINUX_VERSION=$withval],
[LINUX_VERSION=6.7.9]
)
LINUX_VERSION_MAJOR=$(echo $LINUX_VERSION | cut -d. -f1)
AC_SUBST([LINUX_VERSION])
AC_SUBST([LINUX_VERSION_MAJOR])
AC_ARG_WITH([musl-version],
[AS_HELP_STRING([--with-musl-version=X.X.X],
[define the version of musl libc])],
[MUSL_VERSION=$withval],
[MUSL_VERSION=1.2.5]
)
AC_SUBST([MUSL_VERSION])
dnl Mirror options.
AC_ARG_WITH([linux-mirror],
[AS_HELP_STRING([--with-linux-mirror=OFFICIAL | CDN | TSINGHUA | ALIYUN | USTC | <URL>],
[define the mirror of Linux kernel])],
[LINUX_MIRROR=$withval],
[LINUX_MIRROR=OFFICIAL]
)
dnl Use '[[', ']]' instead of '[', ']' to avoid Autoconf interpreting.
LINUX_MIRROR_CHECK=$(echo "$LINUX_MIRROR" | tr "[[:lower:]]" "[[:upper:]]")
LINUX_MIRROR_CUSTOME=
if test "$LINUX_MIRROR_CHECK" != "OFFICIAL" -a "$LINUX_MIRROR_CHECK" != "CDN" -a "$LINUX_MIRROR_CHECK" != "TSINGHUA" -a "$LINUX_MIRROR_CHECK" != "ALIYUN" -a "$LINUX_MIRROR_CHECK" != "USTC"; then
LINUX_MIRROR_CUSTOME=$LINUX_MIRROR
LINUX_MIRROR=CUSTOME
fi
AC_SUBST([LINUX_MIRROR])
AC_SUBST([LINUX_MIRROR_CUSTOME])
AC_ARG_WITH([busybox-mirror],
[AS_HELP_STRING([--with-busybox-mirror=OFFICIAL | <URL>],
[define the mirror of BusyBox])],
[BUSYBOX_MIRROR=$withval],
[BUSYBOX_MIRROR=OFFICIAL]
)
BUSYBOX_MIRROR_CHECK=$(echo "$BUSYBOX_MIRROR" | tr "[[:lower:]]" "[[:upper:]]")
BUSYBOX_MIRROR_CUSTOME=
if test "$BUSYBOX_MIRROR_CHECK" != "OFFICIAL"; then
BUSYBOX_MIRROR_CUSTOME=$BUSYBOX_MIRROR
BUSYBOX_MIRROR=CUSTOME
fi
AC_SUBST([BUSYBOX_MIRROR])
AC_SUBST([BUSYBOX_MIRROR_CUSTOME])
AC_ARG_WITH([musl-mirror],
[AS_HELP_STRING([--with-musl-mirror=OFFICIAL | <URL>],
[define the mirror of musl libc])],
[MUSL_MIRROR=$withval],
[MUSL_MIRROR=OFFICIAL]
)
MUSL_MIRROR_CHECK=$(echo "$MUSL_MIRROR" | tr "[[:lower:]]" "[[:upper:]]")
MUSL_MIRROR_CUSTOME=
if test "$MUSL_MIRROR_CHECK" != "OFFICIAL"; then
MUSL_MIRROR_CUSTOME=$MUSL_MIRROR
MUSL_MIRROR=CUSTOME
fi
AC_SUBST([MUSL_MIRROR])
AC_SUBST([MUSL_MIRROR_CUSTOME])
dnl Checks for build configuration.
AC_CONFIG_FILES([Makefile])
AC_CONFIG_FILES([mirrors.mk])
AC_OUTPUT