Changeset a2011ad in freewrt


Ignore:
Timestamp:
Jun 12, 2006, 1:09:53 AM (20 years ago)
Author:
Thorsten Glaser <tg@…>
Branches:
freewrt_1_0, freewrt_2_0
Children:
8ec9389
Parents:
abfbcd7
Message:

Correctly determine HOSTCC and HOSTCFLAGS (from host make)
and pass them as CC/CFLAGS to the toolchain as well.

Now this at least goes as far as I suspected the first
breakage would be (on MirBSD) - autotools.

Detecting works by invoking $(MAKE) with a BSD-specific
makefile and just using $(HOSTCFLAGS) if that fails.
This works better on OpenBSD too, FWIW.

git-svn-id: svn://www.freewrt.org/trunk/freewrt@54 afb5a338-a214-0410-bd46-81f09a774fd1

Files:
3 edited

Legend:

Unmodified
Added
Removed
  • Makefile

    rabfbcd7 ra2011ad  
    3333GMAKE_INV=      PATH=$(PWD)/lbin:$(PATH) ${GMAKE} -f $(PWD)/build.mk ${VARS_TO_PASS}
    3434
    35 VARS_TO_PASS=   HOSTCC='${CC}' MAKE='${GMAKE}'
     35VARS_TO_PASS=   HOSTCC='${CC}' MAKE='${GMAKE}' \
     36                HOSTCFLAGS="$$(x=$$(echo \
     37                    'f:\n\techo P:$${CFLAGS}\n.include <bsd.prog.mk>' | \
     38                    ${MAKE} -f - f EXPERIMENTAL=yes 2>/dev/null | grep '^P:' \
     39                    2>/dev/null | sed 's/^P://'); echo $${x:-${CFLAGS}})"
    3640
    3741all: prereq
  • build.mk

    rabfbcd7 ra2011ad  
    8080toolchain/%:
    8181        @$(TRACE) $@
    82         $(MAKE) -C toolchain $(patsubst toolchain/%,%,$@)
     82        $(MAKE) -C toolchain $(patsubst toolchain/%,%,$@) \
     83            CC='$(HOSTCC)' CFLAGS='$(HOSTCFLAGS)'
    8384
    8485#############################################################
  • package/config/Makefile

    rabfbcd7 ra2011ad  
    66
    77# Select the compiler needed to build binaries for your development system
    8 HOSTCC    = gcc
    9 HOSTCFLAGS= -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer
     8HOSTCC    ?= gcc
     9HOSTCFLAGS?= -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer
    1010# Ensure consistent sort order, 'gcc -print-search-dirs' behavior, etc.
    1111LC_ALL:= C
     
    9595ncurses:
    9696        @echo "main() {}" > lxtemp.c
    97         @if $(HOSTCC) lxtemp.c $(LIBS) ; then \
     97        @if $(HOSTCC) $(HOSTCFLAGS) lxtemp.c $(LIBS) ; then \
    9898                rm -f lxtemp.c a.out; \
    9999        else \
Note: See TracChangeset for help on using the changeset viewer.