diff options
Diffstat (limited to 'docs/env.sh')
-rw-r--r-- | docs/env.sh | 180 |
1 files changed, 117 insertions, 63 deletions
diff --git a/docs/env.sh b/docs/env.sh index bb2cbabea..4cb056ec1 100644 --- a/docs/env.sh +++ b/docs/env.sh @@ -1,4 +1,6 @@ -#!/bin/sh +# 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. # # NetSurf Library, tool and browser development support script # @@ -25,7 +27,7 @@ ############################################################################### # deb packages for dpkg based systems -NS_DEV_DEB="build-essential pkg-config git gperf libcurl3-dev libssl-dev libpng-dev libjpeg-dev" +NS_DEV_DEB="build-essential pkg-config git gperf libcurl3-dev libpng-dev libjpeg-dev" NS_TOOL_DEB="flex bison libhtml-parser-perl" if [ "x${NETSURF_GTK_MAJOR}" = "x3" ]; then NS_GTK_DEB="libgtk-3-dev librsvg2-dev" @@ -36,12 +38,20 @@ fi # apt get commandline to install necessary dev packages ns-apt-get-install() { + 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 + NS_DEV_DEB="${NS_DEV_DEB} libssl1.0-dev" + else + NS_DEV_DEB="${NS_DEV_DEB} libssl-dev" + fi sudo apt-get install $(echo ${NS_DEV_DEB} ${NS_TOOL_DEB} ${NS_GTK_DEB}) } # packages for yum installer RPM based systems (tested on fedora 20) -NS_DEV_YUM_RPM="git gcc pkgconfig libexpat-devel openssl-devel libcurl-devel perl-Digest-MD5-File libjpeg-devel libpng-devel" +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" if [ "x${NETSURF_GTK_MAJOR}" = "x3" ]; then NS_GTK_YUM_RPM="gtk3-devel librsvg2-devel" @@ -188,7 +198,7 @@ if [ "x${HOST}" = "x" ]; then HOST=${TARGET_ABI} fi else - HOST_CC_LIST="${HOST}-cc ${HOST}-gcc /opt/netsurf/${HOST}/cross/bin/${HOST}-cc /opt/netsurf/${HOST}/cross/bin/${HOST}-gcc" + HOST_CC_LIST="/opt/netsurf/${HOST}/cross/bin/${HOST}-cc /opt/netsurf/${HOST}/cross/bin/${HOST}-gcc ${HOST}-cc ${HOST}-gcc" for HOST_CC_V in $(echo ${HOST_CC_LIST});do HOST_CC=$(${WHICH_CMD} ${HOST_CC_V}) if [ "x${HOST_CC}" != "x" ];then @@ -203,9 +213,13 @@ else HOST_CC_MACHINE=$(${HOST_CC} -dumpmachine 2>/dev/null) if [ "${HOST_CC_MACHINE}" != "${HOST}" ];then - echo "Compiler dumpmachine differes from HOST setting" + echo "Compiler dumpmachine differs from HOST setting" return 2 fi + + NS_ENV_CC="${HOST_CC}" + export NS_ENV_CC + unset HOST_CC_LIST HOST_CC_V HOST_CC HOST_CC_MACHINE fi @@ -249,64 +263,81 @@ NS_GIT="git://git.netsurf-browser.org" # Buildsystem: everything depends on this NS_BUILDSYSTEM="buildsystem" -# internal libraries all frontends require (order is important) -NS_INTERNAL_LIBS="libwapcaplet libparserutils libhubbub libdom libcss libnsgif libnsbmp libutf8proc libnsutils libnspsl libnslog" +NS_TOOLS="" +NS_FRONTEND_LIBS="" -# The browser itself -NS_BROWSER="netsurf" +BUILD_TARGET="${TARGET:-netsurf}" - -# 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) - # 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="" +case "$BUILD_TARGET" in + libhubbub) + NS_INTERNAL_LIBS="libparserutils" ;; - 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" + + libdom) + NS_INTERNAL_LIBS="libwapcaplet libparserutils libhubbub" ;; - *-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 + + libcss) + NS_INTERNAL_LIBS="libwapcaplet libparserutils" ;; - *) - # default tools required to build the browser - NS_TOOLS="nsgenbind" - # default additional internal libraries - NS_FRONTEND_LIBS="libsvgtiny libnsfb" + + 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 ;; esac @@ -317,7 +348,7 @@ export MAKE # git pull in all repos parameters are passed to git pull ns-pull() { - for REPO in $(echo ${NS_BUILDSYSTEM} ${NS_INTERNAL_LIBS} ${NS_FRONTEND_LIBS} ${NS_TOOLS} ${NS_BROWSER}) ; do + for REPO in $(echo ${NS_BUILDSYSTEM} ${NS_INTERNAL_LIBS} ${NS_FRONTEND_LIBS} ${NS_TOOLS} ${BUILD_TARGET}) ; do echo -n " GIT: Pulling ${REPO}: " if [ -f "${TARGET_WORKSPACE}/${REPO}/.git/config" ]; then (cd ${TARGET_WORKSPACE}/${REPO} && git pull $*; ) @@ -330,19 +361,42 @@ ns-pull() # clone all repositories ns-clone() { + SHALLOW="" + SKIP="" + while [ $# -gt 0 ] + do + case "$1" in + -d | --deps-only) SKIP="${BUILD_TARGET}" + shift + ;; + -s | --shallow) SHALLOW="--depth 1" + shift + ;; + -*) echo "Error: Unknown option: $1" >&2 + exit 1 + ;; + *) # No more options + break + ;; + esac + done + mkdir -p ${TARGET_WORKSPACE} - for REPO in $(echo ${NS_BUILDSYSTEM} ${NS_INTERNAL_LIBS} ${NS_FRONTEND_LIBS} ${NS_RISCOS_LIBS} ${NS_TOOLS} ${NS_BROWSER}) ; do + 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 echo -n " GIT: Cloning ${REPO}: " if [ -f ${TARGET_WORKSPACE}/${REPO}/.git/config ]; then echo "Repository already present" else - (cd ${TARGET_WORKSPACE} && git clone ${NS_GIT}/${REPO}.git; ) + (cd ${TARGET_WORKSPACE} && git clone ${SHALLOW} ${NS_GIT}/${REPO}.git; ) fi done # put current env.sh in place in workspace - 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 + 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 fi } |