From ab7eb292307152e706948a7b19164ff5e6d593d4 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Mon, 3 May 1999 21:59:35 +0000 Subject: Update. * elf/Makefile (trusted-dirs.st): Use gen-trusted-dirs.awk. * elf/gen-trusted-dirs.awk: New file. * elf/dl-load.c (systems_dirs): Moved into file scope. Initialize from SYSTEM_DIRS macro. (system_dirs_len): New variable. Contains lengths of system_dirs strings. (fillin_rpath): Rewrite for systems_dirs being a simple string. Improve string comparisons. Change parameter trusted to be a flag. Change all callers. (_dt_init_paths): Improve using new format for system_dirs. --- elf/gen-trusted-dirs.awk | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 elf/gen-trusted-dirs.awk (limited to 'elf/gen-trusted-dirs.awk') diff --git a/elf/gen-trusted-dirs.awk b/elf/gen-trusted-dirs.awk new file mode 100644 index 0000000000..59f10a4856 --- /dev/null +++ b/elf/gen-trusted-dirs.awk @@ -0,0 +1,37 @@ +BEGIN { + FS = " "; +} + +{ + for (i = 1; i <= NF; ++i) { + s[cnt++] = $i"/"; + } +} + +END { + printf ("#define SYSTEM_DIRS \\\n"); + + printf (" \"%s\"", s[0]); + + for (i = 1; i < cnt; ++i) { + printf (" \"\\0\" \"%s\"", s[i]); + } + + printf ("\n\n"); + + printf ("#define SYSTEM_DIRS_LEN \\\n"); + + printf (" %d", length (s[0])); + m = length (s[0]); + + for (i = 1; i < cnt; ++i) { + printf (", %d", length(s[i])); + if (length(s[i]) > m) { + m = length(s[i]); + } + } + + printf ("\n\n"); + + printf ("#define SYSTEM_DIRS_MAX_LEN\t%d\n", m); +} -- cgit v1.2.3-65-gdbad