Skip to content

Commit

Permalink
build: add separate setting for host linker
Browse files Browse the repository at this point in the history
This adds new HOSTLD and related settings for host linker allowing
it to be different from HOSTCC.

Signed-off-by: Mans Rullgard <[email protected]>
  • Loading branch information
mansr committed Aug 28, 2012
1 parent 2763587 commit 095792f
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ vpath %.texi $(SRC_PATH)
ifndef V
Q = @
ECHO = printf "$(1)\t%s\n" $(2)
BRIEF = CC HOSTCC AS YASM AR LD
BRIEF = CC HOSTCC HOSTLD AS YASM AR LD
SILENT = DEPCC DEPHOSTCC DEPAS DEPYASM RANLIB RM
MSG = $@
M = @$(call ECHO,$(TAG),$@);
Expand Down
2 changes: 1 addition & 1 deletion common.mak
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ $(HOSTOBJS): %.o: %.c
$(call COMPILE,HOSTCC)

$(HOSTPROGS): %$(HOSTEXESUF): %.o
$(HOSTCC) $(HOSTLDFLAGS) $(HOSTCC_O) $< $(HOSTLIBS)
$(HOSTLD) $(HOSTLDFLAGS) $(HOSTLD_O) $< $(HOSTLIBS)

$(OBJS): | $(sort $(dir $(OBJS)))
$(HOSTOBJS): | $(sort $(dir $(HOSTOBJS)))
Expand Down
15 changes: 12 additions & 3 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,7 @@ Advanced options (experts only):
--ld=LD use linker LD
--host-cc=HOSTCC use host C compiler HOSTCC
--host-cflags=HCFLAGS use HCFLAGS when compiling for host
--host-ld=HOSTLD use host linker HOSTLD
--host-ldflags=HLDFLAGS use HLDFLAGS when linking for host
--host-libs=HLIBS use libs HLIBS when linking for host
--host-os=OS compiler host OS [$target_os]
Expand Down Expand Up @@ -1282,6 +1283,7 @@ CMDLINE_SET="
extra_version
host_cc
host_cflags
host_ld
host_ldflags
host_libs
host_os
Expand Down Expand Up @@ -1785,6 +1787,7 @@ CC_O='-o $@'
LD_O='-o $@'
HOSTCC_C='-c'
HOSTCC_O='-o $@'
HOSTLD_O='-o $@'

host_cflags='-D_ISOC99_SOURCE -D_XOPEN_SOURCE=600 -O3 -g'
host_libs='-lm'
Expand Down Expand Up @@ -2269,9 +2272,7 @@ set_ccvars CC

probe_cc hostcc "$host_cc"
host_cflags_filter=$_flags_filter
host_ldflags_filter=$_flags_filter
add_host_cflags $_flags $_cflags
add_host_ldflags $_flags $_ldflags
set_ccvars HOSTCC

test -n "$cc_type" && enable $cc_type ||
Expand All @@ -2280,7 +2281,8 @@ test -n "$cc_type" && enable $cc_type ||
: ${as_default:=$cc}
: ${dep_cc_default:=$cc}
: ${ld_default:=$cc}
set_default ar as dep_cc ld
: ${host_ld_default:=$host_cc}
set_default ar as dep_cc ld host_ld

probe_cc as "$as"
asflags_filter=$_flags_filter
Expand All @@ -2293,6 +2295,11 @@ add_ldflags $_flags $_ldflags
test "$cc_type" != "$ld_type" && add_ldflags $cc_ldflags
LD_O=${_ld_o-$LD_O}

probe_cc hostld "$host_ld"
host_ldflags_filter=$_flags_filter
add_host_ldflags $_flags $_ldflags
HOSTLD_O=${_ld_o-$HOSTLD_O}

if [ -z "$CC_DEPFLAGS" ] && [ "$dep_cc" != "$cc" ]; then
probe_cc depcc "$dep_cc"
CCDEP=${_DEPCMD:-$DEPCMD}
Expand Down Expand Up @@ -3537,6 +3544,7 @@ ASDEP_FLAGS=$ASDEP_FLAGS
CC_DEPFLAGS=$CC_DEPFLAGS
AS_DEPFLAGS=$AS_DEPFLAGS
HOSTCC=$host_cc
HOSTLD=$host_ld
HOSTCFLAGS=$host_cflags
HOSTEXESUF=$HOSTEXESUF
HOSTLDFLAGS=$host_ldflags
Expand All @@ -3548,6 +3556,7 @@ HOSTCCDEP_FLAGS=$HOSTCCDEP_FLAGS
HOSTCC_DEPFLAGS=$HOSTCC_DEPFLAGS
HOSTCC_C=$HOSTCC_C
HOSTCC_O=$HOSTCC_O
HOSTLD_O=$HOSTLD_O
TARGET_EXEC=$target_exec
TARGET_PATH=$target_path
LIBS-avplay=$sdl_libs
Expand Down

0 comments on commit 095792f

Please sign in to comment.