summaryrefslogtreecommitdiffstats
path: root/configure.ac
blob: 80e3dd3c7e8114fe66e20adf7967dd68336bf1b8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
AC_PREREQ(2.57)
AC_INIT(memedit, 0.8, kernel@pengutronix.de)
AM_INIT_AUTOMAKE([foreign -Wall no-exeext dist-bzip2])
AC_CONFIG_SRCDIR([memedit.c])
AC_CONFIG_HEADER([config.h])
AC_CONFIG_MACRO_DIR([m4])

AM_MAINTAINER_MODE
AM_SILENT_RULES([yes])

# Checks for programs.
AC_CANONICAL_BUILD
AC_CANONICAL_HOST
AC_PROG_CC
AM_PROG_CC_C_O
AC_PROG_LIBTOOL
AC_PROG_LEX
if test "$LEX" != flex; then
  LEX="$SHELL $missing_dir/missing flex"
  AC_SUBST(LEX_OUTPUT_ROOT, lex.yy)
  AC_SUBST(LEXLIB, '')
fi
AC_PROG_YACC

dnl Check for genparse
dnl In version 0.6.5 the API of the generated parser changed. We support
dnl both conventions.
AC_PATH_PROGS(GENPARSE, genparse,, $PATH)
if test -n "$GENPARSE"; then
	GENPARSE_VERS_MAGIC=`set -- \`$GENPARSE --version | awk '{gsub("v", "", $2); gsub("\\\\\\\\.", " ", $2); print $2}'\`; printf "%03d%03d%03d" \$1 \$2 \$3 | sed -e "s/^0*//g"`
elif test ! -e memedit_parser.h; then
	AC_MSG_ERROR([genparse could not be found, please install the genparse package])
fi
AM_CONDITIONAL(HAVE_GENPARSE, test -n "$GENPARSE")
AC_SUBST(GENPARSE_VERS_MAGIC, $GENPARSE_VERS_MAGIC)

# Checks for libraries.

#
# define helper function
#
AC_DEFUN([AC_CHECK_LIBRARY],
    [ac_save_LIBS="$LIBS"
    LIBS="$$3 $ac_save_LIBS"
    AC_CHECK_LIB($1,$2)
    $3=`echo "$LIBS" | sed "s% $ac_save_LIBS$%%"`
    LIBS="$ac_save_LIBS"])


# Checks for libraries.
# FIXME: Replace `main' with a function in `-lncurses':
LIBS="$LIBS -lncurses"
AC_CHECK_LIBRARY(readline, main, READLINE_LIBS)
if test x"${READLINE_LIBS}" = x""; then
	AC_MSG_ERROR([You need the readline library])
fi
READLINE_LIBS="$READLINE_LIBS -lncurses"
AC_SUBST(READLINE_LIBS)

# Checks for header files.

# Checks for typedefs, structures, and compiler characteristics.

# Checks for library functions.
AC_OUTPUT(Makefile)