From f915f0f7c8a35ecc5ca95e99f5bf4286aafa3d05 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 29 Jan 2011 14:36:11 +0200 Subject: Fix the MS-Windows build broken by 2011-01-17T19:01:01Z!eggert@cs.ucla.edu and emacs-23/2010-05-21T19:51:48Z!acm@muc.de. lib/makefile.w32-in: lib/getopt_.h: New files. src/s/ms-w32.h (HAVE_MKTIME): Remove. src/makefile.w32-in (LOCAL_FLAGS): Add -I../lib. (GNULIB): New variable. (LIBS): Add $(GNULIB). $(TEMACS): Depend on $(GNULIB). : Fix font-lock disrupted by a lone `"'. src/makefile.w32-in (LOCAL_FLAGS): Add -I../lib. (GETOPTOBJS, GETOPTDEPS): Remove targets. (MOVEMAILOBJS): Replace $(GETOPTOBJS) with ../lib/$(BLD)/libgnu.$(A). ($(BLD)/movemail.exe): Depend on ../lib/getopt.h. (ECLIENTOBJS, ETAGSOBJ, CTAGSOBJ, EBROWSEOBJ): Replace getopt.o and getopt1.o with ../lib/$(BLD)/libgnu.$(A). (clean): Don't remove getopt.h. (getopt.h, $(BLD)/getopt.$(O), $(BLD)/getopt1.$(O)): Remove targets. ($(BLD)/ctags.$(O), $(BLD)/etags.$(O)): Replace getopt.h with $(EMACS_ROOT)/lib/getopt.h. nt/makefile.w32-in (all-other-dirs-nmake, all-other-dirs-gmake) (bootstrap-nmake, bootstrap-gmake, bootstrap-clean-nmake) (bootstrap-clean-gmake, clean-other-dirs-nmake) (clean-other-dirs-gmake, cleanall-other-dirs-nmake) (cleanall-other-dirs-gmake, distclean-other-dirs-nmake) (distclean-other-dirs-gmake, maintainer-clean-other-dirs-nmake) (maintainer-clean-other-dirs-gmake): Recurse into ../lib as well. nt/configure.bat: Create lib/makefile. nt/config.nt (HAVE_MKTIME, BROKEN_MKTIME): Remove. (HAVE_ATTRIBUTE_ALIGNED, HAVE_C99_STRTOLD, HAVE_DECL_GETENV) (HAVE_DECL_LOCALTIME_R, HAVE_WCHAR_T, PACKAGE, VERSION, inline) (_GL_UNUSED, _UNUSED_PARAMETER_): Add definitions, for gnulib. --- lib-src/ChangeLog | 19 ++++++++++++++++++ lib-src/makefile.w32-in | 51 +++++++++++++------------------------------------ lib-src/ntlib.c | 2 +- lib-src/ntlib.h | 2 +- 4 files changed, 34 insertions(+), 40 deletions(-) (limited to 'lib-src') diff --git a/lib-src/ChangeLog b/lib-src/ChangeLog index 2abfd6c8062..bc76c253ab3 100644 --- a/lib-src/ChangeLog +++ b/lib-src/ChangeLog @@ -1,3 +1,22 @@ +2011-01-29 Eli Zaretskii + + * makefile.w32-in (LOCAL_FLAGS): Add -I../lib. + (GETOPTOBJS, GETOPTDEPS): Remove targets. + (MOVEMAILOBJS): Replace $(GETOPTOBJS) with ../lib/$(BLD)/libgnu.$(A). + ($(BLD)/movemail.exe): Depend on ../lib/getopt.h. + (ECLIENTOBJS, ETAGSOBJ, CTAGSOBJ, EBROWSEOBJ): Replace getopt.o + and getopt1.o with ../lib/$(BLD)/libgnu.$(A). + (clean): Don't remove getopt.h. + (getopt.h, $(BLD)/getopt.$(O), $(BLD)/getopt1.$(O)): Remove targets. + ($(BLD)/ctags.$(O), $(BLD)/etags.$(O)): Replace getopt.h with + $(EMACS_ROOT)/lib/getopt.h. + +2011-01-28 Chong Yidong + + * ntlib.c (setregid): New stub, renamed from setegid. + + * ntlib.h: Update prototype. + 2011-01-25 Chong Yidong * movemail.c (main): Use setregid instead of setegid, which is diff --git a/lib-src/makefile.w32-in b/lib-src/makefile.w32-in index 80931fc3ca2..3685d0e71be 100644 --- a/lib-src/makefile.w32-in +++ b/lib-src/makefile.w32-in @@ -24,8 +24,8 @@ ALL = make-docfile hexl ctags etags movemail ebrowse emacsclient VERSION = 24.0.50 LOCAL_FLAGS = -DWINDOWSNT -DDOS_NT -DSTDC_HEADERS=1 -DNO_LDAV=1 \ - -DNO_ARCHIVES=1 -DHAVE_CONFIG_H=1 -I../nt/inc \ - -I../src + -DNO_ARCHIVES=1 -DHAVE_CONFIG_H=1 -I../lib \ + -I../nt/inc -I../src LIBS = $(BASE_LIBS) $(ADVAPI32) @@ -50,22 +50,19 @@ emacsclient: stamp_BLD $(BLD)/emacsclient.exe $(BLD)/emacsclientw.exe test-distrib: stamp_BLD $(BLD)/test-distrib.exe "$(BLD)/test-distrib.exe" "$(SRC)/testfile" -GETOPTOBJS = $(BLD)/getopt.$(O) $(BLD)/getopt1.$(O) -GETOPTDEPS = $(GETOPTOBJS) getopt.h MOVEMAILOBJS = $(BLD)/movemail.$(O) \ $(BLD)/pop.$(O) \ - $(BLD)/ntlib.$(O) \ - $(GETOPTOBJS) + ../lib/$(BLD)/libgnu.$(A) \ + $(BLD)/ntlib.$(O) -$(BLD)/movemail.exe: $(MOVEMAILOBJS) getopt.h +$(BLD)/movemail.exe: $(MOVEMAILOBJS) ../lib/getopt.h # put wsock32.lib before $(LIBS) to ensure we don't link to ws2_32.lib $(LINK) $(LINK_OUT)$@ $(LINK_FLAGS) $(MOVEMAILOBJS) $(WSOCK32) $(LIBS) ECLIENT_CFLAGS = -DHAVE_GETCWD -DHAVE_STRERROR -DVERSION="\"$(VERSION)\"" ECLIENTOBJS = $(BLD)/emacsclient.$(O) \ - $(BLD)/getopt.$(O) \ - $(BLD)/getopt1.$(O) \ - $(BLD)/ntlib.$(O) + $(BLD)/ntlib.$(O) \ + ../lib/$(BLD)/libgnu.$(A) CLIENTRES = ../nt/$(BLD)/emacsclient.res $(CLIENTRES): ../nt/emacsclient.rc @@ -86,8 +83,7 @@ $(BLD)/emacsclient.$(O): emacsclient.c makefile.w32-in $(CC) $(CFLAGS) $(ECLIENT_CFLAGS) $(CC_OUT)$@ emacsclient.c ETAGSOBJ = $(BLD)/etags.$(O) \ - $(BLD)/getopt.$(O) \ - $(BLD)/getopt1.$(O) \ + ../lib/$(BLD)/libgnu.$(A) \ $(BLD)/ntlib.$(O) \ $(BLD)/regex.$(O) @@ -96,8 +92,7 @@ $(BLD)/etags.exe: $(ETAGSOBJ) EBROWSEOBJ = $(BLD)/ebrowse.$(O) \ - $(BLD)/getopt.$(O) \ - $(BLD)/getopt1.$(O) \ + ../lib/$(BLD)/libgnu.$(A) \ $(BLD)/ntlib.$(O) $(BLD)/ebrowse.exe: $(EBROWSEOBJ) @@ -112,8 +107,7 @@ $(BLD)/etags.$(O): etags.c $(CC) $(CFLAGS) $(ETAGS_CFLAGS) $(CC_OUT)$@ etags.c CTAGSOBJ = $(BLD)/ctags.$(O) \ - $(BLD)/getopt.$(O) \ - $(BLD)/getopt1.$(O) \ + ../lib/$(BLD)/libgnu.$(A) \ $(BLD)/ntlib.$(O) \ $(BLD)/regex.$(O) @@ -340,7 +334,6 @@ install: $(INSTALL_FILES) clean: - $(DEL) DOC* $(COMPILER_TEMP_FILES) - $(DEL) ctags.c - - $(DEL) getopt.h - $(DEL_TREE) $(OBJDIR) - $(DEL) stamp_BLD - $(DEL) echolisp.tmp @@ -365,9 +358,6 @@ cleanall: clean echo $(CONFIG_H) has changed. Re-run configure.bat. exit -1 -getopt.h: getopt_.h - $(CP) $(ALL_DEPS) $@ - ### TAGS ### TAGS: $(BLD)/etags.exe *.c *.h @@ -392,7 +382,7 @@ $(BLD)/ctags.$(O) : \ $(EMACS_ROOT)/src/m/intel386.h \ $(EMACS_ROOT)/lib-src/../src/config.h \ $(SRC)/ntlib.h \ - $(SRC)/getopt.h + $(EMACS_ROOT)/lib/getopt.h $(BLD)/emacsclient.$(O) : \ $(SRC)/emacsclient.c \ @@ -407,7 +397,7 @@ $(BLD)/etags.$(O) : \ $(EMACS_ROOT)/src/m/intel386.h \ $(EMACS_ROOT)/lib-src/../src/config.h \ $(SRC)/ntlib.h \ - $(SRC)/getopt.h + $(EMACS_ROOT)/lib/getopt.h $(BLD)/fakemail.$(O) : \ $(SRC)/fakemail.c \ @@ -424,21 +414,6 @@ $(BLD)/getdate.$(O) : \ $(EMACS_ROOT)/src/config.h \ $(MSTOOLS_SYS)/types.h -$(BLD)/getopt.$(O) : \ - $(SRC)/getopt.c \ - $(EMACS_ROOT)/src/s/ms-w32.h \ - $(EMACS_ROOT)/src/m/intel386.h \ - $(EMACS_ROOT)/src/config.h \ - $(SRC)/ntlib.h \ - $(SRC)/getopt.h - -$(BLD)/getopt1.$(O) : \ - $(SRC)/getopt1.c \ - $(EMACS_ROOT)/src/s/ms-w32.h \ - $(EMACS_ROOT)/src/m/intel386.h \ - $(EMACS_ROOT)/src/config.h \ - $(SRC)/getopt.h - $(BLD)/hexl.$(O) : \ $(SRC)/hexl.c @@ -500,7 +475,7 @@ $(BLD)/timer.$(O) : \ # $(BLD)/make-docfile.$(O) $(BLD)/hexl.$(O) $(BLD)/fakemail.$(O): stamp_BLD -$(BLD)/test-distrib.$(O) $(GETOPTOBJS) $(MOVEMAILOBJS): stamp_BLD +$(BLD)/test-distrib.$(O) $(MOVEMAILOBJS): stamp_BLD $(BLD)/emacsclient.$(O) $(BLD)/etags.$(O) $(BLD)/regex.$(O): stamp_BLD diff --git a/lib-src/ntlib.c b/lib-src/ntlib.c index 02db2afdd37..0ecd4177d2c 100644 --- a/lib-src/ntlib.c +++ b/lib-src/ntlib.c @@ -143,7 +143,7 @@ setuid (unsigned uid) } int -setegid (unsigned gid) +setregid (unsigned rgid, unsigned gid) { return 0; } diff --git a/lib-src/ntlib.h b/lib-src/ntlib.h index d328913d71d..be8d2a58a50 100644 --- a/lib-src/ntlib.h +++ b/lib-src/ntlib.h @@ -38,7 +38,7 @@ unsigned getuid (void); unsigned getegid (void); unsigned getgid (void); int setuid (unsigned uid); -int setegid (unsigned gid); +int setregid (unsigned rgid, unsigned gid); char * getpass (const char * prompt); int fchown (int fd, unsigned uid, unsigned gid); -- cgit v1.2.1