Reinier Post (rp@xxxxxxxxxx) wrote: > > An attempt at correct building on Sun and SGI. > > Sun: common libxpm paths problems > > Yes. Specifying the libxpm path causes the test for XOpenDisplay() to fail, > the link command has a problem with order (it tries -lX11 -L/usr/openwin, > which doesn't find libX11). I don't know how to fix it myself. I've been studying autoconf/automake for the last few days, for a different project I'm working on. So I decided to take a look at this. I've come to the conclusion that the AC_CHECK_LIB macro is just plain inadequate for X11 libraries, because it isn't smart enough to rearrange the linker arguments in the right order. (Either that, or I (and all the other Freeciv autoconf hackers) have somehow managed to use it incorrectly. In any event, the info pages are clearly inadequate, because I had to look at the source code to see exactly what the macro does.) So, after several tries, I've come up with this change, which works on my GNU/Linux box and *looks* like it should work on other systems as well. I'd appreciate hearing the results on non-Linux systems, particularly those without GNU ld or with strange X11 locations (like Solaris). This change creates a new file, acsite.m4, which contains a new macro, FC_CHECK_X_LIB. It's even documented. ;-) It also patches configure.in to use this macro instead of AC_CHECK_LIB in appropriate places. (Patch is against Nov. 13 CVS.) Because I'm not sure how to put a new file into a patch (--new-file won't work since this isn't a directory comparison) I've attached my acsite.m4 as attachment #1, and the patch as attachment #2. Even this change may not be enough if the target system has Xpm (or Xaw) installed in a different place from the other X libs. But it should be no worse than the current (CVS) method. Hope this is helpful. -- "Daddy, why do those people have to | Greg Wooledge use Microsoft Windows?" | wooledge@xxxxxxxxxxx "Don't stare, son; it's not polite." | http://www.kellnet.com/wooledge/