| | 124 | if {[variant_isset no_x11]} { |
| | 125 | default_variants +quartz |
| | 126 | } |
| | 127 | |
| | 128 | if {![variant_isset quartz]} { |
| | 129 | default_variants +x11 |
| | 130 | } |
| | 131 | |
| | 132 | pre-fetch { |
| | 133 | if {![variant_isset quartz] && ![variant_isset x11]} { |
| | 134 | error "Either +x11 or +quartz is required" |
| | 135 | } |
| | 136 | } |
| | 137 | |
| | 138 | pre-configure { |
| | 139 | if {[file exists ${prefix}/lib/gtk-2.0/include/gdkconfig.h]} { |
| | 140 | set gtk_not_quartz [catch {exec grep -q GDK_WINDOWING_QUARTZ ${prefix}/lib/gtk-2.0/include/gdkconfig.h}] |
| | 141 | set gtk_not_x11 [catch {exec grep -q GDK_WINDOWING_X11 ${prefix}/lib/gtk-2.0/include/gdkconfig.h}] |
| | 142 | if {[variant_isset quartz] && ${gtk_not_quartz}} { |
| | 143 | error "+quartz variant selected, but gtk2+x11 is installed" |
| | 144 | } elseif {[variant_isset x11] && ${gtk_not_x11}} { |
| | 145 | error "+x11 variant selected, but gtk2+quartz is installed" |
| | 146 | } |
| | 147 | } else { |
| | 148 | error "Cannot find gdkconfig.h" |
| | 149 | } |
| | 150 | } |
| | 151 | |
| | 152 | variant quartz requires no_x11 conflicts x11 description {Enable Quartz rendering} { |
| | 153 | configure.env-append LDFLAGS="-framework Carbon" |
| | 154 | } |
| | 155 | |
| | 156 | variant x11 conflicts quartz description {Enable rendering in X11 (default)} { |
| | 157 | } |
| | 158 | |
| | 159 | variant no_x11 description {Build without X Windows support} { |
| | 160 | configure.args-delete --with-x |
| | 161 | configure.args-append --without-x |
| | 162 | } |
| | 163 | |