OSDN Git Service

切り裂きの大鎌『ブラッディ・ムーン』に関する変更.
[hengband/hengband.git] / configure.in
1 dnl Process this file with autoconf to produce a configure script.
2 AC_INIT(src/main.c)
3
4 AM_CONFIG_HEADER(src/autoconf.h)
5
6 AM_INIT_AUTOMAKE(hengband, 1.7.0)
7
8 AC_ARG_WITH(setgid,
9 [  --with-setgid=NAME      install hengband as group NAME],
10 [case "${withval}" in
11   no) GAMEGROUP="";;
12   yes) AC_MSG_ERROR(missing argument for --with-setgid);;
13   *) GAMEGROUP="$withval";;
14 esac])
15 AC_SUBST(GAMEGROUP)
16 AM_CONDITIONAL(SET_GID, test "$GAMEGROUP" != "")
17
18 AC_LANG_C
19
20 dnl generate the installation path for the ./lib/ folder
21 if test "$GAMEGROUP" != ""; then
22   MY_EXPAND_DIR(game_datadir, "$datadir/games/$PACKAGE/lib/")
23 else
24   MY_EXPAND_DIR(game_datadir, "./lib/")
25   bindir=".."
26 fi
27
28 dnl overwrite the path with an user-specified value
29 AC_ARG_WITH(libpath,
30 [  --with-libpath=path     specify the path to the Hengband lib folder],
31 [game_datadir="$withval"])
32
33 AC_DEFINE_UNQUOTED(DEFAULT_PATH, "$game_datadir", [Path to the Hengband lib folder])
34 DEFAULT_PATH="$game_datadir"
35 AC_SUBST(DEFAULT_PATH)
36
37 dnl Checks for programs.
38 AC_PROG_CC
39
40 AC_ARG_ENABLE(japanese,
41 [  --disable-japanese      build english version], use_japanese=no, [AC_DEFINE(JP, 1, [Enable Japanese]) AC_DEFINE(EUC, 1, [Use Extended Unix Code])])
42
43 AC_ARG_ENABLE(xim,
44 [  --disable-xim           disable xim support], use_xim=no, use_xim=yes)
45 AC_ARG_ENABLE(fontset,
46 [  --disable-fontset       disable fontset support], use_fontset=no, use_fontset=yes)
47 AC_ARG_ENABLE(worldscore,
48 [  --disable-worldscore    disable worldscore support], ,AC_DEFINE(WORLD_SCORE, 1, [Allow the game to send scores to the score server]))
49 AC_ARG_ENABLE(chuukei,
50 [  --enable-chuukei        enable internet chuukei support], AC_DEFINE(CHUUKEI, 1, [Chuukei mode]))
51
52 dnl -fno-strength-reduce prevents a bug in some versions of gcc
53 if test "$GCC" = yes; then
54   CFLAGS="$CFLAGS -fno-strength-reduce"
55 fi
56
57 dnl Checks for libraries.
58 dnl Replace `main' with a function in -lncurses:
59 AC_CHECK_LIB(ncurses, initscr, [AC_DEFINE(USE_GCU, 1, [Allow -mGCU environment]) AC_DEFINE(USE_NCURSES, 1, [Use ncurses]) LIBS="$LIBS -lncurses"])
60 if test "$ac_cv_lib_ncurses_initscr" != yes; then
61   AC_CHECK_LIB(curses, initscr, [AC_DEFINE(USE_GCU, 1, [Allow -mGCU environment]) LIBS="$LIBS -lcurses"])
62   if test "$ac_cv_lib_curses_initscr" != yes; then
63     AC_CHECK_LIB(termcap, tgetent, [AC_DEFINE(USE_CAP, 1, [Allow -mCAP environment]) LIBS="$LIBS -ltermcap"])
64   fi
65 fi
66
67 dnl Checks for header files.
68 AC_PATH_XTRA
69 if test "$have_x" = yes; then
70   LIBS="$LIBS -lX11"
71   AC_DEFINE(USE_X11, 1, [Allow -mX11 environment])
72   CFLAGS="$X_CFLAGS $CFLAGS"
73   LDFLAGS="$X_LIBS $LDFLAGS"
74
75   if test "$use_fontset" = yes; then
76     AC_DEFINE(USE_FONTSET, 1, [Use FontSet])
77   else
78     if test "$use_japanese" != no; then
79       AC_DEFINE(USE_JP_FONTSTRUCT, 1, [Use Kanji without FontSet])
80     fi
81   fi
82
83   if test "$use_xim" = yes; then
84     AC_DEFINE(USE_XIM, 1, [Use X Imput Method])
85   fi
86
87   if test "$use_fontset" = yes || test "$use_xim" = yes; then
88     AC_DEFINE(USE_LOCALE, 1, [Support Locale])
89     if test "$use_japanese" != no; then
90       AC_DEFINE(DEFAULT_LOCALE, "ja_JP.eucJP", Default Japanese Locale)
91     fi
92     AC_CHECK_LIB(X11, _Xsetlocale, AC_DEFINE(X_LOCALE, 1, [Use XLocale]))
93     AC_CHECK_LIB(xpg4, setlocale, LIBS="$LIBS -lxpg4")
94   fi
95 fi
96
97 AC_HEADER_STDC
98 AC_CHECK_HEADERS(fcntl.h strings.h sys/file.h sys/ioctl.h sys/time.h termio.h unistd.h)
99
100 dnl Checks for typedefs, structures, and compiler characteristics.
101 AC_C_CONST
102 AC_TYPE_PID_T
103 AC_TYPE_SIZE_T
104 AC_HEADER_TIME
105 AC_STRUCT_TM
106
107 dnl Checks for library functions.
108 AC_PROG_GCC_TRADITIONAL
109 AC_FUNC_MEMCMP
110 AC_TYPE_SIGNAL
111 AC_FUNC_STRFTIME
112 AC_FUNC_VPRINTF
113 AC_CHECK_FUNCS(gethostname mkdir select socket strtol vasprintf vsnprintf mkstemp usleep)
114
115 AC_OUTPUT(Makefile src/Makefile lib/Makefile lib/apex/Makefile lib/bone/Makefile lib/data/Makefile lib/edit/Makefile lib/file/Makefile lib/help/Makefile lib/info/Makefile lib/pref/Makefile lib/save/Makefile lib/script/Makefile lib/user/Makefile lib/xtra/Makefile lib/xtra/font/Makefile lib/xtra/graf/Makefile lib/xtra/music/Makefile lib/xtra/sound/Makefile)