Add automated test on delayed return value handling in ExternalInterface.call().
[gnash.git] / macros / openvg.m4
blob93b2823a6ed4ada250c8b2c22edd647bc10b1043
1 dnl  
2 dnl Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
3 dnl  
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.
8 dnl  
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],
19   has_openvg=no
20   mesavg=no
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}/VG/openvg.h; then
26         ac_cv_path_openvg_includes="-I`(cd ${with_openvg_includes}; pwd)`"
27       else
28         AC_MSG_ERROR([${with_openvg_includes} directory doesn't contain VG/openvg.h])
29       fi
30     fi
31   ])
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])
41            mesavg=yes
42             else 
43               if test -f $i/VG/ext.h; then
44           AC_DEFINE(HAVE_VG_EXT_H, 1, [Have Freescale OpenVG])
45               fi
46         fi
47         has_openvg=yes
48         if test x"$i" != x"/usr/include"; then
49           ac_cv_path_openvg_includes="-I$i"
50           break
51         else
52           ac_cv_path_openvg_includes=""
53           break
54         fi
55       fi
56     done
57   fi
59   dnl if test x"${has_openvg}" = xno; then
60   dnl   AC_CHECK_HEADER([VG/openvg.h], [ac_cv_path_openvg_includes=""])
61   dnl fi
63   if test x"${mesavg}" = xyes; then
64     OPENVG_CFLAGS="${ac_cv_path_openvg_includes}"
65   else
66     OPENVG_CFLAGS="-DOPENVG_STATIC_LIBRARY ${ac_cv_path_openvg_includes}"
67   fi
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"
76       fi
77     fi
78   ])
80   if test x"${ac_cv_path_openvg_lib}" = x; 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"
85           break
86         else
87           ac_cv_path_openvg_lib="-lOpenVG"
88           break
89         fi
90       fi
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"
96         break
97       fi
98     done
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
102     dnl link time.
103     if test -f $i/libgsl.${shlibext} -o -f $i/libgsl.a; then
104       EXTRA_EGL_LIBS="${EXTRA_EGL_LIBS} -lgsl"
105     fi
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"
110     fi
111     if test -f $i/libcrypto.${shlibext} -o -f $i/libcrypto.a; then
112       EXTRA_EGL_LIBS="${EXTRA_EGL_LIBS} -lcrypto"
113     fi
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=""])
117     fi
118   fi
120   if test x"${ac_cv_path_openvg_lib}" != x ; then
121     OPENVG_LIBS="${ac_cv_path_openvg_lib}"
122     has_openvg="yes"
123   else
124     OPENVG_LIBS=""
125   fi
126   
127   AC_SUBST(EXTRA_EGL_LIBS)
128   AC_SUBST(OPENVG_CFLAGS)
129   AC_SUBST(OPENVG_LIBS)
132 # Local Variables:
133 # c-basic-offset: 2
134 # tab-width: 2
135 # indent-tabs-mode: nil
136 # End: