Merge lp:~peter-pearse/ubuntu/natty/tcl8.5/prop001 into lp:ubuntu/natty/tcl8.5

Proposed by Peter Pearse
Status: Needs review
Proposed branch: lp:~peter-pearse/ubuntu/natty/tcl8.5/prop001
Merge into: lp:ubuntu/natty/tcl8.5
Diff against target: 179 lines (+141/-0) (has conflicts)
4 files modified
debian/changelog (+14/-0)
debian/patches/cross.diff (+121/-0)
debian/patches/series (+5/-0)
debian/rules (+1/-0)
Text conflict in debian/changelog
Text conflict in debian/patches/series
To merge this branch: bzr merge lp:~peter-pearse/ubuntu/natty/tcl8.5/prop001
Reviewer Review Type Date Requested Status
Steve Langasek Needs Fixing
Review via email: mp+48137@code.launchpad.net

Description of the change

debian patch added to allow cross building of the unix variant.

unix/configure patched
- pass down both CC & CC_FOR_BUILD
- modify SHLIB_LD & STLIB_LD to pass ${CC_IN_USE} rather than ${CC} to
  allow two make passes with differing toolchains

configure.in not patched since the debian build does not autoconfigure.

unix/Makefile.in patched
- detect cross building
- if cross building add an extra pass to build a host tclch & preserve it
  for the second pass

To post a comment you must log in.
Revision history for this message
Steve Langasek (vorlon) wrote :

The changelog says "add debian patch" - does that mean this is a patch sourced from Debian? If so, please document the authorship.

Revision history for this message
Steve Langasek (vorlon) wrote :

Very nice overall. A few comments:

+ifeq ($(BUILD_HOST_PASS),)
+ ifneq ($(CC),$(CC_FOR_BUILD))
+ @echo "Copy back the binary from the build host pass"
+ cp tclsh_host tclsh
+ endif
+else

Surely the second check is redundant, since BUILD_HOST_PASS is only set when $(CC) and $(CC_FOR_BUILD) are different. Simplify by dropping the inner check?

+ifeq ($(BUILD_HOST_PASS),)
+ # Cross compiler
+ CC_TO_USE = $(CC)
+else
+ # Build host compiler
+ CC_TO_USE = $(CC_FOR_BUILD)
+endif

With the previous change, because the build-host build is done in a submake we can instead reduce this to:

ifneq ($(BUILD_HOST_PASS),)
     # Build host compiler
     CC = $(CC_FOR_BUILD)
endif

That will significantly shorten the patch.

Also, changes to unix/configure.in seem to be missing from the patch; only the changes to unix/configure are applied.

review: Needs Fixing
Revision history for this message
Steve Langasek (vorlon) wrote :

Lastly: debian/changelog shows a version of '8.5.8-2build2'. the 'build' suffix is reserved for binary-only package rebuilds that don't change the source; this needs to be '8.5.8-2ubuntu1'.

14. By Peter Pearse

Incorporate Steve Langasek's suggestions.

Unmerged revisions

14. By Peter Pearse

Incorporate Steve Langasek's suggestions.

13. By Peter Pearse

