Tom Lane wrote:
> > I can pull out NO_PGPORT, but what commit causes the original
> > problem? Was it only one?  (I wasn't watching.)
>
> This one:
>
> 2005-07-03 14:54  petere

Attached is the patch, in case someone wants to revert it.  (I'd do it 
myself but I suppose this would interfere with rolling back the 
subsequent patches.)

I apologize for all the trouble.

-- 
Peter Eisentraut
http://developer.postgresql.org/~petere/
diff -ur ../cvs-pgsql/configure ./configure
--- ../cvs-pgsql/configure	2005-07-01 20:16:43.000000000 +0200
+++ ./configure	2005-07-03 20:12:54.531260250 +0200
@@ -314,7 +314,7 @@
 # include <unistd.h>
 #endif"
 
-ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS configure_args build build_cpu build_vendor build_os host host_cpu host_vendor host_os PORTNAME docdir enable_nls WANTED_LANGUAGES default_port enable_shared enable_rpath enable_debug CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP GCC TAS autodepend INCLUDES enable_thread_safety with_tcl with_perl with_python with_krb5 krb_srvtab with_pam with_bonjour with_openssl EGREP ELF_SYS LDFLAGS_SL AWK FLEX FLEXFLAGS LN_S LD with_gnu_ld ld_R_works RANLIB ac_ct_RANLIB LORDER TAR STRIP ac_ct_STRIP STRIP_STATIC_LIB STRIP_SHARED_LIB YACC YFLAGS PERL perl_archlibexp perl_privlibexp perl_useshrplib perl_embed_ldflags PYTHON python_version python_configdir python_includespec python_libdir python_libspec python_additional_libs HAVE_IPV6 LIBOBJS acx_pthread_config PTHREAD_CC PTHREAD_LIBS PTHREAD_CFLAGS HAVE_POSIX_SIGNALS MSGFMT MSGMERGE XGETTEXT localedir TCLSH TCL_CONFIG_SH TCL_INCLUDE_SPEC TCL_LIB_FILE TCL_LIBS TCL_LIB_SPEC TCL_SHARED_BUILD TCL_SHLIB_LD_LIBS NSGMLS JADE have_docbook DOCBOOKSTYLE COLLATEINDEX SGMLSPL vpath_build LTLIBOBJS'
+ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS configure_args build build_cpu build_vendor build_os host host_cpu host_vendor host_os PORTNAME docdir enable_nls WANTED_LANGUAGES default_port enable_shared enable_rpath enable_debug CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP GCC CC_FOR_BUILD TAS autodepend INCLUDES enable_thread_safety with_tcl with_perl with_python with_krb5 krb_srvtab with_pam with_bonjour with_openssl EGREP ELF_SYS LDFLAGS_SL AWK FLEX FLEXFLAGS LN_S LD with_gnu_ld ld_R_works RANLIB ac_ct_RANLIB LORDER TAR STRIP ac_ct_STRIP STRIP_STATIC_LIB STRIP_SHARED_LIB YACC YFLAGS PERL perl_archlibexp perl_privlibexp perl_useshrplib perl_embed_ldflags PYTHON python_version python_configdir python_includespec python_libdir python_libspec python_additional_libs HAVE_IPV6 LIBOBJS acx_pthread_config PTHREAD_CC PTHREAD_LIBS PTHREAD_CFLAGS HAVE_POSIX_SIGNALS MSGFMT MSGMERGE XGETTEXT localedir TCLSH TCL_CONFIG_SH TCL_INCLUDE_SPEC TCL_LIB_FILE TCL_LIBS TCL_LIB_SPEC TCL_SHARED_BUILD TCL_SHLIB_LD_LIBS NSGMLS JADE have_docbook DOCBOOKSTYLE COLLATEINDEX SGMLSPL vpath_build LTLIBOBJS'
 ac_subst_files=''
 
 # Initialize some variables set by options.
@@ -3306,6 +3306,17 @@
 
 
 #
+# Native compiler
+#
+
+if test -z "$CC_FOR_BUILD"; then
+  CC_FOR_BUILD=$CC
+fi
+
+
+
+
+#
 # Set up TAS assembly code if needed; the template file has now had its
 # chance to request this.
 #
@@ -22892,6 +22903,7 @@
 s,@OBJEXT@,$OBJEXT,;t t
 s,@CPP@,$CPP,;t t
 s,@GCC@,$GCC,;t t
+s,@CC_FOR_BUILD@,$CC_FOR_BUILD,;t t
 s,@TAS@,$TAS,;t t
 s,@autodepend@,$autodepend,;t t
 s,@INCLUDES@,$INCLUDES,;t t
diff -ur ../cvs-pgsql/configure.in ./configure.in
--- ../cvs-pgsql/configure.in	2005-07-01 20:17:30.000000000 +0200
+++ ./configure.in	2005-07-03 19:20:00.587380507 +0200
@@ -304,6 +304,17 @@
 
 
 #
+# Native compiler
+#
+
+if test -z "$CC_FOR_BUILD"; then
+  CC_FOR_BUILD=$CC
+fi
+
+AC_SUBST(CC_FOR_BUILD)
+
+
+#
 # Set up TAS assembly code if needed; the template file has now had its
 # chance to request this.
 #
diff -ur ../cvs-pgsql/doc/src/sgml/installation.sgml ./doc/src/sgml/installation.sgml
--- ../cvs-pgsql/doc/src/sgml/installation.sgml	2005-06-30 18:31:47.000000000 +0200
+++ ./doc/src/sgml/installation.sgml	2005-07-03 20:06:54.560270579 +0200
@@ -993,6 +993,23 @@
 <userinput>./configure CC=/opt/bin/gcc CFLAGS='-O2 -pipe'</>
 </screen>
     </para>
+
+    <para>
+     If you are cross-compiling<indexterm><primary>cross
+     compilation</primary></indexterm> (compiling on one architecture
+     with the intent to run on a different architecture), special care
+     needs to be taken.  First of all, specify the host architecture
+     (the architecture PostgreSQL will run on) using the option
+     <option>--host</option>.  The variables <envar>CC</>,
+     <envar>CFLAGS</>, etc. should refer to the build tools for the
+     host architecture.  During the build process, the time-zone
+     database for PostgreSQL is created and a special tool to do that
+     is compiled and run during the build process.  This tool needs to
+     be compiled using a native compiler.  Specify this compiler using
+     the variable <envar>CC_FOR_BUILD</envar>.  Cross compilation
+     requires expert knowledge and the support for this process in the
+     PostgreSQL tree should be considered somewhat experimental.
+    </para>
    </step>
 
   <step>
diff -ur ../cvs-pgsql/src/Makefile.global.in ./src/Makefile.global.in
--- ../cvs-pgsql/src/Makefile.global.in	2005-05-30 17:35:05.000000000 +0200
+++ ./src/Makefile.global.in	2005-07-03 19:20:00.587380507 +0200
@@ -182,6 +182,7 @@
 endif # not PGXS
 
 CC = @CC@
+CC_FOR_BUILD = @CC_FOR_BUILD@
 GCC = @GCC@
 CFLAGS = @CFLAGS@
 
diff -ur ../cvs-pgsql/src/timezone/Makefile ./src/timezone/Makefile
--- ../cvs-pgsql/src/timezone/Makefile	2005-01-04 20:41:01.000000000 +0100
+++ ./src/timezone/Makefile	2005-07-03 19:20:00.597378736 +0200
@@ -18,7 +18,7 @@
 OBJS= localtime.o strftime.o pgtz.o
 
 # files needed to build zic utility program
-ZICOBJS= zic.o ialloc.o scheck.o localtime.o
+ZICOBJS= zic.o ialloc.o scheck.o localtime-zic.o
 
 # timezone data files
 TZDATA := africa antarctica asia australasia europe northamerica southamerica \
@@ -30,8 +30,17 @@
 SUBSYS.o: $(OBJS)
 	$(LD) $(LDREL) $(LDOUT) SUBSYS.o $(OBJS)
 
+# In case of cross-compilation, zic needs to be built with a native
+# compiler because it is run during the build, not on the final
+# system.
+
+localtime-zic.c: localtime.c
+	$(LN_S) $< $@
+
+$(ZICOBJS): CC=$(CC_FOR_BUILD)
+
 zic: $(ZICOBJS)
-	$(CC) $(CFLAGS) $(ZICOBJS) $(LDFLAGS) $(LIBS) -o [EMAIL PROTECTED](X)
+	$(CC_FOR_BUILD) $(CFLAGS) $(ZICOBJS) -o [EMAIL PROTECTED](X)
 
 install: all installdirs
 	./zic -d $(DESTDIR)$(datadir)/timezone $(TZDATAFILES)
@@ -40,4 +49,4 @@
 	$(mkinstalldirs) $(DESTDIR)$(datadir)
 
 clean distclean maintainer-clean:
-	rm -f SUBSYS.o zic$(X) $(OBJS) $(ZICOBJS)
+	rm -f SUBSYS.o zic zic$(X) $(OBJS) $(ZICOBJS) localtime-zic.c
---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
    (send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])

Reply via email to