diff --git a/Makefile b/Makefile index 124fe8d..c924000 100644 --- a/Makefile +++ b/Makefile @@ -7,7 +7,7 @@ LUADIR = external/lua CC = ${_CC} CFLAGS = ${_CFLAGS} -I${LUADIR} -pedantic -Wall -Wextra CPPFLAGS = -D_DEFAULT_SOURCE -LDFLAGS = -lm ${_LDFLAGS} +LDFLAGS = ${_LDFLAGS} OBJS = callisto.o lcl.o lenviron.o lextra.o lfs.o ljson.o \ lprocess.o util.o diff --git a/configure b/configure index c5b266c..be4b402 100755 --- a/configure +++ b/configure @@ -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"