Tiny web frontend for mlmmj
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

66 lines
1.7 KiB

# vim:se syn=tcl:
#
use cc cc-lib cc-shared pkg-config
set maj_ver 0
set med_ver 0
set min_ver 5
define VERSION $maj_ver.$med_ver.$min_ver
options {
pkgconfigdir:WHERE => "path to the directory where to install pc files"
with-asan => "build with libasan support"
mlmmjdir:WHERE => "path to the mlmmj directory"
}
if {[opt-str pkgconfigdir dir]} {
define pkgconfigdir $dir
} else {
if {[string match *-freebsd* [get-define host]]} {
define pkgconfigdir [get-define prefix]/libdata/pkgconfig
} else {
define pkgconfigdir [get-define prefix]/lib/pkgconfig
}
}
if {[opt-str mlmmjdir dir]} {
define MLMMJDIR $dir
} else {
define MLMMJDIR [get-define prefix]/mlmmj]
}
cc-check-tools strip
define GITHASH ""
if {[cc-check-progs git] && [file exists .git] &&
![catch {exec git rev-parse --short HEAD} gitrev] &&
![catch {exec git diff-index -m --name-only HEAD} gitdirty]} {
define GITHASH -$gitrev[expr {$gitdirty eq {} ? {} : {-dirty}}]
}
if {![pkg-config-init 0]} {
user-error "Unable to find pkg-config"
}
foreach pc { kcgi kcgi-html } {
if {[pkg-config $pc]} {
define-append CONFIG_CFLAGS [pkg-config-get $pc CFLAGS]
define-append CONFIG_LDFLAGS [pkg-config-get $pc LDFLAGS]
define-append CONFIG_LIBS [pkg-config-get $pc LIBS]
} else {
user-error "Unable to find klib via pkg-config"
}
}
if {[opt-bool with-asan]} {
define-append ASAN_CFLAGS -O0 -ggdb -fsanitize=address
define-append ASAN_LDFLAGS -fsanitize=address
if {[string match *-linux* [get-define host]]} {
# ASAN depends on libdl for dlsym when building with GCC
define-append ASAN_LDFLAGS -ldl
}
define asan 1
}
make-config-header config.h -auto { VERSION GITHASH MLMMJDIR prefix}
make-template mk/defs.mk.in
make-template Makefile.in