summaryrefslogtreecommitdiff
path: root/.ci/ci-configure.sh
blob: e7bf7255bbe078e67d092bf9ca29bc882cca5f4f (plain)
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
#!/bin/sh

set -e

. .ci/travis.sh

CI_BUILD_TYPE="$1"

DEFAULT_LINUX_COPTS="--prefix=/usr/ --with-tests=regular --disable-cxx-bindings -C"

WAYLAND_LINUX_COPTS=" --enable-wayland --enable-elput --enable-drm \
--enable-wayland-ivi-shell --enable-gl-drm --with-opengl=es --enable-egl"

MISC_LINUX_COPTS=" --enable-harfbuzz --enable-liblz4 --enable-image-loader-webp --enable-xinput22 \
--enable-multisense --enable-lua-old --enable-xpresent --enable-hyphen \
--enable-pixman --enable-pixman-font --enable-pixman-rect --enable-pixman-line \
--enable-pixman-poly --enable-pixman-image --enable-pixman-image-scale-sample \
--enable-image-loader-generic --enable-libuv --enable-tile-rotate --enable-vnc-server \
--enable-sdl --enable-fb --enable-v4l2 --enable-cserve --enable-always-build-examples \
--enable-ecore-wayland --enable-ecore-drm --enable-cancel-ok --with-crypto=gnutls \
--enable-debug --disable-gstreamer1 --enable-gstreamer"

MISC_DISABLED_LINUX_COPTS=" --disable-neon --disable-libeeze --disable-systemd --disable-magic-debug \
--disable-valgrind --disable-gstreamer1 \
--disable-fontconfig --disable-fribidi --disable-poppler --disable-spectre --disable-libraw \
--disable-librsvg --disable-xcf --disable-libmount --disable-tslib --disable-audio \
--disable-pulseaudio --disable-avahi --disable-xinput2 --disable-xim --disable-scim \
--disable-ibus --disable-physics --disable-quick-launch --disable-elua"

RELEASE_READY_LINUX_COPTS=" --with-profile=release"

if [ "$DISTRO" != "" ] ; then
  # Normal build test of all targets
  OPTS="$DEFAULT_LINUX_COPTS"

  if [ "$1" = "wayland" ]; then
    OPTS="$OPTS $WAYLAND_LINUX_COPTS"
  fi

  if [ "$1" = "misc" ]; then
    OPTS="$OPTS $MISC_LINUX_COPTS"
  fi

  if [ "$1" = "misc-disabled" ]; then
    OPTS="$OPTS $MISC_DISABLED_LINUX_COPTS"
  fi

  if [ "$1" = "release-ready" ]; then
    OPTS="$OPTS $RELEASE_READY_LINUX_COPTS"
  fi
  docker exec $(cat $HOME/cid) sh -c 'rm -f ~/.ccache/ccache.conf'
  travis_fold autoreconf autoreconf
  docker exec --env MAKEFLAGS="-j5 -rR" --env EIO_MONITOR_POLL=1 --env CC="ccache gcc" \
    --env CXX="ccache g++" --env CFLAGS="-fdirectives-only" --env CXXFLAGS="-fdirectives-only" \
    --env LD="ld.gold" $(cat $HOME/cid) sh -c "autoreconf -iv"
  travis_endfold autoreconf
  travis_fold configure "configure $OPTS"
  docker exec --env MAKEFLAGS="-j5 -rR" --env EIO_MONITOR_POLL=1 --env CC="ccache gcc" \
    --env CXX="ccache g++" --env CFLAGS="-fdirectives-only" --env CXXFLAGS="-fdirectives-only" \
    --env LD="ld.gold" $(cat $HOME/cid) sh -c "./configure $OPTS"
  travis_endfold configure
else
  OSX_COPTS="--disable-cxx-bindings --with-tests=regular -C"

  # Prepare OSX env for build
  mkdir -p ~/Library/LaunchAgents
  ln -sfv /usr/local/opt/d-bus/*.plist ~/Library/LaunchAgents
  launchctl load ~/Library/LaunchAgents/org.freedesktop.dbus-session.plist
  export PATH="/usr/local/opt/ccache/libexec:$(brew --prefix gettext)/bin:$PATH"

  export CFLAGS="-I/usr/local/opt/openssl/include -frewrite-includes $CFLAGS"
  export LDFLAGS="-L/usr/local/opt/openssl/lib $LDFLAGS"
  export LDFLAGS="-L/usr/local/opt/openssl/lib $LDFLAGS"

  # Normal build test of all targets
  rm -f ~/.ccache/ccache.conf
  travis_fold autoreconf autoreconf
  autoreconf -iv
  travis_endfold autoreconf
  travis_fold configure "configure $OSX_COPTS"
  ./configure $OSX_COPTS
  travis_endfold configure
fi