-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfigure.ac
More file actions
67 lines (54 loc) · 2.1 KB
/
configure.ac
File metadata and controls
67 lines (54 loc) · 2.1 KB
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
66
67
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ([2.69])
AC_INIT([CMatrix], [2.0], [ewfalor@gmail.com])
AC_CONFIG_SRCDIR([cmatrix.c])
AC_CONFIG_HEADERS([config.h])
AM_INIT_AUTOMAKE([foreign -Wall -Werror subdir-objects])
AC_USE_SYSTEM_EXTENSIONS
# Checks for programs.
AC_PROG_CC
AC_PROG_INSTALL
AC_PROG_MAKE_SET
PKG_PROG_PKG_CONFIG
# Checks for header files.
AC_CHECK_HEADERS([fcntl.h stddef.h stdint.h stdlib.h string.h sys/ioctl.h termio.h termios.h unistd.h])
AC_CHECK_HEADERS([curses.h ncurses.h ncursesw/curses.h])
# Detect curses (prefer ncursesw via pkg-config, fall back to search)
have_ncurses_pkg=no
CURSES_LIB_NAME=""
PKG_CHECK_MODULES([NCURSES], [ncursesw], [have_ncurses_pkg=yes
CURSES_LIB_NAME=ncursesw], [
PKG_CHECK_MODULES([NCURSES], [ncurses], [have_ncurses_pkg=yes
CURSES_LIB_NAME=ncurses], [
have_ncurses_pkg=no
])
])
AS_IF([test "x$have_ncurses_pkg" = "xyes"], [
: # use NCURSES_CFLAGS/NCURSES_LIBS via Makefile
], [
AC_SEARCH_LIBS([initscr], [ncursesw ncurses curses tinfo], [
AS_CASE(["$ac_cv_search_initscr"],
[no], [AC_MSG_ERROR([curses (ncurses) development files not found])],
["none required"], [CURSES_LIB_NAME=""],
[-l*], [CURSES_LIB_NAME=`echo "$ac_cv_search_initscr" | sed 's/^-l//'`]
)
AS_IF([test -n "$CURSES_LIB_NAME"], [NCURSES_LIBS="-l$CURSES_LIB_NAME"], [NCURSES_LIBS=""])
], [
AC_MSG_ERROR([curses (ncurses) development files not found])
])
])
AC_SUBST([NCURSES_CFLAGS])
AC_SUBST([NCURSES_LIBS])
AC_SUBST([CURSES_LIB_NAME])
# Checks for typedefs, structures, and compiler characteristics.
AC_C_INLINE
AC_TYPE_PID_T
AC_TYPE_SIZE_T
# Checks for library functions.
AC_CHECK_FUNCS([atexit dup2 getpagesize memset putenv strcasecmp strdup])
# Optional curses functions (after libraries are known)
AC_CHECK_FUNCS([use_default_colors resizeterm wresize])
AC_CONFIG_FILES([Makefile])
AC_ARG_ENABLE(debug, [ --enable-debug Enable debugging (def disabled)],)
AC_OUTPUT