fixed enable zippy in configure script and added some checks for OS X
authorArun Persaud <arun@nubati.net>
Sun, 23 Aug 2009 06:14:11 +0000 (23:14 -0700)
committerArun Persaud <arun@nubati.net>
Sun, 23 Aug 2009 06:14:11 +0000 (23:14 -0700)
make tried to compile zippy even when --disable-zippy was given. Also fixed a bug in xboard.c where #ifdef instead of #if was used to test for ZIPPY (it's either 0 or 1, so we need #if).

Also added some special checks for OS X, not sure if these will do it, but it's a start;)

Makefile.am
configure.ac
xboard.c

index b72e3e5..f84d4bc 100644 (file)
@@ -1,5 +1,12 @@
+
+if ZIPPY
+  ZPY = zippy.c
+else 
+  ZPY =
+endif 
+
 bin_PROGRAMS = xboard
-xboard_SOURCES = backend.c lists.c pgntags.c xedittags.c xhistory.c zippy.c childio.c moves.c uci.c xengineoutput.c xoptions.c gamelist.c parser.l xboard.c xgamelist.c book.c
+xboard_SOURCES = backend.c lists.c pgntags.c xedittags.c xhistory.c $(ZPY) childio.c moves.c uci.c xengineoutput.c xoptions.c gamelist.c parser.l xboard.c xgamelist.c book.c
 
 AM_CPPFLAGS=-DINFODIR='"$(infodir)"'
 AM_LDFLAGS= -lm @XAW_LIBS@
index b985632..8b39396 100644 (file)
@@ -328,6 +328,14 @@ dnl| USE_PTYS=1
       CONF_CFLAGS="-fwritable-strings"
     fi
   ;;
+dnl| OS X
+  *-apple-* )
+    if test -d /usr/X11/lib ; then
+      X_CFLAGS="$X_CFLAGS "
+      X_LIBS="$X_LIBS -L/usr/X11/lib -R/usr/X11/lib"
+      X_PRE_LIBS = "$X_PRE_LIBS -lXpm  -lSM -lICE"
+    fi
+  ;;
 esac
 
 AC_ARG_ENABLE( [xpm],
@@ -388,11 +396,9 @@ AC_ARG_ENABLE( [zippy],
 
 if test x"$enable_zippy" != xno; then
   AC_DEFINE(ZIPPY, 1,[should zippy be enabled])
-  ZIPPY_O=zippy.o
-  ZIPPY_H=zippy.h
 fi
-AC_SUBST(ZIPPY_O)  
-AC_SUBST(ZIPPY_H)  
+AM_CONDITIONAL([ZIPPY], [test x$enable_zippy != xno])
+
 
 AC_ARG_ENABLE(sigint, 
 [AS_HELP_STRING([--enable-sigint],[sending SIGINT (^C) wakes up GNU Chess (default)])],
index 05af22b..d539705 100644 (file)
--- a/xboard.c
+++ b/xboard.c
@@ -1022,7 +1022,7 @@ XtResource clientResources[] = {
     { "localLineEditing", "localLineEditing", XtRBoolean,
        sizeof(Boolean), XtOffset(AppDataPtr, localLineEditing),
        XtRImmediate, (XtPointer) True }, /* not implemented, must be True */
-#ifdef ZIPPY
+#if ZIPPY
     { "zippyTalk", "zippyTalk", XtRBoolean,
        sizeof(Boolean), XtOffset(AppDataPtr, zippyTalk),
        XtRImmediate, (XtPointer) ZIPPY_TALK },