Patch contains 2 changes: - enable readline on FreeBSD (upstream never accepted this PR) - use -O3 on FreeBSD --- Makefile.orig 2023-01-10 11:11:11 UTC +++ Makefile @@ -4,7 +4,8 @@ default: build/debug/mujs build/debug/mujs-pp -CFLAGS = -std=c99 -pedantic -Wall -Wextra -Wno-unused-parameter +# change to c11 on FreeBSD because FreeBSD headers induce c11 through isnan(3), etc. +CFLAGS = -std=c11 -pedantic -Wall -Wextra -Wno-unused-parameter OPTIM = -O3 @@ -79,7 +80,7 @@ build/sanitize/mujs: main.c one.c $(SRCS) $(HDRS) build/debug/libmujs.$(SO): one.c $(SRCS) $(HDRS) @mkdir -p $(@D) - $(CC) $(CFLAGS) -g -fPIC -shared -o $@ one.c -lm + $(CC) $(CFLAGS) -g -fPIC -shared $(LDFLAGS) -o $@ one.c -lm build/debug/libmujs.o: one.c $(SRCS) $(HDRS) @mkdir -p $(@D) $(CC) $(CFLAGS) -g -c -o $@ one.c @@ -92,7 +93,7 @@ build/debug/mujs-pp: pp.c build/debug/libmujs.o build/release/libmujs.$(SO): one.c $(SRCS) $(HDRS) @mkdir -p $(@D) - $(CC) $(CFLAGS) $(OPTIM) -fPIC -shared -o $@ one.c -lm + $(CC) $(CFLAGS) $(OPTIM) -fPIC -shared $(LDFLAGS) -o $@ one.c -lm build/release/libmujs.o: one.c $(SRCS) $(HDRS) @mkdir -p $(@D) $(CC) $(CFLAGS) $(OPTIM) -c -o $@ one.c