gnash-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gnash-commit] gnash/macros x11.m4


From: Rob Savoye
Subject: [Gnash-commit] gnash/macros x11.m4
Date: Fri, 26 Jan 2007 05:14:29 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Changes by:     Rob Savoye <rsavoye>    07/01/26 05:14:29

Added files:
        macros         : x11.m4 

Log message:
        Add our own X11 tests, as the default one won't cross compile.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/macros/x11.m4?cvsroot=gnash&rev=1.1

Patches:
Index: x11.m4
===================================================================
RCS file: x11.m4
diff -N x11.m4
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ x11.m4      26 Jan 2007 05:14:29 -0000      1.1
@@ -0,0 +1,128 @@
+dnl  
+dnl    Copyright (C) 2005, 2006 Free Software Foundation, Inc.
+dnl  
+dnl  This program is free software; you can redistribute it and/or modify
+dnl  it under the terms of the GNU General Public License as published by
+dnl  the Free Software Foundation; either version 2 of the License, or
+dnl  (at your option) any later version.
+dnl  
+dnl  This program is distributed in the hope that it will be useful,
+dnl  but WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+dnl  GNU General Public License for more details.
+dnl  You should have received a copy of the GNU General Public License
+dnl  along with this program; if not, write to the Free Software
+dnl  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+
+
+dnl $Id: x11.m4,v 1.1 2007/01/26 05:14:29 rsavoye Exp $
+
+AC_DEFUN([GNASH_PATH_X11],
+[
+  AC_ARG_ENABLE(x11, AC_HELP_STRING([--enable-x11], [Enable support for x11 
images]),
+  [case "${enableval}" in
+    yes) x11=yes ;;
+    no)  x11=no ;;
+    *)   AC_MSG_ERROR([bad value ${enableval} for enable-x11 option]) ;;
+  esac], x11=yes)
+
+  if test x"$x11" = x"yes"; then
+    dnl Look for the header
+  AC_ARG_WITH(x11_incl, AC_HELP_STRING([--with-x11-incl], [Directory where 
libx11 header is]), with_x11_incl=${withval})
+    AC_CACHE_VAL(ac_cv_path_x11_incl,[
+    if test x"${with_x11_incl}" != x ; then
+      if test -f ${with_x11_incl}/X11/X.h ; then
+       ac_cv_path_x11_incl=-I`(cd ${with_x11_incl}; pwd)`
+      else
+       AC_MSG_ERROR([${with_x11_incl} directory doesn't contain x11lib.h])
+      fi
+    fi
+    ])
+
+    dnl If the path hasn't been specified, go look for it.
+    if test x"${ac_cv_path_x11_incl}" = x; then
+      AC_MSG_CHECKING([for libx11 headers])
+      for i in $incllist; do
+       if test -f $i/X11/X.h; then
+         if test x"$i" != x"/usr/include"; then
+           ac_cv_path_x11_incl="-I$i"
+           break
+          else
+           ac_cv_path_x11_incl=""
+           break
+         fi
+       fi
+      done
+    fi
+
+    if test x"${ac_cv_path_x11_incl}" = x; then
+      AC_CHECK_HEADERS(X11/X.h, [ac_cv_path_x11_incl=""])
+    fi
+
+    AC_MSG_RESULT(${ac_cv_path_x11_incl})
+
+    if test x"${ac_cv_path_x11_incl}" != x ; then
+      X11_CFLAGS="${ac_cv_path_x11_incl}"
+      AC_MSG_RESULT(${ac_cv_path_x11_incl})
+    else
+      X11_CFLAGS=""
+    fi
+
+    dnl Look for the library
+    AC_ARG_WITH(x11_lib, AC_HELP_STRING([--with-x11-lib], [directory where x11 
library is]), with_x11_lib=${withval})
+    AC_CACHE_VAL(ac_cv_path_x11_lib,[
+      if test x"${with_x11_lib}" != x ; then
+        if test -f ${with_x11_lib}/libX11.a -o -f ${with_x11_lib}/libX11.so; 
then
+         ac_cv_path_x11_lib=`(cd ${with_x11_lib}; pwd)`
+        else
+         AC_MSG_ERROR([${with_x11_lib} directory doesn't contain libx11.])
+        fi
+      fi
+    ])
+
+    dnl If the header doesn't exist, there is no point looking for the library.
+    if test x"${ac_cv_path_x11_incl}" = x; then
+      AC_MSG_CHECKING([for libx11 library])
+      for i in $libslist; do
+             if test -f $i/libX11.a -o -f $i/libX11.so; then
+               if test x"$i" != x"/usr/lib"; then
+                 ac_cv_path_x11_lib="-L$i"
+                 break
+          else
+                 ac_cv_path_x11_lib=""
+                 break
+               fi
+          AC_MSG_RESULT(yes)
+        fi
+      done
+    fi
+
+    if test x"${ac_cv_path_x11_lib}" = x; then
+      AC_CHECK_LIB(x11, x11_mem_init, [ac_cv_path_x11_lib=""])
+      AC_MSG_RESULT(${ac_cv_path_x11_lib})
+    fi
+
+    if test x"${ac_cv_path_x11_lib}" != x ; then
+      X11_LIBS="${ac_cv_path_x11_lib}"
+    else
+      X11_LIBS=""
+    fi
+  fi
+
+  if test x"${ac_cv_path_x11_lib}" != x ; then
+      X11_LIBS="${ac_cv_path_x11_lib} -lx11"
+  else
+      X11_LIBS="-lX11"
+  fi
+
+  AM_CONDITIONAL(HAVE_X11, [test x$x11 = xyes])
+
+  AC_SUBST(X11_CFLAGS)
+  AC_SUBST(X11_LIBS)
+])
+
+# Local Variables:
+# c-basic-offset: 2
+# tab-width: 2
+# indent-tabs-mode: nil
+# End:




reply via email to

[Prev in Thread] Current Thread [Next in Thread]