Ignore:
Timestamp:
Feb 28, 2009, 4:23:16 AM (10 years ago)
Author:
mcalhoun@…
Message:

ncursesw: Allow cross-compiled build to find and run a valid program tic.
Attempt to fix #18675.

File:
1 edited

Legend:

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

    r47312 r47439  
    4040if {[variant_isset universal]} {
    4141        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.
     42                global merger_dont_diff merger_destroot_env
     43
     44                # These tests must be done in pre-fetch because it is the earliest stage in which universal_archs_to_use has the correct values.
    4445                if { [llength ${universal_archs_to_use}] > 2 } {
    4546                        lappend merger_dont_diff ${prefix}/include/${name}/curses.h
     47                }
     48
     49                # The destroot phase needs to run the just built tic program.
     50                #     Setting the PATH variable allows tic to be found.
     51                #     tic links against shared libraries, which are found only after setting DYLD_LIBRARY_PATH.
     52                set need_cross  "no"
     53                set have_run    "no"
     54                if { ${os.arch}=="i386" } {
     55                        # Determine if any cross-compiling is required.
     56                        foreach arch ${universal_archs_to_use} {
     57                                if { ${arch}=="ppc64" || (${os.major} >= 10 && ${arch}=="ppc") } {
     58                                        set need_cross "yes"
     59                                }
     60                        }
     61
     62                        # Find an architecture whose binaries will run on this platform.
     63                        foreach arch ${universal_archs_to_use} {
     64                                if { ${arch}=="i386" || ${arch}=="x86_64" || (${os.major} < 10 && ${arch}=="ppc") } {
     65                                        if { ${os.major} >= 10 } {
     66                                                set merger_destroot_env(ppc)     "DYLD_LIBRARY_PATH=${workpath}/${arch}/lib PATH=${workpath}/${arch}/progs:$env(PATH)"
     67                                        }
     68                                        set merger_destroot_env(ppc64)    "DYLD_LIBRARY_PATH=${workpath}/${arch}/lib PATH=${workpath}/${arch}/progs:$env(PATH)"
     69                                        set have_run  "yes"
     70                                        break
     71                                }
     72                        }
     73                } else {
     74                        # Determine if any cross-compiling is required
     75                        foreach arch ${universal_archs_to_use} {
     76                                if { ${arch}=="i386" || ${arch}=="x86_64" } {
     77                                        set need_cross "yes"
     78                                }
     79                        }
     80
     81                        # Find an architecture whose binaries will run on this platform.
     82                        foreach arch ${universal_archs_to_use} {
     83                                if { ${arch}=="ppc" || ${arch}=="ppc64" } {
     84                                        set merger_destroot_env(i386)    "DYLD_LIBRARY_PATH=${workpath}/${arch}/lib PATH=${workpath}/${arch}/progs:$env(PATH)"
     85                                        set merger_destroot_env(x86_64)  "DYLD_LIBRARY_PATH=${workpath}/${arch}/lib PATH=${workpath}/${arch}/progs:$env(PATH)"
     86                                        set have_run  "yes"
     87                                        break
     88                                }
     89                        }
     90                }
     91
     92                if { ${need_cross}=="yes" && ${have_run}=="no" } {
     93                        return -code error "At least one of the universal_archs values must run on your host architecture."
    4694                }
    4795        }
Note: See TracChangeset for help on using the changeset viewer.