From 6a0e08cdc2a2b4b5b13ae221376d56712a084d96 Mon Sep 17 00:00:00 2001 From: kstailey Date: Wed, 2 Apr 1997 22:55:36 +0000 Subject: [PATCH] Add "-P dir" option to prepend a dir to the include path. This is driven by g77 using install.texi which collides with gcc install.texi. This has been submitted to bug-texinfo@prep.ai.mit.edu. *** You must rebuild/reinstall makeinfo before building gcc! *** --- gnu/usr.bin/texinfo/makeinfo/makeinfo.c | 27 ++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/gnu/usr.bin/texinfo/makeinfo/makeinfo.c b/gnu/usr.bin/texinfo/makeinfo/makeinfo.c index a3bd34b3702..1331ab17822 100644 --- a/gnu/usr.bin/texinfo/makeinfo/makeinfo.c +++ b/gnu/usr.bin/texinfo/makeinfo/makeinfo.c @@ -1,5 +1,5 @@ /* Makeinfo -- convert texinfo format files into info files. - $Id: makeinfo.c,v 1.1.1.3 1996/12/15 21:39:24 downsj Exp $ + $Id: makeinfo.c,v 1.2 1997/04/02 22:55:36 kstailey Exp $ Copyright (C) 1987, 92, 93, 94, 95, 96 Free Software Foundation, Inc. @@ -833,9 +833,9 @@ main (argc, argv) while ((c = getopt_long (argc, argv, #if defined (HAVE_MACROS) - "D:E:U:I:f:o:p:e:r:s:V", + "D:E:U:I:P:f:o:p:e:r:s:V", #else - "D:U:I:f:o:p:e:r:s:V", + "D:U:I:P:f:o:p:e:r:s:V", #endif /* !HAVE_MACROS */ long_options, &ind)) != EOF) @@ -877,6 +877,27 @@ main (argc, argv) strcat (include_files_path, optarg); break; + /* Prepend User specified include dir to include path? */ + case 'P': + if (!include_files_path) { + include_files_path = strdup (optarg); + include_files_path = (char *) + xrealloc (include_files_path, + strlen (include_files_path) + 3); /* 3 for ":." & NULL */ + strcat (include_files_path, ":."); + } else { + char *tmp = strdup (include_files_path); + + include_files_path = (char *) + xrealloc (include_files_path, /* 2 for ":" & NULL */ + strlen (include_files_path) + strlen (optarg) + 2); + strcpy (include_files_path, optarg); + strcat (include_files_path, ":"); + strcat (include_files_path, tmp); + free (tmp); + } + break; + /* User specified fill_column? */ case 'f': if (sscanf (optarg, "%d", &fill_column) != 1) -- 2.20.1