diff --git a/Makefile.am b/Makefile.am index c86d5439bb..d24060346d 100644 --- a/Makefile.am +++ b/Makefile.am @@ -410,7 +410,7 @@ $(OUR_MODULES): $(switch_builddir)/modules.conf libfreeswitch.la test -z "$$fail" build/print_git_revision: build/print_git_revision.c - $(CC) -o $@ $< + $(CC_FOR_BUILD) -o $@ $< src/switch_version.lo: src/include/switch_version.h diff --git a/configure.ac b/configure.ac index 0577c2e0f5..4c52bb86de 100644 --- a/configure.ac +++ b/configure.ac @@ -218,6 +218,14 @@ AC_PROG_LIBTOOL #Check for compiler vendor AX_COMPILER_VENDOR +# Set CC_FOR_BUILD +if test "x${cross_compiling}" = "xyes"; then + CC_FOR_BUILD=${CC_FOR_BUILD-gcc} +else + CC_FOR_BUILD='$(CC)' +fi +AC_SUBST(CC_FOR_BUILD) + # Optimize AC_ARG_ENABLE(optimization, [AC_HELP_STRING([--enable-optimization],[Set if you want us to add max optimising compiler flags])],[enable_optimizer="$enableval"],[enable_optimizer="no"])