OSDN Git Service

[Delete] 未使用になったlibcurlの関連ファイル
[hengbandforosx/hengbandosx.git] / configure.ac
1 dnl Process this file with autoconf to produce a configure script.
2 AC_INIT(hengband, 3.0.0.0)
3
4 AC_CONFIG_MACRO_DIRS([m4])
5 AC_CONFIG_HEADERS(src/autoconf.h)
6 AC_CONFIG_SRCDIR(src/main.cpp)
7 AM_INIT_AUTOMAKE
8
9 AC_ARG_WITH(setgid,
10 [  --with-setgid=NAME      install hengband as group NAME],
11 [case "${withval}" in
12   no) GAMEGROUP="";;
13   yes) AC_MSG_ERROR(missing argument for --with-setgid);;
14   *) GAMEGROUP="$withval";;
15 esac])
16 AC_SUBST(GAMEGROUP)
17 AM_CONDITIONAL(SET_GID, test "$GAMEGROUP" != "")
18
19 dnl generate the installation path for the ./lib/ folder
20 if test "$GAMEGROUP" != ""; then
21   MY_EXPAND_DIR(game_libpath, "$datarootdir/games/$PACKAGE/lib/")
22 else
23   MY_EXPAND_DIR(game_libpath, "./lib/")
24   bindir=".."
25 fi
26
27 dnl overwrite the path with an user-specified value
28 AC_ARG_WITH(libpath,
29 [  --with-libpath=path     specify the path to the Hengband lib folder],
30 [game_libpath="$withval"])
31
32 AC_ARG_WITH(varpath,
33 [  --with-varpath=path     specify the path to the Hengband var folder],
34 [game_varpath="$withval"],
35 [game_varpath="$game_libpath"])
36
37 AC_DEFINE_UNQUOTED(DEFAULT_LIB_PATH, "$game_libpath", [Path to the Hengband lib folder])
38 DEFAULT_LIB_PATH="$game_libpath"
39 AC_SUBST(DEFAULT_LIB_PATH)
40
41 AC_DEFINE_UNQUOTED(DEFAULT_VAR_PATH, "$game_varpath", [Path to the Hengband var folder])
42 DEFAULT_VAR_PATH="$game_varpath"
43 AC_SUBST(DEFAULT_VAR_PATH)
44
45 dnl Checks for programs.
46 AC_LANG(C++)
47 AC_PROG_CXX
48 AX_CXX_COMPILE_STDCXX(20, [ext], [mandatory])
49 PKG_PROG_PKG_CONFIG
50
51 AC_ARG_ENABLE(japanese,
52 [  --disable-japanese      build english version], use_japanese=no, [AC_DEFINE(JP, 1, [Enable Japanese]) AC_DEFINE(EUC, 1, [Use Extended Unix Code])])
53
54 AC_ARG_ENABLE(xim,
55 [  --disable-xim           disable xim support], use_xim=no, use_xim=yes)
56 AC_ARG_ENABLE(fontset,
57 [  --disable-fontset       disable fontset support], use_fontset=no, use_fontset=yes)
58 AC_ARG_ENABLE([xft],
59         AS_HELP_STRING([--enable-xft], [Enable xft support]))
60 AC_ARG_ENABLE(worldscore,
61 [  --disable-worldscore    disable worldscore support], worldscore=no)
62 AC_ARG_ENABLE(chuukei,
63 [  --enable-chuukei        enable internet chuukei support], AC_DEFINE(CHUUKEI, 1, [Chuukei mode]))
64 AC_ARG_ENABLE([pch],
65 [  --disable-pch           disable use of precompiled headers],
66 enable_pch=no, enable_pch=yes)
67 AM_CONDITIONAL([PCH], [test x$enable_pch = xyes])
68
69 dnl Checks for libraries.
70 dnl Replace `main' with a function in -lncurses:
71 AC_CHECK_LIB(ncursesw, initscr, [AC_DEFINE(USE_GCU, 1, [Allow -mGCU environment]) AC_DEFINE(USE_NCURSES, 1, [Use ncurses]) LIBS="$LIBS -lncursesw"])
72 if test "$ac_cv_lib_ncursesw_initscr" != yes; then
73   AC_CHECK_LIB(ncurses, initscr, [AC_DEFINE(USE_GCU, 1, [Allow -mGCU environment]) AC_DEFINE(USE_NCURSES, 1, [Use ncurses]) LIBS="$LIBS -lncurses"])
74   if test "$ac_cv_lib_ncurses_initscr" != yes; then
75     AC_CHECK_LIB(curses, initscr, [AC_DEFINE(USE_GCU, 1, [Allow -mGCU environment]) LIBS="$LIBS -lcurses"])
76     if test "$ac_cv_lib_curses_initscr" != yes; then
77       AC_CHECK_LIB(termcap, tgetent, [AC_DEFINE(USE_CAP, 1, [Allow -mCAP environment]) LIBS="$LIBS -ltermcap"])
78     fi
79   fi
80 fi
81
82 AC_CHECK_LIB(iconv, iconv_open)
83
84 dnl The world score server is currently only available in Japanese.
85 if test "$use_japanese" = no; then
86   worldscore=no
87 fi
88 if test "$worldscore" != no; then
89   PKG_CHECK_MODULES(libssl, [libssl])
90   PKG_CHECK_MODULES(libcrypto, [libcrypto])
91   AC_DEFINE(WORLD_SCORE, 1, [Allow the game to send scores to the score server])
92 fi
93
94 dnl Checks for header files.
95 AC_PATH_XTRA
96 if test "$have_x" = yes; then
97   LIBS="$LIBS -lX11"
98   AC_DEFINE(USE_X11, 1, [Allow -mX11 environment])
99   CXXFLAGS="$X_CFLAGS $CXXFLAGS"
100   LDFLAGS="$X_LIBS $LDFLAGS"
101
102   if test "$use_fontset" = yes; then
103     AC_DEFINE(USE_FONTSET, 1, [Use FontSet])
104   else
105     if test "$use_japanese" != no; then
106       AC_DEFINE(USE_JP_FONTSTRUCT, 1, [Use Kanji without FontSet])
107     fi
108   fi
109
110   if test "$use_xim" = yes; then
111     AC_DEFINE(USE_XIM, 1, [Use X Imput Method])
112   fi
113
114   if test "$use_fontset" = yes || test "$use_xim" = yes; then
115     AC_DEFINE(USE_LOCALE, 1, [Support Locale])
116     if test "$use_japanese" != no; then
117       AC_DEFINE(DEFAULT_LOCALE, "ja_JP.eucJP", Default Japanese Locale)
118     fi
119     AC_CHECK_LIB(X11, _Xsetlocale, AC_DEFINE(X_LOCALE, 1, [Use XLocale]))
120     AC_CHECK_LIB(xpg4, setlocale, LIBS="$LIBS -lxpg4")
121   fi
122
123   AS_IF([test "x$enable_xft" = "xyes"], [
124     PKG_CHECK_MODULES(XFT, [xft],
125       [AC_DEFINE([USE_XFT], [1], [Use XFT])])
126   ])
127 fi
128
129 if test "$use_japanese" != no; then
130   AC_CHECK_PROG(NKF, nkf, yes)
131   if test x"$NKF" != x"yes"; then
132     AC_MSG_ERROR([nkf is not found. Please install nkf.])
133   fi
134 fi
135
136 if test "$enable_pch" != no; then
137   dnl md5sum, sha224sum, sha256sum, sha384sum, sha512sum and b2sum are
138   dnl frequently available on Linux.  md5 is available on macOS and OpenBSD.
139   dnl sha1, sha256, and sha512 are available on OpenBSD.
140   AC_PATH_PROGS(PCH_CHECKSUMMER, [md5sum md5 sha1sum sha1 sha224sum sha256sum sha256 sha384sum sha512sum sha512 b2sum], [none])
141   AC_ARG_VAR([PCH_CHECKSUMMER], [full path to a utility to compute the checksum for the precompiled header; checksum is for ccache's pch_external_checksum])
142 fi
143
144 AC_CHECK_HEADERS(fcntl.h sys/file.h sys/ioctl.h sys/time.h termio.h unistd.h stdint.h)
145
146 dnl Checks for typedefs, structures, and compiler characteristics.
147 AC_C_CONST
148 AC_TYPE_PID_T
149 AC_TYPE_SIZE_T
150 AC_STRUCT_TM
151
152 dnl Checks for library functions.
153 AC_PROG_GCC_TRADITIONAL
154 AC_FUNC_MEMCMP
155 AC_FUNC_STRFTIME
156 AC_FUNC_VPRINTF
157 AC_CHECK_FUNCS(gethostname mkdir select socket strtol mkstemp usleep)
158
159 AC_CONFIG_FILES(Makefile src/Makefile lib/Makefile lib/apex/Makefile \
160         lib/bone/Makefile lib/data/Makefile \
161         lib/edit/Makefile lib/edit/quests/Makefile lib/edit/towns/Makefile \
162         lib/file/Makefile lib/file/books/Makefile lib/help/Makefile \
163         lib/info/Makefile lib/pref/Makefile lib/save/Makefile \
164         lib/script/Makefile lib/user/Makefile lib/xtra/Makefile \
165         lib/xtra/graf/Makefile lib/xtra/music/Makefile lib/xtra/sound/Makefile)
166 AC_OUTPUT()