configure.ac
author mjsousa
Wed, 17 Dec 2014 13:47:37 +0000
changeset 966 cd7fa00ad774
parent 642 2ca07e3b08d6
child 1027 675ee2eeb3ff
permissions -rw-r--r--
When generating C code, use the const_value of a symbolic_variable when it is used in a subrange.
353
17bffb57a8c5 Building compiler with autoconf. Thanks go to Matteo of sirius-es.it
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
     1
#                                               -*- Autoconf -*-
17bffb57a8c5 Building compiler with autoconf. Thanks go to Matteo of sirius-es.it
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
     2
# Process this file with autoconf to produce a configure script.
17bffb57a8c5 Building compiler with autoconf. Thanks go to Matteo of sirius-es.it
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
     3
17bffb57a8c5 Building compiler with autoconf. Thanks go to Matteo of sirius-es.it
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
     4
AC_PREREQ([2.61])
363
a0fb5d224855 fix bug report email address.
Mario de Sousa <msousa@fe.up.pt>
parents: 353
diff changeset
     5
AC_INIT([matiec], [0.1], [msousa@fe.up.pt, beremiz-devel@lists.sourceforge.net])
353
17bffb57a8c5 Building compiler with autoconf. Thanks go to Matteo of sirius-es.it
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
     6
AC_CONFIG_HEADERS([config/config.h])
17bffb57a8c5 Building compiler with autoconf. Thanks go to Matteo of sirius-es.it
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
     7
AC_CONFIG_AUX_DIR(config)
17bffb57a8c5 Building compiler with autoconf. Thanks go to Matteo of sirius-es.it
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
     8
17bffb57a8c5 Building compiler with autoconf. Thanks go to Matteo of sirius-es.it
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
     9
AM_INIT_AUTOMAKE([foreign])
17bffb57a8c5 Building compiler with autoconf. Thanks go to Matteo of sirius-es.it
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
    10
17bffb57a8c5 Building compiler with autoconf. Thanks go to Matteo of sirius-es.it
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
    11
# Before checking for CXX and CC, set CFLAGS and CXXFLAGS because they
17bffb57a8c5 Building compiler with autoconf. Thanks go to Matteo of sirius-es.it
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
    12
# are otherwise initialized to contain -g -O2
17bffb57a8c5 Building compiler with autoconf. Thanks go to Matteo of sirius-es.it
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
    13
if test "x$CFLAGS" = "x"; then
17bffb57a8c5 Building compiler with autoconf. Thanks go to Matteo of sirius-es.it
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
    14
CFLAGS=
17bffb57a8c5 Building compiler with autoconf. Thanks go to Matteo of sirius-es.it
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
    15
fi
17bffb57a8c5 Building compiler with autoconf. Thanks go to Matteo of sirius-es.it
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
    16
if test "x$CXXFLAGS" = "x"; then
17bffb57a8c5 Building compiler with autoconf. Thanks go to Matteo of sirius-es.it
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
    17
CXXFLAGS=
17bffb57a8c5 Building compiler with autoconf. Thanks go to Matteo of sirius-es.it
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
    18
fi
17bffb57a8c5 Building compiler with autoconf. Thanks go to Matteo of sirius-es.it
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
    19
17bffb57a8c5 Building compiler with autoconf. Thanks go to Matteo of sirius-es.it
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
    20
# Checks for programs.
17bffb57a8c5 Building compiler with autoconf. Thanks go to Matteo of sirius-es.it
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
    21
AC_PROG_YACC
17bffb57a8c5 Building compiler with autoconf. Thanks go to Matteo of sirius-es.it
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
    22
AC_PROG_LEX
17bffb57a8c5 Building compiler with autoconf. Thanks go to Matteo of sirius-es.it
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
    23
AC_PROG_CXX
17bffb57a8c5 Building compiler with autoconf. Thanks go to Matteo of sirius-es.it
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
    24
AC_PROG_INSTALL
17bffb57a8c5 Building compiler with autoconf. Thanks go to Matteo of sirius-es.it
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
    25
AC_PROG_LN_S
17bffb57a8c5 Building compiler with autoconf. Thanks go to Matteo of sirius-es.it
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
    26
AC_PROG_MAKE_SET
17bffb57a8c5 Building compiler with autoconf. Thanks go to Matteo of sirius-es.it
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
    27
