Enlightenment CVS committal

Author  : sebastid
Project : e17
Module  : libs/epsilon

Dir     : e17/libs/epsilon


Modified Files:
        configure.in epsilon-config.in 


Log Message:
* Better usage of m4 macros to get cflags/libs from configure scripts.
* Bail out if the script doesn't find a lib that will result in a
  compile error.

===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/epsilon/configure.in,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -3 -r1.9 -r1.10
--- configure.in        30 Jul 2005 06:16:02 -0000      1.9
+++ configure.in        2 Sep 2005 20:13:21 -0000       1.10
@@ -44,84 +44,73 @@
         [CFLAGS="$CFLAGS -I$withval/include"
         LIBS="-L$withval/lib $LIBS"])
 
-AC_PATH_GENERIC(imlib2, 1.0.0, [
-  AC_SUBST(imlib_libs)
-  AC_SUBST(imlib_cflags) ],
-  AC_MSG_ERROR(Cannot find imlib2: Is imlib2-config in the path?) )
-imlib_libs=`imlib2-config --libs`
-imlib_cflags=`imlib2-config --cflags`
-AC_SUBST(imlib_libs)
-AC_SUBST(imlib_cflags)
-
-have_png="no"
-have_epeg="no"
-epeg_libs=""
-epeg_cflags=""
+AC_PATH_GENERIC(imlib2, 1.0.0,
+  [ have_imlib2="yes" ],
+  [
+    have_imlib2="yes"
+    AC_MSG_ERROR(Cannot find imlib2: Is imlib2-config in the path?)
+  ]
+)
+
 dnl Make sure the epeg header/lib is available
-AC_CHECK_HEADER( Epeg.h, 
-  [ AC_DEFINE(HAVE_EPEG_H, 1, [Epeg.h available]) 
-    have_epeg="yes" 
-    epeg_libs=`epeg-config --libs`
-    epeg_cflags=`epeg-config --cflags` ],
-  [ AC_MSG_WARN(Cannot find Epeg.h on your system: jpeg thumbnail suckage!) ])
-AC_CHECK_LIB(epeg, epeg_file_open, [ 
-    AC_DEFINE(HAVE_EPEG_LIB, 1, [libepeg available]) 
-])
-AC_SUBST(epeg_libs)
-AC_SUBST(epeg_cflags)
+AC_PATH_GENERIC(epeg, 0.9.0,
+  [
+    AC_DEFINE(HAVE_EPEG_H, 1, [Epeg.h is available])
+    have_epeg="yes"
+  ],
+  [
+    have_epeg="yes"
+    AC_MSG_WARN(Cannot find Epeg on your system: jpeg thumbnail suckage!)
+  ]
+)
 
 dnl Make sure the png header/lib is available
-AC_CHECK_HEADER( png.h, 
-  [ AC_DEFINE(HAVE_PNG_H, 1, [png.h available]) 
-    have_png="yes" 
-    LIBS="$LIBS -lpng -lz -lm" ], 
-  [ AC_MSG_ERROR(Cannot find png.h on your system, try --with-png=) ])
-AC_CHECK_LIB(png, png_create_read_struct, [ 
-    AC_DEFINE(HAVE_PNG_LIB, 1, [libpng available]) 
-])
-  
+PKG_CHECK_MODULES(PNG, libpng12 >= 1.2.0,
+  [ have_png="yes" ],
+  [ have_png="no" ]
+)
+
 AC_PATH_PROG(PERL, perl, 0)
 AC_SUBST(PERL)
 
 dnl Make sure the Evas header/lib is available
-AC_CHECK_HEADER( Evas.h, 
-  [ AC_DEFINE(HAVE_EVAS_H, 1, [Evas.h available]) 
-    have_evas="yes" 
-    evas_libs=`evas-config --libs`
-    evas_cflags=`evas-config --cflags` ],
-  [ AC_MSG_WARN(Cannot find Evas.h on your system: edje thumbnail suckage!) ])
-AC_CHECK_LIB(evas, evas_object_rectangle_add, [ 
-    AC_DEFINE(HAVE_EVAS_LIB, 1, [libevas available]) 
-])
-AC_SUBST(evas_libs)
-AC_SUBST(evas_cflags)
+AC_PATH_GENERIC(evas, 0.9.9,
+  [ have_evas="yes" ],
+  [
+    have_evas="yes"
+    AC_MSG_ERROR(Cannot find Evas on your system: jpeg thumbnail suckage!)
+  ]
+)
 
 dnl Make sure the Ecore_Evas header/lib is available
