Skip to content

Commit

Permalink
Revised dependency check script.
Browse files Browse the repository at this point in the history
- Removed GMP, MPFR and MPC dependencies since GCC build script will download & utilize appropriate versions of these libraries.
- Removed freetype dependency. It seems to have no reason for the host system to have this library as a must.
- Make special checks on OS X for readline & libtool to ensure that we have GNU version, not BSD implementation shipped with OS X.
  • Loading branch information
FTPiano committed Jun 1, 2015
1 parent 1766dec commit 2a72a22
Showing 1 changed file with 32 additions and 9 deletions.
41 changes: 32 additions & 9 deletions depends/check-dependencies.sh
Expand Up @@ -28,6 +28,19 @@ function check_header
missing_depends+=($1); return 1
}

function check_header_nosys
{
for place in ${header_paths[@]}; do
if [ "${place:0:12}" != "/usr/include" ]; then
for name in ${@:2}; do
[ -f "$place/$name" ] && return 0
done
fi
done

missing_depends+=($1); return 1
}

function check_program
{
binary=${2:-$1}
Expand All @@ -49,17 +62,14 @@ function check_aclocal



check_header gmp gmp.h
check_header mpc mpc.h
check_header mpfr mpfr.h
# check_header gmp gmp.h
# check_header mpc mpc.h
# check_header mpfr mpfr.h
check_header libelf elf.h libelf.h libelf/libelf.h gelf.h libelf/gelf.h
check_header libusb usb.h
check_header ncurses ncurses.h ncurses/ncurses.h
check_header readline readline.h readline/readline.h
check_header zlib zlib.h



check_program git
check_program svn
check_program wget
Expand All @@ -70,14 +80,13 @@ check_program unzip
check_program autoconf
check_program automake
check_program automake-1.9 # This particular version is needed too
check_program libtool
check_program cmake
check_program make
check_program gcc
check_program g++

check_program sdl-config
check_program freetype-config
# check_program freetype-config

check_program bison
check_program flex
Expand All @@ -86,7 +95,21 @@ check_program tclsh
check_program makeinfo
check_program doxygen


# Sometimes things will be a little different on Mac OS X...
if [ "$(uname)" == "Darwin" ]; then
# readline should be checked carefully on OS X to save us from being
# fooled by BSD libedit.
brew --version 1>/dev/null 2>&1 \
&& header_paths+=("`brew --prefix`/opt/readline/include")
check_header_nosys readline readline.h readline/readline.h

# GNU libtool will be prepended with letter 'g' to prevent conflicts with
# the one comes along with OS X.
check_program glibtool
else
check_header readline readline.h readline/readline.h
check_program libtool
fi

if [ ${#missing_depends[@]} -ne 0 ]; then
echo "Couldn't find dependencies:"
Expand Down

0 comments on commit 2a72a22

Please sign in to comment.