[47312] trunk/dports/devel
mcalhoun at macports.org
mcalhoun at macports.org
Wed Feb 25 14:25:52 PST 2009
Revision: 47312
http://trac.macports.org/changeset/47312
Author: mcalhoun at macports.org
Date: 2009-02-25 14:25:51 -0800 (Wed, 25 Feb 2009)
Log Message:
-----------
ncursesw, ncurses: Allow cross-compiling. Attempts to fix issues raised in #18187.
Modified Paths:
--------------
trunk/dports/devel/ncurses/Portfile
trunk/dports/devel/ncursesw/Portfile
Modified: trunk/dports/devel/ncurses/Portfile
===================================================================
--- trunk/dports/devel/ncurses/Portfile 2009-02-25 21:55:24 UTC (rev 47311)
+++ trunk/dports/devel/ncurses/Portfile 2009-02-25 22:25:51 UTC (rev 47312)
@@ -48,7 +48,43 @@
destroot.env-append LD_LIBRARY_PATH=${prefix}/lib
}
-set merger_must_run_binaries yes
-set merger_no_3_archs yes
+if {[variant_isset universal]} {
+ pre-fetch {
+ global merger_dont_diff
+ # This test must be done in pre-fetch because it is the earliest stage in which universal_archs_to_use has the correct values.
+ if { [llength ${universal_archs_to_use}] > 2 } {
+ lappend merger_dont_diff ${prefix}/include/${name}/curses.h
+ }
+ }
+ # When cross-compiling, force configure script to assume file system is the same on build and host architectures.
+ # We can not use --enable-mixed-case=[yes,no] since HFS+ case sensitivity is not known.
+ patchfiles-append patch-configure.diff
+
+ # Build process requires compiler and pre-processor to build binaries which run on build architecture.
+ lappend cross_configure_args --with-build-cc='${configure.cc}'
+ lappend cross_configure_args --with-build-cpp='${configure.cpp}'
+
+ # Unless, _XOPEN_SOURCE_EXTENDED is defined, include/curses.h will not include some system header files,
+ # which in turn will cause problems with ncurses/curses.priv.h.
+ lappend cross_configure_args --with-build-cppflags=-D_XOPEN_SOURCE_EXTENDED
+
+ # Configure script attempts to run a test program which allocates a chunk of memory and writes to it.
+ # If cross-compiling, default does not assume the program would succeed (safest option).
+ lappend cross_configure_args --enable-big-core
+
+ # For chtype, configure script chooses between int and long for smallest data type which can hold, up to version 5.7, 31 bits.
+ # If sizeof(unsigned long)==sizeof(unsigned int), configure script chooses long.
+ # For booltype, configure script tries to find data type xxx with sizeof(bool)==sizeof(xxx).
+ if { ${os.arch}=="i386" } {
+ if { ${os.major} >= 10 } {
+ set merger_configure_args(ppc) "${cross_configure_args} --with-chtype=long --with-bool='unsigned int'"
+ }
+ set merger_configure_args(ppc64) "${cross_configure_args} --with-chtype=int --with-bool='unsigned char'"
+ } else {
+ set merger_configure_args(i386) "${cross_configure_args} --with-chtype=long --with-bool='unsigned char'"
+ set merger_configure_args(x86_64) "${cross_configure_args} --with-chtype=int --with-bool='unsigned char'"
+ }
+}
+
use_parallel_build yes
Modified: trunk/dports/devel/ncursesw/Portfile
===================================================================
--- trunk/dports/devel/ncursesw/Portfile 2009-02-25 21:55:24 UTC (rev 47311)
+++ trunk/dports/devel/ncursesw/Portfile 2009-02-25 22:25:51 UTC (rev 47312)
@@ -37,7 +37,43 @@
--mandir=${prefix}/share/man \
--with-manpage-format=normal
-set merger_must_run_binaries yes
-set merger_no_3_archs yes
+if {[variant_isset universal]} {
+ pre-fetch {
+ global merger_dont_diff
+ # This test must be done in pre-fetch because it is the earliest stage in which universal_archs_to_use has the correct values.
+ if { [llength ${universal_archs_to_use}] > 2 } {
+ lappend merger_dont_diff ${prefix}/include/${name}/curses.h
+ }
+ }
+ # When cross-compiling, force configure script to assume file system is the same on build and host architectures.
+ # We can not use --enable-mixed-case=[yes,no] since HFS+ case sensitivity is not known.
+ patchfiles-append patch-configure.diff
+
+ # Build process requires compiler and pre-processor to build binaries which run on build architecture.
+ lappend cross_configure_args --with-build-cc='${configure.cc}'
+ lappend cross_configure_args --with-build-cpp='${configure.cpp}'
+
+ # Unless, _XOPEN_SOURCE_EXTENDED is defined, include/curses.h will not include some system header files,
+ # which in turn will cause problems with ncurses/curses.priv.h.
+ lappend cross_configure_args --with-build-cppflags=-D_XOPEN_SOURCE_EXTENDED
+
+ # Configure script attempts to run a test program which allocates a chunk of memory and writes to it.
+ # If cross-compiling, default does not assume the program would succeed (safest option).
+ lappend cross_configure_args --enable-big-core
+
+ # For chtype, configure script chooses between int and long for smallest data type which can hold, up to version 5.7, 31 bits.
+ # If sizeof(unsigned long)==sizeof(unsigned int), configure script chooses long.
+ # For booltype, configure script tries to find data type xxx with sizeof(bool)==sizeof(xxx).
+ if { ${os.arch}=="i386" } {
+ if { ${os.major} >= 10 } {
+ set merger_configure_args(ppc) "${cross_configure_args} --with-chtype=long --with-bool='unsigned int'"
+ }
+ set merger_configure_args(ppc64) "${cross_configure_args} --with-chtype=int --with-bool='unsigned char'"
+ } else {
+ set merger_configure_args(i386) "${cross_configure_args} --with-chtype=long --with-bool='unsigned char'"
+ set merger_configure_args(x86_64) "${cross_configure_args} --with-chtype=int --with-bool='unsigned char'"
+ }
+}
+
use_parallel_build yes
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20090225/5198e848/attachment.html>
More information about the macports-changes
mailing list