-
Notifications
You must be signed in to change notification settings - Fork 5
/
configure.ac
107 lines (96 loc) · 2.71 KB
/
configure.ac
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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
# vim:ts=2:sw=2:et:
AC_INIT(gimli,1.1,,gimli)
AM_INIT_AUTOMAKE([foreign])
AC_PROG_CC
AM_PROG_CC_C_O
AM_PROG_AS
AC_PROG_LIBTOOL
AC_C_INLINE
AC_C_BIGENDIAN
CFLAGS=`echo $CFLAGS | sed -e 's/-O2//;'`
CFLAGS="-D_REENTRANT $CFLAGS"
if test "$GCC" == "yes" ; then
CFLAGS="$CFLAGS -Wmissing-prototypes -Wformat"
fi
MODULE_SUFFIX=".so"
SHLIB_SUFFIX=".so"
DWARF_DEBUG_FLAGS="-gdwarf-2 -g3"
AC_ARG_WITH(codesign,[
--with-codesign=certname Mac OS/X: name of a code signing certificate
to use to authorize the glider as a debugger],[
DARWIN_CODESIGN="codesign -s \"$withval\" -f --continue glider wdb"
],[
DARWIN_CODESIGN="echo"
])
DARWIN_DSYMUTIL="echo"
case $host in
*darwin*)
LDFLAGS="-lpthread"
CORONER_LDFLAGS="-framework Security -framework CoreFoundation -sectcreate __TEXT __info_plist glider.plist"
MODULE_SUFFIX=".bundle"
SHLIB_SUFFIX=".dylib"
RLDPATH="-R"
DARWIN_DSYMUTIL="dsymutil -o .libs/wedgie.dSYM .libs/wedgie ; dsymutil -o .libs/libgimli.0.dylib.dSYM .libs/libgimli.0.dylib"
;;
*linux*)
CORONER_LDFLAGS="-lthread_db -lpthread"
RLDPATH="-Wl,-rpath="
;;
*freebsd*)
CORONER_LDFLAGS="-lthread_db -lpthread"
RLDPATH="-Wl,-rpath="
;;
*solaris*)
RLDPATH="-R"
case $CC in
*gcc*)
;;
*)
DWARF_DEBUG_FLAGS="-xdebugformat=dwarf"
;;
esac
LDFLAGS="-lrt"
CORONER_LDFLAGS="-lc_db -lrtld_db"
;;
esac
AC_DEFINE_UNQUOTED([MODULE_SUFFIX], "$MODULE_SUFFIX", [platform module suffix])
CFLAGS="$CFLAGS $DWARF_DEBUG_FLAGS -DGIMLI_GLIDER_PATH=\\\"\$(bindir)/glider\\\""
LDFLAGS="$LDFLAGS $DWARF_DEBUG_FLAGS"
AC_SUBST(CORONER_LDFLAGS)
AC_SUBST(DARWIN_DSYMUTIL)
AC_SUBST(DARWIN_CODESIGN)
AC_CHECK_LIB(dl, dlopen)
AC_CHECK_LIB(m, floor)
AC_CHECK_LIB(crypt, crypt)
AC_CHECK_FUNCS(clock_gettime)
AC_CHECK_SIZEOF(void*)
AC_DEFINE(LUA_USE_POSIX, 1, [Use POSIX functions])
AC_DEFINE(LUA_USE_DLOPEN, 1, [Use dlopen for loading modules])
AC_DEFINE_UNQUOTED(LUA_ROOT, "$prefix/", [Installation prefix])
AC_DEFINE(LUA_VERMAJORMINOR, "5.1", [First two version number octets])
AC_SUBST(PACKAGE_VERMAJORMINOR, 5.1)
AC_ARG_WITH(readline,
[ --with-readline link ldb against libreadline],
[
LDFLAGS_SAVE="$LDFLAGS"
LDFLAGS="-L$withval"
AC_CHECK_LIB(readline, readline, [
AC_SUBST(RL_LDFLAGS, "-lreadline")
AC_SUBST(RL_CFLAGS, "-DLUA_USE_READLINE")
])
LDFLAGS="$LDFLAGS_SAVE"
])
AC_ARG_WITH(libedit,
[ --with-libedit link ldb against libedit],
[
LDFLAGS_SAVE="$LDFLAGS"
LDFLAGS="-L$withval"
AC_CHECK_LIB(edit, readline, [
AC_SUBST(RL_LDFLAGS, "-ledit")
AC_SUBST(RL_CFLAGS, "-DLUA_USE_READLINE")
])
LDFLAGS="$LDFLAGS_SAVE"
])
AC_CONFIG_HEADERS(gimli_config.h)
AC_CONFIG_FILES(Makefile)
AC_OUTPUT