You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by David Ashley <da...@xdr.com> on 2003/08/13 17:48:56 UTC
[PATCH] diff against 1.3.28 to allow cross compilation
This is a very simple patch to make cross compilation easier, I needed
to cross compile for ppc. The idea is CC = the cross compiler you use
to build apache, and I make NCC = the native compiler for building on
the host/build system. There are some utilities created in src/main that
need to execute on the build system, and those need to use the NCC
compiler.
I made it so NCC defaults to CC if it isn't defined, so this should be
harmless. Anyway the patch works fine for me. I build ppc with this:
CC=ppc-linux-gcc NCC=gcc ./configure --with-layout=Apache etc.
The patch works fine against 1.3.27 also.
diff -Nur apache_1.3.27/configure apache_1.3.27.ppc/configure
--- apache_1.3.27/configure Tue May 21 05:24:59 2002
+++ apache_1.3.27.ppc/configure Tue Aug 12 13:09:35 2003
@@ -1048,7 +1048,7 @@
echo "## restoring your configuration. Additional parameters can be supplied." >>$configstatus
echo "##" >>$configstatus
echo "" >>$configstatus
-for var in CC CPP OPTIM CFLAGS CFLAGS_SHLIB LDFLAGS LD_SHLIB LDFLAGS_SHLIB \
+for var in NCC CC CPP OPTIM CFLAGS CFLAGS_SHLIB LDFLAGS LD_SHLIB LDFLAGS_SHLIB \
LDFLAGS_SHLIB_EXPORT LIBS INCLUDES RANLIB DEPS TARGET; do
eval "val=\"\$$var\""
if [ "x$val" != "x" ]; then
@@ -1369,7 +1369,7 @@
# generate settings from imported environment variables
OIFS="$IFS"
IFS="$DIFS"
-for var in CC CPP OPTIM CFLAGS CFLAGS_SHLIB LDFLAGS LD_SHLIB LDFLAGS_SHLIB \
+for var in NCC CC CPP OPTIM CFLAGS CFLAGS_SHLIB LDFLAGS LD_SHLIB LDFLAGS_SHLIB \
LDFLAGS_SHLIB_EXPORT LIBS INCLUDES RANLIB DEPS TARGET; do
eval "val=\"\$$var\"";
if [ "x$val" != "x" ]; then
diff -Nur apache_1.3.27/src/Configuration.tmpl apache_1.3.27.ppc/src/Configuration.tmpl
--- apache_1.3.27/src/Configuration.tmpl Thu Jan 17 05:20:50 2002
+++ apache_1.3.27.ppc/src/Configuration.tmpl Tue Aug 12 13:27:27 2003
@@ -58,6 +58,7 @@
EXTRA_DEPS=
#CC=
+#NCC=
#CPP=
#OPTIM=
#RANLIB=
diff -Nur apache_1.3.27/src/Configure apache_1.3.27.ppc/src/Configure
--- apache_1.3.27/src/Configure Wed Jul 24 13:41:23 2002
+++ apache_1.3.27.ppc/src/Configure Tue Aug 12 13:24:11 2003
@@ -130,7 +130,7 @@
exit 1
fi
-echo "Using config file: $file"
+echo "Using config file $file"
####################################################################
## From the Configuration file, create a "cleaned-up" version
Binary files apache_1.3.27/src/core and apache_1.3.27.ppc/src/core differ
diff -Nur apache_1.3.27/src/main/Makefile.tmpl apache_1.3.27.ppc/src/main/Makefile.tmpl
--- apache_1.3.27/src/main/Makefile.tmpl Thu Jun 22 16:22:27 2000
+++ apache_1.3.27.ppc/src/main/Makefile.tmpl Tue Aug 12 13:01:30 2003
@@ -1,3 +1,6 @@
+ifndef NCC
+NCC=$(CC)
+endif
CFLAGS=$(OPTIM) $(CFLAGS1) $(EXTRA_CFLAGS)
LIBS=$(EXTRA_LIBS) $(LIBS1)
@@ -33,13 +36,13 @@
./gen_uri_delims >uri_delims.h
gen_uri_delims: gen_uri_delims.o
- $(CC) $(CFLAGS) $(LDFLAGS) -o gen_uri_delims gen_uri_delims.o $(LIBS)
+ $(NCC) $(CFLAGS) $(LDFLAGS) -o gen_uri_delims gen_uri_delims.o $(LIBS)
test_char.h: gen_test_char
./gen_test_char >test_char.h
gen_test_char: gen_test_char.o
- $(CC) $(CFLAGS) $(LDFLAGS) -o gen_test_char gen_test_char.o $(LIBS)
+ $(NCC) $(CFLAGS) $(LDFLAGS) -o gen_test_char gen_test_char.o $(LIBS)
# We really don't expect end users to use this rule. It works only with
# gcc, and rebuilds Makefile.tmpl. You have to re-run Configure after
@@ -73,7 +76,9 @@
$(INCDIR)/ap_config_auto.h $(OSDIR)/os.h $(INCDIR)/ap_ctype.h \
$(INCDIR)/hsregex.h $(INCDIR)/ap_alloc.h $(INCDIR)/buff.h \
$(INCDIR)/ap.h $(INCDIR)/util_uri.h
+ $(NCC) -o gen_test_char.o -c $(CFLAGS) gen_test_char.c $(INCLUDES)
gen_uri_delims.o: gen_uri_delims.c
+ $(NCC) -o gen_uri_delims.o -c $(CFLAGS) gen_uri_delims.c $(INCLUDES)
http_config.o: http_config.c $(INCDIR)/httpd.h $(INCDIR)/ap_config.h \
$(INCDIR)/ap_mmn.h $(INCDIR)/ap_config_auto.h $(OSDIR)/os.h \
$(INCDIR)/ap_ctype.h $(INCDIR)/hsregex.h $(INCDIR)/ap_alloc.h \