M Makefile => Makefile +2 -2
@@ 58,11 58,11 @@ $(OUTDIR)/mrsh.pc:
mrsh: $(OUTDIR)/libmrsh.a $(mrsh_objects)
@printf 'CCLD\t$@\n'
- @$(CC) -o $@ $(LIBS) $(mrsh_objects) -L$(OUTDIR) -lmrsh
+ @$(CC) -o $@ $(LDFLAGS) $(LIBS) $(mrsh_objects) -L$(OUTDIR) -lmrsh
highlight: $(OUTDIR)/libmrsh.a $(highlight_objects)
@printf 'CCLD\t$@\n'
- @$(CC) -o $@ $(LIBS) $(highlight_objects) -L$(OUTDIR) -lmrsh
+ @$(CC) -o $@ $(LDFLAGS) $(LIBS) $(highlight_objects) -L$(OUTDIR) -lmrsh
check: mrsh $(tests)
@for t in $(tests); do \
M configure => configure +15 -2
@@ 10,6 10,8 @@ LIBS=
use_readline=-1
readline=readline
+static=
+
for arg
do
case "$arg" in
@@ 23,6 25,12 @@ do
use_readline=1
readline=${arg#*=}
;;
+ --static)
+ static=$arg
+ ;;
+ --dynamic)
+ static=
+ ;;
esac
done
@@ 181,6 189,11 @@ test_ldflags() {
mkdir -p "$outdir"
+if [ -n "$static" ]
+then
+ test_ldflags $static
+fi
+
for flag in \
-g -std=c99 -pedantic -Werror -Wundef -Wlogical-op \
-Wmissing-include-dirs -Wold-style-definition -Wpointer-arith -Winit-self \
@@ 259,8 272,8 @@ fi
if [ $use_readline -eq 1 ]
then
- append_cflags $($pkg_config --cflags-only-I $readline)
- append_libs $($pkg_config --libs $readline)
+ append_cflags $($pkg_config $static --cflags-only-I $readline)
+ append_libs $($pkg_config $static --libs $readline)
fi
printf "Creating %s/config.mk... " "$outdir"