configure.ac
author Manuele Conti <conti.ma@alice.it>
Mon, 30 Jul 2012 22:59:00 +0200
changeset 622 eaa49b276e17
parent 369 569e7d9e2406
child 642 2ca07e3b08d6
permissions -rw-r--r--
Add check bison version in configure.ac file.
To build correctly matiec we need bison greater or equals than 2.4 version.
Now the "configure" script is able to check if system has correctly requirements.
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.
eaa49b276e17 Add check bison version in configure.ac file.
Manuele Conti <conti.ma@alice.it>
parents: 369
diff changeset
    31
[[[ $(bison --version) =~ ([0-9][.][0-9]*) ]]] && version_bison="${BASH_REMATCH[[1]]}"
eaa49b276e17 Add check bison version in configure.ac file.
Manuele Conti <conti.ma@alice.it>
parents: 369
diff changeset
    32
eaa49b276e17 Add check bison version in configure.ac file.
Manuele Conti <conti.ma@alice.it>
parents: 369
diff changeset
    33
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
    34
	[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
    35
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
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
    38
  echo "------------------------------------------"
eaa49b276e17 Add check bison version in configure.ac file.
Manuele Conti <conti.ma@alice.it>
parents: 369
diff changeset
    39
  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
    40
  echo "------------------------------------------"
eaa49b276e17 Add check bison version in configure.ac file.
Manuele Conti <conti.ma@alice.it>
parents: 369
diff changeset
    41
  (exit 1); exit 1;
eaa49b276e17 Add check bison version in configure.ac file.
Manuele Conti <conti.ma@alice.it>
parents: 369
diff changeset
    42
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
    43
17bffb57a8c5 Building compiler with autoconf. Thanks go to Matteo of sirius-es.it
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
    44
# 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
    45
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
    46
17bffb57a8c5 Building compiler with autoconf. Thanks go to Matteo of sirius-es.it
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
    47
# 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
    48
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
    49
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
    50
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
    51
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
    52
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
    53
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
    54
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
    55
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
    56
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
    57
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
    58
17bffb57a8c5 Building compiler with autoconf. Thanks go to Matteo of sirius-es.it
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
    59
# 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
    60
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
    61
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
    62
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
    63
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
    64
622
eaa49b276e17 Add check bison version in configure.ac file.
Manuele Conti <conti.ma@alice.it>
parents: 369
diff changeset
    65
353
17bffb57a8c5 Building compiler with autoconf. Thanks go to Matteo of sirius-es.it
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
    66
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
    67
17bffb57a8c5 Building compiler with autoconf. Thanks go to Matteo of sirius-es.it
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
    68
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
    69
	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
    70
	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
    71
	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
    72
	stage3/Makefile \
369
569e7d9e2406 Add iec2iec building in the project Makefiles.
Matteo Facchinetti
parents: 363
diff changeset
    73
	stage4/Makefile \
569e7d9e2406 Add iec2iec building in the project Makefiles.
Matteo Facchinetti
parents: 363
diff changeset
    74
	stage4/generate_c/Makefile \
569e7d9e2406 Add iec2iec building in the project Makefiles.
Matteo Facchinetti
parents: 363
diff changeset
    75
	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
    76
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
    77
17bffb57a8c5 Building compiler with autoconf. Thanks go to Matteo of sirius-es.it
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
    78