-
Notifications
You must be signed in to change notification settings - Fork 0
/
autogen.sh
executable file
·109 lines (92 loc) · 3.24 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
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
#!/bin/bash
LOG="autogen.log"
unamestr=`uname`
function error_exit
{
echo "Something went wrong with $1; check $LOG" 1>&2
exit 1
}
mkdir -p m4
echo "---------------------------------------------------------" >> $LOG
echo "Running Bibledit autogen.sh" >> $LOG
date >> $LOG
echo "Running autoreconf..."
echo "autoreconf---------------------------------------" >> $LOG
autoreconf --force --install >> $LOG 2>&1
echo "Creating m4/aclocal.m4..."
test -r m4/aclocal.m4 || touch m4/aclocal.m4
echo "Copying some autoconf macros on system $unamestr..."
echo "Copying macros-----------------------------------" >> $LOG
# First case is msys2 on Windows
if [ -n "$MSYSTEM" ]
then
case "$MSYSTEM" in
MINGW32)
ACLOCAL="/mingw32/share/aclocal"
;;
MINGW64)
ACLOCAL="/mingw64/share/aclocal"
;;
MSYS)
error_exit "copying autoconf macros (you are using an MSYS shell instead of a MINGW shell?)"
;;
*)
echo "Unknown value $MSYSTEM in MSYSTEM environment variable, so I don't know what to do."
exit 2
;;
esac
# Second case I can handle is on Linux
elif [ $unamestr == "Linux" ]
then
ACLOCAL="/usr/share/aclocal"
else
error_exit "figuring out what system I am on, so I can copy autoconf macros"
fi
cp -f "$ACLOCAL/codeset.m4" m4/
cp -f "$ACLOCAL/gettext.m4" m4/
cp -f "$ACLOCAL/glib-gettext.m4" m4/
cp -f "$ACLOCAL/glibc21.m4" m4/
cp -f "$ACLOCAL/iconv.m4" m4/
cp -f "$ACLOCAL/lcmessage.m4" m4/
cp -f "$ACLOCAL/progtest.m4" m4/
# What to do about isc-posix.m4?
echo "Running glib-gettextize..."
echo "glib-gettextize----------------------------------" >> $LOG
echo "Ignore non-fatal messages" >> $LOG
echo "no" | glib-gettextize --force --copy >> $LOG 2>&1
echo "Making m4/aclocal.m4 writable ..."
echo "Making m4/aclocal.m4 writable--------------------" >> $LOG
test -r m4/aclocal.m4 && chmod u+w m4/aclocal.m4
echo "Running intltoolize..."
echo "intltoolize--------------------------------------" >> $LOG
intltoolize --force --copy --automake >> $LOG 2>&1 || error_exit "intltoolize"
echo "Running aclocal..."
echo "aclocal------------------------------------------" >> $LOG
#-I /mingw/msys/1.0/share/aclocal
aclocal -I m4 --install >> $LOG 2>&1 || error_exit "aclocal"
echo "Running libtoolize..."
echo "libtoolize---------------------------------------" >> $LOG
libtoolize >> $LOG 2>&1 || error_exit "libtoolize"
echo "Running autoheader..."
echo "autoheader---------------------------------------" >> $LOG
autoheader >> $LOG 2>&1 || error_exit "autoheader"
echo "Running autoconf..."
echo "autoconf-----------------------------------------" >> $LOG
autoconf >> $LOG 2>&1 || error_exit "autoconf"
echo "Running automake..."
echo "automake-----------------------------------------" >> $LOG
automake --add-missing >> $LOG 2>&1 || error_exit "automake"
echo "You should now run ./configure, then make."
if [ $unamestr == "Linux" ]
then
echo "After that, you should run sudo make install"
elif [ $unamestr == "MINGW32_NT-6.1" ]
then
echo "After that, you should run windows/installWin.sh"
elif [ $unamestr == "MINGW64_NT-6.1" ]
then
echo "After that, you should run windows/installWin.sh"
else
echo "After that, I'm not quite sure how to install on your system."
fi
echo "Check $LOG if you want to see some details about what we just did."