Ticket #8910: install_deps.sh

File install_deps.sh, 4.2 KB (added by mmadia, 7 years ago)

Script that generates KDL, debug_server exceptions

Line 
1#!/bin/sh
2#
3#
4CWD=`pwd`
5DOWNLOADS="$CWD/downloads"
6DEPS="$CWD/dependencies"
7DIRECTORIES=( "$DOWNLOADS" "$DEPS")
8WGET_CMD='wget --quiet'
9DEP_URLS=( \
10'http://git.savannah.gnu.org/gitweb/?p=gnulib.git;a=blob_plain;f=build-aux/config.guess' \
11'http://git.savannah.gnu.org/gitweb/?p=gnulib.git;a=blob_plain;f=build-aux/config.sub' \
12'http://ports.haiku-files.org/svn/haikuports/trunk/dev-libs/glib/patches/pkgconfig_glib-1.2.10-installable.diff' \
13'http://ftp.gnu.org/gnu/autoconf/autoconf-2.13.tar.gz' \
14'http://pkgconfig.freedesktop.org/releases/pkg-config-0.23.tar.gz' \
15'http://ftp.mozilla.org/pub/mozilla.org/mozilla/libraries/source/libIDL-0.6.8.tar.gz' )
16# ####
17# NOTE: currently andrewtv.org is down
18#'http://andrewtv.org/static/libIDL/libIDL-0.6.8.tar.gz' \
19
20AUTOCONF_CMD="/boot/common/bin/autoconf-2.13"
21# --macro-dir=/boot/apps/autoconf-2.13/share/autoconf"
22
23PREFIX=--prefix=/boot/common
24
25# #################################
26# create_dirs ()
27#
28function create_dirs ()
29{
30echo "Creating directory structure ... "
31for dir in ${DIRECTORIES[@]}
32do
33 if ! [ -d "$dir" ] ; then
34 mkdir -p "$dir"
35 fi
36done
37} # function create_dirs ()
38
39
40# #################################
41# download_deps ()
42#
43function download_deps ()
44{
45echo "Downloading necessary dependency source archives ... "
46
47for url in ${DEP_URLS[@]}
48do
49 filename=${url##*/}
50 if ! [ -e "$DOWNLOADS/$filename" ]; then
51 echo " $filename ..."
52 $WGET_CMD --output-document="$DOWNLOADS/$filename" "$url"
53 fi
54done
55} # function download_deps ()
56
57
58# #################################
59# unpack_deps ()
60#
61function unpack_deps ()
62{
63
64echo "Expanding dependency source archives ... "
65
66for archive in "$DOWNLOADS"/*
67do
68ext=${archive##*.}
69file=${archive##*/}
70
71if [ "$ext" = "gz" ]; then
72 cd "$DEPS"
73 if ! [ -f "$file"-expanded ]; then
74 tar xvf "$archive"
75 touch "$file"-expanded
76 fi
77 cd "$CWD"
78
79fi
80done
81} # function unpack_deps ()
82
83
84# #################################
85# copy_config_sub ()
86#
87function copy_config_guess ()
88{
89cd "$DEPS"
90echo "Updating dependencies' config.guess ..."
91for result in `find -name config.guess`
92do
93 echo "$result"
94 cp -f "$DOWNLOADS/config.guess" "$result"
95done
96cd "$CWD"
97} # function copy_config_guess ()
98
99
100# #################################
101# copy_config_sub ()
102#
103function copy_config_sub ()
104{
105
106cd "$DEPS"
107echo "Updating dependencies' config.sub ..."
108for result in `find -name config.sub`
109do
110 echo "$result"
111 cp -f "$DOWNLOADS/config.sub" "$result"
112done
113cd "$CWD"
114} # function copy_config_sub ()
115
116
117# #################################
118# build_autoconf213 ()
119#
120function build_autoconf213 ()
121{
122cd "$CWD"'/dependencies/autoconf-2.13'
123echo "`pwd`"
124./configure --prefix=/boot/common/autoconf-2.13 --program-suffix=-2.13 --bindir=/boot/common/bin/
125make
126make install
127cd "$CWD"
128} # function build_autoconf213 ()
129
130
131
132# #################################
133# build_glib ()
134#
135# NOTE : TODO : re-do patch, as it does not include configure.in changes
136function build_glib ()
137{
138cd "$CWD"/dependencies/pkg-config-0.23/
139echo "`pwd`"
140patch -p0 -N -i "$DOWNLOADS"/pkgconfig_glib-1.2.10-installable.diff
141cd glib-1.2.10
142libtoolize --force --copy
143aclocal
144automake
145autoconf
146./configure "$PREFIX"
147make
148make check
149make install
150cd "$CWD"
151} # function build_glib ()
152
153
154# #################################
155# build_libidl ()
156#
157function build_libidl ()
158{
159cd "$CWD"/dependencies
160cd libIDL-0.6.8
161$AUTOCONF_CMD
162./configure "$PREFIX"
163make
164make install
165cd "$CWD"
166} # function build_libidl ()
167
168
169# #################################
170# print_mozconfig_message ()
171#
172function print_mozconfig_message ()
173{
174cat <<EOF
175####====--------------------------------------------====####
176### === --- THIS MUST GO IN YOUR MOZCONFIG --- === ###
177#
178export GLIB_CONFIG=/boot/common/bin/glib-config
179mk_add_options GLIB_CONFIG=/boot/common/bin/glib-config
180
181export LIBIDL_CONFIG=/boot/common/bin/libIDL-config
182mk_add_options LIBIDL_CONFIG=/boot/common/bin/libIDL-config
183#
184####====--------------------------------------------====####
185EOF
186
187} # function print_mozconfig_message ()
188# #################################
189# main execution block
190#
191create_dirs
192download_deps
193unpack_deps
194copy_config_guess
195copy_config_sub
196build_autoconf213
197build_glib
198build_libidl
199print_mozconfig_message