configure: include -lm and -DLUA_USE_POSIX in config.mk

This commit is contained in:
Jeremy Baxter 2024-02-18 18:14:34 +13:00
parent 331c6acbd2
commit bbd25fe4a2
2 changed files with 15 additions and 10 deletions

23
configure vendored
View file

@ -5,7 +5,10 @@
set -e
mkf=config.mk
cflags='-std=c99' # set here to apply to all subtrees
# these also apply to all libraries in external/
cflags='-std=c99'
cppflags='-DLUA_USE_POSIX'
ldflags='-lm'
# utility functions
@ -57,7 +60,7 @@ gen_CFLAGS () {
## flags used in the linking step
gen_LDFLAGS () {
if pkg-config readline; then
ldflags="$(pkg-config --libs readline)"
ldflags="$ldflags $(pkg-config --libs readline)"
fi
if present ld.lld; then
ldflags="$ldflags -fuse-ld=lld"
@ -105,11 +108,13 @@ gen_LDFLAGS
printf '# generated by configure
_CC = %s
_CFLAGS = %s
_LDFLAGS =%s
' \
"$cc" \
"$cflags" \
"$ldflags"\
_CC = %s
_CFLAGS = %s
_CPPFLAGS = %s
_LDFLAGS =%s
' \
"$cc" \
"$cflags" \
"$cppflags"\
"$ldflags" \
>"$mkf"