From d6db9fd60a55f8ad2cf8e60e2481c4e7412117ee Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 6 Apr 2013 16:25:17 +0300 Subject: [PATCH] Fixed src/epaths.h generation and lib-src dependencies and libraries. --- Makefile.in | 15 ++++++++++- configure.ac | 28 +++++++++++--------- lib-src/Makefile.in | 63 ++++++++++++++++++++++++++------------------- nt/epaths.nt | 4 +-- 4 files changed, 69 insertions(+), 41 deletions(-) diff --git a/Makefile.in b/Makefile.in index fc0b2ab4fb..6e0f151ea1 100644 --- a/Makefile.in +++ b/Makefile.in @@ -290,7 +290,7 @@ COPYDESTS = $(DESTDIR)${etcdir} $(DESTDIR)${lispdir} $(DESTDIR)${leimdir}/ja-dic all: ${SUBDIR} -.PHONY: all ${SUBDIR} blessmail epaths-force FRC +.PHONY: all ${SUBDIR} blessmail epaths-force epaths-force-w32 FRC removenullpaths=sed -e 's/^://g' -e 's/:$$//g' -e 's/::/:/g' @@ -317,6 +317,19 @@ epaths-force: FRC -e 's;\(#.*PATH_DOC\).*$$;\1 "${docdir}";') && \ ${srcdir}/build-aux/move-if-change epaths.h.$$$$ src/epaths.h +# Convert MSYS-style /x/foo file name into x:/foo that Windows can grok. +msys_to_w32=sed -e 's,^/\([A-Za-z]\)/,\1:/,' + +# The w32 build needs a slightly different editing, and it uses +# nt/epaths.nt as the template. +epaths-force-w32: FRC + @(w32srcdir=`echo "${srcdir}" | ${msys_to_w32}` ; \ + sed < ${srcdir}/nt/epaths.nt > epaths.h.$$$$ \ + -e '/^.*#/s/@VER@/${version}/g' \ + -e '/^.*#/s/@CFG@/${configuration}/g' \ + -e "/^.*#/s|@SRC@|$${w32srcdir}|g") && \ + ${srcdir}/build-aux/move-if-change epaths.h.$$$$ src/epaths.h + lib-src src: $(NTDIR) lib src: lib-src FRC diff --git a/configure.ac b/configure.ac index a46f89ad55..67cb02c068 100644 --- a/configure.ac +++ b/configure.ac @@ -1031,8 +1031,6 @@ AC_SUBST(C_SWITCH_SYSTEM) LIBS_SYSTEM= -LIB_WSOCK32= -NTLIB= case "$opsys" in ## IBM's X11R5 uses -lIM and -liconv in AIX 3.2.2. aix4-2) LIBS_SYSTEM="-lrts -lIM -liconv" ;; @@ -1045,16 +1043,9 @@ case "$opsys" in ## Motif needs -lgen. unixware) LIBS_SYSTEM="-lsocket -lnsl -lelf -lgen" ;; - - mingw32) LIBS_SYSTEM="-lcomctl32" - LIB_WSOCK32="$LIB_WSOCK32 -lwsock32" - NTLIB="ntlib.$ac_objext" - ;; esac AC_SUBST(LIBS_SYSTEM) -AC_SUBST(LIB_WSOCK32) -AC_SUBST(NTLIB) ### Make sure subsequent tests use flags consistent with the build flags. @@ -1578,6 +1569,9 @@ fi FIRSTFILE_OBJ= NTDIR= +LIBS_ECLIENT= +LIB_WSOCK32= +NTLIB= CM_OBJ="cm.o" if test "${HAVE_W32}" = "yes"; then AC_DEFINE(HAVE_NTGUI, 1, [Define to use native MS Windows GUI.]) @@ -1600,12 +1594,15 @@ if test "${HAVE_W32}" = "yes"; then W32_OBJ="$W32_OBJ w32.o w32console.o w32heap.o w32inevt.o w32proc.o" W32_OBJ="$W32_OBJ w32notify.o" W32_LIBS="$W32_LIBS -lwinmm -lgdi32 -lcomdlg32" - W32_LIBS="$W32_LIBS -lmpr -lwinspool -lole32 -lusp10" + W32_LIBS="$W32_LIBS -lmpr -lwinspool -lole32 -lcomctl32 -lusp10" CLIENTRES="emacsclient.res" CLIENTW="emacsclientw\$(EXEEXT)" FIRSTFILE_OBJ=firstfile.o NTDIR=nt CM_OBJ= + LIBS_ECLIENT="-lcomctl32" + LIB_WSOCK32="-lwsock32" + NTLIB="ntlib.$ac_objext" fi fi AC_SUBST(W32_OBJ) @@ -1618,6 +1615,9 @@ AC_SUBST(W32_RES_LINK) AC_SUBST(FIRSTFILE_OBJ) AC_SUBST(NTDIR) AC_SUBST(CM_OBJ) +AC_SUBST(LIBS_ECLIENT) +AC_SUBST(LIB_WSOCK32) +AC_SUBST(NTLIB) if test "${HAVE_W32}" = "yes"; then window_system=w32 @@ -4661,8 +4661,12 @@ dnl by configure. This also explains the `move-if-change' test and dnl the use of force in the `epaths-force' rule in Makefile.in. AC_CONFIG_COMMANDS([epaths], [ echo creating src/epaths.h -${MAKE-make} MAKEFILE_NAME=do-not-make-Makefile epaths-force -], [GCC="$GCC" CPPFLAGS="$CPPFLAGS"]) +if test "${opsys}" = "mingw32"; then + ${MAKE-make} MAKEFILE_NAME=do-not-make-Makefile epaths-force-w32 +else + ${MAKE-make} MAKEFILE_NAME=do-not-make-Makefile epaths-force +fi +], [GCC="$GCC" CPPFLAGS="$CPPFLAGS" opsys="$opsys"]) AC_CONFIG_COMMANDS([gdbinit], [ if test ! -f src/.gdbinit && test -f "$srcdir/src/.gdbinit"; then diff --git a/lib-src/Makefile.in b/lib-src/Makefile.in index 5e9616673b..f7f334730f 100644 --- a/lib-src/Makefile.in +++ b/lib-src/Makefile.in @@ -166,14 +166,18 @@ 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@ +## empty or -lwsock2 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) + $(COM_ERRLIB) $(LIBHESIOD) $(LIBRESOLV) $(LIB_WSOCK32) -## Extra object files for linking emacsclient +## Extra libraries when linking emacsclient +## (empty or -lcomctl32 for MinGW) +LIBS_ECLIENT = @LIBS_ECLIENT@ + +## Extra object files for linking for MinGW NTLIB = @NTLIB@ CLIENTRES = @CLIENTRES@ WINDRES = @WINDRES@ @@ -312,61 +316,68 @@ regex.o: $(srcdir)/../src/regex.c $(srcdir)/../src/regex.h $(config_h) ${CC} -c ${CPP_CFLAGS} -DCONFIG_BROKETS -DINHIBIT_STRING_HEADER \ ${srcdir}/../src/regex.c -etags${EXEEXT}: ${srcdir}/etags.c regex.o $(config_h) +etags${EXEEXT}: ${srcdir}/etags.c regex.o $(NTLIB) $(config_h) $(CC) ${ALL_CFLAGS} -DEMACS_NAME="\"GNU Emacs\"" \ -DVERSION="\"${version}\"" ${srcdir}/etags.c \ - regex.o $(LOADLIBES) -o etags${EXEEXT} + regex.o $(LOADLIBES) $(NTLIB) -o etags${EXEEXT} -ebrowse${EXEEXT}: ${srcdir}/ebrowse.c ${srcdir}/../lib/min-max.h $(config_h) +ebrowse${EXEEXT}: ${srcdir}/ebrowse.c ${srcdir}/../lib/min-max.h $(NTLIB) \ + $(config_h) $(CC) ${ALL_CFLAGS} -DVERSION="\"${version}\"" \ - ${srcdir}/ebrowse.c $(LOADLIBES) -o ebrowse${EXEEXT} + ${srcdir}/ebrowse.c $(LOADLIBES) $(NTLIB) -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${EXEEXT} + regex.o $(LOADLIBES) $(NTLIB) -o ctags${EXEEXT} -profile${EXEEXT}: ${srcdir}/profile.c $(config_h) +profile${EXEEXT}: ${srcdir}/profile.c $(NTLIB) $(config_h) $(CC) ${ALL_CFLAGS} ${srcdir}/profile.c \ - $(LOADLIBES) $(LIB_CLOCK_GETTIME) -o profile${EXEEXT} + $(LOADLIBES) $(NTLIB) $(LIB_CLOCK_GETTIME) -o profile${EXEEXT} -make-docfile${EXEEXT}: ${srcdir}/make-docfile.c $(config_h) - $(CC) ${ALL_CFLAGS} ${srcdir}/make-docfile.c $(LOADLIBES) \ +make-docfile${EXEEXT}: ${srcdir}/make-docfile.c $(NTLIB) $(config_h) + $(CC) ${ALL_CFLAGS} ${srcdir}/make-docfile.c $(LOADLIBES) $(NTLIB) \ -o make-docfile${EXEEXT} movemail${EXEEXT}: ${srcdir}/movemail.c pop.o $(NTLIB) $(config_h) $(CC) ${ALL_CFLAGS} ${MOVE_FLAGS} ${srcdir}/movemail.c pop.o \ - $(NTLIB) $(LIB_WSOCK32) $(LOADLIBES) $(LIBS_MOVE) \ - -o movemail${EXEEXT} + $(LOADLIBES) $(NTLIB) $(LIBS_MOVE) -o movemail${EXEEXT} -pop.o: ${srcdir}/pop.c ${srcdir}/../lib/min-max.h $(config_h) +pop.o: ${srcdir}/pop.c ${srcdir}/pop.h ${srcdir}/../lib/min-max.h $(config_h) $(CC) -c ${CPP_CFLAGS} ${MOVE_FLAGS} ${srcdir}/pop.c emacsclient${EXEEXT}: ${srcdir}/emacsclient.c $(NTLIB) $(config_h) $(CC) ${ALL_CFLAGS} ${srcdir}/emacsclient.c \ - -DVERSION="\"${version}\"" $(LIB_WSOCK32) \ - $(LOADLIBES) $(LIB_FDATASYNC) -o emacsclient${EXEEXT} + -DVERSION="\"${version}\"" $(NTLIB) $(LOADLIBES) $(LIB_FDATASYNC) \ + $(LIB_WSOCK32) $(LIBS_ECLIENT) -o emacsclient${EXEEXT} emacsclientw${EXEEXT}: ${srcdir}/emacsclient.c $(NTLIB) $(CLIENTRES) $(config_h) $(CC) ${ALL_CFLAGS} $(CLIENTRES) -mwindows ${srcdir}/emacsclient.c \ - -DVERSION="\"${version}\"" $(LIB_WSOCK32) \ - $(LOADLIBES) -lcomctl32 $(LIB_FDATASYNC) -o emacsclientw${EXEEXT} + -DVERSION="\"${version}\"" $(LOADLIBES) $(LIB_FDATASYNC) \ + $(LIB_WSOCK32) $(LIBS_ECLIENT) -o emacsclientw${EXEEXT} + +NTINC = ${srcdir}/../nt +NTDEPS = $(NTINC)/ms-w32.h $(NTINC)/sys/stat.h $(NTINC)/inttypes.h \ + $(NTINC)/stdint.h $(NTINC)/pwd.h $(NTINC)/sys/time.h $(NTINC)/stdbool.h \ + $(NTINC)/sys/wait.h $(NTINC)/unistd.h $(NTINC)/sys/file.h $(NTINC)/netdb.h -ntlib.o: ${srcdir}/ntlib.c ${srcdir}/ntlib.h +# The dependency on $(NTDEPS) is a trick intended to cause recompile of +# programs on MinGW whenever some private header in nt/inc is modified. +ntlib.o: ${srcdir}/ntlib.c ${srcdir}/ntlib.h $(NTDEPS) $(CC) -c ${CPP_CFLAGS} ${srcdir}/ntlib.c -hexl${EXEEXT}: ${srcdir}/hexl.c $(config_h) +hexl${EXEEXT}: ${srcdir}/hexl.c $(NTLIB) $(config_h) $(CC) ${ALL_CFLAGS} ${srcdir}/hexl.c $(LOADLIBES) -o hexl${EXEEXT} update-game-score${EXEEXT}: ${srcdir}/update-game-score.c $(NTLIB) $(config_h) $(CC) ${ALL_CFLAGS} -DHAVE_SHARED_GAME_DIR="\"$(gamedir)\"" \ - ${srcdir}/update-game-score.c $(NTLIB) $(LOADLIBES) \ + ${srcdir}/update-game-score.c $(LOADLIBES) $(NTLIB) \ -o update-game-score${EXEEXT} -emacsclient.res: ${srcdir}/../nt/emacsclient.rc - $(WINDRES) -O coff --include-dir=${srcdir}/../nt -o emacsclient.res \ - ${srcdir}/../nt/emacsclient.rc +emacsclient.res: $(NTINC)/emacsclient.rc + $(WINDRES) -O coff --include-dir=$(NTINC) -o emacsclient.res \ + $(NTINC)/emacsclient.rc ## Makefile ends here. diff --git a/nt/epaths.nt b/nt/epaths.nt index 10f38aab1c..1e418550d5 100644 --- a/nt/epaths.nt +++ b/nt/epaths.nt @@ -38,7 +38,7 @@ along with GNU Emacs. If not, see . */ /emacs/VERSION/lisp:/emacs/VERSION/leim where datadir is eg /usr/local/share. */ -#define PATH_LOADSEARCH "%emacs_dir%/share/emacs/@VER@/lisp:%emacs_dir%/share/emacs/@VER@/leim" +#define PATH_LOADSEARCH "%emacs_dir%/share/emacs/@VER@/lisp;%emacs_dir%/share/emacs/@VER@/leim" /* Like PATH_LOADSEARCH, but contains the non-standard pieces. These are the site-lisp directories, typically something like @@ -48,7 +48,7 @@ along with GNU Emacs. If not, see . */ This is combined with PATH_LOADSEARCH to make the default load-path. If the --no-site-lisp option is used, this piece is excluded. */ -#define PATH_SITELOADSEARCH "%emacs_dir%/share/emacs/@VER@/site-lisp:%emacs_dir%/share/emacs/site-lisp" +#define PATH_SITELOADSEARCH "%emacs_dir%/share/emacs/@VER@/site-lisp;%emacs_dir%/share/emacs/site-lisp" /* Like PATH_LOADSEARCH, but used only during the build process when Emacs is dumping. Configure (using "make epaths-force") sets -- 2.20.1