mirror of
https://github.com/wine-mirror/wine
synced 2024-07-08 20:06:18 +00:00
Created a separate static portability library and moved some of the
libwine routines in there.
This commit is contained in:
parent
ea8d2e2141
commit
6a9fe36de2
|
@ -70,6 +70,7 @@ WIDL = $(TOOLSDIR)/tools/widl/widl
|
||||||
WRCFLAGS = -J -m $(EXTRAWRCFLAGS)
|
WRCFLAGS = -J -m $(EXTRAWRCFLAGS)
|
||||||
LDPATH = @LDPATH@
|
LDPATH = @LDPATH@
|
||||||
DLLDIR = $(TOPOBJDIR)/dlls
|
DLLDIR = $(TOPOBJDIR)/dlls
|
||||||
|
LIBPORT = -L$(TOPOBJDIR)/libs/port -lwine_port
|
||||||
LIBWINE = -L$(TOPOBJDIR)/library -lwine
|
LIBWINE = -L$(TOPOBJDIR)/library -lwine
|
||||||
LIBUNICODE = -L$(TOPOBJDIR)/unicode -lwine_unicode
|
LIBUNICODE = -L$(TOPOBJDIR)/unicode -lwine_unicode
|
||||||
LIBUUID = -L$(TOPOBJDIR)/ole -lwine_uuid
|
LIBUUID = -L$(TOPOBJDIR)/ole -lwine_uuid
|
||||||
|
|
18
Makefile.in
18
Makefile.in
|
@ -32,6 +32,7 @@ SUBDIRS = \
|
||||||
documentation \
|
documentation \
|
||||||
include \
|
include \
|
||||||
library \
|
library \
|
||||||
|
libs \
|
||||||
miscemu \
|
miscemu \
|
||||||
ole \
|
ole \
|
||||||
programs \
|
programs \
|
||||||
|
@ -55,7 +56,7 @@ INSTALLDEVSUBDIRS = \
|
||||||
tools
|
tools
|
||||||
|
|
||||||
# Sub-directories to install for both install-lib and install-dev
|
# Sub-directories to install for both install-lib and install-dev
|
||||||
INSTALLBOTHSUBDIRS = dlls
|
INSTALLBOTHSUBDIRS = dlls libs
|
||||||
|
|
||||||
INSTALLSUBDIRS = $(INSTALLDEVSUBDIRS) $(INSTALLLIBSUBDIRS)
|
INSTALLSUBDIRS = $(INSTALLDEVSUBDIRS) $(INSTALLLIBSUBDIRS)
|
||||||
|
|
||||||
|
@ -120,15 +121,16 @@ $(INSTALLBOTHSUBDIRS:%=%/__uninstall__): dummy
|
||||||
# Dependencies between directories
|
# Dependencies between directories
|
||||||
|
|
||||||
all: $(SUBDIRS)
|
all: $(SUBDIRS)
|
||||||
dlls: library ole tools unicode
|
dlls: library libs ole tools unicode
|
||||||
server: library tools unicode
|
server: library libs tools unicode
|
||||||
miscemu programs: dlls library ole tools unicode
|
miscemu programs: dlls library libs ole tools unicode
|
||||||
tools: library unicode
|
tools: library libs unicode
|
||||||
|
|
||||||
dlls/__install-lib__ dlls/__install-dev__: library ole tools unicode
|
dlls/__install-lib__ dlls/__install-dev__: library libs ole tools unicode
|
||||||
server/__install__: library tools unicode
|
server/__install__: library libs tools unicode
|
||||||
miscemu/__install__ programs/__install__: library ole tools unicode dlls/__install-lib__
|
miscemu/__install__ programs/__install__: library libs ole tools unicode dlls/__install-lib__
|
||||||
library/__install__: library
|
library/__install__: library
|
||||||
|
libs/__install__: libs
|
||||||
ole/__install__: ole
|
ole/__install__: ole
|
||||||
tools/__install__: tools
|
tools/__install__: tools
|
||||||
unicode/__install__: unicode
|
unicode/__install__: unicode
|
||||||
|
|
|
@ -1517,6 +1517,8 @@ dlls/x11drv/Makefile
|
||||||
documentation/Makefile
|
documentation/Makefile
|
||||||
include/Makefile
|
include/Makefile
|
||||||
library/Makefile
|
library/Makefile
|
||||||
|
libs/Makefile
|
||||||
|
libs/port/Makefile
|
||||||
miscemu/Makefile
|
miscemu/Makefile
|
||||||
ole/Makefile
|
ole/Makefile
|
||||||
programs/Makefile
|
programs/Makefile
|
||||||
|
|
|
@ -16,7 +16,7 @@ MAINSPEC = $(MODULE:%.dll=%).spec
|
||||||
SPEC_DEF = $(MAINSPEC).def
|
SPEC_DEF = $(MAINSPEC).def
|
||||||
WIN16_FILES = $(SPEC_SRCS:.spec=.spec.o) $(C_SRCS16:.c=.o) $(EXTRA_OBJS16)
|
WIN16_FILES = $(SPEC_SRCS:.spec=.spec.o) $(C_SRCS16:.c=.o) $(EXTRA_OBJS16)
|
||||||
ALL_OBJS = @WIN16_FILES@ $(OBJS) $(MODULE).dbg.o
|
ALL_OBJS = @WIN16_FILES@ $(OBJS) $(MODULE).dbg.o
|
||||||
ALL_LIBS = $(LIBWINE) $(EXTRALIBS) $(LIBS)
|
ALL_LIBS = $(LIBWINE) $(EXTRALIBS) $(LIBPORT) $(LIBS)
|
||||||
IMPORTLIBS = $(DELAYIMPORTS:%=$(DLLDIR)/lib%.$(IMPLIBEXT)) $(IMPORTS:%=$(DLLDIR)/lib%.$(IMPLIBEXT))
|
IMPORTLIBS = $(DELAYIMPORTS:%=$(DLLDIR)/lib%.$(IMPLIBEXT)) $(IMPORTS:%=$(DLLDIR)/lib%.$(IMPLIBEXT))
|
||||||
|
|
||||||
all: $(MODULE)$(DLLEXT) $(SUBDIRS)
|
all: $(MODULE)$(DLLEXT) $(SUBDIRS)
|
||||||
|
|
|
@ -21,7 +21,7 @@ RUNTESTFLAGS = -q -P wine -M $(TESTDLL) -T $(TOPOBJDIR) -p $(TESTPROGRAM)
|
||||||
C_SRCS = $(CTESTS)
|
C_SRCS = $(CTESTS)
|
||||||
EXTRA_SRCS = $(TESTLIST)
|
EXTRA_SRCS = $(TESTLIST)
|
||||||
EXTRA_OBJS = $(TESTLIST:.c=.o)
|
EXTRA_OBJS = $(TESTLIST:.c=.o)
|
||||||
ALL_LIBS = $(LIBWINE) $(EXTRALIBS) $(LIBS)
|
ALL_LIBS = $(LIBWINE) $(EXTRALIBS) $(LIBPORT) $(LIBS)
|
||||||
IMPORTLIBS = $(DELAYIMPORTS:%=$(DLLDIR)/lib%.$(IMPLIBEXT)) $(IMPORTS:%=$(DLLDIR)/lib%.$(IMPLIBEXT))
|
IMPORTLIBS = $(DELAYIMPORTS:%=$(DLLDIR)/lib%.$(IMPLIBEXT)) $(IMPORTS:%=$(DLLDIR)/lib%.$(IMPLIBEXT))
|
||||||
|
|
||||||
CROSSTEST = $(TESTDLL:%.dll=%)_crosstest.exe
|
CROSSTEST = $(TESTDLL:%.dll=%)_crosstest.exe
|
||||||
|
|
246
library/port.c
246
library/port.c
|
@ -64,88 +64,6 @@
|
||||||
# include <stdint.h>
|
# include <stdint.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/***********************************************************************
|
|
||||||
* usleep
|
|
||||||
*/
|
|
||||||
#ifndef HAVE_USLEEP
|
|
||||||
int usleep (unsigned int useconds)
|
|
||||||
{
|
|
||||||
#if defined(__EMX__)
|
|
||||||
DosSleep(useconds);
|
|
||||||
return 0;
|
|
||||||
#elif defined(__BEOS__)
|
|
||||||
return snooze(useconds);
|
|
||||||
#elif defined(HAVE_SELECT)
|
|
||||||
struct timeval delay;
|
|
||||||
|
|
||||||
delay.tv_sec = useconds / 1000000;
|
|
||||||
delay.tv_usec = useconds % 1000000;
|
|
||||||
|
|
||||||
select( 0, 0, 0, 0, &delay );
|
|
||||||
return 0;
|
|
||||||
#else /* defined(__EMX__) || defined(__BEOS__) || defined(HAVE_SELECT) */
|
|
||||||
errno = ENOSYS;
|
|
||||||
return -1;
|
|
||||||
#endif /* defined(__EMX__) || defined(__BEOS__) || defined(HAVE_SELECT) */
|
|
||||||
}
|
|
||||||
#endif /* HAVE_USLEEP */
|
|
||||||
|
|
||||||
/***********************************************************************
|
|
||||||
* memmove
|
|
||||||
*/
|
|
||||||
#ifndef HAVE_MEMMOVE
|
|
||||||
void *memmove( void *dest, const void *src, size_t len )
|
|
||||||
{
|
|
||||||
register char *dst = dest;
|
|
||||||
|
|
||||||
/* Use memcpy if not overlapping */
|
|
||||||
if ((dst + len <= (char *)src) || ((char *)src + len <= dst))
|
|
||||||
{
|
|
||||||
memcpy( dst, src, len );
|
|
||||||
}
|
|
||||||
/* Otherwise do it the hard way (FIXME: could do better than this) */
|
|
||||||
else if (dst < (char *)src)
|
|
||||||
{
|
|
||||||
while (len--) *dst++ = *((char *)src)++;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
dst += len - 1;
|
|
||||||
src = (char *)src + len - 1;
|
|
||||||
while (len--) *dst-- = *((char *)src)--;
|
|
||||||
}
|
|
||||||
return dest;
|
|
||||||
}
|
|
||||||
#endif /* HAVE_MEMMOVE */
|
|
||||||
|
|
||||||
/***********************************************************************
|
|
||||||
* strerror
|
|
||||||
*/
|
|
||||||
#ifndef HAVE_STRERROR
|
|
||||||
const char *strerror( int err )
|
|
||||||
{
|
|
||||||
/* Let's hope we have sys_errlist then */
|
|
||||||
return sys_errlist[err];
|
|
||||||
}
|
|
||||||
#endif /* HAVE_STRERROR */
|
|
||||||
|
|
||||||
|
|
||||||
/***********************************************************************
|
|
||||||
* getpagesize
|
|
||||||
*/
|
|
||||||
#ifndef HAVE_GETPAGESIZE
|
|
||||||
size_t getpagesize(void)
|
|
||||||
{
|
|
||||||
# ifdef __svr4__
|
|
||||||
return sysconf(_SC_PAGESIZE);
|
|
||||||
# elif defined(__i386__)
|
|
||||||
return 4096;
|
|
||||||
# else
|
|
||||||
# error Cannot get the page size on this platform
|
|
||||||
# endif
|
|
||||||
}
|
|
||||||
#endif /* HAVE_GETPAGESIZE */
|
|
||||||
|
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
* clone
|
* clone
|
||||||
|
@ -181,42 +99,6 @@ int clone( int (*fn)(void *), void *stack, int flags, void *arg )
|
||||||
}
|
}
|
||||||
#endif /* !HAVE_CLONE && __linux__ */
|
#endif /* !HAVE_CLONE && __linux__ */
|
||||||
|
|
||||||
/***********************************************************************
|
|
||||||
* strcasecmp
|
|
||||||
*/
|
|
||||||
#ifndef HAVE_STRCASECMP
|
|
||||||
int strcasecmp( const char *str1, const char *str2 )
|
|
||||||
{
|
|
||||||
const unsigned char *ustr1 = (const unsigned char *)str1;
|
|
||||||
const unsigned char *ustr2 = (const unsigned char *)str2;
|
|
||||||
|
|
||||||
while (*ustr1 && toupper(*ustr1) == toupper(*ustr2)) {
|
|
||||||
ustr1++;
|
|
||||||
ustr2++;
|
|
||||||
}
|
|
||||||
return toupper(*ustr1) - toupper(*ustr2);
|
|
||||||
}
|
|
||||||
#endif /* HAVE_STRCASECMP */
|
|
||||||
|
|
||||||
/***********************************************************************
|
|
||||||
* strncasecmp
|
|
||||||
*/
|
|
||||||
#ifndef HAVE_STRNCASECMP
|
|
||||||
int strncasecmp( const char *str1, const char *str2, size_t n )
|
|
||||||
{
|
|
||||||
const unsigned char *ustr1 = (const unsigned char *)str1;
|
|
||||||
const unsigned char *ustr2 = (const unsigned char *)str2;
|
|
||||||
int res;
|
|
||||||
|
|
||||||
if (!n) return 0;
|
|
||||||
while ((--n > 0) && *ustr1) {
|
|
||||||
if ((res = toupper(*ustr1) - toupper(*ustr2))) return res;
|
|
||||||
ustr1++;
|
|
||||||
ustr2++;
|
|
||||||
}
|
|
||||||
return toupper(*ustr1) - toupper(*ustr2);
|
|
||||||
}
|
|
||||||
#endif /* HAVE_STRNCASECMP */
|
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
* getsockopt
|
* getsockopt
|
||||||
|
@ -241,134 +123,6 @@ unsigned long inet_network(const char *cp)
|
||||||
}
|
}
|
||||||
#endif /* defined(HAVE_INET_NETWORK) */
|
#endif /* defined(HAVE_INET_NETWORK) */
|
||||||
|
|
||||||
/***********************************************************************
|
|
||||||
* statfs
|
|
||||||
*/
|
|
||||||
#ifndef HAVE_STATFS
|
|
||||||
int statfs(const char *name, struct statfs *info)
|
|
||||||
{
|
|
||||||
#ifdef __BEOS__
|
|
||||||
dev_t mydev;
|
|
||||||
fs_info fsinfo;
|
|
||||||
|
|
||||||
if(!info) {
|
|
||||||
errno = ENOSYS;
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((mydev = dev_for_path(name)) < 0) {
|
|
||||||
errno = ENOSYS;
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (fs_stat_dev(mydev,&fsinfo) < 0) {
|
|
||||||
errno = ENOSYS;
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
info->f_bsize = fsinfo.block_size;
|
|
||||||
info->f_blocks = fsinfo.total_blocks;
|
|
||||||
info->f_bfree = fsinfo.free_blocks;
|
|
||||||
return 0;
|
|
||||||
#else /* defined(__BEOS__) */
|
|
||||||
errno = ENOSYS;
|
|
||||||
return -1;
|
|
||||||
#endif /* defined(__BEOS__) */
|
|
||||||
}
|
|
||||||
#endif /* !defined(HAVE_STATFS) */
|
|
||||||
|
|
||||||
|
|
||||||
/***********************************************************************
|
|
||||||
* lstat
|
|
||||||
*/
|
|
||||||
#ifndef HAVE_LSTAT
|
|
||||||
int lstat(const char *file_name, struct stat *buf)
|
|
||||||
{
|
|
||||||
return stat( file_name, buf );
|
|
||||||
}
|
|
||||||
#endif /* HAVE_LSTAT */
|
|
||||||
|
|
||||||
/***********************************************************************
|
|
||||||
* mkstemp
|
|
||||||
*/
|
|
||||||
#ifndef HAVE_MKSTEMP
|
|
||||||
int mkstemp(char *tmpfn)
|
|
||||||
{
|
|
||||||
int tries;
|
|
||||||
char *xstart;
|
|
||||||
|
|
||||||
xstart = tmpfn+strlen(tmpfn)-1;
|
|
||||||
while ((xstart > tmpfn) && (*xstart == 'X'))
|
|
||||||
xstart--;
|
|
||||||
tries = 10;
|
|
||||||
while (tries--) {
|
|
||||||
char *newfn = mktemp(tmpfn);
|
|
||||||
int fd;
|
|
||||||
if (!newfn) /* something else broke horribly */
|
|
||||||
return -1;
|
|
||||||
fd = open(newfn,O_CREAT|O_RDWR|O_EXCL,0600);
|
|
||||||
if (fd!=-1)
|
|
||||||
return fd;
|
|
||||||
newfn = xstart;
|
|
||||||
/* fill up with X and try again ... */
|
|
||||||
while (*newfn) *newfn++ = 'X';
|
|
||||||
}
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
#endif /* HAVE_MKSTEMP */
|
|
||||||
|
|
||||||
|
|
||||||
/***********************************************************************
|
|
||||||
* pread
|
|
||||||
*
|
|
||||||
* FIXME: this is not thread-safe
|
|
||||||
*/
|
|
||||||
#ifndef HAVE_PREAD
|
|
||||||
ssize_t pread( int fd, void *buf, size_t count, off_t offset )
|
|
||||||
{
|
|
||||||
ssize_t ret;
|
|
||||||
off_t old_pos;
|
|
||||||
|
|
||||||
if ((old_pos = lseek( fd, 0, SEEK_CUR )) == -1) return -1;
|
|
||||||
if (lseek( fd, offset, SEEK_SET ) == -1) return -1;
|
|
||||||
if ((ret = read( fd, buf, count )) == -1)
|
|
||||||
{
|
|
||||||
int err = errno; /* save errno */
|
|
||||||
lseek( fd, old_pos, SEEK_SET );
|
|
||||||
errno = err;
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
if (lseek( fd, old_pos, SEEK_SET ) == -1) return -1;
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
#endif /* HAVE_PREAD */
|
|
||||||
|
|
||||||
|
|
||||||
/***********************************************************************
|
|
||||||
* pwrite
|
|
||||||
*
|
|
||||||
* FIXME: this is not thread-safe
|
|
||||||
*/
|
|
||||||
#ifndef HAVE_PWRITE
|
|
||||||
ssize_t pwrite( int fd, const void *buf, size_t count, off_t offset )
|
|
||||||
{
|
|
||||||
ssize_t ret;
|
|
||||||
off_t old_pos;
|
|
||||||
|
|
||||||
if ((old_pos = lseek( fd, 0, SEEK_CUR )) == -1) return -1;
|
|
||||||
if (lseek( fd, offset, SEEK_SET ) == -1) return -1;
|
|
||||||
if ((ret = write( fd, buf, count )) == -1)
|
|
||||||
{
|
|
||||||
int err = errno; /* save errno */
|
|
||||||
lseek( fd, old_pos, SEEK_SET );
|
|
||||||
errno = err;
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
if (lseek( fd, old_pos, SEEK_SET ) == -1) return -1;
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
#endif /* HAVE_PWRITE */
|
|
||||||
|
|
||||||
|
|
||||||
#if defined(__svr4__) || defined(__NetBSD__)
|
#if defined(__svr4__) || defined(__NetBSD__)
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
|
|
1
libs/.cvsignore
Normal file
1
libs/.cvsignore
Normal file
|
@ -0,0 +1 @@
|
||||||
|
Makefile
|
25
libs/Makefile.in
Normal file
25
libs/Makefile.in
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
TOPSRCDIR = @top_srcdir@
|
||||||
|
TOPOBJDIR = ..
|
||||||
|
SRCDIR = @srcdir@
|
||||||
|
VPATH = @srcdir@
|
||||||
|
MODULE = none
|
||||||
|
|
||||||
|
SUBDIRS = \
|
||||||
|
port
|
||||||
|
|
||||||
|
# Sub-directories to install for install-lib
|
||||||
|
INSTALLLIBSUBDIRS =
|
||||||
|
|
||||||
|
# Sub-directories to install for install-dev
|
||||||
|
INSTALLDEVSUBDIRS =
|
||||||
|
|
||||||
|
INSTALLSUBDIRS = $(INSTALLDEVSUBDIRS) $(INSTALLLIBSUBDIRS)
|
||||||
|
|
||||||
|
@MAKE_RULES@
|
||||||
|
|
||||||
|
all: $(SUBDIRS)
|
||||||
|
|
||||||
|
install-lib:: $(INSTALLLIBSUBDIRS:%=%/__install__)
|
||||||
|
install-dev:: $(INSTALLDEVSUBDIRS:%=%/__install__)
|
||||||
|
|
||||||
|
### Dependencies:
|
1
libs/port/.cvsignore
Normal file
1
libs/port/.cvsignore
Normal file
|
@ -0,0 +1 @@
|
||||||
|
Makefile
|
30
libs/port/Makefile.in
Normal file
30
libs/port/Makefile.in
Normal file
|
@ -0,0 +1,30 @@
|
||||||
|
DEFS = @DLLFLAGS@ -D__WINESRC__
|
||||||
|
TOPSRCDIR = @top_srcdir@
|
||||||
|
TOPOBJDIR = ../..
|
||||||
|
SRCDIR = @srcdir@
|
||||||
|
VPATH = @srcdir@
|
||||||
|
MODULE = libwine_port.a
|
||||||
|
|
||||||
|
C_SRCS = \
|
||||||
|
getpagesize.c \
|
||||||
|
lstat.c \
|
||||||
|
memmove.c \
|
||||||
|
mkstemp.c \
|
||||||
|
pread.c \
|
||||||
|
pwrite.c \
|
||||||
|
statfs.c \
|
||||||
|
strcasecmp.c \
|
||||||
|
strerror.c \
|
||||||
|
strncasecmp.c \
|
||||||
|
usleep.c
|
||||||
|
|
||||||
|
all: $(MODULE)
|
||||||
|
|
||||||
|
@MAKE_RULES@
|
||||||
|
|
||||||
|
$(MODULE): $(OBJS) Makefile.in
|
||||||
|
$(RM) $@
|
||||||
|
$(AR) $@ $(OBJS)
|
||||||
|
$(RANLIB) $@
|
||||||
|
|
||||||
|
### Dependencies:
|
39
libs/port/getpagesize.c
Normal file
39
libs/port/getpagesize.c
Normal file
|
@ -0,0 +1,39 @@
|
||||||
|
/*
|
||||||
|
* getpagesize function
|
||||||
|
*
|
||||||
|
* Copyright 1996 Alexandre Julliard
|
||||||
|
*
|
||||||
|
* This library is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
|
* License as published by the Free Software Foundation; either
|
||||||
|
* version 2.1 of the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This library is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
* Lesser General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Lesser General Public
|
||||||
|
* License along with this library; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "config.h"
|
||||||
|
#include "wine/port.h"
|
||||||
|
|
||||||
|
#ifdef HAVE_UNISTD_H
|
||||||
|
# include <unistd.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef HAVE_GETPAGESIZE
|
||||||
|
size_t getpagesize(void)
|
||||||
|
{
|
||||||
|
# ifdef __svr4__
|
||||||
|
return sysconf(_SC_PAGESIZE);
|
||||||
|
# elif defined(__i386__)
|
||||||
|
return 4096;
|
||||||
|
# else
|
||||||
|
# error Cannot get the page size on this platform
|
||||||
|
# endif
|
||||||
|
}
|
||||||
|
#endif /* HAVE_GETPAGESIZE */
|
29
libs/port/lstat.c
Normal file
29
libs/port/lstat.c
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
/*
|
||||||
|
* lstat function
|
||||||
|
*
|
||||||
|
* Copyright 1996 Alexandre Julliard
|
||||||
|
*
|
||||||
|
* This library is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
|
* License as published by the Free Software Foundation; either
|
||||||
|
* version 2.1 of the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This library is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
* Lesser General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Lesser General Public
|
||||||
|
* License along with this library; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "config.h"
|
||||||
|
#include "wine/port.h"
|
||||||
|
|
||||||
|
#ifndef HAVE_LSTAT
|
||||||
|
int lstat(const char *file_name, struct stat *buf)
|
||||||
|
{
|
||||||
|
return stat( file_name, buf );
|
||||||
|
}
|
||||||
|
#endif /* HAVE_LSTAT */
|
47
libs/port/memmove.c
Normal file
47
libs/port/memmove.c
Normal file
|
@ -0,0 +1,47 @@
|
||||||
|
/*
|
||||||
|
* memmove function
|
||||||
|
*
|
||||||
|
* Copyright 1996 Alexandre Julliard
|
||||||
|
*
|
||||||
|
* This library is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
|
* License as published by the Free Software Foundation; either
|
||||||
|
* version 2.1 of the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This library is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
* Lesser General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Lesser General Public
|
||||||
|
* License along with this library; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "config.h"
|
||||||
|
#include "wine/port.h"
|
||||||
|
|
||||||
|
#ifndef HAVE_MEMMOVE
|
||||||
|
void *memmove( void *dest, const void *src, size_t len )
|
||||||
|
{
|
||||||
|
register char *dst = dest;
|
||||||
|
|
||||||
|
/* Use memcpy if not overlapping */
|
||||||
|
if ((dst + len <= (char *)src) || ((char *)src + len <= dst))
|
||||||
|
{
|
||||||
|
memcpy( dst, src, len );
|
||||||
|
}
|
||||||
|
/* Otherwise do it the hard way (FIXME: could do better than this) */
|
||||||
|
else if (dst < (char *)src)
|
||||||
|
{
|
||||||
|
while (len--) *dst++ = *((char *)src)++;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
dst += len - 1;
|
||||||
|
src = (char *)src + len - 1;
|
||||||
|
while (len--) *dst-- = *((char *)src)--;
|
||||||
|
}
|
||||||
|
return dest;
|
||||||
|
}
|
||||||
|
#endif /* HAVE_MEMMOVE */
|
55
libs/port/mkstemp.c
Normal file
55
libs/port/mkstemp.c
Normal file
|
@ -0,0 +1,55 @@
|
||||||
|
/*
|
||||||
|
* mkstemp function
|
||||||
|
*
|
||||||
|
* Copyright 1996 Alexandre Julliard
|
||||||
|
*
|
||||||
|
* This library is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
|
* License as published by the Free Software Foundation; either
|
||||||
|
* version 2.1 of the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This library is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
* Lesser General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Lesser General Public
|
||||||
|
* License along with this library; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "config.h"
|
||||||
|
#include "wine/port.h"
|
||||||
|
|
||||||
|
#include <fcntl.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#ifdef HAVE_UNISTD_H
|
||||||
|
# include <unistd.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef HAVE_MKSTEMP
|
||||||
|
int mkstemp(char *tmpfn)
|
||||||
|
{
|
||||||
|
int tries;
|
||||||
|
char *xstart;
|
||||||
|
|
||||||
|
xstart = tmpfn+strlen(tmpfn)-1;
|
||||||
|
while ((xstart > tmpfn) && (*xstart == 'X'))
|
||||||
|
xstart--;
|
||||||
|
tries = 10;
|
||||||
|
while (tries--)
|
||||||
|
{
|
||||||
|
char *newfn = mktemp(tmpfn);
|
||||||
|
int fd;
|
||||||
|
if (!newfn) /* something else broke horribly */
|
||||||
|
return -1;
|
||||||
|
fd = open(newfn,O_CREAT|O_RDWR|O_EXCL,0600);
|
||||||
|
if (fd!=-1)
|
||||||
|
return fd;
|
||||||
|
newfn = xstart;
|
||||||
|
/* fill up with X and try again ... */
|
||||||
|
while (*newfn) *newfn++ = 'X';
|
||||||
|
}
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
#endif /* HAVE_MKSTEMP */
|
49
libs/port/pread.c
Normal file
49
libs/port/pread.c
Normal file
|
@ -0,0 +1,49 @@
|
||||||
|
/*
|
||||||
|
* pread function
|
||||||
|
*
|
||||||
|
* Copyright 1996 Alexandre Julliard
|
||||||
|
*
|
||||||
|
* This library is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
|
* License as published by the Free Software Foundation; either
|
||||||
|
* version 2.1 of the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This library is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
* Lesser General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Lesser General Public
|
||||||
|
* License along with this library; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "config.h"
|
||||||
|
#include "wine/port.h"
|
||||||
|
|
||||||
|
#include <errno.h>
|
||||||
|
#ifdef HAVE_UNISTD_H
|
||||||
|
# include <unistd.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* FIXME: this is not thread-safe */
|
||||||
|
|
||||||
|
#ifndef HAVE_PREAD
|
||||||
|
ssize_t pread( int fd, void *buf, size_t count, off_t offset )
|
||||||
|
{
|
||||||
|
ssize_t ret;
|
||||||
|
off_t old_pos;
|
||||||
|
|
||||||
|
if ((old_pos = lseek( fd, 0, SEEK_CUR )) == -1) return -1;
|
||||||
|
if (lseek( fd, offset, SEEK_SET ) == -1) return -1;
|
||||||
|
if ((ret = read( fd, buf, count )) == -1)
|
||||||
|
{
|
||||||
|
int err = errno; /* save errno */
|
||||||
|
lseek( fd, old_pos, SEEK_SET );
|
||||||
|
errno = err;
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
if (lseek( fd, old_pos, SEEK_SET ) == -1) return -1;
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
#endif /* HAVE_PREAD */
|
49
libs/port/pwrite.c
Normal file
49
libs/port/pwrite.c
Normal file
|
@ -0,0 +1,49 @@
|
||||||
|
/*
|
||||||
|
* pwrite function
|
||||||
|
*
|
||||||
|
* Copyright 1996 Alexandre Julliard
|
||||||
|
*
|
||||||
|
* This library is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
|
* License as published by the Free Software Foundation; either
|
||||||
|
* version 2.1 of the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This library is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
* Lesser General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Lesser General Public
|
||||||
|
* License along with this library; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "config.h"
|
||||||
|
#include "wine/port.h"
|
||||||
|
|
||||||
|
#include <errno.h>
|
||||||
|
#ifdef HAVE_UNISTD_H
|
||||||
|
# include <unistd.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* FIXME: this is not thread-safe */
|
||||||
|
|
||||||
|
#ifndef HAVE_PWRITE
|
||||||
|
ssize_t pwrite( int fd, const void *buf, size_t count, off_t offset )
|
||||||
|
{
|
||||||
|
ssize_t ret;
|
||||||
|
off_t old_pos;
|
||||||
|
|
||||||
|
if ((old_pos = lseek( fd, 0, SEEK_CUR )) == -1) return -1;
|
||||||
|
if (lseek( fd, offset, SEEK_SET ) == -1) return -1;
|
||||||
|
if ((ret = write( fd, buf, count )) == -1)
|
||||||
|
{
|
||||||
|
int err = errno; /* save errno */
|
||||||
|
lseek( fd, old_pos, SEEK_SET );
|
||||||
|
errno = err;
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
if (lseek( fd, old_pos, SEEK_SET ) == -1) return -1;
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
#endif /* HAVE_PWRITE */
|
76
libs/port/statfs.c
Normal file
76
libs/port/statfs.c
Normal file
|
@ -0,0 +1,76 @@
|
||||||
|
/*
|
||||||
|
* statfs function
|
||||||
|
*
|
||||||
|
* Copyright 1996 Alexandre Julliard
|
||||||
|
*
|
||||||
|
* This library is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
|
* License as published by the Free Software Foundation; either
|
||||||
|
* version 2.1 of the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This library is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
* Lesser General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Lesser General Public
|
||||||
|
* License along with this library; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "config.h"
|
||||||
|
#include "wine/port.h"
|
||||||
|
|
||||||
|
#ifdef __BEOS__
|
||||||
|
#include <be/kernel/fs_info.h>
|
||||||
|
#include <be/kernel/OS.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include <errno.h>
|
||||||
|
#ifdef HAVE_SYS_PARAM_H
|
||||||
|
# include <sys/param.h>
|
||||||
|
#endif
|
||||||
|
#ifdef STATFS_DEFINED_BY_SYS_VFS
|
||||||
|
# include <sys/vfs.h>
|
||||||
|
#else
|
||||||
|
# ifdef STATFS_DEFINED_BY_SYS_MOUNT
|
||||||
|
# include <sys/mount.h>
|
||||||
|
# else
|
||||||
|
# ifdef STATFS_DEFINED_BY_SYS_STATFS
|
||||||
|
# include <sys/statfs.h>
|
||||||
|
# endif
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef HAVE_STATFS
|
||||||
|
int statfs(const char *name, struct statfs *info)
|
||||||
|
{
|
||||||
|
#ifdef __BEOS__
|
||||||
|
dev_t mydev;
|
||||||
|
fs_info fsinfo;
|
||||||
|
|
||||||
|
if(!info) {
|
||||||
|
errno = ENOSYS;
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((mydev = dev_for_path(name)) < 0) {
|
||||||
|
errno = ENOSYS;
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (fs_stat_dev(mydev,&fsinfo) < 0) {
|
||||||
|
errno = ENOSYS;
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
info->f_bsize = fsinfo.block_size;
|
||||||
|
info->f_blocks = fsinfo.total_blocks;
|
||||||
|
info->f_bfree = fsinfo.free_blocks;
|
||||||
|
return 0;
|
||||||
|
#else /* defined(__BEOS__) */
|
||||||
|
errno = ENOSYS;
|
||||||
|
return -1;
|
||||||
|
#endif /* defined(__BEOS__) */
|
||||||
|
}
|
||||||
|
#endif /* !defined(HAVE_STATFS) */
|
38
libs/port/strcasecmp.c
Normal file
38
libs/port/strcasecmp.c
Normal file
|
@ -0,0 +1,38 @@
|
||||||
|
/*
|
||||||
|
* strcasecmp function
|
||||||
|
*
|
||||||
|
* Copyright 1996 Alexandre Julliard
|
||||||
|
*
|
||||||
|
* This library is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
|
* License as published by the Free Software Foundation; either
|
||||||
|
* version 2.1 of the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This library is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
* Lesser General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Lesser General Public
|
||||||
|
* License along with this library; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "config.h"
|
||||||
|
#include "wine/port.h"
|
||||||
|
|
||||||
|
#include <ctype.h>
|
||||||
|
|
||||||
|
#ifndef HAVE_STRCASECMP
|
||||||
|
int strcasecmp( const char *str1, const char *str2 )
|
||||||
|
{
|
||||||
|
const unsigned char *ustr1 = (const unsigned char *)str1;
|
||||||
|
const unsigned char *ustr2 = (const unsigned char *)str2;
|
||||||
|
|
||||||
|
while (*ustr1 && toupper(*ustr1) == toupper(*ustr2)) {
|
||||||
|
ustr1++;
|
||||||
|
ustr2++;
|
||||||
|
}
|
||||||
|
return toupper(*ustr1) - toupper(*ustr2);
|
||||||
|
}
|
||||||
|
#endif /* HAVE_STRCASECMP */
|
30
libs/port/strerror.c
Normal file
30
libs/port/strerror.c
Normal file
|
@ -0,0 +1,30 @@
|
||||||
|
/*
|
||||||
|
* strerror function
|
||||||
|
*
|
||||||
|
* Copyright 1996 Alexandre Julliard
|
||||||
|
*
|
||||||
|
* This library is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
|
* License as published by the Free Software Foundation; either
|
||||||
|
* version 2.1 of the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This library is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
* Lesser General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Lesser General Public
|
||||||
|
* License along with this library; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "config.h"
|
||||||
|
#include "wine/port.h"
|
||||||
|
|
||||||
|
#ifndef HAVE_STRERROR
|
||||||
|
const char *strerror( int err )
|
||||||
|
{
|
||||||
|
/* Let's hope we have sys_errlist then */
|
||||||
|
return sys_errlist[err];
|
||||||
|
}
|
||||||
|
#endif /* HAVE_STRERROR */
|
42
libs/port/strncasecmp.c
Normal file
42
libs/port/strncasecmp.c
Normal file
|
@ -0,0 +1,42 @@
|
||||||
|
/*
|
||||||
|
* strncasecmp function
|
||||||
|
*
|
||||||
|
* Copyright 1996 Alexandre Julliard
|
||||||
|
*
|
||||||
|
* This library is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
|
* License as published by the Free Software Foundation; either
|
||||||
|
* version 2.1 of the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This library is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
* Lesser General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Lesser General Public
|
||||||
|
* License along with this library; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "config.h"
|
||||||
|
#include "wine/port.h"
|
||||||
|
|
||||||
|
#include <ctype.h>
|
||||||
|
|
||||||
|
#ifndef HAVE_STRNCASECMP
|
||||||
|
int strncasecmp( const char *str1, const char *str2, size_t n )
|
||||||
|
{
|
||||||
|
const unsigned char *ustr1 = (const unsigned char *)str1;
|
||||||
|
const unsigned char *ustr2 = (const unsigned char *)str2;
|
||||||
|
int res;
|
||||||
|
|
||||||
|
if (!n) return 0;
|
||||||
|
while ((--n > 0) && *ustr1)
|
||||||
|
{
|
||||||
|
if ((res = toupper(*ustr1) - toupper(*ustr2))) return res;
|
||||||
|
ustr1++;
|
||||||
|
ustr2++;
|
||||||
|
}
|
||||||
|
return toupper(*ustr1) - toupper(*ustr2);
|
||||||
|
}
|
||||||
|
#endif /* HAVE_STRNCASECMP */
|
45
libs/port/usleep.c
Normal file
45
libs/port/usleep.c
Normal file
|
@ -0,0 +1,45 @@
|
||||||
|
/*
|
||||||
|
* usleep function
|
||||||
|
*
|
||||||
|
* Copyright 1996 Alexandre Julliard
|
||||||
|
*
|
||||||
|
* This library is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
|
* License as published by the Free Software Foundation; either
|
||||||
|
* version 2.1 of the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This library is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
* Lesser General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Lesser General Public
|
||||||
|
* License along with this library; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "config.h"
|
||||||
|
#include "wine/port.h"
|
||||||
|
|
||||||
|
#ifndef HAVE_USLEEP
|
||||||
|
int usleep (unsigned int useconds)
|
||||||
|
{
|
||||||
|
#if defined(__EMX__)
|
||||||
|
DosSleep(useconds);
|
||||||
|
return 0;
|
||||||
|
#elif defined(__BEOS__)
|
||||||
|
return snooze(useconds);
|
||||||
|
#elif defined(HAVE_SELECT)
|
||||||
|
struct timeval delay;
|
||||||
|
|
||||||
|
delay.tv_sec = useconds / 1000000;
|
||||||
|
delay.tv_usec = useconds % 1000000;
|
||||||
|
|
||||||
|
select( 0, 0, 0, 0, &delay );
|
||||||
|
return 0;
|
||||||
|
#else /* defined(__EMX__) || defined(__BEOS__) || defined(HAVE_SELECT) */
|
||||||
|
errno = ENOSYS;
|
||||||
|
return -1;
|
||||||
|
#endif /* defined(__EMX__) || defined(__BEOS__) || defined(HAVE_SELECT) */
|
||||||
|
}
|
||||||
|
#endif /* HAVE_USLEEP */
|
|
@ -18,7 +18,7 @@ all: $(MODULE)
|
||||||
ALL_OBJS = $(SPEC_SRCS:.spec=.spec.o) $(OBJS)
|
ALL_OBJS = $(SPEC_SRCS:.spec=.spec.o) $(OBJS)
|
||||||
|
|
||||||
$(MODULE): $(ALL_OBJS)
|
$(MODULE): $(ALL_OBJS)
|
||||||
$(CC) -o $@ $(ALL_OBJS) -L$(DLLDIR) $(LDIMPORTS:%=-l%) $(LIBWINE) $(LIBUNICODE) $(LIBS) $(LDFLAGS)
|
$(CC) -o $@ $(ALL_OBJS) -L$(DLLDIR) $(LDIMPORTS:%=-l%) $(LIBWINE) $(LIBUNICODE) $(LIBPORT) $(LIBS) $(LDFLAGS)
|
||||||
|
|
||||||
wine.spec.c: $(WINEBUILD)
|
wine.spec.c: $(WINEBUILD)
|
||||||
$(LDPATH) $(WINEBUILD) $(DEFS) -o $@ --exe wine -mgui -e wine_initial_task -L$(DLLDIR) $(IMPORTS:%=-l%)
|
$(LDPATH) $(WINEBUILD) $(DEFS) -o $@ --exe wine -mgui -e wine_initial_task -L$(DLLDIR) $(IMPORTS:%=-l%)
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
DEFS = @DLLFLAGS@ $(EXTRADEFS)
|
DEFS = @DLLFLAGS@ $(EXTRADEFS)
|
||||||
LDDLLFLAGS = @LDDLLFLAGS@
|
LDDLLFLAGS = @LDDLLFLAGS@
|
||||||
ALL_OBJS = $(OBJS) $(MODULE).dbg.o
|
ALL_OBJS = $(OBJS) $(MODULE).dbg.o
|
||||||
ALL_LIBS = $(LIBWINE) $(EXTRALIBS) $(LIBS)
|
ALL_LIBS = $(LIBWINE) $(EXTRALIBS) $(LIBPORT) $(LIBS)
|
||||||
BASEMODULE = $(MODULE:.exe=)
|
BASEMODULE = $(MODULE:.exe=)
|
||||||
TESTIMPORTS = $(DELAYIMPORTS) $(IMPORTS)
|
TESTIMPORTS = $(DELAYIMPORTS) $(IMPORTS)
|
||||||
RUNTESTFLAGS= -q -P wine -T $(TOPOBJDIR) $(PLTESTPROGRAM:%=-p %)
|
RUNTESTFLAGS= -q -P wine -T $(TOPOBJDIR) $(PLTESTPROGRAM:%=-p %)
|
||||||
|
|
|
@ -6,7 +6,7 @@ SRCDIR = @srcdir@
|
||||||
VPATH = @srcdir@
|
VPATH = @srcdir@
|
||||||
MODULE = none
|
MODULE = none
|
||||||
PROGRAMS = aviinfo.exe aviplay.exe icinfo.exe
|
PROGRAMS = aviinfo.exe aviplay.exe icinfo.exe
|
||||||
ALL_LIBS = $(LIBWINE) $(LIBS)
|
ALL_LIBS = $(LIBWINE) $(LIBPORT) $(LIBS)
|
||||||
|
|
||||||
C_SRCS = \
|
C_SRCS = \
|
||||||
aviinfo.c \
|
aviinfo.c \
|
||||||
|
|
|
@ -50,7 +50,7 @@ all: $(PROGRAMS)
|
||||||
@MAKE_RULES@
|
@MAKE_RULES@
|
||||||
|
|
||||||
wineserver: $(OBJS)
|
wineserver: $(OBJS)
|
||||||
$(CC) -o $(PROGRAMS) $(OBJS) $(LIBWINE) $(LIBUNICODE) $(LIBS) $(LDFLAGS)
|
$(CC) -o $(PROGRAMS) $(OBJS) $(LIBUNICODE) $(LIBPORT) $(LIBS) $(LDFLAGS)
|
||||||
|
|
||||||
install:: $(PROGRAMS)
|
install:: $(PROGRAMS)
|
||||||
$(MKINSTALLDIRS) $(bindir)
|
$(MKINSTALLDIRS) $(bindir)
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
DEFS = -DNO_LIBWINE -DLEX_OUTPUT_ROOT="\"@LEX_OUTPUT_ROOT@\"" -DINCLUDEDIR="\"$(includedir)\"" -DBINDIR="\"$(bindir)\""
|
DEFS = -DLEX_OUTPUT_ROOT="\"@LEX_OUTPUT_ROOT@\"" -DINCLUDEDIR="\"$(includedir)\"" -DBINDIR="\"$(bindir)\""
|
||||||
TOPSRCDIR = @top_srcdir@
|
TOPSRCDIR = @top_srcdir@
|
||||||
TOPOBJDIR = ..
|
TOPOBJDIR = ..
|
||||||
SRCDIR = @srcdir@
|
SRCDIR = @srcdir@
|
||||||
VPATH = @srcdir@
|
VPATH = @srcdir@
|
||||||
MODULE = none
|
MODULE = none
|
||||||
|
|
||||||
PROGRAMS = \
|
PROGRAMS = \
|
||||||
bin2res \
|
bin2res \
|
||||||
|
@ -40,19 +40,19 @@ all: $(PROGRAMS) $(SUBDIRS)
|
||||||
widl wrc: wpp
|
widl wrc: wpp
|
||||||
|
|
||||||
makedep: makedep.o
|
makedep: makedep.o
|
||||||
$(CC) $(CFLAGS) -o makedep makedep.o
|
$(CC) $(CFLAGS) -o makedep makedep.o $(LIBPORT)
|
||||||
|
|
||||||
fnt2bdf: fnt2bdf.o
|
fnt2bdf: fnt2bdf.o
|
||||||
$(CC) $(CFLAGS) -o fnt2bdf fnt2bdf.o
|
$(CC) $(CFLAGS) -o fnt2bdf fnt2bdf.o $(LIBPORT)
|
||||||
|
|
||||||
bin2res: bin2res.o
|
bin2res: bin2res.o
|
||||||
$(CC) $(CFLAGS) -o bin2res bin2res.o
|
$(CC) $(CFLAGS) -o bin2res bin2res.o $(LIBPORT)
|
||||||
|
|
||||||
winegcc: winegcc.o
|
winegcc: winegcc.o
|
||||||
$(CC) $(CFLAGS) -o winegcc winegcc.o
|
$(CC) $(CFLAGS) -o winegcc winegcc.o $(LIBPORT)
|
||||||
|
|
||||||
winewrap: winewrap.o
|
winewrap: winewrap.o
|
||||||
$(CC) $(CFLAGS) -o winewrap winewrap.o
|
$(CC) $(CFLAGS) -o winewrap winewrap.o $(LIBPORT)
|
||||||
|
|
||||||
install::
|
install::
|
||||||
$(MKINSTALLDIRS) $(bindir) $(mandir)/man$(prog_manext)
|
$(MKINSTALLDIRS) $(bindir) $(mandir)/man$(prog_manext)
|
||||||
|
|
|
@ -23,11 +23,8 @@ all: $(PROGRAMS)
|
||||||
|
|
||||||
@MAKE_RULES@
|
@MAKE_RULES@
|
||||||
|
|
||||||
widl: $(OBJS) $(TOPOBJDIR)/tools/wpp/libwpp.a
|
widl$(EXEEXT): $(OBJS) $(TOPOBJDIR)/tools/wpp/libwpp.a
|
||||||
$(CC) $(CFLAGS) -o widl $(OBJS) $(EXTRALIBS) $(LIBWINE) $(LIBUNICODE) $(LEXLIB) $(LDFLAGS)
|
$(CC) $(CFLAGS) -o $@ $(OBJS) $(EXTRALIBS) $(LIBPORT) $(LEXLIB) $(LDFLAGS)
|
||||||
|
|
||||||
widl.exe: $(OBJS) $(TOPOBJDIR)/tools/wpp/libwpp.a
|
|
||||||
$(CC) $(CFLAGS) -o widl.exe $(OBJS) $(EXTRALIBS) $(LIBWINE) $(LIBUNICODE) $(LEXLIB) -liberty $(LDFLAGS)
|
|
||||||
|
|
||||||
y.tab.c y.tab.h: parser.y
|
y.tab.c y.tab.h: parser.y
|
||||||
$(YACC) $(YACCOPT) -d -t $(SRCDIR)/parser.y
|
$(YACC) $(YACCOPT) -d -t $(SRCDIR)/parser.y
|
||||||
|
|
|
@ -29,7 +29,6 @@
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
|
|
||||||
#include "wine/unicode.h"
|
|
||||||
#include "widl.h"
|
#include "widl.h"
|
||||||
#include "utils.h"
|
#include "utils.h"
|
||||||
#include "parser.h"
|
#include "parser.h"
|
||||||
|
|
|
@ -23,7 +23,7 @@ all: $(PROGRAMS) winebuild.man
|
||||||
@MAKE_RULES@
|
@MAKE_RULES@
|
||||||
|
|
||||||
winebuild$(EXEEXT): $(OBJS)
|
winebuild$(EXEEXT): $(OBJS)
|
||||||
$(CC) $(CFLAGS) -o $@ $(OBJS) $(LIBWINE) $(LIBUNICODE) $(LDFLAGS)
|
$(CC) $(CFLAGS) -o $@ $(OBJS) $(LIBUNICODE) $(LIBPORT) $(LDFLAGS)
|
||||||
|
|
||||||
winebuild.man: winebuild.man.in
|
winebuild.man: winebuild.man.in
|
||||||
sed -e 's,@PACKAGE_STRING\@,@PACKAGE_STRING@,g' $(SRCDIR)/winebuild.man.in >$@ || $(RM) $@
|
sed -e 's,@PACKAGE_STRING\@,@PACKAGE_STRING@,g' $(SRCDIR)/winebuild.man.in >$@ || $(RM) $@
|
||||||
|
|
|
@ -22,7 +22,7 @@ all: $(PROGRAMS)
|
||||||
@MAKE_RULES@
|
@MAKE_RULES@
|
||||||
|
|
||||||
winedump: $(OBJS)
|
winedump: $(OBJS)
|
||||||
$(CC) $(CFLAGS) -o winedump $(OBJS) $(LIBWINE) $(LDFLAGS)
|
$(CC) $(CFLAGS) -o winedump $(OBJS) $(LIBPORT) $(LDFLAGS)
|
||||||
|
|
||||||
install:: $(PROGRAMS)
|
install:: $(PROGRAMS)
|
||||||
$(MKINSTALLDIRS) $(bindir)
|
$(MKINSTALLDIRS) $(bindir)
|
||||||
|
|
|
@ -24,11 +24,8 @@ mcl.o: y.tab.h
|
||||||
|
|
||||||
@MAKE_RULES@
|
@MAKE_RULES@
|
||||||
|
|
||||||
wmc: $(OBJS)
|
wmc$(EXEEXT): $(OBJS)
|
||||||
$(CC) $(CFLAGS) -o wmc $(OBJS) $(LIBWINE) $(LIBUNICODE) $(LEXLIB) $(LDFLAGS)
|
$(CC) $(CFLAGS) -o $@ $(OBJS) $(LIBUNICODE) $(LIBPORT) $(LEXLIB) $(LDFLAGS)
|
||||||
|
|
||||||
wmc.exe: $(OBJS)
|
|
||||||
$(CC) $(CFLAGS) -o wmc.exe $(OBJS) $(LIBWINE) $(LIBUNICODE) $(LEXLIB) -liberty $(LDFLAGS)
|
|
||||||
|
|
||||||
y.tab.c y.tab.h: mcy.y
|
y.tab.c y.tab.h: mcy.y
|
||||||
$(YACC) $(YACCOPT) -d -t $(SRCDIR)/mcy.y
|
$(YACC) $(YACCOPT) -d -t $(SRCDIR)/mcy.y
|
||||||
|
|
|
@ -27,11 +27,8 @@ all: $(PROGRAMS)
|
||||||
|
|
||||||
@MAKE_RULES@
|
@MAKE_RULES@
|
||||||
|
|
||||||
wrc: $(OBJS) $(TOPOBJDIR)/tools/wpp/libwpp.a
|
wrc$(EXEEXT): $(OBJS) $(TOPOBJDIR)/tools/wpp/libwpp.a
|
||||||
$(CC) $(CFLAGS) -o wrc $(OBJS) $(EXTRALIBS) $(LIBWINE) $(LIBUNICODE) $(LEXLIB) $(LDFLAGS)
|
$(CC) $(CFLAGS) -o $@ $(OBJS) $(EXTRALIBS) $(LIBUNICODE) $(LIBPORT) $(LEXLIB) $(LDFLAGS)
|
||||||
|
|
||||||
wrc.exe: $(OBJS) $(TOPOBJDIR)/tools/wpp/libwpp.a
|
|
||||||
$(CC) $(CFLAGS) -o wrc.exe $(OBJS) $(EXTRALIBS) $(LIBWINE) $(LIBUNICODE) $(LEXLIB) -liberty $(LDFLAGS)
|
|
||||||
|
|
||||||
y.tab.c y.tab.h: parser.y
|
y.tab.c y.tab.h: parser.y
|
||||||
$(YACC) $(YACCOPT) -d -t $(SRCDIR)/parser.y
|
$(YACC) $(YACCOPT) -d -t $(SRCDIR)/parser.y
|
||||||
|
|
Loading…
Reference in New Issue
Block a user