Modernize configure.ac a bit

This commit is contained in:
Rémi Denis-Courmont 2006-09-12 18:35:04 +00:00
parent 6810a85e35
commit ecddc275c8
3 changed files with 30 additions and 25 deletions

View File

@ -38,32 +38,16 @@ dnl
dnl Check for tools
dnl
AC_PROG_CC_C99
AC_USE_SYSTEM_EXTENSIONS
AM_PROG_CC_C_O
AC_PROG_CXX
eval "${CXX} --version" >/dev/null 2>&1 || CXX=""
if test "${CXX}" != ""; then
AC_PROG_CXXCPP
fi
AC_PROG_OBJC
_AM_DEPENDENCIES([OBJC])
AC_PROG_EGREP
AC_PROG_MAKE_SET
AC_PROG_INSTALL
AM_PROG_AS
dnl AC_PROG_EGREP only exists in autoconf 2.54+, so we use AC_EGREP_CPP right
dnl now otherwise it might be set in an obscure if statement.
AC_EGREP_CPP(foo,foo)
dnl AC_PROG_OBJC doesn't seem to exist, this is the KDE workaround
AC_MSG_CHECKING(for an Objective-C compiler)
OBJC="${CXX}"
AC_SUBST(OBJC)
OBJCFLAGS="${CXXFLAGS} -fgnu-runtime -fconstant-string-class=NSConstantString"
AC_SUBST(OBJCFLAGS)
dnl _AM_DEPENDENCIES(OBJC) doesn't work, so hard code OBJCDEPMODE here
#OBJCDEPMODE="depmode=gcc3"
#AC_SUBST(OBJCDEPMODE)
_AM_DEPENDENCIES(OBJC)
AC_MSG_RESULT(not implemented yet)
dnl Find the right ranlib, even when cross-compiling
AC_CHECK_TOOL(RANLIB, ranlib, :)
AC_CHECK_TOOL(STRIP, strip, :)
@ -904,22 +888,27 @@ fi
# fi
#done
AC_CACHE_CHECK([if \$CC accepts -Wall],
AC_CACHE_CHECK([if $CC accepts -Wall],
[ac_cv_c_Wall],
[CFLAGS="-Wall ${CFLAGS_save}"
AC_TRY_COMPILE([],,ac_cv_c_Wall=yes, ac_cv_c_Wall=no)])
AC_CACHE_CHECK([if \$CC accepts -Wconversion],
AC_CACHE_CHECK([if $CC accepts -Wextra],
[ac_cv_c_Werror],
[CFLAGS="-Werror ${CFLAGS_save}"
AC_TRY_COMPILE([],,ac_cv_c_Werror=yes, ac_cv_c_Werror=no)])
AC_CACHE_CHECK([if $CC accepts -Wconversion],
[ac_cv_c_Wconversion],
[CFLAGS="-Wconversion ${CFLAGS_save}"
AC_TRY_COMPILE([],,ac_cv_c_Wconversion=yes, ac_cv_c_Wconversion=no)])
AC_CACHE_CHECK([if \$CC accepts -Wunreachable-code],
AC_CACHE_CHECK([if $CC accepts -Wunreachable-code],
[ac_cv_c_Wunreachable_code],
[CFLAGS="-Wunreachable-code ${CFLAGS_save}"
AC_TRY_COMPILE([],,ac_cv_c_Wunreachable_code=yes, ac_cv_c_Wunreachable_code=no)])
AC_CACHE_CHECK([if \$CC accepts -Wsign-compare],
AC_CACHE_CHECK([if $CC accepts -Wsign-compare],
[ac_cv_c_Wsign_compare],
[CFLAGS="-Wsign-compare ${CFLAGS_save}"
AC_TRY_COMPILE([],,ac_cv_c_Wsign_compare=yes, ac_cv_c_Wsign_compare=no)])
@ -930,6 +919,12 @@ if test "${ac_cv_c_Wall}" != "no"; then
OBJCFLAGS_save="-Wall ${OBJCFLAGS_save}"; OBJCFLAGS="${OBJCFLAGS_save}"
fi
if test "${ac_cv_c_Wextra}" != "no"; then
CFLAGS_save="-Wextra ${CFLAGS_save}"; CFLAGS="${CFLAGS_save}"
CXXFLAGS_save="-Wextra ${CFLAGS_save}"; CXXFLAGS="${CXXFLAGS_save}"
OBJCFLAGS_save="-Wextra ${OBJCFLAGS_save}"; OBJCFLAGS="${OBJCFLAGS_save}"
fi
if test "${ac_cv_c_Wsign_compare}" != "no"; then
CFLAGS_save="-Wsign-compare ${CFLAGS_save}"; CFLAGS="${CFLAGS_save}"
CXXFLAGS_save="-Wsign-compare ${CFLAGS_save}"; CXXFLAGS="${CXXFLAGS_save}"

View File

@ -1,7 +1,17 @@
# Replacements for autoconf 2.59 and older
# Please make official source tarballs with recent autoconf only.
# Copyright (C) 2006 Rémi Denis-Courmont.
# Distribution and usage of this file, verbatim or modified, is permitted
# with no limitations.
AC_DEFUN([AC_PROG_CC_C00],
[ AC_REQUIRE([AC_PROG_CC])dnl
CC="$CC -std=c99"
])
AC_DEFUN([AC_PROG_OBJC], [ ])
AC_DEFUN([AC_USE_SYSTEM_EXTENSIONS],
[ AC_DEFINE([_GNU_SOURCE], [ ], [Enable lots of stuff with glibc.])
])

View File

@ -95,7 +95,7 @@ linkage="c"
#
# On Linux and Solaris, activate 64-bit off_t (by default under BSD)
#
cppflags="${cppflags} -D_FILE_OFFSET_BITS=64 -D__USE_UNIX98 -D_LARGEFILE64_SOURCE -D_REENTRANT -D_THREAD_SAFE -D_GNU_SOURCE"
cppflags="${cppflags} -D_FILE_OFFSET_BITS=64 -D__USE_UNIX98 -D_LARGEFILE64_SOURCE -D_REENTRANT -D_THREAD_SAFE"
#
# Gettext, data and plugin location