-
Notifications
You must be signed in to change notification settings - Fork 1
/
bootstrap
executable file
·87 lines (74 loc) · 2.75 KB
/
bootstrap
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
#!/bin/bash
# This file is part of progstm32.
#
# Copyright (C) 2018, Rishi Gupta. All rights reserved.
#
# The progstm32 is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation; either version 2.1 of the License, or
# (at your option) any later version.
#
# The progstm32 is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
# License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with this library; if not, write to the Free Software Foundation,Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#1. 'autoconf' takes configure.ac and produces configure script.
#2. 'automake' takes Makefile.am and produces Makefile.in.
#3. 'autoheader' utility generates a C language header file template config.h.in
# from configure.ac
#4. 'autoreconf' execute the configuration tools in the Autoconf, Automake and
# Libtool packages as required by the project in right order.
#5. 'configure' script takes Makefile.in and produces final Makefile.
#6. 'aclocal' generates aclocal.m4 based on the contents of configure.ac.
#7. 'libtool' is generated from ltmain.sh.
cd "$(dirname '$0')"
if [[ $EUID -eq 0 ]]; then
echo "$(tput setaf 1)Run as non root user.$(tput sgr0)" 1>&2
exit 1
fi
rm -rf INSTALL m4 configure Makefile.in depcomp config.guess config.sub >/dev/null 2>&1
rm -rf missing aclocal.m4 install-sh ltmain.sh config.h config.h.in compile >/dev/null 2>&1
rm -rf config.h.in~ configdata.pm autom4te.cache config.status config.log stamp-h1 >/dev/null 2>&1
mkdir -p m4
command -v libtoolize >/dev/null 2>&1
if [ $? -ne 0 ]; then
command -v libtool >/dev/null 2>&1
if [ $? -ne 0 ]; then
echo "could not find libtool." 1>&2
exit 1
fi
fi
command -v pkg-config >/dev/null 2>&1
if [ $? -ne 0 ]; then
echo "pkg-config is required." 1>&2
exit 1
fi
command -v autoreconf >/dev/null 2>&1
if [ $? -ne 0 ]; then
echo "autoconf and automake are required." 1>&2
exit 1
fi
# sudo apt-get install autoconf-archive
# Typical order of running auto tools by autoreconf is:
# - aclocal --warnings=all -I m4
# - libtoolize
# - autoconf --warnings=all
# - autoheader --warnings=all
# - automake --add-missing --no-force --warnings=all
autoreconf -vis -W all
status=$?
if [ $status -ne 0 ]; then
echo "autoreconf exited with status $status" 1>&2
exit 1
fi
command -v tput >/dev/null 2>&1
if [ $? -eq 0 ]; then
echo "$(tput setaf 11)Bootstrapped successfully.$(tput sgr0)"
else
echo "Bootstrapped successfully."
fi
exit 0