Changeset 47312


Ignore:
Timestamp:
Feb 25, 2009, 10:25:51 PM (10 years ago)
Author:
mcalhoun@…
Message:

ncursesw, ncurses: Allow cross-compiling. Attempts to fix issues raised in #18187.
The patchfile patch-configure.diff not added until r47363.

Location:
trunk/dports/devel
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/dports/devel/ncurses/Portfile

    r46484 r47312  
    4949}
    5050
    51 set merger_must_run_binaries yes
    52 set merger_no_3_archs yes
     51if {[variant_isset universal]} {
     52    pre-fetch {
     53        global merger_dont_diff
     54        # This test must be done in pre-fetch because it is the earliest stage in which universal_archs_to_use has the correct values.
     55        if { [llength ${universal_archs_to_use}] > 2 } {
     56            lappend merger_dont_diff ${prefix}/include/${name}/curses.h
     57        }
     58    }
     59
     60    # When cross-compiling, force configure script to assume file system is the same on build and host architectures.
     61    #     We can not use --enable-mixed-case=[yes,no] since HFS+ case sensitivity is not known.
     62    patchfiles-append  patch-configure.diff
     63
     64    # Build process requires compiler and pre-processor to build binaries which run on build architecture.
     65    lappend cross_configure_args  --with-build-cc='${configure.cc}'
     66    lappend cross_configure_args  --with-build-cpp='${configure.cpp}'
     67
     68    # Unless, _XOPEN_SOURCE_EXTENDED is defined, include/curses.h will not include some system header files,
     69    #     which in turn will cause problems with ncurses/curses.priv.h.
     70    lappend cross_configure_args  --with-build-cppflags=-D_XOPEN_SOURCE_EXTENDED
     71
     72    # Configure script attempts to run a test program which allocates a chunk of memory and writes to it.
     73    #     If cross-compiling, default does not assume the program would succeed (safest option).
     74    lappend cross_configure_args  --enable-big-core
     75
     76    # For chtype, configure script chooses between int and long for smallest data type which can hold, up to version 5.7, 31 bits.
     77    #     If sizeof(unsigned long)==sizeof(unsigned int), configure script chooses long.
     78    # For booltype, configure script tries to find data type xxx with sizeof(bool)==sizeof(xxx).
     79    if { ${os.arch}=="i386" } {
     80        if { ${os.major} >= 10 } {
     81            set merger_configure_args(ppc)   "${cross_configure_args} --with-chtype=long  --with-bool='unsigned int'"
     82        }
     83        set merger_configure_args(ppc64)   "${cross_configure_args} --with-chtype=int  --with-bool='unsigned char'"
     84    } else {
     85        set merger_configure_args(i386)    "${cross_configure_args} --with-chtype=long --with-bool='unsigned char'"
     86        set merger_configure_args(x86_64)  "${cross_configure_args} --with-chtype=int  --with-bool='unsigned char'"
     87    }
     88}
    5389
    5490use_parallel_build      yes
  • trunk/dports/devel/ncursesw/Portfile

    r46484 r47312  
    3838                                --with-manpage-format=normal
    3939
    40 set merger_must_run_binaries yes
    41 set merger_no_3_archs yes
     40if {[variant_isset universal]} {
     41        pre-fetch {
     42                global merger_dont_diff
     43                # This test must be done in pre-fetch because it is the earliest stage in which universal_archs_to_use has the correct values.
     44                if { [llength ${universal_archs_to_use}] > 2 } {
     45                        lappend merger_dont_diff ${prefix}/include/${name}/curses.h
     46                }
     47        }
     48
     49        # When cross-compiling, force configure script to assume file system is the same on build and host architectures.
     50        #     We can not use --enable-mixed-case=[yes,no] since HFS+ case sensitivity is not known.
     51        patchfiles-append  patch-configure.diff
     52
     53        # Build process requires compiler and pre-processor to build binaries which run on build architecture.
     54        lappend cross_configure_args  --with-build-cc='${configure.cc}'
     55        lappend cross_configure_args  --with-build-cpp='${configure.cpp}'
     56
     57        # Unless, _XOPEN_SOURCE_EXTENDED is defined, include/curses.h will not include some system header files,
     58        #     which in turn will cause problems with ncurses/curses.priv.h.
     59        lappend cross_configure_args  --with-build-cppflags=-D_XOPEN_SOURCE_EXTENDED
     60
     61        # Configure script attempts to run a test program which allocates a chunk of memory and writes to it.
     62        #     If cross-compiling, default does not assume the program would succeed (safest option).
     63        lappend cross_configure_args  --enable-big-core
     64
     65        # For chtype, configure script chooses between int and long for smallest data type which can hold, up to version 5.7, 31 bits.
     66        #     If sizeof(unsigned long)==sizeof(unsigned int), configure script chooses long.
     67        # For booltype, configure script tries to find data type xxx with sizeof(bool)==sizeof(xxx).
     68        if { ${os.arch}=="i386" } {
     69                if { ${os.major} >= 10 } {
     70                        set merger_configure_args(ppc)   "${cross_configure_args} --with-chtype=long  --with-bool='unsigned int'"
     71                }
     72                set merger_configure_args(ppc64)   "${cross_configure_args} --with-chtype=int  --with-bool='unsigned char'"
     73        } else {
     74                set merger_configure_args(i386)    "${cross_configure_args} --with-chtype=long --with-bool='unsigned char'"
     75                set merger_configure_args(x86_64)  "${cross_configure_args} --with-chtype=int  --with-bool='unsigned char'"
     76        }
     77}
    4278
    4379use_parallel_build      yes
Note: See TracChangeset for help on using the changeset viewer.