OSDN Git Service

To avoid extra unneeded library dependencies, do not link against the curses or X11...
authorEric Branlund <ebranlund@fastmail.com>
Sun, 15 Sep 2019 08:24:44 +0000 (01:24 -0700)
committerEric Branlund <ebranlund@fastmail.com>
Sun, 15 Sep 2019 08:24:44 +0000 (01:24 -0700)
configure.ac
readme_eng.txt

index def84c7..9bece8a 100644 (file)
@@ -66,13 +66,15 @@ fi
 
 dnl Checks for libraries.
 dnl Replace `main' with a function in -lncurses:
-AC_CHECK_LIB(ncursesw, initscr, [AC_DEFINE(USE_GCU, 1, [Allow -mGCU environment]) AC_DEFINE(USE_NCURSES, 1, [Use ncurses]) LIBS="$LIBS -lncursesw"])
-if test "$ac_cv_lib_ncursesw_initscr" != yes; then
-  AC_CHECK_LIB(ncurses, initscr, [AC_DEFINE(USE_GCU, 1, [Allow -mGCU environment]) AC_DEFINE(USE_NCURSES, 1, [Use ncurses]) LIBS="$LIBS -lncurses"])
-  if test "$ac_cv_lib_ncurses_initscr" != yes; then
-    AC_CHECK_LIB(curses, initscr, [AC_DEFINE(USE_GCU, 1, [Allow -mGCU environment]) LIBS="$LIBS -lcurses"])
-    if test "$ac_cv_lib_curses_initscr" != yes; then
-      AC_CHECK_LIB(termcap, tgetent, [AC_DEFINE(USE_CAP, 1, [Allow -mCAP environment]) LIBS="$LIBS -ltermcap"])
+if test x"$enable_cocoa" != xyes ; then
+  AC_CHECK_LIB(ncursesw, initscr, [AC_DEFINE(USE_GCU, 1, [Allow -mGCU environment]) AC_DEFINE(USE_NCURSES, 1, [Use ncurses]) LIBS="$LIBS -lncursesw"])
+  if test "$ac_cv_lib_ncursesw_initscr" != yes; then
+    AC_CHECK_LIB(ncurses, initscr, [AC_DEFINE(USE_GCU, 1, [Allow -mGCU environment]) AC_DEFINE(USE_NCURSES, 1, [Use ncurses]) LIBS="$LIBS -lncurses"])
+    if test "$ac_cv_lib_ncurses_initscr" != yes; then
+      AC_CHECK_LIB(curses, initscr, [AC_DEFINE(USE_GCU, 1, [Allow -mGCU environment]) LIBS="$LIBS -lcurses"])
+      if test "$ac_cv_lib_curses_initscr" != yes; then
+        AC_CHECK_LIB(termcap, tgetent, [AC_DEFINE(USE_CAP, 1, [Allow -mCAP environment]) LIBS="$LIBS -ltermcap"])
+      fi
     fi
   fi
 fi
@@ -87,7 +89,7 @@ dnl Removing it or conditionally executing it will likely lead to warnings
 dnl on that platform about the preprocessor disagreeing with the compiler on
 dnl the tests in AC_CHECK_HEADERS.
 AC_PATH_XTRA
-if test "$have_x" = yes; then
+if test "$have_x" = yes && test x"$enable_cocoa" != xyes ; then
   LIBS="$LIBS -lX11"
   AC_DEFINE(USE_X11, 1, [Allow -mX11 environment])
   CFLAGS="$X_CFLAGS $CFLAGS"
index ca850e3..6474d10 100644 (file)
@@ -67,7 +67,7 @@ downloading the source archive and running
 
 tar -zxvf hengband-x.x.x.tar.gz
 cd hengband-x.x.x
-./configure --disable-japanese --enable-cocoa --without-x
+./configure --disable-japanese --enable-cocoa
 make install
 
 from a terminal where you substitute x.x.x with the version number you