mirror of
https://github.com/znc/znc.git
synced 2026-03-28 17:42:41 +01:00
Remove autoconf, leave only CMake
This commit is contained in:
@@ -7,39 +7,22 @@ clone_depth: 10
|
||||
environment:
|
||||
matrix:
|
||||
- cygwin_url: https://cygwin.com/setup-x86_64.exe
|
||||
build_with: cmake
|
||||
- cygwin_url: https://cygwin.com/setup-x86.exe
|
||||
build_with: cmake
|
||||
- cygwin_url: https://cygwin.com/setup-x86_64.exe
|
||||
build_with: autoconf
|
||||
- cygwin_url: https://cygwin.com/setup-x86.exe
|
||||
build_with: autoconf
|
||||
install:
|
||||
- ps: Invoke-WebRequest $env:cygwin_url -OutFile c:\cygwin-setup.exe
|
||||
# libcrypt-devel is needed only on x86_64 and only for modperl... probably some dependency problem.
|
||||
- c:\cygwin-setup.exe --quiet-mode --no-shortcuts --no-startmenu --no-desktop --upgrade-also --only-site --site http://cygwin.mirror.constant.com/ --root c:\cygwin-root --local-package-dir c:\cygwin-setup-cache --packages automake,gcc-g++,make,pkg-config,wget,libssl-devel,libicu-devel,zlib-devel,libcrypt-devel,perl,python3-devel,swig,libsasl2-devel,libQt5Core-devel,cmake,libboost-devel,gettext-devel
|
||||
- c:\cygwin-setup.exe --quiet-mode --no-shortcuts --no-startmenu --no-desktop --upgrade-also --only-site --site http://cygwin.mirror.constant.com/ --root c:\cygwin-root --local-package-dir c:\cygwin-setup-cache --packages gcc-g++,make,pkg-config,wget,libssl-devel,libicu-devel,zlib-devel,libcrypt-devel,perl,python3-devel,swig,libsasl2-devel,libQt5Core-devel,cmake,libboost-devel,gettext-devel
|
||||
- c:\cygwin-root\bin\sh -lc "echo Hi"
|
||||
- c:\cygwin-root\bin\sh -lc "uname -a"
|
||||
- c:\cygwin-root\bin\sh -lc "cat /proc/cpuinfo"
|
||||
- c:\cygwin-root\bin\sh -lc "cat /proc/meminfo"
|
||||
- c:\cygwin-root\bin\sh -lc "cygcheck -s -v > $APPVEYOR_BUILD_FOLDER/cygcheck.log 2>&1"
|
||||
- ps: Push-AppveyorArtifact cygcheck.log
|
||||
- ps: |
|
||||
if ($env:build_with -eq "cmake") {
|
||||
$env:cfg_suffix = ".sh"
|
||||
$env:unittest = "unittest"
|
||||
$env:inttest = "inttest"
|
||||
} else {
|
||||
$env:cfg_suffix = ""
|
||||
$env:unittest = "test"
|
||||
$env:inttest = "test2"
|
||||
}
|
||||
# stdin is broken at AppVeyor, so we open it explicitly as /dev/null
|
||||
build_script:
|
||||
- git submodule update --init
|
||||
- c:\cygwin-root\bin\sh -lc "cd $APPVEYOR_BUILD_FOLDER; ./autogen.sh < /dev/null"
|
||||
- mkdir build
|
||||
- c:\cygwin-root\bin\sh -lc "cd $APPVEYOR_BUILD_FOLDER/build; ../configure$cfg_suffix --enable-charset --enable-zlib --enable-openssl --enable-perl --enable-python --enable-cyrus < /dev/null; result=$?; if [[ $build_with == cmake ]]; then cmake --system-information > config.log; fi; appveyor PushArtifact config.log; exit $result"
|
||||
- c:\cygwin-root\bin\sh -lc "cd $APPVEYOR_BUILD_FOLDER/build; ../configure.sh --enable-charset --enable-zlib --enable-openssl --enable-perl --enable-python --enable-cyrus < /dev/null; result=$?; cmake --system-information > config.log; appveyor PushArtifact config.log; exit $result"
|
||||
- c:\cygwin-root\bin\sh -lc "cd $APPVEYOR_BUILD_FOLDER/build; make VERBOSE=1 -j2 < /dev/null"
|
||||
- c:\cygwin-root\bin\sh -lc "cd $APPVEYOR_BUILD_FOLDER/build; make install < /dev/null"
|
||||
- c:\cygwin-root\bin\sh -lc "znc --version"
|
||||
@@ -47,5 +30,5 @@ build_script:
|
||||
- c:\cygwin-root\bin\sh -lc "find /usr/local/lib/znc -iname '*.dll' -o -iname '*.so' | tee /tmp/files-to-rebase"
|
||||
- c:\cygwin-root\bin\sh -lc "rebaseall -v -T /tmp/files-to-rebase"
|
||||
test_script:
|
||||
- c:\cygwin-root\bin\sh -lc "cd $APPVEYOR_BUILD_FOLDER/build; make VERBOSE=1 $unittest < /dev/null"
|
||||
- c:\cygwin-root\bin\sh -lc "cd $APPVEYOR_BUILD_FOLDER/build; make VERBOSE=1 $inttest < /dev/null"
|
||||
- c:\cygwin-root\bin\sh -lc "cd $APPVEYOR_BUILD_FOLDER/build; make VERBOSE=1 unittest < /dev/null"
|
||||
- c:\cygwin-root\bin\sh -lc "cd $APPVEYOR_BUILD_FOLDER/build; make VERBOSE=1 inttest < /dev/null"
|
||||
|
||||
42
.travis.yml
42
.travis.yml
@@ -13,41 +13,31 @@ matrix:
|
||||
- os: linux
|
||||
dist: xenial
|
||||
compiler: gcc
|
||||
env: BUILD_TYPE=normal BUILD_WITH=cmake
|
||||
- os: linux
|
||||
compiler: gcc
|
||||
env: BUILD_TYPE=normal BUILD_WITH=autoconf
|
||||
env: BUILD_TYPE=normal
|
||||
- os: linux
|
||||
compiler: clang
|
||||
env: BUILD_TYPE=asan BUILD_WITH=cmake
|
||||
env: BUILD_TYPE=asan
|
||||
- os: linux
|
||||
compiler: clang
|
||||
env: BUILD_TYPE=tsan BUILD_WITH=cmake
|
||||
env: BUILD_TYPE=tsan
|
||||
# TODO: enable
|
||||
# - os: linux
|
||||
# compiler: clang
|
||||
# env: BUILD_TYPE=msan BUILD_WITH=cmake
|
||||
# env: BUILD_TYPE=msan
|
||||
# - os: linux
|
||||
# compiler: clang
|
||||
# env: BUILD_TYPE=ubsan BUILD_WITH=cmake
|
||||
# env: BUILD_TYPE=ubsan
|
||||
- os: linux
|
||||
compiler: gcc
|
||||
env: BUILD_TYPE=normal BUILD_WITH=cmake
|
||||
env: BUILD_TYPE=normal
|
||||
arch: arm64
|
||||
- os: osx
|
||||
osx_image: xcode9.3 # macOS 10.13
|
||||
compiler: clang
|
||||
env: BUILD_TYPE=normal BUILD_WITH=cmake
|
||||
- os: osx
|
||||
osx_image: xcode9.3 # macOS 10.13
|
||||
compiler: clang
|
||||
env: BUILD_TYPE=normal BUILD_WITH=autoconf
|
||||
env: BUILD_TYPE=normal
|
||||
- os: linux
|
||||
compiler: gcc
|
||||
env: BUILD_TYPE=tarball BUILD_WITH=cmake
|
||||
- os: linux
|
||||
compiler: gcc
|
||||
env: BUILD_TYPE=tarball BUILD_WITH=autoconf
|
||||
env: BUILD_TYPE=tarball
|
||||
- stage: deploy
|
||||
os: linux
|
||||
env:
|
||||
@@ -99,7 +89,6 @@ before_install:
|
||||
- if [[ "$BUILD_TYPE" == "tsan" ]]; then MYCXXFLAGS+=" -fsanitize=thread -O1 -fPIE" MYLDFLAGS+=" -fsanitize=thread"; fi
|
||||
- if [[ "$BUILD_TYPE" == "msan" ]]; then MYCXXFLAGS+=" -fsanitize=memory -O1 -fno-omit-frame-pointer -fno-optimize-sibling-calls -fsanitize-memory-track-origins" MYLDFLAGS+=" -fsanitize=memory"; fi
|
||||
- if [[ "$BUILD_TYPE" == "ubsan" ]]; then MYCXXFLAGS=" -fsanitize=undefined -O1 -fPIE -fno-sanitize-recover" MYLDFLAGS="-fsanitize=undefined -pie -fno-sanitize-recover"; fi
|
||||
- if [[ "$BUILD_WITH" == "cmake" ]]; then CFGSUFFIX=.sh UNITTEST=unittest INTTEST=inttest; else CFGSUFFIX= UNITTEST=test INTTEST=test2; fi
|
||||
- if [[ "$CC" == "gcc" ]]; then MYCXXFLAGS+=" --coverage" MYLDFLAGS+=" --coverage"; fi
|
||||
- if [[ "$CC" == "clang" ]]; then MYCXXFLAGS+=" -fprofile-instr-generate -fcoverage-mapping" MYLDFLAGS+=" -fprofile-instr-generate"; fi
|
||||
install:
|
||||
@@ -107,7 +96,7 @@ install:
|
||||
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then lsb_release -a; fi
|
||||
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get update; fi
|
||||
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get install -y libperl-dev tcl-dev libsasl2-dev libicu-dev swig qtbase5-dev libboost-locale-dev python3-pip cpanminus; fi
|
||||
- if [[ "$TRAVIS_OS_NAME" == "linux" && "$BUILD_WITH" == "cmake" ]]; then sudo apt-get install -y cmake; fi
|
||||
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get install -y cmake; fi
|
||||
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then cpanm --local-lib=~/perl5 local::lib && eval $(perl -I ~/perl5/lib/perl5/ -Mlocal::lib); fi
|
||||
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then cpanm --notest Devel::Cover::Report::Clover; fi
|
||||
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then export ZNC_MODPERL_COVERAGE=1; fi
|
||||
@@ -121,9 +110,8 @@ install:
|
||||
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew list --versions; fi
|
||||
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update; fi
|
||||
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install swig icu4c jq qt5 gettext python cmake openssl pkg-config; fi
|
||||
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install autoconf automake; fi
|
||||
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew outdated python || brew upgrade python; fi
|
||||
- if [[ "$TRAVIS_OS_NAME" == "osx" && "$BUILD_WITH" == "cmake" ]]; then brew outdated cmake || brew upgrade cmake; fi
|
||||
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew outdated cmake || brew upgrade cmake; fi
|
||||
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew info --json=v1 --installed | jq .; fi
|
||||
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then export PKG_CONFIG_PATH="$(brew --prefix qt5)/lib/pkgconfig:$PKG_CONFIG_PATH"; fi
|
||||
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then ls -la ~/.cache; fi
|
||||
@@ -139,16 +127,15 @@ script:
|
||||
- if [[ "$BUILD_TYPE" == "tarball" ]]; then ./make-tarball.sh --nightly znc-git-2015-01-16 /tmp/znc-tarball.tar.gz; fi
|
||||
- if [[ "$BUILD_TYPE" == "tarball" ]]; then cd /tmp; tar xvf znc-tarball.tar.gz; fi
|
||||
- if [[ "$BUILD_TYPE" == "tarball" ]]; then cd /tmp/znc-git-2015-01-16; fi
|
||||
- if [[ "$BUILD_TYPE" != "tarball" && "$BUILD_WITH" != "cmake" ]]; then ./bootstrap.sh; fi
|
||||
- mkdir build
|
||||
- cd build
|
||||
- ../configure$CFGSUFFIX --enable-debug --enable-perl --enable-python --enable-tcl --enable-cyrus --enable-charset $CFGFLAGS CXXFLAGS="$CXXFLAGS $MYCXXFLAGS" LDFLAGS="$LDFLAGS $MYLDFLAGS"
|
||||
- if [[ "$BUILD_WITH" == "cmake" ]]; then cmake --system-information; else cat config.log; fi
|
||||
- ../configure.sh --enable-debug --enable-perl --enable-python --enable-tcl --enable-cyrus --enable-charset $CFGFLAGS CXXFLAGS="$CXXFLAGS $MYCXXFLAGS" LDFLAGS="$LDFLAGS $MYLDFLAGS"
|
||||
- cmake --system-information
|
||||
- make VERBOSE=1
|
||||
- env LLVM_PROFILE_FILE="$PWD/unittest.profraw" make VERBOSE=1 $UNITTEST
|
||||
- env LLVM_PROFILE_FILE="$PWD/unittest.profraw" make VERBOSE=1 unittest
|
||||
- sudo make install
|
||||
# TODO: use DEVEL_COVER_OPTIONS for https://metacpan.org/pod/Devel::Cover
|
||||
- env LLVM_PROFILE_FILE="$PWD/inttest.profraw" ZNC_MODPERL_COVERAGE_OPTS="-db,$PWD/cover_db" make VERBOSE=1 $INTTEST
|
||||
- env LLVM_PROFILE_FILE="$PWD/inttest.profraw" ZNC_MODPERL_COVERAGE_OPTS="-db,$PWD/cover_db" make VERBOSE=1 inttest
|
||||
- /usr/local/bin/znc --version
|
||||
after_success:
|
||||
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then ~/perl5/bin/cover --no-gcov --report=clover; fi
|
||||
@@ -157,7 +144,6 @@ after_success:
|
||||
xcrun llvm-profdata merge unittest.profraw -o unittest.profdata
|
||||
xcrun llvm-profdata merge inttest.profraw -o inttest.profdata
|
||||
xcrun llvm-cov show -show-line-counts-or-regions -instr-profile=unittest.profdata test/unittest_bin > unittest-cmake-coverage.txt
|
||||
xcrun llvm-cov show -show-line-counts-or-regions -instr-profile=unittest.profdata unittest > unittest-autoconf-coverage.txt
|
||||
xcrun llvm-cov show -show-line-counts-or-regions -instr-profile=inttest.profdata /usr/local/bin/znc > inttest-znc-coverage.txt
|
||||
find /usr/local/lib/znc -name '*.so' -or -name '*.bundle' | while read f; do xcrun llvm-cov show -show-line-counts-or-regions -instr-profile=inttest.profdata $f > inttest-$(basename $f)-coverage.txt; done
|
||||
fi
|
||||
|
||||
263
Makefile.in
263
Makefile.in
@@ -1,263 +0,0 @@
|
||||
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@
|
||||
includedir := @includedir@
|
||||
sbindir := @sbindir@
|
||||
localstatedir := @localstatedir@
|
||||
systemdsystemunitdir := @systemdsystemunitdir@
|
||||
CXX := @CXX@
|
||||
CXXFLAGS := -I$(srcdir)/include -Iinclude @CPPFLAGS@ @CXXFLAGS@
|
||||
LDFLAGS := @LDFLAGS@
|
||||
LIBS := @LIBS@
|
||||
LIBZNC := @LIBZNC@
|
||||
LIBZNCDIR:= @LIBZNCDIR@
|
||||
MODDIR := @MODDIR@
|
||||
DATADIR := @DATADIR@
|
||||
PKGCONFIGDIR := $(libdir)/pkgconfig
|
||||
INSTALL := @INSTALL@
|
||||
INSTALL_PROGRAM := @INSTALL_PROGRAM@
|
||||
INSTALL_SCRIPT := @INSTALL_SCRIPT@
|
||||
INSTALL_DATA := @INSTALL_DATA@
|
||||
GIT := @GIT@
|
||||
SED := @SED@
|
||||
|
||||
GTEST_DIR := @GTEST_DIR@
|
||||
GMOCK_DIR := @GMOCK_DIR@
|
||||
ifeq "$(GTEST_DIR)" ""
|
||||
GTEST_DIR := $(srcdir)/third_party/googletest/googletest
|
||||
endif
|
||||
ifeq "$(GMOCK_DIR)" ""
|
||||
GMOCK_DIR := $(srcdir)/third_party/googletest/googlemock
|
||||
endif
|
||||
qt_CFLAGS := @qt_CFLAGS@ -fPIC -std=c++11 -pthread
|
||||
qt_LIBS := @qt_LIBS@ -pthread
|
||||
|
||||
# Force the simple internal regex engine to get consistent behavior on all platforms.
|
||||
# See https://code.google.com/p/chromium/issues/detail?id=317224 for more details.
|
||||
GTEST_FLAGS := -DGTEST_HAS_POSIX_RE=0 -I$(GMOCK_DIR)/include -I$(GTEST_DIR)/include
|
||||
# Silence warnings about overload virtual Csock::Write(), and missing field
|
||||
# initializers in both gtest and gmock
|
||||
GTEST_FLAGS += -Wno-overloaded-virtual -Wno-missing-field-initializers
|
||||
|
||||
LIB_SRCS := ZNCString.cpp Csocket.cpp znc.cpp IRCNetwork.cpp User.cpp IRCSock.cpp \
|
||||
Client.cpp Chan.cpp Nick.cpp Server.cpp Modules.cpp MD5.cpp Buffer.cpp Utils.cpp \
|
||||
FileUtils.cpp HTTPSock.cpp Template.cpp ClientCommand.cpp Socket.cpp SHA256.cpp \
|
||||
WebModules.cpp Listener.cpp Config.cpp ZNCDebug.cpp Threads.cpp version.cpp Query.cpp \
|
||||
SSLVerifyHost.cpp Message.cpp Translation.cpp
|
||||
LIB_SRCS := $(addprefix src/,$(LIB_SRCS))
|
||||
BIN_SRCS := src/main.cpp
|
||||
LIB_OBJS := $(patsubst %cpp,%o,$(LIB_SRCS))
|
||||
BIN_OBJS := $(patsubst %cpp,%o,$(BIN_SRCS))
|
||||
TESTS := StringTest ConfigTest UtilsTest ThreadTest NickTest ClientTest NetworkTest \
|
||||
MessageTest ModulesTest IRCSockTest QueryTest BufferTest UserTest
|
||||
TESTS := $(addprefix test/,$(addsuffix .o,$(TESTS)))
|
||||
CLEAN := znc src/*.o test/*.o core core.* .version_extra .depend modules/.depend \
|
||||
unittest $(LIBZNC)
|
||||
DISTCLEAN := Makefile config.log config.status znc-buildmod include/znc/zncconfig.h \
|
||||
modules/Makefile man/Makefile znc.pc znc-uninstalled.pc test/Makefile
|
||||
|
||||
CXXFLAGS += -D_MODDIR_=\"$(MODDIR)\" -D_DATADIR_=\"$(DATADIR)\"
|
||||
|
||||
ifneq "$(V)" ""
|
||||
VERBOSE=1
|
||||
endif
|
||||
ifeq "$(VERBOSE)" ""
|
||||
Q=@
|
||||
E=@echo
|
||||
C=-s
|
||||
else
|
||||
Q=
|
||||
E=@\#
|
||||
C=
|
||||
endif
|
||||
|
||||
.PHONY: all man modules clean distclean install version_extra_recompile test
|
||||
.SECONDARY:
|
||||
|
||||
all: znc man modules $(LIBZNC)
|
||||
@echo ""
|
||||
@echo " ZNC was successfully compiled."
|
||||
@echo " Use '$(MAKE) install' to install ZNC to '$(prefix)'."
|
||||
|
||||
ifeq "$(LIBZNC)" ""
|
||||
OBJS := $(BIN_OBJS) $(LIB_OBJS)
|
||||
|
||||
znc: $(OBJS)
|
||||
$(E) Linking znc...
|
||||
$(Q)$(CXX) $(LDFLAGS) -o $@ $(OBJS) $(LIBS)
|
||||
|
||||
else
|
||||
znc: $(BIN_OBJS) $(LIBZNC)
|
||||
$(E) Linking znc...
|
||||
$(Q)$(CXX) $(LDFLAGS) -o $@ $(BIN_OBJS) -L. -lznc -Wl,-rpath,$(LIBZNCDIR) $(LIBS)
|
||||
|
||||
$(LIBZNC): $(LIB_OBJS)
|
||||
$(E) Linking $(LIBZNC)...
|
||||
$(Q)$(CXX) $(LDFLAGS) -shared -o $@ $(LIB_OBJS) $(LIBS) -Wl,--out-implib=libznc.dll.a
|
||||
endif
|
||||
|
||||
unittest: $(LIB_OBJS) test/gtest-all.o test/gmock-all.o test/gmock-main.o $(TESTS)
|
||||
$(E) Linking unit test...
|
||||
$(Q)$(CXX) $(LDFLAGS) -o $@ $(LIB_OBJS) test/gtest-all.o test/gmock-all.o test/gmock-main.o $(TESTS) $(LIBS)
|
||||
|
||||
inttest: test/Integration.o test/Int-gtest-all.o test/Int-gmock-all.o
|
||||
$(E) Linking integration test...
|
||||
$(Q)g++ -std=c++11 -o $@ test/Integration.o test/Int-gtest-all.o test/Int-gmock-all.o $(LIBS) $(qt_LIBS)
|
||||
|
||||
man:
|
||||
@$(MAKE) -C man $(C)
|
||||
|
||||
modules: $(LIBZNC) include/znc/Csocket.h
|
||||
@$(MAKE) -C modules $(C)
|
||||
|
||||
clean:
|
||||
rm -rf $(CLEAN)
|
||||
@$(MAKE) -C modules clean;
|
||||
@$(MAKE) -C man clean
|
||||
|
||||
distclean: clean
|
||||
rm -rf $(DISTCLEAN)
|
||||
|
||||
src/%.o: src/%.cpp Makefile include/znc/Csocket.h
|
||||
@mkdir -p .depend src
|
||||
$(E) Building core object $*...
|
||||
$(Q)$(CXX) $(CXXFLAGS) -c -o $@ $< -MD -MF .depend/$*.dep -MT $@
|
||||
|
||||
test/%.o: test/%.cpp Makefile include/znc/Csocket.h
|
||||
@mkdir -p .depend test
|
||||
$(E) Building test object $*...
|
||||
$(Q)$(CXX) $(CXXFLAGS) $(GTEST_FLAGS) -c -o $@ $< -MD -MF .depend/$*.test.dep -MT $@
|
||||
|
||||
test/gtest-all.o: $(GTEST_DIR)/src/gtest-all.cc Makefile
|
||||
@mkdir -p .depend test
|
||||
$(E) Building test object gtest-all...
|
||||
$(Q)$(CXX) $(CXXFLAGS) $(GTEST_FLAGS) -I$(GTEST_DIR) -c -o $@ $< -MD -MF .depend/gtest-all.dep -MT $@
|
||||
|
||||
test/gmock-all.o: $(GMOCK_DIR)/src/gmock-all.cc Makefile
|
||||
@mkdir -p .depend test
|
||||
$(E) Building test object gmock-all...
|
||||
$(Q)$(CXX) $(CXXFLAGS) $(GTEST_FLAGS) -I$(GMOCK_DIR) -c -o $@ $< -MD -MF .depend/gmock-all.dep -MT $@
|
||||
|
||||
test/gmock-main.o: $(GMOCK_DIR)/src/gmock_main.cc Makefile
|
||||
@mkdir -p .depend test
|
||||
$(E) Building test object gmock-main...
|
||||
$(Q)$(CXX) $(CXXFLAGS) $(GTEST_FLAGS) -c -o $@ $< -MD -MF .depend/gmock-main.dep -MT $@
|
||||
|
||||
# Qt fails under TSAN, so CXXFLAGS/LDFLAGS can't be used.
|
||||
test/Integration.o: test/integration/autoconf-all.cpp Makefile
|
||||
@mkdir -p .depend test
|
||||
$(E) Building test object Integration...
|
||||
$(Q)g++ $(qt_CFLAGS) $(GTEST_FLAGS) -I$(srcdir)/test/integration/framework -c -o $@ $< -MD -MF .depend/Integration.test.dep -MT $@ '-DZNC_BIN_DIR="$(bindir)"' '-DZNC_SRC_DIR="$(realpath $(srcdir))"'
|
||||
test/Int-gtest-all.o: $(GTEST_DIR)/src/gtest-all.cc Makefile
|
||||
@mkdir -p .depend test
|
||||
$(E) Building test object Int-gtest-all...
|
||||
$(Q)g++ $(qt_CFLAGS) $(GTEST_FLAGS) -I$(GTEST_DIR) -c -o $@ $< -MD -MF .depend/Int-gtest-all.dep -MT $@
|
||||
test/Int-gmock-all.o: $(GMOCK_DIR)/src/gmock-all.cc Makefile
|
||||
@mkdir -p .depend test
|
||||
$(E) Building test object Int-gmock-all...
|
||||
$(Q)g++ $(qt_CFLAGS) $(GTEST_FLAGS) -I$(GMOCK_DIR) -c -o $@ $< -MD -MF .depend/Int-gmock-all.dep -MT $@
|
||||
test/Int-gmock-main.o: $(GMOCK_DIR)/src/gmock_main.cc Makefile
|
||||
@mkdir -p .depend test
|
||||
$(E) Building test object Int-gmock-main...
|
||||
$(Q)g++ $(qt_CFLAGS) $(GTEST_FLAGS) -c -o $@ $< -MD -MF .depend/Int-gmock-main.dep -MT $@
|
||||
|
||||
ifneq "THIS_IS_NOT_TARBALL" ""
|
||||
# If git commit was changed since previous build, add a phony target to dependencies, forcing version.o to be recompiled
|
||||
# Nightlies have pregenerated version.cpp
|
||||
src/version.cpp: Makefile version.sh $(shell if [ x`cat .version_extra 2> /dev/null` != x`$(srcdir)/version.sh "$(GIT)" 3>&2 2> /dev/null` ]; then echo version_extra_recompile; fi)
|
||||
@mkdir -p .depend src
|
||||
$(E) Building source file version.cpp...
|
||||
$(Q)WRITE_OUTPUT=yes $(srcdir)/version.sh "$(GIT)" > .version_extra 2> /dev/null
|
||||
|
||||
CLEAN += src/version.cpp
|
||||
endif
|
||||
|
||||
CLEAN += src/Csocket.cpp include/znc/Csocket.h
|
||||
|
||||
src/Csocket.cpp: third_party/Csocket/Csocket.cc
|
||||
@rm -f $@
|
||||
@mkdir -p src
|
||||
@sed -e 's:#include "Csocket.h":#include <znc/Csocket.h>:' $^ > $@
|
||||
include/znc/Csocket.h: third_party/Csocket/Csocket.h
|
||||
@rm -f $@
|
||||
@mkdir -p include/znc
|
||||
@sed -e 's:#include "defines.h":#include <znc/defines.h>:' $^ > $@
|
||||
third_party/Csocket/Csocket.h third_party/Csocket/Csocket.cc:
|
||||
@echo It looks like git submodules are not initialized. Run: git submodule update --init --recursive
|
||||
@exit 1
|
||||
|
||||
znc.service: znc.service.in
|
||||
@sed -e "s:\@CMAKE_INSTALL_FULL_BINDIR\@:$(bindir):" $^ > $@
|
||||
|
||||
CLEAN += znc.service
|
||||
|
||||
install: znc znc.service $(LIBZNC)
|
||||
test -d $(DESTDIR)$(bindir) || $(INSTALL) -d $(DESTDIR)$(bindir)
|
||||
test -d $(DESTDIR)$(includedir)/znc || $(INSTALL) -d $(DESTDIR)$(includedir)/znc
|
||||
test -d $(DESTDIR)$(PKGCONFIGDIR) || $(INSTALL) -d $(DESTDIR)$(PKGCONFIGDIR)
|
||||
test -d $(DESTDIR)$(MODDIR) || $(INSTALL) -d $(DESTDIR)$(MODDIR)
|
||||
test -d $(DESTDIR)$(DATADIR) || $(INSTALL) -d $(DESTDIR)$(DATADIR)
|
||||
cp -R $(srcdir)/webskins $(DESTDIR)$(DATADIR)
|
||||
find $(DESTDIR)$(DATADIR)/webskins -type d -exec chmod 0755 '{}' \;
|
||||
find $(DESTDIR)$(DATADIR)/webskins -type f -exec chmod 0644 '{}' \;
|
||||
$(INSTALL_PROGRAM) znc $(DESTDIR)$(bindir)
|
||||
$(INSTALL_SCRIPT) znc-buildmod $(DESTDIR)$(bindir)
|
||||
$(INSTALL_DATA) $(srcdir)/include/znc/*.h $(DESTDIR)$(includedir)/znc
|
||||
$(INSTALL_DATA) include/znc/*.h $(DESTDIR)$(includedir)/znc
|
||||
$(INSTALL_DATA) znc.pc $(DESTDIR)$(PKGCONFIGDIR)
|
||||
@$(MAKE) -C modules install DESTDIR=$(DESTDIR);
|
||||
if test -n "$(LIBZNC)"; then \
|
||||
test -d $(DESTDIR)$(LIBZNCDIR) || $(INSTALL) -d $(DESTDIR)$(LIBZNCDIR) || exit 1 ; \
|
||||
$(INSTALL_PROGRAM) $(LIBZNC) $(DESTDIR)$(LIBZNCDIR) || exit 1 ; \
|
||||
$(INSTALL_PROGRAM) libznc.dll.a $(DESTDIR)$(libdir) || exit 1 ; \
|
||||
fi
|
||||
@$(MAKE) -C man install DESTDIR=$(DESTDIR)
|
||||
@HAVE_SYSTEMD_TRUE@test -d $(DESTDIR)$(systemdsystemunitdir) || $(INSTALL) -d $(DESTDIR)$(systemdsystemunitdir)
|
||||
@HAVE_SYSTEMD_TRUE@$(INSTALL_DATA) $(srcdir)/znc.service $(DESTDIR)$(systemdsystemunitdir)
|
||||
@echo ""
|
||||
@echo "******************************************************************"
|
||||
@echo " ZNC was successfully installed."
|
||||
@echo " You can use '$(bindir)/znc --makeconf'"
|
||||
@echo " to generate a config file."
|
||||
@echo ""
|
||||
@echo " If you need help with using ZNC, please visit our wiki at:"
|
||||
@echo " https://znc.in"
|
||||
|
||||
uninstall:
|
||||
rm $(DESTDIR)$(bindir)/znc
|
||||
rm $(DESTDIR)$(bindir)/znc-buildmod
|
||||
rm $(DESTDIR)$(includedir)/znc/*.h
|
||||
rm $(DESTDIR)$(PKGCONFIGDIR)/znc.pc
|
||||
rm -rf $(DESTDIR)$(DATADIR)/webskins
|
||||
if test -n "$(LIBZNC)"; then \
|
||||
rm $(DESTDIR)$(LIBZNCDIR)/$(LIBZNC) || exit 1 ; \
|
||||
rmdir $(DESTDIR)$(LIBZNCDIR) || exit 1 ; \
|
||||
fi
|
||||
@$(MAKE) -C man uninstall DESTDIR=$(DESTDIR)
|
||||
@if test -n "modules"; then \
|
||||
$(MAKE) -C modules uninstall DESTDIR=$(DESTDIR); \
|
||||
fi
|
||||
rmdir $(DESTDIR)$(bindir)
|
||||
rmdir $(DESTDIR)$(includedir)/znc
|
||||
rmdir $(DESTDIR)$(PKGCONFIGDIR)
|
||||
@echo "Successfully uninstalled, but empty directories were left behind"
|
||||
|
||||
test: unittest
|
||||
$(Q)./unittest
|
||||
|
||||
# This test uses files at <prefix>/lib/znc, which is less than ideal, especially from build scripts of distros.
|
||||
# That's why it's a separate make target.
|
||||
test2: inttest
|
||||
$(Q)./inttest
|
||||
|
||||
-include $(wildcard .depend/*.dep)
|
||||
34
README.md
34
README.md
@@ -27,9 +27,7 @@ Core:
|
||||
* GNU make
|
||||
* pkg-config
|
||||
* GCC 4.8 or clang 3.2
|
||||
* Either of:
|
||||
* autoconf and automake (but only if building from git, not from tarball)
|
||||
* CMake
|
||||
* CMake
|
||||
|
||||
## Optional Requirements
|
||||
|
||||
@@ -55,20 +53,11 @@ Character Encodings:
|
||||
* To get proper character encoding and charsets install ICU (`libicu4-dev`)
|
||||
|
||||
I18N (UI translation)
|
||||
* CMake-based build only
|
||||
* Boost.Locale
|
||||
* gettext is a build dependency
|
||||
|
||||
## Installing ZNC
|
||||
|
||||
Currently there are 2 build systems in place: CMake and `./configure`.
|
||||
`./configure` will eventually be removed.
|
||||
There is also `configure.sh` which should make migration to CMake easier:
|
||||
it accepts the same parameters as `./configure`,
|
||||
but calls CMake with CMake-style parameters.
|
||||
|
||||
### Installing with CMake
|
||||
|
||||
Installation from source code is performed using the CMake toolchain.
|
||||
|
||||
```shell
|
||||
@@ -81,29 +70,16 @@ make install
|
||||
|
||||
You can use `cmake-gui` or `ccmake` for more interactiveness.
|
||||
|
||||
There is also `configure.sh` which should make migration to CMake easier:
|
||||
it accepts the same parameters as old `./configure`,
|
||||
but calls CMake with CMake-style parameters.
|
||||
|
||||
Note for FreeBSD users:
|
||||
By default base OpenSSL is selected.
|
||||
If you want the one from ports, use `-DOPENSSL_ROOT_DIR=/usr/local`.
|
||||
|
||||
For troubleshooting, `cmake --system-information` will show you details.
|
||||
|
||||
### Installing with `./configure`
|
||||
|
||||
Installation from source code is performed using the `automake` toolchain.
|
||||
If you are building from git, you will need to run `./autogen.sh` first to
|
||||
produce the `configure` script.
|
||||
|
||||
```shell
|
||||
mkdir build
|
||||
cd build
|
||||
../configure
|
||||
make
|
||||
make install
|
||||
```
|
||||
|
||||
You can use `./configure --help` if you want to get a list of options, though
|
||||
the defaults should be suiting most needs.
|
||||
|
||||
## Setting up znc.conf
|
||||
|
||||
For setting up a configuration file in `~/.znc` you can simply do
|
||||
|
||||
44
autogen.sh
44
autogen.sh
@@ -1,44 +0,0 @@
|
||||
#!/bin/sh
|
||||
# Run this to generate all the initial makefiles, etc.
|
||||
# This is based on various examples which can be found everywhere.
|
||||
set -e
|
||||
|
||||
FLAGS=${FLAGS--Wall}
|
||||
ACLOCAL=${ACLOCAL-aclocal}
|
||||
AUTOHEADER=${AUTOHEADER-autoheader}
|
||||
AUTOCONF=${AUTOCONF-autoconf}
|
||||
AUTOMAKE=${AUTOMAKE-automake}
|
||||
ACLOCAL_FLAGS="${ACLOCAL_FLAGS--I m4} ${FLAGS}"
|
||||
AUTOHEADER_FLAGS="${AUTOHEADER_FLAGS} ${FLAGS}"
|
||||
AUTOCONF_FLAGS="${AUTOCONF_FLAGS} ${FLAGS}"
|
||||
AUTOMAKE_FLAGS="${AUTOMAKE_FLAGS---add-missing} ${FLAGS}"
|
||||
|
||||
die() {
|
||||
echo "$@"
|
||||
exit 1
|
||||
}
|
||||
do_cmd() {
|
||||
echo "Running '$@'"
|
||||
$@
|
||||
}
|
||||
|
||||
test -f configure.ac || die "No configure.ac found."
|
||||
which pkg-config > /dev/null || die "ERROR: pkg-config not found. Install pkg-config and run $0 again"
|
||||
|
||||
# Generate aclocal.m4 for use by autoconf
|
||||
do_cmd $ACLOCAL $ACLOCAL_FLAGS
|
||||
# Generate zncconfig.h.in for configure
|
||||
do_cmd $AUTOHEADER $AUTOHEADER_FLAGS
|
||||
# Generate configure
|
||||
do_cmd $AUTOCONF $AUTOCONF_FLAGS
|
||||
|
||||
# Copy config.sub, config.guess, install.sh, ...
|
||||
# This will complain that we don't use automake, let's just ignore that
|
||||
do_cmd $AUTOMAKE $AUTOMAKE_FLAGS || true
|
||||
test -f config.guess -a -f config.sub -a -f install-sh ||
|
||||
die "Automake didn't install config.guess, config.sub and install-sh!"
|
||||
|
||||
echo "(Yes, automake is supposed to fail, ignore that)"
|
||||
echo
|
||||
|
||||
echo "You may now run ./configure."
|
||||
@@ -1 +0,0 @@
|
||||
autogen.sh
|
||||
752
configure.ac
752
configure.ac
@@ -1,752 +0,0 @@
|
||||
dnl This redefines AC_PROG_CC to a version which errors out instead. This is
|
||||
dnl because all our tests should be done with the C++ compiler. This should
|
||||
dnl catch stuff which accidentally uses the C compiler.
|
||||
AC_DEFUN([AC_PROG_CC], [m4_errprint(__file__:__line__[: Something is trying to use the C compiler. Since this is a C++ project, this should not happen!
|
||||
])m4_exit(1)])
|
||||
|
||||
dnl Needed for AC_PATH_PROGS_FEATURE_CHECK which was added in 2.62
|
||||
AC_PREREQ([2.62])
|
||||
dnl Keep the version number in sync with version.h!
|
||||
AC_INIT([znc], [1.9.x])
|
||||
LIBZNC_VERSION=1.9.x
|
||||
AC_CONFIG_MACRO_DIR([m4])
|
||||
AC_CONFIG_SRCDIR([src/znc.cpp])
|
||||
AC_LANG([C++])
|
||||
AC_CONFIG_HEADERS([include/znc/zncconfig.h])
|
||||
AH_TOP([#ifndef ZNCCONFIG_H
|
||||
#define ZNCCONFIG_H])
|
||||
AH_BOTTOM([#endif /* ZNCCONFIG_H */])
|
||||
|
||||
AC_DEFUN([ZNC_AUTO_FAIL], [
|
||||
# This looks better in the summary at the end
|
||||
$1="not found"
|
||||
if test "x$old_$1" != "xauto" ; then
|
||||
AC_MSG_ERROR([$2])
|
||||
else
|
||||
AC_MSG_WARN([$3])
|
||||
fi
|
||||
])
|
||||
|
||||
# AC_PROG_CXX sets CXXFLAGS to "-O2 -g" if it is unset which we don't want
|
||||
CXXFLAGS="$CXXFLAGS "
|
||||
AC_PROG_CXX
|
||||
# "Optional" because we want custom error message
|
||||
AX_CXX_COMPILE_STDCXX_11([noext], [optional])
|
||||
if test x"$HAVE_CXX11" != x1; then
|
||||
AC_MSG_ERROR([Upgrade your compiler. GCC 4.8+ and Clang 3.2+ are known to work.])
|
||||
fi
|
||||
|
||||
appendLib () {
|
||||
if test "$LIBS" != ""; then
|
||||
LIBS="$LIBS $*"
|
||||
else
|
||||
LIBS=$*
|
||||
fi
|
||||
}
|
||||
|
||||
appendCXX () {
|
||||
if test "$CXXFLAGS" != ""; then
|
||||
CXXFLAGS="$CXXFLAGS $*"
|
||||
else
|
||||
CXXFLAGS=$*
|
||||
fi
|
||||
}
|
||||
|
||||
appendMod () {
|
||||
if test "$MODFLAGS" != ""; then
|
||||
MODFLAGS="$MODFLAGS $*"
|
||||
else
|
||||
MODFLAGS=$*
|
||||
fi
|
||||
}
|
||||
|
||||
appendLD () {
|
||||
if test "$LDFLAGS" != ""; then
|
||||
LDFLAGS="$LDFLAGS $*"
|
||||
else
|
||||
LDFLAGS=$*
|
||||
fi
|
||||
}
|
||||
|
||||
AC_PROG_INSTALL
|
||||
AC_PROG_GREP
|
||||
AC_PROG_SED
|
||||
AC_CANONICAL_HOST
|
||||
AC_SYS_LARGEFILE
|
||||
ZNC_VISIBILITY
|
||||
AC_PATH_PROG([GIT], [git])
|
||||
PKG_PROG_PKG_CONFIG()
|
||||
|
||||
AC_ARG_ENABLE( [debug],
|
||||
AS_HELP_STRING([--enable-debug], [enable debugging]),
|
||||
[DEBUG="$enableval"],
|
||||
[DEBUG="no"])
|
||||
AC_ARG_ENABLE( [ipv6],
|
||||
AS_HELP_STRING([--disable-ipv6], [disable ipv6 support]),
|
||||
[IPV6="$enableval"],
|
||||
[IPV6="yes"])
|
||||
AC_ARG_ENABLE( [openssl],
|
||||
AS_HELP_STRING([--disable-openssl], [disable openssl]),
|
||||
[SSL="$enableval"],
|
||||
[SSL="auto"])
|
||||
AC_ARG_ENABLE( [zlib],
|
||||
AS_HELP_STRING([--disable-zlib], [disable zlib]),
|
||||
[ZLIB="$enableval"],
|
||||
[ZLIB="auto"])
|
||||
AC_ARG_ENABLE( [perl],
|
||||
AS_HELP_STRING([--enable-perl], [enable perl]),
|
||||
[PERL="$enableval"],
|
||||
[PERL="no"])
|
||||
AC_ARG_ENABLE( [python],
|
||||
AS_HELP_STRING([--enable-python[[[=python3]]]], [enable python.
|
||||
By default python3.pc of pkg-config is used, but you can use
|
||||
another name, for example python-3.1]),
|
||||
[PYTHON="$enableval"],
|
||||
[PYTHON="no"])
|
||||
AC_ARG_ENABLE( [swig],
|
||||
AS_HELP_STRING([--enable-swig], [Enable automatic generation of source files needed for modperl/modpython.
|
||||
This value is ignored if perl and python are disabled.
|
||||
Usually no need to enable it.
|
||||
]),
|
||||
[USESWIG="$enableval"],
|
||||
[USESWIG="auto"])
|
||||
AC_ARG_ENABLE( [cyrus],
|
||||
AS_HELP_STRING([--enable-cyrus], [enable cyrus]),
|
||||
[if test "$enableval" = "yes" ; then CYRUS=1; fi],)
|
||||
AC_ARG_ENABLE( [optimization],
|
||||
AS_HELP_STRING([--disable-optimization], [Disable some compiler optimizations to
|
||||
decrease memory usage while compiling]),
|
||||
[OPTIMIZE="$enableval"],
|
||||
[OPTIMIZE="yes"])
|
||||
AC_ARG_ENABLE( [tdns],
|
||||
AS_HELP_STRING([--disable-tdns], [disable threads usage for DNS resolving]),
|
||||
[TDNS="$enableval"],
|
||||
[TDNS="auto"])
|
||||
AC_ARG_ENABLE( [run-from-source],
|
||||
AS_HELP_STRING([--enable-run-from-source], [ZNC will be runnable without installation]),
|
||||
[if test "x$enableval" = "xyes" ; then
|
||||
AC_DEFINE([RUN_FROM_SOURCE], [1],
|
||||
[Define if ZNC should be runnable without installation])
|
||||
fi
|
||||
RUNFROMSOURCE="$enableval"],
|
||||
[RUNFROMSOURCE="no"])
|
||||
AC_ARG_ENABLE( [poll],
|
||||
AS_HELP_STRING([--disable-poll], [use select() instead of poll()]),
|
||||
[POLL="$enableval"],
|
||||
[POLL="yes"])
|
||||
|
||||
AC_ARG_WITH( [gtest],
|
||||
AS_HELP_STRING([--with-gtest=DIR], [Path to directory with src/gtest-all.cc file.
|
||||
If not specified, git submodule will be used.
|
||||
If it is not available either, "make test" will fail.]))
|
||||
if test "x$with_gtest" != xno; then
|
||||
AC_SUBST([GTEST_DIR], [$with_gtest])
|
||||
fi
|
||||
AC_ARG_WITH([gmock],
|
||||
AS_HELP_STRING([--with-gmock=DIR], [Path to directory with src/gmock-all.cc and src/gmock_main.cc files.
|
||||
If not specified, git submodule will be used.
|
||||
If it is not available either, "make test" will fail.]))
|
||||
if test "x$with_gmock" != xno; then
|
||||
AC_SUBST([GMOCK_DIR], [$with_gmock])
|
||||
fi
|
||||
|
||||
|
||||
AC_ARG_WITH([systemdsystemunitdir],
|
||||
AS_HELP_STRING([--with-systemdsystemunitdir=DIR], [Directory for systemd service files]),
|
||||
[
|
||||
if test x"$with_systemdsystemunitdir" = xyes; then
|
||||
with_systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd)
|
||||
fi
|
||||
])
|
||||
if test "x$with_systemdsystemunitdir" != xno; then
|
||||
AC_SUBST([systemdsystemunitdir], [$with_systemdsystemunitdir])
|
||||
fi
|
||||
AM_CONDITIONAL(HAVE_SYSTEMD, [test -n "$with_systemdsystemunitdir" -a "x$with_systemdsystemunitdir" != xno ])
|
||||
|
||||
case "${host_os}" in
|
||||
freebsd*)
|
||||
# -D__GNU_LIBRARY__ makes this work on fbsd 4.11
|
||||
appendCXX -I/usr/local/include -D__GNU_LIBRARY__
|
||||
appendLib -L/usr/local/lib -lcompat
|
||||
appendMod -L/usr/local/lib
|
||||
;;
|
||||
solaris*)
|
||||
appendLib -lsocket -lnsl -lresolv
|
||||
ISSUN=1
|
||||
;;
|
||||
cygwin)
|
||||
# We don't want to use -std=gnu++11 instead of -std=c++11, but among other things, -std=c++11 defines __STRICT_ANSI__ which makes cygwin not to compile: undefined references to strerror_r, to fdopen, to strcasecmp, etc (their declarations in system headers are between ifdef)
|
||||
appendCXX -U__STRICT_ANSI__
|
||||
ISCYGWIN=1
|
||||
;;
|
||||
darwin*)
|
||||
ISDARWIN=1
|
||||
|
||||
AC_PATH_PROG([BREW], [brew])
|
||||
if test -n "$BREW"; then
|
||||
# add default homebrew paths
|
||||
|
||||
if test "x$HAVE_ICU" != "xno"; then
|
||||
AC_MSG_CHECKING([icu4c via homebrew])
|
||||
icu4c_prefix=`$BREW --prefix icu4c`
|
||||
if test -n "$icu4c_prefix"; then
|
||||
export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:$icu4c_prefix/lib/pkgconfig"
|
||||
AC_MSG_RESULT([$icu4c_prefix])
|
||||
else
|
||||
AC_MSG_RESULT([no])
|
||||
fi
|
||||
fi
|
||||
|
||||
if test "x$PYTHON" != "xno"; then
|
||||
brew_python_pc="$PYTHON"
|
||||
# This is duplication of non-darwin python logic below...
|
||||
if test "x$brew_python_pc" = "xyes"; then
|
||||
brew_python_pc="python3"
|
||||
fi
|
||||
AC_MSG_CHECKING([python3 via homebrew])
|
||||
python3_prefix=`$BREW --prefix python3`
|
||||
if test -n "$python3_prefix"; then
|
||||
python3_prefix=`find "$python3_prefix/" -name $brew_python_pc.pc | head -n1`
|
||||
if test -n "$python3_prefix"; then
|
||||
python3_prefix=`dirname "$python3_prefix"`
|
||||
export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:$python3_prefix"
|
||||
AC_MSG_RESULT([$python3_prefix])
|
||||
else
|
||||
AC_MSG_RESULT([no $brew_python_pc.pc found])
|
||||
fi
|
||||
else
|
||||
AC_MSG_RESULT([no])
|
||||
fi
|
||||
fi
|
||||
|
||||
if test "x$SSL" != "xno"; then
|
||||
AC_MSG_CHECKING([openssl via homebrew])
|
||||
openssl_prefix=`$BREW --prefix openssl`
|
||||
if test -n "$openssl_prefix"; then
|
||||
export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:$openssl_prefix/lib/pkgconfig"
|
||||
AC_MSG_RESULT([$openssl_prefix])
|
||||
else
|
||||
AC_MSG_RESULT([no])
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
if test "$DEBUG" != "no"; then
|
||||
appendCXX -ggdb3
|
||||
AC_DEFINE([_DEBUG], [1], [Define for debugging])
|
||||
if test "x$ISCYGWIN" != x1; then
|
||||
# These enable some debug options in g++'s STL, e.g. invalid use of iterators
|
||||
# But they cause crashes on cygwin while loading modules
|
||||
AC_DEFINE([_GLIBCXX_DEBUG], [1], [Enable extra debugging checks in libstdc++])
|
||||
AC_DEFINE([_GLIBCXX_DEBUG_PEDANTIC], [1], [Enable extra debugging checks in libstdc++])
|
||||
fi
|
||||
else
|
||||
if test "x$OPTIMIZE" = "xyes"; then
|
||||
appendCXX -O2
|
||||
|
||||
# In old times needed to define _FORTIFY_SOURCE to 2 ourself.
|
||||
# Then GCC started to define it itself to 2. It was ok.
|
||||
# But then GCC 4.7 started to define it to 0 or 2 depending on optimization level, and it started to conflict with our define.
|
||||
AC_MSG_CHECKING([whether compiler predefines _FORTIFY_SOURCE])
|
||||
AC_COMPILE_IFELSE([
|
||||
AC_LANG_PROGRAM([[
|
||||
]], [[
|
||||
#ifndef _FORTIFY_SOURCE
|
||||
#error "Just checking, nothing fatal here"
|
||||
#endif
|
||||
]])
|
||||
], [
|
||||
AC_MSG_RESULT([yes])
|
||||
], [
|
||||
AC_MSG_RESULT([no])
|
||||
appendCXX "-D_FORTIFY_SOURCE=2"
|
||||
])
|
||||
fi
|
||||
fi
|
||||
|
||||
if test "$IPV6" != "no"; then
|
||||
AC_DEFINE([HAVE_IPV6], [1], [Define if IPv6 support is enabled])
|
||||
fi
|
||||
|
||||
if test "x$GXX" = "xyes"; then
|
||||
appendCXX -Wall -W -Wno-unused-parameter -Woverloaded-virtual -Wshadow
|
||||
fi
|
||||
|
||||
if test "$POLL" = "yes"; then
|
||||
# poll() is broken on Mac OS, it fails with POLLNVAL for pipe()s.
|
||||
if test -n "$ISDARWIN"
|
||||
then
|
||||
# Did they give us --enable-poll?
|
||||
if test -n "$enable_poll"
|
||||
then
|
||||
# Yes, they asked for this.
|
||||
AC_MSG_WARN([poll() is known to be broken on Mac OS X. You have been warned.])
|
||||
else
|
||||
# No, our default value of "yes" got applied.
|
||||
AC_MSG_WARN([poll() is known to be broken on Mac OS X. Using select() instead.])
|
||||
AC_MSG_WARN([Use --enable-poll for forcing poll() to be used.])
|
||||
POLL=no
|
||||
fi
|
||||
fi
|
||||
if test "$POLL" = "yes"; then
|
||||
AC_DEFINE([CSOCK_USE_POLL], [1], [Use poll() instead of select()])
|
||||
fi
|
||||
fi
|
||||
|
||||
AC_CHECK_LIB( gnugetopt, getopt_long,)
|
||||
AC_CHECK_FUNCS([lstat getopt_long getpassphrase clock_gettime tcsetattr])
|
||||
|
||||
# ----- Check for dlopen
|
||||
|
||||
AC_SEARCH_LIBS([dlopen], [dl], [],
|
||||
[AC_MSG_ERROR([Could not find dlopen. ZNC will not work on this box until you upgrade this ancient system or at least install the necessary system libraries.])])
|
||||
|
||||
# ----- Check for pthreads
|
||||
|
||||
AX_PTHREAD([
|
||||
AC_DEFINE([HAVE_PTHREAD], [1], [Define if you have POSIX threads libraries and header files.])
|
||||
appendCXX "$PTHREAD_CFLAGS"
|
||||
appendLib "$PTHREAD_LIBS"
|
||||
], [
|
||||
AC_MSG_ERROR([This compiler/OS doesn't seem to support pthreads.])
|
||||
])
|
||||
|
||||
# Note that old broken systems, such as OpenBSD, NetBSD, which don't support AI_ADDRCONFIG, also have thread-unsafe getaddrinfo().
|
||||
# Gladly, they fixed thread-safety before support of AI_ADDRCONFIG, so this can be abused to detect the thread-safe getaddrinfo().
|
||||
#
|
||||
# TODO: drop support of blocking DNS at some point. OpenBSD supports AI_ADDRCONFIG since Nov 2014, and their getaddrinfo() is thread-safe since Nov 2013. NetBSD's one is thread-safe since ages ago.
|
||||
DNS_TEXT=blocking
|
||||
if test "x$TDNS" != "xno"; then
|
||||
old_TDNS=$TDNS
|
||||
AC_MSG_CHECKING([whether getaddrinfo() supports AI_ADDRCONFIG])
|
||||
AC_COMPILE_IFELSE([
|
||||
AC_LANG_PROGRAM([[
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
#include <netdb.h>
|
||||
]], [[
|
||||
int x = AI_ADDRCONFIG;
|
||||
(void) x;
|
||||
]])
|
||||
], [
|
||||
AC_MSG_RESULT([yes])
|
||||
TDNS=yes
|
||||
], [
|
||||
AC_MSG_RESULT([no])
|
||||
TDNS=no
|
||||
])
|
||||
if test "x$TDNS" = "xyes"; then
|
||||
DNS_TEXT=threads
|
||||
AC_DEFINE([HAVE_THREADED_DNS], [1], [Define if threaded DNS is enabled])
|
||||
else
|
||||
ZNC_AUTO_FAIL([TDNS],
|
||||
[support for threaded DNS not found. Try --disable-tdns.
|
||||
Disabling it may result in a slight performance decrease but will not have any other side-effects],
|
||||
[support for threaded DNS not found, so DNS resolving will be blocking])
|
||||
fi
|
||||
fi
|
||||
|
||||
# ----- Check for openssl
|
||||
|
||||
SSL_TEXT="$SSL"
|
||||
if test "x$SSL" != "xno"; then
|
||||
old_SSL=$SSL
|
||||
PKG_CHECK_MODULES([openssl], [openssl], [
|
||||
appendLib "$openssl_LIBS"
|
||||
appendCXX "$openssl_CFLAGS"
|
||||
], [
|
||||
# Don't reorder this!
|
||||
# On some arches libssl depends on libcrypto without linking to it :(
|
||||
AC_CHECK_LIB( crypto, BIO_new,, SSL=no ; SSL_TEXT="no (libcrypt not found)" )
|
||||
AC_CHECK_LIB( ssl, SSL_shutdown,, SSL=no ; SSL_TEXT="no (libssl not found)" )
|
||||
])
|
||||
|
||||
if test "x$SSL" != "xno"; then
|
||||
AC_MSG_CHECKING([whether openssl is usable])
|
||||
AC_LINK_IFELSE([
|
||||
AC_LANG_PROGRAM([[
|
||||
#include <openssl/ssl.h>
|
||||
#include <openssl/dh.h>
|
||||
]], [[
|
||||
SSL_CTX* ctx = SSL_CTX_new(SSLv23_method());
|
||||
SSL* ssl = SSL_new(ctx);
|
||||
DH* dh = DH_new();
|
||||
DH_free(dh);
|
||||
SSL_free(ssl);
|
||||
SSL_CTX_free(ctx);
|
||||
]])
|
||||
], [
|
||||
AC_MSG_RESULT([yes])
|
||||
], [
|
||||
AC_MSG_RESULT([no])
|
||||
SSL=no
|
||||
SSL_TEXT="no (openssl not usable)"
|
||||
])
|
||||
|
||||
fi
|
||||
|
||||
if test "x$SSL" = "xno" ; then
|
||||
ZNC_AUTO_FAIL([SSL],
|
||||
[OpenSSL not found. Try --disable-openssl.],
|
||||
[OpenSSL was not found and thus disabled])
|
||||
NOSSL=1
|
||||
else
|
||||
AC_DEFINE([HAVE_LIBSSL], [1], [Define if openssl is enabled])
|
||||
SSL=yes
|
||||
SSL_TEXT=yes
|
||||
fi
|
||||
else
|
||||
NOSSL=1
|
||||
SSL_TEXT="no (explicitly disabled)"
|
||||
fi
|
||||
|
||||
# ----- Check for zlib
|
||||
|
||||
old_ZLIB="$ZLIB"
|
||||
ZLIB_TEXT="$ZLIB"
|
||||
if test "x$ZLIB" != "xno"; then
|
||||
AC_MSG_CHECKING([whether zlib is usable])
|
||||
my_saved_LIBS="$LIBS"
|
||||
appendLib "-lz"
|
||||
AC_LINK_IFELSE([AC_LANG_PROGRAM([[
|
||||
#include "zlib.h"
|
||||
]], [[
|
||||
z_stream zs;
|
||||
(void) deflateInit2(&zs, 0, 0, 0, 0, 0);
|
||||
(void) deflate(&zs, 0);
|
||||
]])
|
||||
], [
|
||||
AC_MSG_RESULT([yes])
|
||||
ZLIB=yes
|
||||
ZLIB_TEXT=yes
|
||||
], [
|
||||
AC_MSG_RESULT([no])
|
||||
ZLIB=no
|
||||
ZLIB_TEXT="no (libz not found)"
|
||||
])
|
||||
if test "x$ZLIB" = "xno"; then
|
||||
ZNC_AUTO_FAIL([ZLIB],
|
||||
[zlib was not found. Try --disable-zlib],
|
||||
[zlib was not found and thus disabled])
|
||||
LIBS="$my_saved_LIBS"
|
||||
else
|
||||
AC_DEFINE([HAVE_ZLIB], [1], [Define if zlib is available])
|
||||
fi
|
||||
fi
|
||||
|
||||
AC_ARG_ENABLE( [charset],
|
||||
AS_HELP_STRING([--disable-charset], [disable ICU support]),
|
||||
[HAVE_ICU="$enableval"],
|
||||
[HAVE_ICU="auto"])
|
||||
if test "x$HAVE_ICU" != "xno"
|
||||
then
|
||||
old_HAVE_ICU="$HAVE_ICU"
|
||||
PKG_CHECK_MODULES([icu], [icu-uc], [
|
||||
appendLib "$icu_LIBS"
|
||||
appendCXX "$icu_CFLAGS"
|
||||
HAVE_ICU=yes
|
||||
AC_DEFINE([HAVE_ICU], [1], [Enable ICU library for Unicode handling])
|
||||
AC_DEFINE([U_USING_ICU_NAMESPACE], [0], [Do not clutter global namespace with ICU C++ stuff])
|
||||
], [
|
||||
ZNC_AUTO_FAIL([HAVE_ICU],
|
||||
[support for charset conversion not found. Try --disable-charset.],
|
||||
[support for charset conversion not found and thus disabled])
|
||||
HAVE_ICU="no (icu-uc not found via pkg-config)"
|
||||
])
|
||||
fi
|
||||
|
||||
# For integration test only
|
||||
PKG_CHECK_MODULES([qt], [Qt5Network >= 5.4], [], [:])
|
||||
|
||||
AC_ARG_WITH( [module-prefix],
|
||||
AS_HELP_STRING([--with-module-prefix], [module object code [LIBDIR/znc]]),
|
||||
[MODDIR=$withval],
|
||||
[MODDIR="${libdir}/znc"] )
|
||||
|
||||
AC_ARG_WITH( [module-data-prefix],
|
||||
AS_HELP_STRING([--with-module-data-prefix=DIR],
|
||||
[static module data (webadmin skins) [DATADIR/znc]]),
|
||||
[DATADIR=$withval],
|
||||
[DATADIR="${datadir}/znc"] )
|
||||
|
||||
appendMod "$CXXFLAGS"
|
||||
appendMod "$CFLAG_VISIBILITY"
|
||||
|
||||
if test -z "$ISSUN" -a -z "$ISDARWIN" -a -z "$ISCYGWIN"; then
|
||||
# This is an unknown compiler flag on some OS
|
||||
appendLD -Wl,--export-dynamic
|
||||
fi
|
||||
|
||||
if test -z "$ISCYGWIN" ; then
|
||||
# cygwin doesn't need -fPIC, everything else does (for modules)
|
||||
# warning: -fPIC ignored for target (all code is position independent)
|
||||
appendMod -fPIC
|
||||
else
|
||||
# But cygwin does want most of ZNC in a shared lib
|
||||
# See https://cygwin.com/ml/cygwin-apps/2015-07/msg00108.html for the reasoning behind the name.
|
||||
LIBZNC="cygznc-${LIBZNC_VERSION}.dll"
|
||||
LIBZNCDIR="$bindir"
|
||||
# See above about __STRICT_ANSI__
|
||||
qt_CFLAGS="$qt_CFLAGS -U__STRICT_ANSI__"
|
||||
fi
|
||||
|
||||
if test -z "$ISDARWIN"; then
|
||||
MODLINK="-shared"
|
||||
else
|
||||
# Mac OS X differentiates between shared libs (-dynamiclib)
|
||||
# and loadable modules (-bundle).
|
||||
MODLINK="-bundle -flat_namespace -undefined suppress"
|
||||
# TODO test if -twolevel_namespace and/or
|
||||
# -undefined dynamic_lookup work
|
||||
# (dynamic_lookup might only work on 10.4 and later)
|
||||
fi
|
||||
|
||||
if test "x$PERL" != xno -o "x$PYTHON" != xno; then
|
||||
old_USESWIG="$USESWIG"
|
||||
if test "x$USESWIG" != "xno"; then
|
||||
AC_PROG_SWIG([3.0.0])
|
||||
test -z "$SWIG" && USESWIG=no
|
||||
if test "x$USESWIG" = xno -a "x$old_USESWIG" = yes; then
|
||||
AC_MSG_ERROR([Could not found appropriate SWIG installation. Check config.log for details.])
|
||||
fi
|
||||
fi
|
||||
if test -r "$srcdir/modules/modperl/generated.tar.gz" -a -r "$srcdir/modules/modpython/generated.tar.gz"; then
|
||||
AC_MSG_NOTICE([modperl/modpython files are found, disabling SWIG])
|
||||
USESWIG=no
|
||||
fi
|
||||
if test "x$USESWIG" = xno; then
|
||||
if test ! -r "$srcdir/modules/modperl/generated.tar.gz" -o ! -r "$srcdir/modules/modpython/generated.tar.gz"; then
|
||||
AC_MSG_ERROR([Can not build modperl/modpython. Either install SWIG, or build ZNC from a tarball, or disable modperl/modpython. Check config.log for details.])
|
||||
else
|
||||
AC_MSG_NOTICE([modperl/modpython files are found, no SWIG needed])
|
||||
fi
|
||||
USESWIG="not needed"
|
||||
SWIG=""
|
||||
else
|
||||
USESWIG=yes
|
||||
fi
|
||||
else
|
||||
if test "x$USESWIG" = "xyes"; then
|
||||
AC_MSG_WARN([swig is used only for perl and python, but both are disabled. Disabling swig.])
|
||||
fi
|
||||
USESWIG='not needed'
|
||||
fi
|
||||
|
||||
PERL_TEXT="$PERL"
|
||||
if test "x$PERL" != "xno"; then
|
||||
old_PERL="$PERL"
|
||||
AC_PATH_PROG([PERL_BINARY], [perl], [])
|
||||
if test -n "$PERL_BINARY" && eval "$PERL_BINARY -e'use 5.010'"; then
|
||||
my_saved_LDFLAGS="$LDFLAGS"
|
||||
appendLD `$PERL_BINARY -MExtUtils::Embed -e ccopts -e ldopts`
|
||||
AC_CHECK_LIB(perl, perl_alloc,
|
||||
[: No, we do not want autoconf to do sth automatically],
|
||||
PERL="no" ; PERL_TEXT="no (libperl not found)")
|
||||
LDFLAGS="$my_saved_LDFLAGS"
|
||||
else
|
||||
PERL="no"
|
||||
PERL_TEXT="no (perl binary not found or too old)"
|
||||
fi
|
||||
if test "x$PERL" = "xno"; then
|
||||
ZNC_AUTO_FAIL([PERL],
|
||||
[perl not found. Try --disable-perl.],
|
||||
[perl was not found and thus disabled])
|
||||
PERL_BINARY=""
|
||||
else
|
||||
PERL="yes"
|
||||
PERL_TEXT="yes"
|
||||
fi
|
||||
fi
|
||||
|
||||
PYTHON_TEXT="$PYTHON"
|
||||
if test "x$PYTHON" != "xno"; then
|
||||
# Default value for just --enable-python
|
||||
if test "x$PYTHON" = "xyes"; then
|
||||
PYTHON="python3"
|
||||
fi
|
||||
old_PYTHON="$PYTHON"
|
||||
if test -z "$PKG_CONFIG"; then
|
||||
AC_MSG_ERROR([pkg-config is required for modpython.])
|
||||
fi
|
||||
PKG_CHECK_MODULES([python], [$PYTHON-embed >= 3.3],, [
|
||||
PKG_CHECK_MODULES([python], [$PYTHON >= 3.3],, AC_MSG_ERROR([$PYTHON.pc not found or is wrong. Try --disable-python or install python3.]))
|
||||
])
|
||||
my_saved_LIBS="$LIBS"
|
||||
my_saved_CXXFLAGS="$CXXFLAGS"
|
||||
appendLib $python_LIBS
|
||||
appendCXX $python_CFLAGS
|
||||
AC_CHECK_FUNC([Py_Initialize], [], [PYTHON="no" ; PYTHON_TEXT="no (libpython not found)"])
|
||||
if test "x$PYTHON" != "xno"; then
|
||||
# Yes, modpython depends on perl.
|
||||
AC_PATH_PROG([PERL_BINARY], [perl])
|
||||
if test -z "$PERL_BINARY"; then
|
||||
AC_MSG_ERROR([To compile modpython you need to be able to execute perl scripts. Try --disable-python or install perl.])
|
||||
fi
|
||||
LIBS="$my_saved_LIBS"
|
||||
CXXFLAGS="$my_saved_CXXFLAGS"
|
||||
fi
|
||||
if test "x$HAVE_ICU" != "xyes"; then
|
||||
AC_MSG_ERROR([Modpython requires ZNC to be compiled with charset support, but ICU library not found. Try --disable-python or install libicu.])
|
||||
fi
|
||||
if test "x$PYTHON" = "xno"; then
|
||||
ZNC_AUTO_FAIL([PYTHON],
|
||||
[python not found. Try --disable-python.],
|
||||
[python was not found and thus disabled])
|
||||
PYTHONCFG_BINARY=""
|
||||
else
|
||||
PYTHON="yes"
|
||||
PYTHON_TEXT="yes"
|
||||
fi
|
||||
fi
|
||||
|
||||
if test -n "$CYRUS"; then
|
||||
AC_CHECK_LIB( sasl2, sasl_server_init,
|
||||
[: Dont let autoconf add -lsasl2, Makefile handles that],
|
||||
AC_MSG_ERROR([could not find libsasl2. Try --disable-cyrus.]))
|
||||
fi
|
||||
|
||||
# Check if we want modtcl
|
||||
AC_ARG_ENABLE( [tcl],
|
||||
AS_HELP_STRING([--enable-tcl], [enable modtcl]),
|
||||
[TCL="$enableval"],
|
||||
[TCL="no"])
|
||||
|
||||
AC_ARG_WITH( [tcl-flags],
|
||||
AS_HELP_STRING([--with-tcl-flags=FLAGS],
|
||||
[The flags needed for compiling and linking modtcl]),
|
||||
[TCL_FLAGS="$withval"],)
|
||||
|
||||
if test x"$TCL" = "xyes"
|
||||
then
|
||||
AC_ARG_WITH( [tcl],
|
||||
AS_HELP_STRING([--with-tcl=DIR],
|
||||
[directory containing tclConfig.sh]),
|
||||
TCL_DIR="${withval}")
|
||||
|
||||
# This will need to be extended in the future, but I don't think
|
||||
# it's a good idea to stuff a shitload of random stuff in here right now
|
||||
for path in $TCL_DIR /usr/lib /usr/lib/tcl8.4 /usr/lib/tcl8.5 /usr/lib/tcl8.6
|
||||
do
|
||||
file="${path}/tclConfig.sh"
|
||||
AC_MSG_CHECKING([for ${file}])
|
||||
if test -r ${file}
|
||||
then
|
||||
TCL_CONF=${file}
|
||||
AC_MSG_RESULT([yes])
|
||||
break
|
||||
fi
|
||||
AC_MSG_RESULT([no])
|
||||
done
|
||||
|
||||
if test x"${TCL_CONF}" = x
|
||||
then
|
||||
# They --enable-tcl'd, so give them some sane default
|
||||
TCL_FLAGS="-I/usr/include/tcl -ltcl"
|
||||
AC_MSG_WARN([Could not find tclConfig.sh, using some sane defaults.])
|
||||
else
|
||||
AC_MSG_CHECKING([modtcl flags])
|
||||
. ${TCL_CONF}
|
||||
# eval because those vars depend on other vars in there
|
||||
eval "TCL_LIB_SPEC=\"${TCL_LIB_SPEC}\""
|
||||
eval "TCL_INCLUDE_SPEC=\"${TCL_INCLUDE_SPEC}\""
|
||||
TCL_FLAGS="$TCL_INCLUDE_SPEC $TCL_LIB_SPEC"
|
||||
AC_MSG_RESULT([$TCL_FLAGS])
|
||||
fi
|
||||
my_saved_LIBS="$LIBS"
|
||||
appendLib "$TCL_FLAGS"
|
||||
AC_CHECK_FUNC([Tcl_CreateInterp], [TCL_TEST=yes], [TCL_TEST=no])
|
||||
if test x"$TCL_TEST" = "xno"; then
|
||||
AC_MSG_ERROR([tcl not found, try --disable-tcl, or install tcl properly. If tcl is installed to a non-standard path, use --enable-tcl --with-tcl=/path])
|
||||
fi
|
||||
LIBS="$my_saved_LIBS"
|
||||
fi
|
||||
|
||||
AC_CACHE_CHECK([for GNU make], [ac_cv_path_GNUMAKE], [
|
||||
AC_PATH_PROGS_FEATURE_CHECK([GNUMAKE], [make gmake], [[
|
||||
if $ac_path_GNUMAKE --version | $GREP GNU > /dev/null; then
|
||||
ac_cv_path_GNUMAKE=$ac_path_GNUMAKE
|
||||
ac_path_GNUMAKE_found=:
|
||||
fi
|
||||
]], [AC_MSG_ERROR([could not find GNU make])]
|
||||
)
|
||||
])
|
||||
GNUMAKE=`echo $ac_cv_path_GNUMAKE | $SED "s%.*/%%"`
|
||||
|
||||
# this is in the end, for not trying to include it when it doesn't exist yet
|
||||
appendCXX "-include znc/zncconfig.h"
|
||||
appendMod "-include znc/zncconfig.h"
|
||||
|
||||
AC_SUBST([CXXFLAGS])
|
||||
AC_SUBST([CPPFLAGS])
|
||||
AC_SUBST([MODFLAGS])
|
||||
AC_SUBST([LDFLAGS])
|
||||
AC_SUBST([LIBS])
|
||||
AC_SUBST([LIBZNC])
|
||||
AC_SUBST([LIBZNCDIR])
|
||||
AC_SUBST([ISCYGWIN])
|
||||
AC_SUBST([MODLINK])
|
||||
AC_SUBST([NOSSL])
|
||||
AC_SUBST([TCL_FLAGS])
|
||||
AC_SUBST([CYRUS])
|
||||
AC_SUBST([MODDIR])
|
||||
AC_SUBST([DATADIR])
|
||||
AC_SUBST([PERL])
|
||||
AC_SUBST([PYTHON])
|
||||
AC_SUBST([SWIG])
|
||||
AC_SUBST([python_CFLAGS])
|
||||
AC_SUBST([python_LIBS])
|
||||
AC_SUBST([qt_CFLAGS])
|
||||
AC_SUBST([qt_LIBS])
|
||||
AC_CONFIG_FILES([Makefile])
|
||||
AC_CONFIG_FILES([znc-buildmod])
|
||||
AC_CONFIG_FILES([man/Makefile])
|
||||
AC_CONFIG_FILES([znc.pc])
|
||||
AC_CONFIG_FILES([znc-uninstalled.pc])
|
||||
AC_CONFIG_FILES([modules/Makefile])
|
||||
AC_OUTPUT
|
||||
|
||||
if test "x$ISCYGWIN" = x1; then
|
||||
# Side effect of undefining __STRICT_ANSI__
|
||||
# http://llvm.org/bugs/show_bug.cgi?id=13530
|
||||
echo >> include/znc/zncconfig.h
|
||||
echo '#ifndef ZNCCONFIG_H_ADDITIONS' >> include/znc/zncconfig.h
|
||||
echo '#define ZNCCONFIG_H_ADDITIONS' >> include/znc/zncconfig.h
|
||||
echo '#ifdef __clang__' >> include/znc/zncconfig.h
|
||||
echo 'struct __float128;' >> include/znc/zncconfig.h
|
||||
echo '#endif' >> include/znc/zncconfig.h
|
||||
echo '#endif' >> include/znc/zncconfig.h
|
||||
fi
|
||||
|
||||
echo
|
||||
echo ZNC AC_PACKAGE_VERSION configured
|
||||
echo
|
||||
echo "The configure script is deprecated and will be removed from ZNC"
|
||||
echo "in some future version. Use either CMake or the convenience wrapper"
|
||||
echo "configure.sh which takes the same parameters as configure."
|
||||
echo
|
||||
echo "prefix: $prefix"
|
||||
echo "debug: $DEBUG"
|
||||
echo "ipv6: $IPV6"
|
||||
echo "openssl: $SSL_TEXT"
|
||||
echo "dns: $DNS_TEXT"
|
||||
echo "perl: $PERL_TEXT"
|
||||
echo "python: $PYTHON_TEXT"
|
||||
echo "swig: $USESWIG"
|
||||
if test x"$CYRUS" = "x" ; then
|
||||
echo "cyrus: no"
|
||||
else
|
||||
echo "cyrus: yes"
|
||||
fi
|
||||
if test x"$TCL_FLAGS" = "x" ; then
|
||||
echo "tcl: no"
|
||||
else
|
||||
echo "tcl: yes"
|
||||
fi
|
||||
echo "charset: $HAVE_ICU"
|
||||
echo "zlib: $ZLIB_TEXT"
|
||||
echo "run from src: $RUNFROMSOURCE"
|
||||
echo
|
||||
echo "Now you can run \"$GNUMAKE\" to compile ZNC"
|
||||
|
||||
5
de.zip
5
de.zip
@@ -1,5 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<error>
|
||||
<code>8</code>
|
||||
<message>File was not found</message>
|
||||
</error>
|
||||
@@ -16,19 +16,9 @@ limitations under the License.
|
||||
#ifndef ZNC_VERSION_H
|
||||
#define ZNC_VERSION_H
|
||||
|
||||
#ifndef BUILD_WITH_CMAKE
|
||||
// The following defines are for #if comparison (preprocessor only likes ints)
|
||||
#define VERSION_MAJOR 1
|
||||
#define VERSION_MINOR 9
|
||||
#define VERSION_PATCH -1
|
||||
// This one is for display purpose and to check ABI compatibility of modules
|
||||
#define VERSION_STR "1.9.x"
|
||||
#endif
|
||||
|
||||
// Don't use this one
|
||||
#define VERSION (VERSION_MAJOR + VERSION_MINOR / 10.0)
|
||||
|
||||
// autoconf: You can add -DVERSION_EXTRA="stuff" to your CXXFLAGS!
|
||||
// CMake: You can add -DVERSION_EXTRA=stuff to cmake!
|
||||
#ifndef VERSION_EXTRA
|
||||
#define VERSION_EXTRA ""
|
||||
|
||||
@@ -1,210 +0,0 @@
|
||||
dnl @synopsis AC_PROG_SWIG([major.minor.micro])
|
||||
dnl
|
||||
dnl NOTICE: for new code, use http://www.gnu.org/s/autoconf-archive/ax_pkg_swig.html instead.
|
||||
dnl
|
||||
dnl This macro searches for a SWIG installation on your system. If
|
||||
dnl found you should call SWIG via $(SWIG). You can use the optional
|
||||
dnl first argument to check if the version of the available SWIG is
|
||||
dnl greater than or equal to the value of the argument. It should have
|
||||
dnl the format: N[.N[.N]] (N is a number between 0 and 999. Only the
|
||||
dnl first N is mandatory.)
|
||||
dnl
|
||||
dnl If the version argument is given (e.g. 1.3.17), AC_PROG_SWIG checks
|
||||
dnl that the swig package is this version number or higher.
|
||||
dnl
|
||||
dnl In configure.in, use as:
|
||||
dnl
|
||||
dnl AC_PROG_SWIG(1.3.17)
|
||||
dnl SWIG_ENABLE_CXX
|
||||
dnl SWIG_MULTI_MODULE_SUPPORT
|
||||
dnl SWIG_PYTHON
|
||||
dnl
|
||||
dnl @category InstalledPackages
|
||||
dnl @author Sebastian Huber <sebastian-huber@web.de>
|
||||
dnl @author Alan W. Irwin <irwin@beluga.phys.uvic.ca>
|
||||
dnl @author Rafael Laboissiere <rafael@laboissiere.net>
|
||||
dnl @author Andrew Collier <abcollier@yahoo.com>
|
||||
dnl @version 2004-09-20
|
||||
dnl
|
||||
dnl Modified by Alexey Sokolov <alexey@asokolov.org> on 2012-08-08
|
||||
dnl @license GPLWithACException
|
||||
dnl
|
||||
dnl NOTICE: for new code, use http://www.gnu.org/s/autoconf-archive/ax_pkg_swig.html instead.
|
||||
|
||||
AC_DEFUN([AC_PROG_SWIG],[
|
||||
SWIG_ERROR=""
|
||||
|
||||
if test -n "$1"; then
|
||||
# Calculate the required version number components
|
||||
[required=$1]
|
||||
[required_major=`echo $required | sed 's/[^0-9].*//'`]
|
||||
if test -z "$required_major" ; then
|
||||
[required_major=0]
|
||||
fi
|
||||
[required=`echo $required | sed 's/[0-9]*[^0-9]//'`]
|
||||
[required_minor=`echo $required | sed 's/[^0-9].*//'`]
|
||||
if test -z "$required_minor" ; then
|
||||
[required_minor=0]
|
||||
fi
|
||||
[required=`echo $required | sed 's/[0-9]*[^0-9]//'`]
|
||||
[required_patch=`echo $required | sed 's/[^0-9].*//'`]
|
||||
if test -z "$required_patch" ; then
|
||||
[required_patch=0]
|
||||
fi
|
||||
fi
|
||||
|
||||
# for "python 3 abc set" and "PyInt_FromSize_t in python3" checks
|
||||
|
||||
cat <<-END > conftest-python.i
|
||||
%module conftest;
|
||||
%include <pyabc.i>
|
||||
%include <std_set.i>
|
||||
%template(SInt) std::set<int>;
|
||||
END
|
||||
|
||||
# check if perl has std::...::size_type defined. Don't add new tests to this .i; it'll break this test due to check for "NewPointerObj(("
|
||||
|
||||
cat <<-END > conftest-perl.i
|
||||
%module conftest;
|
||||
%include <std_vector.i>
|
||||
%include <std_list.i>
|
||||
%include <std_deque.i>
|
||||
%template() std::vector<int>;
|
||||
%template() std::list<int>;
|
||||
%template() std::deque<int>;
|
||||
std::vector<int>::size_type checkVector();
|
||||
std::list<int>::size_type checkList();
|
||||
std::deque<int>::size_type checkDeque();
|
||||
END
|
||||
SWIG_installed_versions=""
|
||||
AC_CACHE_CHECK([for SWIG >= $1], [znc_cv_path_SWIG], [
|
||||
AC_PATH_PROGS_FEATURE_CHECK([SWIG], [swig swig2.0 swig3.0], [
|
||||
echo trying $ac_path_SWIG >&AS_MESSAGE_LOG_FD
|
||||
$ac_path_SWIG -version >&AS_MESSAGE_LOG_FD
|
||||
[swig_version=`$ac_path_SWIG -version 2>&1 | grep 'SWIG Version' | sed 's/.*\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\).*/\1/g'`]
|
||||
if test -n "$swig_version"; then
|
||||
swig_right_version=1
|
||||
|
||||
SWIG_installed_versions="$SWIG_installed_versions $swig_version "
|
||||
|
||||
if test -n "$required"; then
|
||||
# Calculate the available version number components
|
||||
[available=$swig_version]
|
||||
|
||||
[available_major=`echo $available | sed 's/[^0-9].*//'`]
|
||||
if test -z "$available_major" ; then
|
||||
[available_major=0]
|
||||
fi
|
||||
[available=`echo $available | sed 's/[0-9]*[^0-9]//'`]
|
||||
[available_minor=`echo $available | sed 's/[^0-9].*//'`]
|
||||
if test -z "$available_minor" ; then
|
||||
[available_minor=0]
|
||||
fi
|
||||
[available=`echo $available | sed 's/[0-9]*[^0-9]//'`]
|
||||
[available_patch=`echo $available | sed 's/[^0-9].*//'`]
|
||||
if test -z "$available_patch" ; then
|
||||
[available_patch=0]
|
||||
fi
|
||||
|
||||
if test $available_major -lt $required_major; then
|
||||
swig_right_version=0
|
||||
elif test $available_major -eq $required_major; then
|
||||
if test $available_minor -lt $required_minor; then
|
||||
swig_right_version=0
|
||||
elif test $available_minor -eq $required_minor; then
|
||||
if test $available_patch -lt $required_patch; then
|
||||
swig_right_version=0
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
if test $swig_right_version -eq 1; then
|
||||
# "python 3 abc set", "PyInt_FromSize_t in python3" and "perl size_type" checks
|
||||
echo "checking behavior of this SWIG" >&AS_MESSAGE_LOG_FD
|
||||
|
||||
$ac_path_SWIG -python -py3 -c++ -shadow conftest-python.i >&AS_MESSAGE_LOG_FD && \
|
||||
echo "python wrapper created" >&AS_MESSAGE_LOG_FD && \
|
||||
echo "testing std::set... ">&AS_MESSAGE_LOG_FD && \
|
||||
grep SInt_discard conftest.py > /dev/null 2>&1 && \
|
||||
echo "std::set works" >&AS_MESSAGE_LOG_FD && \
|
||||
echo "testing PyInt_FromSize_t..." >&AS_MESSAGE_LOG_FD && \
|
||||
grep '#define PyInt_FromSize_t' conftest-python_wrap.cxx > /dev/null 2>&1 && \
|
||||
echo "PyInt_FromSize_t is defined" >&AS_MESSAGE_LOG_FD && \
|
||||
$ac_path_SWIG -perl -c++ -shadow conftest-perl.i >&AS_MESSAGE_LOG_FD && \
|
||||
echo "perl wrapper created" >&AS_MESSAGE_LOG_FD && \
|
||||
echo "testing size_type..." >&AS_MESSAGE_LOG_FD && \
|
||||
test 0 -eq `grep -c 'NewPointerObj((' conftest-perl_wrap.cxx` && \
|
||||
echo "size_type work" >&AS_MESSAGE_LOG_FD && \
|
||||
znc_cv_path_SWIG=$ac_path_SWIG \
|
||||
ac_path_SWIG_found=:
|
||||
if test "x$ac_path_SWIG_found" != "x:"; then
|
||||
echo "fail" >&AS_MESSAGE_LOG_FD
|
||||
fi
|
||||
rm -f conftest-python_wrap.cxx conftest.py
|
||||
rm -f conftest-perl_wrap.cxx conftest.pm
|
||||
|
||||
|
||||
else
|
||||
echo "SWIG version >= $1 is required. You have '$swig_version'" >&AS_MESSAGE_LOG_FD
|
||||
fi
|
||||
fi
|
||||
echo end trying $ac_path_SWIG >&AS_MESSAGE_LOG_FD
|
||||
])
|
||||
])
|
||||
rm -f conftest-python.i conftest-perl.i
|
||||
if test -n "$SWIG_installed_versions"; then
|
||||
AC_MSG_NOTICE([Following SWIG versions are found:$SWIG_installed_versions])
|
||||
fi
|
||||
|
||||
AC_SUBST([SWIG], [$znc_cv_path_SWIG])
|
||||
if test -n "$SWIG"; then
|
||||
SWIG_LIB=`$SWIG -swiglib`
|
||||
fi
|
||||
AC_SUBST([SWIG_LIB])
|
||||
])
|
||||
|
||||
# SWIG_ENABLE_CXX()
|
||||
#
|
||||
# Enable SWIG C++ support. This affects all invocations of $(SWIG).
|
||||
AC_DEFUN([SWIG_ENABLE_CXX],[
|
||||
AC_REQUIRE([AC_PROG_SWIG])
|
||||
AC_REQUIRE([AC_PROG_CXX])
|
||||
SWIG="$SWIG -c++"
|
||||
])
|
||||
|
||||
# SWIG_MULTI_MODULE_SUPPORT()
|
||||
#
|
||||
# Enable support for multiple modules. This effects all invocations
|
||||
# of $(SWIG). You have to link all generated modules against the
|
||||
# appropriate SWIG runtime library. If you want to build Python
|
||||
# modules for example, use the SWIG_PYTHON() macro and link the
|
||||
# modules against $(SWIG_PYTHON_LIBS).
|
||||
#
|
||||
AC_DEFUN([SWIG_MULTI_MODULE_SUPPORT],[
|
||||
AC_REQUIRE([AC_PROG_SWIG])
|
||||
SWIG="$SWIG -noruntime"
|
||||
])
|
||||
|
||||
# SWIG_PYTHON([use-shadow-classes = {no, yes}])
|
||||
#
|
||||
# Checks for Python and provides the $(SWIG_PYTHON_CPPFLAGS),
|
||||
# and $(SWIG_PYTHON_OPT) output variables.
|
||||
#
|
||||
# $(SWIG_PYTHON_OPT) contains all necessary SWIG options to generate
|
||||
# code for Python. Shadow classes are enabled unless the value of the
|
||||
# optional first argument is exactly 'no'. If you need multi module
|
||||
# support (provided by the SWIG_MULTI_MODULE_SUPPORT() macro) use
|
||||
# $(SWIG_PYTHON_LIBS) to link against the appropriate library. It
|
||||
# contains the SWIG Python runtime library that is needed by the type
|
||||
# check system for example.
|
||||
AC_DEFUN([SWIG_PYTHON],[
|
||||
AC_REQUIRE([AC_PROG_SWIG])
|
||||
AC_REQUIRE([AC_PYTHON_DEVEL])
|
||||
test "x$1" != "xno" || swig_shadow=" -noproxy"
|
||||
AC_SUBST([SWIG_PYTHON_OPT],[-python$swig_shadow])
|
||||
AC_SUBST([SWIG_PYTHON_CPPFLAGS],[$PYTHON_CPPFLAGS])
|
||||
])
|
||||
|
||||
|
||||
|
||||
@@ -1,169 +0,0 @@
|
||||
# ============================================================================
|
||||
# http://www.gnu.org/software/autoconf-archive/ax_cxx_compile_stdcxx_11.html
|
||||
# ============================================================================
|
||||
#
|
||||
# SYNOPSIS
|
||||
#
|
||||
# AX_CXX_COMPILE_STDCXX_11([ext|noext],[mandatory|optional])
|
||||
#
|
||||
# DESCRIPTION
|
||||
#
|
||||
# Check for baseline language coverage in the compiler for the C++11
|
||||
# standard; if necessary, add switches to CXXFLAGS to enable support.
|
||||
#
|
||||
# The first argument, if specified, indicates whether you insist on an
|
||||
# extended mode (e.g. -std=gnu++11) or a strict conformance mode (e.g.
|
||||
# -std=c++11). If neither is specified, you get whatever works, with
|
||||
# preference for an extended mode.
|
||||
#
|
||||
# The second argument, if specified 'mandatory' or if left unspecified,
|
||||
# indicates that baseline C++11 support is required and that the macro
|
||||
# should error out if no mode with that support is found. If specified
|
||||
# 'optional', then configuration proceeds regardless, after defining
|
||||
# HAVE_CXX11 if and only if a supporting mode is found.
|
||||
#
|
||||
# LICENSE
|
||||
#
|
||||
# Copyright (c) 2008 Benjamin Kosnik <bkoz@redhat.com>
|
||||
# Copyright (c) 2012 Zack Weinberg <zackw@panix.com>
|
||||
# Copyright (c) 2013 Roy Stogner <roystgnr@ices.utexas.edu>
|
||||
# Copyright (c) 2014, 2015 Google Inc.; contributed by Alexey Sokolov <sokolov@google.com>
|
||||
#
|
||||
# Copying and distribution of this file, with or without modification, are
|
||||
# permitted in any medium without royalty provided the copyright notice
|
||||
# and this notice are preserved. This file is offered as-is, without any
|
||||
# warranty.
|
||||
|
||||
#serial 5
|
||||
|
||||
m4_define([_AX_CXX_COMPILE_STDCXX_11_testbody], [[
|
||||
#include <map>
|
||||
template <typename T>
|
||||
struct check
|
||||
{
|
||||
static_assert(sizeof(int) <= sizeof(T), "not big enough");
|
||||
};
|
||||
|
||||
struct Base {
|
||||
virtual void f() {}
|
||||
};
|
||||
struct Child : public Base {
|
||||
virtual void f() override {}
|
||||
};
|
||||
|
||||
typedef check<check<bool>> right_angle_brackets;
|
||||
|
||||
int a;
|
||||
decltype(a) b;
|
||||
|
||||
typedef check<int> check_type;
|
||||
check_type c;
|
||||
check_type&& cr = static_cast<check_type&&>(c);
|
||||
|
||||
auto d = a;
|
||||
auto l = [](){};
|
||||
|
||||
// http://stackoverflow.com/questions/13728184/template-aliases-and-sfinae
|
||||
// Clang 3.1 fails with headers of libstd++ 4.8.3 when using std::function because of this
|
||||
namespace test_template_alias_sfinae {
|
||||
struct foo {};
|
||||
|
||||
template<typename T>
|
||||
using member = typename T::member_type;
|
||||
|
||||
template<typename T>
|
||||
void func(...) {}
|
||||
|
||||
template<typename T>
|
||||
void func(member<T>*) {}
|
||||
|
||||
void test();
|
||||
|
||||
void test() {
|
||||
func<foo>(0);
|
||||
}
|
||||
}
|
||||
|
||||
void test_map() {
|
||||
std::map<int, int> m;
|
||||
m.emplace(2, 4);
|
||||
}
|
||||
]])
|
||||
|
||||
AC_DEFUN([AX_CXX_COMPILE_STDCXX_11], [dnl
|
||||
m4_if([$1], [], [],
|
||||
[$1], [ext], [],
|
||||
[$1], [noext], [],
|
||||
[m4_fatal([invalid argument `$1' to AX_CXX_COMPILE_STDCXX_11])])dnl
|
||||
m4_if([$2], [], [ax_cxx_compile_cxx11_required=true],
|
||||
[$2], [mandatory], [ax_cxx_compile_cxx11_required=true],
|
||||
[$2], [optional], [ax_cxx_compile_cxx11_required=false],
|
||||
[m4_fatal([invalid second argument `$2' to AX_CXX_COMPILE_STDCXX_11])])
|
||||
AC_LANG_PUSH([C++])dnl
|
||||
ac_success=no
|
||||
AC_CACHE_CHECK(whether $CXX supports C++11 features by default,
|
||||
ax_cv_cxx_compile_cxx11,
|
||||
[AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_11_testbody])],
|
||||
[ax_cv_cxx_compile_cxx11=yes],
|
||||
[ax_cv_cxx_compile_cxx11=no])])
|
||||
if test x$ax_cv_cxx_compile_cxx11 = xyes; then
|
||||
ac_success=yes
|
||||
fi
|
||||
|
||||
m4_if([$1], [noext], [], [dnl
|
||||
if test x$ac_success = xno; then
|
||||
for switch in -std=gnu++11 -std=gnu++0x; do
|
||||
cachevar=AS_TR_SH([ax_cv_cxx_compile_cxx11_$switch])
|
||||
AC_CACHE_CHECK(whether $CXX supports C++11 features with $switch,
|
||||
$cachevar,
|
||||
[ac_save_CXXFLAGS="$CXXFLAGS"
|
||||
CXXFLAGS="$CXXFLAGS $switch"
|
||||
AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_11_testbody])],
|
||||
[eval $cachevar=yes],
|
||||
[eval $cachevar=no])
|
||||
CXXFLAGS="$ac_save_CXXFLAGS"])
|
||||
if eval test x\$$cachevar = xyes; then
|
||||
CXXFLAGS="$CXXFLAGS $switch"
|
||||
ac_success=yes
|
||||
break
|
||||
fi
|
||||
done
|
||||
fi])
|
||||
|
||||
m4_if([$1], [ext], [], [dnl
|
||||
if test x$ac_success = xno; then
|
||||
for switch in -std=c++11 -std=c++0x; do
|
||||
cachevar=AS_TR_SH([ax_cv_cxx_compile_cxx11_$switch])
|
||||
AC_CACHE_CHECK(whether $CXX supports C++11 features with $switch,
|
||||
$cachevar,
|
||||
[ac_save_CXXFLAGS="$CXXFLAGS"
|
||||
CXXFLAGS="$CXXFLAGS $switch"
|
||||
AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_11_testbody])],
|
||||
[eval $cachevar=yes],
|
||||
[eval $cachevar=no])
|
||||
CXXFLAGS="$ac_save_CXXFLAGS"])
|
||||
if eval test x\$$cachevar = xyes; then
|
||||
CXXFLAGS="$CXXFLAGS $switch"
|
||||
ac_success=yes
|
||||
break
|
||||
fi
|
||||
done
|
||||
fi])
|
||||
AC_LANG_POP([C++])
|
||||
if test x$ax_cxx_compile_cxx11_required = xtrue; then
|
||||
if test x$ac_success = xno; then
|
||||
AC_MSG_ERROR([*** A compiler with support for C++11 language features is required.])
|
||||
fi
|
||||
else
|
||||
if test x$ac_success = xno; then
|
||||
HAVE_CXX11=0
|
||||
AC_MSG_NOTICE([No compiler with C++11 support was found])
|
||||
else
|
||||
HAVE_CXX11=1
|
||||
AC_DEFINE(HAVE_CXX11,1,
|
||||
[define if the compiler supports basic C++11 syntax])
|
||||
fi
|
||||
|
||||
AC_SUBST(HAVE_CXX11)
|
||||
fi
|
||||
])
|
||||
310
m4/ax_pthread.m4
310
m4/ax_pthread.m4
@@ -1,310 +0,0 @@
|
||||
# ===========================================================================
|
||||
# http://www.gnu.org/software/autoconf-archive/ax_pthread.html
|
||||
# ===========================================================================
|
||||
#
|
||||
# SYNOPSIS
|
||||
#
|
||||
# AX_PTHREAD([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
|
||||
#
|
||||
# DESCRIPTION
|
||||
#
|
||||
# This macro figures out how to build C programs using POSIX threads. It
|
||||
# sets the PTHREAD_LIBS output variable to the threads library and linker
|
||||
# flags, and the PTHREAD_CFLAGS output variable to any special C compiler
|
||||
# flags that are needed. (The user can also force certain compiler
|
||||
# flags/libs to be tested by setting these environment variables.)
|
||||
#
|
||||
# Also sets PTHREAD_CC to any special C compiler that is needed for
|
||||
# multi-threaded programs (defaults to the value of CC otherwise). (This
|
||||
# is necessary on AIX to use the special cc_r compiler alias.)
|
||||
#
|
||||
# NOTE: You are assumed to not only compile your program with these flags,
|
||||
# but also link it with them as well. e.g. you should link with
|
||||
# $PTHREAD_CC $CFLAGS $PTHREAD_CFLAGS $LDFLAGS ... $PTHREAD_LIBS $LIBS
|
||||
#
|
||||
# If you are only building threads programs, you may wish to use these
|
||||
# variables in your default LIBS, CFLAGS, and CC:
|
||||
#
|
||||
# LIBS="$PTHREAD_LIBS $LIBS"
|
||||
# CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
|
||||
# CC="$PTHREAD_CC"
|
||||
#
|
||||
# In addition, if the PTHREAD_CREATE_JOINABLE thread-attribute constant
|
||||
# has a nonstandard name, defines PTHREAD_CREATE_JOINABLE to that name
|
||||
# (e.g. PTHREAD_CREATE_UNDETACHED on AIX).
|
||||
#
|
||||
# Also HAVE_PTHREAD_PRIO_INHERIT is defined if pthread is found and the
|
||||
# PTHREAD_PRIO_INHERIT symbol is defined when compiling with
|
||||
# PTHREAD_CFLAGS.
|
||||
#
|
||||
# ACTION-IF-FOUND is a list of shell commands to run if a threads library
|
||||
# is found, and ACTION-IF-NOT-FOUND is a list of commands to run it if it
|
||||
# is not found. If ACTION-IF-FOUND is not specified, the default action
|
||||
# will define HAVE_PTHREAD.
|
||||
#
|
||||
# Please let the authors know if this macro fails on any platform, or if
|
||||
# you have any other suggestions or comments. This macro was based on work
|
||||
# by SGJ on autoconf scripts for FFTW (http://www.fftw.org/) (with help
|
||||
# from M. Frigo), as well as ac_pthread and hb_pthread macros posted by
|
||||
# Alejandro Forero Cuervo to the autoconf macro repository. We are also
|
||||
# grateful for the helpful feedback of numerous users.
|
||||
#
|
||||
# Updated for Autoconf 2.68 by Daniel Richard G.
|
||||
#
|
||||
# LICENSE
|
||||
#
|
||||
# Copyright (c) 2008 Steven G. Johnson <stevenj@alum.mit.edu>
|
||||
# Copyright (c) 2011 Daniel Richard G. <skunk@iSKUNK.ORG>
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License as published by the
|
||||
# Free Software Foundation, either version 3 of the License, or (at your
|
||||
# option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful, but
|
||||
# WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
|
||||
# Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License along
|
||||
# with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
# As a special exception, the respective Autoconf Macro's copyright owner
|
||||
# gives unlimited permission to copy, distribute and modify the configure
|
||||
# scripts that are the output of Autoconf when processing the Macro. You
|
||||
# need not follow the terms of the GNU General Public License when using
|
||||
# or distributing such scripts, even though portions of the text of the
|
||||
# Macro appear in them. The GNU General Public License (GPL) does govern
|
||||
# all other use of the material that constitutes the Autoconf Macro.
|
||||
#
|
||||
# This special exception to the GPL applies to versions of the Autoconf
|
||||
# Macro released by the Autoconf Archive. When you make and distribute a
|
||||
# modified version of the Autoconf Macro, you may extend this special
|
||||
# exception to the GPL to apply to your modified version as well.
|
||||
|
||||
#serial 17
|
||||
|
||||
AU_ALIAS([ACX_PTHREAD], [AX_PTHREAD])
|
||||
AC_DEFUN([AX_PTHREAD], [
|
||||
AC_REQUIRE([AC_CANONICAL_HOST])
|
||||
AC_LANG_PUSH([C++])
|
||||
ax_pthread_ok=no
|
||||
|
||||
# We used to check for pthread.h first, but this fails if pthread.h
|
||||
# requires special compiler flags (e.g. on True64 or Sequent).
|
||||
# It gets checked for in the link test anyway.
|
||||
|
||||
# First of all, check if the user has set any of the PTHREAD_LIBS,
|
||||
# etcetera environment variables, and if threads linking works using
|
||||
# them:
|
||||
if test x"$PTHREAD_LIBS$PTHREAD_CFLAGS" != x; then
|
||||
save_CXXFLAGS="$CXXFLAGS"
|
||||
CXXFLAGS="$CXXFLAGS $PTHREAD_CFLAGS"
|
||||
save_LIBS="$LIBS"
|
||||
LIBS="$PTHREAD_LIBS $LIBS"
|
||||
AC_MSG_CHECKING([for pthread_join in LIBS=$PTHREAD_LIBS with CXXFLAGS=$PTHREAD_CFLAGS])
|
||||
AC_TRY_LINK_FUNC(pthread_join, ax_pthread_ok=yes)
|
||||
AC_MSG_RESULT($ax_pthread_ok)
|
||||
if test x"$ax_pthread_ok" = xno; then
|
||||
PTHREAD_LIBS=""
|
||||
PTHREAD_CFLAGS=""
|
||||
fi
|
||||
LIBS="$save_LIBS"
|
||||
CXXFLAGS="$save_CXXFLAGS"
|
||||
fi
|
||||
|
||||
# We must check for the threads library under a number of different
|
||||
# names; the ordering is very important because some systems
|
||||
# (e.g. DEC) have both -lpthread and -lpthreads, where one of the
|
||||
# libraries is broken (non-POSIX).
|
||||
|
||||
# Create a list of thread flags to try. Items starting with a "-" are
|
||||
# C compiler flags, and other items are library names, except for "none"
|
||||
# which indicates that we try without any flags at all, and "pthread-config"
|
||||
# which is a program returning the flags for the Pth emulation library.
|
||||
|
||||
ax_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config"
|
||||
|
||||
# The ordering *is* (sometimes) important. Some notes on the
|
||||
# individual items follow:
|
||||
|
||||
# pthreads: AIX (must check this before -lpthread)
|
||||
# none: in case threads are in libc; should be tried before -Kthread and
|
||||
# other compiler flags to prevent continual compiler warnings
|
||||
# -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h)
|
||||
# -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able)
|
||||
# lthread: LinuxThreads port on FreeBSD (also preferred to -pthread)
|
||||
# -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads)
|
||||
# -pthreads: Solaris/gcc
|
||||
# -mthreads: Mingw32/gcc, Lynx/gcc
|
||||
# -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it
|
||||
# doesn't hurt to check since this sometimes defines pthreads too;
|
||||
# also defines -D_REENTRANT)
|
||||
# ... -mt is also the pthreads flag for HP/aCC
|
||||
# pthread: Linux, etcetera
|
||||
# --thread-safe: KAI C++
|
||||
# pthread-config: use pthread-config program (for GNU Pth library)
|
||||
|
||||
case "${host_cpu}-${host_os}" in
|
||||
*solaris*)
|
||||
|
||||
# On Solaris (at least, for some versions), libc contains stubbed
|
||||
# (non-functional) versions of the pthreads routines, so link-based
|
||||
# tests will erroneously succeed. (We need to link with -pthreads/-mt/
|
||||
# -lpthread.) (The stubs are missing pthread_cleanup_push, or rather
|
||||
# a function called by this macro, so we could check for that, but
|
||||
# who knows whether they'll stub that too in a future libc.) So,
|
||||
# we'll just look for -pthreads and -lpthread first:
|
||||
|
||||
ax_pthread_flags="-pthreads pthread -mt -pthread $ax_pthread_flags"
|
||||
;;
|
||||
|
||||
*-darwin*)
|
||||
ax_pthread_flags="-pthread $ax_pthread_flags"
|
||||
;;
|
||||
esac
|
||||
|
||||
if test x"$ax_pthread_ok" = xno; then
|
||||
for flag in $ax_pthread_flags; do
|
||||
|
||||
case $flag in
|
||||
none)
|
||||
AC_MSG_CHECKING([whether pthreads work without any flags])
|
||||
;;
|
||||
|
||||
-*)
|
||||
AC_MSG_CHECKING([whether pthreads work with $flag])
|
||||
PTHREAD_CFLAGS="$flag"
|
||||
PTHREAD_LIBS="$flag"
|
||||
;;
|
||||
|
||||
pthread-config)
|
||||
AC_CHECK_PROG(ax_pthread_config, pthread-config, yes, no)
|
||||
if test x"$ax_pthread_config" = xno; then continue; fi
|
||||
PTHREAD_CFLAGS="`pthread-config --cflags`"
|
||||
PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`"
|
||||
;;
|
||||
|
||||
*)
|
||||
AC_MSG_CHECKING([for the pthreads library -l$flag])
|
||||
PTHREAD_LIBS="-l$flag"
|
||||
;;
|
||||
esac
|
||||
|
||||
save_LIBS="$LIBS"
|
||||
save_CXXFLAGS="$CXXFLAGS"
|
||||
LIBS="$PTHREAD_LIBS $LIBS"
|
||||
CXXFLAGS="$CXXFLAGS $PTHREAD_CFLAGS"
|
||||
|
||||
# Check for various functions. We must include pthread.h,
|
||||
# since some functions may be macros. (On the Sequent, we
|
||||
# need a special flag -Kthread to make this header compile.)
|
||||
# We check for pthread_join because it is in -lpthread on IRIX
|
||||
# while pthread_create is in libc. We check for pthread_attr_init
|
||||
# due to DEC craziness with -lpthreads. We check for
|
||||
# pthread_cleanup_push because it is one of the few pthread
|
||||
# functions on Solaris that doesn't have a non-functional libc stub.
|
||||
# We try pthread_create on general principles.
|
||||
AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <pthread.h>
|
||||
static void routine(void *a) { *((int*)a) = 42; }
|
||||
static void *start_routine(void *a) { return a; }],
|
||||
[pthread_t th; pthread_attr_t attr;
|
||||
pthread_create(&th, 0, start_routine, 0);
|
||||
pthread_join(th, 0);
|
||||
pthread_attr_init(&attr);
|
||||
pthread_cleanup_push(routine, 0);
|
||||
pthread_cleanup_pop(0) /* ; */])],
|
||||
[ax_pthread_ok=yes],
|
||||
[])
|
||||
|
||||
LIBS="$save_LIBS"
|
||||
CXXFLAGS="$save_CXXFLAGS"
|
||||
|
||||
AC_MSG_RESULT($ax_pthread_ok)
|
||||
if test "x$ax_pthread_ok" = xyes; then
|
||||
break;
|
||||
fi
|
||||
|
||||
PTHREAD_LIBS=""
|
||||
PTHREAD_CFLAGS=""
|
||||
done
|
||||
fi
|
||||
|
||||
# Various other checks:
|
||||
if test "x$ax_pthread_ok" = xyes; then
|
||||
save_LIBS="$LIBS"
|
||||
LIBS="$PTHREAD_LIBS $LIBS"
|
||||
save_CXXFLAGS="$CXXFLAGS"
|
||||
CXXFLAGS="$CXXFLAGS $PTHREAD_CFLAGS"
|
||||
|
||||
# Detect AIX lossage: JOINABLE attribute is called UNDETACHED.
|
||||
AC_MSG_CHECKING([for joinable pthread attribute])
|
||||
attr_name=unknown
|
||||
for attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do
|
||||
AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <pthread.h>],
|
||||
[int attr = $attr; return attr /* ; */])],
|
||||
[attr_name=$attr; break],
|
||||
[])
|
||||
done
|
||||
AC_MSG_RESULT($attr_name)
|
||||
if test "$attr_name" != PTHREAD_CREATE_JOINABLE; then
|
||||
AC_DEFINE_UNQUOTED(PTHREAD_CREATE_JOINABLE, $attr_name,
|
||||
[Define to necessary symbol if this constant
|
||||
uses a non-standard name on your system.])
|
||||
fi
|
||||
|
||||
AC_MSG_CHECKING([if more special flags are required for pthreads])
|
||||
flag=no
|
||||
case "${host_cpu}-${host_os}" in
|
||||
*-aix* | *-freebsd* | *-darwin*) flag="-D_THREAD_SAFE";;
|
||||
*-osf* | *-hpux*) flag="-D_REENTRANT";;
|
||||
*solaris*)
|
||||
if test "$GXX" = "yes"; then
|
||||
flag="-D_REENTRANT"
|
||||
else
|
||||
flag="-mt -D_REENTRANT"
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
AC_MSG_RESULT(${flag})
|
||||
if test "x$flag" != xno; then
|
||||
PTHREAD_CFLAGS="$flag $PTHREAD_CFLAGS"
|
||||
fi
|
||||
|
||||
AC_CACHE_CHECK([for PTHREAD_PRIO_INHERIT],
|
||||
ax_cv_PTHREAD_PRIO_INHERIT, [
|
||||
AC_LINK_IFELSE([
|
||||
AC_LANG_PROGRAM([[#include <pthread.h>]], [[int i = PTHREAD_PRIO_INHERIT; (void) i;]])],
|
||||
[ax_cv_PTHREAD_PRIO_INHERIT=yes],
|
||||
[ax_cv_PTHREAD_PRIO_INHERIT=no])
|
||||
])
|
||||
AS_IF([test "x$ax_cv_PTHREAD_PRIO_INHERIT" = "xyes"],
|
||||
AC_DEFINE([HAVE_PTHREAD_PRIO_INHERIT], 1, [Have PTHREAD_PRIO_INHERIT.]))
|
||||
|
||||
LIBS="$save_LIBS"
|
||||
CXXFLAGS="$save_CXXFLAGS"
|
||||
|
||||
# More AIX lossage: must compile with xlc_r or cc_r
|
||||
if test x"$GXX" != xyes; then
|
||||
AC_CHECK_PROGS(PTHREAD_CC, xlc_r cc_r, ${CC})
|
||||
else
|
||||
PTHREAD_CC=$CC
|
||||
fi
|
||||
else
|
||||
PTHREAD_CC="$CC"
|
||||
fi
|
||||
|
||||
AC_SUBST(PTHREAD_LIBS)
|
||||
AC_SUBST(PTHREAD_CFLAGS)
|
||||
AC_SUBST(PTHREAD_CC)
|
||||
|
||||
# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND:
|
||||
if test x"$ax_pthread_ok" = xyes; then
|
||||
ifelse([$1],,AC_DEFINE(HAVE_PTHREAD,1,[Define if you have POSIX threads libraries and header files.]),[$1])
|
||||
:
|
||||
else
|
||||
ax_pthread_ok=no
|
||||
$2
|
||||
fi
|
||||
AC_LANG_POP
|
||||
])dnl AX_PTHREAD
|
||||
272
m4/iconv.m4
272
m4/iconv.m4
@@ -1,272 +0,0 @@
|
||||
# iconv.m4 serial 18 (gettext-0.18.2)
|
||||
dnl Copyright (C) 2000-2002, 2007-2012 Free Software Foundation, Inc.
|
||||
dnl This file is free software; the Free Software Foundation
|
||||
dnl gives unlimited permission to copy and/or distribute it,
|
||||
dnl with or without modifications, as long as this notice is preserved.
|
||||
|
||||
dnl From Bruno Haible.
|
||||
|
||||
AC_DEFUN([AM_ICONV_LINKFLAGS_BODY],
|
||||
[
|
||||
dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
|
||||
AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
|
||||
dnl AC_REQUIRE([AC_LIB_RPATH])
|
||||
|
||||
dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
|
||||
dnl accordingly.
|
||||
AC_LIB_LINKFLAGS_BODY([iconv])
|
||||
])
|
||||
|
||||
AC_DEFUN([AM_ICONV_LINK],
|
||||
[
|
||||
[HAVE_ICONV=""]
|
||||
|
||||
dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and
|
||||
dnl those with the standalone portable GNU libiconv installed).
|
||||
AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
|
||||
|
||||
dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
|
||||
dnl accordingly.
|
||||
AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
|
||||
|
||||
dnl Add $INCICONV to CPPFLAGS before performing the following checks,
|
||||
dnl because if the user has installed libiconv and not disabled its use
|
||||
dnl via --without-libiconv-prefix, he wants to use it. The first
|
||||
dnl AC_LINK_IFELSE will then fail, the second AC_LINK_IFELSE will succeed.
|
||||
am_save_CPPFLAGS="$CPPFLAGS"
|
||||
AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCICONV])
|
||||
|
||||
AC_CACHE_CHECK([for iconv], [am_cv_func_iconv], [
|
||||
am_cv_func_iconv="no, consider installing GNU libiconv"
|
||||
am_cv_lib_iconv=no
|
||||
AC_LINK_IFELSE(
|
||||
[AC_LANG_PROGRAM(
|
||||
[[
|
||||
#include <stdlib.h>
|
||||
#include <iconv.h>
|
||||
]],
|
||||
[[iconv_t cd = iconv_open("","");
|
||||
iconv(cd,NULL,NULL,NULL,NULL);
|
||||
iconv_close(cd);]])],
|
||||
[am_cv_func_iconv=yes])
|
||||
if test "$am_cv_func_iconv" != yes; then
|
||||
am_save_LIBS="$LIBS"
|
||||
LIBS="$LIBS $LIBICONV"
|
||||
AC_LINK_IFELSE(
|
||||
[AC_LANG_PROGRAM(
|
||||
[[
|
||||
#include <stdlib.h>
|
||||
#include <iconv.h>
|
||||
]],
|
||||
[[iconv_t cd = iconv_open("","");
|
||||
iconv(cd,NULL,NULL,NULL,NULL);
|
||||
iconv_close(cd);]])],
|
||||
[am_cv_lib_iconv=yes]
|
||||
[am_cv_func_iconv=yes])
|
||||
LIBS="$am_save_LIBS"
|
||||
fi
|
||||
])
|
||||
if test "$am_cv_func_iconv" = yes; then
|
||||
AC_CACHE_CHECK([for working iconv], [am_cv_func_iconv_works], [
|
||||
dnl This tests against bugs in AIX 5.1, AIX 6.1..7.1, HP-UX 11.11,
|
||||
dnl Solaris 10.
|
||||
am_save_LIBS="$LIBS"
|
||||
if test $am_cv_lib_iconv = yes; then
|
||||
LIBS="$LIBS $LIBICONV"
|
||||
fi
|
||||
AC_RUN_IFELSE(
|
||||
[AC_LANG_SOURCE([[
|
||||
#include <iconv.h>
|
||||
#include <string.h>
|
||||
int main ()
|
||||
{
|
||||
int result = 0;
|
||||
/* Test against AIX 5.1 bug: Failures are not distinguishable from successful
|
||||
returns. */
|
||||
{
|
||||
iconv_t cd_utf8_to_88591 = iconv_open ("ISO8859-1", "UTF-8");
|
||||
if (cd_utf8_to_88591 != (iconv_t)(-1))
|
||||
{
|
||||
static const char input[] = "\342\202\254"; /* EURO SIGN */
|
||||
char buf[10];
|
||||
const char *inptr = input;
|
||||
size_t inbytesleft = strlen (input);
|
||||
char *outptr = buf;
|
||||
size_t outbytesleft = sizeof (buf);
|
||||
size_t res = iconv (cd_utf8_to_88591,
|
||||
(char **) &inptr, &inbytesleft,
|
||||
&outptr, &outbytesleft);
|
||||
if (res == 0)
|
||||
result |= 1;
|
||||
iconv_close (cd_utf8_to_88591);
|
||||
}
|
||||
}
|
||||
/* Test against Solaris 10 bug: Failures are not distinguishable from
|
||||
successful returns. */
|
||||
{
|
||||
iconv_t cd_ascii_to_88591 = iconv_open ("ISO8859-1", "646");
|
||||
if (cd_ascii_to_88591 != (iconv_t)(-1))
|
||||
{
|
||||
static const char input[] = "\263";
|
||||
char buf[10];
|
||||
const char *inptr = input;
|
||||
size_t inbytesleft = strlen (input);
|
||||
char *outptr = buf;
|
||||
size_t outbytesleft = sizeof (buf);
|
||||
size_t res = iconv (cd_ascii_to_88591,
|
||||
(char **) &inptr, &inbytesleft,
|
||||
&outptr, &outbytesleft);
|
||||
if (res == 0)
|
||||
result |= 2;
|
||||
iconv_close (cd_ascii_to_88591);
|
||||
}
|
||||
}
|
||||
/* Test against AIX 6.1..7.1 bug: Buffer overrun. */
|
||||
{
|
||||
iconv_t cd_88591_to_utf8 = iconv_open ("UTF-8", "ISO-8859-1");
|
||||
if (cd_88591_to_utf8 != (iconv_t)(-1))
|
||||
{
|
||||
static const char input[] = "\304";
|
||||
static char buf[2] = { (char)0xDE, (char)0xAD };
|
||||
const char *inptr = input;
|
||||
size_t inbytesleft = 1;
|
||||
char *outptr = buf;
|
||||
size_t outbytesleft = 1;
|
||||
size_t res = iconv (cd_88591_to_utf8,
|
||||
(char **) &inptr, &inbytesleft,
|
||||
&outptr, &outbytesleft);
|
||||
if (res != (size_t)(-1) || outptr - buf > 1 || buf[1] != (char)0xAD)
|
||||
result |= 4;
|
||||
iconv_close (cd_88591_to_utf8);
|
||||
}
|
||||
}
|
||||
#if 0 /* This bug could be worked around by the caller. */
|
||||
/* Test against HP-UX 11.11 bug: Positive return value instead of 0. */
|
||||
{
|
||||
iconv_t cd_88591_to_utf8 = iconv_open ("utf8", "iso88591");
|
||||
if (cd_88591_to_utf8 != (iconv_t)(-1))
|
||||
{
|
||||
static const char input[] = "\304rger mit b\366sen B\374bchen ohne Augenma\337";
|
||||
char buf[50];
|
||||
const char *inptr = input;
|
||||
size_t inbytesleft = strlen (input);
|
||||
char *outptr = buf;
|
||||
size_t outbytesleft = sizeof (buf);
|
||||
size_t res = iconv (cd_88591_to_utf8,
|
||||
(char **) &inptr, &inbytesleft,
|
||||
&outptr, &outbytesleft);
|
||||
if ((int)res > 0)
|
||||
result |= 8;
|
||||
iconv_close (cd_88591_to_utf8);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
/* Test against HP-UX 11.11 bug: No converter from EUC-JP to UTF-8 is
|
||||
provided. */
|
||||
if (/* Try standardized names. */
|
||||
iconv_open ("UTF-8", "EUC-JP") == (iconv_t)(-1)
|
||||
/* Try IRIX, OSF/1 names. */
|
||||
&& iconv_open ("UTF-8", "eucJP") == (iconv_t)(-1)
|
||||
/* Try AIX names. */
|
||||
&& iconv_open ("UTF-8", "IBM-eucJP") == (iconv_t)(-1)
|
||||
/* Try HP-UX names. */
|
||||
&& iconv_open ("utf8", "eucJP") == (iconv_t)(-1))
|
||||
result |= 16;
|
||||
return result;
|
||||
}]])],
|
||||
[am_cv_func_iconv_works=yes],
|
||||
[am_cv_func_iconv_works=no],
|
||||
[
|
||||
changequote(,)dnl
|
||||
case "$host_os" in
|
||||
aix* | hpux*) am_cv_func_iconv_works="guessing no" ;;
|
||||
*) am_cv_func_iconv_works="guessing yes" ;;
|
||||
esac
|
||||
changequote([,])dnl
|
||||
])
|
||||
LIBS="$am_save_LIBS"
|
||||
])
|
||||
case "$am_cv_func_iconv_works" in
|
||||
*no) am_func_iconv=no am_cv_lib_iconv=no ;;
|
||||
*) am_func_iconv=yes ;;
|
||||
esac
|
||||
else
|
||||
am_func_iconv=no am_cv_lib_iconv=no
|
||||
fi
|
||||
if test "$am_func_iconv" = yes; then
|
||||
AC_DEFINE([HAVE_ICONV], [1],
|
||||
[Define if you have the iconv() function and it works.])
|
||||
[HAVE_ICONV=1]
|
||||
fi
|
||||
if test "$am_cv_lib_iconv" = yes; then
|
||||
AC_MSG_CHECKING([how to link with libiconv])
|
||||
AC_MSG_RESULT([$LIBICONV])
|
||||
else
|
||||
dnl If $LIBICONV didn't lead to a usable library, we don't need $INCICONV
|
||||
dnl either.
|
||||
CPPFLAGS="$am_save_CPPFLAGS"
|
||||
LIBICONV=
|
||||
LTLIBICONV=
|
||||
fi
|
||||
AC_SUBST([HAVE_ICONV])
|
||||
AC_SUBST([LIBICONV])
|
||||
AC_SUBST([LTLIBICONV])
|
||||
])
|
||||
|
||||
dnl Define AM_ICONV using AC_DEFUN_ONCE for Autoconf >= 2.64, in order to
|
||||
dnl avoid warnings like
|
||||
dnl "warning: AC_REQUIRE: `AM_ICONV' was expanded before it was required".
|
||||
dnl This is tricky because of the way 'aclocal' is implemented:
|
||||
dnl - It requires defining an auxiliary macro whose name ends in AC_DEFUN.
|
||||
dnl Otherwise aclocal's initial scan pass would miss the macro definition.
|
||||
dnl - It requires a line break inside the AC_DEFUN_ONCE and AC_DEFUN expansions.
|
||||
dnl Otherwise aclocal would emit many "Use of uninitialized value $1"
|
||||
dnl warnings.
|
||||
m4_define([gl_iconv_AC_DEFUN],
|
||||
m4_version_prereq([2.64],
|
||||
[[AC_DEFUN_ONCE(
|
||||
[$1], [$2])]],
|
||||
[m4_ifdef([gl_00GNULIB],
|
||||
[[AC_DEFUN_ONCE(
|
||||
[$1], [$2])]],
|
||||
[[AC_DEFUN(
|
||||
[$1], [$2])]])]))
|
||||
gl_iconv_AC_DEFUN([AM_ICONV],
|
||||
[
|
||||
AM_ICONV_LINK
|
||||
if test "$am_cv_func_iconv" = yes; then
|
||||
AC_MSG_CHECKING([for iconv declaration])
|
||||
AC_CACHE_VAL([am_cv_proto_iconv], [
|
||||
AC_COMPILE_IFELSE(
|
||||
[AC_LANG_PROGRAM(
|
||||
[[
|
||||
#include <stdlib.h>
|
||||
#include <iconv.h>
|
||||
extern
|
||||
#ifdef __cplusplus
|
||||
"C"
|
||||
#endif
|
||||
#if defined(__STDC__) || defined(_MSC_VER) || defined(__cplusplus)
|
||||
size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
|
||||
#else
|
||||
size_t iconv();
|
||||
#endif
|
||||
]],
|
||||
[[]])],
|
||||
[am_cv_proto_iconv_arg1=""],
|
||||
[am_cv_proto_iconv_arg1="const"])
|
||||
am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);"])
|
||||
am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'`
|
||||
AC_MSG_RESULT([
|
||||
$am_cv_proto_iconv])
|
||||
AC_DEFINE_UNQUOTED([ICONV_CONST], [$am_cv_proto_iconv_arg1],
|
||||
[Define as const if the declaration of iconv() needs const.])
|
||||
dnl Also substitute ICONV_CONST in the gnulib generated <iconv.h>.
|
||||
m4_ifdef([gl_ICONV_H_DEFAULTS],
|
||||
[AC_REQUIRE([gl_ICONV_H_DEFAULTS])
|
||||
if test -n "$am_cv_proto_iconv_arg1"; then
|
||||
ICONV_CONST="const"
|
||||
fi
|
||||
])
|
||||
fi
|
||||
])
|
||||
@@ -1,88 +0,0 @@
|
||||
# visibility.m4 serial 3 (gettext-0.18)
|
||||
dnl Copyright (C) 2005, 2008-2010 Free Software Foundation, Inc.
|
||||
dnl This file is free software; the Free Software Foundation
|
||||
dnl gives unlimited permission to copy and/or distribute it,
|
||||
dnl with or without modifications, as long as this notice is preserved.
|
||||
|
||||
dnl From Bruno Haible.
|
||||
|
||||
dnl Changes done by Uli Schlachter (C) 2011:
|
||||
dnl - Renamed everything from gl_ to znc_
|
||||
dnl - Instead of using CFLAGS, this now uses CXXFLAGS (the macro would actually
|
||||
dnl silently break if you called AC_LANG with anything but C before it)
|
||||
dnl - Because of the above, this now requiers AC_PROG_CXX and $GXX instead
|
||||
dnl of $GCC
|
||||
dnl - Added calls to AC_LANG_PUSH([C++]) and AC_LANG_POP
|
||||
dnl - Replaced AC_TRY_COMPILE with AC_COMPILE_IFELSE
|
||||
dnl - Added a definition for dummyfunc() so that this works with
|
||||
dnl -Wmissing-declarations
|
||||
|
||||
dnl Tests whether the compiler supports the command-line option
|
||||
dnl -fvisibility=hidden and the function and variable attributes
|
||||
dnl __attribute__((__visibility__("hidden"))) and
|
||||
dnl __attribute__((__visibility__("default"))).
|
||||
dnl Does *not* test for __visibility__("protected") - which has tricky
|
||||
dnl semantics (see the 'vismain' test in glibc) and does not exist e.g. on
|
||||
dnl MacOS X.
|
||||
dnl Does *not* test for __visibility__("internal") - which has processor
|
||||
dnl dependent semantics.
|
||||
dnl Does *not* test for #pragma GCC visibility push(hidden) - which is
|
||||
dnl "really only recommended for legacy code".
|
||||
dnl Set the variable CFLAG_VISIBILITY.
|
||||
dnl Defines and sets the variable HAVE_VISIBILITY.
|
||||
|
||||
AC_DEFUN([ZNC_VISIBILITY],
|
||||
[
|
||||
AC_REQUIRE([AC_PROG_CXX])
|
||||
AC_LANG_PUSH([C++])
|
||||
CFLAG_VISIBILITY=
|
||||
HAVE_VISIBILITY=0
|
||||
if test -n "$GXX"; then
|
||||
dnl First, check whether -Werror can be added to the command line, or
|
||||
dnl whether it leads to an error because of some other option that the
|
||||
dnl user has put into $CC $CFLAGS $CPPFLAGS.
|
||||
AC_MSG_CHECKING([whether the -Werror option is usable])
|
||||
AC_CACHE_VAL([znc_cv_cc_vis_werror], [
|
||||
znc_save_CXXFLAGS="$CXXFLAGS"
|
||||
CXXFLAGS="$CXXFLAGS -Werror"
|
||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [])],
|
||||
[znc_cv_cc_vis_werror=yes],
|
||||
[znc_cv_cc_vis_werror=no])
|
||||
CXXFLAGS="$znc_save_CXXFLAGS"])
|
||||
AC_MSG_RESULT([$znc_cv_cc_vis_werror])
|
||||
dnl Now check whether visibility declarations are supported.
|
||||
AC_MSG_CHECKING([for simple visibility declarations])
|
||||
AC_CACHE_VAL([znc_cv_cc_visibility], [
|
||||
znc_save_CXXFLAGS="$CXXFLAGS"
|
||||
CXXFLAGS="$CXXFLAGS -fvisibility=hidden"
|
||||
dnl We use the option -Werror and a function dummyfunc, because on some
|
||||
dnl platforms (Cygwin 1.7) the use of -fvisibility triggers a warning
|
||||
dnl "visibility attribute not supported in this configuration; ignored"
|
||||
dnl at the first function definition in every compilation unit, and we
|
||||
dnl don't want to use the option in this case.
|
||||
if test $znc_cv_cc_vis_werror = yes; then
|
||||
CXXFLAGS="$CXXFLAGS -Werror"
|
||||
fi
|
||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
|
||||
[[extern __attribute__((__visibility__("hidden"))) int hiddenvar;
|
||||
extern __attribute__((__visibility__("default"))) int exportedvar;
|
||||
extern __attribute__((__visibility__("hidden"))) int hiddenfunc (void);
|
||||
extern __attribute__((__visibility__("default"))) int exportedfunc (void);
|
||||
void dummyfunc (void);
|
||||
void dummyfunc (void) {}]],
|
||||
[])],
|
||||
[znc_cv_cc_visibility=yes],
|
||||
[znc_cv_cc_visibility=no])
|
||||
CXXFLAGS="$znc_save_CXXFLAGS"])
|
||||
AC_MSG_RESULT([$znc_cv_cc_visibility])
|
||||
if test $znc_cv_cc_visibility = yes; then
|
||||
CFLAG_VISIBILITY="-fvisibility=hidden"
|
||||
HAVE_VISIBILITY=1
|
||||
fi
|
||||
fi
|
||||
AC_SUBST([CFLAG_VISIBILITY])
|
||||
AC_SUBST([HAVE_VISIBILITY])
|
||||
AC_DEFINE_UNQUOTED([HAVE_VISIBILITY], [$HAVE_VISIBILITY],
|
||||
[Define to 1 or 0, depending whether the compiler supports simple visibility declarations.])
|
||||
AC_LANG_POP
|
||||
])
|
||||
@@ -50,15 +50,8 @@ cp -p third_party/Csocket/Csocket.cc third_party/Csocket/Csocket.h $TMPDIR/$ZNCD
|
||||
)
|
||||
(
|
||||
cd $TMPDIR/$ZNCDIR
|
||||
AUTOMAKE_FLAGS="--add-missing --copy" ./autogen.sh
|
||||
rm -r autom4te.cache/
|
||||
rm -rf .travis* .appveyor* .ci/
|
||||
rm make-tarball.sh
|
||||
# For autoconf
|
||||
sed -e "s/THIS_IS_NOT_TARBALL//" -i Makefile.in
|
||||
echo '#include <znc/version.h>' > src/version.cpp
|
||||
echo "const char* ZNC_VERSION_EXTRA = VERSION_EXTRA \"$DESC\";" >> src/version.cpp
|
||||
# For cmake
|
||||
if [ "x$DESC" != "x" ]; then
|
||||
if [ $NIGHTLY = 1 ]; then
|
||||
echo $DESC > .nightly
|
||||
|
||||
@@ -1,44 +0,0 @@
|
||||
SHELL := @SHELL@
|
||||
|
||||
# Support out-of-tree builds
|
||||
VPATH := @srcdir@
|
||||
|
||||
prefix := @prefix@
|
||||
exec_prefix := @exec_prefix@
|
||||
datarootdir := @datarootdir@
|
||||
mandir := @mandir@
|
||||
|
||||
INSTALL := @INSTALL@
|
||||
INSTALL_DATA := @INSTALL_DATA@
|
||||
|
||||
MAN1 := znc.1.gz znc-buildmod.1.gz
|
||||
|
||||
ifneq "$(V)" ""
|
||||
VERBOSE=1
|
||||
endif
|
||||
ifeq "$(VERBOSE)" ""
|
||||
Q=@
|
||||
E=@echo
|
||||
else
|
||||
Q=
|
||||
E=@\#
|
||||
endif
|
||||
|
||||
all: $(MAN1)
|
||||
|
||||
%.1.gz: %.1 Makefile
|
||||
$(E) Packing man page $@...
|
||||
$(Q)gzip -9 <$< >$@
|
||||
|
||||
clean:
|
||||
-rm -f $(MAN1)
|
||||
|
||||
install: $(MAN1)
|
||||
test -d $(DESTDIR)$(mandir)/man1 || $(INSTALL) -d $(DESTDIR)$(mandir)/man1
|
||||
$(INSTALL_DATA) $(MAN1) $(DESTDIR)$(mandir)/man1
|
||||
|
||||
uninstall:
|
||||
for file in $(MAN1) ; do \
|
||||
rm $(DESTDIR)$(mandir)/man1/$$file || exit 1 ; \
|
||||
done
|
||||
rmdir $(DESTDIR)$(mandir)/man1
|
||||
@@ -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/
|
||||
10
src/znc.cpp
10
src/znc.cpp
@@ -134,15 +134,7 @@ CString CZNC::GetTag(bool bIncludeVersion, bool bHTML) {
|
||||
}
|
||||
|
||||
CString CZNC::GetCompileOptionsString() {
|
||||
// Build system doesn't affect ABI
|
||||
return ZNC_COMPILE_OPTIONS_STRING + CString(
|
||||
", build: "
|
||||
#ifdef BUILD_WITH_CMAKE
|
||||
"cmake"
|
||||
#else
|
||||
"autoconf"
|
||||
#endif
|
||||
);
|
||||
return ZNC_COMPILE_OPTIONS_STRING;
|
||||
}
|
||||
|
||||
CString CZNC::GetUptime() const {
|
||||
|
||||
59
version.sh
59
version.sh
@@ -1,59 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
# When changing this file, remember also about nightlies (make-tarball.sh)
|
||||
|
||||
# Get the path to the source directory
|
||||
GIT_DIR=`dirname $0`
|
||||
|
||||
# Our argument should be the path to git
|
||||
GIT="$1"
|
||||
if [ "x$GIT" = "x" ]
|
||||
then
|
||||
EXTRA=""
|
||||
else
|
||||
GIT_HERE="${GIT}"
|
||||
GIT="${GIT} --git-dir=${GIT_DIR}/.git"
|
||||
|
||||
# Figure out the information we need
|
||||
LATEST_TAG=`${GIT} describe --abbrev=0 HEAD`
|
||||
COMMITS_SINCE=`${GIT} log --pretty=oneline ${LATEST_TAG}..HEAD | wc -l`
|
||||
# Explicitly make it a number: on openbsd wc -l returns " 42" instead of "42"
|
||||
let COMMITS_SINCE=COMMITS_SINCE
|
||||
SHORT_ID=`${GIT} rev-parse --short HEAD`
|
||||
|
||||
if [ "x$COMMITS_SINCE" = "x0" ]
|
||||
then
|
||||
if [ "x$LATEST_TAG" = "x" ]
|
||||
then
|
||||
if [ "x$SHORT_ID" = "x" ]
|
||||
then
|
||||
EXTRA=""
|
||||
else
|
||||
EXTRA="-git-${SHORT_ID}"
|
||||
fi
|
||||
else
|
||||
# If this commit is tagged, don't print anything
|
||||
# (the assumption here is: this is a release)
|
||||
EXTRA=""
|
||||
fi
|
||||
else
|
||||
EXTRA="-git-${COMMITS_SINCE}-${SHORT_ID}"
|
||||
fi
|
||||
|
||||
if [ 1 = `cd ${GIT_DIR}; ${GIT_HERE} status --ignore-submodules=dirty --porcelain -- third_party/Csocket | wc -l` ]
|
||||
then
|
||||
# Makefile redirects all errors from this script into /dev/null, but this messages actually needs to be shown
|
||||
# So put it to 3, and then Makefile redirects 3 to stderr
|
||||
echo "Warning: Csocket submodule looks outdated. Run: git submodule update --init --recursive" 1>&3
|
||||
EXTRA="${EXTRA}-frankenznc"
|
||||
fi
|
||||
fi
|
||||
|
||||
# Generate output file, if any
|
||||
if [ "x$WRITE_OUTPUT" = "xyes" ]
|
||||
then
|
||||
echo '#include <znc/version.h>' > src/version.cpp
|
||||
echo "const char* ZNC_VERSION_EXTRA = VERSION_EXTRA \"$EXTRA\";" >> src/version.cpp
|
||||
fi
|
||||
|
||||
echo "$EXTRA"
|
||||
@@ -1,68 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
ERROR="[ !! ]"
|
||||
WARNING="[ ** ]"
|
||||
OK="[ ok ]"
|
||||
|
||||
# Check if we got everything we need
|
||||
|
||||
check_binary()
|
||||
{
|
||||
which $1 > /dev/null 2>&1
|
||||
if test $? = 1 ; then
|
||||
echo "${ERROR} Could not find $1. $2"
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
if test "x$CXX" = "x" ; then
|
||||
CXX="@CXX@"
|
||||
fi
|
||||
if test "x$CXX" = "x" ; then
|
||||
CXX=g++
|
||||
fi
|
||||
|
||||
check_binary ${CXX} "What happened to your compiler?"
|
||||
|
||||
if test -z "$1"; then
|
||||
echo "${WARNING} USAGE: $0 <file.cpp> [file.cpp ... ]"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
CXXFLAGS="@CPPFLAGS@ @MODFLAGS@ -I@prefix@/include $CXXFLAGS"
|
||||
LIBS="@LIBS@ $LIBS"
|
||||
MODLINK="@MODLINK@ $MODLINK"
|
||||
VERSION="@PACKAGE_VERSION@"
|
||||
|
||||
# Ugly cygwin stuff :(
|
||||
if test -n "@LIBZNC@"; then
|
||||
prefix="@prefix@"
|
||||
exec_prefix="@exec_prefix@"
|
||||
LDFLAGS="-L@libdir@ $LDFLAGS"
|
||||
LIBS="-lznc $LIBS"
|
||||
fi
|
||||
|
||||
while test -n "$1"
|
||||
do
|
||||
FILE=$1
|
||||
shift
|
||||
|
||||
MOD="${FILE%.cpp}"
|
||||
MOD="${MOD%.cc}"
|
||||
MOD="${MOD##*/}"
|
||||
|
||||
if test ! -f "${FILE}"; then
|
||||
echo "${ERROR} Building \"${MOD}\" for ZNC $VERSION... File not found"
|
||||
exit 1
|
||||
else
|
||||
printf "Building \"${MOD}.so\" for ZNC $VERSION... "
|
||||
if ${CXX} ${CXXFLAGS} ${INCLUDES} ${LDFLAGS} ${MODLINK} -o "${MOD}.so" "${FILE}" ${LIBS} ; then
|
||||
echo "${OK}"
|
||||
else
|
||||
echo "${ERROR} Error while building \"${MOD}.so\""
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
exit 0
|
||||
@@ -1,26 +0,0 @@
|
||||
# You can access these with e.g. pkg-config --variable=moddir znc
|
||||
prefix=@prefix@
|
||||
exec_prefix=@exec_prefix@
|
||||
datarootdir=@datarootdir@
|
||||
bindir=@bindir@
|
||||
libdir=@libdir@
|
||||
datadir=@datadir@
|
||||
includedir=@includedir@
|
||||
|
||||
cxx=@CXX@
|
||||
CPPFLAGS=@CPPFLAGS@
|
||||
MODFLAGS=@MODFLAGS@
|
||||
version=@PACKAGE_VERSION@
|
||||
moddir=@MODDIR@
|
||||
moddatadir=@DATADIR@
|
||||
modlink=@MODLINK@
|
||||
|
||||
# This and the following two lines should be the only differences to znc.pc.in
|
||||
srcdir=@abs_srcdir@
|
||||
INC_PATH=-I${srcdir}/
|
||||
|
||||
Name: ZNC
|
||||
Description: An advanced IRC proxy
|
||||
Version: ${version}
|
||||
URL: https://znc.in
|
||||
Cflags: ${CPPFLAGS} ${MODFLAGS} ${INC_PATH}
|
||||
24
znc.pc.in
24
znc.pc.in
@@ -1,24 +0,0 @@
|
||||
# You can access these with e.g. pkg-config --variable=moddir znc
|
||||
prefix=@prefix@
|
||||
exec_prefix=@exec_prefix@
|
||||
datarootdir=@datarootdir@
|
||||
bindir=@bindir@
|
||||
libdir=@libdir@
|
||||
datadir=@datadir@
|
||||
includedir=@includedir@
|
||||
|
||||
cxx=@CXX@
|
||||
CPPFLAGS=@CPPFLAGS@
|
||||
MODFLAGS=@MODFLAGS@
|
||||
version=@PACKAGE_VERSION@
|
||||
moddir=@MODDIR@
|
||||
moddatadir=@DATADIR@
|
||||
modlink=@MODLINK@
|
||||
|
||||
INC_PATH=-I${includedir}/znc
|
||||
|
||||
Name: ZNC
|
||||
Description: An advanced IRC proxy
|
||||
Version: ${version}
|
||||
URL: https://znc.in
|
||||
Cflags: ${CPPFLAGS} ${MODFLAGS} ${INC_PATH}
|
||||
Reference in New Issue
Block a user