[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#111839: [PROPOSAL]: packages should be cross buildable



Package: debian-policy
Version: 3.5.5.0
Severity: wishlist

I'd like to make Debian more friendly to porters and embedded systems.
This patch basically says that packages should support
cross-compilation.  Many packages can already be cross compiled so
this is more documenting current practice rather than anything new.

I think this is an important addition to policy because Debian has the
potential to gain a larger user-base through ports and use on embedded
systems.

(The makefile snipped would be better if it was in a footnote since it
is implementation rather than policy, but the <example> tags didn't
work within a footnote.)

Thanks,

David

Here is a possible addition to the 'Debianised source tree' section:

--- policy.sgml.orig	Sun Sep  9 23:13:31 2001
+++ policy.sgml	Sun Sep  9 23:22:32 2001
@@ -8401,6 +8401,40 @@
 	    targets depend on must also be non-interactive.
 	  </p>
 
+	  <p>
+	    The <tt>debian/rules</tt> script should support
+	    cross-compilation.  Cross-compilation is helpful when
+	    porting Debian to new architectures and facilitates use of
+	    Debian in embedded environments.  Special requirements
+	    vary, but in general when cross-compilation is detected
+	    <tt>debian/rules</tt> should not execute binaries it has
+	    just created.  The following makefile snippet is an
+	    example of how to detect when a package is being
+	    cross-compiled.
+              <example>
+ifneq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE))
+# commands and/or variables for cross build
+else
+# commands and/or variables for native build
+endif
+	      </example>
+	    In addition, <tt>debian/rules</tt> should allow for target
+	    specific configuration via environmental
+	    variables.<footnote> 
+	      <p>
+		To allow for target specific configuration a package
+		should not hard code tool names (gcc, ld, strip, etc.)
+		but should instead use variables (CC, LD, STRIP, etc.)
+		so that the proper tools can be used when cross
+		compiling.  In addition, target specific configuration
+		should be possible without access to the target
+		system. For example, a package that uses GNU autoconf,
+		can be configured by priming CONFIG_SITE with
+		pre-determined values.  
+	      </p>
+            </footnote>
+	  </p>
+
 	  <p>	    
 	    The targets which are required to be present are:	    
 	    <taglist>



Reply to: