diff options
| author | Xavier ASUS <xavi92psx@gmail.com> | 2019-10-18 00:31:54 +0200 |
|---|---|---|
| committer | Xavier ASUS <xavi92psx@gmail.com> | 2019-10-18 00:31:54 +0200 |
| commit | 268a53de823a6750d6256ee1fb1e7707b4b45740 (patch) | |
| tree | 42c1799a9a82b2f7d9790ee9fe181d72a7274751 /support/cpp/configure.ac | |
| download | sdcc-gas-268a53de823a6750d6256ee1fb1e7707b4b45740.tar.gz | |
sdcc-3.9.0 fork implementing GNU assembler syntax
This fork aims to provide better support for stm8-binutils
Diffstat (limited to 'support/cpp/configure.ac')
| -rw-r--r-- | support/cpp/configure.ac | 607 |
1 files changed, 607 insertions, 0 deletions
diff --git a/support/cpp/configure.ac b/support/cpp/configure.ac new file mode 100644 index 0000000..cbf4e07 --- /dev/null +++ b/support/cpp/configure.ac @@ -0,0 +1,607 @@ +# configure.in for GCC +# Process this file with autoconf to generate a configuration script. + +# Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. + +#This file is part of GCC. + +#GCC is free software; you can redistribute it and/or modify it under +#the terms of the GNU General Public License as published by the Free +#Software Foundation; either version 2, or (at your option) any later +#version. + +#GCC is distributed in the hope that it will be useful, but WITHOUT +#ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +#FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +#for more details. + +#You should have received a copy of the GNU General Public License +#along with GCC; see the file COPYING. If not, write to the Free +#Software Foundation, 59 Temple Place - Suite 330, Boston, MA +#02111-1307, USA. + +# Initialization and defaults +AC_PREREQ(2.60) +AC_INIT(sdcpp.c) +AC_CONFIG_HEADER(auto-host.h:config.in) + +remove=rm +hard_link=ln +symbolic_link='ln -s' +copy=cp + +# Check for additional parameters + +# With GNU ld +AC_ARG_WITH(gnu-ld, +[ --with-gnu-ld arrange to work with GNU ld.], +gnu_ld_flag="$with_gnu_ld", +gnu_ld_flag=no) + +# With pre-defined ld +AC_ARG_WITH(ld, +[ --with-ld arrange to use the specified ld (full pathname)], +DEFAULT_LINKER="$with_ld") +if test x"${DEFAULT_LINKER+set}" = x"set"; then + if test ! -x "$DEFAULT_LINKER"; then + AC_MSG_WARN([cannot execute: $DEFAULT_LINKER: check --with-ld or env. var. DEFAULT_LINKER]) + elif $DEFAULT_LINKER -v < /dev/null 2>&1 | grep GNU > /dev/null; then + gnu_ld_flag=yes + fi + AC_DEFINE_UNQUOTED(DEFAULT_LINKER,"$DEFAULT_LINKER", + [Define to enable the use of a default linker.]) +fi + +# With GNU as +AC_ARG_WITH(gnu-as, +[ --with-gnu-as arrange to work with GNU as], +gas_flag="$with_gnu_as", +gas_flag=no) + +AC_ARG_WITH(as, +[ --with-as arrange to use the specified as (full pathname)], +DEFAULT_ASSEMBLER="$with_as") +if test x"${DEFAULT_ASSEMBLER+set}" = x"set"; then + if test ! -x "$DEFAULT_ASSEMBLER"; then + AC_MSG_WARN([cannot execute: $DEFAULT_ASSEMBLER: check --with-as or env. var. DEFAULT_ASSEMBLER]) + elif $DEFAULT_ASSEMBLER -v < /dev/null 2>&1 | grep GNU > /dev/null; then + gas_flag=yes + fi + AC_DEFINE_UNQUOTED(DEFAULT_ASSEMBLER,"$DEFAULT_ASSEMBLER", + [Define to enable the use of a default assembler.]) +fi + +# With stabs +AC_ARG_WITH(stabs, +[ --with-stabs arrange to use stabs instead of host debug format], +stabs="$with_stabs", +stabs=no) + +# With ELF +AC_ARG_WITH(elf, +[ --with-elf arrange to use ELF instead of host debug format], +elf="$with_elf", +elf=no) + +# Specify the local prefix +local_prefix= +AC_ARG_WITH(local-prefix, +[ --with-local-prefix=DIR specifies directory to put local include], +[case "${withval}" in +yes) AC_MSG_ERROR(bad value ${withval} given for local include directory prefix) ;; +no) ;; +*) local_prefix=$with_local_prefix ;; +esac]) + +# Default local prefix if it is empty +if test x$local_prefix = x; then + local_prefix=/usr/local +fi + +AC_ARG_PROGRAM + +# Enable Multibyte Characters for C/C++ +AC_ARG_ENABLE(c-mbchar, +[ --enable-c-mbchar enable multibyte characters for C and C++], +if test x$enable_c_mbchar != xno; then + AC_DEFINE(MULTIBYTE_CHARS, 1, + [Define if you want the C and C++ compilers to support multibyte + character sets for source code.]) +fi) + +# Find the native compiler +AC_PROG_CC +AC_PROG_CC_C_O +# autoconf is lame and doesn't give us any substitution variable for this. +if eval "test \"`echo '$ac_cv_prog_cc_'${ac_cc}_c_o`\" = no"; then + NO_MINUS_C_MINUS_O=yes +else + OUTPUT_OPTION='-o $@' +fi +AC_SUBST(NO_MINUS_C_MINUS_O) +AC_SUBST(OUTPUT_OPTION) + +AC_PROG_CPP +AC_C_INLINE + +gcc_AC_C__BOOL + +# sizeof(char) is 1 by definition. +gcc_AC_COMPILE_CHECK_SIZEOF(short) +gcc_AC_COMPILE_CHECK_SIZEOF(int) +gcc_AC_COMPILE_CHECK_SIZEOF(long) + +gcc_AC_C_CHARSET + +# If the native compiler is GCC, we can enable warnings even in stage1. +# That's useful for people building cross-compilers, or just running a +# quick `make'. +warn_cflags= +if test "x$GCC" = "xyes"; then + warn_cflags='$(GCC_WARN_CFLAGS)' +fi +AC_SUBST(warn_cflags) + +AC_PROG_MAKE_SET + +AC_MSG_CHECKING([whether a default assembler was specified]) +if test x"${DEFAULT_ASSEMBLER+set}" = x"set"; then + if test x"$gas_flag" = x"no"; then + AC_MSG_RESULT([yes ($DEFAULT_ASSEMBLER)]) + else + AC_MSG_RESULT([yes ($DEFAULT_ASSEMBLER - GNU as)]) + fi +else + AC_MSG_RESULT(no) +fi + +AC_MSG_CHECKING([whether a default linker was specified]) +if test x"${DEFAULT_LINKER+set}" = x"set"; then + if test x"$gnu_ld_flag" = x"no"; then + AC_MSG_RESULT([yes ($DEFAULT_LINKER)]) + else + AC_MSG_RESULT([yes ($DEFAULT_LINKER - GNU ld)]) + fi +else + AC_MSG_RESULT(no) +fi + +# Find some useful tools +AC_PROG_AWK +# We need awk to run opts.sh (to create options.c and options.h). +# Bail out if it's missing. +case ${AWK} in + "") AC_MSG_ERROR([can't build without awk, bailing out]) ;; +esac + +gcc_AC_PROG_LN +gcc_AC_PROG_LN_S +AC_PROG_RANLIB +gcc_AC_PROG_INSTALL + +AC_HEADER_STDC +AC_HEADER_TIME +gcc_AC_HEADER_STDBOOL +gcc_AC_HEADER_STRING +AC_HEADER_SYS_WAIT +AC_CHECK_HEADERS(limits.h stddef.h string.h strings.h stdlib.h time.h \ + fcntl.h unistd.h sys/file.h sys/time.h \ + sys/param.h sys/stat.h \ + direct.h malloc.h) + +# Check for thread headers. + +# These tests can't be done till we know if we have limits.h. +gcc_AC_C_CHAR_BIT +AC_C_BIGENDIAN + +# See if we have the mktemp command. +AC_CHECK_PROG(have_mktemp_command, mktemp, yes, no) + +AC_CHECK_PROG(STRIP, strip, strip, :) +AC_CHECK_PROG(AR, ar, ar, :) + +# See if the stage1 system preprocessor understands the ANSI C +# preprocessor stringification operator. (Used by symcat.h.) +AC_C_STRINGIZE + +dnl Disabled until we have a complete test for buggy enum bitfields. +dnl gcc_AC_C_ENUM_BF_UNSIGNED + +AC_CHECK_FUNCS(clock strsignal strchr strrchr lstat) + +AC_CHECK_TYPE(ssize_t, int) + +AC_FUNC_MMAP_ANYWHERE +AC_FUNC_MMAP_FILE + +# We will need to find libiberty.h and ansidecl.h +saved_CFLAGS="$CFLAGS" +CFLAGS="$CFLAGS -I${srcdir} -I${srcdir}/libiberty -I${srcdir}/libcpp/include" +gcc_AC_CHECK_DECLS(getenv abort strsignal errno \ + malloc realloc calloc free clock, , ,[ +#include "ansidecl.h" +#include "system.h"]) + +# Restore CFLAGS from before the gcc_AC_NEED_DECLARATIONS tests. +CFLAGS="$saved_CFLAGS" + +# Try to append a c99 flag +AC_PROG_CC_C99 +if test "$ac_cv_prog_cc_c99" != "no"; then + CFLAGS="$ac_cv_prog_cc_c99 ${CFLAGS}" +fi + +# mkdir takes a single argument on some systems. +gcc_AC_FUNC_MKDIR_TAKES_ONE_ARG + +# File extensions +manext='.1' +objext='.o' +AC_SUBST(manext) +AC_SUBST(objext) + +build_xm_file= +build_xm_defines= +build_install_headers_dir=install-headers-tar +build_exeext= +host_xm_file= +host_xm_defines= +host_xmake_file= +host_truncate_target= +host_exeext= + +# Decode the host machine, then the target machine. +# For the host machine, we save the xm_file variable as host_xm_file; +# then we decode the target machine and forget everything else +# that came from the host machine. +#for machine in $build $host $target; do +# . ${srcdir}/config.gcc +#done + +extra_objs="${host_extra_objs} ${extra_objs}" + +# Default the target-machine variables that were not explicitly set. +if test x"$tm_file" = x +then tm_file=$cpu_type/$cpu_type.h; fi + +if test x"$extra_headers" = x +then extra_headers=; fi + +if test x$md_file = x +then md_file=$cpu_type/$cpu_type.md; fi + +if test x$out_file = x +then out_file=$cpu_type/$cpu_type.c; fi + +if test x"$tmake_file" = x +then tmake_file=$cpu_type/t-$cpu_type +fi + +if test x"$dwarf2" = xyes +then tm_file="$tm_file tm-dwarf2.h" +fi + +# Handle cpp installation. +if test x$enable_cpp != xno +then + tmake_file="$tmake_file t-install-cpp" +fi + +# auto-host.h is the file containing items generated by autoconf and is +# the first file included by config.h. +# If host=build, it is correct to have hconfig include auto-host.h +# as well. If host!=build, we are in error and need to do more +# work to find out the build config parameters. +if test x$host = x$build +then + build_auto=auto-host.h +else + # We create a subdir, then run autoconf in the subdir. + # To prevent recursion we set host and build for the new + # invocation of configure to the build for this invocation + # of configure. + tempdir=build.$$ + rm -rf $tempdir + mkdir $tempdir + cd $tempdir + case ${srcdir} in + /* | [A-Za-z]:[\\/]* ) realsrcdir=${srcdir};; + *) realsrcdir=../${srcdir};; + esac + CC=${CC_FOR_BUILD} ${realsrcdir}/configure \ + --target=$target --host=$build --build=$build + + # We just finished tests for the build machine, so rename + # the file auto-build.h in the gcc directory. + mv auto-host.h ../auto-build.h + cd .. + rm -rf $tempdir + build_auto=auto-build.h +fi + +tm_file="${tm_file} defaults.h" +host_xm_file="auto-host.h ansidecl.h ${host_xm_file} ${tm_file}" +build_xm_file="${build_auto} ansidecl.h ${build_xm_file} ${tm_file}" +xm_file="ansidecl.h ${xm_file} ${tm_file}" + +# Truncate the target if necessary +if test x$host_truncate_target != x; then + target=`echo $target | sed -e 's/\(..............\).*/\1/'` +fi + +# Get the version trigger filename from the toplevel +if test "${with_gcc_version_trigger+set}" = set; then + gcc_version_trigger=$with_gcc_version_trigger +else + gcc_version_trigger=${srcdir}/version.c +fi +changequote(,)dnl +gcc_version_full=`grep version_string ${gcc_version_trigger} | sed -e 's/.*"\([^"]*\)".*/\1/'` +gcc_version=`echo ${gcc_version_full} | sed -e 's/\([^ ]*\) .*/\1/'` + +changequote([,])dnl + +# Internationalization +PACKAGE=sdcc +VERSION="$gcc_version" +AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", + [Define to the name of the distribution.]) +AC_DEFINE_UNQUOTED(VERSION, "$VERSION", + [Define to the version of the distribution.]) +AC_SUBST(PACKAGE) +AC_SUBST(VERSION) + +ALL_LINGUAS="sv" + +# Get an absolute path to the GCC top-level source directory +holddir=`pwd` +cd $srcdir +topdir=`pwd` +cd $holddir + +out_object_file=`basename $out_file .c`.o + +# Figure out what assembler we will be using. +AC_MSG_CHECKING(what assembler to use) +gcc_cv_as= +gcc_cv_gas_major_version= +gcc_cv_gas_minor_version= +gcc_cv_as_gas_srcdir=`echo $srcdir | sed -e 's,/gcc$,,'`/gas +if test -x "$DEFAULT_ASSEMBLER"; then + gcc_cv_as="$DEFAULT_ASSEMBLER" +elif test -x "$AS"; then + gcc_cv_as="$AS" +elif test -x as$host_exeext; then + # Build using assembler in the current directory. + gcc_cv_as=./as$host_exeext +elif test -f $gcc_cv_as_gas_srcdir/configure.in -a -f ../gas/Makefile; then + # Single tree build which includes gas. + for f in $gcc_cv_as_gas_srcdir/configure $gcc_cv_as_gas_srcdir/configure.in $gcc_cv_as_gas_srcdir/Makefile.in + do +changequote(,)dnl + gcc_cv_gas_version=`grep '^VERSION=[0-9]*\.[0-9]*' $f` +changequote([,])dnl + if test x$gcc_cv_gas_version != x; then + break + fi + done +changequote(,)dnl + gcc_cv_gas_major_version=`expr "$gcc_cv_gas_version" : "VERSION=\([0-9]*\)"` + gcc_cv_gas_minor_version=`expr "$gcc_cv_gas_version" : "VERSION=[0-9]*\.\([0-9]*\)"` +changequote([,])dnl +fi + +if test "x$gcc_cv_as" = x -a x$host = x$target; then + # Native build. + # Search the same directories that the installed compiler will + # search. Else we may find the wrong assembler and lose. If we + # do not find a suitable assembler binary, then try the user's + # path. + # + # Also note we have to check MD_EXEC_PREFIX before checking the + # user's path. Unfortunately, there is no good way to get at the + # value of MD_EXEC_PREFIX here. So we do a brute force search + # through all the known MD_EXEC_PREFIX values. Ugh. This needs + # to be fixed as part of the make/configure rewrite too. + + if test "x$exec_prefix" = xNONE; then + if test "x$prefix" = xNONE; then + test_prefix=/usr/local + else + test_prefix=$prefix + fi + else + test_prefix=$exec_prefix + fi + + # If the loop below does not find an assembler, then use whatever + # one we can find in the users's path. + # user's path. + gcc_cv_as=as$host_exeext + + test_dirs="$test_prefix/lib/gcc-lib/$target/$gcc_version \ + $test_prefix/lib/gcc-lib/$target \ + /usr/lib/gcc/$target/$gcc_version \ + /usr/lib/gcc/$target \ + $test_prefix/$target/bin/$target/$gcc_version \ + $test_prefix/$target/bin \ + /usr/libexec \ + /usr/ccs/gcc \ + /usr/ccs/bin \ + /udk/usr/ccs/bin \ + /bsd43/usr/lib/cmplrs/cc \ + /usr/cross64/usr/bin \ + /usr/lib/cmplrs/cc \ + /sysv/usr/lib/cmplrs/cc \ + /svr4/usr/lib/cmplrs/cc \ + /usr/bin" + + for dir in $test_dirs; do + if test -f $dir/as$host_exeext; then + gcc_cv_as=$dir/as$host_exeext + break; + fi + done +fi +if test x$gcc_cv_gas_major_version != x -a x$gcc_cv_gas_minor_version != x; then + AC_MSG_RESULT("newly built gas") +else + AC_MSG_RESULT($gcc_cv_as) +fi + +# Figure out what nm we will be using. +AC_MSG_CHECKING(what nm to use) +if test -x nm$host_exeext; then + gcc_cv_nm=./nm$host_exeext +elif test x$host = x$target; then + # Native build. + gcc_cv_nm=nm$host_exeext +fi +AC_MSG_RESULT($gcc_cv_nm) + +dnl Very limited version of automake's enable-maintainer-mode + +AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) + dnl maintainer-mode is disabled by default + AC_ARG_ENABLE(maintainer-mode, +[ --enable-maintainer-mode + enable make rules and dependencies not useful + (and sometimes confusing) to the casual installer], + maintainer_mode=$enableval, + maintainer_mode=no) + +AC_MSG_RESULT($maintainer_mode) + +if test "$maintainer_mode" = "yes"; then + MAINT='' +else + MAINT='#' +fi +AC_SUBST(MAINT)dnl + +# These (without "all_") are set in each config-lang.in. +# `language' must be a single word so is spelled singularly. +all_stagestuff= +all_outputs='Makefile' +# List of language makefile fragments. + +# Add the language fragments. +# Languages are added via two mechanisms. Some information must be +# recorded in makefile variables, these are defined in config-lang.in. +# We accumulate them and plug them into the main Makefile. +# The other mechanism is a set of hooks for each of the main targets +# like `clean', `install', etc. + +language_fragments="Make-lang" + +# Define variables host_canonical and build_canonical +# because some Cygnus local changes in the Makefile depend on them. +build_canonical=${build} +host_canonical=${host} +target_subdir= +if test "${host}" != "${target}" ; then + target_subdir=${target_alias}/ +fi +AC_SUBST(build_canonical) +AC_SUBST(host_canonical) +AC_SUBST(target_subdir) + +# Nothing to do for FLOAT_H, float_format already handled. +objdir=`pwd` +AC_SUBST(objdir) + +# -Wall c flag if GNU C +if test "$ac_cv_c_compiler_gnu" = "yes"; then + WALL_FLAG="-Wall" +else + WALL_FLAG= +fi +AC_SUBST(WALL_FLAG) + +# Substitute configuration variables +AC_SUBST(all_stagestuff) +AC_SUBST(build_exeext) +AC_SUBST(build_install_headers_dir) +AC_SUBST(build_xm_file_list) +AC_SUBST(build_xm_file) +AC_SUBST(build_xm_defines) +AC_SUBST(check_languages) +AC_SUBST(dep_host_xmake_file) +AC_SUBST(dep_tmake_file) +AC_SUBST(extra_c_flags) +AC_SUBST(extra_headers_list) +AC_SUBST(extra_objs) +AC_SUBST(extra_parts) +AC_SUBST(extra_passes) +AC_SUBST(extra_programs) +AC_SUBST(gcc_config_arguments) +AC_SUBST(gcc_version) +AC_SUBST(gcc_version_full) +AC_SUBST(gcc_version_trigger) +AC_SUBST(host_exeext) +AC_SUBST(host_extra_gcc_objs) +AC_SUBST(install) +AC_SUBST(lang_tree_files) +AC_SUBST(local_prefix) +AC_SUBST(md_file) +AC_SUBST(out_file) +AC_SUBST(out_object_file) +AC_SUBST(symbolic_link) +AC_SUBST(thread_file) +AC_SUBST(c_target_objs) + +#AC_SUBST_FILE(target_overrides) +#AC_SUBST_FILE(host_overrides) +#AC_SUBST(cross_defines) +#AC_SUBST_FILE(cross_overrides) +#AC_SUBST_FILE(build_overrides) + +# Create the Makefile +# and configure language subdirectories +AC_OUTPUT($all_outputs, +[ +case x$CONFIG_HEADERS in +xauto-host.h:config.in) +echo > cstamp-h ;; +esac + +# Avoid having to add intl to our include paths. +if test -f intl/libintl.h; then + echo creating libintl.h + echo '#include "intl/libintl.h"' >libintl.h +fi +], +[ +host='${host}' +build='${build}' +target='${target}' +target_alias='${target_alias}' +srcdir='${srcdir}' +symbolic_link='${symbolic_link}' +program_transform_set='${program_transform_set}' +program_transform_name='${program_transform_name}' +dep_host_xmake_file='${dep_host_xmake_file}' +host_xmake_file='${host_xmake_file}' +dep_tmake_file='${dep_tmake_file}' +tmake_file='${tmake_file}' +thread_file='${thread_file}' +gcc_config_arguments='${gcc_config_arguments}' +gcc_version='${gcc_version}' +gcc_version_full='${gcc_version_full}' +gcc_version_trigger='${gcc_version_trigger}' +local_prefix='${local_prefix}' +build_install_headers_dir='${build_install_headers_dir}' +build_exeext='${build_exeext}' +host_exeext='${host_exeext}' +out_file='${out_file}' +gdb_needs_out_file_path='${gdb_needs_out_file_path}' +SET_MAKE='${SET_MAKE}' +target_list='${target_list}' +target_overrides='${target_overrides}' +host_overrides='${host_overrides}' +cross_defines='${cross_defines}' +cross_overrides='${cross_overrides}' +build_overrides='${build_overrides}' +cpp_install_dir='${cpp_install_dir}' +]) |
