forked from McKay42/McEngine
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathautogen.sh
executable file
·74 lines (57 loc) · 1.85 KB
/
autogen.sh
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
#!/usr/bin/env sh
# bootstrap script
# run this to generate the configure script and other files needed
# by the build system (e.g. source files to compile).
set -e
# Make sure we're in the right directory
if [ ! -f "configure.ac" ]; then
echo "Error: configure.ac not found. Run this script from the project root directory."
exit 1
fi
########################################
echo "Generating source file list..."
SOURCES_FILE="src/Makefile.sources"
mkdir -p "$(dirname "$SOURCES_FILE")"
cat > "$SOURCES_FILE" << EOF
# Automatically generated by autogen.sh - DO NOT EDIT
McOsu_SOURCES = \\
EOF
find src -type f '(' -name "*.cpp" -o -name "*.c" ')' | LC_ALL=C sort | \
sed 's/$/\\/' | \
sed 's/^/\t/' >> "$SOURCES_FILE"
echo "\$(NULL)" >> "$SOURCES_FILE"
mkdir -p "$(dirname build/aux)"
########################################
check_tool() {
if ! command -v "$1" >/dev/null 2>&1; then
echo "Error: $1 not found. Please install $2."
exit 1
fi
}
check_tool "aclocal" "automake"
check_tool "automake" "automake"
check_tool "autoconf" "autoconf"
check_tool "pkg-config" "pkg-config"
echo "Running autotools..."
autoreconf -fiv
echo "
Bootstrap complete. You can now build McOsu either:
For development (recommended, out-of-tree build):
mkdir build
cd build
../configure [options]
make
make install
For end-users (in-tree build):
./configure [options]
make
make install
Some configure options:
--prefix=/usr Install to /usr instead of ./dist
--enable-debug Enable debug build
--disable-native Disable native CPU optimizations
--disable-system-deps Build some dependencies from source
--enable-static Try to build/link libraries statically
--enable-lto Enable link-time optimization (default: used if available)
For a full list of options, run: ./configure --help
"