mingw32libtoolmingw-w64gnu-autogen

Passing "-no-undefined" to Libtool LDFLAG


I am building a dll using MSys and Mingw on windows. The source for project only provides a autogen.sh, configure.ac and makefile.am. To generate the makefiles, you run autogen.sh then ./configure. I then go and manually add -no-undefined to the LDFLAGS in the makefile. This is not ideal, during the generation of the makefiles, this LDFLAGS should be set correctly.

Somewhere I have to change a configuration file, so that when the makefiles is generated the LDFLAGS is correctly set.

How do I do that?


Solution

  • You should be able to set it in Makefile.am. If your library declaration looked something like this:

    lib_LTLIBRARIES = libfoo.la
    libfoo_la_SOURCES = foo.c
    

    You'd add this line:

    libfoo_la_LDFLAGS = -no-undefined