3 # BSD's m4 probably isn't gonna cut it, use gm4 if it is available
4 type gm4 >/dev/null 2>&1 && M4=gm4 || M4=m4
6 M4_VERSION=$($M4 --version | head -1 | sed -e 's/^\(m4 \)\?(\?GNU M4)\? *//g' )
7 GOOD_M4=$( echo $M4_VERSION | awk -F. '{if( ($1>1) || ( ($1==1) && ($2>4) ) || ( ($1==1) && ($2==4) && ($3>=6) )) print 1 }')
9 if [ "$GOOD_M4" != "1" ]; then
10 echo You have m4 version $M4_VERSION. SXEmacs requires m4 version 1.4.6 or later.
14 # To cater for Solaris
15 if test -d "/usr/xpg4/bin"; then
16 PATH=/usr/xpg4/bin:$PATH
20 type git >/dev/null 2>&1 && GIT=git
26 if test -n "$GIT" -a -n "$($GIT symbolic-ref HEAD 2>/dev/null)"; then
27 TREE_VERSION="$($GIT tag|tail -n1|tr -d v)"
28 GIT_VERSION="$($GIT describe)"
30 TREE_VERSION="22.1.14"
31 GIT_VERSION="no_git_version"
34 emacs_major_version="$(echo $TREE_VERSION|cut -d. -f1)"
35 emacs_minor_version="$(echo $TREE_VERSION|cut -d. -f2)"
36 emacs_beta_version="$(echo $TREE_VERSION|cut -d. -f3)"
37 sxemacs_codename="Geo"
38 sxemacs_git_version="$GIT_VERSION"
40 autoconf_ver=$(autoconf --version 2>/dev/null | head -n1)
41 autoheader_ver=$(autoheader --version 2>/dev/null | head -n1)
42 automake_ver=$(automake --version 2>/dev/null | head -n1)
43 aclocal_ver=$(aclocal --version 2>/dev/null | head -n1)
44 libtool_ver=$(libtool --version 2>/dev/null | head -n1)
47 # When things go wrong... get a bigger hammer!
48 if test -n "$PHAMMER"; then
52 if test -n "$HAMMER"; then
53 if test -n "$GIT" -a -n "$($GIT symbolic-ref HEAD 2>/dev/null)"; then
56 echo "ERROR: Not a git workspace, or you don't have git" >&2
63 cat>sxemacs_version.m4<<EOF
64 dnl autogenerated version number
65 m4_define([SXEM4CS_VERSION], [$emacs_major_version.$emacs_minor_version.$emacs_beta_version])
66 m4_define([SXEM4CS_MAJOR_VERSION], [$emacs_major_version])
67 m4_define([SXEM4CS_MINOR_VERSION], [$emacs_minor_version])
68 m4_define([SXEM4CS_BETA_VERSION], [$emacs_beta_version])
69 m4_define([SXEM4CS_BETA_P], [$emacs_is_beta])
70 m4_define([SXEM4CS_GIT_VERSION], [$sxemacs_git_version])
71 m4_define([SXEM4CS_CODENAME], [$sxemacs_codename])
72 m4_define([4UTOCONF_VERSION], [$autoconf_ver])
73 m4_define([4UTOHEADER_VERSION], [$autoheader_ver])
74 m4_define([4CLOCAL_VERSION], [$aclocal_ver])
75 m4_define([4UTOMAKE_VERSION], [$automake_ver])
76 m4_define([4IBTOOL_VERSION], [$libtool_ver])
79 if test -z "$FORCE"; then
82 rm -rf autom4te.cache aclocal.m4
86 if type glibtoolize 2>/dev/null; then
87 LIBTOOLIZE=glibtoolize
92 autoreconf $FORCE --verbose --install -Wall
94 # hack-o-matic. Using gmp's config.{guess,sub} lets us have properer
95 # detected machine configurations --SY.
96 guess=$(grep GMP config.guess)
97 sub=$(grep GMP config.sub)
98 if test -z "${guess}"; then
99 mv -vf config.guess configfsf.guess
100 cp -v configgmp.guess config.guess
102 if test -z "${sub}"; then
103 mv -vf config.sub configfsf.sub
104 cp -v configgmp.sub config.sub