[Home]

Summary:ASTERISK-09914: [patch] allow extra flags for cross compilation
Reporter:Thorsten Glaser (mirabilos)Labels:
Date Opened:2007-07-20 05:40:49Date Closed:2007-09-06 16:49:12
Priority:MinorRegression?No
Status:Closed/CompleteComponents:Core/BuildSystem
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:
Description:When cross-compiling, it is usually necessary to pass extra
CFLAGS and LDFLAGS to the build system from the parent build
environment, in this case, the FreeWRT ADK (trunk version).

Attached is a patch to provide this ability; feel free to
solve this with a different way though.

Cause of the problem: while CFLAGS and LDFLAGS are passed by
environment, the Makefiles do not add to them with += but
overwrite or just don't use them, so we have to pass them as
an additional make flag.

This patch is currently part of the FreeWRT ADK; I hereby
submit it for inclusion into upstream on behalf of the author,
my employer.


****** STEPS TO REPRODUCE ******

Try to pass extra CFLAGS to the Asterisk build system.

****** ADDITIONAL INFORMATION ******

--- asterisk-1.4.0.orig/Makefile        2006-12-22 23:33:46.000000000 +0100
+++ asterisk-1.4.0/Makefile     2007-01-15 12:34:22.000000000 +0100
@@ -180,6 +180,10 @@ ifeq ($(OSARCH),linux-gnu)
  endif
endif

+# fix for cross compiling
+ASTCFLAGS+= ${EXTRA_CFLAGS} ${EXTRA_CPPFLAGS}
+ASTLDFLAGS+= ${EXTRA_LDFLAGS}
+
ASTCFLAGS+=-pipe -Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations $(DEBUG)

ASTCFLAGS+=-include $(ASTTOPDIR)/include/asterisk/autoconfig.h
Comments:By: Jason Parker (jparker) 2007-07-20 17:32:38

Please verify licensing concerns in http://bugs.digium.com/view.php?id=10252#67674

By: Jason Parker (jparker) 2007-09-06 16:49:12

As of at revision 81827, 1.4 and trunk support COPTS and LDOPTS variables, which get added to ASTCFLAGS and ASTLDFLAGS.