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
=== modified file 'debian/changelog'
--- debian/changelog 2011-03-03 20:01:52 +0000
+++ debian/changelog 2011-04-19 14:06:14 +0000
@@ -1,3 +1,4 @@
1<<<<<<< TREE
1tcl8.5 (8.5.9-2) unstable; urgency=low2tcl8.5 (8.5.9-2) unstable; urgency=low
23
3 * Moved /usr/share/tcltk/tcl8.5/tclConfig.sh back to the /usr/lib/tcl8.54 * Moved /usr/share/tcltk/tcl8.5/tclConfig.sh back to the /usr/lib/tcl8.5
@@ -15,6 +16,19 @@
15 * Added ${misc:Depends} to debian/control.16 * Added ${misc:Depends} to debian/control.
1617
17 -- Sergei Golovan <sgolovan@debian.org> Fri, 05 Nov 2010 13:33:59 +030018 -- Sergei Golovan <sgolovan@debian.org> Fri, 05 Nov 2010 13:33:59 +0300
19=======
20tcl8.5 (8.5.8-2ubuntu1) natty; urgency=low
21
22 * Patch to allow cross building of unix variant
23
24 -- Peter Pearse <peter.pearse@linaro.org> Tue, 01 Feb 2011 11:05:28 +0000
25
26tcl8.5 (8.5.8-2build1) maverick; urgency=low
27
28 * Rebuild to set TCL_CC properly on i386.
29
30 -- Matthias Klose <doko@ubuntu.com> Wed, 30 Jun 2010 13:53:09 +0200
31>>>>>>> MERGE-SOURCE
1832
19tcl8.5 (8.5.8-2) unstable; urgency=low33tcl8.5 (8.5.8-2) unstable; urgency=low
2034
2135
=== added file 'debian/patches/cross.diff'
--- debian/patches/cross.diff 1970-01-01 00:00:00 +0000
+++ debian/patches/cross.diff 2011-04-19 14:06:14 +0000
@@ -0,0 +1,121 @@
1Index: tcl8.5/unix/configure
2===================================================================
3--- tcl8.5.orig/unix/configure 2011-04-19 13:50:23.000000000 +0000
4+++ tcl8.5/unix/configure 2011-04-19 13:50:23.000000000 +0000
5@@ -308,7 +308,7 @@
6 # include <unistd.h>
7 #endif"
8
9-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'
10+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'
11 ac_subst_files=''
12
13 # Initialize some variables set by options.
14@@ -10021,6 +10021,25 @@
15 { (exit 1); exit 1; }; } ;;
16 esac
17
18+#--------------------------------------------------------------------
19+# When cross building one may need to build some tools as both
20+# host & build binaries so we supply both build & host compilers
21+#--------------------------------------------------------------------
22+echo "$as_me:$LINENO: setting CC_FOR_BUILD" >&5
23+echo $ECHO_N "setting CC_FOR_BUILD... $ECHO_C" >&6
24+
25+CC_FOR_BUILD=${CC}
26+if test "$cross_compiling" != no; then
27+ cc_converted=`echo ${CC} | sed 's/-/\//g'`
28+ cc_suffix=`basename $cc_converted`
29+ if test "x$build_alias" = x; then
30+ CC_FOR_BUILD=$cc_suffix
31+ else
32+ CC_FOR_BUILD=$build_alias\-$cc_suffix
33+ fi
34+fi
35+echo "$as_me:$LINENO: result: $CC_FOR_BUILD" >&5
36+echo "${CC_FOR_BUILD}" >&6
37
38 #--------------------------------------------------------------------
39 # Supply substitutes for missing POSIX library procedures, or
40@@ -19158,8 +19177,6 @@
41 DEFS=`sed -n -f confdef2opt.sed confdefs.h | tr "$ac_LF_and_DOT" ' .'`
42 rm -f confdef2opt.sed
43
44-
45-
46 CFLAGS="${CFLAGS} ${CPPFLAGS}"; CPPFLAGS=""
47
48 : ${CONFIG_STATUS=./config.status}
49@@ -19691,6 +19708,7 @@
50 s,@LIBS@,$LIBS,;t t
51 s,@MAN_FLAGS@,$MAN_FLAGS,;t t
52 s,@CC@,$CC,;t t
53+s,@CC_FOR_BUILD@,$CC_FOR_BUILD,;t t
54 s,@CFLAGS@,$CFLAGS,;t t
55 s,@LDFLAGS@,$LDFLAGS,;t t
56 s,@CPPFLAGS@,$CPPFLAGS,;t t
57Index: tcl8.5/unix/Makefile.in
58===================================================================
59--- tcl8.5.orig/unix/Makefile.in 2011-04-19 13:50:23.000000000 +0000
60+++ tcl8.5/unix/Makefile.in 2011-04-19 13:56:44.000000000 +0000
61@@ -236,8 +236,14 @@
62 TCL_BUILDTIME_LIBRARY = @TCL_SRC_DIR@/library
63
64 CC = @CC@
65+# Compiler for building build host tools used during the build:
66+CC_FOR_BUILD = @CC_FOR_BUILD@
67 #CC = purify -best-effort @CC@ -DPURIFY
68
69+ifeq ($(BUILD_HOST_PASS),1)
70+ CC = $(CC_FOR_BUILD)
71+endif
72+
73 # Flags to be passed to installManPage to control how the manpages should be
74 # installed (symlinks, compression, package name suffix).
75 MAN_FLAGS = @MAN_FLAGS@
76@@ -540,7 +546,21 @@
77 SRCS = $(GENERIC_SRCS) $(TOMMATH_SRCS) $(UNIX_SRCS) $(NOTIFY_SRCS) \
78 $(STUB_SRCS) @PLAT_SRCS@
79
80+
81+ifeq (${CC},${CC_FOR_BUILD})
82 all: binaries libraries doc
83+else
84+
85+# Add a target to build the host binaries (tclsh) used during the build
86+all: host_binaries binaries libraries doc
87+
88+host_binaries:
89+ @echo "Build the host binaries used during the build"
90+ $(MAKE) binaries BUILD_HOST_PASS=1
91+ @echo "Now clean for cross building pass"
92+ $(MAKE) clean BUILD_HOST_PASS=1
93+
94+endif
95
96 binaries: ${LIB_FILE} $(STUB_LIB_FILE) $(TCL_BUILD_EXP_FILE) tclsh
97
98@@ -572,6 +592,14 @@
99 tclsh: ${TCLSH_OBJS} ${TCL_LIB_FILE}
100 ${CC} ${CFLAGS} ${LDFLAGS} ${TCLSH_OBJS} @TCL_BUILD_LIB_SPEC@ ${LIBS} @EXTRA_TCLSH_LIBS@ \
101 ${CC_SEARCH_FLAGS} -o tclsh
102+ cp tclsh tclsh_to_install
103+ifeq ($(BUILD_HOST_PASS),)
104+ @echo "Copy back the binary from the build host pass"
105+ cp tclsh_host tclsh
106+else
107+ @echo "Preserve the host binary for use in the second pass"
108+ cp tclsh tclsh_host
109+endif
110
111 # Resetting the LIB_RUNTIME_DIR below is required so that the generated
112 # tcltest executable gets the build directory burned into its ld search path.
113@@ -740,7 +768,7 @@
114 "$(LIB_INSTALL_DIR)"/$(TCL_EXP_FILE); \
115 fi
116 @echo "Installing tclsh as $(BIN_INSTALL_DIR)/tclsh$(VERSION)"
117- @$(INSTALL_PROGRAM) tclsh "$(BIN_INSTALL_DIR)"/tclsh$(VERSION)
118+ @$(INSTALL_PROGRAM) tclsh_to_install "$(BIN_INSTALL_DIR)"/tclsh$(VERSION)
119 @echo "Installing tclConfig.sh to $(CONFIG_INSTALL_DIR)/"
120 @$(INSTALL_DATA) tclConfig.sh "$(CONFIG_INSTALL_DIR)"/tclConfig.sh
121 @if test "$(STUB_LIB_FILE)" != "" ; then \
0122
=== modified file 'debian/patches/series'
--- debian/patches/series 2010-11-05 13:33:59 +0000
+++ debian/patches/series 2011-04-19 14:06:14 +0000
@@ -6,3 +6,8 @@
6rpath.diff6rpath.diff
7non-linux.diff7non-linux.diff
8manpages.diff8manpages.diff
9<<<<<<< TREE
10=======
11mips.diff
12cross.diff
13>>>>>>> MERGE-SOURCE
914
=== modified file 'debian/rules'
--- debian/rules 2011-03-03 20:01:52 +0000
+++ debian/rules 2011-04-19 14:06:14 +0000
@@ -138,6 +138,7 @@
138 rm $$f ; \138 rm $$f ; \
139 fi ; \139 fi ; \
140 done140 done
141 find unix -name tclsh_\* -exec rm -fr {} \;
141 touch install-stamp142 touch install-stamp
142143
143# Build architecture-independent files here.144# Build architecture-independent files here.

Subscribers

People subscribed via source and target branches

to all changes: