]> code.delx.au - gnu-emacs/commitdiff
Finished with lib-src compilation, except emacsclientw and emacsclient.res.
authorEli Zaretskii <eliz@gnu.org>
Sat, 30 Mar 2013 17:00:51 +0000 (20:00 +0300)
committerEli Zaretskii <eliz@gnu.org>
Sat, 30 Mar 2013 17:00:51 +0000 (20:00 +0300)
Next -- compilation in nt/, and then problems in src/.

configure.ac
lib-src/Makefile.in
lib-src/ntlib.c
lib-src/ntlib.h
lib-src/update-game-score.c
nt/inc/ms-w32.h

index 5ed6aed23d54690900325aa0c653f9efcd32394e..c41a0914607448f6db7e1a3e8cdb08cf7b0ebce3 100644 (file)
@@ -1026,6 +1026,8 @@ AC_SUBST(C_SWITCH_SYSTEM)
 
 
 LIBS_SYSTEM=
+LIB_WSOCK32=
+NTLIB_O=
 case "$opsys" in
   ## IBM's X11R5 uses -lIM and -liconv in AIX 3.2.2.
   aix4-2) LIBS_SYSTEM="-lrts -lIM -liconv" ;;
@@ -1038,9 +1040,16 @@ case "$opsys" in
 
   ## Motif needs -lgen.
   unixware) LIBS_SYSTEM="-lsocket -lnsl -lelf -lgen" ;;
+
+  mingw32) LIBS_SYSTEM="-lcomctl32"
+  LIB_WSOCK32="$LIB_WSOCK32 -lwsock32"
+  NTLIB_O="ntlib.$ac_objext"
+  ;;
 esac
-AC_SUBST(LIBS_SYSTEM)
 
+AC_SUBST(LIBS_SYSTEM)
+AC_SUBST(LIB_WSOCK32)
+AC_SUBST(NTLIB_O)
 
 ### Make sure subsequent tests use flags consistent with the build flags.
 
@@ -1574,8 +1583,8 @@ if test "${HAVE_W32}" = "yes"; then
     W32_RES_LINK="-Wl,-bpe-i386 -Wl,emacs.res"
   else
     W32_OBJ="$W32_OBJ w32.o w32console.o w32heap.o w32inevt.o w32proc.o"
-    W32_LIBS="$W32_LIBS -lwinmm -ladvapi32 -lgdi32 -lcomdlg32 -luser32"
-    W32_LIBS="$W32_LIBS -lmpr -lshell32 -lwinspool -lole32 -lcomctl32 -lusp10"
+    W32_LIBS="$W32_LIBS -lwinmm -lgdi32 -lcomdlg32"
+    W32_LIBS="$W32_LIBS -lmpr -lwinspool -lole32 -lusp10"
   fi
 fi
 AC_SUBST(W32_OBJ)
index 7069af9767a13ee0b171a3540d58755e4ea1f0f5..903dbfcf7b9f4ca4d13a59475bcf241aaabf6073 100644 (file)
@@ -163,11 +163,16 @@ LIBS_MAIL=@LIBS_MAIL@
 LIB_CLOCK_GETTIME = @LIB_CLOCK_GETTIME@
 ## empty or -lrt or -lposix4 if HAVE_FDATASYNC
 LIB_FDATASYNC = @LIB_FDATASYNC@
+## empty of -lwsock32 for MinGW
+LIB_WSOCK32 = @LIB_WSOCK32@
 
 ## Extra libraries to use when linking movemail.
 LIBS_MOVE = $(LIBS_MAIL) $(KRB4LIB) $(DESLIB) $(KRB5LIB) $(CRYPTOLIB) \
             $(COM_ERRLIB) $(LIBHESIOD) $(LIBRESOLV)
 
+## Extra object files for linking emacsclient
+NTLIB_O = @NTLIB_O@
+
 ## Some systems define this to request special libraries.
 LIBS_SYSTEM = @LIBS_SYSTEM@
 
@@ -292,7 +297,7 @@ TAGS: etags${EXEEXT}
 ## distribute Emacs.  If they were clobbered, all the .elc files were
 ## clobbered too.
 test-distrib${EXEEXT}: ${srcdir}/test-distrib.c
