-
Notifications
You must be signed in to change notification settings - Fork 1
/
autogen.sh
executable file
·35 lines (28 loc) · 830 Bytes
/
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
#!/bin/bash
# Function that checks for program availability (works only
# with programs the accept the --version argument)
mkdir -p m4
function check_prog {
# Try finding the program with the 'which' command.
# Redirect any output to /dev/null.
which $1 > /dev/null 2>&1
# if it doesn't exist, you should get an error status
if [[ $? != 0 ]]
then
echo "Error: program '$1' missing. Please install it."
echo "Trying to continue ..."
fi
}
# Check programs which are required for the next steps.
# This is for user friendliness only.
check_prog autoconf
check_prog automake
check_prog libtool
# Copy the original file to have the normal name
cp conf.ac.orig configure.ac
# Update the file if necessary
autoupdate
# Remove the copy the updating program leaves
rm -f configure.ac~
# Reconfigure
autoreconf --install