Files
znc/modules/Makefile.in
psychon 973b41a99c Fix compilling modperl
Modperl was broken for quite some time and no one noticed...

The modperlFLAGS include the path to some static lib which will be linked in.
For this to work, we need to already have used one of its symbols.

Now, if the linker first sees this DynaLoader.a and then our object file,
there are no references to any symbol from it yet and thus he drops it.

The fix is easy: The modperlFLAGS need to be after modperl.cpp on the
command line.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@970 726aef4b-f618-498e-8847-2d620e286838
2008-03-01 09:29:26 +00:00

96 lines
2.1 KiB
Makefile

prefix := @prefix@
exec_prefix := @exec_prefix@
datarootdir := @datarootdir@
bindir := @bindir@
datadir := @datadir@
sysconfdir := @sysconfdir@
libdir := @libdir@
sbindir := @sbindir@
localstatedir := @localstatedir@
CXX := @CXX@
CXXFLAGS := @CXXFLAGS@
LDFLAGS := @LDFLAGS@
INCLUDES := @INCLUDES@ -I..
LIBS := @LIBS@
PERL := @PERL@
MODDIR := @MODDIR@
DATADIR := @DATADIR@
ifeq "@NOSSL@" "1"
FILES := $(foreach file, $(wildcard *.cpp), \
$(if $(shell grep REQUIRESSL $(file)), \
, \
$(basename $(file)) \
))
else
FILES := $(basename $(wildcard *.cpp))
endif
ifneq "$(PERL)" ""
PERLCC := -DHAVE_PERL `$(PERL) -MExtUtils::Embed -e perl_inc`
PERLLD := `$(PERL) -MExtUtils::Embed -e perl_inc -e ldopts`
PERLHOOK := modperl_install
else
FILES := $(shell echo $(FILES) | sed -e "s/modperl//")
endif
modperlFLAGS := $(PERLLD) $(PERLCC)
ifeq "@SASL@" ""
FILES := $(shell echo $(FILES) | sed -e "s/saslauth//")
endif
saslauthFLAGS := -lsasl2
SRCS := $(wildcard ../*.cpp) $(addsuffix .cpp, $(FILES))
TARGETS := $(addsuffix .so, $(FILES))
CLEAN := *.so
DEPEND := $(wildcard .depend)
ifeq ($(DEPEND), )
DEPEND := no
else
DEPEND := yes
endif
.PHONY: all clean install modperl_install
all: $(TARGETS)
.depend:
@mkdir -p .depend
depend: .depend
install: all create_install_dir install_metadirs $(PERLHOOK)
install -m 0755 $(TARGETS) $(DESTDIR)$(MODDIR)
create_install_dir:
mkdir -p $(DESTDIR)$(MODDIR)
mkdir -p $(DESTDIR)$(DATADIR)
rm -rf $(DESTDIR)$(MODDIR)/*.so
install_metadirs: create_install_dir
for a in *; do \
if [ -d $$a ] && [ -f $${a}.so ]; then \
cp -Rp $$a $(DESTDIR)$(DATADIR); \
fi \
done
clean:
rm -rf $(CLEAN)
ifeq ($(DEPEND), yes)
%.so: %.cpp
$(CXX) $(CXXFLAGS) $(INCLUDES) $(LDFLAGS) -shared -o $@ $< $($(basename $<)FLAGS) -MMD -MF .depend/$<.dep
else
%.so: %.cpp
$(CXX) $(CXXFLAGS) $(INCLUDES) $(LDFLAGS) -shared -o $@ $< $($(basename $<)FLAGS)
endif
modperl_install: create_install_dir
for i in *.pm; do \
install -m 0755 $$i $(DESTDIR)$(MODDIR); \
done
-include $(wildcard .depend/*.dep)