-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfigure.ac
More file actions
87 lines (70 loc) · 2.19 KB
/
Copy pathconfigure.ac
File metadata and controls
87 lines (70 loc) · 2.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
AC_PREREQ([2.69])
AC_INIT([vmod-wasm], [4.3.5], [https://github.com/RamazanKara/vmod-wasm/issues])
AC_CONFIG_SRCDIR([src/vmod_wasm.vcc])
AC_CONFIG_MACRO_DIRS([m4])
AC_CONFIG_HEADERS([config.h])
AM_INIT_AUTOMAKE([1.16 foreign subdir-objects -Wall -Werror])
AM_SILENT_RULES([yes])
AM_PROG_AR
LT_PREREQ([2.4])
LT_INIT([dlopen disable-static])
AC_PROG_CC
AC_PROG_INSTALL
# Check for pkg-config
PKG_PROG_PKG_CONFIG
# Find Varnish
PKG_CHECK_MODULES([VARNISHAPI], [varnishapi >= 9.0])
# Find vmodtool.py
AC_ARG_VAR([VMODTOOL], [path to vmodtool.py])
if test -z "$VMODTOOL"; then
VMODTOOL="$($PKG_CONFIG --variable=vmodtool varnishapi)"
fi
if test -z "$VMODTOOL" || ! test -f "$VMODTOOL"; then
AC_MSG_ERROR([cannot find vmodtool.py — install varnish-dev])
fi
# Varnish directories
VMOD_DIR="$($PKG_CONFIG --variable=vmoddir varnishapi)"
AC_SUBST([VMOD_DIR])
VARNISH_VMOD_INCLUDE="$($PKG_CONFIG --variable=pkgincludedir varnishapi)"
AC_SUBST([VARNISH_VMOD_INCLUDE])
# Find varnishtest
AC_ARG_VAR([VARNISHTEST], [path to varnishtest])
if test -z "$VARNISHTEST"; then
AC_PATH_PROG([VARNISHTEST], [varnishtest])
fi
# Find Wasmtime C API
AC_ARG_WITH([wasmtime],
[AS_HELP_STRING([--with-wasmtime=DIR], [path to Wasmtime C API installation])],
[WASMTIME_DIR="$withval"],
[WASMTIME_DIR=""])
if test -n "$WASMTIME_DIR"; then
WASMTIME_CFLAGS="-I${WASMTIME_DIR}/include"
WASMTIME_LIBS="-L${WASMTIME_DIR}/lib -lwasmtime"
else
# Try pkg-config first, then default paths
PKG_CHECK_MODULES([WASMTIME], [wasmtime], [], [
# Fall back to checking standard paths
AC_CHECK_HEADER([wasmtime.h], [],
[AC_MSG_ERROR([cannot find wasmtime.h — install Wasmtime C API or use --with-wasmtime=DIR])])
WASMTIME_LIBS="-lwasmtime"
])
fi
AC_SUBST([WASMTIME_CFLAGS])
AC_SUBST([WASMTIME_LIBS])
# Platform-specific linker flags for Wasmtime (Rust static lib)
case "$host_os" in
linux*)
WASMTIME_LIBS="$WASMTIME_LIBS -lpthread -ldl -lm"
;;
darwin*)
WASMTIME_LIBS="$WASMTIME_LIBS -lpthread"
;;
esac
# Portability checks
AC_CHECK_FUNCS([strlcpy])
AC_CHECK_LIB([rt], [clock_gettime])
AC_CONFIG_FILES([
Makefile
src/Makefile
])
AC_OUTPUT