mirror of
https://github.com/cathugger/mkp224o.git
synced 2025-01-10 03:27:19 -03:00
fix win side, add incomplete build script
This commit is contained in:
parent
8b2d09d1c0
commit
481a6b701f
3 changed files with 41 additions and 5 deletions
3
contrib/winbuild/.gitignore
vendored
Normal file
3
contrib/winbuild/.gitignore
vendored
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
/winepfx
|
||||||
|
/x86_64
|
||||||
|
/i686
|
33
contrib/winbuild/buildwin.sh
Executable file
33
contrib/winbuild/buildwin.sh
Executable file
|
@ -0,0 +1,33 @@
|
||||||
|
#!/bin/sh
|
||||||
|
set -e
|
||||||
|
|
||||||
|
D=$(realpath "$0")
|
||||||
|
D=$(dirname "$D")
|
||||||
|
cd "$D"
|
||||||
|
|
||||||
|
export WINEARCH=win64
|
||||||
|
export WINEPREFIX=$(realpath ./winepfx)
|
||||||
|
OPATH=$PATH
|
||||||
|
|
||||||
|
for w in x86_64 i686
|
||||||
|
do
|
||||||
|
rm -rf "$w"
|
||||||
|
mkdir "$w"
|
||||||
|
cd "$w"
|
||||||
|
p=$w-w64-mingw32
|
||||||
|
|
||||||
|
case $w in
|
||||||
|
i686)
|
||||||
|
CFLAGS="-march=i686 -mtune=generic"
|
||||||
|
;;
|
||||||
|
x86_64)
|
||||||
|
CFLAGS="-march=x86-64 -mtune=generic"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
CFLAGS="-O3 $CFLAGS -fomit-frame-pointer"
|
||||||
|
|
||||||
|
export PATH=/usr/$p/bin:$PATH
|
||||||
|
../../../configure --enable-regex --enable-donna CC="$p-gcc" CFLAGS="$CFLAGS"
|
||||||
|
make
|
||||||
|
cd ..
|
||||||
|
done
|
10
ioutil.c
10
ioutil.c
|
@ -218,9 +218,9 @@ int createdir(const char *path,int secret)
|
||||||
return CreateDirectoryA(path,0) ? 0 : -1;
|
return CreateDirectoryA(path,0) ? 0 : -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int syncwritefile(const char *filename,const char *tmpname,int secret,const char *data,size_t datalen)
|
static int syncwritefile(const char *filename,const char *tmpname,int secret,const u8 *data,size_t datalen)
|
||||||
{
|
{
|
||||||
FH f = createfile(tmpnamestr,secret)
|
FH f = createfile(tmpname,secret);
|
||||||
if (f == FH_invalid)
|
if (f == FH_invalid)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
|
@ -236,7 +236,7 @@ static int syncwritefile(const char *filename,const char *tmpname,int secret,con
|
||||||
goto failrm;
|
goto failrm;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (MoveFileA(tmpnamestr,filename) == 0) {
|
if (MoveFileA(tmpname,filename) == 0) {
|
||||||
goto failrm;
|
goto failrm;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -245,12 +245,12 @@ static int syncwritefile(const char *filename,const char *tmpname,int secret,con
|
||||||
failclose:
|
failclose:
|
||||||
(void) closefile(f);
|
(void) closefile(f);
|
||||||
failrm:
|
failrm:
|
||||||
remove(tmpnamestr);
|
remove(tmpname);
|
||||||
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int syncwrite(const char *filename,int secret,const char *data,size_t datalen)
|
int syncwrite(const char *filename,int secret,const u8 *data,size_t datalen)
|
||||||
{
|
{
|
||||||
size_t fnlen = strlen(filename);
|
size_t fnlen = strlen(filename);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue