move some autoconf macros into separate m4 dir

This commit is contained in:
Niels Grewe 2019-12-03 20:00:01 +01:00
parent ebd667fe16
commit 114faf5cd8
No known key found for this signature in database
GPG key ID: 003E2A780EE52172
6 changed files with 199 additions and 83 deletions

26
.gitignore vendored Normal file
View file

@ -0,0 +1,26 @@
config.make
config-noarch.make
config.cache
GNUmakefile
GNUstep.sh
GNUstep.csh
config.h
config.status
openapp
debugapp
executable.template
opentool
gnustep-make.spec
fixpath.sh
GNUstep.conf
config-install-p-test-file2
*.log
TestFramework/gnustep-tests
runtime/
autom4te.cache
gnustep-config
filesystem.make
filesystem.csh
filesystem.sh
gnustep-make-ld.so.conf
GNUstep-strict-v2.conf

16
aclocal.m4 vendored Normal file
View file

@ -0,0 +1,16 @@
# generated automatically by aclocal 1.15.1 -*- Autoconf -*-
# Copyright (C) 1996-2017 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])])
m4_include([m4/gs_cc_is_clang.m4])
m4_include([m4/gs_gcc_version.m4])

116
configure vendored
View file

@ -739,6 +739,7 @@ infodir
docdir
oldincludedir
includedir
runstatedir
localstatedir
sharedstatedir
sysconfdir
@ -834,6 +835,7 @@ datadir='${datarootdir}'
sysconfdir='${prefix}/etc'
sharedstatedir='${prefix}/com'
localstatedir='${prefix}/var'
runstatedir='${localstatedir}/run'
includedir='${prefix}/include'
oldincludedir='/usr/include'
docdir='${datarootdir}/doc/${PACKAGE}'
@ -1086,6 +1088,15 @@ do
| -silent | --silent | --silen | --sile | --sil)
silent=yes ;;
-runstatedir | --runstatedir | --runstatedi | --runstated \
| --runstate | --runstat | --runsta | --runst | --runs \
| --run | --ru | --r)
ac_prev=runstatedir ;;
-runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
| --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \
| --run=* | --ru=* | --r=*)
runstatedir=$ac_optarg ;;
-sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
ac_prev=sbindir ;;
-sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
@ -1223,7 +1234,7 @@ fi
for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
datadir sysconfdir sharedstatedir localstatedir includedir \
oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
libdir localedir mandir
libdir localedir mandir runstatedir
do
eval ac_val=\$$ac_var
# Remove trailing slashes.
@ -1376,6 +1387,7 @@ Fine tuning of the installation directories:
--sysconfdir=DIR read-only single-machine data [PREFIX/etc]
--sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
--localstatedir=DIR modifiable single-machine data [PREFIX/var]
--runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run]
--libdir=DIR object code libraries [EPREFIX/lib]
--includedir=DIR C header files [PREFIX/include]
--oldincludedir=DIR C header files for non-gcc [/usr/include]
@ -2247,6 +2259,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
#
# TODO: This configure file should not contain any checks that depend on the
# Objective-C runtime being used or available. This is because on
@ -5587,22 +5600,27 @@ fi
# But we need to compute, and print out, what flag we're using now.
OBJC_FINAL_LIB_FLAG="$OBJC_LIB_FLAG"
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler is clang" >&5
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler is clang" >&5
$as_echo_n "checking whether the compiler is clang... " >&6; }
if test ! x"${GCC}" = x"yes" ; then
CLANG_CC=no
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
if ${_gs_cv_cc_is_clang+:} false; then :
$as_echo_n "(cached) " >&6
else
if "${CC}" -v 2>&1 | grep -q 'clang version'; then
CLANG_CC=yes
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
else
CLANG_CC=no
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
_gs_cv_cc_is_clang="no"
if test x"${GCC}" = x"yes" ; then
if "${CC}" -v 2>&1 | grep -q 'clang version'; then
_gs_cv_cc_is_clang="yes";
fi
fi
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_gs_cv_cc_is_clang" >&5
$as_echo "$_gs_cv_cc_is_clang" >&6; }
gs_cv_cc_is_clang=${_gs_cv_cc_is_clang}
CLANG_CC=${_gs_cv_cc_is_clang}
if test "x$_gs_cv_cc_is_clang" = x"yes"; then :
fi
@ -6149,36 +6167,50 @@ fi
# Check for the GCC version - this is used in the following tests
#--------------------------------------------------------------------
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for the GCC version" >&5
$as_echo_n "checking for the GCC version... " >&6; }
if test ! x"${GCC}" = x"yes" ; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no: it's not gcc" >&5
$as_echo "no: it's not gcc" >&6; }
if test x"${gs_cv_cc_is_clang}" = x"yes"; then
compiler_identification="clang"
else
compiler_identification="GCC"
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for the ${compiler_identification} version" >&5
$as_echo_n "checking for the ${compiler_identification} version... " >&6; }
if ${_gs_cv_gcc_parsed_version+:} false; then :
$as_echo_n "(cached) " >&6
else
# Running gcc -dumpversion we get something like 2.95.4 or
# egcs-2.91.66 or 3.0.2 or 3.1 20011211
# We want to discard anything but the major number.
# Explanation of the regexp -
# \([^0-9]*\) matches non numeric chars at the beginning
# \([0-9][0-9]*\) matches 1 or more numeric chars (this is the 2^nd
# subpattern)
# \([^0-9]*\) matches one or more non numeric chars
# \([0-9][0-9]*\) matches 1 or more numeric chars (this is the 4^nd
# subpattern)
# \([^0-9].*\) matches a non numeric char followed by anything
# /\2/ replace the whole lot with the 2^nd subpattern
# /\4/ replace the whole lot with the 4^nd subpattern
# All square brackets are doubled because this file is processed by m4 first.
# Finally, any error messages are redirected to &5, so that they are logged
# into config.log but don't clutter the normal user output.
gs_cv_gcc_major_version=`(${CC} -dumpversion | sed "s/\([^0-9]*\)\([0-9][0-9]*\)\([^0-9]*\)\([0-9][0-9]*\)\([^0-9]*.*\)/\2/") 2>&5`;
gs_cv_gcc_minor_version=`(${CC} -dumpversion | sed "s/\([^0-9]*\)\([0-9][0-9]*\)\([^0-9]*\)\([0-9][0-9]*\)\([^0-9]*.*\)/\4/") 2>&5`;
_gs_cv_gcc_major_version=""
_gs_cv_gcc_minor_version=""
_gs_cv_gcc_parsed_version="no: it's not gcc"
if test x"${GCC}" = x"yes" ; then
_gs_cv_gcc_major_version=`(${CC} -dumpversion | sed "s/\([^0-9]*\)\([0-9][0-9]*\)\([^0-9]*\)\([0-9][0-9]*\)\([^0-9]*.*\)/\2/") 2>&5`;
_gs_cv_gcc_minor_version=`(${CC} -dumpversion | sed "s/\([^0-9]*\)\([0-9][0-9]*\)\([^0-9]*\)\([0-9][0-9]*\)\([^0-9]*.*\)/\4/") 2>&5`;
_gs_cv_gcc_parsed_version="${_gs_cv_gcc_major_version}.${_gs_cv_gcc_minor_version}";
fi
gs_cv_gcc_parsed_version=${gs_cv_gcc_major_version}.${gs_cv_gcc_minor_version}
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: version: ${gs_cv_gcc_parsed_version}" >&5
$as_echo "version: ${gs_cv_gcc_parsed_version}" >&6; }
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_gs_cv_gcc_parsed_version" >&5
$as_echo "$_gs_cv_gcc_parsed_version" >&6; }
if test ! x"${_gs_cv_gcc_parsed_version}" = x"no: it's not gcc"; then
_gs_cv_gcc_major_version="${_gs_cv_gcc_parsed_version%%.*}"
_gs_cv_gcc_minor_version="${_gs_cv_gcc_parsed_version#*.}"
fi
if test "x$_gs_cv_gcc_major_version" = x""; then :
{ gs_cv_gcc_major_version=; unset gs_cv_gcc_major_version;}
else
gs_cv_gcc_major_version=${_gs_cv_gcc_major_version}
fi
if test "x$_gs_cv_gcc_minor_version" = x""; then :
{ gs_cv_gcc_minor_version=; unset gs_cv_gcc_minor_version;}
else
gs_cv_gcc_minor_version=${_gs_cv_gcc_minor_version}
fi
if test "x$_gs_cv_gcc_major_version" = x""; then :
{ gs_cv_gcc_parsed_version=; unset gs_cv_gcc_parsed_version;}
else
gs_cv_gcc_parsed_version="${_gs_cv_gcc_major_version}.${_gs_cv_gcc_minor_version}"
fi
# Do not restore LIBS and CFLAGS yet as we need to test if the
# compiler supports native exceptions.

View file

@ -23,6 +23,7 @@
AC_INIT
AC_PREREQ(2.57)
AC_CONFIG_SRCDIR([application.make])
AC_CONFIG_MACRO_DIRS([m4])
#
# TODO: This configure file should not contain any checks that depend on the
@ -1221,20 +1222,7 @@ AC_SUBST(OBJC_LIB_FLAG)
# But we need to compute, and print out, what flag we're using now.
OBJC_FINAL_LIB_FLAG="$OBJC_LIB_FLAG"
AC_MSG_CHECKING(whether the compiler is clang)
if test ! x"${GCC}" = x"yes" ; then
CLANG_CC=no
AC_MSG_RESULT(no)
else
if "${CC}" -v 2>&1 | grep -q 'clang version'; then
CLANG_CC=yes
AC_MSG_RESULT(yes)
else
CLANG_CC=no
AC_MSG_RESULT(no)
fi
fi
AC_SUBST(CLANG_CC)
GS_CHECK_CC_IS_CLANG()
saved_CFLAGS="$CFLAGS"
saved_LIBS="$LIBS"
@ -1523,33 +1511,7 @@ AC_SUBST(OBJ_MERGE_CMD_FLAG)
# Check for the GCC version - this is used in the following tests
#--------------------------------------------------------------------
AC_MSG_CHECKING(for the GCC version)
if test ! x"${GCC}" = x"yes" ; then
AC_MSG_RESULT(no: it's not gcc)
else
# Running gcc -dumpversion we get something like 2.95.4 or
# egcs-2.91.66 or 3.0.2 or 3.1 20011211
# We want to discard anything but the major number.
# Explanation of the regexp -
# \([^0-9]*\) matches non numeric chars at the beginning
# \([0-9][0-9]*\) matches 1 or more numeric chars (this is the 2^nd
# subpattern)
# \([^0-9]*\) matches one or more non numeric chars
# \([0-9][0-9]*\) matches 1 or more numeric chars (this is the 4^nd
# subpattern)
# \([^0-9].*\) matches a non numeric char followed by anything
# /\2/ replace the whole lot with the 2^nd subpattern
# /\4/ replace the whole lot with the 4^nd subpattern
# All square brackets are doubled because this file is processed by m4 first.
# Finally, any error messages are redirected to &5, so that they are logged
# into config.log but don't clutter the normal user output.
gs_cv_gcc_major_version=`(${CC} -dumpversion | sed "s/\([[^0-9]]*\)\([[0-9]][[0-9]]*\)\([[^0-9]]*\)\([[0-9]][[0-9]]*\)\([[^0-9]]*.*\)/\2/") 2>&5`;
gs_cv_gcc_minor_version=`(${CC} -dumpversion | sed "s/\([[^0-9]]*\)\([[0-9]][[0-9]]*\)\([[^0-9]]*\)\([[0-9]][[0-9]]*\)\([[^0-9]]*.*\)/\4/") 2>&5`;
gs_cv_gcc_parsed_version=${gs_cv_gcc_major_version}.${gs_cv_gcc_minor_version}
AC_MSG_RESULT(version: ${gs_cv_gcc_parsed_version})
fi
GS_CHECK_GCC_VERSION()
# Do not restore LIBS and CFLAGS yet as we need to test if the
# compiler supports native exceptions.

27
m4/gs_cc_is_clang.m4 Normal file
View file

@ -0,0 +1,27 @@
# SYNOPSIS
#
# GS_CHECK_CC_IS_CLANG([run-if-true],[run-if-false])
#
# DESCRIPTION
#
# This macro checks whether the active C compiler is a variant of clang. Upon return
#
# * The makefile variable `CLANG_CC' is set to `yes' or `no'.
# * The variables `CLANG_CC' and `gs_cv_cc_is_clang' are set to the same values.
# * Additionally if clang, run shell code run-if-true
# else run shell code run-if-false.
AC_DEFUN([GS_CHECK_CC_IS_CLANG],dnl
[AC_REQUIRE([AC_PROG_CC])
AC_CACHE_CHECK([whether the compiler is clang],[_gs_cv_cc_is_clang], [dnl
_gs_cv_cc_is_clang="no"
if test x"${GCC}" = x"yes" ; then
if "${CC}" -v 2>&1 | grep -q 'clang version'; then
_gs_cv_cc_is_clang="yes";
fi
fi
])
AS_VAR_SET([gs_cv_cc_is_clang], [${_gs_cv_cc_is_clang}])
AS_VAR_SET([CLANG_CC], [${_gs_cv_cc_is_clang}])
AC_SUBST([CLANG_CC])
AS_VAR_IF([_gs_cv_cc_is_clang], ["yes"], [$1], [$2])
])

53
m4/gs_gcc_version.m4 Normal file
View file

@ -0,0 +1,53 @@
# SYNOPSIS
#
# GS_CHECK_GCC_VERSION()
#
# DESCRIPTION
#
# Extracts the major and minor version numbers from a GCC-like compiler (GCC or clang)
# into the following variables:
# * gs_cv_gcc_major_version
# * gs_cv_gcc_minor_version
# * gs_cv_gcc_parsed_version (the combined version string)
AC_DEFUN([GS_CHECK_GCC_VERSION],dnl
[AC_REQUIRE([AC_PROG_CC])
AC_REQUIRE([GS_CHECK_CC_IS_CLANG])
if test x"${gs_cv_cc_is_clang}" = x"yes"; then
compiler_identification="clang"
else
compiler_identification="GCC"
fi
AC_CACHE_CHECK([for the ${compiler_identification} version],[_gs_cv_gcc_parsed_version], [dnl
_gs_cv_gcc_major_version=""
_gs_cv_gcc_minor_version=""
_gs_cv_gcc_parsed_version="no: it's not gcc"
if test x"${GCC}" = x"yes" ; then
dnl Running gcc -dumpversion we get something like 2.95.4 or
dnl egcs-2.91.66 or 3.0.2 or 3.1 20011211
dnl We want to discard anything but the major number.
dnl Explanation of the regexp -
dnl \([^0-9]*\) matches non numeric chars at the beginning
dnl \([0-9][0-9]*\) matches 1 or more numeric chars (this is the 2^nd
dnl subpattern)
dnl \([^0-9]*\) matches one or more non numeric chars
dnl \([0-9][0-9]*\) matches 1 or more numeric chars (this is the 4^nd
dnl subpattern)
dnl \([^0-9].*\) matches a non numeric char followed by anything
dnl /\2/ replace the whole lot with the 2^nd subpattern
dnl /\4/ replace the whole lot with the 4^nd subpattern
dnl All square brackets are doubled because this file is processed by m4 first.
dnl Finally, any error messages are redirected to &5, so that they are logged
dnl into config.log but don't clutter the normal user output.
_gs_cv_gcc_major_version=`(${CC} -dumpversion | sed "s/\([[^0-9]]*\)\([[0-9]][[0-9]]*\)\([[^0-9]]*\)\([[0-9]][[0-9]]*\)\([[^0-9]]*.*\)/\2/") 2>&5`;
_gs_cv_gcc_minor_version=`(${CC} -dumpversion | sed "s/\([[^0-9]]*\)\([[0-9]][[0-9]]*\)\([[^0-9]]*\)\([[0-9]][[0-9]]*\)\([[^0-9]]*.*\)/\4/") 2>&5`;
_gs_cv_gcc_parsed_version="${_gs_cv_gcc_major_version}.${_gs_cv_gcc_minor_version}";
fi
])
if test ! x"${_gs_cv_gcc_parsed_version}" = x"no: it's not gcc"; then
_gs_cv_gcc_major_version="${_gs_cv_gcc_parsed_version%%.*}"
_gs_cv_gcc_minor_version="${_gs_cv_gcc_parsed_version#*.}"
fi
AS_VAR_IF([_gs_cv_gcc_major_version], [""], [AS_UNSET([gs_cv_gcc_major_version])], [AS_VAR_SET([gs_cv_gcc_major_version], [${_gs_cv_gcc_major_version}])])
AS_VAR_IF([_gs_cv_gcc_minor_version], [""], [AS_UNSET([gs_cv_gcc_minor_version])], [AS_VAR_SET([gs_cv_gcc_minor_version], [${_gs_cv_gcc_minor_version}])])
AS_VAR_IF([_gs_cv_gcc_major_version], [""], [AS_UNSET([gs_cv_gcc_parsed_version])], [AS_VAR_SET([gs_cv_gcc_parsed_version], ["${_gs_cv_gcc_major_version}.${_gs_cv_gcc_minor_version}"])])
])