Add debian patch to allow cross building of unix variant

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/changelog'
2--- debian/changelog 2011-03-03 20:01:52 +0000
3+++ debian/changelog 2011-04-19 14:06:14 +0000
4@@ -1,3 +1,4 @@
5+<<<<<<< TREE
6 tcl8.5 (8.5.9-2) unstable; urgency=low
7
8 * Moved /usr/share/tcltk/tcl8.5/tclConfig.sh back to the /usr/lib/tcl8.5
9@@ -15,6 +16,19 @@
10 * Added ${misc:Depends} to debian/control.
11
12 -- Sergei Golovan <sgolovan@debian.org> Fri, 05 Nov 2010 13:33:59 +0300
13+=======
14+tcl8.5 (8.5.8-2ubuntu1) natty; urgency=low
15+
16+ * Patch to allow cross building of unix variant
17+
18+ -- Peter Pearse <peter.pearse@linaro.org> Tue, 01 Feb 2011 11:05:28 +0000
19+
20+tcl8.5 (8.5.8-2build1) maverick; urgency=low
21+
22+ * Rebuild to set TCL_CC properly on i386.
23+
24+ -- Matthias Klose <doko@ubuntu.com> Wed, 30 Jun 2010 13:53:09 +0200
25+>>>>>>> MERGE-SOURCE
26
27 tcl8.5 (8.5.8-2) unstable; urgency=low
28
29
30=== added file 'debian/patches/cross.diff'
31--- debian/patches/cross.diff 1970-01-01 00:00:00 +0000
32+++ debian/patches/cross.diff 2011-04-19 14:06:14 +0000
33@@ -0,0 +1,121 @@
34+Index: tcl8.5/unix/configure
35+===================================================================
36+--- tcl8.5.orig/unix/configure 2011-04-19 13:50:23.000000000 +0000
37++++ tcl8.5/unix/configure 2011-04-19 13:50:23.000000000 +0000
38+@@ -308,7 +308,7 @@
39+ # include <unistd.h>
40+ #endif"
41+
42+-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 MAN_FLAGS CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP EGREP TCL_THREADS RANLIB ac_ct_RANLIB AR LIBOBJS TCL_LIBS DL_LIBS DL_OBJS PLAT_OBJS PLAT_SRCS LDAIX_SRC CFLAGS_DEBUG CFLAGS_OPTIMIZE CFLAGS_WARNING LDFLAGS_DEBUG LDFLAGS_OPTIMIZE CC_SEARCH_FLAGS LD_SEARCH_FLAGS STLIB_LD SHLIB_LD TCL_SHLIB_LD_EXTRAS TK_SHLIB_LD_EXTRAS SHLIB_LD_LIBS SHLIB_CFLAGS SHLIB_SUFFIX MAKE_LIB MAKE_STUB_LIB INSTALL_LIB INSTALL_STUB_LIB CFLAGS_DEFAULT LDFLAGS_DEFAULT DTRACE TCL_VERSION TCL_MAJOR_VERSION TCL_MINOR_VERSION TCL_PATCH_LEVEL TCL_YEAR TCL_LIB_FILE TCL_LIB_FLAG TCL_LIB_SPEC TCL_STUB_LIB_FILE TCL_STUB_LIB_FLAG TCL_STUB_LIB_SPEC TCL_STUB_LIB_PATH TCL_INCLUDE_SPEC TCL_BUILD_STUB_LIB_SPEC TCL_BUILD_STUB_LIB_PATH TCL_SRC_DIR CFG_TCL_SHARED_LIB_SUFFIX CFG_TCL_UNSHARED_LIB_SUFFIX CFG_TCL_EXPORT_FILE_SUFFIX TCL_SHARED_BUILD LD_LIBRARY_PATH_VAR TCL_BUILD_LIB_SPEC TCL_NEEDS_EXP_FILE TCL_BUILD_EXP_FILE TCL_EXP_FILE TCL_LIB_VERSIONS_OK TCL_SHARED_LIB_SUFFIX TCL_UNSHARED_LIB_SUFFIX TCL_HAS_LONGLONG INSTALL_TZDATA DTRACE_SRC DTRACE_HDR DTRACE_OBJ MAKEFILE_SHELL BUILD_DLTEST TCL_PACKAGE_PATH TCL_MODULE_PATH TCL_LIBRARY PRIVATE_INCLUDE_DIR HTML_DIR EXTRA_CC_SWITCHES EXTRA_APP_CC_SWITCHES EXTRA_INSTALL EXTRA_INSTALL_BINARIES EXTRA_BUILD_HTML EXTRA_TCLSH_LIBS DLTEST_LD DLTEST_SUFFIX'
43++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 MAN_FLAGS CC CC_FOR_BUILD CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP EGREP TCL_THREADS RANLIB ac_ct_RANLIB AR LIBOBJS TCL_LIBS DL_LIBS DL_OBJS PLAT_OBJS PLAT_SRCS LDAIX_SRC CFLAGS_DEBUG CFLAGS_OPTIMIZE CFLAGS_WARNING LDFLAGS_DEBUG LDFLAGS_OPTIMIZE CC_SEARCH_FLAGS LD_SEARCH_FLAGS STLIB_LD SHLIB_LD TCL_SHLIB_LD_EXTRAS TK_SHLIB_LD_EXTRAS SHLIB_LD_LIBS SHLIB_CFLAGS SHLIB_SUFFIX MAKE_LIB MAKE_STUB_LIB INSTALL_LIB INSTALL_STUB_LIB CFLAGS_DEFAULT LDFLAGS_DEFAULT DTRACE TCL_VERSION TCL_MAJOR_VERSION TCL_MINOR_VERSION TCL_PATCH_LEVEL TCL_YEAR TCL_LIB_FILE TCL_LIB_FLAG TCL_LIB_SPEC TCL_STUB_LIB_FILE TCL_STUB_LIB_FLAG TCL_STUB_LIB_SPEC TCL_STUB_LIB_PATH TCL_INCLUDE_SPEC TCL_BUILD_STUB_LIB_SPEC TCL_BUILD_STUB_LIB_PATH TCL_SRC_DIR CFG_TCL_SHARED_LIB_SUFFIX CFG_TCL_UNSHARED_LIB_SUFFIX CFG_TCL_EXPORT_FILE_SUFFIX TCL_SHARED_BUILD LD_LIBRARY_PATH_VAR TCL_BUILD_LIB_SPEC TCL_NEEDS_EXP_FILE TCL_BUILD_EXP_FILE TCL_EXP_FILE TCL_LIB_VERSIONS_OK TCL_SHARED_LIB_SUFFIX TCL_UNSHARED_LIB_SUFFIX TCL_HAS_LONGLONG INSTALL_TZDATA DTRACE_SRC DTRACE_HDR DTRACE_OBJ MAKEFILE_SHELL BUILD_DLTEST TCL_PACKAGE_PATH TCL_MODULE_PATH TCL_LIBRARY PRIVATE_INCLUDE_DIR HTML_DIR EXTRA_CC_SWITCHES EXTRA_APP_CC_SWITCHES EXTRA_INSTALL EXTRA_INSTALL_BINARIES EXTRA_BUILD_HTML EXTRA_TCLSH_LIBS DLTEST_LD DLTEST_SUFFIX'
44+ ac_subst_files=''
45+
46+ # Initialize some variables set by options.
47+@@ -10021,6 +10021,25 @@
48+ { (exit 1); exit 1; }; } ;;
49+ esac
50+
51++#--------------------------------------------------------------------
52++# When cross building one may need to build some tools as both
53++# host & build binaries so we supply both build & host compilers
54++#--------------------------------------------------------------------
55++echo "$as_me:$LINENO: setting CC_FOR_BUILD" >&5
56++echo $ECHO_N "setting CC_FOR_BUILD... $ECHO_C" >&6
57++
58++CC_FOR_BUILD=${CC}
59++if test "$cross_compiling" != no; then
60++ cc_converted=`echo ${CC} | sed 's/-/\//g'`
61++ cc_suffix=`basename $cc_converted`
62++ if test "x$build_alias" = x; then
63++ CC_FOR_BUILD=$cc_suffix
64++ else
65++ CC_FOR_BUILD=$build_alias\-$cc_suffix
66++ fi
67++fi
68++echo "$as_me:$LINENO: result: $CC_FOR_BUILD" >&5
69++echo "${CC_FOR_BUILD}" >&6
70+
71+ #--------------------------------------------------------------------
72+ # Supply substitutes for missing POSIX library procedures, or
73+@@ -19158,8 +19177,6 @@
74+ DEFS=`sed -n -f confdef2opt.sed confdefs.h | tr "$ac_LF_and_DOT" ' .'`
75+ rm -f confdef2opt.sed
76+
77+-
78+-
79+ CFLAGS="${CFLAGS} ${CPPFLAGS}"; CPPFLAGS=""
80+
81+ : ${CONFIG_STATUS=./config.status}
82+@@ -19691,6 +19708,7 @@
83+ s,@LIBS@,$LIBS,;t t
84+ s,@MAN_FLAGS@,$MAN_FLAGS,;t t
85+ s,@CC@,$CC,;t t
86++s,@CC_FOR_BUILD@,$CC_FOR_BUILD,;t t
87+ s,@CFLAGS@,$CFLAGS,;t t
88+ s,@LDFLAGS@,$LDFLAGS,;t t
89+ s,@CPPFLAGS@,$CPPFLAGS,;t t
90+Index: tcl8.5/unix/Makefile.in
91+===================================================================
92+--- tcl8.5.orig/unix/Makefile.in 2011-04-19 13:50:23.000000000 +0000
93++++ tcl8.5/unix/Makefile.in 2011-04-19 13:56:44.000000000 +0000
94+@@ -236,8 +236,14 @@
95+ TCL_BUILDTIME_LIBRARY = @TCL_SRC_DIR@/library
96+
97+ CC = @CC@
98++# Compiler for building build host tools used during the build:
99++CC_FOR_BUILD = @CC_FOR_BUILD@
100+ #CC = purify -best-effort @CC@ -DPURIFY
101+
102++ifeq ($(BUILD_HOST_PASS),1)
103++ CC = $(CC_FOR_BUILD)
104++endif
105++
106+ # Flags to be passed to installManPage to control how the manpages should be
107+ # installed (symlinks, compression, package name suffix).
108+ MAN_FLAGS = @MAN_FLAGS@
109+@@ -540,7 +546,21 @@
110+ SRCS = $(GENERIC_SRCS) $(TOMMATH_SRCS) $(UNIX_SRCS) $(NOTIFY_SRCS) \
111+ $(STUB_SRCS) @PLAT_SRCS@
112+
113++
114++ifeq (${CC},${CC_FOR_BUILD})
115+ all: binaries libraries doc
116++else
117++
118++# Add a target to build the host binaries (tclsh) used during the build
119++all: host_binaries binaries libraries doc
120++
121++host_binaries:
122++ @echo "Build the host binaries used during the build"
123++ $(MAKE) binaries BUILD_HOST_PASS=1
124++ @echo "Now clean for cross building pass"
125++ $(MAKE) clean BUILD_HOST_PASS=1
126++
127++endif
128+
129+ binaries: ${LIB_FILE} $(STUB_LIB_FILE) $(TCL_BUILD_EXP_FILE) tclsh
130+
131+@@ -572,6 +592,14 @@
132+ tclsh: ${TCLSH_OBJS} ${TCL_LIB_FILE}
133+ ${CC} ${CFLAGS} ${LDFLAGS} ${TCLSH_OBJS} @TCL_BUILD_LIB_SPEC@ ${LIBS} @EXTRA_TCLSH_LIBS@ \
134+ ${CC_SEARCH_FLAGS} -o tclsh
135++ cp tclsh tclsh_to_install
136++ifeq ($(BUILD_HOST_PASS),)
137++ @echo "Copy back the binary from the build host pass"
138++ cp tclsh_host tclsh
139++else
140++ @echo "Preserve the host binary for use in the second pass"
141++ cp tclsh tclsh_host
142++endif
143+
144+ # Resetting the LIB_RUNTIME_DIR below is required so that the generated
145+ # tcltest executable gets the build directory burned into its ld search path.
146+@@ -740,7 +768,7 @@
147+ "$(LIB_INSTALL_DIR)"/$(TCL_EXP_FILE); \
148+ fi
149+ @echo "Installing tclsh as $(BIN_INSTALL_DIR)/tclsh$(VERSION)"
150+- @$(INSTALL_PROGRAM) tclsh "$(BIN_INSTALL_DIR)"/tclsh$(VERSION)
151++ @$(INSTALL_PROGRAM) tclsh_to_install "$(BIN_INSTALL_DIR)"/tclsh$(VERSION)
152+ @echo "Installing tclConfig.sh to $(CONFIG_INSTALL_DIR)/"
153+ @$(INSTALL_DATA) tclConfig.sh "$(CONFIG_INSTALL_DIR)"/tclConfig.sh
154+ @if test "$(STUB_LIB_FILE)" != "" ; then \
155
156=== modified file 'debian/patches/series'
157--- debian/patches/series 2010-11-05 13:33:59 +0000
158+++ debian/patches/series 2011-04-19 14:06:14 +0000
159@@ -6,3 +6,8 @@
160 rpath.diff
161 non-linux.diff
162 manpages.diff
163+<<<<<<< TREE
164+=======
165+mips.diff
166+cross.diff
167+>>>>>>> MERGE-SOURCE
168
169=== modified file 'debian/rules'
170--- debian/rules 2011-03-03 20:01:52 +0000
171+++ debian/rules 2011-04-19 14:06:14 +0000
172@@ -138,6 +138,7 @@
173 rm $$f ; \
174 fi ; \
175 done
176+ find unix -name tclsh_\* -exec rm -fr {} \;
177 touch install-stamp
178
179 # Build architecture-independent files here.

Subscribers

People subscribed via source and target branches

to all changes: