-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbootstrap
More file actions
executable file
·149 lines (115 loc) · 4.59 KB
/
Copy pathbootstrap
File metadata and controls
executable file
·149 lines (115 loc) · 4.59 KB
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
138
139
140
141
142
143
144
145
146
147
148
#! /bin/bash
# Quickscope - a software oscilloscope
#
# Copyright (C) 2012-2014 Lance Arsenault
# This file is part of Quickscope.
#
# Quickscope is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published
# by the Free Software Foundation, either version 3 of the License,
# or (at your option) any later version.
#
# Quickscope 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
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Quickscope. If not, see <http://www.gnu.org/licenses/>.
#
####################################################################
#---------------------------------------------------------------------
# WHAT'S THIS FILE FOR
# Run this if you just got this package from Git.
# This is run to generate files, configure, Makefile.in and the-like,
# that are needed to make the files in this directory into something
# closer to a package for source distribution, packages source
# tar-ball files. The files that this starts with commonly come from
# a Git repository. This uses the GNU Autotools.
# The source files from the Git repository are a subset of the files
# in a source tarball. There no way around that if we require that
# no generated files go into the repository and we need to minimize
# dependences in building from source tarballs.
# So now if we use GNU autotools and make files to generate files
# that are in the source tarball, we tend to have more system
# requirements when building from repository source than from
# tarball source and so we are lead to having the
# './configure --enable-repobuild' option. We have not seen a
# standard option flag for this kind of option, but differing
# repo build idea is very common.
#---------------------------------------------------------------------
# Unlike 'configure' this script only runs in the
# source directory and generates files in the source
# directory where we assume this script file is.
# See output from: $0 --help.
scriptdir="$(dirname ${BASH_SOURCE[0]})" || exit 1
cd $scriptdir || exit 1
function cleanup_FAIL()
{
rm -f "$scriptdir"/configure
FAIL
}
function bootstrap()
{
# This tries to do what this script does
# without any checks.
set -x
# create empty files if not present
for f in NEWS AUTHORS ChangeLog ; do
if [ ! -f "$f" ] ; then
touch $f
fi
done
# Today bootstrap is easy with autoreconf
#
# We cannot use WARNING=error because it wrongly requires
# use to use automake option subdir-objects as in
# AM_INIT_AUTOMAKE(-Wall -Werror dist-bzip2 no-dist-gzip subdir-objects)
# doing so breaks the build. We are not using subdir-objects
# the way automake thinks we are.
WARNINGS=all autoreconf --force --verbose --install || cleanup_FAIL
set +x
echo "The automake subdir-objects warnings are not a concern."
echo "They make wrong assumptions about what this code is doing."
echo
echo "Successfully added the GNU autotools files to quickscope"
echo "The quickscope source is now bootstraped."
echo
echo "Success"
exit 0
}
function usage()
{
cat <<END
Usage: $0 [--force|--help|-h]
You need to run this if you got this Quickscope source
from the Git (or other) repository. You most likely do
not need to run this otherwise.
Generate files needed to make a source tarball from
source files from the Git repository. This does not
generate all files needed to build a source tarball.
You must run the GNU configure script after running this
script to make all the files that go into a source tarball.
This script is needed so that we do not need to check in
generated files into the repository and at the same time
reduce the number of dependences needed to build Quickscope
from a source tarball. If you got this source from a
Git (or other) repository you need to run this. If you got
this source from a tarball distribution you do not need
to run this. Mostly this just runs the GNU autoreconf
program which generates GNU autotools build system files
like configure, Makefile, and libtool.
We rely on GNU autotools configure script to check for
other prerequisite packages.
OPTIONS
--force run this without checking
--help|-h print this help and exit
END
exit 1
}
[ "$1" = "--force" ] && bootstrap
[ -z "$1" ] || usage
# Test that we have some programs in path
source repo_require.bash || exit 1
check_repo_require
bootstrap