2000-02-18 03:38:33 +08:00
|
|
|
# Makefile.in for Cygwin.
|
|
|
|
#
|
|
|
|
# This file is part of Cygwin.
|
|
|
|
#
|
|
|
|
# This software is a copyrighted work licensed under the terms of the
|
|
|
|
# Cygwin license. Please consult the file "CYGWIN_LICENSE" for
|
|
|
|
# details.
|
2012-11-23 21:22:47 +08:00
|
|
|
# configure_input: @configure_input@
|
2000-02-18 03:38:33 +08:00
|
|
|
|
|
|
|
# This makefile requires GNU make.
|
2012-11-23 21:22:47 +08:00
|
|
|
|
2011-04-04 23:01:43 +08:00
|
|
|
srcdir:=@srcdir@
|
2012-11-23 21:22:47 +08:00
|
|
|
target_builddir:=@target_builddir@
|
|
|
|
winsup_srcdir:=@winsup_srcdir@
|
|
|
|
|
2020-10-27 23:31:06 +08:00
|
|
|
CC:=@CC@
|
|
|
|
CXX:=@CXX@
|
|
|
|
|
2012-11-23 21:22:47 +08:00
|
|
|
CFLAGS?=@CFLAGS@
|
|
|
|
CXXFLAGS?=@CXXFLAGS@
|
2020-10-03 21:41:58 +08:00
|
|
|
INCLUDES?=@INCLUDES@
|
2012-11-23 21:22:47 +08:00
|
|
|
|
2012-07-09 17:00:56 +08:00
|
|
|
include ${srcdir}/../Makefile.common
|
2000-02-18 03:38:33 +08:00
|
|
|
|
2020-05-22 17:32:51 +08:00
|
|
|
VPATH+=$(srcdir)/regex $(srcdir)/lib $(srcdir)/libc $(srcdir)/math $(srcdir)/tzcode
|
2000-07-01 11:51:55 +08:00
|
|
|
|
2013-04-23 17:44:36 +08:00
|
|
|
target_cpu:=@target_cpu@
|
2000-02-18 03:38:33 +08:00
|
|
|
target_alias:=@target_alias@
|
|
|
|
build_alias:=@build_alias@
|
|
|
|
host_alias:=@host_alias@
|
|
|
|
prefix:=@prefix@
|
|
|
|
|
|
|
|
program_transform_name:=@program_transform_name@
|
|
|
|
exec_prefix:=@exec_prefix@
|
|
|
|
bindir:=@bindir@
|
|
|
|
libdir:=@libdir@
|
2004-01-20 07:03:43 +08:00
|
|
|
mandir:=@mandir@
|
2008-04-05 17:30:06 +08:00
|
|
|
sysconfdir:=@sysconfdir@
|
2012-11-23 21:22:47 +08:00
|
|
|
datarootdir:=@datarootdir@
|
2000-02-18 03:38:33 +08:00
|
|
|
ifeq ($(target_alias),$(host_alias))
|
|
|
|
ifeq ($(build_alias),$(host_alias))
|
|
|
|
tooldir:=$(exec_prefix)
|
|
|
|
else
|
|
|
|
tooldir:=$(exec_prefix)/$(target_alias)
|
|
|
|
endif
|
|
|
|
else
|
|
|
|
tooldir:=$(exec_prefix)/$(target_alias)
|
|
|
|
endif
|
|
|
|
datadir:=@datadir@
|
|
|
|
infodir:=@infodir@
|
|
|
|
includedir:=@includedir@
|
|
|
|
|
2003-07-26 08:10:48 +08:00
|
|
|
override INSTALL:=@INSTALL@
|
|
|
|
override INSTALL_PROGRAM:=@INSTALL_PROGRAM@
|
|
|
|
override INSTALL_DATA:=@INSTALL_DATA@
|
2000-02-18 03:38:33 +08:00
|
|
|
|
2012-11-23 21:22:47 +08:00
|
|
|
cygserver_blddir:=${target_builddir}/winsup/cygserver
|
|
|
|
LIBSERVER:=${cygserver_blddir}/libcygserver.a
|
|
|
|
|
|
|
|
LIBC:=$(newlib_build)/libc/libc.a
|
|
|
|
LIBM:=$(newlib_build)/libm/libm.a
|
|
|
|
CRT0:=$(cygwin_build)/crt0.o
|
|
|
|
|
2000-02-18 03:38:33 +08:00
|
|
|
#
|
|
|
|
# --enable options from configure
|
|
|
|
#
|
2012-11-23 21:22:47 +08:00
|
|
|
CCEXTRA=
|
2020-08-06 03:58:22 +08:00
|
|
|
COMMON_CFLAGS=-MMD ${$(*F)_CFLAGS} -Wimplicit-fallthrough=5 -Werror -fmerge-constants -ftracer $(CCEXTRA)
|
2013-04-23 17:44:36 +08:00
|
|
|
ifeq ($(target_cpu),x86_64)
|
|
|
|
COMMON_CFLAGS+=-mcmodel=small
|
|
|
|
endif
|
2020-05-31 01:41:18 +08:00
|
|
|
COMPILE.cc+=${COMMON_CFLAGS} # -std=gnu++14
|
2012-11-23 21:22:47 +08:00
|
|
|
COMPILE.c+=${COMMON_CFLAGS}
|
2000-02-18 03:38:33 +08:00
|
|
|
|
|
|
|
AR:=@AR@
|
|
|
|
AR_FLAGS:=qv
|
|
|
|
RANLIB:=@RANLIB@
|
|
|
|
LD:=@LD@
|
|
|
|
DLLTOOL:=@DLLTOOL@
|
|
|
|
WINDRES:=@WINDRES@
|
|
|
|
AS:=@AS@
|
2001-12-20 10:55:11 +08:00
|
|
|
NM:=@NM@
|
2005-08-08 10:27:43 +08:00
|
|
|
OBJCOPY:=@OBJCOPY@
|
|
|
|
OBJDUMP:=@OBJDUMP@
|
|
|
|
STRIP:=@STRIP@
|
2001-12-20 10:55:11 +08:00
|
|
|
LDSCRIPT:=cygwin.sc
|
2005-10-17 11:20:20 +08:00
|
|
|
MKDIRP:=$(INSTALL) -m 755 -d
|
2000-02-18 03:38:33 +08:00
|
|
|
|
|
|
|
# Setup the testing framework, if you have one
|
|
|
|
EXPECT = `if [ -f $${rootme}/../../expect/expect$(EXEEXT) ] ; then \
|
2002-09-22 08:46:24 +08:00
|
|
|
echo $${rootme}/../../expect/expect$(EXEEXT) ; \
|
|
|
|
else echo expect ; fi`
|
2000-02-18 03:38:33 +08:00
|
|
|
|
|
|
|
RUNTEST = `if [ -f $${srcdir}/../dejagnu/runtest ] ; then \
|
|
|
|
echo $${srcdir}/../dejagnu/runtest ; \
|
|
|
|
else echo runtest; fi`
|
|
|
|
RUNTESTFLAGS =
|
|
|
|
|
|
|
|
# Parameters used in building the cygwin.dll.
|
2003-03-10 01:01:41 +08:00
|
|
|
# We build as cygwin0.dll and rename at install time to overcome
|
2000-02-18 03:38:33 +08:00
|
|
|
# native rebuilding issues (we don't want the build tools to see a partially
|
|
|
|
# built cygwin.dll and attempt to use it instead of the old one).
|
|
|
|
|
2020-10-23 22:33:39 +08:00
|
|
|
DLL_NAME:=cygwin1.dll
|
|
|
|
TEST_DLL_NAME:=${patsubst %1.dll,%0.dll,$(DLL_NAME)}
|
2003-03-10 01:01:41 +08:00
|
|
|
TEST_LIB_NAME:=libcygwin0.a
|
2013-05-01 07:43:08 +08:00
|
|
|
DIN_FILE=@DIN_FILE@ common.din
|
2000-02-18 03:38:33 +08:00
|
|
|
DEF_FILE:=cygwin.def
|
2013-04-23 17:44:36 +08:00
|
|
|
TLSOFFSETS_H:=@TLSOFFSETS_H@
|
2000-02-18 03:38:33 +08:00
|
|
|
DLL_ENTRY:=@DLL_ENTRY@
|
|
|
|
|
|
|
|
LIBGMON_A:=libgmon.a
|
2003-05-12 19:06:27 +08:00
|
|
|
CYGWIN_START:=crt0.o
|
2000-02-18 03:38:33 +08:00
|
|
|
GMON_START:=gcrt0.o
|
|
|
|
|
2013-04-23 17:44:36 +08:00
|
|
|
toolopts:=--cpu=${target_cpu} --ar=${AR} --as=${AS} --nm=${NM} --objcopy=${OBJCOPY}
|
2009-04-12 11:19:52 +08:00
|
|
|
speclib=\
|
|
|
|
${srcdir}/speclib ${toolopts} \
|
|
|
|
--exclude='cygwin' \
|
|
|
|
--exclude='(?i:dll)' \
|
|
|
|
--exclude='reloc' \
|
2013-04-23 17:44:36 +08:00
|
|
|
--exclude='^main$$' \
|
2009-04-12 11:19:52 +08:00
|
|
|
--exclude='^_main$$' \
|
|
|
|
$^
|
2009-03-28 12:55:36 +08:00
|
|
|
|
2000-02-18 03:38:33 +08:00
|
|
|
# Some things want these from libc, but they have their own static
|
|
|
|
# data which apps can get to, which is a pain in the dll, so we
|
|
|
|
# include them directly into the library.
|
|
|
|
|
2000-07-01 11:51:55 +08:00
|
|
|
LIBCOS:=${sort ${addsuffix .o,${basename ${notdir ${wildcard $(srcdir)/lib/*.c}}}} \
|
|
|
|
${addsuffix .o,${basename ${notdir ${wildcard $(srcdir)/lib/*.cc}}}}}
|
2000-02-18 03:38:33 +08:00
|
|
|
|
|
|
|
# Build all source files in the config directory
|
|
|
|
|
2007-07-08 23:04:34 +08:00
|
|
|
EXTRA_OFILES:=
|
2000-02-18 03:38:33 +08:00
|
|
|
|
2013-04-23 17:44:36 +08:00
|
|
|
MALLOC_OFILES:=malloc.o
|
2001-04-24 23:25:31 +08:00
|
|
|
|
2012-10-24 18:12:45 +08:00
|
|
|
DLL_IMPORTS:=${shell $(CC) -print-file-name=w32api/libkernel32.a} ${shell $(CC) -print-file-name=w32api/libntdll.a}
|
2000-02-18 03:38:33 +08:00
|
|
|
|
2003-11-29 04:55:59 +08:00
|
|
|
#
|
2020-08-30 03:29:24 +08:00
|
|
|
LIBC_OFILES:= \
|
|
|
|
arc4random_stir.o \
|
|
|
|
base64.o \
|
|
|
|
bsdlib.o \
|
|
|
|
call_once.o \
|
|
|
|
cnd.o \
|
|
|
|
fnmatch.o \
|
|
|
|
fts.o \
|
|
|
|
ftw.o \
|
|
|
|
getentropy.o \
|
|
|
|
getopt.o \
|
|
|
|
inet_addr.o \
|
|
|
|
inet_network.o \
|
|
|
|
minires-os-if.o \
|
|
|
|
minires.o \
|
|
|
|
msgcat.o \
|
|
|
|
mtx.o \
|
|
|
|
nftw.o \
|
|
|
|
rcmd.o \
|
|
|
|
rexec.o \
|
|
|
|
strfmon.o \
|
|
|
|
strptime.o \
|
|
|
|
thrd.o \
|
|
|
|
tss.o \
|
|
|
|
xsique.o
|
|
|
|
|
Add missing long double functions to Cygwin
This patch adds the long double functions missing in newlib to Cygwin.
Apart from some self-written additions (exp10l, finite{f,l}, isinf{f,l},
isnan{f,l}, pow10l) the files are taken from the Mingw-w64 math lib.
Minor changes were required, e.g. substitue _WIN64 with __x86_64__ and
fixing __FLT_RPT_DOMAIN/__FLT_RPT_ERANGE for Cygwin.
Cygwin:
* math: New subdir with math functions.
* Makefile.in (VPATH): Add math subdir.
(MATH_OFILES): List of object files collected from building files in
math subdir.
(DLL_OFILES): Add $(MATH_OFILES).
${CURDIR}/libm.a: Add $(MATH_OFILES) to build.
* common.din: Add new functions from math subdir.
* i686.din: Align to new math subdir. Remove functions now commonly
available.
* x86_64.din: Ditto.
* math.h: math.h wrapper to define mingw structs used in some files in
math subdir.
* include/cygwin/version.h: Bump API minor version.
newlib:
* libc/include/complex.h: Add prototypes for complex long double
functions. Only define for Cygwin.
* libc/include/math.h: Additionally enable prototypes of long double
functions for Cygwin. Add Cygwin-only prototypes for dreml, sincosl,
exp10l and pow10l. Explain why we don't add them to newlib.
* libc/include/tgmath.h: Enable long double handling on Cygwin.
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2016-03-29 01:35:20 +08:00
|
|
|
MATH_OFILES:= \
|
|
|
|
acoshl.o \
|
|
|
|
acosl.o \
|
|
|
|
asinhl.o \
|
|
|
|
asinl.o \
|
|
|
|
atan2l.o \
|
|
|
|
atanhl.o \
|
|
|
|
atanl.o \
|
|
|
|
cabsl.o \
|
|
|
|
cacosl.o \
|
|
|
|
cargl.o \
|
|
|
|
casinl.o \
|
|
|
|
catanl.o \
|
|
|
|
cbrtl.o \
|
|
|
|
ccosl.o \
|
|
|
|
ceill.o \
|
|
|
|
cephes_emath.o \
|
|
|
|
cexpl.o \
|
|
|
|
cimagl.o \
|
|
|
|
clog10l.o \
|
|
|
|
clogl.o \
|
|
|
|
conjl.o \
|
|
|
|
copysignl.o \
|
|
|
|
coshl.o \
|
|
|
|
cosl.o \
|
|
|
|
cosl_internal.o \
|
|
|
|
cossin.o \
|
|
|
|
cpowl.o \
|
|
|
|
cprojl.o \
|
|
|
|
creall.o \
|
|
|
|
csinl.o \
|
|
|
|
csqrtl.o \
|
|
|
|
ctanl.o \
|
|
|
|
erfl.o \
|
|
|
|
exp10l.o \
|
|
|
|
exp2l.o \
|
|
|
|
expl.o \
|
|
|
|
expm1l.o \
|
|
|
|
fabsl.o \
|
|
|
|
fdiml.o \
|
|
|
|
finite.o \
|
|
|
|
floorl.o \
|
|
|
|
fmal.o \
|
|
|
|
fmaxl.o \
|
|
|
|
fminl.o \
|
|
|
|
fmodl.o \
|
|
|
|
frexpl.o \
|
|
|
|
ilogbl.o \
|
|
|
|
internal_logl.o \
|
|
|
|
isinf.o \
|
|
|
|
isnan.o \
|
|
|
|
ldexpl.o \
|
|
|
|
lgammal.o \
|
|
|
|
llrint.o \
|
|
|
|
llrintf.o \
|
|
|
|
llrintl.o \
|
|
|
|
llroundl.o \
|
|
|
|
log10l.o \
|
|
|
|
log1pl.o \
|
|
|
|
log2l.o \
|
|
|
|
logbl.o \
|
|
|
|
logl.o \
|
|
|
|
lrint.o \
|
|
|
|
lrintf.o \
|
|
|
|
lrintl.o \
|
|
|
|
lroundl.o \
|
|
|
|
modfl.o \
|
|
|
|
nearbyint.o \
|
|
|
|
nearbyintf.o \
|
|
|
|
nearbyintl.o \
|
|
|
|
nextafterl.o \
|
|
|
|
nexttoward.o \
|
|
|
|
nexttowardf.o \
|
|
|
|
pow10l.o \
|
|
|
|
powil.o \
|
|
|
|
powl.o \
|
|
|
|
remainder.o \
|
|
|
|
remainderf.o \
|
|
|
|
remainderl.o \
|
|
|
|
remquol.o \
|
|
|
|
rint.o \
|
|
|
|
rintf.o \
|
|
|
|
rintl.o \
|
|
|
|
roundl.o \
|
|
|
|
scalbl.o \
|
|
|
|
scalbnl.o \
|
|
|
|
sinhl.o \
|
|
|
|
sinl.o \
|
|
|
|
sinl_internal.o \
|
|
|
|
sqrtl.o \
|
|
|
|
tanhl.o \
|
|
|
|
tanl.o \
|
|
|
|
tgammal.o \
|
|
|
|
truncl.o
|
|
|
|
|
2020-05-22 17:32:51 +08:00
|
|
|
TZCODE_OFILES:=localtime.o
|
|
|
|
|
2014-10-16 23:40:09 +08:00
|
|
|
DLL_OFILES:= \
|
|
|
|
advapi32.o \
|
2018-07-24 13:31:59 +08:00
|
|
|
aio.o \
|
2014-10-16 23:40:09 +08:00
|
|
|
assert.o \
|
|
|
|
autoload.o \
|
2018-11-27 20:47:02 +08:00
|
|
|
clock.o \
|
2014-10-16 23:40:09 +08:00
|
|
|
ctype.o \
|
|
|
|
cxx.o \
|
|
|
|
cygheap.o \
|
|
|
|
cygthread.o \
|
|
|
|
cygtls.o \
|
|
|
|
cygwait.o \
|
|
|
|
cygxdr.o \
|
|
|
|
dcrt0.o \
|
|
|
|
debug.o \
|
|
|
|
devices.o \
|
|
|
|
dir.o \
|
|
|
|
dlfcn.o \
|
|
|
|
dll_init.o \
|
|
|
|
dtable.o \
|
|
|
|
environ.o \
|
|
|
|
errno.o \
|
|
|
|
exceptions.o \
|
|
|
|
exec.o \
|
|
|
|
external.o \
|
|
|
|
fcntl.o \
|
|
|
|
fenv.o \
|
|
|
|
fhandler.o \
|
|
|
|
fhandler_clipboard.o \
|
|
|
|
fhandler_console.o \
|
2019-01-07 19:29:07 +08:00
|
|
|
fhandler_cygdrive.o \
|
2014-10-16 23:40:09 +08:00
|
|
|
fhandler_dev.o \
|
|
|
|
fhandler_disk_file.o \
|
|
|
|
fhandler_dsp.o \
|
|
|
|
fhandler_fifo.o \
|
|
|
|
fhandler_floppy.o \
|
|
|
|
fhandler_netdrive.o \
|
|
|
|
fhandler_nodevice.o \
|
2019-01-07 19:31:28 +08:00
|
|
|
fhandler_pipe.o \
|
2014-10-16 23:40:09 +08:00
|
|
|
fhandler_proc.o \
|
|
|
|
fhandler_process.o \
|
2019-01-07 03:18:14 +08:00
|
|
|
fhandler_process_fd.o \
|
2014-10-16 23:40:09 +08:00
|
|
|
fhandler_procnet.o \
|
|
|
|
fhandler_procsys.o \
|
|
|
|
fhandler_procsysvipc.o \
|
|
|
|
fhandler_random.o \
|
|
|
|
fhandler_raw.o \
|
|
|
|
fhandler_registry.o \
|
|
|
|
fhandler_serial.o \
|
2019-01-14 06:13:33 +08:00
|
|
|
fhandler_signalfd.o \
|
2014-10-16 23:40:09 +08:00
|
|
|
fhandler_socket.o \
|
2018-02-22 04:40:01 +08:00
|
|
|
fhandler_socket_inet.o \
|
|
|
|
fhandler_socket_local.o \
|
2018-02-24 03:59:21 +08:00
|
|
|
fhandler_socket_unix.o \
|
2014-10-16 23:40:09 +08:00
|
|
|
fhandler_tape.o \
|
|
|
|
fhandler_termios.o \
|
2019-01-16 05:02:33 +08:00
|
|
|
fhandler_timerfd.o \
|
2014-10-16 23:40:09 +08:00
|
|
|
fhandler_tty.o \
|
|
|
|
fhandler_virtual.o \
|
|
|
|
fhandler_windows.o \
|
|
|
|
fhandler_zero.o \
|
|
|
|
flock.o \
|
|
|
|
fork.o \
|
forkables: Create forkable hardlinks, yet unused.
In preparation to protect fork() against dll- and exe-updates, create
hardlinks to the main executable and each loaded dll in subdirectories
of /var/run/cygfork/, if that one exists on the NTFS file system.
The directory names consist of the user sid, the main executable's NTFS
IndexNumber, and the most recent LastWriteTime of all involved binaries
(dlls and main executable). Next to the main.exe hardlink we create the
empty file main.exe.local to enable dll redirection.
The name of the mutex to synchronize hardlink creation/cleanup also is
assembled from these directory names, to allow for synchronized cleanup
of even orphaned hardlink directories.
The hardlink to each dynamically loaded dll goes into another directory,
named using the NTFS IndexNumber of the dll's original directory.
* Makefile.in (DLL_OFILES): Add forkable.o.
* dll_init.h (struct dll): Declare member variables fbi, fii,
forkable_ntname. Declare methods nominate_forkable,
create_forkable.
(struct dll_list): Declare enum forkables_needs. Declare member
variables forkables_dirx_size, forkables_dirx_ntname,
forkables_mutex_name, forkables_mutex. Declare private methods
forkable_ntnamesize, prepare_forkables_nomination,
update_forkables_needs, update_forkables, create_forkables,
denominate_forkables, close_mutex, try_remove_forkables,
set_forkables_inheritance, request_forkables. Declare public
static methods ntopenfile, read_fii, read_fbi. Declare public
methods release_forkables, cleanup_forkables. Define public
inline method setup_forkables.
* dll_init.cc (dll_list::alloc): Allocate memory to hold the
name of the hardlink in struct dll member forkable_ntname.
Initialize struct dll members fbi, fii.
(dll_list::load_after_fork): Call release_forkables method.
* fork.cc: Rename public fork function to static dofork, add
with_forkables as bool pointer parameter. Add new fork function
calling dofork. (struct frok): Add bool pointer member
with_forkables, add as constructor parameter.
(frok::parent): Call dlls.setup_forkables before CreateProcessW,
dlls.release_forkables afterwards.
* pinfo.cc (pinfo::exit): Call dlls.cleanup_forkables.
* syscalls.cc (_unlink_nt): Rename public unlink_nt function to
static _unlink_nt, with 'shareable' as additional argument.
(unlink_nt): New, wrap _unlink_nt for original behaviour.
(unlink_nt_shareable): New, wrap _unlink_nt to keep a binary
file still loadable while removing one of its hardlinks.
* forkable.cc: New file.
Implement static functions mkdirs, rmdirs, rmdirs_synchronized,
stat_real_file_once, format_IndexNumber, rootname, sidname,
exename, lwtimename. Define static array forkable_nameparts.
(struct dll): Implement nominate_forkable, create_forkable.
(struct dll_list): Implement static methods ntopenfile,
read_fii, read_fbi. Implement forkable_ntnamesize,
2016-12-07 18:58:27 +08:00
|
|
|
forkable.o \
|
2014-10-16 23:40:09 +08:00
|
|
|
glob.o \
|
|
|
|
glob_pattern_p.o \
|
|
|
|
globals.o \
|
|
|
|
grp.o \
|
|
|
|
heap.o \
|
|
|
|
hookapi.o \
|
|
|
|
init.o \
|
|
|
|
ioctl.o \
|
|
|
|
ipc.o \
|
|
|
|
kernel32.o \
|
|
|
|
ldap.o \
|
|
|
|
libstdcxx_wrapper.o \
|
2017-03-22 03:17:42 +08:00
|
|
|
loadavg.o \
|
2014-10-16 23:40:09 +08:00
|
|
|
lsearch.o \
|
|
|
|
malloc_wrapper.o \
|
|
|
|
miscfuncs.o \
|
|
|
|
mktemp.o \
|
|
|
|
mmap.o \
|
2019-08-08 16:53:58 +08:00
|
|
|
mmap_alloc.o \
|
2014-10-16 23:40:09 +08:00
|
|
|
msg.o \
|
|
|
|
mount.o \
|
|
|
|
net.o \
|
|
|
|
netdb.o \
|
|
|
|
nfs.o \
|
|
|
|
nlsfuncs.o \
|
|
|
|
ntea.o \
|
|
|
|
passwd.o \
|
|
|
|
path.o \
|
|
|
|
pinfo.o \
|
|
|
|
poll.o \
|
|
|
|
posix_ipc.o \
|
2019-01-22 22:23:05 +08:00
|
|
|
posix_timer.o \
|
2014-10-16 23:40:09 +08:00
|
|
|
pseudo-reloc.o \
|
|
|
|
pthread.o \
|
2014-10-17 16:19:27 +08:00
|
|
|
quotactl.o \
|
2014-10-16 23:40:09 +08:00
|
|
|
random.o \
|
|
|
|
regcomp.o \
|
|
|
|
regerror.o \
|
|
|
|
regexec.o \
|
|
|
|
regfree.o \
|
|
|
|
registry.o \
|
|
|
|
resource.o \
|
|
|
|
scandir.o \
|
|
|
|
sched.o \
|
|
|
|
sec_acl.o \
|
|
|
|
sec_auth.o \
|
|
|
|
sec_helper.o \
|
2016-01-07 01:41:36 +08:00
|
|
|
sec_posixacl.o \
|
2014-10-16 23:40:09 +08:00
|
|
|
security.o \
|
|
|
|
select.o \
|
|
|
|
sem.o \
|
|
|
|
setlsapwd.o \
|
|
|
|
shared.o \
|
|
|
|
shm.o \
|
|
|
|
sigfe.o \
|
|
|
|
signal.o \
|
|
|
|
sigproc.o \
|
|
|
|
smallprint.o \
|
|
|
|
spawn.o \
|
|
|
|
strace.o \
|
|
|
|
strfuncs.o \
|
|
|
|
strsep.o \
|
|
|
|
strsig.o \
|
|
|
|
sync.o \
|
|
|
|
syscalls.o \
|
|
|
|
sysconf.o \
|
|
|
|
syslog.o \
|
|
|
|
termios.o \
|
|
|
|
thread.o \
|
2019-01-20 02:53:48 +08:00
|
|
|
timerfd.o \
|
2014-10-16 23:40:09 +08:00
|
|
|
times.o \
|
|
|
|
tls_pbuf.o \
|
|
|
|
tty.o \
|
|
|
|
uinfo.o \
|
|
|
|
uname.o \
|
|
|
|
wait.o \
|
|
|
|
wincap.o \
|
|
|
|
window.o \
|
|
|
|
winf.o \
|
|
|
|
$(EXTRA_OFILES) \
|
|
|
|
$(MALLOC_OFILES) \
|
2020-08-30 03:29:24 +08:00
|
|
|
$(LIBC_OFILES) \
|
Add missing long double functions to Cygwin
This patch adds the long double functions missing in newlib to Cygwin.
Apart from some self-written additions (exp10l, finite{f,l}, isinf{f,l},
isnan{f,l}, pow10l) the files are taken from the Mingw-w64 math lib.
Minor changes were required, e.g. substitue _WIN64 with __x86_64__ and
fixing __FLT_RPT_DOMAIN/__FLT_RPT_ERANGE for Cygwin.
Cygwin:
* math: New subdir with math functions.
* Makefile.in (VPATH): Add math subdir.
(MATH_OFILES): List of object files collected from building files in
math subdir.
(DLL_OFILES): Add $(MATH_OFILES).
${CURDIR}/libm.a: Add $(MATH_OFILES) to build.
* common.din: Add new functions from math subdir.
* i686.din: Align to new math subdir. Remove functions now commonly
available.
* x86_64.din: Ditto.
* math.h: math.h wrapper to define mingw structs used in some files in
math subdir.
* include/cygwin/version.h: Bump API minor version.
newlib:
* libc/include/complex.h: Add prototypes for complex long double
functions. Only define for Cygwin.
* libc/include/math.h: Additionally enable prototypes of long double
functions for Cygwin. Add Cygwin-only prototypes for dreml, sincosl,
exp10l and pow10l. Explain why we don't add them to newlib.
* libc/include/tgmath.h: Enable long double handling on Cygwin.
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2016-03-29 01:35:20 +08:00
|
|
|
$(MATH_OFILES) \
|
2020-10-08 22:41:24 +08:00
|
|
|
$(TZCODE_OFILES)
|
2000-02-18 03:38:33 +08:00
|
|
|
|
2015-01-28 19:43:06 +08:00
|
|
|
VERSION_OFILES:=version.o winver.o
|
|
|
|
|
2013-06-18 17:45:37 +08:00
|
|
|
ifeq ($(target_cpu),x86_64)
|
|
|
|
# Needed by mcountFunc.S to choose the right code path and symbol names
|
|
|
|
ASFLAGS:=-D_WIN64
|
|
|
|
endif
|
|
|
|
|
|
|
|
GMON_OFILES:=gmon.o mcount.o profil.o mcountFunc.o
|
2001-12-20 10:55:11 +08:00
|
|
|
|
2014-11-05 17:28:01 +08:00
|
|
|
NEW_FUNCTIONS:=$(addprefix --replace=,\
|
2014-11-05 17:48:00 +08:00
|
|
|
atexit= \
|
2014-11-05 17:28:01 +08:00
|
|
|
timezone= \
|
2019-01-24 19:01:01 +08:00
|
|
|
uname=uname_x \
|
2014-11-05 17:28:01 +08:00
|
|
|
__xdrrec_getrec= \
|
|
|
|
__xdrrec_setnonblock= \
|
|
|
|
xdr_array= \
|
|
|
|
xdr_bool= \
|
|
|
|
xdr_bytes= \
|
|
|
|
xdr_char= \
|
|
|
|
xdr_double= \
|
|
|
|
xdr_enum= \
|
|
|
|
xdr_float= \
|
|
|
|
xdr_free= \
|
|
|
|
xdr_hyper= \
|
|
|
|
xdr_int= \
|
|
|
|
xdr_int16_t= \
|
|
|
|
xdr_int32_t= \
|
|
|
|
xdr_int64_t= \
|
|
|
|
xdr_int8_t= \
|
|
|
|
xdr_long= \
|
|
|
|
xdr_longlong_t= \
|
|
|
|
xdr_netobj= \
|
|
|
|
xdr_opaque= \
|
|
|
|
xdr_pointer= \
|
|
|
|
xdr_reference= \
|
|
|
|
xdr_short= \
|
|
|
|
xdr_sizeof= \
|
|
|
|
xdr_string= \
|
|
|
|
xdr_u_char= \
|
|
|
|
xdr_u_hyper= \
|
|
|
|
xdr_u_int= \
|
|
|
|
xdr_u_int16_t= \
|
|
|
|
xdr_u_int32_t= \
|
|
|
|
xdr_u_int64_t= \
|
|
|
|
xdr_u_int8_t= \
|
|
|
|
xdr_u_long= \
|
|
|
|
xdr_u_longlong_t= \
|
|
|
|
xdr_u_short= \
|
|
|
|
xdr_uint16_t= \
|
|
|
|
xdr_uint32_t= \
|
|
|
|
xdr_uint64_t= \
|
|
|
|
xdr_uint8_t= \
|
|
|
|
xdr_union= \
|
|
|
|
xdr_vector= \
|
|
|
|
xdr_void= \
|
|
|
|
xdr_wrapstring= \
|
|
|
|
xdrmem_create= \
|
|
|
|
xdrrec_create= \
|
|
|
|
xdrrec_endofrecord= \
|
|
|
|
xdrrec_eof= \
|
|
|
|
xdrrec_skiprecord= \
|
|
|
|
xdrstdio_create= \
|
|
|
|
)
|
2013-04-23 17:44:36 +08:00
|
|
|
ifeq ($(target_cpu),x86_64)
|
2014-11-05 17:28:01 +08:00
|
|
|
NEW_FUNCTIONS+=
|
2013-04-23 17:44:36 +08:00
|
|
|
else
|
2014-11-05 17:28:01 +08:00
|
|
|
NEW_FUNCTIONS+=$(addprefix --replace=,\
|
2009-04-12 11:19:52 +08:00
|
|
|
acl=_acl32 \
|
|
|
|
aclcheck=_aclcheck32 \
|
|
|
|
aclfrommode=_aclfrommode32 \
|
|
|
|
aclfrompbits=_aclfrompbits32 \
|
|
|
|
aclfromtext=_aclfromtext32 \
|
|
|
|
aclsort=_aclsort32 \
|
|
|
|
acltomode=_acltomode32 \
|
|
|
|
acltopbits=_acltopbits32 \
|
|
|
|
acltotext=_acltotext32 \
|
|
|
|
chown=_chown32 \
|
|
|
|
facl=_facl32 \
|
|
|
|
fchown=_fchown32 \
|
|
|
|
fcntl=_fcntl64 \
|
|
|
|
fdopen=_fdopen64 \
|
|
|
|
fgetpos=_fgetpos64 \
|
|
|
|
fopen=_fopen64 \
|
|
|
|
freopen=_freopen64 \
|
|
|
|
fseeko=_fseeko64 \
|
|
|
|
fsetpos=_fsetpos64 \
|
|
|
|
fstat=_fstat64 \
|
|
|
|
ftello=_ftello64 \
|
|
|
|
ftruncate=_ftruncate64 \
|
|
|
|
getegid=_getegid32 \
|
|
|
|
geteuid=_geteuid32 \
|
|
|
|
getgid=_getgid32 \
|
|
|
|
getgrent=_getgrent32 \
|
|
|
|
getgrgid=_getgrgid32 \
|
|
|
|
getgrnam=_getgrnam32 \
|
|
|
|
getgroups=_getgroups32 \
|
|
|
|
getpwuid=_getpwuid32 \
|
|
|
|
getpwuid_r=_getpwuid_r32 \
|
|
|
|
getuid=_getuid32 \
|
|
|
|
initgroups=_initgroups32 \
|
|
|
|
lchown=_lchown32 \
|
|
|
|
lseek=_lseek64 \
|
|
|
|
lstat=_lstat64 \
|
|
|
|
mknod=_mknod32 \
|
|
|
|
mmap=_mmap64 \
|
|
|
|
open=_open64 \
|
|
|
|
setegid=_setegid32 \
|
|
|
|
seteuid=_seteuid32 \
|
|
|
|
setgid=_setgid32 \
|
|
|
|
setgroups=_setgroups32 \
|
|
|
|
setregid=_setregid32 \
|
|
|
|
setreuid=_setreuid32 \
|
|
|
|
setuid=_setuid32 \
|
|
|
|
stat=_stat64 \
|
|
|
|
tmpfile=_tmpfile64 \
|
|
|
|
truncate=_truncate64 \
|
|
|
|
)
|
2013-04-23 17:44:36 +08:00
|
|
|
endif
|
2000-02-18 03:38:33 +08:00
|
|
|
|
2002-07-25 17:09:34 +08:00
|
|
|
API_VER:=$(srcdir)/include/cygwin/version.h
|
|
|
|
|
2009-03-28 12:55:36 +08:00
|
|
|
LIB_NAME:=libcygwin.a
|
2017-11-28 13:56:30 +08:00
|
|
|
SUBLIBS:=libpthread.a libutil.a ${CURDIR}/libm.a ${CURDIR}/libc.a libdl.a libresolv.a librt.a libacl.a libssp.a
|
2004-04-06 22:22:43 +08:00
|
|
|
EXTRALIBS:=libautomode.a libbinmode.a libtextmode.a libtextreadmode.a
|
|
|
|
INSTOBJS:=automode.o binmode.o textmode.o textreadmode.o
|
2003-08-06 09:40:12 +08:00
|
|
|
TARGET_LIBS:=$(LIB_NAME) $(CYGWIN_START) $(GMON_START) $(LIBGMON_A) $(SUBLIBS) $(INSTOBJS) $(EXTRALIBS)
|
* devices.cc: New file.
* devices.gperf: New file.
* devices.shilka: New file.
* cygwin-gperf: New file.
* cygwin-shilka: New file.
* fhandler_fifo.cc: New file.
* fhandler_nodevice.cc : New file. Reorganize headers so that path.h precedes
fhandler.h throughout. Remove device argument and unit arguments from fhandler
constructors throughout. Remove pc arguments to fhandler functions and use
internal pc element instead, throughout. Use dev element in pc throughout.
Use major/minor elements rather than units and device numbers previously in
fhandler class. Use correct methods for fhandler file names rather than
directly accessing file name variables, throughout.
* Makefile.in (DLL_OFILES): Add devices.o, fhandler_fifo.o
* dcrt0.cc (dll_crt0_1): Call device::init.
* devices.h: Renumber devices based on more Linux-like major/minor numbers.
Add more devices. Declare standard device storage.
(device): Declare struct.
* dir.cc (opendir): Use new 'build_fh_name' to construct a fhandler_* type.
* dtable.cc (dtable::get_debugger_info): Ditto.
(cygwin_attach_handle_to_fd): Ditto.
(dtable::release): Remove special FH_SOCKET case in favor of generic
"need_fixup_before" test.
(dtable::init_std_file_from_handle): Use either build_fh_dev or build_fh_name
to build standard fhandler.
(dtable::build_fh_name): Renamed from dtable::build_fhandler_from_name. Move
out of dtable class. Don't accept a path_conv argument. Just build it here
and pass it to:
(build_fh_pc): Renamed from dtable::build_fhandler. Move out of dtable class.
Use intrinsic device type in path_conv to create new fhandler.
(build_fh_dev): Renamed from dtable::build_fhandler. Move out of dtable class.
Simplify arguments to just take new 'device' type and a name. Just return
pointer to fhandler rather than trying to insert into dtable.
(dtable::dup_worker): Accommodate above build_fh name changes.
(dtable::find_fifo): New (currently broken) function.
(handle_to_fn): Use strechr for efficiency.
* dtable.h: Reflect above build_fh name changes and argument differences.
(fhandler_base *&operator []): Return self rather than copy of self.
* fhandler.cc (fhandler_base::operator =): Use pc element to set normalized
path.
(fhandler_base::set_name): Ditto.
(fhandler_base::raw_read): Use method to access name.
(fhandler_base::write): Correctly use get_output_handle rather than get_handle.
(handler_base::device_access_denied): New function.
(fhandler_base::open): Eliminate pc argument and use pc element of
fhandler_base throughout.
(fhandler_base::fstat): Detect if device is based in filesystem and use
fstat_fs to calculate stat, if so.
(fhandler_base::fhandler_base): Eliminate handling of file names and, instead,
just free appropriate component from pc.
(fhandler_base::opendir): Remove path_conv parameter.
* fhandler.h: Remove all device flags.
(fhandler_base::pc): New element.
(fhandler_base::set_name): Change argument to path_conv.
(fhandler_base::error): New function.
(fhandler_base::exists): New function.
(fhandler_base::pc_binmode): New function.
(fhandler_base::dev): New function.
(fhandler_base::open_fs): New function.
(fhandler_base::fstat_fs): New function.
(fhandler_base::fstat_by_name): New function.
(fhandler_base::fstat_by_handle): New function.
(fhandler_base::isfifo): New function.
(fhandler_base::is_slow): New function.
(fhandler_base::is_auto_device): New function.
(fhandler_base::is_fs_special): New function.
(fhandler_base::device_access_denied): New function.
(fhandler_base::operator DWORD&): New operator.
(fhandler_base::get_name): Return normalized path from pc.
(fhandler_base::get_win32_name): Return windows path from pc.
(fhandler_base::isdevice): Renamed from is_device.
(fhandler_base::get_native_name): Return device format.
(fhandler_fifo): New class.
(fhandler_nodevice): New class.
(select_stuff::device_specific): Remove array.
(select_stuff::device_specific_pipe): New class element.
(select_stuff::device_specific_socket): New class element.
(select_stuff::device_specific_serial): New class element.
(select_stuff::select_stuff): Initialize new elements.
* fhandler_disk_file.cc (fhandler_base::fstat_by_handle): Move to base class
from fhandler_disk_file.
(fhandler_base::fstat_by_name): Ditto.
(fhandler_base::fstat_by_name): Ditto.
(fhandler_disk_file::open): Move most functionality into
fhandler_base::open_fs.
(fhandler_base::open_fs): New function.
(fhandler_disk_file::close): Move most functionality into
fhandler_base::close_fs.
(fhandler_base::close_fs): New function.
* fhandler_mem.cc (fhandler_dev_mem::open): Use device name in debugging
output.
* fhandler_socket.cc (fhandler_socket::set_connect_secret): Copy standard
urandom device into appropriate place.
(fhandler_socket::accept): Reflect change in fdsock return value.
* fhandler_tty.cc: See "throughouts" above.
* net.cc: Accommodate fdsock change throughout.
(fdsock): Return success or failure, accept fd argument and device argument.
* path.cc (symlink_info::major): New element.
(symlink_info::minor): New element.
(symlink_info::parse_device): Declare new function.
(fs_info::update): Accommodate changes in path_conv class.
(path_conv::fillin): Ditto.
(path_conv::return_and_clear_normalized_path): Eliminate.
(path_conv::set_normalized_path): New function.
(path_conv::path_conv): Set info in dev element. Use path_conv methods Check
for FH_FS rather than FH_BAD to indicate when to fill in filesystem stuff.
where appropriate rather than direct access. Use set_normalized_path to set
normalized path.
(windows_device_names): Eliminate.
(get_dev): Ditto.
(get_raw_device_number): Ditto.
(get_device_number): Ditto.
(win32_device_name): Call new device name parser to do most of the heavy
lifting.
(mount_info::conv_to_win32_path): Fill in dev field as appropriate.
(symlink_worker): Handle new device files.
(symlink_info::check): Ditto.
(symlink_info::parse_device): Define new function.
* path.h (executable_states): Move here from fhandler.h.
(fs_info): Rename variables to *_storage and create methods for accessing same.
(path_conv): Add dev element, remove devn and unit and adjust inline methods to
accommodate.
(set_normalized_path): Declare new function.
* pinfo.cc (_pinfo::commune_recv): Add broken support for handling fifos.
(_pinfo::commune_send): Ditto.
* pipe.cc (fhandler_pipe::close): check for existence of handle before closing
it.
(handler_pipe::create): Rename from make_pipe. Change arguments to accept
fhandler_pipe array. Accommodate fifos.
(pipe): Rework to deal with fhandler_pipe::create changes.
(_pipe): Ditto.
* select.cc: Use individual device_specific types throughout rather than
indexing with obsolete device number.
(set_bits): Use is_socket call rather than checking device number.
* shared_info.h (CURR_MOUNT_MAGIC): Update.
(conv_to_win32_path): Reflect addition of device argument.
* syscalls.cc (mknod_worker): New function.
(open): Use build_fh_name to build fhandler.
(chown_worker): Detect if this is an 'auto' device rather than an on-filesystem
device and handle appropriately.
(chmod_device): New function.
(chmod): Detect if this is an 'auto' device rather than an on-filesystem device
and handle appropriately. Use chmod_device to set mode of in-filesystem
devices.
(stat_worker): Eliminate path_conv argument. Call build_fh_name to construct
fhandler. Use fh->error() rather than pc->error to detect errors in fhandler
construction.
(access_worker): New function pulled from access. Accommodate in-filesystem
devices.
(access): Use access_worker.
(fpathconf): Detect if this is an 'auto' device rather than an on-filesystem
device and handle appropriately.
(mknod_worker): New function.
(mknod32): New function.
(chroot): Free normalized path -- assuming it was actually cmalloced.
* tty.cc (create_tty_master): Tweak for new device class.
(tty::common_init): Ditto.
* winsup.h (stat_worker): Remove.
(symlink_worker): Declare.
* exceptions.cc (set_process_mask): Just call sig_dispatch_pending and don't
worry about pending_signals since sig_dispatch_pending should always do the
right thing now.
(sig_handle): Reorganize SIGCONT handling to more closely conform to SUSv3.
* pinfo.h: Move __SIG enum to sigproc.h.
(PICOM_FIFO): New enum element.
(_pinfo): Remove 'thread2signal' stuff throughout class.
(_pinfo::commune_send): Make varargs.
(_pinfo::sigtodo): Eliminate.
(_pinfo::thread2signal): Ditto.
* signal.cc (kill_worker): Eliminate call to setthread2signal.
* sigproc.cc (local_sigtodo): Eliminate.
(getlocal_sigtodo): Ditto.
(sigelem): New class.
(pending_signals): New class.
(sigqueue): New variable, start of sigqueue linked list.
(sigcatch_nonmain): Eliminate.
(sigcatch_main): Eliminate.
(sigcatch_nosync): Eliminate.
(sigcomplete_nonmain): Eliminate.
(pending_signals): Eliminate.
(sig_clear): Call signal thread to clear pending signals, unless already in
signal thread.
(sigpending): Call signal thread to get pending signals.
(sig_dispatch_pending): Eliminate use of pending_signals and just check
sigqueue.
(sigproc_terminate): Eliminate all of the obsolete semaphore stuff. Close
signal pipe handle.
(sig_send): Eliminate all of the obsolete semaphore stuff and use pipe to send
signals.
(getevent): Eliminate.
(pending_signals::add): New function.
(pending_signals::del): New function.
(pending_signals::next): New function.
(wait_sig): Eliminate all of the obsolete semaphore stuff. Use pipe to
communicate and maintain a linked list of signals.
* sigproc.h: Move __SIG defines here. Add __SIGPENDING.
(sig_dispatch_pending): Remove "C" specifier.
(sig_handle): Accept a mask argument.
* thread.cc: Remove signal handling considerations throughout.
2003-09-25 08:37:18 +08:00
|
|
|
|
|
|
|
ifneq "${filter -O%,$(CFLAGS)}" ""
|
2015-04-05 06:31:03 +08:00
|
|
|
dtable_CFLAGS:=-fcheck-new
|
2020-05-25 19:50:36 +08:00
|
|
|
localtime_CFLAGS:=-fwrapv
|
2015-04-05 06:31:03 +08:00
|
|
|
malloc_CFLAGS:=-O3
|
|
|
|
sync_CFLAGS:=-O3
|
|
|
|
ifeq ($(target_cpu),i686)
|
|
|
|
# on x86, exceptions.cc must be compiled with a frame-pointer as it uses RtlCaptureContext()
|
|
|
|
exceptions_CFLAGS:=-fno-omit-frame-pointer
|
|
|
|
endif
|
* devices.cc: New file.
* devices.gperf: New file.
* devices.shilka: New file.
* cygwin-gperf: New file.
* cygwin-shilka: New file.
* fhandler_fifo.cc: New file.
* fhandler_nodevice.cc : New file. Reorganize headers so that path.h precedes
fhandler.h throughout. Remove device argument and unit arguments from fhandler
constructors throughout. Remove pc arguments to fhandler functions and use
internal pc element instead, throughout. Use dev element in pc throughout.
Use major/minor elements rather than units and device numbers previously in
fhandler class. Use correct methods for fhandler file names rather than
directly accessing file name variables, throughout.
* Makefile.in (DLL_OFILES): Add devices.o, fhandler_fifo.o
* dcrt0.cc (dll_crt0_1): Call device::init.
* devices.h: Renumber devices based on more Linux-like major/minor numbers.
Add more devices. Declare standard device storage.
(device): Declare struct.
* dir.cc (opendir): Use new 'build_fh_name' to construct a fhandler_* type.
* dtable.cc (dtable::get_debugger_info): Ditto.
(cygwin_attach_handle_to_fd): Ditto.
(dtable::release): Remove special FH_SOCKET case in favor of generic
"need_fixup_before" test.
(dtable::init_std_file_from_handle): Use either build_fh_dev or build_fh_name
to build standard fhandler.
(dtable::build_fh_name): Renamed from dtable::build_fhandler_from_name. Move
out of dtable class. Don't accept a path_conv argument. Just build it here
and pass it to:
(build_fh_pc): Renamed from dtable::build_fhandler. Move out of dtable class.
Use intrinsic device type in path_conv to create new fhandler.
(build_fh_dev): Renamed from dtable::build_fhandler. Move out of dtable class.
Simplify arguments to just take new 'device' type and a name. Just return
pointer to fhandler rather than trying to insert into dtable.
(dtable::dup_worker): Accommodate above build_fh name changes.
(dtable::find_fifo): New (currently broken) function.
(handle_to_fn): Use strechr for efficiency.
* dtable.h: Reflect above build_fh name changes and argument differences.
(fhandler_base *&operator []): Return self rather than copy of self.
* fhandler.cc (fhandler_base::operator =): Use pc element to set normalized
path.
(fhandler_base::set_name): Ditto.
(fhandler_base::raw_read): Use method to access name.
(fhandler_base::write): Correctly use get_output_handle rather than get_handle.
(handler_base::device_access_denied): New function.
(fhandler_base::open): Eliminate pc argument and use pc element of
fhandler_base throughout.
(fhandler_base::fstat): Detect if device is based in filesystem and use
fstat_fs to calculate stat, if so.
(fhandler_base::fhandler_base): Eliminate handling of file names and, instead,
just free appropriate component from pc.
(fhandler_base::opendir): Remove path_conv parameter.
* fhandler.h: Remove all device flags.
(fhandler_base::pc): New element.
(fhandler_base::set_name): Change argument to path_conv.
(fhandler_base::error): New function.
(fhandler_base::exists): New function.
(fhandler_base::pc_binmode): New function.
(fhandler_base::dev): New function.
(fhandler_base::open_fs): New function.
(fhandler_base::fstat_fs): New function.
(fhandler_base::fstat_by_name): New function.
(fhandler_base::fstat_by_handle): New function.
(fhandler_base::isfifo): New function.
(fhandler_base::is_slow): New function.
(fhandler_base::is_auto_device): New function.
(fhandler_base::is_fs_special): New function.
(fhandler_base::device_access_denied): New function.
(fhandler_base::operator DWORD&): New operator.
(fhandler_base::get_name): Return normalized path from pc.
(fhandler_base::get_win32_name): Return windows path from pc.
(fhandler_base::isdevice): Renamed from is_device.
(fhandler_base::get_native_name): Return device format.
(fhandler_fifo): New class.
(fhandler_nodevice): New class.
(select_stuff::device_specific): Remove array.
(select_stuff::device_specific_pipe): New class element.
(select_stuff::device_specific_socket): New class element.
(select_stuff::device_specific_serial): New class element.
(select_stuff::select_stuff): Initialize new elements.
* fhandler_disk_file.cc (fhandler_base::fstat_by_handle): Move to base class
from fhandler_disk_file.
(fhandler_base::fstat_by_name): Ditto.
(fhandler_base::fstat_by_name): Ditto.
(fhandler_disk_file::open): Move most functionality into
fhandler_base::open_fs.
(fhandler_base::open_fs): New function.
(fhandler_disk_file::close): Move most functionality into
fhandler_base::close_fs.
(fhandler_base::close_fs): New function.
* fhandler_mem.cc (fhandler_dev_mem::open): Use device name in debugging
output.
* fhandler_socket.cc (fhandler_socket::set_connect_secret): Copy standard
urandom device into appropriate place.
(fhandler_socket::accept): Reflect change in fdsock return value.
* fhandler_tty.cc: See "throughouts" above.
* net.cc: Accommodate fdsock change throughout.
(fdsock): Return success or failure, accept fd argument and device argument.
* path.cc (symlink_info::major): New element.
(symlink_info::minor): New element.
(symlink_info::parse_device): Declare new function.
(fs_info::update): Accommodate changes in path_conv class.
(path_conv::fillin): Ditto.
(path_conv::return_and_clear_normalized_path): Eliminate.
(path_conv::set_normalized_path): New function.
(path_conv::path_conv): Set info in dev element. Use path_conv methods Check
for FH_FS rather than FH_BAD to indicate when to fill in filesystem stuff.
where appropriate rather than direct access. Use set_normalized_path to set
normalized path.
(windows_device_names): Eliminate.
(get_dev): Ditto.
(get_raw_device_number): Ditto.
(get_device_number): Ditto.
(win32_device_name): Call new device name parser to do most of the heavy
lifting.
(mount_info::conv_to_win32_path): Fill in dev field as appropriate.
(symlink_worker): Handle new device files.
(symlink_info::check): Ditto.
(symlink_info::parse_device): Define new function.
* path.h (executable_states): Move here from fhandler.h.
(fs_info): Rename variables to *_storage and create methods for accessing same.
(path_conv): Add dev element, remove devn and unit and adjust inline methods to
accommodate.
(set_normalized_path): Declare new function.
* pinfo.cc (_pinfo::commune_recv): Add broken support for handling fifos.
(_pinfo::commune_send): Ditto.
* pipe.cc (fhandler_pipe::close): check for existence of handle before closing
it.
(handler_pipe::create): Rename from make_pipe. Change arguments to accept
fhandler_pipe array. Accommodate fifos.
(pipe): Rework to deal with fhandler_pipe::create changes.
(_pipe): Ditto.
* select.cc: Use individual device_specific types throughout rather than
indexing with obsolete device number.
(set_bits): Use is_socket call rather than checking device number.
* shared_info.h (CURR_MOUNT_MAGIC): Update.
(conv_to_win32_path): Reflect addition of device argument.
* syscalls.cc (mknod_worker): New function.
(open): Use build_fh_name to build fhandler.
(chown_worker): Detect if this is an 'auto' device rather than an on-filesystem
device and handle appropriately.
(chmod_device): New function.
(chmod): Detect if this is an 'auto' device rather than an on-filesystem device
and handle appropriately. Use chmod_device to set mode of in-filesystem
devices.
(stat_worker): Eliminate path_conv argument. Call build_fh_name to construct
fhandler. Use fh->error() rather than pc->error to detect errors in fhandler
construction.
(access_worker): New function pulled from access. Accommodate in-filesystem
devices.
(access): Use access_worker.
(fpathconf): Detect if this is an 'auto' device rather than an on-filesystem
device and handle appropriately.
(mknod_worker): New function.
(mknod32): New function.
(chroot): Free normalized path -- assuming it was actually cmalloced.
* tty.cc (create_tty_master): Tweak for new device class.
(tty::common_init): Ditto.
* winsup.h (stat_worker): Remove.
(symlink_worker): Declare.
* exceptions.cc (set_process_mask): Just call sig_dispatch_pending and don't
worry about pending_signals since sig_dispatch_pending should always do the
right thing now.
(sig_handle): Reorganize SIGCONT handling to more closely conform to SUSv3.
* pinfo.h: Move __SIG enum to sigproc.h.
(PICOM_FIFO): New enum element.
(_pinfo): Remove 'thread2signal' stuff throughout class.
(_pinfo::commune_send): Make varargs.
(_pinfo::sigtodo): Eliminate.
(_pinfo::thread2signal): Ditto.
* signal.cc (kill_worker): Eliminate call to setthread2signal.
* sigproc.cc (local_sigtodo): Eliminate.
(getlocal_sigtodo): Ditto.
(sigelem): New class.
(pending_signals): New class.
(sigqueue): New variable, start of sigqueue linked list.
(sigcatch_nonmain): Eliminate.
(sigcatch_main): Eliminate.
(sigcatch_nosync): Eliminate.
(sigcomplete_nonmain): Eliminate.
(pending_signals): Eliminate.
(sig_clear): Call signal thread to clear pending signals, unless already in
signal thread.
(sigpending): Call signal thread to get pending signals.
(sig_dispatch_pending): Eliminate use of pending_signals and just check
sigqueue.
(sigproc_terminate): Eliminate all of the obsolete semaphore stuff. Close
signal pipe handle.
(sig_send): Eliminate all of the obsolete semaphore stuff and use pipe to send
signals.
(getevent): Eliminate.
(pending_signals::add): New function.
(pending_signals::del): New function.
(pending_signals::next): New function.
(wait_sig): Eliminate all of the obsolete semaphore stuff. Use pipe to
communicate and maintain a linked list of signals.
* sigproc.h: Move __SIG defines here. Add __SIGPENDING.
(sig_dispatch_pending): Remove "C" specifier.
(sig_handle): Accept a mask argument.
* thread.cc: Remove signal handling considerations throughout.
2003-09-25 08:37:18 +08:00
|
|
|
endif
|
2020-02-27 00:02:01 +08:00
|
|
|
# required since gcc 9.x
|
|
|
|
exec_CFLAGS:=-fno-builtin-execve
|
* devices.cc: New file.
* devices.gperf: New file.
* devices.shilka: New file.
* cygwin-gperf: New file.
* cygwin-shilka: New file.
* fhandler_fifo.cc: New file.
* fhandler_nodevice.cc : New file. Reorganize headers so that path.h precedes
fhandler.h throughout. Remove device argument and unit arguments from fhandler
constructors throughout. Remove pc arguments to fhandler functions and use
internal pc element instead, throughout. Use dev element in pc throughout.
Use major/minor elements rather than units and device numbers previously in
fhandler class. Use correct methods for fhandler file names rather than
directly accessing file name variables, throughout.
* Makefile.in (DLL_OFILES): Add devices.o, fhandler_fifo.o
* dcrt0.cc (dll_crt0_1): Call device::init.
* devices.h: Renumber devices based on more Linux-like major/minor numbers.
Add more devices. Declare standard device storage.
(device): Declare struct.
* dir.cc (opendir): Use new 'build_fh_name' to construct a fhandler_* type.
* dtable.cc (dtable::get_debugger_info): Ditto.
(cygwin_attach_handle_to_fd): Ditto.
(dtable::release): Remove special FH_SOCKET case in favor of generic
"need_fixup_before" test.
(dtable::init_std_file_from_handle): Use either build_fh_dev or build_fh_name
to build standard fhandler.
(dtable::build_fh_name): Renamed from dtable::build_fhandler_from_name. Move
out of dtable class. Don't accept a path_conv argument. Just build it here
and pass it to:
(build_fh_pc): Renamed from dtable::build_fhandler. Move out of dtable class.
Use intrinsic device type in path_conv to create new fhandler.
(build_fh_dev): Renamed from dtable::build_fhandler. Move out of dtable class.
Simplify arguments to just take new 'device' type and a name. Just return
pointer to fhandler rather than trying to insert into dtable.
(dtable::dup_worker): Accommodate above build_fh name changes.
(dtable::find_fifo): New (currently broken) function.
(handle_to_fn): Use strechr for efficiency.
* dtable.h: Reflect above build_fh name changes and argument differences.
(fhandler_base *&operator []): Return self rather than copy of self.
* fhandler.cc (fhandler_base::operator =): Use pc element to set normalized
path.
(fhandler_base::set_name): Ditto.
(fhandler_base::raw_read): Use method to access name.
(fhandler_base::write): Correctly use get_output_handle rather than get_handle.
(handler_base::device_access_denied): New function.
(fhandler_base::open): Eliminate pc argument and use pc element of
fhandler_base throughout.
(fhandler_base::fstat): Detect if device is based in filesystem and use
fstat_fs to calculate stat, if so.
(fhandler_base::fhandler_base): Eliminate handling of file names and, instead,
just free appropriate component from pc.
(fhandler_base::opendir): Remove path_conv parameter.
* fhandler.h: Remove all device flags.
(fhandler_base::pc): New element.
(fhandler_base::set_name): Change argument to path_conv.
(fhandler_base::error): New function.
(fhandler_base::exists): New function.
(fhandler_base::pc_binmode): New function.
(fhandler_base::dev): New function.
(fhandler_base::open_fs): New function.
(fhandler_base::fstat_fs): New function.
(fhandler_base::fstat_by_name): New function.
(fhandler_base::fstat_by_handle): New function.
(fhandler_base::isfifo): New function.
(fhandler_base::is_slow): New function.
(fhandler_base::is_auto_device): New function.
(fhandler_base::is_fs_special): New function.
(fhandler_base::device_access_denied): New function.
(fhandler_base::operator DWORD&): New operator.
(fhandler_base::get_name): Return normalized path from pc.
(fhandler_base::get_win32_name): Return windows path from pc.
(fhandler_base::isdevice): Renamed from is_device.
(fhandler_base::get_native_name): Return device format.
(fhandler_fifo): New class.
(fhandler_nodevice): New class.
(select_stuff::device_specific): Remove array.
(select_stuff::device_specific_pipe): New class element.
(select_stuff::device_specific_socket): New class element.
(select_stuff::device_specific_serial): New class element.
(select_stuff::select_stuff): Initialize new elements.
* fhandler_disk_file.cc (fhandler_base::fstat_by_handle): Move to base class
from fhandler_disk_file.
(fhandler_base::fstat_by_name): Ditto.
(fhandler_base::fstat_by_name): Ditto.
(fhandler_disk_file::open): Move most functionality into
fhandler_base::open_fs.
(fhandler_base::open_fs): New function.
(fhandler_disk_file::close): Move most functionality into
fhandler_base::close_fs.
(fhandler_base::close_fs): New function.
* fhandler_mem.cc (fhandler_dev_mem::open): Use device name in debugging
output.
* fhandler_socket.cc (fhandler_socket::set_connect_secret): Copy standard
urandom device into appropriate place.
(fhandler_socket::accept): Reflect change in fdsock return value.
* fhandler_tty.cc: See "throughouts" above.
* net.cc: Accommodate fdsock change throughout.
(fdsock): Return success or failure, accept fd argument and device argument.
* path.cc (symlink_info::major): New element.
(symlink_info::minor): New element.
(symlink_info::parse_device): Declare new function.
(fs_info::update): Accommodate changes in path_conv class.
(path_conv::fillin): Ditto.
(path_conv::return_and_clear_normalized_path): Eliminate.
(path_conv::set_normalized_path): New function.
(path_conv::path_conv): Set info in dev element. Use path_conv methods Check
for FH_FS rather than FH_BAD to indicate when to fill in filesystem stuff.
where appropriate rather than direct access. Use set_normalized_path to set
normalized path.
(windows_device_names): Eliminate.
(get_dev): Ditto.
(get_raw_device_number): Ditto.
(get_device_number): Ditto.
(win32_device_name): Call new device name parser to do most of the heavy
lifting.
(mount_info::conv_to_win32_path): Fill in dev field as appropriate.
(symlink_worker): Handle new device files.
(symlink_info::check): Ditto.
(symlink_info::parse_device): Define new function.
* path.h (executable_states): Move here from fhandler.h.
(fs_info): Rename variables to *_storage and create methods for accessing same.
(path_conv): Add dev element, remove devn and unit and adjust inline methods to
accommodate.
(set_normalized_path): Declare new function.
* pinfo.cc (_pinfo::commune_recv): Add broken support for handling fifos.
(_pinfo::commune_send): Ditto.
* pipe.cc (fhandler_pipe::close): check for existence of handle before closing
it.
(handler_pipe::create): Rename from make_pipe. Change arguments to accept
fhandler_pipe array. Accommodate fifos.
(pipe): Rework to deal with fhandler_pipe::create changes.
(_pipe): Ditto.
* select.cc: Use individual device_specific types throughout rather than
indexing with obsolete device number.
(set_bits): Use is_socket call rather than checking device number.
* shared_info.h (CURR_MOUNT_MAGIC): Update.
(conv_to_win32_path): Reflect addition of device argument.
* syscalls.cc (mknod_worker): New function.
(open): Use build_fh_name to build fhandler.
(chown_worker): Detect if this is an 'auto' device rather than an on-filesystem
device and handle appropriately.
(chmod_device): New function.
(chmod): Detect if this is an 'auto' device rather than an on-filesystem device
and handle appropriately. Use chmod_device to set mode of in-filesystem
devices.
(stat_worker): Eliminate path_conv argument. Call build_fh_name to construct
fhandler. Use fh->error() rather than pc->error to detect errors in fhandler
construction.
(access_worker): New function pulled from access. Accommodate in-filesystem
devices.
(access): Use access_worker.
(fpathconf): Detect if this is an 'auto' device rather than an on-filesystem
device and handle appropriately.
(mknod_worker): New function.
(mknod32): New function.
(chroot): Free normalized path -- assuming it was actually cmalloced.
* tty.cc (create_tty_master): Tweak for new device class.
(tty::common_init): Ditto.
* winsup.h (stat_worker): Remove.
(symlink_worker): Declare.
* exceptions.cc (set_process_mask): Just call sig_dispatch_pending and don't
worry about pending_signals since sig_dispatch_pending should always do the
right thing now.
(sig_handle): Reorganize SIGCONT handling to more closely conform to SUSv3.
* pinfo.h: Move __SIG enum to sigproc.h.
(PICOM_FIFO): New enum element.
(_pinfo): Remove 'thread2signal' stuff throughout class.
(_pinfo::commune_send): Make varargs.
(_pinfo::sigtodo): Eliminate.
(_pinfo::thread2signal): Ditto.
* signal.cc (kill_worker): Eliminate call to setthread2signal.
* sigproc.cc (local_sigtodo): Eliminate.
(getlocal_sigtodo): Ditto.
(sigelem): New class.
(pending_signals): New class.
(sigqueue): New variable, start of sigqueue linked list.
(sigcatch_nonmain): Eliminate.
(sigcatch_main): Eliminate.
(sigcatch_nosync): Eliminate.
(sigcomplete_nonmain): Eliminate.
(pending_signals): Eliminate.
(sig_clear): Call signal thread to clear pending signals, unless already in
signal thread.
(sigpending): Call signal thread to get pending signals.
(sig_dispatch_pending): Eliminate use of pending_signals and just check
sigqueue.
(sigproc_terminate): Eliminate all of the obsolete semaphore stuff. Close
signal pipe handle.
(sig_send): Eliminate all of the obsolete semaphore stuff and use pipe to send
signals.
(getevent): Eliminate.
(pending_signals::add): New function.
(pending_signals::del): New function.
(pending_signals::next): New function.
(wait_sig): Eliminate all of the obsolete semaphore stuff. Use pipe to
communicate and maintain a linked list of signals.
* sigproc.h: Move __SIG defines here. Add __SIGPENDING.
(sig_dispatch_pending): Remove "C" specifier.
(sig_handle): Accept a mask argument.
* thread.cc: Remove signal handling considerations throughout.
2003-09-25 08:37:18 +08:00
|
|
|
|
2011-04-04 19:12:48 +08:00
|
|
|
fhandler_proc_CFLAGS+=-DUSERNAME="\"$(USER)\"" -DHOSTNAME="\"$(HOSTNAME)\""
|
|
|
|
fhandler_proc_CFLAGS+=-DGCC_VERSION="\"`$(CC) -v 2>&1 | tail -n 1`\""
|
|
|
|
|
2020-10-26 21:56:51 +08:00
|
|
|
.PHONY: all force dll_ofiles install \
|
2020-10-16 22:06:43 +08:00
|
|
|
install install-libs install-headers \
|
2016-06-06 00:58:22 +08:00
|
|
|
clean distclean realclean maintainer-clean
|
2000-02-18 03:38:33 +08:00
|
|
|
|
2020-10-26 21:56:51 +08:00
|
|
|
all: $(TARGET_LIBS) $(TEST_LIB_NAME)
|
2000-02-18 03:38:33 +08:00
|
|
|
|
|
|
|
force:
|
|
|
|
|
2020-10-19 21:34:35 +08:00
|
|
|
install: install-libs install-headers install-man install-ldif
|
2001-07-29 10:33:30 +08:00
|
|
|
|
2002-05-18 14:10:16 +08:00
|
|
|
uninstall: uninstall-libs uninstall-headers uninstall-man
|
2002-01-08 12:51:01 +08:00
|
|
|
|
2001-12-31 11:19:29 +08:00
|
|
|
install-libs: $(TARGET_LIBS)
|
2020-08-27 20:02:46 +08:00
|
|
|
@$(MKDIRP) $(DESTDIR)$(bindir) $(DESTDIR)$(tooldir)/lib
|
2009-02-24 10:11:14 +08:00
|
|
|
$(INSTALL_PROGRAM) $(TEST_DLL_NAME) $(DESTDIR)$(bindir)/$(DLL_NAME); \
|
2001-12-31 11:19:29 +08:00
|
|
|
for i in $^; do \
|
2009-02-24 10:11:14 +08:00
|
|
|
$(INSTALL_DATA) $$i $(DESTDIR)$(tooldir)/lib/`basename $$i` ; \
|
2001-07-29 10:33:30 +08:00
|
|
|
done
|
2009-02-24 10:11:14 +08:00
|
|
|
cd $(DESTDIR)$(tooldir)/lib && ln -sf libcygwin.a libg.a
|
2001-07-29 10:33:30 +08:00
|
|
|
|
|
|
|
install-headers:
|
2000-02-18 03:38:33 +08:00
|
|
|
cd $(srcdir); \
|
|
|
|
for sub in `find include -name '[a-z]*' -type d -print | sort`; do \
|
2009-02-24 10:11:14 +08:00
|
|
|
$(MKDIRP) $(DESTDIR)$(tooldir)/$$sub; \
|
2000-02-18 03:38:33 +08:00
|
|
|
for i in $$sub/*.h ; do \
|
2009-02-24 10:11:14 +08:00
|
|
|
$(INSTALL_DATA) $$i $(DESTDIR)$(tooldir)/$$sub/`basename $$i` ; \
|
2000-02-18 03:38:33 +08:00
|
|
|
done ; \
|
2000-04-27 02:19:22 +08:00
|
|
|
done ; \
|
2001-12-20 10:55:11 +08:00
|
|
|
|
|
|
|
install-man:
|
2009-02-24 10:11:14 +08:00
|
|
|
@$(MKDIRP) $(DESTDIR)$(mandir)/man2 $(DESTDIR)$(mandir)/man3 $(DESTDIR)$(mandir)/man5 $(DESTDIR)$(mandir)/man7
|
2001-12-20 10:55:11 +08:00
|
|
|
cd $(srcdir); \
|
2015-06-19 04:04:58 +08:00
|
|
|
for i in `find . -type f ! -path './release/*' -name '*.2'`; do \
|
2009-02-24 10:11:14 +08:00
|
|
|
$(INSTALL_DATA) $$i $(DESTDIR)$(mandir)/man2/`basename $$i` ; \
|
2001-12-20 10:55:11 +08:00
|
|
|
done; \
|
2015-06-19 04:04:58 +08:00
|
|
|
for i in `find . -type f ! -path './release/*' -name '*.3'`; do \
|
2009-02-24 10:11:14 +08:00
|
|
|
$(INSTALL_DATA) $$i $(DESTDIR)$(mandir)/man3/`basename $$i` ; \
|
2001-12-20 10:55:11 +08:00
|
|
|
done; \
|
2015-06-19 04:04:58 +08:00
|
|
|
for i in `find . -type f ! -path './release/*' -name '*.5'`; do \
|
2009-02-24 10:11:14 +08:00
|
|
|
$(INSTALL_DATA) $$i $(DESTDIR)$(mandir)/man5/`basename $$i` ; \
|
2001-12-20 10:55:11 +08:00
|
|
|
done; \
|
2015-06-19 04:04:58 +08:00
|
|
|
for i in `find . -type f ! -path './release/*' -name '*.7'`; do \
|
2009-02-24 10:11:14 +08:00
|
|
|
$(INSTALL_DATA) $$i $(DESTDIR)$(mandir)/man7/`basename $$i` ; \
|
2001-12-20 10:55:11 +08:00
|
|
|
done
|
2000-02-18 03:38:33 +08:00
|
|
|
|
2014-11-27 03:46:59 +08:00
|
|
|
install-ldif:
|
|
|
|
@$(MKDIRP) $(DESTDIR)$(datarootdir)/cygwin
|
|
|
|
$(INSTALL_DATA) $(srcdir)/cygwin.ldif $(DESTDIR)$(datarootdir)/cygwin
|
|
|
|
|
2002-01-08 12:51:01 +08:00
|
|
|
uninstall-libs: $(TARGET_LIBS)
|
|
|
|
rm -f $(bindir)/$(DLL_NAME); \
|
|
|
|
for i in $^; do \
|
|
|
|
rm -f $(tooldir)/lib/$$i ; \
|
|
|
|
done
|
|
|
|
|
|
|
|
uninstall-headers:
|
|
|
|
cd $(srcdir); \
|
|
|
|
for sub in `find include -name '[a-z]*' -type d -print | sort`; do \
|
|
|
|
for i in $$sub/*.h ; do \
|
|
|
|
rm -f $(tooldir)/$$sub/`basename $$i` ; \
|
|
|
|
done ; \
|
|
|
|
done ; \
|
|
|
|
|
|
|
|
uninstall-man:
|
|
|
|
cd $(srcdir); \
|
|
|
|
for i in `find . -type f -name '*.2'`; do \
|
2013-04-23 17:44:36 +08:00
|
|
|
rm -f $(DESTDIR)$(mandir)/man2/`basename $$i` ; \
|
2002-01-08 12:51:01 +08:00
|
|
|
done; \
|
|
|
|
for i in `find . -type f -name '*.3'`; do \
|
2013-04-23 17:44:36 +08:00
|
|
|
rm -f $(DESTDIR)$(mandir)/man3/`basename $$i` ; \
|
2002-01-08 12:51:01 +08:00
|
|
|
done; \
|
|
|
|
for i in `find . -type f -name '*.5'`; do \
|
2013-04-23 17:44:36 +08:00
|
|
|
rm -f $(DESTDIR)$(mandir)/man5/`basename $$i` ; \
|
2002-01-08 12:51:01 +08:00
|
|
|
done; \
|
|
|
|
for i in `find . -type f -name '*.7'`; do \
|
2013-04-23 17:44:36 +08:00
|
|
|
rm -f $(DESTDIR)$(mandir)/man7/`basename $$i` ; \
|
2002-01-08 12:51:01 +08:00
|
|
|
done
|
|
|
|
|
2016-06-06 00:58:22 +08:00
|
|
|
clean distclean realclean:
|
2020-05-26 16:19:35 +08:00
|
|
|
-rm -f *.o *.dll *.dbg *.a *.exp junk *.base version.cc *.exe *.d \
|
|
|
|
*stamp* *_magic.h sigfe.s cygwin.def cygwin.map cygwin.sc \
|
|
|
|
globals.h localtime.patched.c
|
2012-11-23 21:22:47 +08:00
|
|
|
-@$(MAKE) -C ${cygserver_blddir} libclean
|
2000-02-18 03:38:33 +08:00
|
|
|
|
2016-06-06 00:58:22 +08:00
|
|
|
maintainer-clean: clean
|
2000-02-18 03:38:33 +08:00
|
|
|
@echo "This command is intended for maintainers to use;"
|
|
|
|
@echo "it deletes files that may require special tools to rebuild."
|
|
|
|
-rm -fr configure
|
2016-06-06 00:58:22 +08:00
|
|
|
-rm -f $(srcdir)/$(TLSOFFSETS_H) $(srcdir)/devices.cc
|
2000-02-18 03:38:33 +08:00
|
|
|
|
2013-04-23 17:44:36 +08:00
|
|
|
# Rule to build LDSCRIPT
|
|
|
|
$(LDSCRIPT): $(LDSCRIPT).in
|
|
|
|
$(CC) -E - -P < $^ -o $@
|
2000-02-18 03:38:33 +08:00
|
|
|
|
|
|
|
# Rule to build cygwin.dll
|
2015-01-28 19:43:06 +08:00
|
|
|
$(TEST_DLL_NAME): $(LDSCRIPT) dllfixdbg $(DLL_OFILES) $(LIBSERVER) $(LIBC) $(LIBM) $(API_VER) Makefile $(VERSION_OFILES)
|
2013-05-25 05:12:16 +08:00
|
|
|
$(CXX) $(CXXFLAGS) \
|
2020-10-14 23:49:45 +08:00
|
|
|
-mno-use-libstdc-wrappers \
|
2020-10-04 04:39:40 +08:00
|
|
|
-Wl,--gc-sections -nostdlib -Wl,-T$(firstword $^) -static \
|
2005-06-12 05:00:23 +08:00
|
|
|
-Wl,--heap=0 -Wl,--out-implib,cygdll.a -shared -o $@ \
|
2015-01-28 19:43:06 +08:00
|
|
|
-e $(DLL_ENTRY) $(DEF_FILE) $(DLL_OFILES) $(VERSION_OFILES) \
|
2003-08-26 02:21:07 +08:00
|
|
|
$(MALLOC_OBJ) $(LIBSERVER) $(LIBM) $(LIBC) \
|
2009-01-03 13:12:22 +08:00
|
|
|
-lgcc $(DLL_IMPORTS) -Wl,-Map,cygwin.map
|
2016-06-26 00:08:18 +08:00
|
|
|
@$(word 2,$^) $(OBJDUMP) $(OBJCOPY) $@ ${patsubst %0.dll,%1.dbg,$@}
|
2003-03-10 01:01:41 +08:00
|
|
|
@ln -f $@ new-$(DLL_NAME)
|
2000-02-18 03:38:33 +08:00
|
|
|
|
2001-12-20 10:55:11 +08:00
|
|
|
# Rule to build libcygwin.a
|
2013-04-23 17:44:36 +08:00
|
|
|
$(LIB_NAME): $(DEF_FILE) $(LIBCOS) | $(TEST_DLL_NAME)
|
|
|
|
${srcdir}/mkimport ${toolopts} ${NEW_FUNCTIONS} $@ cygdll.a $(wordlist 2,99,$^)
|
2001-09-25 06:49:12 +08:00
|
|
|
|
2001-12-20 10:55:11 +08:00
|
|
|
# Rule to make stub library used by testsuite
|
|
|
|
# dependency set to $(LIB_NAME) to accommodate make -j2.
|
2003-03-10 01:01:41 +08:00
|
|
|
$(TEST_LIB_NAME): $(LIB_NAME)
|
|
|
|
perl -p -e 'BEGIN{binmode(STDIN); binmode(STDOUT);}; s/cygwin1/cygwin0/g' < $? > $@
|
2001-10-01 05:10:38 +08:00
|
|
|
|
2012-11-23 21:22:47 +08:00
|
|
|
$(LIBSERVER): ${cygserver_blddir}/Makefile
|
|
|
|
$(MAKE) -C ${cygserver_blddir} libcygserver.a
|
|
|
|
|
2000-02-18 03:38:33 +08:00
|
|
|
dll_ofiles: $(DLL_OFILES)
|
|
|
|
|
2020-11-20 05:34:44 +08:00
|
|
|
$(LIBGMON_A): $(GMON_OFILES)
|
2000-02-18 03:38:33 +08:00
|
|
|
$(AR) rcv $(LIBGMON_A) $(GMON_OFILES)
|
|
|
|
|
2009-01-03 13:12:22 +08:00
|
|
|
globals.h: mkglobals_h globals.cc
|
|
|
|
$^ > $@
|
|
|
|
|
2016-03-30 20:35:46 +08:00
|
|
|
${DLL_OFILES} ${LIBCOS}: globals.h $(srcdir)/$(TLSOFFSETS_H)
|
2009-01-03 13:12:22 +08:00
|
|
|
|
2001-12-26 12:53:34 +08:00
|
|
|
shared_info_magic.h: cygmagic shared_info.h
|
2012-11-23 21:22:47 +08:00
|
|
|
/bin/sh $(word 1,$^) $@ "${COMPILE.cc} -E -x c++" $(word 2,$^) SHARED_MAGIC 'class shared_info' USER_MAGIC 'class user_info'
|
2001-12-26 12:53:34 +08:00
|
|
|
|
|
|
|
child_info_magic.h: cygmagic child_info.h
|
2012-11-23 21:22:47 +08:00
|
|
|
/bin/sh $(word 1,$^) $@ "${COMPILE.cc} -E -x c++" $(word 2,$^) CHILD_INFO_MAGIC 'class child_info'
|
2001-12-26 12:53:34 +08:00
|
|
|
|
|
|
|
dcrt0.o sigproc.o: child_info_magic.h
|
|
|
|
|
|
|
|
shared.o: shared_info_magic.h
|
|
|
|
|
2020-05-25 23:40:27 +08:00
|
|
|
localtime.patched.c: tzcode/localtime.c tzcode/localtime.c.patch
|
|
|
|
patch -u -o localtime.patched.c \
|
|
|
|
$(srcdir)/tzcode/localtime.c \
|
|
|
|
$(srcdir)/tzcode/localtime.c.patch
|
|
|
|
|
|
|
|
localtime.o: tzcode/localtime_wrapper.c localtime.patched.c
|
2020-05-25 19:50:36 +08:00
|
|
|
$(CC) ${COMMON_CFLAGS} ${localtime_CFLAGS} \
|
2020-05-25 19:45:17 +08:00
|
|
|
-I$(target_builddir)/winsup/cygwin \
|
|
|
|
-I$(srcdir) -I$(srcdir)/tzcode -c -o $@ $<
|
|
|
|
|
2003-10-01 20:36:39 +08:00
|
|
|
$(srcdir)/devices.cc: gendevices devices.in devices.h
|
* devices.cc: New file.
* devices.gperf: New file.
* devices.shilka: New file.
* cygwin-gperf: New file.
* cygwin-shilka: New file.
* fhandler_fifo.cc: New file.
* fhandler_nodevice.cc : New file. Reorganize headers so that path.h precedes
fhandler.h throughout. Remove device argument and unit arguments from fhandler
constructors throughout. Remove pc arguments to fhandler functions and use
internal pc element instead, throughout. Use dev element in pc throughout.
Use major/minor elements rather than units and device numbers previously in
fhandler class. Use correct methods for fhandler file names rather than
directly accessing file name variables, throughout.
* Makefile.in (DLL_OFILES): Add devices.o, fhandler_fifo.o
* dcrt0.cc (dll_crt0_1): Call device::init.
* devices.h: Renumber devices based on more Linux-like major/minor numbers.
Add more devices. Declare standard device storage.
(device): Declare struct.
* dir.cc (opendir): Use new 'build_fh_name' to construct a fhandler_* type.
* dtable.cc (dtable::get_debugger_info): Ditto.
(cygwin_attach_handle_to_fd): Ditto.
(dtable::release): Remove special FH_SOCKET case in favor of generic
"need_fixup_before" test.
(dtable::init_std_file_from_handle): Use either build_fh_dev or build_fh_name
to build standard fhandler.
(dtable::build_fh_name): Renamed from dtable::build_fhandler_from_name. Move
out of dtable class. Don't accept a path_conv argument. Just build it here
and pass it to:
(build_fh_pc): Renamed from dtable::build_fhandler. Move out of dtable class.
Use intrinsic device type in path_conv to create new fhandler.
(build_fh_dev): Renamed from dtable::build_fhandler. Move out of dtable class.
Simplify arguments to just take new 'device' type and a name. Just return
pointer to fhandler rather than trying to insert into dtable.
(dtable::dup_worker): Accommodate above build_fh name changes.
(dtable::find_fifo): New (currently broken) function.
(handle_to_fn): Use strechr for efficiency.
* dtable.h: Reflect above build_fh name changes and argument differences.
(fhandler_base *&operator []): Return self rather than copy of self.
* fhandler.cc (fhandler_base::operator =): Use pc element to set normalized
path.
(fhandler_base::set_name): Ditto.
(fhandler_base::raw_read): Use method to access name.
(fhandler_base::write): Correctly use get_output_handle rather than get_handle.
(handler_base::device_access_denied): New function.
(fhandler_base::open): Eliminate pc argument and use pc element of
fhandler_base throughout.
(fhandler_base::fstat): Detect if device is based in filesystem and use
fstat_fs to calculate stat, if so.
(fhandler_base::fhandler_base): Eliminate handling of file names and, instead,
just free appropriate component from pc.
(fhandler_base::opendir): Remove path_conv parameter.
* fhandler.h: Remove all device flags.
(fhandler_base::pc): New element.
(fhandler_base::set_name): Change argument to path_conv.
(fhandler_base::error): New function.
(fhandler_base::exists): New function.
(fhandler_base::pc_binmode): New function.
(fhandler_base::dev): New function.
(fhandler_base::open_fs): New function.
(fhandler_base::fstat_fs): New function.
(fhandler_base::fstat_by_name): New function.
(fhandler_base::fstat_by_handle): New function.
(fhandler_base::isfifo): New function.
(fhandler_base::is_slow): New function.
(fhandler_base::is_auto_device): New function.
(fhandler_base::is_fs_special): New function.
(fhandler_base::device_access_denied): New function.
(fhandler_base::operator DWORD&): New operator.
(fhandler_base::get_name): Return normalized path from pc.
(fhandler_base::get_win32_name): Return windows path from pc.
(fhandler_base::isdevice): Renamed from is_device.
(fhandler_base::get_native_name): Return device format.
(fhandler_fifo): New class.
(fhandler_nodevice): New class.
(select_stuff::device_specific): Remove array.
(select_stuff::device_specific_pipe): New class element.
(select_stuff::device_specific_socket): New class element.
(select_stuff::device_specific_serial): New class element.
(select_stuff::select_stuff): Initialize new elements.
* fhandler_disk_file.cc (fhandler_base::fstat_by_handle): Move to base class
from fhandler_disk_file.
(fhandler_base::fstat_by_name): Ditto.
(fhandler_base::fstat_by_name): Ditto.
(fhandler_disk_file::open): Move most functionality into
fhandler_base::open_fs.
(fhandler_base::open_fs): New function.
(fhandler_disk_file::close): Move most functionality into
fhandler_base::close_fs.
(fhandler_base::close_fs): New function.
* fhandler_mem.cc (fhandler_dev_mem::open): Use device name in debugging
output.
* fhandler_socket.cc (fhandler_socket::set_connect_secret): Copy standard
urandom device into appropriate place.
(fhandler_socket::accept): Reflect change in fdsock return value.
* fhandler_tty.cc: See "throughouts" above.
* net.cc: Accommodate fdsock change throughout.
(fdsock): Return success or failure, accept fd argument and device argument.
* path.cc (symlink_info::major): New element.
(symlink_info::minor): New element.
(symlink_info::parse_device): Declare new function.
(fs_info::update): Accommodate changes in path_conv class.
(path_conv::fillin): Ditto.
(path_conv::return_and_clear_normalized_path): Eliminate.
(path_conv::set_normalized_path): New function.
(path_conv::path_conv): Set info in dev element. Use path_conv methods Check
for FH_FS rather than FH_BAD to indicate when to fill in filesystem stuff.
where appropriate rather than direct access. Use set_normalized_path to set
normalized path.
(windows_device_names): Eliminate.
(get_dev): Ditto.
(get_raw_device_number): Ditto.
(get_device_number): Ditto.
(win32_device_name): Call new device name parser to do most of the heavy
lifting.
(mount_info::conv_to_win32_path): Fill in dev field as appropriate.
(symlink_worker): Handle new device files.
(symlink_info::check): Ditto.
(symlink_info::parse_device): Define new function.
* path.h (executable_states): Move here from fhandler.h.
(fs_info): Rename variables to *_storage and create methods for accessing same.
(path_conv): Add dev element, remove devn and unit and adjust inline methods to
accommodate.
(set_normalized_path): Declare new function.
* pinfo.cc (_pinfo::commune_recv): Add broken support for handling fifos.
(_pinfo::commune_send): Ditto.
* pipe.cc (fhandler_pipe::close): check for existence of handle before closing
it.
(handler_pipe::create): Rename from make_pipe. Change arguments to accept
fhandler_pipe array. Accommodate fifos.
(pipe): Rework to deal with fhandler_pipe::create changes.
(_pipe): Ditto.
* select.cc: Use individual device_specific types throughout rather than
indexing with obsolete device number.
(set_bits): Use is_socket call rather than checking device number.
* shared_info.h (CURR_MOUNT_MAGIC): Update.
(conv_to_win32_path): Reflect addition of device argument.
* syscalls.cc (mknod_worker): New function.
(open): Use build_fh_name to build fhandler.
(chown_worker): Detect if this is an 'auto' device rather than an on-filesystem
device and handle appropriately.
(chmod_device): New function.
(chmod): Detect if this is an 'auto' device rather than an on-filesystem device
and handle appropriately. Use chmod_device to set mode of in-filesystem
devices.
(stat_worker): Eliminate path_conv argument. Call build_fh_name to construct
fhandler. Use fh->error() rather than pc->error to detect errors in fhandler
construction.
(access_worker): New function pulled from access. Accommodate in-filesystem
devices.
(access): Use access_worker.
(fpathconf): Detect if this is an 'auto' device rather than an on-filesystem
device and handle appropriately.
(mknod_worker): New function.
(mknod32): New function.
(chroot): Free normalized path -- assuming it was actually cmalloced.
* tty.cc (create_tty_master): Tweak for new device class.
(tty::common_init): Ditto.
* winsup.h (stat_worker): Remove.
(symlink_worker): Declare.
* exceptions.cc (set_process_mask): Just call sig_dispatch_pending and don't
worry about pending_signals since sig_dispatch_pending should always do the
right thing now.
(sig_handle): Reorganize SIGCONT handling to more closely conform to SUSv3.
* pinfo.h: Move __SIG enum to sigproc.h.
(PICOM_FIFO): New enum element.
(_pinfo): Remove 'thread2signal' stuff throughout class.
(_pinfo::commune_send): Make varargs.
(_pinfo::sigtodo): Eliminate.
(_pinfo::thread2signal): Ditto.
* signal.cc (kill_worker): Eliminate call to setthread2signal.
* sigproc.cc (local_sigtodo): Eliminate.
(getlocal_sigtodo): Ditto.
(sigelem): New class.
(pending_signals): New class.
(sigqueue): New variable, start of sigqueue linked list.
(sigcatch_nonmain): Eliminate.
(sigcatch_main): Eliminate.
(sigcatch_nosync): Eliminate.
(sigcomplete_nonmain): Eliminate.
(pending_signals): Eliminate.
(sig_clear): Call signal thread to clear pending signals, unless already in
signal thread.
(sigpending): Call signal thread to get pending signals.
(sig_dispatch_pending): Eliminate use of pending_signals and just check
sigqueue.
(sigproc_terminate): Eliminate all of the obsolete semaphore stuff. Close
signal pipe handle.
(sig_send): Eliminate all of the obsolete semaphore stuff and use pipe to send
signals.
(getevent): Eliminate.
(pending_signals::add): New function.
(pending_signals::del): New function.
(pending_signals::next): New function.
(wait_sig): Eliminate all of the obsolete semaphore stuff. Use pipe to
communicate and maintain a linked list of signals.
* sigproc.h: Move __SIG defines here. Add __SIGPENDING.
(sig_dispatch_pending): Remove "C" specifier.
(sig_handle): Accept a mask argument.
* thread.cc: Remove signal handling considerations throughout.
2003-09-25 08:37:18 +08:00
|
|
|
${wordlist 1,2,$^} $@
|
|
|
|
|
2012-11-23 21:22:47 +08:00
|
|
|
${CURDIR}/libc.a: ${LIB_NAME} ${CURDIR}/libm.a libpthread.a libutil.a
|
2009-03-28 12:55:36 +08:00
|
|
|
${speclib} -v ${@F}
|
2001-12-31 11:19:29 +08:00
|
|
|
|
Add missing long double functions to Cygwin
This patch adds the long double functions missing in newlib to Cygwin.
Apart from some self-written additions (exp10l, finite{f,l}, isinf{f,l},
isnan{f,l}, pow10l) the files are taken from the Mingw-w64 math lib.
Minor changes were required, e.g. substitue _WIN64 with __x86_64__ and
fixing __FLT_RPT_DOMAIN/__FLT_RPT_ERANGE for Cygwin.
Cygwin:
* math: New subdir with math functions.
* Makefile.in (VPATH): Add math subdir.
(MATH_OFILES): List of object files collected from building files in
math subdir.
(DLL_OFILES): Add $(MATH_OFILES).
${CURDIR}/libm.a: Add $(MATH_OFILES) to build.
* common.din: Add new functions from math subdir.
* i686.din: Align to new math subdir. Remove functions now commonly
available.
* x86_64.din: Ditto.
* math.h: math.h wrapper to define mingw structs used in some files in
math subdir.
* include/cygwin/version.h: Bump API minor version.
newlib:
* libc/include/complex.h: Add prototypes for complex long double
functions. Only define for Cygwin.
* libc/include/math.h: Additionally enable prototypes of long double
functions for Cygwin. Add Cygwin-only prototypes for dreml, sincosl,
exp10l and pow10l. Explain why we don't add them to newlib.
* libc/include/tgmath.h: Enable long double handling on Cygwin.
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2016-03-29 01:35:20 +08:00
|
|
|
${CURDIR}/libm.a: ${LIB_NAME} $(LIBM) $(MATH_OFILES)
|
2009-03-28 12:55:36 +08:00
|
|
|
${speclib} ${@F}
|
2004-09-10 16:30:51 +08:00
|
|
|
|
2020-09-01 18:52:08 +08:00
|
|
|
libpthread.a: ${LIB_NAME} pthread.o thread.o call_once.o cnd.o mtx.o \
|
|
|
|
thrd.o tss.o
|
2009-03-28 12:55:36 +08:00
|
|
|
${speclib} ${@F}
|
2001-12-31 11:19:29 +08:00
|
|
|
|
2009-04-12 11:19:52 +08:00
|
|
|
libutil.a: ${LIB_NAME} bsdlib.o
|
2009-03-28 12:55:36 +08:00
|
|
|
${speclib} ${@F}
|
2001-12-31 11:19:29 +08:00
|
|
|
|
2009-04-12 11:19:52 +08:00
|
|
|
libdl.a: ${LIB_NAME} dlfcn.o
|
2009-03-28 12:55:36 +08:00
|
|
|
${speclib} ${@F}
|
2006-06-03 23:48:30 +08:00
|
|
|
|
2009-04-12 11:19:52 +08:00
|
|
|
libresolv.a: ${LIB_NAME} minires.o
|
2009-03-28 12:55:36 +08:00
|
|
|
${speclib} ${@F}
|
2006-12-12 03:59:06 +08:00
|
|
|
|
2009-06-12 18:19:36 +08:00
|
|
|
librt.a: ${LIB_NAME} posix_ipc.o
|
|
|
|
${speclib} ${@F}
|
|
|
|
|
2016-01-07 01:41:36 +08:00
|
|
|
libacl.a: ${LIB_NAME} sec_posixacl.o
|
|
|
|
${speclib} ${@F}
|
|
|
|
|
2017-11-28 13:56:30 +08:00
|
|
|
libssp.a: ${LIB_NAME} $(newlib_build)/libc/ssp/lib.a
|
|
|
|
${speclib} ${@F}
|
|
|
|
|
2009-03-28 12:55:36 +08:00
|
|
|
${EXTRALIBS}: lib%.a: %.o
|
2001-12-31 11:19:29 +08:00
|
|
|
$(AR) cru $@ $?
|
|
|
|
|
2019-01-30 00:33:59 +08:00
|
|
|
# Every time we touch a source file, the version info has to be rebuilt
|
|
|
|
# to maintain a correct build date, especially in uname release output
|
|
|
|
find_src_files = $(wildcard $(dir)/*.[chS]) $(wildcard $(dir)/*.cc)
|
|
|
|
src_files := $(foreach dir,$(VPATH),$(find_src_files))
|
|
|
|
|
2019-02-02 22:10:13 +08:00
|
|
|
# mkvers.sh creates version.cc in the first place, winver.o always
|
|
|
|
# second, so version.cc is always older than winver.o
|
|
|
|
version.cc: mkvers.sh include/cygwin/version.h winver.rc $(src_files)
|
2015-01-28 19:43:06 +08:00
|
|
|
@echo "Making version.cc and winver.o";\
|
2020-10-27 23:31:06 +08:00
|
|
|
export CC="${CC}";\
|
2020-10-03 21:41:58 +08:00
|
|
|
/bin/sh ${word 1,$^} ${word 2,$^} ${word 3,$^} $(WINDRES) ${CFLAGS} -I${srcdir}/include
|
2019-02-02 22:10:13 +08:00
|
|
|
$(VERSION_OFILES): version.cc
|
2017-02-16 23:57:40 +08:00
|
|
|
|
2020-10-28 23:31:27 +08:00
|
|
|
$(DEF_FILE): gendef $(srcdir)/$(TLSOFFSETS_H) $(DIN_FILE)
|
|
|
|
$(word 1,$^) --cpu=${target_cpu} --output-def=$@ --tlsoffsets=$(word 2,$^) $(wordlist 3,99,$^)
|
2003-11-29 04:55:59 +08:00
|
|
|
|
2013-04-23 17:44:36 +08:00
|
|
|
$(srcdir)/$(TLSOFFSETS_H): gentls_offsets cygtls.h
|
2020-10-27 01:53:06 +08:00
|
|
|
$^ $@ $(target_cpu) $(COMPILE.cc) || rm $@
|
2003-11-29 04:55:59 +08:00
|
|
|
|
|
|
|
sigfe.s: $(DEF_FILE)
|
2020-10-28 23:31:27 +08:00
|
|
|
@[ -s $@ ] || \
|
|
|
|
{ rm -f $(DEF_FILE); $(MAKE) -s -j1 $(DEF_FILE); }; \
|
|
|
|
[ -s $@ ] && touch $@
|
2003-11-29 04:55:59 +08:00
|
|
|
|
2016-03-30 20:35:46 +08:00
|
|
|
sigfe.o: sigfe.s $(srcdir)/$(TLSOFFSETS_H)
|
2015-02-20 20:15:38 +08:00
|
|
|
$(CC) ${CFLAGS} -c -o $@ $<
|
2000-06-23 05:51:48 +08:00
|
|
|
|
2010-01-28 19:54:00 +08:00
|
|
|
ctags: CTAGS
|
|
|
|
tags: CTAGS
|
|
|
|
CTAGS:
|
2017-11-27 20:38:43 +08:00
|
|
|
-cd $(srcdir) && \
|
|
|
|
ctags -R --c++-kinds=+p --fields=+iaS --extra=+q \
|
2017-11-28 20:10:34 +08:00
|
|
|
--regex-C++='/EXPORT_ALIAS *\([a-zA-Z0-9_]*, *([a-zA-Z0-9_]*)\)/\1/' \
|
2017-11-28 20:31:20 +08:00
|
|
|
--regex-C++='/__ASMNAME *\("([a-zA-Z0-9_]+)"\)/\1/' \
|
2020-10-03 21:41:58 +08:00
|
|
|
.
|
2010-01-28 19:54:00 +08:00
|
|
|
|
2000-12-16 06:25:51 +08:00
|
|
|
deps:=${wildcard *.d}
|
|
|
|
ifneq (,$(deps))
|
|
|
|
include $(deps)
|
2000-08-22 23:25:25 +08:00
|
|
|
endif
|
2009-07-13 05:15:47 +08:00
|
|
|
|
|
|
|
%: RCS/%,v
|