2019-08-01 13:06:38 +03:00
|
|
|
# This shell fragment is intended for use in `bash` or `zsh`. While it
|
|
|
|
# may work in other shells it is not meant to, and any misbehaviour is not
|
|
|
|
# considered a bug in that case.
|
2013-03-05 15:53:10 +04:00
|
|
|
#
|
2017-12-07 10:56:50 +03:00
|
|
|
# NetSurf Library, tool and browser development support script
|
2013-03-05 15:53:10 +04:00
|
|
|
#
|
2024-05-25 12:22:47 +03:00
|
|
|
# Copyright 2013-2024 Vincent Sanders <vince@netsurf-browser.org>
|
2017-12-07 10:56:50 +03:00
|
|
|
# Released under the MIT Licence
|
2013-03-05 15:53:10 +04:00
|
|
|
#
|
|
|
|
# This script allows NetSurf and its libraries to be built without
|
|
|
|
# requiring installation into a system.
|
|
|
|
#
|
2017-12-07 10:56:50 +03:00
|
|
|
# Usage: source env.sh
|
|
|
|
#
|
|
|
|
# Controlling variables
|
|
|
|
# HOST sets the target architecture for library builds
|
|
|
|
# BUILD sets the building machines architecture
|
|
|
|
# TARGET_WORKSPACE is the workspace directory to keep the sandboxes
|
2024-05-29 10:52:23 +03:00
|
|
|
# TARGET_TOOLKIT controls development package installs
|
|
|
|
# can be unset or one of framebuffer, gtk2, gtk3, qt6
|
2017-12-07 10:56:50 +03:00
|
|
|
#
|
|
|
|
# The use of HOST and BUILD here is directly comprable to the GCC
|
|
|
|
# usage as described at:
|
|
|
|
# http://gcc.gnu.org/onlinedocs/gccint/Configure-Terms.html
|
|
|
|
#
|
|
|
|
|
|
|
|
###############################################################################
|
|
|
|
# OS Package installation
|
|
|
|
###############################################################################
|
|
|
|
|
|
|
|
|
2024-05-29 10:52:23 +03:00
|
|
|
# deb packages for dpkg based systems
|
2017-12-07 10:56:50 +03:00
|
|
|
# apt get commandline to install necessary dev packages
|
2024-05-29 10:52:23 +03:00
|
|
|
ns_apt_get_install()
|
2017-12-07 10:56:50 +03:00
|
|
|
{
|
2024-05-29 10:52:23 +03:00
|
|
|
NS_DEV_DEB="build-essential pkg-config git gperf libcurl3-dev libexpat1-dev libpng-dev libjpeg-dev"
|
2018-11-07 00:55:20 +03:00
|
|
|
LIBCURL_OPENSSL_CONFLICTS="$(/usr/bin/apt-cache show libcurl4-openssl-dev | grep Conflicts | grep -o libssl1.0-dev)"
|
|
|
|
if [ "x${LIBCURL_OPENSSL_CONFLICTS}" != "x" ]; then
|
|
|
|
NS_DEV_DEB="${NS_DEV_DEB} libssl-dev"
|
|
|
|
elif /usr/bin/apt-cache show libssl1.0-dev >/dev/null 2>&1; then
|
2018-01-20 16:29:36 +03:00
|
|
|
NS_DEV_DEB="${NS_DEV_DEB} libssl1.0-dev"
|
|
|
|
else
|
|
|
|
NS_DEV_DEB="${NS_DEV_DEB} libssl-dev"
|
|
|
|
fi
|
2024-05-29 10:52:23 +03:00
|
|
|
|
|
|
|
NS_TOOL_DEB="flex bison libhtml-parser-perl"
|
|
|
|
|
|
|
|
case "${TARGET_TOOLKIT}" in
|
|
|
|
gtk2)
|
|
|
|
NS_TK_DEB="libgtk2.0-dev librsvg2-dev"
|
|
|
|
;;
|
|
|
|
gtk3)
|
|
|
|
NS_TK_DEB="libgtk-3-dev librsvg2-dev"
|
|
|
|
;;
|
|
|
|
qt6)
|
|
|
|
NS_TK_DEB="qt6-base-dev-tools qt6-base-dev"
|
|
|
|
;;
|
|
|
|
framebuffer)
|
|
|
|
NS_TK_DEB="libfreetype-dev libsdl1.2-compat-dev libxcb-util-dev libxcb-icccm4-dev libxcb-image0-dev libxcb-keysyms1-dev"
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
NS_TK_DEB=""
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
sudo apt-get install --no-install-recommends $(echo ${NS_DEV_DEB} ${NS_TOOL_DEB} ${NS_TK_DEB})
|
2017-12-07 10:56:50 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
# packages for yum installer RPM based systems (tested on fedora 20)
|
|
|
|
# yum commandline to install necessary dev packages
|
2024-05-29 10:52:23 +03:00
|
|
|
ns_yum_install()
|
2017-12-07 10:56:50 +03:00
|
|
|
{
|
2024-05-29 10:52:23 +03:00
|
|
|
NS_DEV_YUM_RPM="git gcc pkgconfig expat-devel openssl-devel gperf libcurl-devel perl-Digest-MD5-File libjpeg-devel libpng-devel"
|
|
|
|
|
|
|
|
NS_TOOL_YUM_RPM="flex bison"
|
|
|
|
|
|
|
|
case "${TARGET_TOOLKIT}" in
|
|
|
|
gtk2)
|
|
|
|
NS_TK_YUM_RPM="gtk2-devel librsvg2-devel"
|
|
|
|
;;
|
|
|
|
gtk3)
|
|
|
|
NS_TK_YUM_RPM="gtk3-devel librsvg2-devel"
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
NS_TK_YUM_RPM=""
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
sudo yum -y install $(echo ${NS_DEV_YUM_RPM} ${NS_TOOL_YUM_RPM} ${NS_TK_YUM_RPM})
|
2017-12-07 10:56:50 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
# packages for dnf installer RPM based systems (tested on fedora 25)
|
|
|
|
# dnf commandline to install necessary dev packages
|
2024-05-29 10:52:23 +03:00
|
|
|
ns_dnf_install()
|
2017-12-07 10:56:50 +03:00
|
|
|
{
|
2024-05-29 10:52:23 +03:00
|
|
|
NS_DEV_DNF_RPM="java-1.8.0-openjdk-headless gcc clang pkgconfig libcurl-devel libjpeg-devel expat-devel libpng-devel openssl-devel gperf perl-HTML-Parser"
|
|
|
|
|
|
|
|
NS_TOOL_DNF_RPM="git flex bison ccache screen"
|
|
|
|
|
|
|
|
case "${TARGET_TOOLKIT}" in
|
|
|
|
gtk2)
|
|
|
|
NS_TK_DNF_RPM="gtk2-devel"
|
|
|
|
;;
|
|
|
|
gtk3)
|
|
|
|
NS_TK_DNF_RPM="gtk3-devel"
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
NS_TK_DNF_RPM=""
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
sudo dnf install $(echo ${NS_DEV_DNF_RPM} ${NS_TOOL_DNF_RPM} ${NS_TK_DNF_RPM})
|
2017-12-07 10:56:50 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
# packages for zypper installer RPM based systems (tested on openSUSE leap 42)
|
|
|
|
# zypper commandline to install necessary dev packages
|
2024-05-29 10:52:23 +03:00
|
|
|
ns_zypper_install()
|
2017-12-07 10:56:50 +03:00
|
|
|
{
|
2024-05-29 10:52:23 +03:00
|
|
|
NS_DEV_ZYP_RPM="java-1_8_0-openjdk-headless gcc clang pkgconfig libcurl-devel libjpeg-devel libexpat-devel libpng-devel openssl-devel gperf perl-HTML-Parser"
|
|
|
|
|
|
|
|
NS_TOOL_ZYP_RPM="git flex bison gperf ccache screen"
|
|
|
|
|
|
|
|
case "${TARGET_TOOLKIT}" in
|
|
|
|
gtk2)
|
|
|
|
NS_TK_ZYP_RPM="gtk2-devel"
|
|
|
|
;;
|
|
|
|
gtk3)
|
|
|
|
NS_TK_ZYP_RPM="gtk3-devel"
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
NS_TK_ZYP_RPM=""
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
sudo zypper install -y $(echo ${NS_DEV_ZYP_RPM} ${NS_TOOL_ZYP_RPM} ${NS_TK_ZYP_RPM})
|
2017-12-07 10:56:50 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
# Packages for Haiku install
|
|
|
|
# pkgman commandline to install necessary dev packages
|
2024-05-29 10:52:23 +03:00
|
|
|
ns_pkgman_install()
|
2017-12-07 10:56:50 +03:00
|
|
|
{
|
2024-05-29 10:52:23 +03:00
|
|
|
# Haiku secondary arch suffix:
|
|
|
|
# empty for primary (gcc2 on x86) or "_x86" for gcc4 secondary.
|
|
|
|
HA=_x86
|
|
|
|
|
|
|
|
NS_DEV_HPKG="devel:libcurl${HA} devel:libpng${HA} devel:libjpeg${HA} devel:libcrypto${HA} devel:libiconv${HA} devel:libexpat${HA} cmd:pkg_config${HA} cmd:gperf html_parser"
|
|
|
|
|
2017-12-07 10:56:50 +03:00
|
|
|
pkgman install $(echo ${NS_DEV_HPKG})
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
# MAC OS X
|
2024-05-29 10:52:23 +03:00
|
|
|
ns_macport_install()
|
2017-12-07 10:56:50 +03:00
|
|
|
{
|
2024-05-29 10:52:23 +03:00
|
|
|
NS_DEV_MACPORT="git expat openssl curl libjpeg-turbo libpng"
|
|
|
|
|
2017-12-07 10:56:50 +03:00
|
|
|
PATH=/opt/local/bin:/opt/local/sbin:$PATH sudo /opt/local/bin/port install $(echo ${NS_DEV_MACPORT})
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
# packages for FreeBSD install
|
|
|
|
# FreeBSD package install
|
2024-05-29 10:52:23 +03:00
|
|
|
ns_freebsdpkg_install()
|
2017-12-07 10:56:50 +03:00
|
|
|
{
|
2024-05-29 10:52:23 +03:00
|
|
|
NS_DEV_FREEBSDPKG="gmake curl"
|
2017-12-07 10:56:50 +03:00
|
|
|
pkg install $(echo ${NS_DEV_FREEBSDPKG})
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
# generic for help text
|
2024-05-29 10:52:23 +03:00
|
|
|
ns_generic_install()
|
2024-05-25 12:30:52 +03:00
|
|
|
{
|
2024-05-29 10:52:23 +03:00
|
|
|
NS_DEV_GEN="git, gcc, pkgconfig, expat library, openssl library, libcurl, perl, perl MD5 digest, libjpeg library, libpng library"
|
|
|
|
|
|
|
|
NS_TOOL_GEN="flex tool, bison tool"
|
|
|
|
|
|
|
|
case "${TARGET_TOOLKIT}" in
|
|
|
|
gtk2)
|
|
|
|
NS_TK_GEN="gtk+ 2 toolkit library, librsvg2 library"
|
|
|
|
;;
|
|
|
|
gtk3)
|
|
|
|
NS_TK_GEN="gtk+ 3 toolkit library, librsvg2 library"
|
|
|
|
;;
|
|
|
|
qt6)
|
|
|
|
NS_TK_GEN="qt6 toolkit dev library"
|
|
|
|
;;
|
|
|
|
framebuffer)
|
|
|
|
NS_TK_GEN="freetype2 dev library, SDL 1.2 compatible library"
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
NS_TK_DEB=""
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
2024-05-25 12:30:52 +03:00
|
|
|
echo "Unable to determine OS packaging system in use."
|
|
|
|
echo "Please ensure development packages are installed for:"
|
2024-05-29 10:52:23 +03:00
|
|
|
echo ${NS_DEV_GEN}"," ${NS_TOOL_GEN}"," ${NS_TK_GEN}
|
2024-05-25 12:30:52 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
# OS package install
|
2017-12-07 10:56:50 +03:00
|
|
|
# looks for package managers and tries to use them if present
|
|
|
|
ns-package-install()
|
|
|
|
{
|
|
|
|
if [ -x "/usr/bin/zypper" ]; then
|
2024-05-29 10:52:23 +03:00
|
|
|
ns_zypper_install
|
2017-12-07 10:56:50 +03:00
|
|
|
elif [ -x "/usr/bin/apt-get" ]; then
|
2024-05-29 10:52:23 +03:00
|
|
|
ns_apt_get_install
|
2017-12-07 10:56:50 +03:00
|
|
|
elif [ -x "/usr/bin/dnf" ]; then
|
2024-05-29 10:52:23 +03:00
|
|
|
ns_dnf_install
|
2017-12-07 10:56:50 +03:00
|
|
|
elif [ -x "/usr/bin/yum" ]; then
|
2024-05-29 10:52:23 +03:00
|
|
|
ns_yum_install
|
2017-12-07 10:56:50 +03:00
|
|
|
elif [ -x "/bin/pkgman" ]; then
|
2024-05-29 10:52:23 +03:00
|
|
|
ns_pkgman_install
|
2017-12-07 10:56:50 +03:00
|
|
|
elif [ -x "/opt/local/bin/port" ]; then
|
2024-05-29 10:52:23 +03:00
|
|
|
ns_macport_install
|
2017-12-07 10:56:50 +03:00
|
|
|
elif [ -x "/usr/sbin/pkg" ]; then
|
2024-05-29 10:52:23 +03:00
|
|
|
ns_freebsdpkg_install
|
2017-12-07 10:56:50 +03:00
|
|
|
else
|
2024-05-29 10:52:23 +03:00
|
|
|
ns_generic_install
|
2017-12-07 10:56:50 +03:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
###############################################################################
|
|
|
|
# Setup environment
|
|
|
|
###############################################################################
|
2013-03-05 15:53:10 +04:00
|
|
|
|
2017-12-07 10:56:50 +03:00
|
|
|
# environment parameters
|
2014-12-19 16:29:12 +03:00
|
|
|
|
|
|
|
# The system doing the building
|
|
|
|
if [ "x${BUILD}" = "x" ]; then
|
2024-05-25 12:22:47 +03:00
|
|
|
BUILD_CC=$(command -v cc)
|
2017-12-07 10:56:50 +03:00
|
|
|
if [ $? -eq 0 ];then
|
2024-05-25 12:22:47 +03:00
|
|
|
BUILD=$(${BUILD_CC} -dumpmachine)
|
2017-12-07 10:56:50 +03:00
|
|
|
else
|
|
|
|
echo "Unable to locate a compiler. Perhaps run ns-package-install"
|
|
|
|
return 1
|
|
|
|
fi
|
2014-12-19 16:29:12 +03:00
|
|
|
fi
|
|
|
|
|
2024-05-25 12:22:47 +03:00
|
|
|
# work out the host compiler to use
|
2014-12-19 16:29:12 +03:00
|
|
|
if [ "x${HOST}" = "x" ]; then
|
2024-05-25 12:22:47 +03:00
|
|
|
# no host ABI set so host is the same as build unless a target ABI is set
|
2014-12-19 16:29:12 +03:00
|
|
|
if [ "x${TARGET_ABI}" = "x" ]; then
|
2017-08-31 01:10:07 +03:00
|
|
|
HOST=${BUILD}
|
2014-12-19 16:29:12 +03:00
|
|
|
else
|
2017-08-31 01:10:07 +03:00
|
|
|
HOST=${TARGET_ABI}
|
2014-12-19 16:29:12 +03:00
|
|
|
fi
|
2016-08-29 15:50:08 +03:00
|
|
|
else
|
2024-05-25 12:22:47 +03:00
|
|
|
# attempt to find host tools with the specificed ABI
|
2020-05-22 12:05:48 +03:00
|
|
|
HOST_CC_LIST="/opt/netsurf/${HOST}/cross/bin/${HOST}-cc /opt/netsurf/${HOST}/cross/bin/${HOST}-gcc ${HOST}-cc ${HOST}-gcc"
|
2016-11-13 21:29:06 +03:00
|
|
|
for HOST_CC_V in $(echo ${HOST_CC_LIST});do
|
2024-05-25 12:22:47 +03:00
|
|
|
HOST_CC=$(command -v ${HOST_CC_V})
|
|
|
|
if [ $? -eq 0 ];then
|
2017-08-31 01:10:07 +03:00
|
|
|
break
|
|
|
|
fi
|
2016-08-29 15:50:08 +03:00
|
|
|
done
|
2016-11-13 21:29:06 +03:00
|
|
|
if [ "x${HOST_CC}" = "x" ];then
|
2017-08-31 01:10:07 +03:00
|
|
|
echo "Unable to execute host compiler for HOST=${HOST}. is it set correctly?"
|
|
|
|
return 1
|
2016-08-29 15:50:08 +03:00
|
|
|
fi
|
|
|
|
|
|
|
|
HOST_CC_MACHINE=$(${HOST_CC} -dumpmachine 2>/dev/null)
|
|
|
|
|
|
|
|
if [ "${HOST_CC_MACHINE}" != "${HOST}" ];then
|
2020-05-22 12:05:48 +03:00
|
|
|
echo "Compiler dumpmachine differs from HOST setting"
|
2017-08-31 01:10:07 +03:00
|
|
|
return 2
|
2016-08-29 15:50:08 +03:00
|
|
|
fi
|
2020-05-22 12:05:48 +03:00
|
|
|
|
|
|
|
NS_ENV_CC="${HOST_CC}"
|
|
|
|
export NS_ENV_CC
|
|
|
|
|
2016-08-29 15:50:08 +03:00
|
|
|
unset HOST_CC_LIST HOST_CC_V HOST_CC HOST_CC_MACHINE
|
2013-03-05 15:53:10 +04:00
|
|
|
fi
|
|
|
|
|
2017-12-07 10:56:50 +03:00
|
|
|
# set up a default target workspace
|
2013-03-05 15:53:10 +04:00
|
|
|
if [ "x${TARGET_WORKSPACE}" = "x" ]; then
|
2013-03-06 01:12:53 +04:00
|
|
|
TARGET_WORKSPACE=${HOME}/dev-netsurf/workspace
|
|
|
|
fi
|
|
|
|
|
2017-12-07 10:56:50 +03:00
|
|
|
# set up default parallelism
|
2013-03-06 01:12:53 +04:00
|
|
|
if [ "x${USE_CPUS}" = "x" ]; then
|
2013-12-27 05:43:01 +04:00
|
|
|
NCPUS=$(getconf _NPROCESSORS_ONLN 2>/dev/null || getconf NPROCESSORS_ONLN 2>/dev/null)
|
2013-03-06 01:12:53 +04:00
|
|
|
NCPUS="${NCPUS:-1}"
|
|
|
|
NCPUS=$((NCPUS * 2))
|
|
|
|
USE_CPUS="-j${NCPUS}"
|
2013-03-05 15:53:10 +04:00
|
|
|
fi
|
|
|
|
|
2024-05-29 10:52:23 +03:00
|
|
|
# Setup GTK major version if required (either 2 or 3 currently)
|
|
|
|
case "${TARGET_TOOLKIT}" in
|
|
|
|
gtk2)
|
|
|
|
NETSURF_GTK_MAJOR=2
|
|
|
|
;;
|
|
|
|
gtk3)
|
|
|
|
NETSURF_GTK_MAJOR=3
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
if [ "x${NETSURF_GTK_MAJOR}" = "x" ]; then
|
|
|
|
NETSURF_GTK_MAJOR=2
|
|
|
|
fi
|
|
|
|
;;
|
|
|
|
esac
|
2014-03-16 17:46:27 +04:00
|
|
|
|
2017-12-07 10:56:50 +03:00
|
|
|
# report to user
|
2014-12-19 16:29:12 +03:00
|
|
|
echo "BUILD=${BUILD}"
|
|
|
|
echo "HOST=${HOST}"
|
2013-03-05 15:53:10 +04:00
|
|
|
echo "TARGET_WORKSPACE=${TARGET_WORKSPACE}"
|
2013-03-06 01:12:53 +04:00
|
|
|
echo "USE_CPUS=${USE_CPUS}"
|
2013-03-05 15:53:10 +04:00
|
|
|
|
2014-12-19 16:29:12 +03:00
|
|
|
export PREFIX=${TARGET_WORKSPACE}/inst-${HOST}
|
2017-12-07 10:56:50 +03:00
|
|
|
export BUILD_PREFIX=${TARGET_WORKSPACE}/inst-${BUILD}
|
2013-04-12 12:33:58 +04:00
|
|
|
export PKG_CONFIG_PATH=${PREFIX}/lib/pkgconfig:${PKG_CONFIG_PATH}::
|
2013-03-05 15:53:10 +04:00
|
|
|
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${PREFIX}/lib
|
2017-12-07 10:56:50 +03:00
|
|
|
export PATH=${PATH}:${BUILD_PREFIX}/bin
|
2014-03-16 17:46:27 +04:00
|
|
|
export NETSURF_GTK_MAJOR
|
2013-03-05 15:53:10 +04:00
|
|
|
|
2014-12-21 02:56:00 +03:00
|
|
|
# make tool
|
|
|
|
MAKE=make
|
|
|
|
|
2014-03-16 17:46:27 +04:00
|
|
|
# NetSurf GIT repositories
|
2013-03-05 15:53:10 +04:00
|
|
|
NS_GIT="git://git.netsurf-browser.org"
|
2014-03-16 17:46:27 +04:00
|
|
|
|
2014-12-31 17:02:30 +03:00
|
|
|
# Buildsystem: everything depends on this
|
|
|
|
NS_BUILDSYSTEM="buildsystem"
|
|
|
|
|
2022-11-09 18:33:42 +03:00
|
|
|
NS_TOOLS=""
|
|
|
|
NS_FRONTEND_LIBS=""
|
2014-03-16 17:46:27 +04:00
|
|
|
|
2022-11-09 18:33:42 +03:00
|
|
|
BUILD_TARGET="${TARGET:-netsurf}"
|
2013-03-05 15:53:10 +04:00
|
|
|
|
2022-11-09 18:33:42 +03:00
|
|
|
case "$BUILD_TARGET" in
|
|
|
|
libhubbub)
|
|
|
|
NS_INTERNAL_LIBS="libparserutils"
|
2014-12-19 16:29:12 +03:00
|
|
|
;;
|
2022-11-09 18:33:42 +03:00
|
|
|
|
|
|
|
libdom)
|
|
|
|
NS_INTERNAL_LIBS="libwapcaplet libparserutils libhubbub"
|
2016-10-06 02:08:05 +03:00
|
|
|
;;
|
2022-11-09 18:33:42 +03:00
|
|
|
|
|
|
|
libcss)
|
|
|
|
NS_INTERNAL_LIBS="libwapcaplet libparserutils"
|
2014-12-21 02:56:00 +03:00
|
|
|
;;
|
2022-11-09 18:33:42 +03:00
|
|
|
|
|
|
|
netsurf)
|
|
|
|
# internal libraries all frontends require (order is important)
|
|
|
|
NS_INTERNAL_LIBS="libwapcaplet libparserutils libhubbub libdom libcss libnsgif libnsbmp libutf8proc libnsutils libnspsl libnslog"
|
|
|
|
|
|
|
|
# add target specific libraries
|
|
|
|
case "${HOST}" in
|
|
|
|
i586-pc-haiku)
|
|
|
|
# tools required to build the browser for haiku (beos)
|
|
|
|
NS_TOOLS="nsgenbind"
|
|
|
|
# libraries required for the haiku target abi
|
|
|
|
NS_FRONTEND_LIBS="libsvgtiny"
|
|
|
|
;;
|
|
|
|
*arwin*)
|
|
|
|
# tools required to build the browser for OS X
|
|
|
|
NS_TOOLS=""
|
|
|
|
# libraries required for the Darwin target abi
|
|
|
|
NS_FRONTEND_LIBS="libsvgtiny libnsfb"
|
|
|
|
;;
|
|
|
|
arm-unknown-riscos|arm-riscos-gnueabi*)
|
|
|
|
# tools required to build the browser for RISC OS
|
|
|
|
NS_TOOLS="nsgenbind"
|
|
|
|
# libraries required for the risc os target abi
|
|
|
|
NS_FRONTEND_LIBS="libsvgtiny librufl libpencil librosprite"
|
|
|
|
;;
|
|
|
|
*-atari-mint)
|
|
|
|
# tools required to build the browser for atari
|
|
|
|
NS_TOOLS=""
|
|
|
|
# libraries required for the atari frontend
|
|
|
|
NS_FRONTEND_LIBS=""
|
|
|
|
;;
|
|
|
|
ppc-amigaos)
|
|
|
|
# default tools required to build the browser
|
|
|
|
NS_TOOLS="nsgenbind"
|
|
|
|
# default additional internal libraries
|
|
|
|
NS_FRONTEND_LIBS="libsvgtiny"
|
|
|
|
;;
|
|
|
|
m68k-unknown-amigaos)
|
|
|
|
# default tools required to build the browser
|
|
|
|
NS_TOOLS="nsgenbind"
|
|
|
|
# default additional internal libraries
|
|
|
|
NS_FRONTEND_LIBS="libsvgtiny"
|
|
|
|
;;
|
|
|
|
*-unknown-freebsd*)
|
|
|
|
# tools required to build the browser for freebsd
|
|
|
|
NS_TOOLS=""
|
|
|
|
# libraries required for the freebsd frontend
|
|
|
|
NS_FRONTEND_LIBS=""
|
|
|
|
# select gnu make
|
|
|
|
MAKE=gmake
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
# default tools required to build the browser
|
|
|
|
NS_TOOLS="nsgenbind"
|
|
|
|
# default additional internal libraries
|
|
|
|
NS_FRONTEND_LIBS="libsvgtiny libnsfb"
|
|
|
|
;;
|
|
|
|
esac
|
2014-11-16 15:06:18 +03:00
|
|
|
;;
|
|
|
|
esac
|
2013-03-05 15:53:10 +04:00
|
|
|
|
2014-12-21 02:56:00 +03:00
|
|
|
export MAKE
|
|
|
|
|
2014-03-16 17:46:27 +04:00
|
|
|
################ Development helpers ################
|
|
|
|
|
2013-03-05 15:53:10 +04:00
|
|
|
# git pull in all repos parameters are passed to git pull
|
|
|
|
ns-pull()
|
|
|
|
{
|
2022-11-09 18:33:42 +03:00
|
|
|
for REPO in $(echo ${NS_BUILDSYSTEM} ${NS_INTERNAL_LIBS} ${NS_FRONTEND_LIBS} ${NS_TOOLS} ${BUILD_TARGET}) ; do
|
2017-08-31 01:10:07 +03:00
|
|
|
echo -n " GIT: Pulling ${REPO}: "
|
|
|
|
if [ -f "${TARGET_WORKSPACE}/${REPO}/.git/config" ]; then
|
|
|
|
(cd ${TARGET_WORKSPACE}/${REPO} && git pull $*; )
|
|
|
|
else
|
|
|
|
echo "Repository not present"
|
|
|
|
fi
|
2013-03-05 15:53:10 +04:00
|
|
|
done
|
|
|
|
}
|
|
|
|
|
|
|
|
# clone all repositories
|
|
|
|
ns-clone()
|
|
|
|
{
|
2021-02-26 15:06:17 +03:00
|
|
|
SHALLOW=""
|
2022-11-09 18:33:42 +03:00
|
|
|
SKIP=""
|
2021-02-26 15:06:17 +03:00
|
|
|
while [ $# -gt 0 ]
|
|
|
|
do
|
|
|
|
case "$1" in
|
2022-11-09 18:33:42 +03:00
|
|
|
-d | --deps-only) SKIP="${BUILD_TARGET}"
|
2021-02-26 15:06:17 +03:00
|
|
|
shift
|
|
|
|
;;
|
|
|
|
-s | --shallow) SHALLOW="--depth 1"
|
|
|
|
shift
|
|
|
|
;;
|
|
|
|
-*) echo "Error: Unknown option: $1" >&2
|
|
|
|
exit 1
|
|
|
|
;;
|
|
|
|
*) # No more options
|
|
|
|
break
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
done
|
|
|
|
|
2013-03-05 15:53:10 +04:00
|
|
|
mkdir -p ${TARGET_WORKSPACE}
|
2022-11-09 18:33:42 +03:00
|
|
|
for REPO in $(echo ${NS_BUILDSYSTEM} ${NS_INTERNAL_LIBS} ${NS_FRONTEND_LIBS} ${NS_RISCOS_LIBS} ${NS_TOOLS} ${BUILD_TARGET}) ; do
|
|
|
|
[ "x${REPO}" != "x${SKIP}" ] || continue
|
2017-08-31 01:10:07 +03:00
|
|
|
echo -n " GIT: Cloning ${REPO}: "
|
|
|
|
if [ -f ${TARGET_WORKSPACE}/${REPO}/.git/config ]; then
|
|
|
|
echo "Repository already present"
|
|
|
|
else
|
2021-02-26 15:06:17 +03:00
|
|
|
(cd ${TARGET_WORKSPACE} && git clone ${SHALLOW} ${NS_GIT}/${REPO}.git; )
|
2017-08-31 01:10:07 +03:00
|
|
|
fi
|
2013-03-05 15:53:10 +04:00
|
|
|
done
|
|
|
|
|
|
|
|
# put current env.sh in place in workspace
|
2021-02-26 15:06:17 +03:00
|
|
|
if [ "x$NS_BROWSER" = "x" ]; then
|
|
|
|
if [ ! -f "${TARGET_WORKSPACE}/env.sh" -a -f ${TARGET_WORKSPACE}/${NS_BROWSER}/docs/env.sh ]; then
|
|
|
|
cp ${TARGET_WORKSPACE}/${NS_BROWSER}/docs/env.sh ${TARGET_WORKSPACE}/env.sh
|
|
|
|
fi
|
2013-03-05 15:53:10 +04:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
# issues a make command to all libraries
|
2013-03-06 01:12:53 +04:00
|
|
|
ns-make-libs()
|
2013-03-05 15:53:10 +04:00
|
|
|
{
|
2017-12-07 10:56:50 +03:00
|
|
|
for REPO in $(echo ${NS_BUILDSYSTEM} ${NS_INTERNAL_LIBS} ${NS_FRONTEND_LIBS}); do
|
2017-08-31 01:10:07 +03:00
|
|
|
echo " MAKE: make -C ${REPO} $USE_CPUS $*"
|
2017-12-07 10:56:50 +03:00
|
|
|
${MAKE} -C ${TARGET_WORKSPACE}/${REPO} HOST=${HOST} $USE_CPUS $*
|
2017-08-31 01:10:07 +03:00
|
|
|
if [ $? -ne 0 ]; then
|
|
|
|
return $?
|
|
|
|
fi
|
2014-11-16 17:17:05 +03:00
|
|
|
done
|
2017-12-07 10:56:50 +03:00
|
|
|
}
|
2014-11-16 17:17:05 +03:00
|
|
|
|
2017-12-07 10:56:50 +03:00
|
|
|
# issues make command for all tools
|
|
|
|
ns-make-tools()
|
|
|
|
{
|
|
|
|
for REPO in $(echo ${NS_BUILDSYSTEM} ${NS_TOOLS}); do
|
2017-08-31 01:10:07 +03:00
|
|
|
echo " MAKE: make -C ${REPO} $USE_CPUS $*"
|
2017-12-07 10:56:50 +03:00
|
|
|
${MAKE} -C ${TARGET_WORKSPACE}/${REPO} PREFIX=${BUILD_PREFIX} HOST=${BUILD} $USE_CPUS $*
|
2017-08-31 01:10:07 +03:00
|
|
|
if [ $? -ne 0 ]; then
|
|
|
|
return $?
|
|
|
|
fi
|
2013-03-05 15:53:10 +04:00
|
|
|
done
|
|
|
|
}
|
|
|
|
|
2014-03-16 17:46:27 +04:00
|
|
|
# issues a make command for framebuffer libraries
|
2013-04-12 12:33:58 +04:00
|
|
|
ns-make-libnsfb()
|
|
|
|
{
|
|
|
|
echo " MAKE: make -C libnsfb $USE_CPUS $*"
|
2014-12-21 02:56:00 +03:00
|
|
|
${MAKE} -C ${TARGET_WORKSPACE}/libnsfb HOST=${HOST} $USE_CPUS $*
|
2013-04-12 12:33:58 +04:00
|
|
|
}
|
|
|
|
|
2013-03-05 15:53:10 +04:00
|
|
|
# pulls all repos and makes and installs the libraries and tools
|
|
|
|
ns-pull-install()
|
|
|
|
{
|
|
|
|
ns-pull $*
|
|
|
|
|
2017-12-07 10:56:50 +03:00
|
|
|
ns-make-tools install
|
2013-03-06 01:12:53 +04:00
|
|
|
ns-make-libs install
|
2013-03-05 15:53:10 +04:00
|
|
|
}
|
2013-03-06 01:12:53 +04:00
|
|
|
|
|
|
|
# Passes appropriate flags to make
|
|
|
|
ns-make()
|
|
|
|
{
|
2014-12-21 02:56:00 +03:00
|
|
|
${MAKE} $USE_CPUS "$@"
|
2013-03-06 01:12:53 +04:00
|
|
|
}
|