build: support non-standard replacements for -c flag

This allows non-standard replacements for the -c compiler flag.
Some compilers use other flags or no flag at all in place of
the usual one.

Signed-off-by: Mans Rullgard <mans@mansr.com>
pull/28/head
Mans Rullgard 13 years ago
parent 18031c49dc
commit 23565c2641
  1. 2
      Makefile
  2. 13
      configure

@ -33,7 +33,7 @@ LDFLAGS := $(ALLFFLIBS:%=-Llib%) $(LDFLAGS)
define COMPILE define COMPILE
$(call $(1)DEP,$(1)) $(call $(1)DEP,$(1))
$($(1)) $($(1)FLAGS) $($(1)_DEPFLAGS) -c $($(1)_O) $< $($(1)) $($(1)FLAGS) $($(1)_DEPFLAGS) $($(1)_C) $($(1)_O) $<
endef endef
COMPILE_C = $(call COMPILE,CC) COMPILE_C = $(call COMPILE,CC)

13
configure vendored

@ -630,7 +630,7 @@ check_cc(){
log check_cc "$@" log check_cc "$@"
cat > $TMPC cat > $TMPC
log_file $TMPC log_file $TMPC
check_cmd $cc $CPPFLAGS $CFLAGS "$@" -c $(cc_o $TMPO) $TMPC check_cmd $cc $CPPFLAGS $CFLAGS "$@" $CC_C $(cc_o $TMPO) $TMPC
} }
check_cpp(){ check_cpp(){
@ -644,7 +644,7 @@ check_as(){
log check_as "$@" log check_as "$@"
cat > $TMPC cat > $TMPC
log_file $TMPC log_file $TMPC
check_cmd $as $CPPFLAGS $ASFLAGS "$@" -c -o $TMPO $TMPC check_cmd $as $CPPFLAGS $ASFLAGS "$@" $AS_C -o $TMPO $TMPC
} }
check_asm(){ check_asm(){
@ -1736,10 +1736,13 @@ asflags_filter=echo
cflags_filter=echo cflags_filter=echo
ldflags_filter=echo ldflags_filter=echo
AS_C='-c'
AS_O='-o $@' AS_O='-o $@'
CC_C='-c'
CC_E='-E -o $@' CC_E='-E -o $@'
CC_O='-o $@' CC_O='-o $@'
LD_O='-o $@' LD_O='-o $@'
HOSTCC_C='-c'
HOSTCC_O='-o $@' HOSTCC_O='-o $@'
host_cflags='-D_ISOC99_SOURCE -D_XOPEN_SOURCE=600 -O3 -g' host_cflags='-D_ISOC99_SOURCE -D_XOPEN_SOURCE=600 -O3 -g'
@ -2056,7 +2059,7 @@ probe_cc(){
pfx=$1 pfx=$1
_cc=$2 _cc=$2
unset _type _ident _cc_e _cc_o _flags _cflags _ldflags unset _type _ident _cc_c _cc_e _cc_o _flags _cflags _ldflags
unset _depflags _DEPCMD _DEPFLAGS unset _depflags _DEPCMD _DEPFLAGS
_flags_filter=echo _flags_filter=echo
@ -2172,6 +2175,7 @@ probe_cc(){
} }
set_ccvars(){ set_ccvars(){
eval ${1}_C=\${_cc_c-\${${1}_C}}
eval ${1}_E=\${_cc_e-\${${1}_E}} eval ${1}_E=\${_cc_e-\${${1}_E}}
eval ${1}_O=\${_cc_o-\${${1}_O}} eval ${1}_O=\${_cc_o-\${${1}_O}}
@ -3426,7 +3430,9 @@ LN_S=$ln_s
CPPFLAGS=$CPPFLAGS CPPFLAGS=$CPPFLAGS
CFLAGS=$CFLAGS CFLAGS=$CFLAGS
ASFLAGS=$ASFLAGS ASFLAGS=$ASFLAGS
AS_C=$AS_C
AS_O=$AS_O AS_O=$AS_O
CC_C=$CC_C
CC_O=$CC_O CC_O=$CC_O
LD_O=$LD_O LD_O=$LD_O
DLLTOOL=$dlltool DLLTOOL=$dlltool
@ -3459,6 +3465,7 @@ DEPHOSTCCFLAGS=$DEPHOSTCCFLAGS \$(HOSTCCFLAGS)
HOSTCCDEP=$HOSTCCDEP HOSTCCDEP=$HOSTCCDEP
HOSTCCDEP_FLAGS=$HOSTCCDEP_FLAGS HOSTCCDEP_FLAGS=$HOSTCCDEP_FLAGS
HOSTCC_DEPFLAGS=$HOSTCC_DEPFLAGS HOSTCC_DEPFLAGS=$HOSTCC_DEPFLAGS
HOSTCC_C=$HOSTCC_C
HOSTCC_O=$HOSTCC_O HOSTCC_O=$HOSTCC_O
TARGET_EXEC=$target_exec TARGET_EXEC=$target_exec
TARGET_PATH=$target_path TARGET_PATH=$target_path

Loading…
Cancel
Save