Issue 51250 - psdk detection
Summary: psdk detection
Status: CLOSED FIXED
Alias: None
Product: porting
Classification: Code
Component: code (show other issues)
Version: current
Hardware: All Windows, all
: P1 (highest) Trivial (vote)
Target Milestone: OOo 2.0
Assignee: pavel
QA Contact: issues@porting
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-06-27 10:04 UTC by pavel
Modified: 2005-10-25 08:17 UTC (History)
5 users (show)

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


Attachments
Patch for configure.in (940 bytes, patch)
2005-06-27 15:40 UTC, quetschke
no flags Details | Diff
the patch I use now (2.33 KB, patch)
2005-06-28 05:43 UTC, pavel
no flags Details | Diff
Slightly different patch (1.21 KB, patch)
2005-06-28 14:25 UTC, quetschke
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this issue.
Description pavel 2005-06-27 10:04:37 UTC
Hi,

m112 doesn't build here because of:

checking which neon to use... internal
checking which myspell to use... internal
checking which altlinuxhyph to use... internal
checking which mythes to use... internal
checking for PSDK files... configure: error: Some (all?) PSDK files not found,
please check if all needed Platform SDKs
are installed or use --with-psdk-home .

It worked ok with m111.

pavel@drogo:~> cat
/proc/registry/HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/MicrosoftSDK/InstalledSDKs/*/Install\
Dir 2> /dev/null | head -n 1
C:\Program Files\Microsoft SDK\C:\Program Files\Microsoft SDK\C:\Program
Files\Microsoft SDK\C:\Program Files\Microsoft SDK\C:\Program Files\Microsoft
SDK\C:\Program Files\Microsoft SDK\pavel@drogo:~>

Can I provide more details?
Comment 1 pavel 2005-06-27 10:04:59 UTC
set target
Comment 2 quetschke 2005-06-27 15:39:46 UTC
Sorry, there are no lineendings, so the head -n1 didn't work as expected.

The following patch should fix this.
Comment 3 quetschke 2005-06-27 15:40:52 UTC
Created attachment 27516 [details]
Patch for configure.in
Comment 4 quetschke 2005-06-27 22:45:31 UTC
Hi Pavel,
just to make sure where the NULLs are can you post the output of:

pavel@drogo:~> cat
/proc/registry/HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/MicrosoftSDK/InstalledSDKs/*/Install\
Dir 2> /dev/null | head -n 1 | od -c
Comment 5 quetschke 2005-06-28 00:58:34 UTC
OK, the registry entries end with NULL, so the following should work:

PSDK_HOME=`cat /proc/registry/.../MicrosoftSDK/InstalledSDKs/*/Install\ Dir 2>
/dev/null | head -n 1 | sed 's/\x00.*$//'`

Accepting /xHH might not work with every sed, but is ok with cygwins sed.
Comment 6 pavel 2005-06-28 04:45:13 UTC
pavel@drogo:~> cat /proc/registry/HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Microsof
tSDK/InstalledSDKs/*/Install\ Dir|head -n 1|od -c
0000000   C   :   \   P   r   o   g   r   a   m       F   i   l   e   s
0000020   \   M   i   c   r   o   s   o   f   t       S   D   K   \  \0
0000040   C   :   \   P   r   o   g   r   a   m       F   i   l   e   s
0000060   \   M   i   c   r   o   s   o   f   t       S   D   K   \  \0
0000100   C   :   \   P   r   o   g   r   a   m       F   i   l   e   s
0000120   \   M   i   c   r   o   s   o   f   t       S   D   K   \  \0
0000140   C   :   \   P   r   o   g   r   a   m       F   i   l   e   s
0000160   \   M   i   c   r   o   s   o   f   t       S   D   K   \  \0
0000200   C   :   \   P   r   o   g   r   a   m       F   i   l   e   s
0000220   \   M   i   c   r   o   s   o   f   t       S   D   K   \  \0
0000240   C   :   \   P   r   o   g   r   a   m       F   i   l   e   s
0000260   \   M   i   c   r   o   s   o   f   t       S   D   K   \  \0
0000300
pavel@drogo:~> 
Comment 7 pavel 2005-06-28 05:27:27 UTC
Hmm, looks like it doesn't work with my sed:

pavel@drogo:~> cat
/proc/registry/HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/MicrosoftSDK/InstalledSDKs/*/Install\
Dir 2>/dev/null | head -n 1 | sed 's/\x00.*$//'; echo
C:\Program Files\Microsoft SDK\C:\Program Files\Microsoft SDK\C:\Program
Files\Microsoft SDK\C:\Program Files\Microsoft SDK\C:\Program Files\Microsoft
SDK\C:\Program Files\Microsoft SDK\
pavel@drogo:~> 

It only eat the final 0, not the zero's in the middle.

But this works:

pavel@drogo:~> cat /proc/registry/HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Microsof
tSDK/InstalledSDKs/*/Install\ Dir 2>/dev/null | sed 's/\x00/\x0a/g'|head -n 1
C:\Program Files\Microsoft SDK\
pavel@drogo:~> 

But there is another problem:

         # The 2005 PSDK has a trailing backslash
          PSDK_HOME=`echo $PSDK_HOME | $SED -n "s/\/$//p"`

This make PSDK_HOME empty again.
Comment 8 pavel 2005-06-28 05:41:37 UTC
I currently use the attached patch.
Comment 9 pavel 2005-06-28 05:43:18 UTC
Created attachment 27527 [details]
the patch I use now
Comment 10 quetschke 2005-06-28 14:25:13 UTC
Created attachment 27542 [details]
Slightly different patch
Comment 11 quetschke 2005-06-28 14:33:28 UTC
The previous patch uses tr instead of sed for the 00 -> \n transformation. I have
a slightly better feeling with this than using an undocumented feature in sed
(that only sometimes works ;) ).

The problem with the second sed command was somehow the quoting. Using ' instead
of " made the original version work but I also prefer the version without -n.

Oh, I just see that I kept the p in the second sed expression, it is not needed
but doesn't hurt.

Pavel: Do you have a build fix CWS at the moment? Otherwise I will create one
for this patch.
Comment 12 quetschke 2005-06-28 18:36:18 UTC
Committed to vq19.
Comment 13 quetschke 2005-06-28 18:36:41 UTC
Please verify
Comment 14 pavel 2005-06-28 22:01:14 UTC
verified.
Comment 15 Martin Hollmichel 2005-10-25 08:17:12 UTC
close issue