* [PATCH 2.6.9-rc3] Fix 'htmldocs' and friends with O=
@ 2004-10-04 23:39 Tom Rini
2004-10-05 0:28 ` Tonnerre
0 siblings, 1 reply; 4+ messages in thread
From: Tom Rini @ 2004-10-04 23:39 UTC (permalink / raw)
To: Kernel Mailing List, Sam Ravnborg
Hello. The following patch fixes up 'htmldocs' and related to work when
trees are being built with O=. I fixed it all up by passing the srctree
as an env-var to docproc (and thus what it calls) and then pull that out
when needed.
Signed-off-by: Tom Rini <trini@kernel.crashing.org>
--- linux-2.6.9-rc3.orig/Documentation/DocBook/Makefile
+++ linux-2.6.9-rc3/Documentation/DocBook/Makefile
@@ -58,14 +58,14 @@ MAKEMAN = $(PERL) $(srctree)/scripts/m
# The following rules are used to generate the .sgml documentation
# required to generate the final targets. (ps, pdf, html).
quiet_cmd_docproc = DOCPROC $@
- cmd_docproc = $(DOCPROC) doc $< >$@
+ cmd_docproc = SRCTREE=$(srctree)/ $(DOCPROC) doc $< >$@
define rule_docproc
set -e; \
$(if $($(quiet)cmd_$(1)),echo ' $($(quiet)cmd_$(1))';) \
$(cmd_$(1)); \
( \
echo 'cmd_$@ := $(cmd_$(1))'; \
- echo $@: `$(DOCPROC) depend $<`; \
+ echo $@: `SRCTREE=$(srctree) $(DOCPROC) depend $<`; \
) > $(dir $@).$(notdir $@).cmd
endef
@@ -129,6 +129,9 @@ quiet_cmd_db2html = DB2HTML $@
# Rule to generate man files - output is placed in the man subdirectory
%.9: %.sgml
+ifneq ($(KBUILD_SRC),)
+ $(Q)mkdir -p $(objtree)/Documentation/DocBook/man
+endif
$(SPLITMAN) $< $(objtree)/Documentation/DocBook/man "$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)"
$(MAKEMAN) convert $(objtree)/Documentation/DocBook/man $<
--- linux-2.6.9-rc3.orig/scripts/kernel-doc
+++ linux-2.6.9-rc3/scripts/kernel-doc
@@ -1531,7 +1531,7 @@ sub process_state3_type($$) {
}
sub process_file($) {
- my ($file) = @_;
+ my ($file) = "$ENV{'SRCTREE'}@_";
my $identifier;
my $func;
my $initial_section_counter = $section_counter;
--- linux-2.6.9-rc3.orig/scripts/basic/docproc.c
+++ linux-2.6.9-rc3/scripts/basic/docproc.c
@@ -79,6 +79,7 @@ void exec_kernel_doc(char **svec)
{
pid_t pid;
int ret;
+ char real_filename[PATH_MAX + 1];
/* Make sure output generated so far are flushed */
fflush(stdout);
switch(pid=fork()) {
@@ -86,8 +87,13 @@ void exec_kernel_doc(char **svec)
perror("fork");
exit(1);
case 0:
- execvp(KERNELDOCPATH KERNELDOC, svec);
- perror("exec " KERNELDOCPATH KERNELDOC);
+ memset(real_filename, 0, sizeof(real_filename));
+ strncat(real_filename, getenv("SRCTREE"), PATH_MAX);
+ strncat(real_filename, KERNELDOCPATH KERNELDOC,
+ PATH_MAX - strlen(real_filename));
+ execvp(real_filename, svec);
+ fprintf(stderr, "exec ");
+ perror(real_filename);
exit(1);
default:
waitpid(pid, &ret ,0);
@@ -160,12 +166,17 @@ void find_export_symbols(char * filename
struct symfile *sym;
char line[MAXLINESZ];
if (filename_exist(filename) == NULL) {
+ char real_filename[PATH_MAX + 1];
+ memset(real_filename, 0, sizeof(real_filename));
+ strncat(real_filename, getenv("SRCTREE"), PATH_MAX);
+ strncat(real_filename, filename,
+ PATH_MAX - strlen(real_filename));
sym = add_new_file(filename);
- fp = fopen(filename, "r");
+ fp = fopen(real_filename, "r");
if (fp == NULL)
{
fprintf(stderr, "docproc: ");
- perror(filename);
+ perror(real_filename);
}
while(fgets(line, MAXLINESZ, fp)) {
char *p;
--
Tom Rini
http://gate.crashing.org/~trini/
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 2.6.9-rc3] Fix 'htmldocs' and friends with O=
2004-10-04 23:39 [PATCH 2.6.9-rc3] Fix 'htmldocs' and friends with O= Tom Rini
@ 2004-10-05 0:28 ` Tonnerre
2004-10-05 2:15 ` Tom Rini
2004-10-16 20:56 ` Sam Ravnborg
0 siblings, 2 replies; 4+ messages in thread
From: Tonnerre @ 2004-10-05 0:28 UTC (permalink / raw)
To: Tom Rini; +Cc: Kernel Mailing List, Sam Ravnborg
[-- Attachment #1: Type: text/plain, Size: 547 bytes --]
Salut,
On Mon, Oct 04, 2004 at 04:39:58PM -0700, Tom Rini wrote:
> --- linux-2.6.9-rc3.orig/scripts/kernel-doc
> +++ linux-2.6.9-rc3/scripts/kernel-doc
> @@ -1531,7 +1531,7 @@ sub process_state3_type($$) {
> }
>
> sub process_file($) {
> - my ($file) = @_;
> + my ($file) = "$ENV{'SRCTREE'}@_";
> my $identifier;
> my $func;
> my $initial_section_counter = $section_counter;
From performance/memory footprint standpoint it might be better to use
the dot operator here for concatenation.
Tonnerre
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 2.6.9-rc3] Fix 'htmldocs' and friends with O=
2004-10-05 0:28 ` Tonnerre
@ 2004-10-05 2:15 ` Tom Rini
2004-10-16 20:56 ` Sam Ravnborg
1 sibling, 0 replies; 4+ messages in thread
From: Tom Rini @ 2004-10-05 2:15 UTC (permalink / raw)
To: Tonnerre; +Cc: Kernel Mailing List, Sam Ravnborg
On Tue, Oct 05, 2004 at 02:28:14AM +0200, Tonnerre wrote:
> Salut,
>
> On Mon, Oct 04, 2004 at 04:39:58PM -0700, Tom Rini wrote:
> > --- linux-2.6.9-rc3.orig/scripts/kernel-doc
> > +++ linux-2.6.9-rc3/scripts/kernel-doc
> > @@ -1531,7 +1531,7 @@ sub process_state3_type($$) {
> > }
> >
> > sub process_file($) {
> > - my ($file) = @_;
> > + my ($file) = "$ENV{'SRCTREE'}@_";
> > my $identifier;
> > my $func;
> > my $initial_section_counter = $section_counter;
>
> From performance/memory footprint standpoint it might be better to use
> the dot operator here for concatenation.
I'm not a perl person, so if this makes sense to you Sam (or Andrew, if
you've taken this...) please update. Thanks.
--
Tom Rini
http://gate.crashing.org/~trini/
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 2.6.9-rc3] Fix 'htmldocs' and friends with O=
2004-10-05 0:28 ` Tonnerre
2004-10-05 2:15 ` Tom Rini
@ 2004-10-16 20:56 ` Sam Ravnborg
1 sibling, 0 replies; 4+ messages in thread
From: Sam Ravnborg @ 2004-10-16 20:56 UTC (permalink / raw)
To: Tonnerre; +Cc: Tom Rini, Kernel Mailing List, Sam Ravnborg
On Tue, Oct 05, 2004 at 02:28:14AM +0200, Tonnerre wrote:
> Salut,
>
> On Mon, Oct 04, 2004 at 04:39:58PM -0700, Tom Rini wrote:
> > --- linux-2.6.9-rc3.orig/scripts/kernel-doc
> > +++ linux-2.6.9-rc3/scripts/kernel-doc
> > @@ -1531,7 +1531,7 @@ sub process_state3_type($$) {
> > }
> >
> > sub process_file($) {
> > - my ($file) = @_;
> > + my ($file) = "$ENV{'SRCTREE'}@_";
> > my $identifier;
> > my $func;
> > my $initial_section_counter = $section_counter;
>
> From performance/memory footprint standpoint it might be better to use
> the dot operator here for concatenation.
For this usage I prefer readability for us who are not familiar with perl.
For me a '.' is used as thousand separator and end of line. No
usage for concatenation seems intuitive.
So I let it be as-is.
Sam
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2004-10-16 18:56 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-10-04 23:39 [PATCH 2.6.9-rc3] Fix 'htmldocs' and friends with O= Tom Rini
2004-10-05 0:28 ` Tonnerre
2004-10-05 2:15 ` Tom Rini
2004-10-16 20:56 ` Sam Ravnborg
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox