gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] gnash ChangeLog macros/gnashpkgtool.m4


From: Markus Gothe
Subject: [Gnash-commit] gnash ChangeLog macros/gnashpkgtool.m4
Date: Thu, 26 Oct 2006 21:28:33 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Changes by:     Markus Gothe <nihilus>  06/10/26 21:28:33

Modified files:
        .              : ChangeLog 
        macros         : gnashpkgtool.m4 

Log message:
        Added GNASH_PKG_LIBS.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.1403&r2=1.1404
http://cvs.savannah.gnu.org/viewcvs/gnash/macros/gnashpkgtool.m4?cvsroot=gnash&r1=1.9&r2=1.10

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.1403
retrieving revision 1.1404
diff -u -b -r1.1403 -r1.1404
--- ChangeLog   26 Oct 2006 21:25:21 -0000      1.1403
+++ ChangeLog   26 Oct 2006 21:28:33 -0000      1.1404
@@ -1,3 +1,7 @@
+2006-10-25 Markus Gothe <address@hidden>
+
+       * macros/gnashpkgtool.m4: Added GNASH_PKG_LIBS.
+
 2006-10-26 Sandro Santilli <address@hidden>
 
        * server/textformat.h: added missing forward declarations.

Index: macros/gnashpkgtool.m4
===================================================================
RCS file: /sources/gnash/gnash/macros/gnashpkgtool.m4,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -b -r1.9 -r1.10
--- macros/gnashpkgtool.m4      24 Oct 2006 02:27:33 -0000      1.9
+++ macros/gnashpkgtool.m4      26 Oct 2006 21:28:33 -0000      1.10
@@ -35,7 +35,7 @@
 dnl  
 dnl 
 
-dnl $Id: gnashpkgtool.m4,v 1.9 2006/10/24 02:27:33 nihilus Exp $
+dnl $Id: gnashpkgtool.m4,v 1.10 2006/10/26 21:28:33 nihilus Exp $
 
 dnl Generic macros for finding and setting include-paths and library-path
 dnl for packages. Implements GNASH_PKG_INCLUDES() and GNASH_PKG_LIBS()..
@@ -61,7 +61,7 @@
                        if test -f ${with_$1_incl}/$2 ; then
                                ac_cv_path_$1_incl=-I`(cd ${with_$1_incl}; pwd)`
                        else
-                               AC_MSG_ERROR([${with_$1_incl} directory doesn't 
contain $2])
+                               AC_MSG_ERROR([${with_$1_incl} directory doesn't 
contain $2.])
                        fi
                fi
                ])
@@ -92,17 +92,12 @@
                        fi
                done
                fi
-               AC_MSG_CHECKING([for $2 header])
-               AC_MSG_RESULT(${ac_cv_path_$1_incl})
                ])
-       else
-               if test x"${ac_cv_path_$1_incl}" != x"/usr/include"; then
-                       ac_cv_path_$1_incl="-I${ac_cv_path_$1_incl}"
-               else
-                       ac_cv_path_$1_incl=""
-               fi
        fi
        
+       AC_MSG_CHECKING([for $2 header])
+       AC_MSG_RESULT(${ac_cv_path_$1_incl})
+
        if test x"${ac_cv_path_$1_incl}" != x ; then
                UP[]_CFLAGS="${ac_cv_path_$1_incl}"
        else
@@ -116,11 +111,69 @@
 popdef([DOWN])
 ])
 
-AC_DEFUN([GNASH_PKG_LIBS], dnl
+AC_DEFUN([GNASH_PKG_LIBS], dnl GNASH_PKG_LIBS(cairo, cairo_status, [cairo 
render library.])
 [
 pushdef([UP], translit([$1], [a-z], [A-Z]))dnl Uppercase
 pushdef([DOWN], translit([$1], [A-Z], [a-z]))dnl Lowercase
+AC_ARG_ENABLE($1, AC_HELP_STRING([--enable-$1], [Enable support for $3.]),
 
-       AM_CONDITIONAL(HAVE_UP[], [test x"${$1}" = xyes])
+[case "${enableval}" in
+       yes) $1=yes ;;  
+       no)  $1=no ;;
+       *)   
+       AC_MSG_ERROR([bad value ${enableval} for enable-$1 option]) ;;
+esac], $1=yes)
+if test x"${$1}" = x"yes"; then
+       dnl Look for the library
+       AC_ARG_WITH($1_lib, AC_HELP_STRING([--with-$1-lib], [directory where $1 
library is]), with_$1_lib=${withval})
+       AC_CACHE_VAL(ac_cv_path_$1_lib,[
+       if test x"${with_$1_lib}" != x ; then
+               AC_MSG_CHECKING([for lib$1 library in specified directory])
+               if test -f ${with_png_lib}/lib$1.a -o -f 
${with_png_lib}/lib$1.so; then
+                       tmp=`(cd ${with_$1_lib}; pwd)`
+                       ac_cv_path_png_lib="-L${tmp} -l$1"
+                       AC_MSG_RESULT([yes])
+               else
+                       AC_MSG_ERROR([${with_$1_lib} directory doesn't contain 
library $1.])
+                       AC_MSG_RESULT([no])
+               fi
+       fi
+       ])
+
+       dnl If the header doesn't exist, there is no point looking for the 
library.
+       if test x"$PKG_CONFIG" != x -a x"${ac_cv_path_$1_lib}" = x; then
+               $PKG_CONFIG --exists lib$1 && ac_cv_path_$1_lib=`$PKG_CONFIG 
--libs lib$1`
+               $PKG_CONFIG --exists $1 && ac_cv_path_$1_lib=`$PKG_CONFIG 
--libs $1`
+       fi
+
+       if test x"${ac_cv_path_$1_lib}" = x; then
+               AC_CHECK_LIB($1, $2, [ac_cv_path_$1_lib="-l$1"],[
+               libslist="${prefix}/lib64 ${prefix}/lib32 ${prefix}/lib 
/usr/lib64 /usr/lib32 /usr/nekoware/lib /usr/freeware/lib /usr/lib /sw/lib 
/usr/local/lib /home/latest/lib /opt/lib /pkg/lib /opt/local/lib /usr/pkg/lib 
.. ../.."
+               for i in $libslist; do
+                       if test -f "$i/lib$1.a" -o -f "$i/lib$1.so"; then
+                               if test x"$i" != x"/usr/lib"; then
+                                       ac_cv_path_$1_lib="-L$i -l$1"
+                                       break
+                               else
+                                       ac_cv_path_$1_lib=""
+                                       break
+                               fi
+                       fi
+               done])      
+       fi
+
+       AC_MSG_CHECKING([for lib$1 library])      
+       AC_MSG_RESULT(${ac_cv_path_$1_lib})
+
+       if test x"${ac_cv_path_$1_lib}" != x ; then
+               UP[]_LIBS="${ac_cv_path_$1_lib}"
+       else
+               UP[]_LIBS=""
+       fi
+fi
+       AM_CONDITIONAL(HAVE_[]UP, [test x"${$1}" = xyes])
        AC_SUBST(UP[]_LIBS)
+
+popdef([UP])
+popdef([DOWN])
 ])




reply via email to

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