1 dnl Process this file with autoconf to produce a configure script.
4 AM_CONFIG_HEADER(src/autoconf.h)
8 dnl Checks for programs.
11 AM_INIT_AUTOMAKE(hengband, 1.0.9)
13 AC_ARG_ENABLE(japanese,
14 [ --disable-japanese build english version], use_japanese=no, [AC_DEFINE(JP) AC_DEFINE(EUC)])
17 [ --disable-xim disable xim support], use_xim=no, use_xim=yes)
18 AC_ARG_ENABLE(fontset,
19 [ --disable-fontset disable fontset support], use_fontset=no, use_fontset=yes)
20 AC_ARG_ENABLE(worldscore,
21 [ --disable-worldscore disable worldscore support], ,AC_DEFINE(WORLD_SCORE))
22 AC_ARG_ENABLE(chuukei,
23 [ --enable-chuukei enable internet chuukei support], AC_DEFINE(CHUUKEI))
25 dnl -fno-strength-reduce prevents a bug in some versions of gcc
26 if test "$GCC" = yes; then
27 CFLAGS="$CFLAGS -fno-strength-reduce"
30 dnl Checks for libraries.
31 dnl Replace `main' with a function in -lncurses:
32 AC_CHECK_LIB(ncurses, initscr, [AC_DEFINE(USE_GCU) AC_DEFINE(USE_NCURSES) LIBS="$LIBS -lncurses"])
33 if test "$ac_cv_lib_ncurses_initscr" != yes; then
34 AC_CHECK_LIB(curses, initscr, [AC_DEFINE(USE_GCU) LIBS="$LIBS -lcurses"])
35 if test "$ac_cv_lib_curses_initscr" != yes; then
36 AC_CHECK_LIB(termcap, tgetent, [AC_DEFINE(USE_CAP) LIBS="$LIBS -ltermcap"])
40 dnl Checks for header files.
42 if test "$have_x" = yes; then
45 CFLAGS="$X_CFLAGS $CFLAGS"
46 LDFLAGS="$X_LIBS $LDFLAGS"
47 if test "$use_japanese" != no; then
48 if test "$use_fontset" = yes; then
49 AC_DEFINE(USE_FONTSET)
51 if test "$use_xim" = yes; then
54 if test "$use_fontset" = yes || "$use_xim" = yes; then
56 AC_DEFINE(DEFAULT_LOCALE, "ja_JP.eucJP", Default Japanese Locale)
57 AC_CHECK_LIB(X11, _Xsetlocale, AC_DEFINE(X_LOCALE))
58 AC_CHECK_LIB(xpg4, setlocale, LIBS="$LIBS -lxpg4")
66 AC_CHECK_HEADERS(fcntl.h strings.h sys/file.h sys/ioctl.h sys/time.h termio.h unistd.h)
68 dnl Checks for typedefs, structures, and compiler characteristics.
75 dnl Checks for library functions.
76 AC_PROG_GCC_TRADITIONAL
81 AC_CHECK_FUNCS(gethostname mkdir select socket strstr strtol vasprintf vsnprintf mkstemp)
83 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)