-AC_CHECK_HEADER( Ecore_Evas.h, 
-  [ AC_DEFINE(HAVE_ECORE_EVAS_H, 1, [Ecore_Evas.h available]) 
-    have_evas="yes" 
-    ecore_libs=`ecore-config --libs`
-    ecore_cflags=`ecore-config --cflags` ],
-  [ AC_MSG_WARN(Cannot find Ecore_Evas.h on your system: edje thumbnail suckage
-) ])
-AC_CHECK_LIB(ecore_evas, ecore_evas_buffer_new, [ 
-    AC_DEFINE(HAVE_ECORE_EVAS_LIB, 1, [libecore_evas available]) 
-])
-AC_SUBST(ecore_libs)
-AC_SUBST(ecore_cflags)
+AC_PATH_GENERIC(ecore, 0.9.9,
+  [
+    SAVE_CFLAGS=$CFLAGS;
+    CFLAGS="$CFLAGS $ECORE_CFLAGS"
+    AC_CHECK_HEADER(Ecore_Evas.h, 
+      [
+        have_ecore="yes" 
+      ], [
+        have_ecore="no" 
+        AC_MSG_ERROR(Cannot find Ecore_Evas on your system: edje thumbnail 
suckage)
+      ]
+    )
+    CFLAGS=$SAVE_CFLAGS
+  ],
+  [
+    have_ecore="yes"
+    AC_MSG_ERROR(Cannot find Ecore_Evas on your system: jpeg thumbnail 
suckage!)
+  ]
+)
 
 dnl Make sure the Edje header/lib is available
-AC_CHECK_HEADER( Edje.h, 
-  [ AC_DEFINE(HAVE_EDJE_H, 1, [Edje.h available]) 
-    have_edje="yes" 
-    edje_libs=`edje-config --libs`
-    edje_cflags=`edje-config --cflags` ],
-  [ AC_MSG_WARN(Cannot find Edje.h on your system: edje thumbnail suckage!) ])
-AC_CHECK_LIB(edje, edje_object_add, [ 
-    AC_DEFINE(HAVE_EDJE_LIB, 1, [libedje available]) 
-])
-AC_SUBST(edje_libs)
-AC_SUBST(edje_cflags)
+AC_PATH_GENERIC(edje, 0.5.0,
+  [ have_edje="yes" ],
+  [
+    have_edje="yes"
+    AC_MSG_ERROR(Cannot find Edje on your system: jpeg thumbnail suckage!)
+  ]
+)
 
 
 AC_OUTPUT([
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/epsilon/epsilon-config.in,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -3 -r1.1.1.1 -r1.2
--- epsilon-config.in   10 Dec 2003 04:46:34 -0000      1.1.1.1
+++ epsilon-config.in   2 Sep 2005 20:13:21 -0000       1.2
@@ -42,11 +42,11 @@
       if test @includedir@ != /usr/include ; then
         [EMAIL PROTECTED]@
       fi
-      echo $includes @imlib_cflags@ @epeg_cflags@ -I$prefix/include
+      echo $includes @IMLIB2_CFLAGS@ @EPEG_CFLAGS@ @EDJE_CFLAGS@ @[EMAIL 
PROTECTED]/include
       ;;
     --libs)
       [EMAIL PROTECTED]@
-      echo $libdirs -lepsilon @epeg_libs@ @imlib_libs@ -lpng
+      echo $libdirs -lepsilon @IMLIB2_LIBS@ @EPEG_LIBS@ @EDJE_LIBS@ @PNG_LIBS@
       ;;
     *)
       echo "${usage}" 1>&2




-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
enlightenment-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to