Complete.Org: Mailing Lists: Archives: freeciv-dev: June 1999:
[Freeciv-Dev] detecting Xaw3d
Home

[Freeciv-Dev] detecting Xaw3d

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] detecting Xaw3d
From: David Pfitzner <dwp@xxxxxxxxxxxxxx>
Date: Wed, 23 Jun 1999 22:03:45 +1000 (EST)

This patch attempts to do some basic auto-detection of Xaw3d vs Xaw.
It assumes that if we have Xaw3d, then linking with "-lXaw3d" works, 
which the current configure scheme seems to assume when --with-xaw3d 
is used.

It only applies if the user didn't use --with-xaw or --with-xaw3d
explicitly, and if the right versions of GTK+/imlib were not found.
In that case, it tests -lXaw3d to see if we have Xaw3d, and only
if Xaw3d is not found falls back to trying -lXaw and assuming we 
have plain Xaw.  The patch also introduces a few more explicit
configure errors if Xaw or Xaw3d libraries are not found.

So ./configure with no args will now use the first detected of: 
GTK+, Xaw3d, Xaw.  (As opposed to currently, where it uses GTK+ 
or Xaw, and only uses Xaw3d if --with-xaw3d is specified.)

(Note: after applying this patch, you need to have and re-run 
autoconf, and _then_ run ./configure)

Regards,
-- David
diff -u -r --exclude-from exclude_auto freeciv-cvs/configure.in 
fc-adv/configure.in
--- freeciv-cvs/configure.in    Sat Jun 19 22:35:23 1999
+++ fc-adv/configure.in Wed Jun 23 22:08:16 1999
@@ -169,11 +169,23 @@
     FC_CHECK_X_LIB(Xmu, main)
     FC_CHECK_X_LIB(Xpm, XpmReadFileToPixmap, , 
         AC_MSG_ERROR(Need Xpm library; perhaps try/adjust --with-xpm-lib))
-    if test x$WITH_XAW3D = x; then
-       FC_CHECK_X_LIB(Xaw, main)
+
+    dnl Xaw or Xaw3d:
+    dnl If we specified Xaw or Xaw3d explicitly, check and require that.
+    dnl Else: Check Xaw3d first, in case Xaw is linked there.
+    dnl       If didn't find Xaw3d, check Xaw, and complain if neither.
+    if test -n "$WITH_XAW3D"; then
+       FC_CHECK_X_LIB(Xaw3d, main, , AC_MSG_ERROR(Did not find Xaw3d library))
+    elif test -n "$WITH_XAW"; then
+       FC_CHECK_X_LIB(Xaw, main, , AC_MSG_ERROR(Did not find Xaw library))
     else
-       FC_CHECK_X_LIB(Xaw3d, main)
+       FC_CHECK_X_LIB(Xaw3d, main, ,[NO_XAW3D=1])
+        if test -n "$NO_XAW3D"; then
+           FC_CHECK_X_LIB(Xaw, main, , 
+               AC_MSG_ERROR(Did not find either Xaw or Xaw3d library))
+        fi
     fi
+
     dnl Don't do following because don't want server to link with X:
     dnl LIBS="$LIBS $X_LIBS $X_EXTRA_LIBS"
     CLIENT_CFLAGS="$X_CFLAGS"

[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] detecting Xaw3d, David Pfitzner <=