# ============================================================== # Copyright (c) 1996-1998 Tim Barbour. # Copyright (c) 1998-1999 ACT Financial Systems Pty Ltd. # All Rights Reserved. # This make library may be used and distributed under the terms # of the GNU LGPL, as published by the Free Software Foundation. # See the file COPYING for details. # ============================================================== # $Id: gxx.mk,v 1.13 2001/11/18 10:39:21 trb Exp $ #------------------------------------------------------------------------------------------------------- # refers to: GCC GXX GNU_AR GNU_ARFLAGS c_flags cxx_flags cxx_templateflags maybe_checker #------------------------------------------------------------------------------------------------------- # provides variables: cxx_stdincs SUPPORTED_TEMPLATE_METHODS TP_EXTERN_LINKAGE compiler_cdebugflags # compiler_cxxdebugflags compiler_bounds_checker_tool COPTIMISEFLAGS CXXOPTIMISEFLAGS EXCEPTIONFLAGS # cxx_libflags SHLIB_LDFLAGS STATIC_LINK_FLAG #------------------------------------------------------------------------------------------------------- # provides commands: c_compiler c_depend c_linker cxx_compiler cxx_depend cxx_linker cxx_libtool #------------------------------------------------------------------------------------------------------- #+FIXME trb: why no c_stdincs ? c_compiler = $(GCC) $(GCCFLAGS) c_depend = $(GCC) -M $(GCCFLAGS) $(c_flags) c_linker = $(GCC) $(GCCFLAGS) c_kernel_module_linker = $(GNU_LD) c_version = $(GCC) --version | head -n 1 c_version_long = $(GCC) -v 2>&1 cxx_compiler = $(GXX) $(GCCFLAGS) $(GXXFLAGS) cxx_depend = $(GXX) -M $(GCCFLAGS) $(GXXFLAGS) $(cxx_flags) cxx_linker = $(GXX) $(GCCFLAGS) $(GXXFLAGS) $(cxx_templateflags) cxx_template_prelinker = $(cxx_linker) # C++ compiler standard include directories cxx_stdincs = SUPPORTED_TEMPLATE_METHODS = Manual Implicit IMPLICIT_TEMPLATE_FLAGS = -frepo TP_EXTERN_LINKAGE = -fno-implicit-templates compiler_cdebugflags = -g # leave out gstabs+ - g++ will use it if appropriate compiler_cxxdebugflags = -fno-default-inline COPTIMISEFLAGS = -O3 CXXOPTIMISEFLAGS = GCCFLAGS = GXXFLAGS = cxx_libtool = $(GNU_AR) cxx_libflags = $(GNU_ARFLAGS) # export this so it can be seen by bounds_checker.sh export compiler_bounds_checker_tool = $(GNU_CHECKER) # for dynamic libraries, should rename (above, too) cxx_liblinker = $(GNU_LD) SHLIB_LDFLAGS = -shared SHLIB_CFLAGS = -fPIC STATIC_LINK_FLAG = -static # General flags for compiler # # flags for include and library paths incpathflag = -I incfileflag = -include libpathflag = -L # flag to add path for standard includes stdincpath_cflag = -isystem # compile only (no link) flag compflag = -c # define macro flag defineflag = -D # compile output flag cxxoutflag = -o cxx_no_exceptions_flag = -fno-exceptions cxx_no_rtti_flag = -fno-rtti cxx_no_weak_symbols_flag = -fno-weak # often used in kernel ways c_no_frame_pointer_flag = -fomit-frame-pointer c_flags_unsuitable_for_cxx = -Wstrict-prototypes -Wdeclaration-after-statement -Wno-pointer-sign -Werror-implicit-function-declaration -ffreestanding c_kernel_kbuild_unwanted_flags = $(c_flags_unsuitable_for_cxx) # causes C linker to generate relocatable output # i.e. generate an output file that can in turn serve as input to ld # we use -Ur rather than -r, since it can resolve C++ constructors in mixed language programs # and, especially, kernel-modules c_linker_relocatable_flag = -Ur # link output flag, link library flag cxxlinkoutflag = -o # GNU ar likes this to be empty cxxlinkstatliboutflag = cxxlinklibflag = -l c_no_std_includes_flag = -nostdinc # only use given libraries (except startup files and libgcc) # the -ffreestanding option seems to have been added to gcc recently, but is not documented in the gcc info # it is necessary to avoid warnings when compiling kernel headers c_no_default_libraries_flag = -nodefaultlibs -ffreestanding # only use given libraries c_no_standard_libraries_flag = -nostdlib cxx_no_std_includes_flag = -nostdinc++