#!/bin/sh
AC_PREREQ(2.60)
-AC_INIT([sdcc], [2.7.2], [sdcc-devel@lists.sourceforge.net])
+AC_INIT(.version)
AC_CONFIG_SRCDIR([Makefile.in])
AC_CONFIG_HEADER(sdccconf.h:sdccconf_in.h)
AC_PROG_AWK
-VERSION=$PACKAGE_VERSION
+AC_MSG_CHECKING(version of the package)
+if test -f ${srcdir}/.version; then
+ { read VERSION; } < ${srcdir}/.version
+ AC_MSG_RESULT($VERSION)
+elif test -f ../.version; then
+ { read VERSION; } < ../.version
+ AC_MSG_RESULT($VERSION)
+else
+ VERSION="0.0.0"
+ AC_MSG_RESULT(unknown using 0.0.0)
+fi
VERSIONHI=`echo $VERSION|$AWK 'BEGIN {FS="."} {print $1}'`
VERSIONLO=`echo $VERSION|$AWK 'BEGIN {FS="."} {print $2}'`
VERSIONP=`echo $VERSION|$AWK 'BEGIN {FS="."} {print $3}'`
AC_MSG_RESULT(${VERSION})
+AC_SUBST(PACKAGE, [sdcc])
AC_SUBST(VERSION)
AC_SUBST(VERSIONHI)
AC_SUBST(VERSIONLO)
dnl Don't use AC_PROG_YACC
AC_CHECK_PROGS(YACC, 'bison -y' byacc yacc, :)
-AC_DEFUN(SDCC_REQUIRE_PROG,
+AC_DEFUN([SDCC_REQUIRE_PROG],
[if test "$1" = ":"; then
AC_MSG_ERROR([Cannot find required program $2.])
fi
# supports option specified as the 2nd parameter
# For example: DD_CPORT(CXX, fPIC)
-AC_DEFUN(adl_DD_COPT, [
+AC_DEFUN([adl_DD_COPT], [
AC_CACHE_CHECK(whether $$1 accepts -$2,sdcc_cv_$1$2,
cat >_test_.c <<EOF
#include <stdio.h>
# Generating output files
# ===========================================================================
-test $OPT_DISABLE_SDCPP = 0 && AC_CONFIG_SUBDIRS(support/cpp2)
+test $OPT_DISABLE_SDCPP = 0 && AC_CONFIG_SUBDIRS(support/cpp)
test $OPT_DISABLE_PACKIHX = 0 && AC_CONFIG_SUBDIRS(support/packihx)
test $OPT_DISABLE_UCSIM = 0 && AC_CONFIG_SUBDIRS(sim/ucsim)
test $OPT_DISABLE_SDCDB = 0 && AC_CONFIG_SUBDIRS(debugger/mcs51)