Issue 32110 - W32-4nt build broken for external projects
Summary: W32-4nt build broken for external projects
Status: CLOSED FIXED
Alias: None
Product: Build Tools
Classification: Code
Component: solenv (show other issues)
Version: OOo 1.1.2
Hardware: PC Windows 2000
: P1 (highest) Trivial (vote)
Target Milestone: OOo 1.1.3
Assignee: hjs
QA Contact: issues@tools
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-07-26 18:22 UTC by quetschke
Modified: 2006-03-14 21:03 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments
Patch for solenv/inc (1.79 KB, patch)
2004-08-02 12:36 UTC, quetschke
no flags Details | Diff
Patch for solenv/inc for 1.1.x series. (1.82 KB, patch)
2004-08-02 12:48 UTC, quetschke
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this issue.
Description quetschke 2004-07-26 18:22:15 UTC
As noone cared to file an issue, I do it.

The problem was discovered in
<http://tools.openoffice.org/servlets/ReadMsg?list=dev&msgNo=5069>
and this is my response that pinpoints the problem:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
I was just curious and played a it with my favorite toy: shells  :)

> OK, now to your problem: ;-)
>
> The problem IMHO is that in SOLARINC
>  > set SOLARINC=-I. -Id:\oo112src\solver\645\wntmsci9.pro\inc\stl
>  > -Id:\oo112src\solver\645\wntmsci9.pro\inc\external
>  > ...
> the stl dir is set as the first include, because it should superceede
> the system compiler includes in the general case.
> For most external projects this breaks and tg_ext.mk fixes this
> by deleting the stl part from the include path.

OK, that was the theory, unfortunately I found that the cygwin dll
does some "clever" substitution. Try this in a cmd.exe:

C:\>\cygwin\bin\echo.exe "1 \ 2 \\ 3 \\\ 4 \\\\ 5 \\\\\ 6 \t"
1 \ 2 \ 3 \\ 4 \\ 5 \\\ 6 \t

There seems to be a rule that each \\ is collapsed by the cygwin dll,
funnily, when you ommit the quotes there is no transformation.

Now back to the problem:
In tg_ext.mk we have:
echo $(SOLARINC) | sed 's/\\stl//g;s/[ \t]*-I/;/g'
--------------------------^^. For W32-4nt this has to be \\\, as sed
needs \\ as a representation for \.

Ause this might be also a problem for your environment.

An issue would be nice to track the problem.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Sorry, no time for a patch right now.
Comment 1 quetschke 2004-07-26 18:22:34 UTC
Target
Comment 2 quetschke 2004-07-26 18:23:09 UTC
Oh, I forgot, this has also to be fixed for 680.
Comment 3 christianjunker 2004-07-26 20:35:35 UTC
Here is the corrected/fixed line:
INCLUDE!:=$(shell $(WRAPCMD) echo $(SOLARINC) | sed 's/\\\\stl//g;s/[ \\t]*-
I/;/g' )

Hope this helps everybody, who tries to build OOo with 4NT.

Christian
Comment 4 quetschke 2004-07-28 15:35:06 UTC
A short confirmation from cygwin ml:
- - - - - - - - -
Quotes are not treated specially in cmd.  But they are used in Cygwin
to allow applications called from cmd to get values which are otherwise
difficult to transport.  The rules are fairly simple and match your
obvservations.  A backslash is always a special character.  So a real
backslash has to be written as \\, the quoting character itself as
either \' or \", whatever you used for it.  That's it, basically.  So
your example '\\\' is treated as an unfinished quote with two characters,
a backslash and a single quote.
- - - - - - - - -

IMHO the best solution is to invent yet another macro, propably unitools.mk,
.IF "$USE_SHELL"=="4nt"
# Calling a cygwin application from a non-cygwin shell requires
# that backslashes are escaped by another backslash:
# ES .. escape slash
ES=\
.ELSE
ES=
.ENDIF

And the line in tg_ext.mk then has to be:
INCLUDE!:=$(shell $(WRAPCMD) echo $(SOLARINC) | 
sed 's/$(ES)\$(ES)\stl//g;s/[ $(ES)\t]*-I/;/g' )
Comment 5 quetschke 2004-08-02 12:36:46 UTC
Created attachment 16889 [details]
Patch for solenv/inc
Comment 6 quetschke 2004-08-02 12:47:28 UTC
The patch I just attached is for cws_src680_ooo20040815. I should have
opened a new issue for the 680er series.

I'll also attach a patch for 113fix2.
Comment 7 quetschke 2004-08-02 12:48:28 UTC
Created attachment 16890 [details]
Patch for solenv/inc for 1.1.x series.
Comment 8 quetschke 2004-08-02 22:01:37 UTC
Set target.

vq->pjanik: It's untested in this form but this would be my prefered patch.
            Please have a look, and when you agree, please commit.
            Ause is on vacation and cannot double-check, but I think it
            should go in now.
            (Without it W32-4nt is broken anyway.)
Comment 9 pavel 2004-08-04 18:25:59 UTC
Fixed in cws_srx645_ooo113fix2.
Comment 10 Martin Hollmichel 2004-08-26 16:37:44 UTC
verified.
Comment 11 hjs 2004-10-05 10:52:39 UTC
.