Ticket #41077: mod_jk-Portfile.diff

File mod_jk-Portfile.diff, 1.4 KB (added by girgen@…, 11 years ago)
  • Portfile

    old new  
    44
    55name                            mod_jk
    66version                         1.2.27
     7revision                        1
    78
    89categories                      www java
    910license                         Apache-2 BSD
     
    3637set apachedir       apache2
    3738
    3839# Determine a valid value for javahome
    39 if { [llength [array get env "JAVA_HOME"]] > 0 } {
     40variant jni description {Build jni_connect.so and enable jni_worker} {
     41        if { [llength [array get env "JAVA_HOME"]] > 0 } {
    4042        set javahome $env(JAVA_HOME)
    41 } else {
    42         set javahome ""
    43 }
    44 if { ![file isdirectory ${javahome}] } {
     43        } else {
     44                set javahome [exec /usr/libexec/java_home]
     45        }
     46        if { ![file isdirectory ${javahome}] } {
    4547        if { ${os.platform} == "darwin" } {
    4648                if { [file isdirectory "/System/Library/Frameworks/JavaVM.framework/Home"] } {
    4749                        set javahome "/System/Library/Frameworks/JavaVM.framework/Home"
    4850                }
    4951        }
    50 }
    51 if { ![file isdirectory ${javahome}] } {
     52        }
     53        if { ![file isdirectory ${javahome}] } {
    5254    pre-fetch {
    5355            error "This port needs a reasonable value for JAVA_HOME, but couldn't automatically determine one: please set the environment variable."
    5456    }
    55 }
     57        }
    5658
    57 variant jni description {Build jni_connect.so and enable jni_worker} {
    5859        configure.args-append --with-java-home=${javahome} --enable-jni
    5960}
    6061
     
    7273        }
    7374}
    7475
     76patchfiles-append jk_map.c.patch
    7577if {[variant_isset universal]} {
    7678    patchfiles-append   configure_universal.patch
    7779    post-configure {