-       $(CC) ${ALL_CFLAGS} -o test-distrib ${srcdir}/test-distrib.c
+       $(CC) ${ALL_CFLAGS} -o test-distrib${EXEEXT} ${srcdir}/test-distrib.c
        ./test-distrib ${srcdir}/testfile
 
 ../lib/libgnu.a: $(config_h)
@@ -305,44 +310,49 @@ regex.o: $(srcdir)/../src/regex.c $(srcdir)/../src/regex.h $(config_h)
 etags${EXEEXT}: ${srcdir}/etags.c regex.o $(config_h)
        $(CC) ${ALL_CFLAGS} -DEMACS_NAME="\"GNU Emacs\"" \
          -DVERSION="\"${version}\"" ${srcdir}/etags.c \
-         regex.o $(LOADLIBES) -o etags
+         regex.o $(LOADLIBES) -o etags${EXEEXT}
 
 ebrowse${EXEEXT}: ${srcdir}/ebrowse.c ${srcdir}/../lib/min-max.h $(config_h)
        $(CC) ${ALL_CFLAGS} -DVERSION="\"${version}\"" \
-         ${srcdir}/ebrowse.c $(LOADLIBES) -o ebrowse
+         ${srcdir}/ebrowse.c $(LOADLIBES) -o ebrowse${EXEEXT}
 
 ## We depend on etags to assure that parallel makes do not write two
 ## etags.o files on top of each other.
 ctags${EXEEXT}: etags${EXEEXT}
        $(CC) ${ALL_CFLAGS} -DCTAGS -DEMACS_NAME="\"GNU Emacs\"" \
          -DVERSION="\"${version}\"" ${srcdir}/etags.c \
-         regex.o $(LOADLIBES) -o ctags
+         regex.o $(LOADLIBES) -o ctags${EXEEXT}
 
 profile${EXEEXT}: ${srcdir}/profile.c $(config_h)
        $(CC) ${ALL_CFLAGS} ${srcdir}/profile.c \
-         $(LOADLIBES) $(LIB_CLOCK_GETTIME) -o profile
+         $(LOADLIBES) $(LIB_CLOCK_GETTIME) -o profile${EXEEXT}
 
 make-docfile${EXEEXT}: ${srcdir}/make-docfile.c $(config_h)
        $(CC) ${ALL_CFLAGS} ${srcdir}/make-docfile.c $(LOADLIBES) \
-         -o make-docfile
+         -o make-docfile${EXEEXT}
 
-movemail${EXEEXT}: ${srcdir}/movemail.c pop.o $(config_h)
+movemail${EXEEXT}: ${srcdir}/movemail.c pop.o $(NTLIB_O) $(config_h)
        $(CC) ${ALL_CFLAGS} ${MOVE_FLAGS} ${srcdir}/movemail.c pop.o \
-         $(LOADLIBES) $(LIBS_MOVE) -o movemail
+         $(NTLIB_O) $(LIB_WSOCK32) $(LOADLIBES) $(LIBS_MOVE) \
+         -o movemail${EXEEXT}
 
 pop.o: ${srcdir}/pop.c ${srcdir}/../lib/min-max.h $(config_h)
        $(CC) -c ${CPP_CFLAGS} ${MOVE_FLAGS} ${srcdir}/pop.c
 
-emacsclient${EXEEXT}: ${srcdir}/emacsclient.c $(config_h)
+emacsclient${EXEEXT}: ${srcdir}/emacsclient.c $(NTLIB_O) $(config_h)
        $(CC) ${ALL_CFLAGS} ${srcdir}/emacsclient.c \
-          -DVERSION="\"${version}\"" \
-          $(LOADLIBES) $(LIB_FDATASYNC) -o emacsclient
+          -DVERSION="\"${version}\"" $(LIB_WSOCK32) \
+          $(LOADLIBES) $(LIB_FDATASYNC) -o emacsclient${EXEEXT}
+
+ntlib.o: ${srcdir}/ntlib.c ${srcdir}/ntlib.h
+       $(CC) -c ${CPP_CFLAGS} ${srcdir}/ntlib.c
 
 hexl${EXEEXT}: ${srcdir}/hexl.c $(config_h)
-       $(CC) ${ALL_CFLAGS} ${srcdir}/hexl.c $(LOADLIBES) -o hexl
+       $(CC) ${ALL_CFLAGS} ${srcdir}/hexl.c $(LOADLIBES) -o hexl${EXEEXT}
 
