fix failure of 'make release'
[claws.git] / ac / aspell.m4
index f5c21711e6984d58cf1af86c61b670f5a4c235b3..1103ec8541eee70b2fd32cd65c76827c8d67f032 100644 (file)
@@ -36,6 +36,7 @@ dnl
      if test x$aspell_libs = x ; then
         aspell_libs=$aspell_prefix/lib
      fi
+     aspell_path=$aspell_prefix/lib/aspell
   fi
   if test x$aspell_includes = x ; then
      aspell_includes=/usr/local/include
@@ -43,26 +44,34 @@ dnl
   if test x$aspell_libs = x ; then
      aspell_libs=/usr/local/lib
   fi
-
-  AC_PATH_PROG(ASPELL, aspell, no)
-  min_aspell_version=ifelse([$1], ,.50,$1)
-  AC_MSG_CHECKING(for GNU/aspell - version >= $min_aspell_version)
-  no_aspell=""
-  if test "$ASPELL" = "no" ; then
-     echo "*** The aspell executable could not be found"
-     echo "*** If aspell was installed in PREFIX, make sure PREFIX/bin is in"
-     echo "*** your path, or set the ASPELL environment variable to the"
-     echo "*** full path to aspell or configure with --with-aspell-prefix=PREFIX."
-     ASPELL_CFLAGS=""
-     ASPELL_LIBS=""
-     ASPELL_PATH=""
-     no_aspell=yes
-     ifelse([$3], , :, [$3])
-  else
+  if test x$aspell_path = x ; then
+     aspell_path=/usr/local/lib/aspell
+  fi
+  if test "x$enable_aspelltest" != "xyes" ; then
+     echo "*** Disabling GNU/aspell tests upon user request" 
      ASPELL_CFLAGS="-I$aspell_includes"
      ASPELL_LIBS="-L$aspell_libs -laspell"
-     aspell_version=`$ASPELL version|sed -e "s/\(@(#) International Ispell Version 3.1.20 (but really Aspell \)\(.*\))/\2/"`
-     if test "x$enable_aspelltest" = "xyes" ; then
+     AC_DEFINE_UNQUOTED(ASPELL_PATH, "${aspell_path}/", Define ASPELL's default directory)
+     ifelse([$2], , :, [$2])
+  else   
+     AC_PATH_PROG(ASPELL, aspell, no)
+     min_aspell_version=ifelse([$1], ,.50,$1)
+     AC_MSG_CHECKING(for GNU/aspell - version >= $min_aspell_version)
+     no_aspell=""
+     if test "$ASPELL" = "no" ; then
+        echo "*** The aspell executable could not be found"
+        echo "*** If aspell was installed in PREFIX, make sure PREFIX/bin is in"
+        echo "*** your path, or set the ASPELL environment variable to the"
+        echo "*** full path to aspell or configure with --with-aspell-prefix=PREFIX."
+        ASPELL_CFLAGS=""
+        ASPELL_LIBS=""
+        ASPELL_PATH=""
+        no_aspell=yes
+        ifelse([$3], , :, [$3])
+     else
+        ASPELL_CFLAGS="-I$aspell_includes"
+        ASPELL_LIBS="-L$aspell_libs -laspell"
+        aspell_version=`$ASPELL version|sed -e "s/\(@(#) International Ispell Version 3.1.20 (but really Aspell \)\(.*\))/\2/"`
         rm -f conf.aspelltest
         AC_TRY_RUN([
 #include <stdio.h>
@@ -74,24 +83,23 @@ main ()
 {
  system ("touch conf.aspelltest");
  if(strcmp("$aspell_version","$min_aspell_version")<0){
-   printf("no\n");
    return 1;
    }
  return 0;
 }
         ],, no_aspell=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
+        rm -f conf.aspelltest
        if test "x$no_aspell" = x ; then
            AC_MSG_RESULT(yes)
            AC_MSG_CHECKING(for GNU/aspell dictionaries location)
            aspell_path="`$ASPELL config dict-dir`"
-           AC_DEFINE_UNQUOTED(ASPELL_PATH, "${aspell_path}/")
+           AC_DEFINE_UNQUOTED(ASPELL_PATH, "${aspell_path}/", Define ASPELL's default directory)
            AC_MSG_RESULT($aspell_path)
            AC_MSG_CHECKING(if GNU/aspell is correctly installed)
            ac_save_CFLAGS="$CFLAGS"
            ac_save_LIBS="$LIBS"
            CFLAGS="$CFLAGS $ASPELL_CFLAGS"
            LIBS="$LIBS $ASPELL_LIBS"
-           rm -f conf.aspelltest
            AC_TRY_RUN([
 #include <stdio.h>
 #include <stdlib.h>
@@ -102,10 +110,10 @@ int
 main()
 {
  AspellConfig * aspellconfig = new_aspell_config();
- system("touch conf.aspelltest");
  return 0;
 }
            ],, aspell_failure=yes,)
+          rm -f conftest.c
           CFLAGS="$ac_save_CFLAGS"
            LIBS="$ac_save_LIBS"
            if test "x$aspell_failure" = x ; then     
@@ -126,6 +134,7 @@ main()
              ifelse([$3], , :, [$3])
           fi
        else
+           AC_MSG_RESULT(no)
            ASPELL_CFLAGS=""
            ASPELL_LIBS=""
            ASPELL_PATH=""
@@ -136,6 +145,5 @@ main()
   AC_SUBST(ASPELL_CFLAGS)
   AC_SUBST(ASPELL_LIBS)
   AC_SUBST(ASPELL_PATH)
-  rm -f conf.aspelltest
 ])