From 8c17a26b5c9a187279d85dcd98d87a8ed14e37f6 Mon Sep 17 00:00:00 2001 From: Ingo Weinhold Date: Sun, 12 Oct 2003 17:47:07 +0000 Subject: [PATCH] The configure script now sets the variable GCC_RAW_VERSION which is parsed in Jamrules into a list (`.' and `-' are considered delimiters) written into GCC_VERSION. E.g. for the GeekGadgets compiler expect GCC_VERSION to be set to `2 9 beos 000224'. So, GCC_VERSION[1] should contain the major version, GCC_VERSION[2] the middle one. git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4997 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- Jamrules | 21 +++++++++++++++++++++ configure | 3 +++ 2 files changed, 24 insertions(+) diff --git a/Jamrules b/Jamrules index d6215a75d5..b17c9723dc 100644 --- a/Jamrules +++ b/Jamrules @@ -46,6 +46,27 @@ LOCATE on $(HCACHEFILE) $(JCACHEFILE) = $(OBOS_BUILD_DIR) ; include BuildConfig ; } +# analyze GCC version +if ! $(GCC_RAW_VERSION) { + ECHO "Variable GCC_RAW_VERSION not set. Please run ./configure or" ; + EXIT "specify it manually." ; +} +GCC_VERSION = ; +{ + # split the raw version string at `.' and `-' characters + local version = $(GCC_RAW_VERSION) ; + while $(version) { + local split = [ Match "([^.-]*)[.-](.*)" : $(version) ] ; + if $(split) { + GCC_VERSION += $(split[1]) ; + version = $(split[2]) ; + } else { + GCC_VERSION += $(version) ; + version = ; + } + } +} + # Save the platform default headers. PLATFORM_DEFAULT_HEADERS = $(HDRS) ; diff --git a/configure b/configure index b8a16fe780..ab1f8890e7 100755 --- a/configure +++ b/configure @@ -42,6 +42,7 @@ standard_gcc_settings() # PLATFORM_LINKLIBS gcclib=`gcc -print-libgcc-file-name` gccdir=`dirname ${gcclib}` + gcc_version=`gcc --version` if [ "x${PLATFORM_LINKLIBS}" == "x" ] ; then PLATFORM_LINKLIBS="-L ${gccdir} -lgcc" fi @@ -53,6 +54,7 @@ standard_gcc_settings() # default parameter values # platform=`uname` +gcc_version= floppy= bochs_debug=0 @@ -99,6 +101,7 @@ cat << EOF > build/BuildConfig FLOPPY_PATH ?= "${floppy}" ; PLATFORM_LINKLIBS ?= ${PLATFORM_LINKLIBS} ; PLATFORM_HEADERS ?= ${PLATFORM_HEADERS} ; +GCC_RAW_VERSION ?= ${gcc_version} BOCHS_DEBUG_HACK ?= ${bochs_debug} ; EOF