+++ /dev/null
-all:
- make -C helpers
-
-clean:
- make -C helpers clean
defconfigs="$@"
# Make sure external programs we depend on are installed
-msg="You probably did not compile it, run 'make' in the topmost aiaiai source code directory"
-program_required "remap-log" "$msg"
-program_required "aiaiai-locker" "$msg"
program_required "git" ""
program_required "make" ""
program_required "patch" ""
order to make it easier for people to start hacking Aiaiai.
* Describe how the e-mail front-end distinguish patches and collects
patch-sets.
- * Teach the scripts to compile 'remap-log' if it is not compiled,
- instead of just failing. This is probably more user-friendly.
* Describe some review policy, e.g., how many days I promise to wait
for review/reply before applying patches.
-all:
+all: remap-log aiaiai-locker
+
+remap-log:
$(CC) $(CFLAGS) -o remap-log remap-log.c
+
+aiaiai-locker:
$(CC) $(CFLAGS) -o aiaiai-locker aiaiai-locker.c
clean:
shift
done
-program_required "aiaiai-locker" \
- "You probably did not compile it, run 'make' in the topmost aiaiai source code directory"
+compile_helpers "$srcdir"
+program_required "aiaiai-locker" ""
tmpdir="$(mktemp -dt "$PROG.XXXX")"
file_to_check="$(get_file_to_check "$@")"
[ "$#" = 3 ] || die "Insufficient or too many arguments"
-program_required "remap-log" \
- "You probably did not compile it, run 'make' in the topmost aiaiai source code directory"
+
+compile_helpers "$srcdir"
+program_required "remap-log" ""
patch="$(readlink -ev -- "$1")"; shift
input_log1="$(readlink -ev -- "$1")"; shift
[ "$#" -ge 2 ] || die "Insufficient arguments"
-program_required "aiaiai-locker" \
- "You probably did not compile it, run 'make' in the topmost aiaiai source code directory"
+compile_helpers "$srcdir"
+
+program_required "aiaiai-locker" ""
program_required "${cross}gcc" ""
program_required "make" ""
fi
}
+# Some tools in the "helpers" subdirectory have to be compiled before they can
+# be sued. When Aiaiai is used from the source tree (as opposed to being
+# installed from an RPM package), the user may froget to compile the tools.
+# This function tries to compile them.
+#
+# Usage: compile_helpers <srcdir>
+#
+# where <srcdir> is the directory where the helper tools are supposed to live.
+compile_helpers()
+{
+ local srcdir="$1"
+ local tools="remap-log aiaiai-locker"
+
+ for tool in $tools; do
+ if command -v "$tool" >/dev/null 2>&1; then
+ continue
+ fi
+
+ if [ -f "$srcdir/${tool}.c" ]; then
+ make -C "$srcdir" "$tool" >/dev/null 2>&1 ||:
+ fi
+ done
+}
+
# Fetch the first occurrence of an mbox header from a file
# Usage: fetch_header <header_name> < <mbox_file>
fetch_header()