Commit fb5d5cf1 authored by daniel_e's avatar daniel_e
Browse files

Get rid of all deprecated autoconf constructs.

parent 884e4ce6
2002-12-15 Daniel Elstner <daniel.elstner@gmx.net>
* macros/cxx.m4: Get rid of all deprecated autoconf constructs.
* macros/pcre.m4: ditto.
2002-12-15 Daniel Elstner <daniel.elstner@gmx.net>
* configure.ac: Replace the check for gtkmm >= 2.1.0 with a test
......
......@@ -28,18 +28,21 @@ AC_DEFUN([REGEXXER_CXX_HAS_STD_LOCALE],
AC_CACHE_CHECK(
[whether the C++ library supports std::locale],
[regexxer_cv_cxx_has_std_locale],
[
AC_LANG_PUSH([C++])
AC_LINK_IFELSE(
[
AC_LANG_PUSH(C++)
AC_TRY_LINK(
[
#include <iostream>
#include <locale>
],[
std::cout.imbue(std::locale(""));
AC_LANG_PROGRAM(
[[
#include <iostream>
#include <locale>
]],[[
std::cout.imbue(std::locale(""));
]])
],
[regexxer_cv_cxx_has_std_locale=yes],
[regexxer_cv_cxx_has_std_locale=no])
AC_LANG_POP(C++)
AC_LANG_POP([C++])
])
if test "x$regexxer_cv_cxx_has_std_locale" = xyes; then
......@@ -77,22 +80,26 @@ esac
tested_flags=
if test "x$warning_flags" != x
then
echo 'int foo() { return 0; }' > conftest.cc
if test "x$warning_flags" != x; then
{
AC_LANG_PUSH([C++])
AC_LANG_CONFTEST([AC_LANG_SOURCE([[int foo() { return 0; }]])])
conftest_source="conftest.${ac_ext:-cc}"
for flag in $warning_flags
do
# Test whether the compiler accepts the flag. GCC doesn't bail
# out when given an unsupported flag but prints a warning, so
# check the compiler output instead.
regexxer_cxx_out=`$CXX $tested_flags $flag -c conftest.cc 2>&1 || echo failed`
regexxer_cxx_out=`$CXX $tested_flags $flag -c $conftest_source 2>&1 || echo failed`
rm -f "conftest.$OBJEXT"
test "x$regexxer_cxx_out" = x && tested_flags=${tested_flags:+"$tested_flags "}$flag
done
rm -f conftest.cc
rm -f "$conftest_source"
regexxer_cxx_out=
AC_LANG_POP([C++])
}
fi
if test "x$tested_flags" != x
......
......@@ -76,43 +76,44 @@ AC_DEFUN([PCRE_CHECK_UTF8],
[
AC_REQUIRE([PCRE_CHECK_VERSION])
AC_MSG_CHECKING([whether libpcre was compiled with UTF-8 support])
AC_LANG_PUSH(C)
pcre_saved_CFLAGS=$CFLAGS
pcre_saved_LIBS=$LIBS
CFLAGS="$CFLAGS $PCRE_CFLAGS"
LIBS="$LIBS $PCRE_LIBS"
AC_TRY_RUN(
AC_CACHE_CHECK(
[whether libpcre was compiled with UTF-8 support],
[pcre_cv_has_utf8_support],
[
#include <stdio.h>
#include <stdlib.h>
#include <pcre.h>
int main(int argc, char** argv)
{
const char* errmessage = NULL;
int erroffset = 0;
if(pcre_compile(".", PCRE_UTF8, &errmessage, &erroffset, NULL))
exit(0);
fprintf(stderr, "%s\n", errmessage);
exit(1);
return 0;
}
],
[pcre_supports_utf8=yes],
[pcre_supports_utf8=no],
[pcre_supports_utf8="cross compile: assuming yes"])
CFLAGS=$pcre_saved_CFLAGS
LIBS=$pcre_saved_LIBS
AC_LANG_POP(C)
AC_MSG_RESULT([${pcre_supports_utf8}])
if test "x$pcre_supports_utf8" = xno; then
AC_LANG_PUSH([C])
pcre_saved_CFLAGS=$CFLAGS
pcre_saved_LIBS=$LIBS
CFLAGS="$CFLAGS $PCRE_CFLAGS"
LIBS="$LIBS $PCRE_LIBS"
AC_RUN_IFELSE(
[
AC_LANG_PROGRAM(
[[
#include <stdio.h>
#include <stdlib.h>
#include <pcre.h>
]],[[
const char* errmessage = NULL;
int erroffset = 0;
if(pcre_compile(".", PCRE_UTF8, &errmessage, &erroffset, NULL))
exit(0);
fprintf(stderr, "%s\n", errmessage);
exit(1);
]])
],
[pcre_cv_has_utf8_support=yes],
[pcre_cv_has_utf8_support=no],
[pcre_cv_has_utf8_support="cross compile: assuming yes"])
CFLAGS=$pcre_saved_CFLAGS
LIBS=$pcre_saved_LIBS
AC_LANG_POP([C])
])
if test "x$pcre_cv_has_utf8_support" = xno; then
{
AC_MSG_ERROR([[
*** Sorry, the PCRE library installed on your system doesn't support
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment