diff options
Diffstat (limited to 'lib-src')
| -rw-r--r-- | lib-src/ChangeLog | 24 | ||||
| -rw-r--r-- | lib-src/Makefile.in | 83 | ||||
| -rw-r--r-- | lib-src/ntlib.c | 12 | ||||
| -rw-r--r-- | lib-src/ntlib.h | 4 | ||||
| -rw-r--r-- | lib-src/update-game-score.c | 4 |
5 files changed, 98 insertions, 29 deletions
diff --git a/lib-src/ChangeLog b/lib-src/ChangeLog index 63108cae9a9..6ff653b7be6 100644 --- a/lib-src/ChangeLog +++ b/lib-src/ChangeLog | |||
| @@ -1,3 +1,27 @@ | |||
| 1 | 2013-05-16 Eli Zaretskii <eliz@gnu.org> | ||
| 2 | |||
| 3 | * update-game-score.c [WINDOWSNT]: Include "ntlib.h". | ||
| 4 | |||
| 5 | * ntlib.h (sleep): Update prototype. | ||
| 6 | (geteuid): Add prototype. | ||
| 7 | |||
| 8 | * ntlib.c (sleep): Now returns an unsigned value. | ||
| 9 | (getgid): New function. | ||
| 10 | |||
| 11 | * Makefile.in (CLIENTW, LIB_WSOCK32, LIBS_ECLIENT, NTLIB) | ||
| 12 | (CLIENTRES, WINDRES, NTINC, NTDEPS): New variables. | ||
| 13 | (INSTALLABLES): Add $(CLIENTW). | ||
| 14 | (LIBS_MOVE): Use $(LIB_WSOCK32). | ||
| 15 | ($(DESTDIR)${archlibdir}): Use $(EXEEXT) on update-game-score. | ||
| 16 | (test-distrib${EXEEXT}): Use $(EXEEXT) on test-distrib. | ||
| 17 | (etags${EXEEXT}, ebrowse${EXEEXT}, ctags${EXEEXT}) | ||
| 18 | (profile${EXEEXT}, make-docfile${EXEEXT}, movemail${EXEEXT}) | ||
| 19 | (emacsclient${EXEEXT}, hexl${EXEEXT}, update-game-score${EXEEXT}): | ||
| 20 | Add $(NTLIB) to prerequisites. Use $(EXEEXT). | ||
| 21 | (pop.o): Add pop.h to prerequisites. | ||
| 22 | (emacsclientw${EXEEXT}, ntlib.o): New targets. | ||
| 23 | (emacsclient.res): New target. | ||
| 24 | |||
| 1 | 2013-05-15 Stefan Monnier <monnier@iro.umontreal.ca> | 25 | 2013-05-15 Stefan Monnier <monnier@iro.umontreal.ca> |
| 2 | 26 | ||
| 3 | * makefile.w32-in ($(DOC)): Use DOC rather than DOC-X. | 27 | * makefile.w32-in ($(DOC)): Use DOC rather than DOC-X. |
diff --git a/lib-src/Makefile.in b/lib-src/Makefile.in index 7069af9767a..e0acea867b7 100644 --- a/lib-src/Makefile.in +++ b/lib-src/Makefile.in | |||
| @@ -113,8 +113,11 @@ MKDIR_P = @MKDIR_P@ | |||
| 113 | 113 | ||
| 114 | # ========================== Lists of Files =========================== | 114 | # ========================== Lists of Files =========================== |
| 115 | 115 | ||
| 116 | # emacsclientw.exe for MinGW, empty otherwise | ||
| 117 | CLIENTW = @CLIENTW@ | ||
| 118 | |||
| 116 | # Things that a user might actually run, which should be installed in bindir. | 119 | # Things that a user might actually run, which should be installed in bindir. |
| 117 | INSTALLABLES = etags${EXEEXT} ctags${EXEEXT} emacsclient${EXEEXT} \ | 120 | INSTALLABLES = etags${EXEEXT} ctags${EXEEXT} emacsclient${EXEEXT} $(CLIENTW) \ |
| 118 | ebrowse${EXEEXT} | 121 | ebrowse${EXEEXT} |
| 119 | 122 | ||
| 120 | INSTALLABLE_SCRIPTS = grep-changelog | 123 | INSTALLABLE_SCRIPTS = grep-changelog |
| @@ -163,10 +166,21 @@ LIBS_MAIL=@LIBS_MAIL@ | |||
| 163 | LIB_CLOCK_GETTIME = @LIB_CLOCK_GETTIME@ | 166 | LIB_CLOCK_GETTIME = @LIB_CLOCK_GETTIME@ |
| 164 | ## empty or -lrt or -lposix4 if HAVE_FDATASYNC | 167 | ## empty or -lrt or -lposix4 if HAVE_FDATASYNC |
| 165 | LIB_FDATASYNC = @LIB_FDATASYNC@ | 168 | LIB_FDATASYNC = @LIB_FDATASYNC@ |
| 169 | ## empty or -lwsock2 for MinGW | ||
| 170 | LIB_WSOCK32=@LIB_WSOCK32@ | ||
| 166 | 171 | ||
| 167 | ## Extra libraries to use when linking movemail. | 172 | ## Extra libraries to use when linking movemail. |
| 168 | LIBS_MOVE = $(LIBS_MAIL) $(KRB4LIB) $(DESLIB) $(KRB5LIB) $(CRYPTOLIB) \ | 173 | LIBS_MOVE = $(LIBS_MAIL) $(KRB4LIB) $(DESLIB) $(KRB5LIB) $(CRYPTOLIB) \ |
| 169 | $(COM_ERRLIB) $(LIBHESIOD) $(LIBRESOLV) | 174 | $(COM_ERRLIB) $(LIBHESIOD) $(LIBRESOLV) $(LIB_WSOCK32) |
| 175 | |||
| 176 | ## Extra libraries when linking emacsclient | ||
| 177 | ## (empty or -lcomctl32 for MinGW) | ||
| 178 | LIBS_ECLIENT = @LIBS_ECLIENT@ | ||
| 179 | |||
| 180 | ## Extra object files for linking for MinGW | ||
| 181 | NTLIB = @NTLIB@ | ||
| 182 | CLIENTRES = @CLIENTRES@ | ||
| 183 | WINDRES = @WINDRES@ | ||
| 170 | 184 | ||
| 171 | ## Some systems define this to request special libraries. | 185 | ## Some systems define this to request special libraries. |
| 172 | LIBS_SYSTEM = @LIBS_SYSTEM@ | 186 | LIBS_SYSTEM = @LIBS_SYSTEM@ |
| @@ -227,7 +241,7 @@ $(DESTDIR)${archlibdir}: all | |||
| 227 | umask 022; ${MKDIR_P} $(DESTDIR)${gamedir}; \ | 241 | umask 022; ${MKDIR_P} $(DESTDIR)${gamedir}; \ |
| 228 | touch $(DESTDIR)${gamedir}/snake-scores; \ | 242 | touch $(DESTDIR)${gamedir}/snake-scores; \ |
| 229 | touch $(DESTDIR)${gamedir}/tetris-scores | 243 | touch $(DESTDIR)${gamedir}/tetris-scores |
| 230 | -if chown ${gameuser} $(DESTDIR)${archlibdir}/update-game-score && chmod u+s $(DESTDIR)${archlibdir}/update-game-score; then \ | 244 | -if chown ${gameuser} $(DESTDIR)${archlibdir}/update-game-score${EXEEXT} && chmod u+s $(DESTDIR)${archlibdir}/update-game-score${EXEEXT}; then \ |
| 231 | chown ${gameuser} $(DESTDIR)${gamedir}; \ | 245 | chown ${gameuser} $(DESTDIR)${gamedir}; \ |
| 232 | chmod u=rwx,g=rwx,o=rx $(DESTDIR)${gamedir}; \ | 246 | chmod u=rwx,g=rwx,o=rx $(DESTDIR)${gamedir}; \ |
| 233 | fi | 247 | fi |
| @@ -292,7 +306,7 @@ TAGS: etags${EXEEXT} | |||
| 292 | ## distribute Emacs. If they were clobbered, all the .elc files were | 306 | ## distribute Emacs. If they were clobbered, all the .elc files were |
| 293 | ## clobbered too. | 307 | ## clobbered too. |
| 294 | test-distrib${EXEEXT}: ${srcdir}/test-distrib.c | 308 | test-distrib${EXEEXT}: ${srcdir}/test-distrib.c |
| 295 | $(CC) ${ALL_CFLAGS} -o test-distrib ${srcdir}/test-distrib.c | 309 | $(CC) ${ALL_CFLAGS} -o test-distrib${EXEEXT} ${srcdir}/test-distrib.c |
| 296 | ./test-distrib ${srcdir}/testfile | 310 | ./test-distrib ${srcdir}/testfile |
| 297 | 311 | ||
| 298 | ../lib/libgnu.a: $(config_h) | 312 | ../lib/libgnu.a: $(config_h) |
| @@ -302,47 +316,68 @@ regex.o: $(srcdir)/../src/regex.c $(srcdir)/../src/regex.h $(config_h) | |||
| 302 | ${CC} -c ${CPP_CFLAGS} -DCONFIG_BROKETS -DINHIBIT_STRING_HEADER \ | 316 | ${CC} -c ${CPP_CFLAGS} -DCONFIG_BROKETS -DINHIBIT_STRING_HEADER \ |
| 303 | ${srcdir}/../src/regex.c | 317 | ${srcdir}/../src/regex.c |
| 304 | 318 | ||
| 305 | etags${EXEEXT}: ${srcdir}/etags.c regex.o $(config_h) | 319 | etags${EXEEXT}: ${srcdir}/etags.c regex.o $(NTLIB) $(config_h) |
| 306 | $(CC) ${ALL_CFLAGS} -DEMACS_NAME="\"GNU Emacs\"" \ | 320 | $(CC) ${ALL_CFLAGS} -DEMACS_NAME="\"GNU Emacs\"" \ |
| 307 | -DVERSION="\"${version}\"" ${srcdir}/etags.c \ | 321 | -DVERSION="\"${version}\"" ${srcdir}/etags.c \ |
| 308 | regex.o $(LOADLIBES) -o etags | 322 | regex.o $(LOADLIBES) $(NTLIB) -o etags${EXEEXT} |
| 309 | 323 | ||
| 310 | ebrowse${EXEEXT}: ${srcdir}/ebrowse.c ${srcdir}/../lib/min-max.h $(config_h) | 324 | ebrowse${EXEEXT}: ${srcdir}/ebrowse.c ${srcdir}/../lib/min-max.h $(NTLIB) \ |
| 325 | $(config_h) | ||
| 311 | $(CC) ${ALL_CFLAGS} -DVERSION="\"${version}\"" \ | 326 | $(CC) ${ALL_CFLAGS} -DVERSION="\"${version}\"" \ |
| 312 | ${srcdir}/ebrowse.c $(LOADLIBES) -o ebrowse | 327 | ${srcdir}/ebrowse.c $(LOADLIBES) $(NTLIB) -o ebrowse${EXEEXT} |
| 313 | 328 | ||
| 314 | ## We depend on etags to assure that parallel makes do not write two | 329 | ## We depend on etags to assure that parallel makes do not write two |
| 315 | ## etags.o files on top of each other. | 330 | ## etags.o files on top of each other. |
| 316 | ctags${EXEEXT}: etags${EXEEXT} | 331 | ctags${EXEEXT}: etags${EXEEXT} |
| 317 | $(CC) ${ALL_CFLAGS} -DCTAGS -DEMACS_NAME="\"GNU Emacs\"" \ | 332 | $(CC) ${ALL_CFLAGS} -DCTAGS -DEMACS_NAME="\"GNU Emacs\"" \ |
| 318 | -DVERSION="\"${version}\"" ${srcdir}/etags.c \ | 333 | -DVERSION="\"${version}\"" ${srcdir}/etags.c \ |
| 319 | regex.o $(LOADLIBES) -o ctags | 334 | regex.o $(LOADLIBES) $(NTLIB) -o ctags${EXEEXT} |
| 320 | 335 | ||
| 321 | profile${EXEEXT}: ${srcdir}/profile.c $(config_h) | 336 | profile${EXEEXT}: ${srcdir}/profile.c $(NTLIB) $(config_h) |
| 322 | $(CC) ${ALL_CFLAGS} ${srcdir}/profile.c \ | 337 | $(CC) ${ALL_CFLAGS} ${srcdir}/profile.c \ |
| 323 | $(LOADLIBES) $(LIB_CLOCK_GETTIME) -o profile | 338 | $(LOADLIBES) $(NTLIB) $(LIB_CLOCK_GETTIME) -o profile${EXEEXT} |
| 324 | 339 | ||
| 325 | make-docfile${EXEEXT}: ${srcdir}/make-docfile.c $(config_h) | 340 | make-docfile${EXEEXT}: ${srcdir}/make-docfile.c $(NTLIB) $(config_h) |
| 326 | $(CC) ${ALL_CFLAGS} ${srcdir}/make-docfile.c $(LOADLIBES) \ | 341 | $(CC) ${ALL_CFLAGS} ${srcdir}/make-docfile.c $(LOADLIBES) $(NTLIB) \ |
| 327 | -o make-docfile | 342 | -o make-docfile${EXEEXT} |
| 328 | 343 | ||
| 329 | movemail${EXEEXT}: ${srcdir}/movemail.c pop.o $(config_h) | 344 | movemail${EXEEXT}: ${srcdir}/movemail.c pop.o $(NTLIB) $(config_h) |
| 330 | $(CC) ${ALL_CFLAGS} ${MOVE_FLAGS} ${srcdir}/movemail.c pop.o \ | 345 | $(CC) ${ALL_CFLAGS} ${MOVE_FLAGS} ${srcdir}/movemail.c pop.o \ |
| 331 | $(LOADLIBES) $(LIBS_MOVE) -o movemail | 346 | $(LOADLIBES) $(NTLIB) $(LIBS_MOVE) -o movemail${EXEEXT} |
| 332 | 347 | ||
| 333 | pop.o: ${srcdir}/pop.c ${srcdir}/../lib/min-max.h $(config_h) | 348 | pop.o: ${srcdir}/pop.c ${srcdir}/pop.h ${srcdir}/../lib/min-max.h $(config_h) |
| 334 | $(CC) -c ${CPP_CFLAGS} ${MOVE_FLAGS} ${srcdir}/pop.c | 349 | $(CC) -c ${CPP_CFLAGS} ${MOVE_FLAGS} ${srcdir}/pop.c |
| 335 | 350 | ||
| 336 | emacsclient${EXEEXT}: ${srcdir}/emacsclient.c $(config_h) | 351 | emacsclient${EXEEXT}: ${srcdir}/emacsclient.c $(NTLIB) $(config_h) |
| 337 | $(CC) ${ALL_CFLAGS} ${srcdir}/emacsclient.c \ | 352 | $(CC) ${ALL_CFLAGS} ${srcdir}/emacsclient.c \ |
| 338 | -DVERSION="\"${version}\"" \ | 353 | -DVERSION="\"${version}\"" $(NTLIB) $(LOADLIBES) $(LIB_FDATASYNC) \ |
| 339 | $(LOADLIBES) $(LIB_FDATASYNC) -o emacsclient | 354 | $(LIB_WSOCK32) $(LIBS_ECLIENT) -o emacsclient${EXEEXT} |
| 355 | |||
| 356 | emacsclientw${EXEEXT}: ${srcdir}/emacsclient.c $(NTLIB) $(CLIENTRES) $(config_h) | ||
| 357 | $(CC) ${ALL_CFLAGS} $(CLIENTRES) -mwindows ${srcdir}/emacsclient.c \ | ||
| 358 | -DVERSION="\"${version}\"" $(LOADLIBES) $(LIB_FDATASYNC) \ | ||
| 359 | $(LIB_WSOCK32) $(LIBS_ECLIENT) -o emacsclientw${EXEEXT} | ||
| 340 | 360 | ||
| 341 | hexl${EXEEXT}: ${srcdir}/hexl.c $(config_h) | 361 | NTINC = ${srcdir}/../nt/inc |
| 342 | $(CC) ${ALL_CFLAGS} ${srcdir}/hexl.c $(LOADLIBES) -o hexl | 362 | NTDEPS = $(NTINC)/ms-w32.h $(NTINC)/sys/stat.h $(NTINC)/inttypes.h \ |
| 363 | $(NTINC)/stdint.h $(NTINC)/pwd.h $(NTINC)/sys/time.h $(NTINC)/stdbool.h \ | ||
| 364 | $(NTINC)/sys/wait.h $(NTINC)/unistd.h $(NTINC)/sys/file.h $(NTINC)/netdb.h | ||
| 343 | 365 | ||
| 344 | update-game-score${EXEEXT}: ${srcdir}/update-game-score.c $(config_h) | 366 | # The dependency on $(NTDEPS) is a trick intended to cause recompile of |
| 367 | # programs on MinGW whenever some private header in nt/inc is modified. | ||
| 368 | ntlib.o: ${srcdir}/ntlib.c ${srcdir}/ntlib.h $(NTDEPS) | ||
| 369 | $(CC) -c ${CPP_CFLAGS} ${srcdir}/ntlib.c | ||
| 370 | |||
| 371 | hexl${EXEEXT}: ${srcdir}/hexl.c $(NTLIB) $(config_h) | ||
| 372 | $(CC) ${ALL_CFLAGS} ${srcdir}/hexl.c $(LOADLIBES) -o hexl${EXEEXT} | ||
| 373 | |||
| 374 | update-game-score${EXEEXT}: ${srcdir}/update-game-score.c $(NTLIB) $(config_h) | ||
| 345 | $(CC) ${ALL_CFLAGS} -DHAVE_SHARED_GAME_DIR="\"$(gamedir)\"" \ | 375 | $(CC) ${ALL_CFLAGS} -DHAVE_SHARED_GAME_DIR="\"$(gamedir)\"" \ |
| 346 | ${srcdir}/update-game-score.c $(LOADLIBES) -o update-game-score | 376 | ${srcdir}/update-game-score.c $(LOADLIBES) $(NTLIB) \ |
| 377 | -o update-game-score${EXEEXT} | ||
| 378 | |||
| 379 | emacsclient.res: $(NTINC)/../emacsclient.rc | ||
| 380 | $(WINDRES) -O coff --include-dir=$(NTINC)/.. -o emacsclient.res \ | ||
| 381 | $(NTINC)/../emacsclient.rc | ||
| 347 | 382 | ||
| 348 | ## Makefile ends here. | 383 | ## Makefile ends here. |
diff --git a/lib-src/ntlib.c b/lib-src/ntlib.c index 849abc2ede5..41b4e3a0cbc 100644 --- a/lib-src/ntlib.c +++ b/lib-src/ntlib.c | |||
| @@ -49,10 +49,11 @@ struct timezone | |||
| 49 | /* Emulate sleep...we could have done this with a define, but that | 49 | /* Emulate sleep...we could have done this with a define, but that |
| 50 | would necessitate including windows.h in the files that used it. | 50 | would necessitate including windows.h in the files that used it. |
| 51 | This is much easier. */ | 51 | This is much easier. */ |
| 52 | void | 52 | unsigned |
| 53 | sleep (unsigned long seconds) | 53 | sleep (unsigned seconds) |
| 54 | { | 54 | { |
| 55 | Sleep (seconds * 1000); | 55 | Sleep (seconds * 1000); |
| 56 | return 0; | ||
| 56 | } | 57 | } |
| 57 | 58 | ||
| 58 | /* Get the current working directory. */ | 59 | /* Get the current working directory. */ |
| @@ -138,6 +139,12 @@ getuid (void) | |||
| 138 | } | 139 | } |
| 139 | 140 | ||
| 140 | unsigned | 141 | unsigned |
| 142 | geteuid (void) | ||
| 143 | { | ||
| 144 | return getuid (); | ||
| 145 | } | ||
| 146 | |||
| 147 | unsigned | ||
| 141 | getgid (void) | 148 | getgid (void) |
| 142 | { | 149 | { |
| 143 | return 0; | 150 | return 0; |
| @@ -415,4 +422,3 @@ lstat (const char * path, struct stat * buf) | |||
| 415 | { | 422 | { |
| 416 | return stat (path, buf); | 423 | return stat (path, buf); |
| 417 | } | 424 | } |
| 418 | |||
diff --git a/lib-src/ntlib.h b/lib-src/ntlib.h index 1b2f57f35e5..3e48d2997e0 100644 --- a/lib-src/ntlib.h +++ b/lib-src/ntlib.h | |||
| @@ -16,7 +16,6 @@ GNU General Public License for more details. | |||
| 16 | You should have received a copy of the GNU General Public License | 16 | You should have received a copy of the GNU General Public License |
| 17 | along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | 17 | along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ |
| 18 | 18 | ||
| 19 | |||
| 20 | #include <pwd.h> | 19 | #include <pwd.h> |
| 21 | #include <malloc.h> | 20 | #include <malloc.h> |
| 22 | 21 | ||
| @@ -29,12 +28,13 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 29 | #ifdef sleep | 28 | #ifdef sleep |
| 30 | #undef sleep | 29 | #undef sleep |
| 31 | #endif | 30 | #endif |
| 32 | void sleep (unsigned long seconds); | 31 | unsigned sleep (unsigned seconds); |
| 33 | char *getwd (char *dir); | 32 | char *getwd (char *dir); |
| 34 | int getppid (void); | 33 | int getppid (void); |
| 35 | char * getlogin (void); | 34 | char * getlogin (void); |
| 36 | char * cuserid (char * s); | 35 | char * cuserid (char * s); |
| 37 | unsigned getuid (void); | 36 | unsigned getuid (void); |
| 37 | unsigned geteuid (void); | ||
| 38 | unsigned getegid (void); | 38 | unsigned getegid (void); |
| 39 | unsigned getgid (void); | 39 | unsigned getgid (void); |
| 40 | int setuid (unsigned uid); | 40 | int setuid (unsigned uid); |
diff --git a/lib-src/update-game-score.c b/lib-src/update-game-score.c index 29c81a8936c..ec8b4317770 100644 --- a/lib-src/update-game-score.c +++ b/lib-src/update-game-score.c | |||
| @@ -46,6 +46,10 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 46 | #include <sys/stat.h> | 46 | #include <sys/stat.h> |
| 47 | #include <getopt.h> | 47 | #include <getopt.h> |
| 48 | 48 | ||
| 49 | #ifdef WINDOWSNT | ||
| 50 | #include "ntlib.h" | ||
| 51 | #endif | ||
| 52 | |||
| 49 | #define MAX_ATTEMPTS 5 | 53 | #define MAX_ATTEMPTS 5 |
| 50 | #define MAX_SCORES 200 | 54 | #define MAX_SCORES 200 |
| 51 | #define MAX_DATA_LEN 1024 | 55 | #define MAX_DATA_LEN 1024 |