updated INSTALL file to add ./autogen.sh
[xboard.git] / configure.ac
index 8285fb0..97c2d00 100644 (file)
@@ -1,5 +1,23 @@
 dnl| configure.in\r
 dnl|\r
+dnl| Copyright 1992-2001, 2002, 2003, 2004, 2005, 2006, 2007, \r
+dnl| 2008, 2009 Free Software Foundation, Inc.\r
+dnl|\r
+dnl| GNU XBoard is free software: you can redistribute it and/or modify\r
+dnl| it under the terms of the GNU General Public License as published by\r
+dnl| the Free Software Foundation, either version 3 of the License, or (at\r
+dnl| your option) any later version.\r
+dnl| \r
+dnl| GNU XBoard is distributed in the hope that it will be useful, but\r
+dnl| WITHOUT ANY WARRANTY; without even the implied warranty of\r
+dnl| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\r
+dnl| General Public License for more details.\r
+dnl| \r
+dnl| You should have received a copy of the GNU General Public License\r
+dnl| along with this program. If not, see http://www.gnu.org/licenses/.  \r
+dnl| \r
+dnl| --------------------------------------------------------------------\r
+dnl|\r
 dnl| You can process this file with autoconf to produce a configure script.\r
 dnl| However, normally the supplied configure script will work fine.\r
 dnl|\r
@@ -9,12 +27,8 @@ dnl| it portable to sites and systems other than your own), and run autoconf
 dnl| to regenerate configure.  Then submit your changes to be folded into\r
 dnl| the standard version of xboard.\r
 \r
-dnl| need to change these here and in AC_INIT\r
-PRODUCT=xboard\r
-VERSION=4.4  \r
-PATCHLEVEL=0e\r
-\r
-AC_INIT([xboard],[4.4.0e],[bug-xboard@gnu.org])\r
+dnl| define second argument as VERSION.PATCHLEVEL. e.g. 4.4.0j\r
+AC_INIT([xboard],[4.4.0k],[bug-xboard@gnu.org])\r
 AM_INIT_AUTOMAKE\r
 \r
 AC_CONFIG_HEADERS([config.h])\r
@@ -28,8 +42,6 @@ AH_TEMPLATE([HAVE_RANDOM],[template])
 AH_TEMPLATE([HAVE_SYS_SOCKET_H],[template])\r
 AH_TEMPLATE([IBMRTAIX],[template])\r
 AH_TEMPLATE([LAST_PTY_LETTER],[template])\r
-AH_TEMPLATE([PATCHLEVEL],[template])\r
-AH_TEMPLATE([PRODUCT],[template])\r
 AH_TEMPLATE([PTY_ITERATION],[template])\r
 AH_TEMPLATE([PTY_NAME_SPRINTF],[template])\r
 AH_TEMPLATE([PTY_OPEN],[template])\r
@@ -38,7 +50,6 @@ AH_TEMPLATE([REMOTE_SHELL],[template])
 AH_TEMPLATE([RTU],[template])\r
 AH_TEMPLATE([UNIPLUS],[template])\r
 AH_TEMPLATE([USE_PTYS],[template])\r
-AH_TEMPLATE([VERSION],[template])\r
 AH_TEMPLATE([X_WCHAR],[template])\r
 AH_TEMPLATE([ATTENTION],[template])\r
 AH_TEMPLATE([DEFINED_SYS_ERRLIST],[template])\r
@@ -98,7 +109,7 @@ AC_CHECK_LIB(seq, getpseudotty)
 \r
 AC_PATH_XTRA\r
 if test -n "$no_x" ; then\r
-  echo $PRODUCT requires the X Window System header files and libraries!\r
+  echo $PACKAGE requires the X Window System header files and libraries!\r
   echo They were not found on your system.  See FAQ topic C.2.\r
   echo configure failed\r
   exit 1\r
@@ -111,34 +122,31 @@ if test "$xt" == "no" ; then
    exit 1\r
 fi\r
 \r
-AC_ARG_WITH(Xaw3d, [  --with-Xaw3d            use Xaw3d instead of Xaw],\r
-  with_xaw3d="yes", with_xaw3d="no")\r
-\r
-\r
-xaw_headers="no"\r
-if test "$with_xaw3d" == "yes" ; then\r
-   XAW_LIBS="-lXaw3d"\r
-   AC_CHECK_LIB([Xaw3d], [XawTextReplace], xaw3d_lib="yes", xaw3d_lib="no")\r
-   if test "$xaw3d_lib" == "no" ; then\r
-      echo Xaw3d libraries not found\r
-      exit 1\r
-   else\r
-      AC_CHECK_HEADER(X11/Xaw3d/Dialog.h,xaw3d_headers="yes",xaw3d_headers="no")       \r
-      if test "$xaw3d_headers" == "yes" ; then\r
-        AC_DEFINE(USE_XAW3D)\r
-        xaw_headers="yes"\r
-      else\r
-       AC_CHECK_HEADER(X11/Xaw/Dialog.h,xaw_headers="yes")     \r
-      fi\r
-   fi\r
-else\r
+dnl | test if user wants ot use Xaw3d headers\r
+AC_ARG_WITH([Xaw3d],\r
+            [AS_HELP_STRING([--with-Xaw3d],\r
+                            [use Xaw3d instead of Xaw])],\r
+            [with_xaw3d=yes],\r
+            [with_xaw3d=no])\r
+\r
+XAW_LIBS=\r
+AS_IF([test "x$with_xaw3d" != xno],\r
+      [AC_CHECK_LIB([Xaw3d], \r
+                    [XawTextReplace],\r
+                    [AC_SUBST([XAW_LIBS], \r
+                              ["-lXaw3d"])\r
+                     AC_DEFINE([USE_XAW3D], [1],\r
+                               [Define if you want to use Xaw3d])],\r
+                    [AC_CHECK_HEADER(X11/Xaw/Dialog.h,xaw_headers="yes")\r
+                    AC_MSG_FAILURE(\r
+                              [--with-Xaw3d was given, but test for Xaw3d failed])],\r
+                              [-lXaw])])\r
+if test "$with_xaw3d" == "no" ; then\r
    XAW_LIBS="-lXaw"\r
-   AC_CHECK_HEADER(X11/Xaw/Dialog.h,xaw_headers="yes")\r
 fi\r
-\r
 AC_SUBST(XAW_LIBS)\r
 \r
-\r
+dnl | end Xaw3d test\r
 \r
 if test "$xaw_headers" == "no" ; then\r
    echo Xaw headers not found \r
@@ -390,13 +398,6 @@ AC_ARG_ENABLE(sigint,
 fi],\r
 [AC_DEFINE(ATTENTION, 1)])\r
 \r
-AC_DEFINE_UNQUOTED(PRODUCT, "$PRODUCT")\r
-AC_DEFINE_UNQUOTED(VERSION, "$VERSION")\r
-AC_DEFINE_UNQUOTED(PATCHLEVEL, "$PATCHLEVEL")\r
-AC_SUBST(PRODUCT)\r
-AC_SUBST(VERSION)\r
-AC_SUBST(PATCHLEVEL)\r
-\r
 AC_CONFIG_FILES([Makefile cmail])\r
 AC_CONFIG_COMMANDS([test-stamp-h],[test -z "$CONFIG_HEADERS" || date > stamp-h])\r
 AC_CONFIG_COMMANDS([chmod-cmail],[chmod 755 cmail])\r