96 | | platform darwin 9 { |
97 | | patchfiles-append patch-glib_gutils.h.diff |
| 89 | if {[variant_isset universal]} { |
| 90 | # When cross-compiling, use --config-cache to answer questions configure can't determine without running a program. |
| 91 | # When cross-compiling, configure script does not find correct value of NM, |
| 92 | # so replicate NM value found when not cross-compiling. |
| 93 | pre-configure { |
| 94 | global merger_configure_args merger_configure_env |
| 95 | |
| 96 | if { ${os.arch}=="i386" } { |
| 97 | # Determine if any cross-compiling is required. |
| 98 | set need_cross "no" |
| 99 | foreach arch ${universal_archs_to_use} { |
| 100 | if { ${arch}=="ppc64" || (${os.major} >= 10 && ${arch}=="ppc") } { |
| 101 | set need_cross "yes" |
| 102 | } |
| 103 | } |
| 104 | |
| 105 | # Find an architecture whose binaries will run on this platform. |
| 106 | set run_arch "" |
| 107 | foreach arch ${universal_archs_to_use} { |
| 108 | if { ${arch}=="i386" || ${arch}=="x86_64" || (${os.major} < 10 && ${arch}=="ppc") } { |
| 109 | set run_arch ${arch} |
| 110 | break |
| 111 | } |
| 112 | } |
| 113 | |
| 114 | if { ${need_cross}=="yes" && ${run_arch}=="" } { |
| 115 | ui_msg "When building a universal binary of ${name}, put i386 first in universal_archs in ${prefix}/etc/macports/macports.conf" |
| 116 | return -code error "incompatible universal_archs value" |
| 117 | } |
| 118 | |
| 119 | if { ${os.major} >= 10 } { set merger_configure_args(ppc) --config-cache } |
| 120 | set merger_configure_args(ppc64) --config-cache |
| 121 | if { ${os.major} >= 10 } { |
| 122 | set merger_configure_env(ppc) "NM='/usr/bin/nm -p' GLIB_GENMARSHAL=${workpath}/${run_arch}/gobject/glib-genmarshal" |
| 123 | } else { |
| 124 | set merger_configure_env(ppc) "NM='/usr/bin/nm -p'" |
| 125 | } |
| 126 | set merger_configure_env(ppc64) "NM='/usr/bin/nm -p' GLIB_GENMARSHAL=${workpath}/${run_arch}/gobject/glib-genmarshal" |
| 127 | } else { |
| 128 | # Determine if any cross-compiling is required. |
| 129 | set need_cross "no" |
| 130 | foreach arch ${universal_archs_to_use} { |
| 131 | if { ${arch}=="i386" || ${arch}=="x86_64" } { |
| 132 | set need_cross "yes" |
| 133 | } |
| 134 | } |
| 135 | |
| 136 | # Find an architecture whose binaries will run on this platform. |
| 137 | set run_arch "" |
| 138 | foreach arch ${universal_archs_to_use} { |
| 139 | if { ${arch}=="ppc" || ${arch}=="ppc64" } { |
| 140 | set run_arch ${arch} |
| 141 | break |
| 142 | } |
| 143 | } |
| 144 | |
| 145 | if { ${need_cross}=="yes" && ${run_arch}=="" } { |
| 146 | ui_msg "When building a universal binary of ${name}, put ppc first in universal_archs in ${prefix}/etc/macports/macports.conf" |
| 147 | return -code error "incompatible universal_archs value" |
| 148 | } |
| 149 | array set merger_configure_args { |
| 150 | i386 --config-cache |
| 151 | x86_64 --config-cache |
| 152 | } |
| 153 | set merger_configure_env(i386) "NM='/usr/bin/nm -p' GLIB_GENMARSHAL=${workpath}/${run_arch}/gobject/glib-genmarshal" |
| 154 | set merger_configure_env(x86_64) "NM='/usr/bin/nm -p' GLIB_GENMARSHAL=${workpath}/${run_arch}/gobject/glib-genmarshal" |
| 155 | } |
| 156 | } |
| 157 | |
| 158 | post-extract { |
| 159 | # Answers to questions configure can't determine without running a program. |
| 160 | copy ${filespath}/config.cache ${worksrcpath} |
| 161 | } |
| 162 | |
| 163 | pre-destroot { |
| 164 | global merger_dont_diff |
| 165 | |
| 166 | # These tests must be done in pre-destroot to ensure universal_archs_to_use has the correct values. |
| 167 | if { [llength ${universal_archs_to_use}] > 2 } { |
| 168 | set merger_dont_diff ${prefix}/lib/glib-2.0/include/glibconfig.h |
| 169 | } |
| 170 | } |