diff --git a/CHANGES b/CHANGES index 683b5d71cf..5abd272065 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,7 @@ +1956. [bug] Improve cross compile support, 'gen' is now built + by native compiler. See README for additional + cross compile support information. [RT #15148] + 1955. [bug] Pre-allocate the cache cleaning interator. [RT #14998] 1954. [func] Named now falls back to advertising EDNS with a diff --git a/README b/README index 2c89489ef1..737a391b5d 100644 --- a/README +++ b/README @@ -407,6 +407,17 @@ Building LDFLAGS Linker flags. Defaults to empty string. + The following need to be set when cross compiling. + + BUILD_CC + The native C compiler. + BUILD_CFLAGS (optional) + BUILD_CPPFLAGS (optional) + Possible Settings: + -DNEED_OPTARG=1 (optarg is not declared in ) + BUILD_LDFLAGS (optional) + BUILD_LIBS (optional) + To build shared libraries, specify "--with-libtool" on the configure command line. diff --git a/configure.in b/configure.in index ebb34af2d5..4ca47b2daf 100644 --- a/configure.in +++ b/configure.in @@ -18,7 +18,7 @@ AC_DIVERT_PUSH(1)dnl esyscmd([sed "s/^/# /" COPYRIGHT])dnl AC_DIVERT_POP()dnl -AC_REVISION($Revision: 1.355.18.44 $) +AC_REVISION($Revision: 1.355.18.45 $) AC_INIT(lib/dns/name.c) AC_PREREQ(2.59) @@ -1717,6 +1717,7 @@ AC_TRY_COMPILE([ [optarg = 0;], [AC_MSG_RESULT(yes)], [AC_MSG_RESULT(no) +GEN_NEED_OPTARG="-DNEED_OPTARG=1" AC_DEFINE(NEED_OPTARG, 1, [Defined if extern char *optarg is not declared.])]) # @@ -2334,6 +2335,27 @@ AC_SUBST(DLZ_DRIVER_SRCS) AC_SUBST(DLZ_DRIVER_OBJS) AC_SUBST_FILE(DLZ_DRIVER_RULES) +if test "cross_compiling" = "yes"; then + if test -z "$BUILD_CC"; then + AC_ERROR([BUILD_CC not set]) + fi + BUILD_CFLAGS="$BUILD_CFLAGS" + BUILD_CPPFLAGS="$BUILD_CPPFLAGS" + BUILD_LDFLAGS="$BUILD_LDFLAGS" + BUILD_LIBS="$BUILD_LIBS" +else + BUILD_CC="$CC" + BUILD_CFLAGS="$CFLAGS" + BUILD_CPPFLAGS="$CPPFLAGS $GEN_NEED_OPTARG" + BUILD_LDFLAGS="$LDFLAGS" + BUILD_LIBS="$LIBS" +fi + +AC_SUBST(BUILD_CC) +AC_SUBST(BUILD_CFLAGS) +AC_SUBST(BUILD_CPPFLAGS) +AC_SUBST(BUILD_LDFLAGS) +AC_SUBST(BUILD_LIBS) # # Commands to run at the end of config.status. diff --git a/lib/dns/Makefile.in b/lib/dns/Makefile.in index 3c1058b53a..73e94a1704 100644 --- a/lib/dns/Makefile.in +++ b/lib/dns/Makefile.in @@ -13,7 +13,7 @@ # OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR # PERFORMANCE OF THIS SOFTWARE. -# $Id: Makefile.in,v 1.144.18.8 2005/09/05 00:18:23 marka Exp $ +# $Id: Makefile.in,v 1.144.18.9 2006/01/05 00:30:10 marka Exp $ srcdir = @srcdir@ VPATH = @srcdir@ @@ -158,7 +158,8 @@ code.h: gen ./gen -s ${srcdir} > code.h gen: gen.c - ${CC} ${ALL_CFLAGS} ${LDFLAGS} -o $@ ${srcdir}/gen.c ${LIBS} + ${BUILD_CC} ${BUILD_CFLAGS} -I${top_srcdir}/lib/isc/include \ + ${BUILD_CPPFLAGS} ${BUILD_LDFLAGS} -o $@ ${srcdir}/gen.c ${BUILD_LIBS} rbtdb64.@O@: rbtdb.c diff --git a/lib/dns/gen.c b/lib/dns/gen.c index 205bd2d97a..7dac49865b 100644 --- a/lib/dns/gen.c +++ b/lib/dns/gen.c @@ -15,12 +15,10 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: gen.c,v 1.73.18.3 2005/06/04 00:39:03 marka Exp $ */ +/* $Id: gen.c,v 1.73.18.4 2006/01/05 00:30:10 marka Exp $ */ /*! \file */ -#include - #include #include diff --git a/make/rules.in b/make/rules.in index 6ebb17b97f..bca255f97e 100644 --- a/make/rules.in +++ b/make/rules.in @@ -13,7 +13,7 @@ # OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR # PERFORMANCE OF THIS SOFTWARE. -# $Id: rules.in,v 1.47.18.8 2005/10/28 01:53:28 marka Exp $ +# $Id: rules.in,v 1.47.18.9 2006/01/05 00:30:10 marka Exp $ ### ### Common Makefile rules for BIND 9. @@ -101,6 +101,12 @@ STD_CINCLUDES = @STD_CINCLUDES@ STD_CDEFINES = @STD_CDEFINES@ STD_CWARNINGS = @STD_CWARNINGS@ +BUILD_CC = @BUILD_CC@ +BUILD_CFLAGS = @BUILD_CFLAGS@ +BUILD_CPPFLAGS = @BUILD_CPPFLAGS@ +BUILD_LDFAGS = @BUILD_LDFAGS@ +BUILD_LIBS = @BUILD_LIBS@ + .SUFFIXES: .SUFFIXES: .c .@O@