1956. [bug] Improve cross compile support, 'gen' is now built

by native compiler.  See README for additional
                        cross compile support information. [RT #15148]
This commit is contained in:
Mark Andrews 2006-01-05 00:30:10 +00:00
parent 8c5dac56cd
commit 0befce1b74
6 changed files with 49 additions and 7 deletions

View file

@ -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

11
README
View file

@ -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 <unistd.h>)
BUILD_LDFLAGS (optional)
BUILD_LIBS (optional)
To build shared libraries, specify "--with-libtool" on the
configure command line.

View file

@ -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.

View file

@ -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

View file

@ -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 <config.h>
#include <sys/types.h>
#include <ctype.h>

View file

@ -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@