2 dnl Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
4 dnl This program is free software; you can redistribute it and/or modify
5 dnl it under the terms of the GNU General Public License as published by
6 dnl the Free Software Foundation; either version 3 of the License, or
7 dnl (at your option) any later version.
9 dnl This program is distributed in the hope that it will be useful,
10 dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
11 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 dnl GNU General Public License for more details.
13 dnl You should have received a copy of the GNU General Public License
14 dnl along with this program; if not, write to the Free Software
15 dnl Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
17 AC_DEFUN([GNASH_PATH_OPENVG],
21 dnl Look for the headers.
22 AC_ARG_WITH(openvg_includes, AC_HELP_STRING([--with-openvg-includes], [directory where Openvg headers are]), with_openvg_includes=${withval})
23 AC_CACHE_VAL(ac_cv_path_openvg_includes,[
24 if test x"${with_openvg_includes}" != x; then
25 if test -f ${with_openvg_includes}/openvg.h; then
26 ac_cv_path_openvg_includes="`(cd ${with_openvg_includes}; pwd)`"
28 AC_MSG_ERROR([${with_openvg_includes} directory doesn't contain VG/openvg.h])
33 dnl If the include path hasn't been specified, go look for it.
34 if test x"${ac_cv_path_openvg_includes}" = x; then
35 AC_MSG_CHECKING([for Openvg headers])
36 for i in $incllist; do
37 if test -f $i/VG/openvg.h; then
38 dnl We have the libMesa version of OpenVG 1.0.1
39 if test -f $i/VG/vgext.h; then
40 AC_DEFINE(HAVE_VG_VGEXT_H, 1, [Have LibMESA OpenVG])
43 if test -f $i/VG/ext.h; then
44 AC_DEFINE(HAVE_VG_EXT_H, 1, [Have Freescale OpenVG])
48 if test x"$i" != x"/usr/include"; then
49 ac_cv_path_openvg_includes="-I$i"
52 ac_cv_path_openvg_includes=""
59 dnl if test x"${has_openvg}" = xno; then
60 dnl AC_CHECK_HEADER([VG/openvg.h], [ac_cv_path_openvg_includes=""])
63 if test x"${mesavg}" = xyes; then
64 OPENVG_CFLAGS="${ac_cv_path_openvg_includes}"
66 OPENVG_CFLAGS="-DOPENVG_STATIC_LIBRARY ${ac_cv_path_openvg_includes}"
68 AC_MSG_RESULT(${ac_cv_path_openvg_includes})
70 dnl Look for the libraries.
71 AC_ARG_WITH(openvg_lib, AC_HELP_STRING([--with-openvg-lib], [directory where Openvg libraries are]), with_openvg_lib=${withval})
72 AC_CACHE_VAL(ac_cv_path_openvg_lib,[
73 if test x"${with_openvg_lib}" != x ; then
74 if test -f ${with_openvg_lib}/libOpenVG.a -o -f ${with_openvg_lib}/libOpenVG.${shlibext}; then
75 ac_cv_path_openvg_lib="-L`(cd ${with_openvg_lib}; pwd)` -lOpenVG"
80 if test x"${ac_cv_path_openvg_lib}" -o x"${has_openvg}" = xyes; then
81 for i in $libslist; do
82 if test -f $i/libOpenVG.${shlibext} -o -f $i/libOpenVG.a; then
83 if test ! x"$i" = x"/usr/lib" -a ! x"$i" = x"/usr/lib64"; then
84 ac_cv_path_openvg_lib="-L$i -lOpenVG"
87 ac_cv_path_openvg_lib="-lOpenVG"
91 dnl Ubuntu Oneric (11.10) has moved the OpenVG libraries to an architecture
92 dnl specific directory, I assume to separate the two library versions between
93 dnl X11 (Mesa) and a framebuffer.
94 if test -f $i/mesa-egl/libOpenVG.${shlibext} -o -f $i/mesa-egl/libOpenVG.a; then
95 ac_cv_path_openvg_lib="-L$i/mesa-egl -lOpenVG"
99 dnl The Babbage board wants libgsl too. We put this in a separate
100 dnl variable because all the executables need it when statically
101 dnl linking. With Ltib, when cross compiling, these are needed at
103 if test -f $i/libgsl.${shlibext} -o -f $i/libgsl.a; then
104 EXTRA_EGL_LIBS="${EXTRA_EGL_LIBS} -lgsl"
106 dnl The Babbage board wants libssl too because libcurl
107 dnl is statically linked.
108 if test -f $i/libssl.${shlibext} -o -f $i/libssl.a; then
109 EXTRA_EGL_LIBS="${EXTRA_EGL_LIBS} -lssl"
111 if test -f $i/libcrypto.${shlibext} -o -f $i/libcrypto.a; then
112 EXTRA_EGL_LIBS="${EXTRA_EGL_LIBS} -lcrypto"
114 if test x"${ac_cv_path_openvg_lib}" = x; then
115 AC_CHECK_LIB([OpenVG], [vgClear], [ac_cv_path_openvg_lib="-lOpenVG"],
116 [ac_cv_path_openvg_lib=""])
120 if test x"${ac_cv_path_openvg_lib}" != x ; then
121 OPENVG_LIBS="${ac_cv_path_openvg_lib}"
127 AC_SUBST(EXTRA_EGL_LIBS)
128 AC_SUBST(OPENVG_CFLAGS)
129 AC_SUBST(OPENVG_LIBS)
135 # indent-tabs-mode: nil