diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index f26544b17..121fbb62f 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,11 @@ +2003-08-25 Christopher Faylor + + Throughout, change USE_CYGSERVER to USE_SERVER. + * Makefile.in (LIBSERVER): Define and use. + * configure.in: Set LIBSERVER as appropriate. + * environ.cc: Rename allow_daemon to allow_server. Only recognize when + USE_SERVER is defined. + 2003-08-23 Christopher Faylor * syscalls.cc (_remove_r): Define. diff --git a/winsup/cygwin/Makefile.in b/winsup/cygwin/Makefile.in index 66e72cc58..6a54a1cc3 100644 --- a/winsup/cygwin/Makefile.in +++ b/winsup/cygwin/Makefile.in @@ -233,6 +233,7 @@ API_VER:=$(srcdir)/include/cygwin/version.h PWD:=${shell pwd} LIB_NAME:=$(PWD)/libcygwin.a +LIBSERVER:=@LIBSERVER@ SUBLIBS:=$(PWD)/libpthread.a $(PWD)/libm.a $(PWD)/libc.a EXTRALIBS:=libautomode.a libbinmode.a libtextmode.a INSTOBJS:=automode.o binmode.o textmode.o @@ -334,10 +335,10 @@ maintainer-clean realclean: clean # Rule to build cygwin.dll -$(TEST_DLL_NAME): $(LDSCRIPT) $(DLL_OFILES) $(DEF_FILE) $(DLL_IMPORTS) $(LIBC) $(LIBM) $(API_VER) Makefile winver_stamp +$(TEST_DLL_NAME): $(LDSCRIPT) $(DLL_OFILES) $(DEF_FILE) $(DLL_IMPORTS) $(LIBSERVER) $(LIBC) $(LIBM) $(API_VER) Makefile winver_stamp $(CXX) $(CXXFLAGS) $(nostdlib) -Wl,-T$(firstword $^) -Wl,--out-implib,cygdll.a -shared -o $@ \ -e $(DLL_ENTRY) $(DEF_FILE) $(DLL_OFILES) version.o winver.o \ - $(MALLOC_OBJ) $(LIBM) $(LIBC) \ + $(MALLOC_OBJ) $(LIBSERVER) $(LIBM) $(LIBC) \ -lgcc $(DLL_IMPORTS) @ln -f $@ new-$(DLL_NAME) diff --git a/winsup/cygwin/acconfig.h b/winsup/cygwin/acconfig.h index 79e2651d3..36aee469e 100644 --- a/winsup/cygwin/acconfig.h +++ b/winsup/cygwin/acconfig.h @@ -17,4 +17,4 @@ #undef NEWVFORK /* Define if using cygserver */ -#undef USE_CYGSERVER +#undef USE_SERVER diff --git a/winsup/cygwin/config.h.in b/winsup/cygwin/config.h.in index d4f6269e0..b4d44672f 100644 --- a/winsup/cygwin/config.h.in +++ b/winsup/cygwin/config.h.in @@ -38,4 +38,4 @@ #undef NEWVFORK /* Define if using cygserver */ -#undef USE_CYGSERVER +#undef USE_SERVER diff --git a/winsup/cygwin/configure b/winsup/cygwin/configure index e2f22306c..3500fad38 100755 --- a/winsup/cygwin/configure +++ b/winsup/cygwin/configure @@ -1904,11 +1904,13 @@ fi if test "${enable_server+set}" = set; then enableval="$enable_server" case "${enableval}" in -yes) cat >> confdefs.h <<\EOF -#define USE_CYGSERVER 1 +yes) + cat >> confdefs.h <<\EOF +#define USE_SERVER 1 EOF - ;; -no) ;; + + LIBSERVER='$(bupdir)/cygserver/libcygserver.a' ;; +no) LIBSERVER=;; esac fi @@ -1966,6 +1968,7 @@ esac + trap '' 1 2 15 cat > confcache <<\EOF # This file is a shell script that caches the results of configure @@ -2132,6 +2135,7 @@ s%@CPP@%$CPP%g s%@ALLOCA@%$ALLOCA%g s%@SET_MAKE@%$SET_MAKE%g s%@MALLOC_OFILES@%$MALLOC_OFILES%g +s%@LIBSERVER@%$LIBSERVER%g s%@DLL_ENTRY@%$DLL_ENTRY%g s%@DEF_DLL_ENTRY@%$DEF_DLL_ENTRY%g s%@CONFIG_DIR@%$CONFIG_DIR%g diff --git a/winsup/cygwin/configure.in b/winsup/cygwin/configure.in index 2c26d4d3b..c0ad97682 100644 --- a/winsup/cygwin/configure.in +++ b/winsup/cygwin/configure.in @@ -138,8 +138,10 @@ esac AC_ARG_ENABLE(server, [ --enable-server Build a cygwin DLL which can communicate with cygserver], [case "${enableval}" in -yes) AC_DEFINE(USE_CYGSERVER) ;; -no) ;; +yes) + AC_DEFINE(USE_SERVER) + LIBSERVER='$(bupdir)/cygserver/libcygserver.a' ;; +no) LIBSERVER=;; esac ]) @@ -192,6 +194,7 @@ case "$target_cpu" in esac AC_SUBST(MALLOC_OFILES) +AC_SUBST(LIBSERVER) AC_SUBST(DLL_ENTRY) AC_SUBST(DEF_DLL_ENTRY) AC_SUBST(ALLOCA) diff --git a/winsup/cygwin/environ.cc b/winsup/cygwin/environ.cc index 58d880013..fba44ac6d 100644 --- a/winsup/cygwin/environ.cc +++ b/winsup/cygwin/environ.cc @@ -35,8 +35,10 @@ extern bool strip_title_path; extern int pcheck_case; extern int subauth_id; bool reset_com = false; -bool allow_daemon = false; static bool envcache = true; +#ifdef USE_SERVER +extern bool allow_server; +#endif static char **lastenviron; @@ -506,7 +508,9 @@ static struct parse_thing {"binmode", {x: &binmode}, justset, NULL, {{O_TEXT}, {O_BINARY}}}, {"check_case", {func: &check_case_init}, isfunc, NULL, {{0}, {0}}}, {"codepage", {func: &codepage_init}, isfunc, NULL, {{0}, {0}}}, - {"daemon", {&allow_daemon}, justset, NULL, {{false}, {true}}}, +#ifdef USE_SERVER + {"server", {&allow_server}, justset, NULL, {{false}, {true}}}, +#endif {"envcache", {&envcache}, justset, NULL, {{true}, {false}}}, {"error_start", {func: &error_start_init}, isfunc, NULL, {{0}, {0}}}, {"export", {&export_settings}, justset, NULL, {{false}, {true}}}, diff --git a/winsup/cygwin/fhandler_tty.cc b/winsup/cygwin/fhandler_tty.cc index 44eb21e6b..a3694ae9d 100644 --- a/winsup/cygwin/fhandler_tty.cc +++ b/winsup/cygwin/fhandler_tty.cc @@ -507,7 +507,7 @@ fhandler_tty_slave::open (path_conv *, int flags, mode_t) HANDLE from_master_local, to_master_local; -#ifdef USE_CYGSERVER +#ifdef USE_SERVER if (!wincap.has_security () || cygserver_running == CYGSERVER_UNAVAIL || !cygserver_attach_tty (&from_master_local, &to_master_local)) @@ -589,7 +589,7 @@ int fhandler_tty_slave::cygserver_attach_tty (LPHANDLE from_master_ptr, LPHANDLE to_master_ptr) { -#ifndef USE_CYGSERVER +#ifndef USE_SERVER return 0; #else if (!from_master_ptr || !to_master_ptr) diff --git a/winsup/cygwin/fork.cc b/winsup/cygwin/fork.cc index 01daec953..021b83250 100644 --- a/winsup/cygwin/fork.cc +++ b/winsup/cygwin/fork.cc @@ -298,7 +298,7 @@ fork_child (HANDLE& hParent, dll *&first_dll, bool& load_dlls) (void) ForceCloseHandle1 (fork_info->subproc_ready, subproc_ready); (void) ForceCloseHandle1 (fork_info->forker_finished, forker_finished); -#ifdef USE_CYGSERVER +#ifdef USE_SERVER if (fixup_shms_after_fork ()) api_fatal ("recreate_shm areas after fork failed"); #endif diff --git a/winsup/cygwin/shm.cc b/winsup/cygwin/shm.cc index 1221298d2..2fef656e9 100644 --- a/winsup/cygwin/shm.cc +++ b/winsup/cygwin/shm.cc @@ -12,7 +12,7 @@ Cygwin license. Please consult the file "CYGWIN_LICENSE" for details. */ #include "winsup.h" -#ifdef USE_CYGSERVER +#ifdef USE_SERVER #include #include @@ -690,4 +690,4 @@ client_request_shm::client_request_shm (const key_t key, msglen (sizeof (_parameters.in)); } -#endif /* USE_CYGSERVER */ +#endif /* USE_SERVER */ diff --git a/winsup/cygwin/tty.cc b/winsup/cygwin/tty.cc index 4c3365d91..d972f0d82 100644 --- a/winsup/cygwin/tty.cc +++ b/winsup/cygwin/tty.cc @@ -407,13 +407,13 @@ tty::common_init (fhandler_pty_master *ptym) */ if (wincap.has_security ()) { -#ifdef USE_CYGSERVER +#ifdef USE_SERVER if (cygserver_running == CYGSERVER_UNKNOWN) cygserver_init (); #endif if ( -#ifdef USE_CYGSERVER +#ifdef USE_SERVER cygserver_running != CYGSERVER_OK && #endif !SetKernelObjectSecurity (hMainProc,