-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfigure.ac
More file actions
111 lines (92 loc) · 3.2 KB
/
configure.ac
File metadata and controls
111 lines (92 loc) · 3.2 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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ([2.71])
AC_INIT([rogueclone2s],[9.0],[https://github.com/masoo/rogueclone2s])
AM_INIT_AUTOMAKE
AC_CONFIG_SRCDIR([config.h.in])
AC_CONFIG_HEADERS([config.h])
AH_BOTTOM([/* Provide __BEGIN_DECLS/__END_DECLS if not defined by sys/cdefs.h */
#ifndef __BEGIN_DECLS
# ifdef __cplusplus
# define __BEGIN_DECLS extern "C" {
# define __END_DECLS }
# else
# define __BEGIN_DECLS
# define __END_DECLS
# endif
#endif])
# Checks for programs.
AC_PROG_CC
# Detect host platform.
AC_CANONICAL_HOST
# Checks for libraries.
AS_CASE([$host_os],
[haiku*], [AC_CHECK_LIB([ncurses], [initscr])],
[AC_CHECK_LIB([ncursesw], [initscr])])
AC_CHECK_LIB([tinfow], [cbreak], [], [AC_CHECK_LIB([tinfo], [cbreak])])
AC_CHECK_LIB([kernel32], [_sleep])
# MSYS2/MINGW64: curses.h が ncursesw/ サブディレクトリにあるため
# ncursesw6-config でインクルードパスを取得
AS_CASE([$host_os],
[msys*|mingw*], [
AC_PATH_PROG([NCURSESW_CONFIG], [ncursesw6-config], [no])
AS_IF([test "x$NCURSESW_CONFIG" != "xno"],
[CURSES_CFLAGS=`$NCURSESW_CONFIG --cflags`])
])
AC_SUBST([CURSES_CFLAGS])
# Checks for required header files.
save_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS $CURSES_CFLAGS"
AC_CHECK_HEADERS([curses.h], [], [AC_MSG_ERROR([curses.h is required but not found.])])
CPPFLAGS="$save_CPPFLAGS"
# Checks for header files.
AC_CHECK_HEADERS([fcntl.h sgtty.h stdlib.h stdint.h string.h strings.h sys/file.h sys/time.h termio.h unistd.h windows.h])
AC_CHECK_HEADER_STDBOOL
# Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_C_INLINE
AC_STRUCT_TM
AC_TYPE_SIZE_T
AC_TYPE_INT8_T
AC_TYPE_INT16_T
AC_TYPE_INT32_T
AC_TYPE_UINT8_T
AC_TYPE_UINT16_T
AC_TYPE_UINT32_T
# Checks for library functions.
AC_PROG_GCC_TRADITIONAL
AC_FUNC_MALLOC
AC_FUNC_MEMCMP
AC_FUNC_STAT
AC_CHECK_FUNCS([assume_default_colors attr_get chdir getcwd getenv getlogin memset putenv setenv setlocale sleep strchr strstr wcwidth])
AC_CHECK_DECLS([getlogin], [], [], [#include <unistd.h>])
# Configuration options
AC_ARG_ENABLE([color],
AS_HELP_STRING([--enable-color],
[enable color support (default yes)]), ,)
if test "$enable_color" != "no"; then
AC_DEFINE([COLOR], , [Define to enable color support])
fi
AC_ARG_ENABLE([original],
AS_HELP_STRING([--enable-original],
[enable original style (default no)]), ,)
if test "$enable_original" = "yes"; then
AC_DEFINE([ORIGINAL], , [Define to enable original style])
fi
AC_ARG_ENABLE([menu],
AS_HELP_STRING([--enable-menu],
[enable startup menu (default no)]), ,)
if test "$enable_menu" = "yes"; then
AC_DEFINE([MENU], , [Define to enable startup menu])
fi
AM_CONDITIONAL([ENABLE_MENU], [test "$enable_menu" = "yes"])
# Define constants
AC_DEFINE([TOPSCO], , [Define if you have the 'TOPSCO'])
AC_DEFINE([THROW_TUNNEL], , [Define if you have the 'THROW_TUNNEL'])
# Output files
AC_CONFIG_FILES([Makefile
doc/Makefile
man/Makefile
msg/Makefile
src/Makefile])
AC_OUTPUT