AC_PROG_RANLIB
622
eaa49b276e17 Add check bison version in configure.ac file.
Manuele Conti <conti.ma@alice.it>
parents: 369
diff changeset
    28
AC_PROG_AWK
eaa49b276e17 Add check bison version in configure.ac file.
Manuele Conti <conti.ma@alice.it>
parents: 369
diff changeset
    29
eaa49b276e17 Add check bison version in configure.ac file.
Manuele Conti <conti.ma@alice.it>
parents: 369
diff changeset
    30
# Check bison version, we need a version great or equal than 2.4 to build matiec.
642
2ca07e3b08d6 Replace test bison version without bash regular expression.
Manuele Conti <conti.ma@alice.it>
parents: 622
diff changeset
    31
version_bison="$(bison --version | sed q | cut -d' ' -f4)"
2ca07e3b08d6 Replace test bison version without bash regular expression.
Manuele Conti <conti.ma@alice.it>
parents: 622
diff changeset
    32
version_bison=${version_bison:0:3}
622
eaa49b276e17 Add check bison version in configure.ac file.
Manuele Conti <conti.ma@alice.it>
parents: 369
diff changeset
    33
eaa49b276e17 Add check bison version in configure.ac file.
Manuele Conti <conti.ma@alice.it>
parents: 369
diff changeset
    34
AS_IF([awk -v ver="$version_bison" 'BEGIN { if (ver < 2.4) exit 1; }'],
eaa49b276e17 Add check bison version in configure.ac file.
Manuele Conti <conti.ma@alice.it>
parents: 369
diff changeset
    35
	[have_bison_correct=yes], [have_bison_correct=no])
eaa49b276e17 Add check bison version in configure.ac file.
Manuele Conti <conti.ma@alice.it>
parents: 369
diff changeset
    36
eaa49b276e17 Add check bison version in configure.ac file.
Manuele Conti <conti.ma@alice.it>
parents: 369
diff changeset
    37
eaa49b276e17 Add check bison version in configure.ac file.
Manuele Conti <conti.ma@alice.it>
parents: 369
diff changeset
    38
if test "x${have_bison_correct}" = xno; then
eaa49b276e17 Add check bison version in configure.ac file.
Manuele Conti <conti.ma@alice.it>
parents: 369
diff changeset
    39
  echo "------------------------------------------"
eaa49b276e17 Add check bison version in configure.ac file.
Manuele Conti <conti.ma@alice.it>
parents: 369
diff changeset
    40
  echo " Wrong bison version: $version_bison < 2.4 "
eaa49b276e17 Add check bison version in configure.ac file.
Manuele Conti <conti.ma@alice.it>
parents: 369
diff changeset
    41
  echo "------------------------------------------"
eaa49b276e17 Add check bison version in configure.ac file.
Manuele Conti <conti.ma@alice.it>
parents: 369
diff changeset
    42
  (exit 1); exit 1;
eaa49b276e17 Add check bison version in configure.ac file.
Manuele Conti <conti.ma@alice.it>
parents: 369
diff changeset
    43
fi
353
17bffb57a8c5 Building compiler with autoconf. Thanks go to Matteo of sirius-es.it
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
    44
17bffb57a8c5 Building compiler with autoconf. Thanks go to Matteo of sirius-es.it
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
    45
# Checks for header files.
17bffb57a8c5 Building compiler with autoconf. Thanks go to Matteo of sirius-es.it
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
    46
AC_CHECK_HEADERS([float.h limits.h stdint.h stdlib.h string.h strings.h sys/timeb.h unistd.h])
17bffb57a8c5 Building compiler with autoconf. Thanks go to Matteo of sirius-es.it
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
    47
17bffb57a8c5 Building compiler with autoconf. Thanks go to Matteo of sirius-es.it
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
    48
# Checks for typedefs, structures, and compiler characteristics.
17bffb57a8c5 Building compiler with autoconf. Thanks go to Matteo of sirius-es.it
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
    49
AC_HEADER_STDBOOL
17bffb57a8c5 Building compiler with autoconf. Thanks go to Matteo of sirius-es.it
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
    50
AC_C_INLINE
17bffb57a8c5 Building compiler with autoconf. Thanks go to Matteo of sirius-es.it
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
    51
