autogen.sh 1.37 KB
Newer Older
dkirov's avatar
dkirov committed
1
#!/usr/bin/env bash
2
  gajimversion="0.16.5"
3
  if [ -d ".hg" ]; then
4 5
    node=$(hg  tip --template "{node}")
    hgversion="-${node:0:12}"
6 7 8 9 10
  else
    hgversion=""
  fi
  echo "define([AC_PACKAGE_VERSION], [${gajimversion}${hgversion}])" > m4/hgversion.m4

11
  AM_ARGS="--add-missing --gnu --copy -Wno-portability"
12 13
  CONF_ARGS=""

14
  echo "[encoding: UTF-8]" > po/POTFILES.in \
15 16
  && for p in `ls data/gui/*.ui`; do echo "[type: gettext/glade]$p" >> \
  po/POTFILES.in; done \
17
  && ls -1 data/gajim.desktop.in.in data/gajim-remote.desktop.in.in \
18
  src/*.py src/common/*.py src/command_system/*.py src/command_system/implementation/*.py src/common/zeroconf/*.py src/plugins/*.py | grep -v ipython_view.py >> \
19
  po/POTFILES.in \
20 21 22 23
  && echo -e "data/gajim.desktop.in\nsrc/ipython_view.py" > po/POTFILES.skip  || exit 1
  if [ $(find plugins/ -name '*.py' | wc -l) -gt 0 ];then
    ls -1 plugins/*/*.py plugins/*/*.ui >> po/POTFILES.skip
  fi
24 25 26 27 28
  if test -z `which pkg-config 2>/dev/null`;then
    echo "***Error: pkg-config not found***"
	echo "See README.html for build requirements."
	exit 1
  fi
29

30 31
  which glibtoolize >/dev/null 2>&1 && LIBTOOLIZE="glibtoolize" || LIBTOOLIZE="libtoolize"

32 33
  mkdir -p config

dkirov's avatar
dkirov committed
34 35
  intltoolize --force --automake \
  && aclocal -I ./m4 \
36
  && $LIBTOOLIZE --copy --force --automake \
dkirov's avatar
dkirov committed
37
  && autoheader \
38
  && autoconf \
39 40
  && automake ${AM_ARGS} \
  && ./configure ${CONF_ARGS} $@