Debian Codegraph @

lib/libedit/configure.ac

raw
1 # -*- Autoconf -*-
2 # Process this file with autoconf to produce a configure script.
3 #
4 # Compile with debug symbols:
5 # CFLAGS="-ggdb -pedandic -O0" ./configure
6 # CFLAGS="-ggdb -Wall -Wextra -pedantic -O0" ./configure
7 #
8 # Verbose output can be enabled with
9 # "./configure --disable-silent-rules" or "make V=1"
10 #
11
12 AC_PREREQ(2.61)
13 AC_INIT(libedit, [EL_RELEASE],, libedit-[EL_TIMESTAMP])
14 AC_CONFIG_SRCDIR([src/el.c])
15 AC_CONFIG_HEADER([config.h])
16
17 # features of Posix that are extensions to C (define _GNU_SOURCE)
18 AC_USE_SYSTEM_EXTENSIONS
19
20 AM_INIT_AUTOMAKE
21 AC_PROG_LIBTOOL
22
23 # libtool -version-info
24 AC_SUBST(LT_VERSION, [0:36:0])
25
26 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
27
28 # Checks for programs.
29 AC_PROG_CC_C99
30 #AC_PROG_CC
31 AC_PROG_LN_S
32 AC_PROG_AWK
33 EL_MANTYPE
34
35
36 AC_CHECK_LIB(curses, tgetent,,
37 [AC_CHECK_LIB(ncurses, tgetent,,
38 [AC_MSG_ERROR([libcurses or libncurses are required!])] )] )
39
40
41 # Checks for header files.
42 AC_HEADER_DIRENT
43 AC_HEADER_STDC
44 AC_HEADER_SYS_WAIT
45 AC_CHECK_HEADERS([fcntl.h limits.h stdint.h stdlib.h string.h sys/ioctl.h sys/param.h unistd.h curses.h ncurses.h sys/cdefs.h])
46
47 AC_CHECK_HEADER([termios.h], [], [AC_MSG_ERROR([termios.h is required!])],[])
48
49 ## include curses.h to prevent "Present But Cannot Be Compiled"
50 AC_CHECK_HEADERS([term.h],,,
51 [[#if HAVE_CURSES_H
52 # include <curses.h>
53 #elif HAVE_NCURSES_H
54 # include <ncurses.h>
55 #endif
56 ]])
57
58 # Checks for typedefs, structures, and compiler characteristics.
59 AC_C_CONST
60 AC_TYPE_PID_T
61 AC_TYPE_SIZE_T
62 AC_CHECK_TYPES([u_int32_t])
63
64 AC_TRY_COMPILE([
65 #include <limits.h>
66 #include <stddef.h>
67 #if HAVE_STDINT_H
68 # include <stdint.h>
69 #endif
70 ],
71 [size_t x = SIZE_MAX;],
72 [have_size_max=yes],
73 [have_size_max=no])
74 if test "$have_size_max" = yes; then
75 AC_DEFINE([HAVE_SIZE_MAX], [1],
76 [Define to 1 if if your system has SIZE_MAX])
77 fi
78
79 # Checks for library functions.
80 AC_FUNC_FORK
81 AC_PROG_GCC_TRADITIONAL
82 ## _AIX is offended by rpl_malloc and rpl_realloc
83 #AC_FUNC_MALLOC
84 #AC_FUNC_REALLOC
85 AC_TYPE_SIGNAL
86 AC_FUNC_STAT
87 AC_CHECK_FUNCS([getline isascii issetugid wcsdup])
88 EL_GETPW_R_POSIX
89 EL_GETPW_R_DRAFT
90
91 AC_CHECK_MEMBER(struct dirent.d_namlen,
92 AC_DEFINE([HAVE_STRUCT_DIRENT_D_NAMLEN],[1],
93 [Define to 1 if struct dirent has member d_namlen]),,
94 [#if HAVE_DIRENT_H
95 #include <dirent.h>
96 #endif
97 ])
98
99 AH_BOTTOM([
100 #include "sys.h"
101 #define SCCSID
102 #undef LIBC_SCCS
103 #define lint
104 ])
105
106 AC_CONFIG_FILES([Makefile
107 src/Makefile
108 ])
109 AC_OUTPUT