This is a straight translation from my qiita post in Japanese
You may want to link external libraries (like libmysqlclient) when you create an Apache module.
So the Makefile generated by
apxs includes some stub, which is like this:
Cool, so I can add
But the building command executed by make does not include
-lmysqlclient, event after I add it.
What is worse, is that building the module itself succeeds somehow without the library, and I can only get an error when it is loaded into Apache.
LIBS variable is referenced in
ALL_LIBS = $(MOD_LIBS) $(EXTRA_LIBS) $(NOTEST_LIBS) $(LIBS), but this
ALL_LIBS is never used anywhere.
So I can modify
rule.mk a bit, to properly use
Concretely, modify lines around
# Link-related commands as below (
ALL_LIBS is added after
It might be the case that you must add it somewhere else (like in
MOD_LINK), depending on what you want to use or how you build it.
Is it a bug of Apache?
So this issue (?) has existed since looooong time ago and is mentioned even in the Apache Users Mailing List.
So, ALL_LIBS isn’t getting used anywhere. Should it be in SH_LINK after $(ALL_LDFLAGS)?
I guess this is a bug of Apache… isn’t it???