-AC_DEFUN(EX_CHECK_ALL,
-[ AC_CHECK_LIB($1,$2,
- [ AC_CHECK_HEADER($3,[LIBS="-l$1 ${LIBS}"],AC_MSG_ERROR([Adjust CPPFLAGS so that the $4 header $3 gets found])) ],
- [ AC_MSG_ERROR([
-############################################################################
-I could not find a working copy of $4. Check config.log for hints on why
-this is the case. Maybe you need to set LDFLAGS appropriately so that the
-linker can find lib$1. If you have not installed $4, you can get it
-either from its original home on
-
- $6
-
-Or you can find an archive copy on
-
- http://people.ee.ethz.ch/~oetiker/webtools/rrdtool/pub/libs
-
-The last tested version of $4 is $5.
-############################################################################
-])] )
-]
-)
-
-EX_CHECK_ALL(cgi, cgiInit, cgi.h, cgilib, 0.5, http://www.infodrom.org/projects/cgilib)
-EX_CHECK_ALL(art_lgpl_2, art_vpath_add_point, libart_lgpl/libart.h, libart_lgpl, 2.3.16, ftp://ftp.gnome.org/pub/GNOME/sources/libart_lgpl/2.3/)
-EX_CHECK_ALL(z, zlibVersion, zlib.h, zlib, 1.2.1, http://www.gzip.org/zlib/)
-EX_CHECK_ALL(png, png_access_version_number, png.h, libpng, 1.2.5, http://prdownloads.sourceforge.net/libpng/)
-EX_CHECK_ALL(freetype, FT_Init_FreeType, ft2build.h, freetype, 2.1.5, http://prdownloads.sourceforge.net/freetype/)
-
-dnl Check for Perl.
-AC_PATH_PROG(PERL, perl, no)
-if test "x$PERL" = "xno"; then
- COMP_PERL=
-else
- COMP_PERL="perl_piped perl_shared"
- AC_MSG_CHECKING(for shared library extension)
- SO_EXT=`$PERL -e 'use Config; if (defined $Config{so} and $Config{so} ne 'a') {print "$Config{so}\n"} else {print "so\n"};'`
- AC_MSG_RESULT($SO_EXT)
- AC_MSG_CHECKING(for the C compiler perl wants to use to build its modules)
- PROBLEMCC=`$PERL -e 'use Config; ($cc = $Config{cc}) =~ s/\s.*//; exit 0 if -x $cc; map {if (-x "$_/$cc"){exit 0}} split /:/, $ENV{PATH};print $Config{cc}'`
- if test x$PROBLEMCC != x; then
- AC_MSG_RESULT(no)
- echo Could not find the Compiler: '"'$PROBLEMCC'"'
- echo which has been used to build perl. You may have to compile
- echo your own copy of perl to make this work. Binary perls often
- echo exhibit this problem
- exit 1
- else
- AC_MSG_RESULT(found)
- fi
-fi
-AC_SUBST(COMP_PERL)
-AC_SUBST(SO_EXT)
-
-dnl Check for Tcl.
-withval=""
-AC_ARG_WITH(tcllib,[ --with-tcllib=DIR location of the tclConfig.sh])
-found=0
-AC_MSG_CHECKING(for tclConfig.sh in $withval)
-if test -f "$withval/tclConfig.sh" ; then
- tcl_config=$withval/tclConfig.sh
- found=1
- AC_MSG_RESULT(yes)
- break
-else
- AC_MSG_RESULT(no)
-fi
-
-if test $found -eq 0 ; then
- AC_MSG_WARN([tclConfig.sh not found - Tcl interface won't be built])
-else
- . $tcl_config
-fi
-
-dnl Pass additional perl options when generating Makefile from Makefile.PL
-# Options to pass when configuring perl module
-AC_ARG_WITH(perl-options,
-[ --with-perl-options=[OPTIONS] options to pass on command-line when
- generating Makefile from Makefile.PL],
-[PERL_MAKE_OPTIONS=$withval])
-AC_SUBST(PERL_MAKE_OPTIONS)
-
-AM_CONDITIONAL(COMP_TCL, test x$found = x1 )
-
-AC_SUBST(TCL_PREFIX)
-AC_SUBST(TCL_SHLIB_CFLAGS)
-AC_SUBST(TCL_SHLIB_LD)
-AC_SUBST(TCL_SHLIB_SUFFIX)
-AC_SUBST(TCL_PACKAGE_PATH)
-AC_SUBST(TCL_LD_SEARCH_FLAGS)
-
-
-
-dnl Check for nroff
-AC_PATH_PROGS(NROFF, gnroff nroff)
-AC_PATH_PROGS(TROFF, groff troff)
-
-dnl Does the compiler like -Wall and -pedantic?
-if test "x$GCC" = "xyes"; then
- oCFLAGS=$CFLAGS
- CFLAGS="$CFLAGS -Wall -pedantic -Wshadow -Wpointer-arith -Wcast-align -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -Winline -W"
- AC_CACHE_CHECK(if we can use GCC-specific compiler options, rd_cv_gcc_opt,
- [AC_TRY_COMPILE( , return 0 ,
- rd_cv_gcc_opt=yes,
- rd_cv_gcc_opt=no )
- ]
- )
- if test $rd_cv_gcc_opt = no; then
- CFLAGS=$oCFLAGS
- fi
-fi
-