AC_TYPE_INT16_T
17bffb57a8c5 Building compiler with autoconf. Thanks go to Matteo of sirius-es.it
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
    52
AC_TYPE_INT32_T
17bffb57a8c5 Building compiler with autoconf. Thanks go to Matteo of sirius-es.it
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
    53
AC_TYPE_INT64_T
17bffb57a8c5 Building compiler with autoconf. Thanks go to Matteo of sirius-es.it
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
    54
AC_TYPE_INT8_T
17bffb57a8c5 Building compiler with autoconf. Thanks go to Matteo of sirius-es.it
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
    55
AC_TYPE_UINT16_T
17bffb57a8c5 Building compiler with autoconf. Thanks go to Matteo of sirius-es.it
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
    56
AC_TYPE_UINT32_T
17bffb57a8c5 Building compiler with autoconf. Thanks go to Matteo of sirius-es.it
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
    57
AC_TYPE_UINT64_T
17bffb57a8c5 Building compiler with autoconf. Thanks go to Matteo of sirius-es.it
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
    58
AC_TYPE_UINT8_T
17bffb57a8c5 Building compiler with autoconf. Thanks go to Matteo of sirius-es.it
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
    59
17bffb57a8c5 Building compiler with autoconf. Thanks go to Matteo of sirius-es.it
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
    60
# Checks for library functions.
17bffb57a8c5 Building compiler with autoconf. Thanks go to Matteo of sirius-es.it
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
    61
AC_FUNC_MALLOC
17bffb57a8c5 Building compiler with autoconf. Thanks go to Matteo of sirius-es.it
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
    62
AC_FUNC_MKTIME
17bffb57a8c5 Building compiler with autoconf. Thanks go to Matteo of sirius-es.it
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
    63
AC_FUNC_REALLOC
17bffb57a8c5 Building compiler with autoconf. Thanks go to Matteo of sirius-es.it
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
    64
AC_CHECK_FUNCS([clock_gettime memset pow strcasecmp strdup strtoul strtoull])
17bffb57a8c5 Building compiler with autoconf. Thanks go to Matteo of sirius-es.it
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
    65
622
eaa49b276e17 Add check bison version in configure.ac file.
Manuele Conti <conti.ma@alice.it>
parents: 369
diff changeset
    66
353
17bffb57a8c5 Building compiler with autoconf. Thanks go to Matteo of sirius-es.it
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
    67
AC_CONFIG_MACRO_DIR([config])
17bffb57a8c5 Building compiler with autoconf. Thanks go to Matteo of sirius-es.it
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
    68
17bffb57a8c5 Building compiler with autoconf. Thanks go to Matteo of sirius-es.it
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
    69
AC_CONFIG_FILES([Makefile \
17bffb57a8c5 Building compiler with autoconf. Thanks go to Matteo of sirius-es.it
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
    70
	absyntax/Makefile \
17bffb57a8c5 Building compiler with autoconf. Thanks go to Matteo of sirius-es.it
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
    71
	absyntax_utils/Makefile \
17bffb57a8c5 Building compiler with autoconf. Thanks go to Matteo of sirius-es.it
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
    72
	stage1_2/Makefile \
17bffb57a8c5 Building compiler with autoconf. Thanks go to Matteo of sirius-es.it
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
    73
	stage3/Makefile \
369
569e7d9e2406 Add iec2iec building in the project Makefiles.
Matteo Facchinetti
parents: 363
diff changeset
    74
	stage4/Makefile \
569e7d9e2406 Add iec2iec building in the project Makefiles.
Matteo Facchinetti
parents: 363
diff changeset
    75
	stage4/generate_c/Makefile \
569e7d9e2406 Add iec2iec building in the project Makefiles.
Matteo Facchinetti
parents: 363
diff changeset
    76
	stage4/generate_iec/Makefile])
353
17bffb57a8c5 Building compiler with autoconf. Thanks go to Matteo of sirius-es.it
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
    77
AC_OUTPUT
17bffb57a8c5 Building compiler with autoconf. Thanks go to Matteo of sirius-es.it
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
    78
17bffb57a8c5 Building compiler with autoconf. Thanks go to Matteo of sirius-es.it
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
    79