mirror of
https://github.com/znc/znc.git
synced 2026-08-07 09:22:55 +02:00
Remove autoconf, leave only CMake
This commit is contained in:
@@ -1,146 +0,0 @@
|
||||
#
|
||||
# Copyright (C) 2004-2020 ZNC, see the NOTICE file for details.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
all:
|
||||
|
||||
SHELL := @SHELL@
|
||||
|
||||
# Support out-of-tree builds
|
||||
srcdir := @srcdir@
|
||||
VPATH := @srcdir@
|
||||
|
||||
prefix := @prefix@
|
||||
exec_prefix := @exec_prefix@
|
||||
datarootdir := @datarootdir@
|
||||
bindir := @bindir@
|
||||
datadir := @datadir@
|
||||
sysconfdir := @sysconfdir@
|
||||
libdir := @libdir@
|
||||
sbindir := @sbindir@
|
||||
localstatedir := @localstatedir@
|
||||
CXX := @CXX@
|
||||
# CXXFLAGS are for the main binary, so don't use them here, use MODFLAGS instead
|
||||
MODFLAGS := -I$(srcdir)/../include -I../include @CPPFLAGS@ @MODFLAGS@
|
||||
MODLINK := @MODLINK@
|
||||
LDFLAGS := @LDFLAGS@
|
||||
ISCYGWIN := @ISCYGWIN@
|
||||
|
||||
# LIBS are not and should not be used in here.
|
||||
# The znc binary links already against those.
|
||||
# ...but not on cygwin!
|
||||
LIBS :=
|
||||
ifeq "$(ISCYGWIN)" "1"
|
||||
LIBS += @LIBS@
|
||||
endif
|
||||
|
||||
PERL_ON := @PERL@
|
||||
PERL := @PERL_BINARY@
|
||||
PYTHON_ON:= @PYTHON@
|
||||
PY_CFLAGS:= @python_CFLAGS@
|
||||
PY_LDFLAGS:=@python_LIBS@
|
||||
SWIG := @SWIG@
|
||||
MODDIR := @MODDIR@
|
||||
DATADIR := @DATADIR@
|
||||
LIBZNC := @LIBZNC@
|
||||
LIBZNCDIR:= @LIBZNCDIR@
|
||||
INSTALL := @INSTALL@
|
||||
INSTALL_PROGRAM := @INSTALL_PROGRAM@
|
||||
INSTALL_SCRIPT := @INSTALL_SCRIPT@
|
||||
INSTALL_DATA := @INSTALL_DATA@
|
||||
SED := @SED@
|
||||
|
||||
TCL_FLAGS:= @TCL_FLAGS@
|
||||
|
||||
ifneq "$(V)" ""
|
||||
VERBOSE=1
|
||||
endif
|
||||
ifeq "$(VERBOSE)" ""
|
||||
Q=@
|
||||
E=@echo
|
||||
C=-s
|
||||
else
|
||||
Q=
|
||||
E=@\#
|
||||
C=
|
||||
endif
|
||||
|
||||
ifneq "$(LIBZNC)" ""
|
||||
LIBS += -L.. -lznc -Wl,-rpath,$(LIBZNCDIR)
|
||||
endif
|
||||
|
||||
CLEAN :=
|
||||
|
||||
FILES := $(notdir $(wildcard $(srcdir)/*.cpp))
|
||||
|
||||
include $(srcdir)/modperl/Makefile.inc
|
||||
include $(srcdir)/modpython/Makefile.inc
|
||||
include $(srcdir)/modtcl/Makefile.inc
|
||||
|
||||
FILES := $(basename $(FILES))
|
||||
|
||||
ifeq "@NOSSL@" "1"
|
||||
FILES := $(foreach file, $(FILES), \
|
||||
$(if $(shell grep REQUIRESSL $(srcdir)/$(file).cpp), \
|
||||
, \
|
||||
$(basename $(file)) \
|
||||
))
|
||||
endif
|
||||
|
||||
ifeq "@CYRUS@" ""
|
||||
FILES := $(shell echo $(FILES) | sed -e "s:cyrusauth::")
|
||||
endif
|
||||
cyrusauthLDFLAGS := -lsasl2
|
||||
|
||||
TARGETS := $(addsuffix .so, $(sort $(FILES)))
|
||||
|
||||
CLEAN += *.so *.o
|
||||
|
||||
.PHONY: all clean install install_datadir uninstall
|
||||
.SECONDARY:
|
||||
|
||||
all: $(TARGETS)
|
||||
|
||||
install: all install_datadir
|
||||
$(INSTALL_PROGRAM) $(TARGETS) $(DESTDIR)$(MODDIR)
|
||||
|
||||
install_datadir:
|
||||
rm -rf $(DESTDIR)$(DATADIR)/modules
|
||||
test -d $(DESTDIR)$(MODDIR) || $(INSTALL) -d $(DESTDIR)$(MODDIR)
|
||||
test -d $(DESTDIR)$(DATADIR)/modules || $(INSTALL) -d $(DESTDIR)$(DATADIR)/modules
|
||||
rm -rf $(DESTDIR)$(MODDIR)/*.so
|
||||
cp -R $(srcdir)/data/* $(DESTDIR)$(DATADIR)/modules
|
||||
find $(DESTDIR)$(DATADIR)/modules -type d -exec chmod 0755 '{}' \;
|
||||
find $(DESTDIR)$(DATADIR)/modules -type f -exec chmod 0644 '{}' \;
|
||||
|
||||
clean:
|
||||
rm -rf $(CLEAN)
|
||||
|
||||
%.o: %.cpp Makefile
|
||||
@mkdir -p .depend
|
||||
$(E) Building module $(notdir $(basename $@))...
|
||||
$(Q)$(CXX) $(MODFLAGS) -c -o $@ $< $($(notdir $(basename $@))CXXFLAGS) -MD -MF .depend/$(notdir $@).dep
|
||||
|
||||
%.so: %.o Makefile
|
||||
$(E) "Linking module" $(notdir $(basename $@))...
|
||||
$(Q)$(CXX) $(MODFLAGS) $(LDFLAGS) $(MODLINK) -o $@ $< $($(notdir $(basename $@))LDFLAGS) $(LIBS)
|
||||
|
||||
uninstall:
|
||||
# Yes, we are lazy, just remove everything in there
|
||||
rm -rf $(DESTDIR)$(MODDIR)/*
|
||||
rm -rf $(DESTDIR)$(DATADIR)/*
|
||||
rmdir $(DESTDIR)$(MODDIR)
|
||||
rmdir $(DESTDIR)$(DATADIR)
|
||||
|
||||
-include $(wildcard .depend/*.dep)
|
||||
@@ -1,37 +0,0 @@
|
||||
all:
|
||||
|
||||
VPATH := $(srcdir)
|
||||
|
||||
ifneq "$(V)" ""
|
||||
VERBOSE=1
|
||||
endif
|
||||
ifeq "$(VERBOSE)" ""
|
||||
Q=@
|
||||
E=@echo
|
||||
C=-s
|
||||
else
|
||||
Q=
|
||||
E=@\#
|
||||
C=
|
||||
endif
|
||||
|
||||
.SECONDARY:
|
||||
|
||||
all: modperl/modperl_biglib.cpp modperl/ZNC.pm modperl/perlfunctions.cpp modperl/swigperlrun.h
|
||||
|
||||
modperl/swigperlrun.h:
|
||||
@mkdir -p modperl
|
||||
$(Q)$(SWIG) -perl5 -c++ -shadow -external-runtime $@
|
||||
|
||||
modperl/modperl_biglib.cpp: modperl/modperl.i modperl/module.h modperl/CString.i
|
||||
$(E) Generating ZNC API for Perl...
|
||||
@mkdir -p modperl .depend
|
||||
$(Q)$(SWIG) -perl5 -c++ -shadow -outdir modperl -I$(srcdir) -I$(srcdir)/../include -I../include -I$(srcdir)/modperl/include -MD -MF .depend/modperl.swig.dep -w362,315,401,402 -o $@ $<
|
||||
|
||||
modperl/ZNC.pm: modperl/modperl_biglib.cpp
|
||||
|
||||
modperl/perlfunctions.cpp: modperl/codegen.pl modperl/functions.in
|
||||
@mkdir -p modperl
|
||||
$(Q)$(PERL) $^ $@
|
||||
|
||||
-include .depend/modperl.swig.dep
|
||||
@@ -1,78 +0,0 @@
|
||||
# vim: filetype=make
|
||||
|
||||
ifeq "$(PERL_ON)" "yes"
|
||||
# We execute this now so that we see the 'beauty' of these flags in make's output
|
||||
PERL_CXX := $(shell $(PERL) -MExtUtils::Embed -e perl_inc)
|
||||
PERL_LD := $(shell $(PERL) -MExtUtils::Embed -e ldopts)
|
||||
# Perl API is ugly, casting string literals to char* and redeclaring functions :(
|
||||
PERL_CXX += -Wno-write-strings -Wno-redundant-decls -Wno-missing-declarations
|
||||
PERL_CXX += -Wno-type-limits -Wno-sign-compare -Wno-strict-overflow -Wno-unused-value
|
||||
# perl 5.20 will fix this warning: https://rt.perl.org/Public/Bug/Display.html?id=120670
|
||||
PERL_CXX += -Wno-reserved-user-defined-literal -Wno-literal-suffix
|
||||
# This is for SWIG
|
||||
PERL_CXX += -DSWIG_TYPE_TABLE=znc
|
||||
PERLCEXT_EXT := $(shell $(PERL) -MConfig -e'print $$Config::Config{dlext}')
|
||||
modperlCXXFLAGS := $(PERL_CXX) -Wno-unused-function
|
||||
modperlLDFLAGS := $(PERL_LD)
|
||||
# Find additional headers for out-of-tree build
|
||||
modperlCXXFLAGS += -I.
|
||||
|
||||
ifeq "$(ISCYGWIN)" "1"
|
||||
PERLDEPONMOD := modperl.so
|
||||
else
|
||||
PERLDEPONMOD :=
|
||||
endif
|
||||
|
||||
PERLHOOK := modperl_install
|
||||
CLEAN += modperl/ZNC.$(PERLCEXT_EXT) modperl/ZNC.o modperl/gen
|
||||
ifneq "$(SWIG)" ""
|
||||
# Only delete these files if we can regenerate them
|
||||
CLEAN += modperl/ZNC.pm modperl/swigperlrun.h modperl/modperl_biglib.cpp modperl/perlfunctions.cpp
|
||||
endif
|
||||
|
||||
all: modperl_all
|
||||
|
||||
else
|
||||
FILES := $(shell echo $(FILES) | sed -e "s/modperl//")
|
||||
endif
|
||||
|
||||
.PHONY: modperl_install modperl_all
|
||||
|
||||
install: $(PERLHOOK)
|
||||
|
||||
modperl_all: modperl/ZNC.$(PERLCEXT_EXT) modperl/swigperlrun.h modperl/perlfunctions.cpp
|
||||
|
||||
modperl/ZNC.$(PERLCEXT_EXT): modperl/ZNC.o Makefile modperl.so
|
||||
$(E) Linking ZNC Perl bindings library...
|
||||
$(Q)$(CXX) $(MODFLAGS) $(LDFLAGS) $(MODLINK) -o $@ $< $(PERL_LD) $(PERLDEPONMOD) $(LIBS)
|
||||
|
||||
modperl/ZNC.o: modperl/modperl_biglib.cpp Makefile
|
||||
@mkdir -p modperl
|
||||
@mkdir -p .depend
|
||||
$(E) Building ZNC Perl bindings library...
|
||||
$(Q)$(CXX) $(MODFLAGS) -I$(srcdir) -MD -MF .depend/modperl.library.dep $(PERL_CXX) -Wno-unused-variable -Wno-shadow -o $@ $< -c
|
||||
|
||||
ifneq "$(SWIG)" ""
|
||||
include $(srcdir)/modperl/Makefile.gen
|
||||
else
|
||||
modperl/swigperlrun.h modperl/ZNC.pm modperl/perlfunctions.cpp: modperl/modperl_biglib.cpp
|
||||
modperl/modperl_biglib.cpp: modperl/generated.tar.gz
|
||||
@mkdir -p modperl
|
||||
$(E) Unpacking ZNC Perl bindings...
|
||||
$(Q)tar -xf $^ -C modperl
|
||||
endif
|
||||
|
||||
modperl.o: modperl/perlfunctions.cpp modperl/swigperlrun.h
|
||||
|
||||
modperl_install: install_datadir modperl_all
|
||||
for i in $(wildcard $(srcdir)/*.pm); do \
|
||||
$(INSTALL_DATA) $$i $(DESTDIR)$(MODDIR); \
|
||||
done
|
||||
mkdir -p $(DESTDIR)$(MODDIR)/modperl
|
||||
$(INSTALL_PROGRAM) modperl/ZNC.$(PERLCEXT_EXT) $(DESTDIR)$(MODDIR)/modperl
|
||||
if test -e modperl/ZNC.pm ; then \
|
||||
$(INSTALL_DATA) modperl/ZNC.pm $(DESTDIR)$(MODDIR)/modperl || exit 1 ; \
|
||||
else \
|
||||
$(INSTALL_DATA) $(srcdir)/modperl/ZNC.pm $(DESTDIR)$(MODDIR)/modperl || exit 1 ; \
|
||||
fi
|
||||
$(INSTALL_DATA) $(srcdir)/modperl/startup.pl $(DESTDIR)$(MODDIR)/modperl
|
||||
@@ -1,37 +0,0 @@
|
||||
all:
|
||||
|
||||
VPATH := $(srcdir)
|
||||
|
||||
ifneq "$(V)" ""
|
||||
VERBOSE=1
|
||||
endif
|
||||
ifeq "$(VERBOSE)" ""
|
||||
Q=@
|
||||
E=@echo
|
||||
C=-s
|
||||
else
|
||||
Q=
|
||||
E=@\#
|
||||
C=
|
||||
endif
|
||||
|
||||
.SECONDARY:
|
||||
|
||||
all: modpython/modpython_biglib.cpp modpython/znc_core.py modpython/pyfunctions.cpp modpython/swigpyrun.h
|
||||
|
||||
modpython/swigpyrun.h:
|
||||
@mkdir -p modpython
|
||||
$(Q)$(SWIG) -python -py3 -c++ -shadow -external-runtime $@
|
||||
|
||||
modpython/modpython_biglib.cpp: modpython/modpython.i modpython/module.h modpython/cstring.i
|
||||
$(E) Generating ZNC API for python...
|
||||
@mkdir -p modpython .depend
|
||||
$(Q)$(SWIG) -python -py3 -c++ -shadow -outdir modpython -I$(srcdir) -I$(srcdir)/../include -I../include -MD -MF .depend/modpython.swig.dep -w362,315,401 -o $@ $<
|
||||
|
||||
modpython/znc_core.py: modpython/modpython_biglib.cpp
|
||||
|
||||
modpython/pyfunctions.cpp: modpython/codegen.pl modpython/functions.in
|
||||
@mkdir -p modpython
|
||||
$(Q)$(PERL) $^ $@
|
||||
|
||||
-include .depend/modpython.swig.dep
|
||||
@@ -1,88 +0,0 @@
|
||||
# vim: filetype=make
|
||||
|
||||
ifeq "$(PYTHON_ON)" "yes"
|
||||
PYTHONCOMMON := $(PY_CFLAGS)
|
||||
PYTHONCOMMON += -DSWIG_TYPE_TABLE=znc
|
||||
# Could someone fix all of these in swig / python, please?
|
||||
PYTHONCOMMON += -Wno-missing-field-initializers -Wno-unused -Wno-shadow
|
||||
PYTHONCOMMON += -Wno-missing-declarations -Wno-uninitialized -Wno-switch-enum
|
||||
PYTHONCOMMON += -Wno-redundant-decls
|
||||
modpythonCXXFLAGS := $(PYTHONCOMMON) -I.
|
||||
modpythonLDFLAGS := $(PY_LDFLAGS)
|
||||
|
||||
ifeq "${ISCYGWIN}" "1"
|
||||
PYCEXT_EXT := dll
|
||||
PYDEPONMOD := ./modpython.so
|
||||
else
|
||||
PYCEXT_EXT := so
|
||||
PYDEPONMOD :=
|
||||
endif
|
||||
|
||||
PYTHONHOOK := modpython_install
|
||||
CLEAN += modpython/_znc_core.$(PYCEXT_EXT)
|
||||
CLEAN += modpython/_znc_core.o modpython/compiler.o
|
||||
ifneq "$(SWIG)" ""
|
||||
# Only delete these files if we can regenerate them
|
||||
CLEAN += modpython/modpython_biglib.cpp modpython/znc_core.py
|
||||
CLEAN += modpython/swigpyrun.h modpython/pyfunctions.cpp
|
||||
endif
|
||||
ifneq "$(srcdir)" "."
|
||||
# Copied from source for out-of-tree builds
|
||||
CLEAN += modpython/znc.py
|
||||
endif
|
||||
|
||||
else
|
||||
FILES := $(shell echo $(FILES) | sed -e "s/modpython//")
|
||||
endif
|
||||
|
||||
.PHONY: modpython_install modpython_all
|
||||
|
||||
install: $(PYTHONHOOK)
|
||||
|
||||
ifeq "$(PYTHON_ON)" "yes"
|
||||
all: modpython_all
|
||||
endif
|
||||
modpython_all: modpython/_znc_core.$(PYCEXT_EXT)
|
||||
|
||||
modpython/_znc_core.o: modpython/modpython_biglib.cpp Makefile
|
||||
@mkdir -p modpython
|
||||
@mkdir -p .depend
|
||||
$(E) Building ZNC python bindings library...
|
||||
$(Q)$(CXX) $(MODFLAGS) -I$(srcdir) -MD -MF .depend/modpython.library.dep $(PYTHONCOMMON) -o $@ $< -c
|
||||
|
||||
modpython/_znc_core.$(PYCEXT_EXT): modpython/_znc_core.o Makefile modpython.so
|
||||
$(E) Linking ZNC python bindings library...
|
||||
$(Q)$(CXX) $(MODFLAGS) $(LDFLAGS) $(MODLINK) -o $@ $< $(PY_LDFLAGS) $(PYDEPONMOD) $(LIBS)
|
||||
|
||||
ifneq "$(SWIG)" ""
|
||||
include $(srcdir)/modpython/Makefile.gen
|
||||
else
|
||||
modpython/swigpyrun.h modpython/znc_core.py modpython/pyfunctions.cpp: modpython/modpython_biglib.cpp
|
||||
modpython/modpython_biglib.cpp: modpython/generated.tar.gz
|
||||
@mkdir -p modpython
|
||||
$(E) Unpacking ZNC python bindings...
|
||||
$(Q)tar -xf $^ -C modpython
|
||||
endif
|
||||
|
||||
modpython.o: modpython/pyfunctions.cpp modpython/swigpyrun.h
|
||||
|
||||
modpython/compiler.o: modpython/compiler.cpp Makefile
|
||||
@mkdir -p modpython
|
||||
@mkdir -p .depend
|
||||
$(E) Building optimizer for python files...
|
||||
$(Q)$(CXX) $(PYTHONCOMMON) -o $@ $< -c -MD -MF .depend/modpython.compiler.dep
|
||||
modpython/compiler: modpython/compiler.o Makefile
|
||||
$(E) Linking optimizer for python files...
|
||||
$(Q)$(CXX) -o $@ $< $(PY_LDFLAGS)
|
||||
|
||||
modpython_install: install_datadir modpython_all
|
||||
-for i in $(srcdir)/*.py; do \
|
||||
$(INSTALL_DATA) $$i $(DESTDIR)$(MODDIR); \
|
||||
done
|
||||
mkdir -p $(DESTDIR)$(MODDIR)/modpython
|
||||
$(INSTALL_PROGRAM) modpython/_znc_core.$(PYCEXT_EXT) $(DESTDIR)$(MODDIR)/modpython
|
||||
if test -r modpython/znc_core.py;\
|
||||
then $(INSTALL_DATA) modpython/znc_core.py $(DESTDIR)$(MODDIR)/modpython;\
|
||||
else $(INSTALL_DATA) $(srcdir)/modpython/znc_core.py $(DESTDIR)$(MODDIR)/modpython;\
|
||||
fi
|
||||
$(INSTALL_DATA) $(srcdir)/modpython/znc.py $(DESTDIR)$(MODDIR)/modpython
|
||||
@@ -1,15 +0,0 @@
|
||||
ifeq "$(TCL_FLAGS)" ""
|
||||
FILES := $(shell echo $(FILES) | sed -e "s:modtcl::")
|
||||
else
|
||||
TCLHOOK := modtcl_install
|
||||
endif
|
||||
modtclCXXFLAGS := $(TCL_FLAGS)
|
||||
modtclLDFLAGS := $(TCL_FLAGS)
|
||||
|
||||
.PHONY: modtcl_install
|
||||
|
||||
install: $(TCLHOOK)
|
||||
|
||||
modtcl_install:
|
||||
mkdir -p $(DESTDIR)$(DATADIR)/modtcl/
|
||||
$(INSTALL_DATA) $(srcdir)/modtcl/modtcl.tcl $(srcdir)/modtcl/binds.tcl $(DESTDIR)$(DATADIR)/modtcl/
|
||||
Reference in New Issue
Block a user