Install.sh: Add exetype.pl, hide gconfd-2.exe window.

exetype.pl is a perl script that sets the subsystem type of executables
to CONSOLE or WINDOWS (GUI). Apply that to gconfd-2.exe to hide the
console. Editbin.exe could do the same.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@15528 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Andreas Köhler 2007-02-08 21:16:30 +00:00
parent 8118a69b44
commit 648547fd9f
3 changed files with 51 additions and 0 deletions

View File

@ -93,6 +93,9 @@ OPENSSL_DIR=$GLOBAL_DIR\\openssl
PEXPORTS_URL="http://www.emmestech.com/software/cygwin/pexports-0.43/pexports-0.43.zip"
PEXPORTS_DIR=$GLOBAL_DIR\\tools
EXETYPE_SCRIPT=`pwd`/exetype.pl
EXETYPE_DIR=$GLOBAL_DIR\\tools
LIBXML2_URL="http://www.zlatkovic.com/pub/libxml/libxml2-2.6.27.win32.zip"
LIBXML2_DIR=$GLOBAL_DIR\\gnome #avoid XML_FLAGS
@ -208,6 +211,7 @@ if test x$cross_compile != xyes ; then
add_step inst_openssl
fi
add_step inst_pexports
add_step inst_exetype
add_step inst_libxml2
add_step inst_gnome
add_step inst_swig

View File

@ -0,0 +1,28 @@
#!/usr/bin/env perl
# URL: http://jenda.krynicky.cz/perl/GUIscripts.html
# code by: Jan Dubois <jand@ActiveState.com>
use strict;
unless (@ARGV == 2) {
print "Usage: $0 exefile [CONSOLE|WINDOWS]\n";
exit;
}
unless ($ARGV[1] =~ /^(console|windows)$/i) {
print "Invalid subsystem $ARGV[1], please use CONSOLE or WINDOWS\n";
exit;
}
my ($record,$magic,$offset,$size);
open EXE, "+< $ARGV[0]" or die "Cannot open $ARGV[0]: $!";
binmode EXE;
read EXE, $record, 32*4;
($magic,$offset) = unpack "Sx58L", $record;
die "Not an MSDOS executable file" unless $magic == 0x5a4d;
seek EXE, $offset, 0;
read EXE, $record, 24;
($magic,$size) = unpack "Lx16S", $record;
die "PE header not found" unless $magic == 0x4550;
die "Optional header not in NT32 format" unless $size == 224;
seek EXE, $offset+24+68, 0;
print EXE pack "S", uc($ARGV[1]) eq 'CONSOLE' ? 3 : 2;
close EXE;

View File

@ -370,6 +370,21 @@ function inst_pexports() {
quiet which pexports || die "pexports unavailable"
}
function inst_exetype() {
setup exetype
_EXETYPE_UDIR=`unix_path $EXETYPE_DIR`
add_to_env $_EXETYPE_UDIR/bin PATH
if quiet which exetype
then
echo "exetype already installed. skipping."
else
mkdir -p $_EXETYPE_UDIR/bin
cp $EXETYPE_SCRIPT $_EXETYPE_UDIR/bin/exetype
fi
quiet which exetype || die "exetype unavailable"
}
function inst_libxml2() {
setup LibXML2
_LIBXML2_UDIR=`unix_path $LIBXML2_DIR`
@ -482,6 +497,10 @@ function inst_gnome() {
mv libz.dll.a ../lib
qpopd
fi
if [ ! -f libexec/gconfd-2.console.exe ]; then
cp libexec/gconfd-2.exe libexec/gconfd-2.console.exe
exetype libexec/gconfd-2.exe windows
fi
# work around a bug in msys bash, adding 0x01 smilies
cat > bin/pkg-config-msys.sh <<EOF
#!/bin/sh