Commit ecddc275 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

Modernize configure.ac a bit

parent 6810a85e
...@@ -38,32 +38,16 @@ dnl ...@@ -38,32 +38,16 @@ dnl
dnl Check for tools dnl Check for tools
dnl dnl
AC_PROG_CC_C99 AC_PROG_CC_C99
AC_USE_SYSTEM_EXTENSIONS
AM_PROG_CC_C_O AM_PROG_CC_C_O
AC_PROG_CXX AC_PROG_CXX
eval "${CXX} --version" >/dev/null 2>&1 || CXX="" AC_PROG_OBJC
if test "${CXX}" != ""; then _AM_DEPENDENCIES([OBJC])
AC_PROG_CXXCPP AC_PROG_EGREP
fi
AC_PROG_MAKE_SET AC_PROG_MAKE_SET
AC_PROG_INSTALL AC_PROG_INSTALL
AM_PROG_AS 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 dnl Find the right ranlib, even when cross-compiling
AC_CHECK_TOOL(RANLIB, ranlib, :) AC_CHECK_TOOL(RANLIB, ranlib, :)
AC_CHECK_TOOL(STRIP, strip, :) AC_CHECK_TOOL(STRIP, strip, :)
...@@ -904,22 +888,27 @@ fi ...@@ -904,22 +888,27 @@ fi
# fi # fi
#done #done
AC_CACHE_CHECK([if \$CC accepts -Wall], AC_CACHE_CHECK([if $CC accepts -Wall],
[ac_cv_c_Wall], [ac_cv_c_Wall],
[CFLAGS="-Wall ${CFLAGS_save}" [CFLAGS="-Wall ${CFLAGS_save}"
AC_TRY_COMPILE([],,ac_cv_c_Wall=yes, ac_cv_c_Wall=no)]) 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], [ac_cv_c_Wconversion],
[CFLAGS="-Wconversion ${CFLAGS_save}" [CFLAGS="-Wconversion ${CFLAGS_save}"
AC_TRY_COMPILE([],,ac_cv_c_Wconversion=yes, ac_cv_c_Wconversion=no)]) 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], [ac_cv_c_Wunreachable_code],
[CFLAGS="-Wunreachable-code ${CFLAGS_save}" [CFLAGS="-Wunreachable-code ${CFLAGS_save}"
AC_TRY_COMPILE([],,ac_cv_c_Wunreachable_code=yes, ac_cv_c_Wunreachable_code=no)]) 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], [ac_cv_c_Wsign_compare],
[CFLAGS="-Wsign-compare ${CFLAGS_save}" [CFLAGS="-Wsign-compare ${CFLAGS_save}"
AC_TRY_COMPILE([],,ac_cv_c_Wsign_compare=yes, ac_cv_c_Wsign_compare=no)]) 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 ...@@ -930,6 +919,12 @@ if test "${ac_cv_c_Wall}" != "no"; then
OBJCFLAGS_save="-Wall ${OBJCFLAGS_save}"; OBJCFLAGS="${OBJCFLAGS_save}" OBJCFLAGS_save="-Wall ${OBJCFLAGS_save}"; OBJCFLAGS="${OBJCFLAGS_save}"
fi 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 if test "${ac_cv_c_Wsign_compare}" != "no"; then
CFLAGS_save="-Wsign-compare ${CFLAGS_save}"; CFLAGS="${CFLAGS_save}" CFLAGS_save="-Wsign-compare ${CFLAGS_save}"; CFLAGS="${CFLAGS_save}"
CXXFLAGS_save="-Wsign-compare ${CFLAGS_save}"; CXXFLAGS="${CXXFLAGS_save}" CXXFLAGS_save="-Wsign-compare ${CFLAGS_save}"; CXXFLAGS="${CXXFLAGS_save}"
......
# Replacements for autoconf 2.59 and older # Replacements for autoconf 2.59 and older
# Please make official source tarballs with recent autoconf only. # 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_DEFUN([AC_PROG_CC_C00],
[ AC_REQUIRE([AC_PROG_CC])dnl [ AC_REQUIRE([AC_PROG_CC])dnl
CC="$CC -std=c99" 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.])
])
...@@ -95,7 +95,7 @@ linkage="c" ...@@ -95,7 +95,7 @@ linkage="c"
# #
# On Linux and Solaris, activate 64-bit off_t (by default under BSD) # 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 # Gettext, data and plugin location
......
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