Enlightenment CVS committal

Author  : vapier
Project : e17
Module  : libs/evas

Dir     : e17/libs/evas


Modified Files:
        configure.in 


Log Message:
cleanup altivec checks to be more portable
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/evas/configure.in,v
retrieving revision 1.126
retrieving revision 1.127
diff -u -3 -r1.126 -r1.127
--- configure.in        9 Oct 2005 04:22:19 -0000       1.126
+++ configure.in        13 Oct 2005 02:38:04 -0000      1.127
@@ -819,60 +819,54 @@
 AC_MSG_CHECKING(whether to build altivec code)
 AC_ARG_ENABLE(cpu-altivec, 
   [  --enable-cpu-altivec            enable altivec code], [
-     if test x"$enableval" = x"yes" ; then
-        have_altivec="yes"
-        AC_MSG_RESULT(yes)
-       build_cpu_altivec="yes"
-     else
-        AC_MSG_RESULT(no)
-       build_cpu_altivec="yes"
-     fi
-  ],
-  [
-    AC_MSG_RESULT($build_cpu_altivec)
+     build_cpu_altivec=$enableval
   ]
 )
-if test "x$have_altivec" = "xyes"; then
+AC_MSG_RESULT($build_cpu_altivec)
+if test "x$build_cpu_altivec" = "xyes"; then
    AC_CHECK_HEADER(altivec.h,
      [
         AC_DEFINE(BUILD_ALTIVEC, 1, [Build Altivec Code])
-       build_cpu_altivec="yes"
+        AC_DEFINE(HAVE_ALTIVEC_H, 1, [Have altivec.h header file])
+        build_cpu_altivec="yes"
      ],
      [
-       PF=$CFLAGS
+       save_CFLAGS=$CFLAGS
+       save_CPPFLAGS=$CPPFLAGS
        CFLAGS=$CFLAGS" -maltivec"
+       CPPFLAGS=$CPPFLAGS" -maltivec"
+       unset ac_cv_header_altivec_h
        AC_CHECK_HEADER(altivec.h,
          [
             AC_DEFINE(BUILD_ALTIVEC, 1, [Build Altivec Code])
-           build_cpu_altivec="yes"
+            AC_DEFINE(HAVE_ALTIVEC_H, 1, [Have altivec.h header file])
+            build_cpu_altivec="yes"
          ],
          [
             build_cpu_altivec="no"
          ]
        )
-       CFLAGS=$PF
+       CFLAGS=$save_CFLAGS
+       CPPFLAGS=$save_CPPFLAGS
      ]
    )
 fi
-if test "x$have_altivec" = "xyes"; then
+if test "x$build_cpu_altivec" = "xyes"; then
    AC_MSG_CHECKING(whether to use altivec compiler flag)
-   if test $GCC = yes; then
-      if echo "int main(){ return 0;}" | gcc -faltivec -E - > /dev/null 2>&1; 
then
-         AC_MSG_RESULT(yes)
+   if test x"$GCC" = x"yes"; then
+      if echo "int main(){return 0;}" | ${CPP} -faltivec - > /dev/null 2>&1; 
then
          altivec_cflags="-faltivec"
          AC_DEFINE(BUILD_ALTIVEC, 1, [Build Altivec Code])
-      elif echo "int main(){ return 0;}" | gcc -maltivec -E - > /dev/null 
2>&1; then
-         AC_MSG_RESULT(yes)
+      elif echo "int main(){return 0;}" | ${CPP} -maltivec - > /dev/null 2>&1; 
then
          altivec_cflags="-maltivec"
          AC_DEFINE(BUILD_ALTIVEC, 1, [Build Altivec Code])
-      else
-         AC_MSG_RESULT(no)
       fi
-   else
-      AC_MSG_RESULT(no)
    fi
+   AC_MSG_RESULT($altivec_cflags)
+   CFLAGS="$CFLAGS $altivec_cflags"
 fi
 
+
 #######################################
 ## C
 build_cpu_c="no"




-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to