Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
dcc9096b
Kaydet (Commit)
dcc9096b
authored
Mar 09, 2012
tarafından
Tor Lillqvist
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Add mode lines, untabify, clean up indentation
üst
5ce2c589
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
72 additions
and
72 deletions
+72
-72
oowintool
oowintool
+72
-72
No files found.
oowintool
Dosyayı görüntüle @
dcc9096b
#!/usr/bin/perl -w
#!/usr/bin/perl -w
# -*- tab-width: 4; cperl-indent-level: 4; indent-tabs-mode: nil -*-
use
File::
Copy
;
...
...
@@ -20,7 +20,7 @@ sub reg_get_value($)
if
(
defined
$value
)
{
chomp
(
$value
);
$value
=~
s
|\
r
\
n
||
;
#
print "Value '$value' at '$key'\n";
#
print "Value '$value' at '$key'\n";
}
return
$value
;
...
...
@@ -64,20 +64,20 @@ sub cygpath($$$)
return
$path
if
(
!
defined
$path
);
# Strip trailing path separators
if
(
$input_format
eq
'u'
)
{
$path
=~
s
|/*\
s
*
$|
|
;
$path
=~
s
|/*\
s
*
$|
|
;
}
else
{
$path
=~
s
|\\*\
s
*
$|
|
;
$path
=~
s
|\\*\
s
*
$|
|
;
}
# 'Unterminated quoted string errors' from 'ash' when
# forking cygpath so - reimplement cygpath in perl [ gack ]
if
(
$format
eq
'u'
&&
$input_format
eq
'w'
)
{
$path
=~
s
|\\|/|
g
;
$path
=~
s
|
([
a
-
zA
-
Z
]):
/|/c
ygdrive
/$1/
|
g
;
$path
=~
s
|\\|/|
g
;
$path
=~
s
|
([
a
-
zA
-
Z
]):
/|/c
ygdrive
/$1/
|
g
;
}
elsif
(
$format
eq
'w'
&&
$input_format
eq
'u'
)
{
$path
=~
s
|
/cygdrive/
([
a
-
zA
-
Z
])
/|/
$1
/|
g
;
$path
=~
s
|/|\\|
g
;
$path
=~
s
|
/cygdrive/
([
a
-
zA
-
Z
])
/|/
$1
/|
g
;
$path
=~
s
|/|\\|
g
;
}
return
$path
;
...
...
@@ -88,33 +88,34 @@ sub print_path($$)
my
(
$path
,
$unix
)
=
@_
;
$path
=
cygpath
(
$path
,
$unix
,
$output_format
);
print
$path
;
}
sub
print_windows_sdk_home
()
{
my
(
$value
,
$key
);
$value
=
reg_get_value
(
'HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Microsoft SDKs/Windows/v6.1/InstallationFolder'
);
if
(
!
defined
$value
)
{
if
(
!
defined
$value
)
{
$value
=
reg_get_value
(
'HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Microsoft SDKs/Windows/v7.1/InstallationFolder'
);
}
if
(
!
defined
$value
)
{
}
if
(
!
defined
$value
)
{
$value
=
reg_get_value
(
'HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Microsoft SDKs/Windows/CurrentInstallFolder'
);
}
if
(
!
defined
$value
)
{
$value
=
reg_get_value
(
'HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/MicrosoftSDK/Directories/Install Dir'
);
}
if
(
!
defined
$value
)
{
$key
=
reg_find_key
(
'HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/MicrosoftSDK/InstalledSDKs/*/Install Dir'
);
$value
=
reg_get_value
(
$key
);
}
defined
$value
||
die
"Windows S
dk
not found"
;
}
if
(
!
defined
$value
)
{
$value
=
reg_get_value
(
'HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/MicrosoftSDK/Directories/Install Dir'
);
}
if
(
!
defined
$value
)
{
$key
=
reg_find_key
(
'HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/MicrosoftSDK/InstalledSDKs/*/Install Dir'
);
$value
=
reg_get_value
(
$key
);
}
defined
$value
||
die
"Windows S
DK
not found"
;
print
cygpath
(
$value
,
'w'
,
$output_format
);
}
...
...
@@ -160,13 +161,12 @@ sub find_msvs()
{
my
@ms_versions
=
(
\%
msvs_2008, \%msvs_express_2008, \%msvs
_2010
);
for
$ver
(
@ms_versions
)
{
my
$install
=
reg_get_value
(
"HKEY_LOCAL_MACHINE/SOFTWARE/"
.
$ver
->
{
'key'
});
if
(
defined
$install
&&
$install
ne
''
)
{
$ver
->
{
'product_dir'
}
=
$install
;
return
$ver
;
}
for
$ver
(
@ms_versions
)
{
my
$install
=
reg_get_value
(
"HKEY_LOCAL_MACHINE/SOFTWARE/"
.
$ver
->
{
'key'
});
if
(
defined
$install
&&
$install
ne
''
)
{
$ver
->
{
'product_dir'
}
=
$install
;
return
$ver
;
}
}
die
"Can't find MS Visual Studio / VC++"
;
}
...
...
@@ -175,13 +175,12 @@ sub find_msvc()
{
my
@ms_versions
=
(
\%
msvc_2008, \%msvc_express_2008, \%ms
vc_2010
);
for
$ver
(
@ms_versions
)
{
my
$install
=
reg_get_value
(
"HKEY_LOCAL_MACHINE/SOFTWARE/"
.
$ver
->
{
'key'
});
if
(
defined
$install
&&
$install
ne
''
)
{
$ver
->
{
'product_dir'
}
=
$install
;
return
$ver
;
}
for
$ver
(
@ms_versions
)
{
my
$install
=
reg_get_value
(
"HKEY_LOCAL_MACHINE/SOFTWARE/"
.
$ver
->
{
'key'
});
if
(
defined
$install
&&
$install
ne
''
)
{
$ver
->
{
'product_dir'
}
=
$install
;
return
$ver
;
}
}
die
"Can't find MS Visual Studio / VC++"
;
}
...
...
@@ -219,7 +218,7 @@ sub print_dotnetsdk_dir()
reg_get_value
(
"HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/.NETFramework/sdkInstallRootv1.1"
)
||
reg_get_value
(
"HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/.NETFramework/sdkInstallRootv2.0"
);
if
(
$dir
)
{
print
cygpath
(
$dir
,
'w'
,
$output_format
);
print
cygpath
(
$dir
,
'w'
,
$output_format
);
}
}
...
...
@@ -228,9 +227,9 @@ sub print_jdk_dir()
my
$dir
=
reg_get_value
(
"HKEY_LOCAL_MACHINE/SOFTWARE/JavaSoft/Java\ Development\ Kit/1.7/JavaHome"
)
||
reg_get_value
(
"HKEY_LOCAL_MACHINE/SOFTWARE/JavaSoft/Java\ Development\ Kit/1.6/JavaHome"
)
||
reg_get_value
(
"HKEY_LOCAL_MACHINE/SOFTWARE/JavaSoft/Java\ Development\ Kit/1.5/JavaHome"
)
||
reg_get_value
(
"HKEY_LOCAL_MACHINE/SOFTWARE/JavaSoft/Java\ Development\ Kit/1.4/JavaHome"
)
||
reg_get_value
(
"HKEY_LOCAL_MACHINE/SOFTWARE/JavaSoft/Java\ Development\ Kit/1.3/JavaHome"
);
reg_get_value
(
"HKEY_LOCAL_MACHINE/SOFTWARE/JavaSoft/Java\ Development\ Kit/1.5/JavaHome"
)
||
reg_get_value
(
"HKEY_LOCAL_MACHINE/SOFTWARE/JavaSoft/Java\ Development\ Kit/1.4/JavaHome"
)
||
reg_get_value
(
"HKEY_LOCAL_MACHINE/SOFTWARE/JavaSoft/Java\ Development\ Kit/1.3/JavaHome"
);
print
cygpath
(
$dir
,
'w'
,
$output_format
);
}
...
...
@@ -251,11 +250,11 @@ sub msvc_find_version($)
my
$checkpath
=
shift
;
my
$ver
=
find_msvc
();
my
$srcdir
=
(
cygpath
(
$ver
->
{
'product_dir'
},
'w'
,
'u'
)
.
'/'
.
$ver
->
{
$checkpath
});
$ver
->
{
$checkpath
});
-
d
$srcdir
&&
return
$ver
;
$ver
=
find_msvs
();
$srcdir
=
(
cygpath
(
$ver
->
{
'product_dir'
},
'w'
,
'u'
)
.
'/'
.
$ver
->
{
$checkpath
});
$ver
->
{
$checkpath
});
-
d
$srcdir
&&
return
$ver
;
return
undef
;
}
...
...
@@ -266,12 +265,12 @@ sub msvc_copy_dlls($)
my
$ver
=
msvc_find_version
(
'dll_path'
);
defined
$ver
||
return
;
my
$srcdir
=
(
cygpath
(
$ver
->
{
'product_dir'
},
'w'
,
'u'
)
.
'/'
.
$ver
->
{
'dll_path'
});
$ver
->
{
'dll_path'
});
copy_dll
(
$srcdir
,
"msvcp"
.
$ver
->
{
'dll_suffix'
}
.
".dll"
,
$dest
.
$ver
->
{
'dll_suffix'
});
$dest
.
$ver
->
{
'dll_suffix'
});
copy_dll
(
$srcdir
,
"msvcr"
.
$ver
->
{
'dll_suffix'
}
.
".dll"
,
$dest
.
$ver
->
{
'dll_suffix'
});
$dest
.
$ver
->
{
'dll_suffix'
});
if
(
$ver
->
{
'dll_suffix'
}
==
90
)
{
copy_dll
(
$srcdir
,
"msvcm"
.
$ver
->
{
'dll_suffix'
}
.
".dll"
,
$dest
.
$ver
->
{
'dll_suffix'
});
...
...
@@ -309,11 +308,11 @@ my @commands = ();
my
$opt
;
while
(
@ARGV
)
{
$opt
=
shift
@ARGV
;
if
(
$opt
eq
'-w'
||
$opt
eq
'-u'
)
{
$output_format
=
substr
(
$opt
,
1
,
1
);
$output_format
=
substr
(
$opt
,
1
,
1
);
}
else
{
push
@commands
,
$opt
;
push
@commands
,
$opt
;
}
}
...
...
@@ -322,37 +321,38 @@ while (@commands) {
if
(
0
)
{
}
elsif
(
$opt
eq
'--msvc-ver'
)
{
print_msvc_ver
();
print_msvc_ver
();
}
elsif
(
$opt
eq
'--msvc-copy-dlls'
)
{
my
$dest
=
shift
@commands
;
defined
$dest
||
die
"copy-dlls requires a destination directory"
;
msvc_copy_dlls( $des
t
);
my
$dest
=
shift
@commands
;
defined
$dest
||
die
"copy-dlls requires a destination directory"
;
msvc_copy_dlls( $des
t
);
}
elsif
(
$opt
eq
'--msvc-copy-msms'
)
{
my
$dest
=
shift
@commands
;
defined
$dest
||
die
"copy-msms requires a destination directory"
;
msvc_copy_msms( $des
t
,
''
);
my
$dest
=
shift
@commands
;
defined
$dest
||
die
"copy-msms requires a destination directory"
;
msvc_copy_msms( $des
t
,
''
);
}
elsif
(
$opt
eq
'--msvc-copy-msms-64'
)
{
my
$dest
=
shift
@commands
;
defined
$dest
||
die
"copy-msms-64 requires a destination directory"
;
msvc_copy_msms( $des
t
,
'_x64'
);
my
$dest
=
shift
@commands
;
defined
$dest
||
die
"copy-msms-64 requires a destination directory"
;
msvc_copy_msms( $des
t
,
'_x64'
);
}
elsif
(
$opt
eq
'--msvs-productdir'
)
{
print_msvs_productdir
();
print_msvs_productdir
();
}
elsif
(
$opt
eq
'--msvc-productdir'
)
{
print_msvc_product_dir
();
print_msvc_product_dir
();
}
elsif
(
$opt
eq
'--dotnetsdk-dir'
)
{
print_dotnetsdk_dir
();
print_dotnetsdk_dir
();
}
elsif
(
$opt
eq
'--csc-compilerdir'
)
{
print_csc_compiler_dir
();
print_csc_compiler_dir
();
}
elsif
(
$opt
eq
'--windows-sdk-home'
)
{
print_windows_sdk_home
();
print_windows_sdk_home
();
}
elsif
(
$opt
eq
'--jdk-home'
)
{
print_jdk_dir
();
print_jdk_dir
();
}
elsif
(
$opt
eq
'--help'
||
$opt
eq
'/?'
)
{
print_syntax
();
print_syntax
();
}
else
{
print
"Unknown option '$opt'\n"
;
print_syntax
();
exit
1
;
print
"Unknown option '$opt'\n"
;
print_syntax
();
exit
1
;
}
}
# vim:set shiftwidth=4 softtabstop=4 expandtab:
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment