[imapfilter-devel] trivial tweak to Makefile

Stefek Zaba s-imfil-ml-apr04 at zaba.com
Fri Apr 16 20:45:41 EEST 2004


Hi imapfilter gurus...

Thanks for a useful bit of software! In building it on an HP-UX system
where I have only Ordinary User privs, I ended up needing to link statically
against a personal copy of the latest OpenSSL libs. One of the things
which tripped me up for a little while was the line in the Makefile which
reads

   $(CC) $(LIBS) $(LDFLAGS) -o $(BIN) $(OBJ)

I believe it's more conventional for both the GNU linker and the HP-UX ld
(even if they're disguised as gcc/cc respectively ;-) for the libs to come
*after* the objs - that way unsatisfied refs in the objs are resolved
against entrypoints in the libs. So, it's probably Better to make this
line read

  $(CC) -o $(BIN) $(OBJ) $(LIBS) $(LDFLAGS)

With dynamic loading (as any setup in its right mind will prefer!) it makes
no difference, since link symbol resolution will happen at early runtime
anyway; but for cases such as mine where I'm forced to rely on static loading,
it does make a difference - with the original order, the (static) libs
are ignored, as there's nothing in them which needs loading at that point,
and routines from the dynloaded (and in my case, inappropriate-versioned)
SSL libs are dragged in at runtime instead.

So, with luck, this is a compatible change causing no hassle to the normal
world, and helps out the less-normal. If however it breaks something, don't
bother making a change - since in any case my 'abnormal' case requires
Makefile hackery to add -I and -L args to point at the 'personal' dirs
for the .h and static-lib files anyway...

Cheers, Stefek




More information about the Imapfilter-devel mailing list