On 2010-08-02 at 12:29 +0200, Frank Elsner wrote:
> --- exim-4.72.ORG/OS/Makefile-Base 2009-06-10 09:34:04.000000000 +0200
> +++ exim-4.72.NEW/OS/Makefile-Base 2010-07-30 11:03:18.000000000 +0200
> @@ -325,8 +325,8 @@
> @echo "$(CC) version.c"
> $(FE)$(CC) -c $(CFLAGS) $(INCLUDE) $(IPV6_INCLUDE) $(TLS_INCLUDE) version.c
> rm -f exim
> - @echo "$(LNCC) -o exim"
> - $(FE)$(PURIFY) $(LNCC) -o exim $(LFLAGS) $(OBJ_EXIM) version.o \
> + @echo "$(LNCC) -c $(CFLAGS) -o exim"
> + $(FE)$(PURIFY) $(LNCC) -o exim $(CFLAGS) $(LFLAGS) $(OBJ_EXIM) version.o \
This is using Compiler flags when invoking the Linker. Which flags were
needed here, and why were they in CFLAGS rather than LFLAGS to start
with?
> exim_dumpdb: $(OBJ_DUMPDB)
> - @echo "$(LNCC) -o exim_dumpdb"
> + @echo "$(LNCC) $(CFLAGS) -o exim_dumpdb"
> $(FE)$(LNCC) $(CFLAGS) $(INCLUDE) -o exim_dumpdb $(LFLAGS) $(OBJ_DUMPDB) \
> $(LIBS) $(EXTRALIBS) $(DBMLIB)
You changed an echo, which doesn't change the compilation.
> exim_fixdb: $(OBJ_FIXDB)
> - @echo "$(LNCC) -o exim_fixdb"
> + @echo "$(LNCC) $(CFLAGS) -o exim_fixdb"
Ditto. And the same for the next change.
> exim_dbmbuild: exim_dbmbuild.o
> @echo "$(LNCC) -o exim_dbmbuild"
> - $(FE)$(LNCC) -o exim_dbmbuild $(LFLAGS) exim_dbmbuild.o \
> + $(FE)$(LNCC) $(CFLAGS) -o exim_dbmbuild $(LFLAGS) exim_dbmbuild.o \
> $(LIBS) $(EXTRALIBS) $(DBMLIB)
This again appears to be using CFLAGS for the linking, which should be
wrong. And again for the next point.
> eximon.bin: $(EXIMON_EDITME) eximon $(OBJ_MONBIN) \
> ../exim_monitor/em_version.c
> @echo "$(CC) exim_monitor/em_version.c"
> - $(FE)$(CC) -o em_version.o -c \
> + $(FE)$(CC) $(CFLAGS) -o em_version.o -c \
> $(CFLAGS) $(XINCLUDE) -I. ../exim_monitor/em_version.c
> @echo "$(LNCC) -o eximon.bin"
> - $(FE)$(PURIFY) $(LNCC) -o eximon.bin em_version.o $(LFLAGS) $(XLFLAGS) \
> + $(FE)$(PURIFY) $(LNCC) $(CFLAGS) -o eximon.bin em_version.o $(LFLAGS) $(XLFLAGS) \
> $(OBJ_MONBIN) -lXaw -lXmu -lXt -lXext -lX11 $(PCRE_LIBS) \
> $(LIBS) $(LIBS_EXIMON) $(EXTRALIBS) $(EXTRALIBS_EXIMON) -lc
> @if [ x"$(STRIP_COMMAND)" != x"" ]; then \
The second change here is again an attempt to use compiler flags as
arguments to the linker, which may work well enough for some flags for
gcc, but is not portable.
The first change here is more interesting. It looks like we are missing
a CFLAGS for compiling the version object file which will later be
linked into the eximon binary. I can see that for some flags, such as
-fPIC, this might be problematic. So that change should certainly go
in.
The use of $(CFLAGS) on $(LNCC) lines, I'd like to see an explanation
for first, please.
-Phil