configure: set HOSTCC to native compiler
The HOSTCC value defaults to the value of CC if not cross-compiling. If cross-compiling, HOSTCC defaults to "gcc". HOSTCFLAGS, HOSTLDFLAGS, and HOSTLIBS are also given sensible default values. Originally committed as revision 15912 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
parent
88268e944a
commit
9da6609f2d
22
configure
vendored
22
configure
vendored
@ -119,6 +119,10 @@ show_help(){
|
|||||||
echo " --enable-cross-compile assume a cross-compiler is used"
|
echo " --enable-cross-compile assume a cross-compiler is used"
|
||||||
echo " --target-os=OS compiler targets OS [$target_os]"
|
echo " --target-os=OS compiler targets OS [$target_os]"
|
||||||
echo " --cc=CC use C compiler CC [$cc]"
|
echo " --cc=CC use C compiler CC [$cc]"
|
||||||
|
echo " --host-cc=HOSTCC use host C compiler HOSTCC"
|
||||||
|
echo " --host-cflags=HCFLAGS use HCFLAGS when compiling for host"
|
||||||
|
echo " --host-ldflags=HLDFLAGS use HLDFLAGS when linking for host"
|
||||||
|
echo " --host-libs=HLIBS use libs HLIBS when linking for host"
|
||||||
echo " --extra-cflags=ECFLAGS add ECFLAGS to CFLAGS [$CFLAGS]"
|
echo " --extra-cflags=ECFLAGS add ECFLAGS to CFLAGS [$CFLAGS]"
|
||||||
echo " --extra-ldflags=ELDFLAGS add ELDFLAGS to LDFLAGS [$LDFLAGS]"
|
echo " --extra-ldflags=ELDFLAGS add ELDFLAGS to LDFLAGS [$LDFLAGS]"
|
||||||
echo " --extra-libs=ELIBS add ELIBS [$ELIBS]"
|
echo " --extra-libs=ELIBS add ELIBS [$ELIBS]"
|
||||||
@ -906,6 +910,10 @@ CMDLINE_SET="
|
|||||||
cpu
|
cpu
|
||||||
cross_prefix
|
cross_prefix
|
||||||
extra_version
|
extra_version
|
||||||
|
host_cc
|
||||||
|
host_cflags
|
||||||
|
host_ldflags
|
||||||
|
host_libs
|
||||||
logfile
|
logfile
|
||||||
source_path
|
source_path
|
||||||
target_os
|
target_os
|
||||||
@ -1062,6 +1070,7 @@ shlibdir_default="$libdir_default"
|
|||||||
|
|
||||||
# toolchain
|
# toolchain
|
||||||
cc_default="gcc"
|
cc_default="gcc"
|
||||||
|
host_cc_default="gcc"
|
||||||
yasmexe="yasm"
|
yasmexe="yasm"
|
||||||
ar="ar"
|
ar="ar"
|
||||||
nm="nm"
|
nm="nm"
|
||||||
@ -1109,6 +1118,9 @@ SLIBNAME_WITH_VERSION='$(SLIBNAME).$(LIBVERSION)'
|
|||||||
SLIBNAME_WITH_MAJOR='$(SLIBNAME).$(LIBMAJOR)'
|
SLIBNAME_WITH_MAJOR='$(SLIBNAME).$(LIBMAJOR)'
|
||||||
LIB_INSTALL_EXTRA_CMD='$(RANLIB) "$(LIBDIR)/$(LIBNAME)"'
|
LIB_INSTALL_EXTRA_CMD='$(RANLIB) "$(LIBDIR)/$(LIBNAME)"'
|
||||||
|
|
||||||
|
host_cflags='-O3 -g -Wall'
|
||||||
|
host_libs='-lm'
|
||||||
|
|
||||||
# gcc stupidly only outputs the basename of targets with -MM, but we need the
|
# gcc stupidly only outputs the basename of targets with -MM, but we need the
|
||||||
# full relative path for objects in subdirectories for non-recursive Make.
|
# full relative path for objects in subdirectories for non-recursive Make.
|
||||||
DEPEND_CMD='$(CC) $(CFLAGS) -MM -MG $< | sed -e "/^\#.*/d" -e "s,^[[:space:]]*$(*F)\\.o,$(@D)/$(*F).o," -e "s,\\([[:space:]]\\)\\(version\\.h\\),\\1\$$(BUILD_ROOT_REL)/\\2,"'
|
DEPEND_CMD='$(CC) $(CFLAGS) -MM -MG $< | sed -e "/^\#.*/d" -e "s,^[[:space:]]*$(*F)\\.o,$(@D)/$(*F).o," -e "s,\\([[:space:]]\\)\\(version\\.h\\),\\1\$$(BUILD_ROOT_REL)/\\2,"'
|
||||||
@ -1223,6 +1235,8 @@ disabled logging && logfile=/dev/null
|
|||||||
echo "# $0 $@" > $logfile
|
echo "# $0 $@" > $logfile
|
||||||
set >> $logfile
|
set >> $logfile
|
||||||
|
|
||||||
|
test -n "$cross_prefix" && enable cross_compile
|
||||||
|
|
||||||
cc_default="${cross_prefix}${cc_default}"
|
cc_default="${cross_prefix}${cc_default}"
|
||||||
yasmexe="${cross_prefix}${yasmexe}"
|
yasmexe="${cross_prefix}${yasmexe}"
|
||||||
ar="${cross_prefix}${ar}"
|
ar="${cross_prefix}${ar}"
|
||||||
@ -1231,6 +1245,8 @@ ranlib="${cross_prefix}${ranlib}"
|
|||||||
strip="${cross_prefix}${strip}"
|
strip="${cross_prefix}${strip}"
|
||||||
|
|
||||||
set_default cc
|
set_default cc
|
||||||
|
enabled cross_compile || host_cc_default=$cc
|
||||||
|
set_default host_cc
|
||||||
|
|
||||||
# set temporary file name
|
# set temporary file name
|
||||||
if test ! -z "$TMPDIR" ; then
|
if test ! -z "$TMPDIR" ; then
|
||||||
@ -1497,8 +1513,6 @@ add_extralibs $osextralibs
|
|||||||
# Combine FFLDFLAGS and the LDFLAGS environment variable.
|
# Combine FFLDFLAGS and the LDFLAGS environment variable.
|
||||||
LDFLAGS="$FFLDFLAGS $LDFLAGS"
|
LDFLAGS="$FFLDFLAGS $LDFLAGS"
|
||||||
|
|
||||||
test -n "$cross_prefix" && enable cross_compile
|
|
||||||
|
|
||||||
# we need to build at least one lib type
|
# we need to build at least one lib type
|
||||||
if ! enabled_any static shared; then
|
if ! enabled_any static shared; then
|
||||||
cat <<EOF
|
cat <<EOF
|
||||||
@ -2221,6 +2235,10 @@ echo "SLIBSUF=$SLIBSUF" >> config.mak
|
|||||||
echo "EXESUF=$EXESUF" >> config.mak
|
echo "EXESUF=$EXESUF" >> config.mak
|
||||||
echo "EXTRA_VERSION=$extra_version" >> config.mak
|
echo "EXTRA_VERSION=$extra_version" >> config.mak
|
||||||
echo "DEPEND_CMD=$DEPEND_CMD" >> config.mak
|
echo "DEPEND_CMD=$DEPEND_CMD" >> config.mak
|
||||||
|
echo "HOSTCC=$host_cc" >> config.mak
|
||||||
|
echo "HOSTCFLAGS=$host_cflags" >> config.mak
|
||||||
|
echo "HOSTLDFLAGS=$host_ldflags" >> config.mak
|
||||||
|
echo "HOSTLIBS=$host_libs" >> config.mak
|
||||||
|
|
||||||
if enabled bigendian; then
|
if enabled bigendian; then
|
||||||
echo "WORDS_BIGENDIAN=yes" >> config.mak
|
echo "WORDS_BIGENDIAN=yes" >> config.mak
|
||||||
|
Loading…
Reference in New Issue
Block a user