The order of items to link is important on some platforms when building the executables for the command line tools. They must be in order of dependency. Something like this: .o files -> -lssldap -> -lprldap -> -lldap -> -lsvrcore -> nss libs -> nspr libs -> system libs Otherwise you get weird link errors. Also, the makefile.in for tools is kind of messy and redundant.
The LINK_EXE macro already has everything needed - it is not necessary to supply extra libs in the form of the LDTOOLS_LIBS. Just specify them in the correct order in EXTRA_LIBS. You don't need to set EXTRA_LIBS for every platform - on *nix platforms, they are all the same, so just define them in a common place in the correct order. Use PLATFORMLIBS to specify platform dependent libs. The one tricky thing is that LINK_EXE expects OBJS to have all of the objects. This works if you only build one executable per makefile, but this makefile builds several, so you need to get the executable specific .obj file in the link line as well. I suppose I could have used target specific variable assignment to OBJS, but that seemed messy to me, so I just added a $(filter ..) to the LINK_EXE command which will add all of the .obj files specified in the executable link target dependency list to the link line. The filter is to filter out libraries and other dependencies, which are usually specified elsewhere. This seems to work on linux x86_64 and HP IPF 64 just fine.
Checking in mozilla/directory/c-sdk/build.mk; /cvsroot/mozilla/directory/c-sdk/build.mk,v <-- build.mk new revision: 5.24; previous revision: 5.23 done Checking in mozilla/directory/c-sdk/configure; /cvsroot/mozilla/directory/c-sdk/configure,v <-- configure new revision: 5.39; previous revision: 5.38 done Checking in mozilla/directory/c-sdk/configure.in; /cvsroot/mozilla/directory/c-sdk/configure.in,v <-- configure.in new revision: 5.40; previous revision: 5.39 done Checking in mozilla/directory/c-sdk/ldap/clients/tools/Makefile.in; /cvsroot/mozilla/directory/c-sdk/ldap/clients/tools/Makefile.in,v <-- Makefile.in new revision: 5.11; previous revision: 5.10 done