1 # This file is part of DisOrder.
2 # Copyright (C) 2004, 2005, 2007, 2008 Richard Kettlewell
4 # This program is free software: you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation, either version 3 of the License, or
7 # (at your option) any later version.
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
14 # You should have received a copy of the GNU General Public License
15 # along with this program. If not, see <http://www.gnu.org/licenses/>.
18 AC_DEFUN([RJK_FIND_GC_H],[
19 AC_CACHE_CHECK([looking for <gc.h>],[rjk_cv_gc_h],[
23 [rjk_cv_gc_h="on default include path"],[
24 oldCPPFLAGS="${CPPFLAGS}"
25 for dir in /usr/include/gc /usr/local/include/gc; do
26 if test "x$GCC" = xyes; then
27 CPPFLAGS="${oldCPPFLAGS} -isystem $dir"
29 CPPFLAGS="${oldCPPFLAGS} -I$dir"
34 [rjk_cv_gc_h=$dir;break],[rjk_cv_gc_h="not found"])
36 CPPFLAGS="${oldCPPFLAGS}"
39 case "$rjk_cv_gc_h" in
41 missing_headers="$missing_headers gc.h"
44 if test "x$GCC" = xyes; then
45 CPPFLAGS="${CPPFLAGS} -isystem $rjk_cv_gc_h"
47 CPPFLAGS="${CPPFLAGS} -I$rjk_cv_gc_h"
53 AC_DEFUN([RJK_CHECK_LIB],[
54 AC_CACHE_CHECK([for $2 in -l$1],[rjk_cv_lib_$1_$2],[
57 AC_LINK_IFELSE([AC_LANG_PROGRAM([$3],[$2;])],
58 [rjk_cv_lib_$1_$2=yes],
59 [rjk_cv_lib_$1_$2=no])
62 if test $rjk_cv_lib_$1_$2 = yes; then
69 AC_DEFUN([RJK_REQUIRE_PCRE_UTF8],[
70 AC_CACHE_CHECK([whether libpcre was built with UTF-8 support],
74 AC_RUN_IFELSE([AC_LANG_PROGRAM([
83 r = pcre_compile("\x80\x80", PCRE_UTF8,
84 &errptr, &erroffset, 0);
86 fprintf(stderr, "pcre_compile: %s at %d",
90 fprintf(stderr, "accepted bogus UTF-8 string\n");
94 [rjk_cv_pcre_utf8=yes],
95 [rjk_cv_pcre_utf8=no],
96 [AC_MSG_WARN([cross-compiling, cannot check libpcre behaviour])])
99 if test $rjk_cv_pcre_utf8 = no; then
100 AC_MSG_ERROR([please rebuild your pcre library with --enable-utf8])
104 AC_DEFUN([RJK_GCOV],[
107 [AS_HELP_STRING([--with-gcov],
108 [Enable coverage testing])],
109 [if test $withval = yes; then
110 CFLAGS="${CFLAGS} -O0 -fprofile-arcs -ftest-coverage"
111 GCOV=`echo $CC | sed s'/gcc/gcov/;s/ .*$//'`;
113 AC_SUBST([GCOV],[$GCOV])