install.sh and --disable-error-on-warning on win32

Christian Stimming stimming at tuhh.de
Mon Aug 28 16:01:21 EDT 2006


Derek,

actually now I remembered why I came up with ./configure 
--disable-error-on-warning: Libtool is causing some *major* headache with 
respect to exporting symbols from a DLL iff <ltdl.h> is included somewhere in 
the source, see first comment at  
http://wiki.gnucash.org/wiki/Windows#Old_notes 
I *really* tried to solve that one. If you think you can find a more durable 
solution than I did (remember, this concerns *libtool*), then even better. 
The current solution gives a "redefined macro" warning for the LT_SCOPE macro  
defined inside ltdl.h. This warning would stop the build with Werror, and 
that's why I chose to build with --disable-error-on-warning on win32. 
Currently the easiest solution.

The problem is this: <ltdl.h> requires source code which wants to import stuff 
from the libtool DLL to have LIBLTDL_DLL_IMPORT defined (see ltdl.h:134). So 
far, so good, and that's quite normal for DLLs on windows. *However*, the 
libtool shell code in gnucash has the grande idea that since libgncmod.la is 
to be built as a DLL as well, libtool adds -DDLL_EXPORT to the compiler 
command line. That's stupid from libtool, because if DLL_EXPORT is there 
(ltdl.h:131), the header will without further checking define LT_SCOPE twice.

What *should* have been done (as far as I understand windows dlls) is that the 
check for DLL_EXPORT in <ltdl.h> should have been checking for a macro named 
LIBLTDL_BUILDING_ITS_OWN_DLL_RIGHT_NOW, which will be active only at the 
occasion when libltdl builds its own DLL, but surely not at any other program 
that is using the <ltdl.h> header. Or alternatively in case anyone outside is 
actually using the LT_SCOPE macro, then <ltdl.h> should have renamed the 
internally used LT_SCOPE macro into LT_SCOPE_LTDL_INTERNAL, and have 
LIBTOOL_DLL_IMPORT deal with the latter whereas DLL_EXPORT deal with the 
former.

As for the gnucash install.sh script, we have several options:

#1 Ignore the warning by using --disable-error-on-warning

#2 Let install.sh change the ltdl.h header right after it has been installed 
(in inst_gnome, methinks) and change #ifdef DLL_EXPORT into #if 0.

#3 Let install.sh modify the created file ltmain.sh in gnucash so that it 
doesn't add -DDLL_EXPORT to the compiler command line.

#4 Send a patch upstream to the libtool... oh, forget it.

I'm with #1.

Christian


More information about the gnucash-devel mailing list