-update-game-score${EXEEXT}: ${srcdir}/update-game-score.c $(config_h)
+update-game-score${EXEEXT}: ${srcdir}/update-game-score.c $(NTLIB_O) $(config_h)
        $(CC) ${ALL_CFLAGS} -DHAVE_SHARED_GAME_DIR="\"$(gamedir)\"" \
-         ${srcdir}/update-game-score.c $(LOADLIBES) -o update-game-score
+         ${srcdir}/update-game-score.c $(NTLIB_O) $(LOADLIBES) \
+         -o update-game-score${EXEEXT}
 
 ## Makefile ends here.
index 849abc2ede508353b3c94c123c8268292840fc0b..9dbfda90e00124b9104536c0633b2151e1aa26b4 100644 (file)
@@ -20,6 +20,20 @@ GNU General Public License for more details.
 You should have received a copy of the GNU General Public License
 along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 
+#ifdef __MINGW32__
+/* A kludge to avoid including header files in lib/.  They cannot be
+   configured-out, and their stuff interferes with what we have
+   defined in this header and in other headers in nt/inc.  Yuck!  */
+#define __need_system_fcntl_h
+#define _GL_FCNTL_H
+#define _GL_JUST_INCLUDE_SYSTEM_INTTYPES_H
+#define _GL_ALREADY_INCLUDING_SIGNAL_H
+#define _GL_ALREADY_INCLUDING_STDIO_H
+#define __need_system_stdlib_h
+#define _GL_TIME_H
+#define __need_system_sys_stat_h
+#endif
+
 #include <windows.h>
 #include <stdlib.h>
 #include <stdio.h>
@@ -49,10 +63,11 @@ struct timezone
 /* Emulate sleep...we could have done this with a define, but that
    would necessitate including windows.h in the files that used it.
    This is much easier.  */
-void
-sleep (unsigned long seconds)
+unsigned
+sleep (unsigned seconds)
 {
   Sleep (seconds * 1000);
+  return 0;
 }
 
 /* Get the current working directory.  */
@@ -137,6 +152,12 @@ getuid (void)
   return 0;
 }
 
+unsigned
+geteuid (void)
+{
+  return getuid ();
+}
+
 unsigned
 getgid (void)
 {
@@ -415,4 +436,3 @@ lstat (const char * path, struct stat * buf)
 {
   return stat (path, buf);
 }
-
index 1b2f57f35e5871c93cb4d149c73de99a26823db5..3e48d2997e0881efecc77100a02521d461b62da4 100644 (file)
@@ -16,7 +16,6 @@ GNU General Public License for more details.
 You should have received a copy of the GNU General Public License
 along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 
-
 #include <pwd.h>
 #include <malloc.h>
 
@@ -29,12 +28,13 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 #ifdef sleep
 #undef sleep
 #endif
-void sleep (unsigned long seconds);
+unsigned sleep (unsigned seconds);
 char *getwd (char *dir);
 int getppid (void);
 char * getlogin (void);
 char * cuserid (char * s);
 unsigned getuid (void);
+unsigned geteuid (void);
 unsigned getegid (void);
 unsigned getgid (void);
 int setuid (unsigned uid);
index 29c81a8936c2803c7c7465225c4b125b82886aeb..ec8b4317770e8f1a383f7709bf57f13509ca4cf4 100644 (file)
@@ -46,6 +46,10 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 #include <sys/stat.h>
 #include <getopt.h>
 
+#ifdef WINDOWSNT
+#include "ntlib.h"
+#endif
+
 #define MAX_ATTEMPTS 5
 #define MAX_SCORES 200
 #define MAX_DATA_LEN 1024
index 9817cd78cad5891a7b9c58a4d8fc226dd6d99316..ce2b5662775ed02a6df2809fae8c473fb5dce4f2 100644 (file)
@@ -368,9 +368,11 @@ typedef int sigset_t;
 typedef int ssize_t;
 #endif
 
-#ifndef _POSIX /* MinGW64 */
+#ifdef _W64    /* MinGW64 */
+#ifndef _POSIX
 typedef _sigset_t sigset_t;
 #endif
+#endif
 
 typedef void (_CALLBACK_ *signal_handler) (int);
 extern signal_handler sys_signal (int, signal_handler);