-#!/bin/sh -e
+#!/usr/bin/sh -e
-./configure \
- --prefix=/usr \
- ac_cv_func_malloc_0_nonnull=yes \
- ac_cv_func_realloc_0_nonnull=yes
+for i in libopenbsd libz yacc mv lex; do
+ make PREFIX=/usr -C "$i"
+done
-make
-make DESTDIR="$1" install
+cd lex
+install -Dm644 FlexLexer.h "$1/usr/include/FlexLexer.h"
+install -Dm755 lex "$1/usr/bin/flex"
+install -Dm644 flex.1 "$1/usr/share/man/man1/flex.1"
+
+ln -s /usr/bin/flex "$1/usr/bin/lex"
+ln -s /usr/bin/flex "$1/usr/bin/flex++"
+ln -s /usr/share/man/man1/flex "$1/usr/share/man/man1/lex"
-ln -s flex "$1/usr/bin/lex"