2009-06-15 02:17:10 +08:00
|
|
|
# Minix libeditline -*- Autoconf -*-
|
2008-06-08 03:03:48 +08:00
|
|
|
# Process this file with autoconf to produce a configure script.
|
|
|
|
|
|
|
|
AC_PREREQ(2.61)
|
2010-07-18 03:45:39 +08:00
|
|
|
AC_INIT(editline, 1.13.0, troglobit@vmlinux.org)
|
2008-06-08 03:03:48 +08:00
|
|
|
AC_CONFIG_SRCDIR([src/editline.c])
|
|
|
|
AC_CONFIG_HEADER([config.h])
|
2010-07-18 04:00:06 +08:00
|
|
|
AC_CONFIG_MACRO_DIR([m4])
|
2008-06-08 03:03:48 +08:00
|
|
|
|
|
|
|
# Prepare automake
|
2008-06-08 06:32:45 +08:00
|
|
|
AM_INIT_AUTOMAKE([dist-bzip2 dist-lzma])
|
2008-06-08 03:03:48 +08:00
|
|
|
|
2010-01-17 05:42:21 +08:00
|
|
|
# Silent "kernel" style build from automake 1.11 and later.
|
|
|
|
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
|
|
|
|
|
2008-06-08 03:03:48 +08:00
|
|
|
# Checks for programs.
|
|
|
|
AC_PROG_CC
|
|
|
|
|
|
|
|
# Checks for libraries.
|
2010-07-18 04:00:06 +08:00
|
|
|
LT_INIT
|
2008-06-08 03:03:48 +08:00
|
|
|
|
|
|
|
# Checks for header files.
|
|
|
|
AC_HEADER_DIRENT
|
2010-07-18 03:45:39 +08:00
|
|
|
AC_HEADER_STAT
|
2008-06-08 03:03:48 +08:00
|
|
|
AC_HEADER_STDC
|
2008-06-09 05:49:32 +08:00
|
|
|
# Check for malloc.h instead of AC_FUNC_MALLOC/REALLOC AIX and others
|
|
|
|
# mess up the traditional malloc check.
|
2008-06-09 06:17:48 +08:00
|
|
|
AC_CHECK_HEADERS([malloc.h signal.h sgtty.h stdlib.h string.h termio.h termios.h])
|
2008-06-08 03:03:48 +08:00
|
|
|
|
|
|
|
# Overrides and types, should be a check.
|
2008-06-08 06:32:45 +08:00
|
|
|
AC_DEFINE([SYS_UNIX], [1], [Default to UNIX backend, should be detected.])
|
|
|
|
AC_DEFINE([HIDE], [1], [Enable static keyword, hides internal methods.])
|
2008-06-08 03:03:48 +08:00
|
|
|
AC_TYPE_SIZE_T
|
|
|
|
|
|
|
|
# Checks for library functions.
|
|
|
|
AC_FUNC_CLOSEDIR_VOID
|
|
|
|
AC_PROG_GCC_TRADITIONAL
|
2008-06-09 05:49:32 +08:00
|
|
|
# Check for malloc.h instead of AC_FUNC_MALLOC/REALLOC AIX and others
|
|
|
|
# mess up the traditional malloc check.
|
|
|
|
#AC_FUNC_MALLOC
|
|
|
|
#AC_FUNC_REALLOC
|
2008-06-08 03:03:48 +08:00
|
|
|
AC_FUNC_STAT
|
2008-12-03 02:09:17 +08:00
|
|
|
AC_CHECK_FUNCS([strchr strdup strrchr tcgetattr perror])
|
2008-06-08 03:03:48 +08:00
|
|
|
|
2010-07-18 08:30:30 +08:00
|
|
|
AC_ARG_ENABLE(default-complete,
|
|
|
|
[ --enable-default-complete Enable default completion handler.],
|
|
|
|
complete=true; AC_DEFINE(CONFIG_DEFAULT_COMPLETE,, [Define to enable the default completion handler.]))
|
2010-07-18 07:41:18 +08:00
|
|
|
AM_CONDITIONAL([CONFIG_DEFAULT_COMPLETE], [test x$complete = xtrue])
|
2008-10-02 07:52:40 +08:00
|
|
|
|
2009-02-09 04:13:54 +08:00
|
|
|
AC_ARG_ENABLE(arrow-keys,
|
|
|
|
[ --enable-arrow-keys Enable ANSI arrow keys.],
|
2010-07-18 08:30:30 +08:00
|
|
|
AC_DEFINE([CONFIG_ANSI_ARROWS],, [Define to include ANSI arrow keys support.]))
|
2009-02-09 04:13:54 +08:00
|
|
|
|
2010-07-18 07:41:18 +08:00
|
|
|
AC_ARG_ENABLE(sigstop,
|
|
|
|
[ --enable-sigstop Enable SIGSTOP key.],
|
2010-07-18 08:30:30 +08:00
|
|
|
AC_DEFINE([CONFIG_SIGSTOP],, [Define to enable SIGSTOP (Ctrl-Z) key.]))
|
2010-07-18 07:41:18 +08:00
|
|
|
|
|
|
|
AC_ARG_ENABLE(terminal-bell,
|
|
|
|
[ --enable-terminal-bell Enable terminal bell on completion.],
|
2010-07-18 08:30:30 +08:00
|
|
|
AC_DEFINE([CONFIG_ANNOYING_NOISE],, [Define to enable terminal bell on completion.]))
|
2009-02-09 04:13:54 +08:00
|
|
|
|
2010-07-18 08:51:25 +08:00
|
|
|
# Restore gnu89 inline semantics on gcc 4.3 and newer
|
|
|
|
saved_cflags="$CFLAGS"
|
|
|
|
CFLAGS="$CFLAGS -fgnu89-inline"
|
|
|
|
AC_COMPILE_IFELSE(AC_LANG_PROGRAM([]), inline_cflags="-fgnu89-inline", inline_cflags="")
|
|
|
|
CFLAGS="$saved_cflags"
|
|
|
|
|
|
|
|
# check for -fvisibility=hidden compiler support (GCC >= 3.4)
|
|
|
|
saved_cflags="$CFLAGS"
|
|
|
|
CFLAGS="$CFLAGS -fvisibility=hidden"
|
|
|
|
AC_COMPILE_IFELSE(AC_LANG_PROGRAM([]),
|
|
|
|
[VISIBILITY_CFLAGS="-fvisibility=hidden"
|
|
|
|
AC_DEFINE([API_EXPORTED], [__attribute__((visibility("default")))], [Default visibility]) ],
|
|
|
|
[ VISIBILITY_CFLAGS=""
|
|
|
|
AC_DEFINE([API_EXPORTED], [], [Default visibility]) ],
|
|
|
|
])
|
|
|
|
CFLAGS="$saved_cflags"
|
|
|
|
|
|
|
|
# check for -Wno-pointer-sign compiler support (GCC >= 4)
|
|
|
|
saved_cflags="$CFLAGS"
|
|
|
|
CFLAGS="$CFLAGS -Wno-pointer-sign"
|
|
|
|
AC_COMPILE_IFELSE(AC_LANG_PROGRAM([]),
|
|
|
|
nopointersign_cflags="-Wno-pointer-sign", nopointersign_cflags="")
|
|
|
|
CFLAGS="$saved_cflags"
|
|
|
|
|
|
|
|
AM_CFLAGS="-std=gnu99 $inline_cflags -W -Wall -Wundef -Wunused -Wstrict-prototypes -Werror-implicit-function-declaration $nopointersign_cflags -Wshadow"
|
|
|
|
AC_SUBST(AM_CFLAGS)
|
|
|
|
|
2008-06-08 06:32:45 +08:00
|
|
|
AC_OUTPUT(Makefile src/Makefile include/Makefile man/Makefile examples/Makefile)
|
2009-02-09 04:13:54 +08:00
|
|
|
|