[BACK]Return to makeconf.awk CVS log [TXT][DIR] Up to [local] / src / distrib / miniroot

File: [local] / src / distrib / miniroot / makeconf.awk (download)

Revision 1.28, Fri Jun 7 14:38:42 2019 UTC (4 years, 11 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_7_5_BASE, OPENBSD_7_5, OPENBSD_7_4_BASE, OPENBSD_7_4, OPENBSD_7_3_BASE, OPENBSD_7_3, OPENBSD_7_2_BASE, OPENBSD_7_2, OPENBSD_7_1_BASE, OPENBSD_7_1, OPENBSD_7_0_BASE, OPENBSD_7_0, OPENBSD_6_9_BASE, OPENBSD_6_9, OPENBSD_6_8_BASE, OPENBSD_6_8, OPENBSD_6_7_BASE, OPENBSD_6_7, OPENBSD_6_6_BASE, OPENBSD_6_6, HEAD
Changes since 1.27: +2 -2 lines

Add -lz to the library list, since one architecture (armv7) needs it and
there is no downside for others.

#	$OpenBSD: makeconf.awk,v 1.28 2019/06/07 14:38:42 deraadt Exp $

#
# generate crunchgen(1) configuration file from `list' spec.
#

BEGIN {
	printf("#\n# This file is automatically generated by `makeconf'\n#\n\n");
	libs = "libs -lstubs -lutil -lm -ltls -lssl -lcrypto -levent -lc -lz";
}

$1 == "LIBS" {
	$1 = tolower($1);
	libs = $0;
}

$1 == "SRCDIRS" {
	$1 = tolower($1);
	print;
}

($1 == "LINK" || $1 == "SYMLINK") && $2 == "instbin" {
	# find basenames for inclusion in crunchgen's `prog' and `ln' directives
	n = split($3, x, "/");
	p = x[n];
	progs[p] = NF - 3;
	for (i = 4; i <= NF; i++) {
		n = split($i, x, "/");
		l = x[n];
		links[i - 3, p] = l;
	}
}

$1 == "ARGVLINK" {
	# add extra `ln' entries (these don't appear in the filesystem)
	n = progs[$2];
	progs[$2] = ++n;
	links[n, $2] = $3;
}

$1 == "CRUNCHSPECIAL" {
	# collect crunchgen `special' directives
	$1 = "";
	specials[$0] = 1;
}

END {
	# write crunchgen configuration

	# `prog' directives; print 8 to a line
	column = 0;
	for (p in progs) {
		if ((column++ % 8) == 0)
			printf("\nprogs");
		printf(" %s", p);
	}
	printf("\n\n");

	# `ln' directives
	for (p in progs) {
		n = progs[p];
		for (i = 1; i <= n; i++)
			printf("ln %s %s\n", p, links[i,p]);
	}
	printf("\n%s\n\n", libs);
	printf("libdirs distrib/special/libstubs\n");

	# `special' directives
	for (s in specials) {
		printf("special %s\n", s);
	}
}