summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorRoland Reichwein <mail@reichwein.it>2023-01-03 09:31:51 +0100
committerRoland Reichwein <mail@reichwein.it>2023-01-03 09:31:51 +0100
commit2b6f8123e925e3be8ce7c04eccdd49fc728314a5 (patch)
tree78e86bb428b3bc821ae84d0f6abe86136356bd1a
parent5581340f23b31114d33736c630de849898668f38 (diff)
Separated out libcommon as libreichwein
-rw-r--r--Makefile24
-rw-r--r--common.mk4
-rw-r--r--debian/control2
-rw-r--r--https.cpp2
-rwxr-xr-xinstall-webserver.sh2
-rw-r--r--libcommon/Makefile39
-rw-r--r--libcommon/file.cpp46
-rw-r--r--libcommon/file.h15
-rw-r--r--libcommon/mime.cpp41
-rw-r--r--libcommon/mime.h5
-rw-r--r--libcommon/stringutil.cpp66
-rw-r--r--libcommon/stringutil.h10
-rw-r--r--libcommon/tempfile.cpp42
-rw-r--r--libcommon/tempfile.h17
-rw-r--r--libcommon/url.cpp32
-rw-r--r--libcommon/url.h6
-rw-r--r--plugins/cgi/Makefile9
-rw-r--r--plugins/cgi/cgi.cpp2
-rw-r--r--plugins/fcgi/Makefile5
-rw-r--r--plugins/redirect/Makefile5
-rw-r--r--plugins/static-files/Makefile8
-rw-r--r--plugins/static-files/static-files.cpp4
-rw-r--r--plugins/statistics/Makefile8
-rw-r--r--plugins/statistics/statistics.cpp4
-rw-r--r--plugins/webbox/Makefile8
-rw-r--r--plugins/webbox/webbox.cpp10
-rw-r--r--plugins/weblog/Makefile8
-rw-r--r--plugins/weblog/weblog.cpp4
-rw-r--r--response.cpp4
-rw-r--r--tests/Makefile6
30 files changed, 33 insertions, 405 deletions
diff --git a/Makefile b/Makefile
index 94bbe46..cc79b02 100644
--- a/Makefile
+++ b/Makefile
@@ -2,7 +2,7 @@ include common.mk
VERSION=$(shell dpkg-parsechangelog --show-field Version)
-DISTROS=base base-i386 debian10 debian11 ubuntu2004 ubuntu2204
+DISTROS=base debian11 ubuntu2204 ubuntu2210
PROJECTNAME=webserver
TGZNAME=$(shell ls -t ../webserver-*.tar.xz | head -n1 | sed -e 's,^../,,')
PLUGINS= \
@@ -17,7 +17,7 @@ PLUGINS= \
CXXFLAGS+=-fPIE -DVERSION=\"$(VERSION)\"
LDLIBS+=\
--lcommon \
+-lreichwein \
-lboost_context \
-lboost_filesystem \
-lboost_timer \
@@ -32,7 +32,7 @@ LDLIBS+=\
#-lboost_thread \
#-lboost_regex \
-LDFLAGS+=-pie -Llibcommon
+LDFLAGS+=-pie
PROGSRC=\
auth.cpp \
@@ -55,12 +55,9 @@ build: $(PROJECTNAME) $(PLUGINS)
all: build
./webserver -c webserver.conf
-$(PROJECTNAME): libcommon/libcommon.a $(SRC:.cpp=.o)
+$(PROJECTNAME): $(SRC:.cpp=.o)
$(CXX) $(LDFLAGS) $^ $(LDLIBS) $(LIBS) -o $@
-libcommon/libcommon.a:
- $(MAKE) -C libcommon
-
$(PLUGINS):
cd plugins/$@ && $(MAKE)
@@ -117,7 +114,7 @@ clean:
-rm -f plugins/*.so
-find . -name '*.o' -o -name '*.d' -o -name '*.gcno' -o -name '*.gcda' -o -name '*.so' | xargs rm -f
#for i in $(PLUGINS) ; do $(MAKE) -C plugins/$$i clean ; done
- for i in libcommon tests ; do $(MAKE) -C $$i clean ; done
+ $(MAKE) -C tests clean
-rm -rf result
DISTFILES= \
@@ -170,17 +167,6 @@ DISTFILES= \
debian/webserver.install \
debian/webserver.manpages \
debian/webserver.service \
- libcommon/Makefile \
- libcommon/mime.h \
- libcommon/mime.cpp \
- libcommon/file.h \
- libcommon/file.cpp \
- libcommon/stringutil.h \
- libcommon/stringutil.cpp \
- libcommon/tempfile.h \
- libcommon/tempfile.cpp \
- libcommon/url.h \
- libcommon/url.cpp \
plugins/cgi/cgi.h \
plugins/cgi/Makefile \
plugins/cgi/cgi.cpp \
diff --git a/common.mk b/common.mk
index 4c8947e..badfc9d 100644
--- a/common.mk
+++ b/common.mk
@@ -56,9 +56,9 @@ CXXFLAGS+=-pthread
ifeq ($(CXX),clang++-11)
CXXFLAGS+=-std=c++20 #-stdlib=libc++
else ifeq ($(CXX),clang++-14)
-CXXFLAGS+=-std=c++2b #-stdlib=libc++
+CXXFLAGS+=-std=c++20 #-stdlib=libc++
else ifeq ($(CXX),clang++-13)
-CXXFLAGS+=-std=c++2b #-stdlib=libc++
+CXXFLAGS+=-std=c++20 #-stdlib=libc++
else ifeq ($(CXX),g++-11)
CXXFLAGS+=-std=c++20 #-stdlib=libc++
else
diff --git a/debian/control b/debian/control
index 6959a97..8a0a9fd 100644
--- a/debian/control
+++ b/debian/control
@@ -2,7 +2,7 @@ Source: webserver
Section: httpd
Priority: optional
Maintainer: Roland Reichwein <mail@reichwein.it>
-Build-Depends: debhelper (>= 12), libssl-dev, libboost-all-dev | libboost1.71-all-dev, clang-13 | clang-11 | clang | g++-11 | g++, uglifyjs, python3-pkg-resources, htmlmin, cleancss
+Build-Depends: debhelper (>= 12), libssl-dev, libboost-all-dev | libboost1.71-all-dev, clang-13 | clang-11 | clang | g++-11 | g++, uglifyjs, python3-pkg-resources, htmlmin, cleancss, libreichwein-dev
Standards-Version: 4.5.0
Homepage: http://www.reichwein.it/webserver/
diff --git a/https.cpp b/https.cpp
index bacd7e0..768cdba 100644
--- a/https.cpp
+++ b/https.cpp
@@ -4,7 +4,7 @@
#include "server.h"
#include "response.h"
-#include "libcommon/file.h"
+#include "libreichwein/file.h"
#include <openssl/ssl.h>
#include <openssl/crypto.h>
diff --git a/install-webserver.sh b/install-webserver.sh
index d32f5f1..7a3d54e 100755
--- a/install-webserver.sh
+++ b/install-webserver.sh
@@ -10,7 +10,7 @@ if [ "$#" != "1" ] ; then
fi
VERSION=$1
-DISTROS="debian10 debian11 ubuntu2004 ubuntu2204"
+DISTROS="debian11 ubuntu2204 ubuntu2210"
cd /var/www/reichwein.it-debian
diff --git a/libcommon/Makefile b/libcommon/Makefile
deleted file mode 100644
index ddff9fc..0000000
--- a/libcommon/Makefile
+++ /dev/null
@@ -1,39 +0,0 @@
-# Static library to be included both in main program an in plugins (.so)
-
-include ../common.mk
-
-PROJECTNAME=libcommon
-
-CXXFLAGS+= -fvisibility=hidden -fPIC
-
-PROGSRC=\
- file.cpp \
- mime.cpp \
- stringutil.cpp \
- tempfile.cpp \
- url.cpp
-
-SRC=$(PROGSRC)
-
-all: $(PROJECTNAME).a
-
-$(PROJECTNAME).a: $(SRC:.cpp=.o)
- ar rcs $@ $^
-
-%.d: %.cpp
- $(CXX) $(CXXFLAGS) -MM -MP -MF $@ -c $<
-
-%.o: %.cpp %.d
- $(CXX) $(CXXFLAGS) -c $< -o $@
-
-# dependencies
-
-ADD_DEP=Makefile
-
-# misc ---------------------------------------------------
-clean:
- -rm -f *.o *.a *.d
-
-.PHONY: clean all install
-
--include $(wildcard $(SRC:.cpp=.d))
diff --git a/libcommon/file.cpp b/libcommon/file.cpp
deleted file mode 100644
index 47ab8be..0000000
--- a/libcommon/file.cpp
+++ /dev/null
@@ -1,46 +0,0 @@
-#include "file.h"
-
-#include <fstream>
-
-namespace fs = std::filesystem;
-
-using namespace std::string_literals;
-
-std::string File::getFile(const fs::path& filename)
-{
- std::ifstream file(filename.string(), std::ios::in | std::ios::binary | std::ios::ate);
-
- if (file.is_open()) {
- std::ifstream::pos_type fileSize = file.tellg();
- file.seekg(0, std::ios::beg);
-
- std::string bytes(fileSize, ' ');
- file.read(reinterpret_cast<char*>(bytes.data()), fileSize);
-
- return bytes;
-
- } else {
- throw std::runtime_error("Opening "s + filename.string() + " for reading");
- }
-}
-
-void File::setFile(const fs::path& filename, const std::string& s)
-{
- File::setFile(filename, s.data(), s.size());
-}
-
-void File::setFile(const fs::path& filename, const char* data, size_t size)
-{
- std::ofstream file(filename.string(), std::ios::out | std::ios::binary);
- if (file.is_open()) {
- file.write(data, size);
- } else {
- throw std::runtime_error("Opening "s + filename.string() + " for writing");
- }
-}
-
-void File::setFile(const fs::path& filename, const std::vector<uint8_t>& data)
-{
- File::setFile(filename, reinterpret_cast<const char*>(data.data()), data.size());
-}
-
diff --git a/libcommon/file.h b/libcommon/file.h
deleted file mode 100644
index e7e4cf6..0000000
--- a/libcommon/file.h
+++ /dev/null
@@ -1,15 +0,0 @@
-#pragma once
-
-#include <cstdint>
-#include <filesystem>
-#include <string>
-#include <vector>
-
-namespace File {
-
-std::string getFile(const std::filesystem::path& filename);
-void setFile(const std::filesystem::path& filename, const std::string& s);
-void setFile(const std::filesystem::path& filename, const char* data, size_t size);
-void setFile(const std::filesystem::path& filename, const std::vector<uint8_t>& data);
-
-}
diff --git a/libcommon/mime.cpp b/libcommon/mime.cpp
deleted file mode 100644
index f64d046..0000000
--- a/libcommon/mime.cpp
+++ /dev/null
@@ -1,41 +0,0 @@
-#include "mime.h"
-
-#include <boost/algorithm/string/predicate.hpp>
-#include <boost/beast/http.hpp>
-
-namespace beast = boost::beast;
-
-// Return a reasonable mime type based on the extension of a file.
-std::string mime_type(const std::string& path)
-{
- auto const ext = [&path]
- {
- auto const pos = path.rfind(".");
- if (pos == std::string::npos)
- return std::string{};
- return path.substr(pos);
- }();
- if(boost::algorithm::istarts_with(ext, ".htm")) return "text/html";
- if(boost::algorithm::istarts_with(ext, ".html")) return "text/html";
- if(boost::algorithm::istarts_with(ext, ".php")) return "text/html";
- if(boost::algorithm::istarts_with(ext, ".css")) return "text/css";
- if(boost::algorithm::istarts_with(ext, ".txt")) return "text/plain";
- if(boost::algorithm::istarts_with(ext, ".js")) return "application/javascript";
- if(boost::algorithm::istarts_with(ext, ".json")) return "application/json";
- if(boost::algorithm::istarts_with(ext, ".xml")) return "application/xml";
- if(boost::algorithm::istarts_with(ext, ".swf")) return "application/x-shockwave-flash";
- if(boost::algorithm::istarts_with(ext, ".flv")) return "video/x-flv";
- if(boost::algorithm::istarts_with(ext, ".png")) return "image/png";
- if(boost::algorithm::istarts_with(ext, ".jpe")) return "image/jpeg";
- if(boost::algorithm::istarts_with(ext, ".jpeg")) return "image/jpeg";
- if(boost::algorithm::istarts_with(ext, ".jpg")) return "image/jpeg";
- if(boost::algorithm::istarts_with(ext, ".gif")) return "image/gif";
- if(boost::algorithm::istarts_with(ext, ".bmp")) return "image/bmp";
- if(boost::algorithm::istarts_with(ext, ".ico")) return "image/vnd.microsoft.icon";
- if(boost::algorithm::istarts_with(ext, ".tiff")) return "image/tiff";
- if(boost::algorithm::istarts_with(ext, ".tif")) return "image/tiff";
- if(boost::algorithm::istarts_with(ext, ".svg")) return "image/svg+xml";
- if(boost::algorithm::istarts_with(ext, ".svgz")) return "image/svg+xml";
- return "application/text";
-}
-
diff --git a/libcommon/mime.h b/libcommon/mime.h
deleted file mode 100644
index c05eb45..0000000
--- a/libcommon/mime.h
+++ /dev/null
@@ -1,5 +0,0 @@
-#pragma once
-
-#include <string>
-
-std::string mime_type(const std::string& path);
diff --git a/libcommon/stringutil.cpp b/libcommon/stringutil.cpp
deleted file mode 100644
index f87fa00..0000000
--- a/libcommon/stringutil.cpp
+++ /dev/null
@@ -1,66 +0,0 @@
-#include "stringutil.h"
-
-#include <boost/algorithm/string/predicate.hpp>
-#include <boost/algorithm/string/case_conv.hpp>
-
-#include <cstdarg>
-
-std::string strfmt(const char* fmt, ...)
-{
- va_list args;
-
- va_start(args, fmt);
- int size = std::vsnprintf(nullptr, 0, fmt, args);
- va_end(args);
-
- std::string result(size, ' ');
-
- va_start(args, fmt);
- std::vsnprintf(result.data(), size + 1, fmt, args);
- va_end(args);
-
- return result;
-}
-
-std::vector<std::string> split(std::string value, const std::string separators)
-{
- std::vector<std::string> result;
-
- size_t pos0 = 0;
- size_t pos1 = 0;
- while (pos0 < value.size()) {
- pos1 = value.find_first_of(separators, pos0);
- if (pos1 == std::string::npos)
- pos1 = value.size();
- std::string part = value.substr(pos0, pos1 - pos0);
- //std::cout << "DEBUG: " << part << std::endl << std::flush;
- if (part != "")
- result.push_back(part);
- pos0 = value.find_first_not_of(separators, pos1);
- if (pos0 == std::string::npos)
- pos0 = value.size();
- }
-
- return result;
-}
-
-std::string join(std::vector<std::string> vs, std::string separator)
-{
- std::string s;
- for (const auto& line : vs) {
- if (s.size() > 0)
- s += separator;
- s += line;
- }
-
- return s;
-}
-
-bool startsWithAnyOfLower(const std::string &s, const std::vector<std::string> &list) {
- for (const std::string& element : list) {
- if (boost::algorithm::starts_with(boost::algorithm::to_lower_copy(s), boost::algorithm::to_lower_copy(element)))
- return true;
- }
- return false;
-}
-
diff --git a/libcommon/stringutil.h b/libcommon/stringutil.h
deleted file mode 100644
index 5110e2e..0000000
--- a/libcommon/stringutil.h
+++ /dev/null
@@ -1,10 +0,0 @@
-#pragma once
-
-#include <string>
-#include <vector>
-
-std::string strfmt(const char* fmt, ...);
-
-std::vector<std::string> split(std::string value, const std::string separators = "\r\n ");
-std::string join(std::vector<std::string> vs, std::string separator = "\n");
-bool startsWithAnyOfLower(const std::string &s, const std::vector<std::string> &list);
diff --git a/libcommon/tempfile.cpp b/libcommon/tempfile.cpp
deleted file mode 100644
index f425db2..0000000
--- a/libcommon/tempfile.cpp
+++ /dev/null
@@ -1,42 +0,0 @@
-#include "tempfile.h"
-
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-
-#include <iostream>
-
-namespace fs = std::filesystem;
-using namespace std::string_literals;
-
-fs::path Tempfile::GetPath() const
-{
- return m_path;
-}
-
-Tempfile::Tempfile(const std::filesystem::path& extension)
-{
- try {
- fs::path path { fs::temp_directory_path() / "tempfileXXXXXX"};
- if (!extension.empty())
- path += extension;
-
- fs::path::string_type name{path.native()};
- int fd = mkstemps(name.data(), extension.native().size());
- if (fd == -1)
- std::runtime_error("mkstemps: "s + strerror(errno));
- close(fd);
- m_path = std::string{name};
- } catch (const std::exception& ex) {
- throw std::runtime_error("Tempfile error: "s + ex.what());
- }
-}
-
-Tempfile::~Tempfile()
-{
- try {
- fs::remove_all(m_path);
- } catch (const std::exception& ex) {
- std::cerr << "Warning: Couldn't remove temporary file " << m_path << std::endl;
- }
-}
diff --git a/libcommon/tempfile.h b/libcommon/tempfile.h
deleted file mode 100644
index b9839a7..0000000
--- a/libcommon/tempfile.h
+++ /dev/null
@@ -1,17 +0,0 @@
-#pragma once
-
-#include <filesystem>
-
-class Tempfile
-{
- std::filesystem::path m_path;
-
- public:
- std::filesystem::path GetPath() const;
-
- // extension: e.g. ".zip"
- Tempfile(const std::filesystem::path& extension = std::filesystem::path{});
- ~Tempfile();
- };
-
-
diff --git a/libcommon/url.cpp b/libcommon/url.cpp
deleted file mode 100644
index 5baf603..0000000
--- a/libcommon/url.cpp
+++ /dev/null
@@ -1,32 +0,0 @@
-#include "url.h"
-
-std::string urlDecode(std::string s)
-{
- std::string result;
-
- size_t pos = 0;
- while (pos < s.size()) {
- char c {s[pos]};
- if (c == '+') {
- result += ' ';
- } else if (c == '%' && pos + 2 < s.size()) {
- try {
- int i = stoi(s.substr(pos + 1, 2), 0, 16);
- if (i < 0 || i > 255)
- return result;
-
- result += static_cast<char>(i);
- } catch (...) {
- return result;
- }
-
- pos += 2;
- } else {
- result += c;
- }
- pos++;
- }
-
- return result;
-}
-
diff --git a/libcommon/url.h b/libcommon/url.h
deleted file mode 100644
index bd60616..0000000
--- a/libcommon/url.h
+++ /dev/null
@@ -1,6 +0,0 @@
-#pragma once
-
-#include <string>
-
-std::string urlDecode(std::string s);
-
diff --git a/plugins/cgi/Makefile b/plugins/cgi/Makefile
index df51e89..fd8e98d 100644
--- a/plugins/cgi/Makefile
+++ b/plugins/cgi/Makefile
@@ -7,7 +7,7 @@ CXXFLAGS+= -fvisibility=hidden -fPIC
CXXFLAGS+= -I../..
LDLIBS=\
--lcommon \
+-lreichwein \
-lboost_context \
-lboost_coroutine \
-lboost_program_options \
@@ -19,8 +19,6 @@ LDLIBS=\
-lssl -lcrypto \
-ldl
-LDFLAGS+=-L../../libcommon
-
PROGSRC=\
cgi.cpp
@@ -28,12 +26,9 @@ SRC=$(PROGSRC)
all: $(PROJECTNAME).so
-$(PROJECTNAME).so: ../../libcommon/libcommon.a $(SRC:.cpp=.o)
+$(PROJECTNAME).so: $(SRC:.cpp=.o)
$(CXX) $(LDFLAGS) $^ -shared $(LDLIBS) $(LIBS) -o $@
-../../libcommon/libcommon.a:
- cd ../.. && $(MAKE) libcommon/libcommon.a
-
%.d: %.cpp
$(CXX) $(CXXFLAGS) -MM -MP -MF $@ -c $<
diff --git a/plugins/cgi/cgi.cpp b/plugins/cgi/cgi.cpp
index b2af9fa..4e4f6c7 100644
--- a/plugins/cgi/cgi.cpp
+++ b/plugins/cgi/cgi.cpp
@@ -1,6 +1,6 @@
#include "cgi.h"
-#include "libcommon/mime.h"
+#include "libreichwein/mime.h"
#include <boost/algorithm/string/predicate.hpp>
#include <boost/coroutine2/coroutine.hpp>
diff --git a/plugins/fcgi/Makefile b/plugins/fcgi/Makefile
index d3b8ed1..32a8bda 100644
--- a/plugins/fcgi/Makefile
+++ b/plugins/fcgi/Makefile
@@ -18,8 +18,6 @@ LDLIBS=\
-lssl -lcrypto \
-ldl
-LDFLAGS+=-L../../libcommon
-
PROGSRC=\
fcgi.cpp \
fcgiid.cpp \
@@ -32,9 +30,6 @@ all: $(PROJECTNAME).so
$(PROJECTNAME).so: $(SRC:.cpp=.o)
$(CXX) $(CXXFLAGS) $^ -shared $(LIBS) -o $@
-../../libcommon/libcommon.a:
- cd ../.. && $(MAKE) libcommon/libcommon.a
-
%.d: %.cpp
$(CXX) $(CXXFLAGS) -MM -MP -MF $@ -c $<
diff --git a/plugins/redirect/Makefile b/plugins/redirect/Makefile
index 344aa91..7c37228 100644
--- a/plugins/redirect/Makefile
+++ b/plugins/redirect/Makefile
@@ -18,8 +18,6 @@ LDLIBS=\
-lssl -lcrypto \
-ldl
-LDFLAGS+=-L../../libcommon
-
PROGSRC=\
redirect.cpp
@@ -30,9 +28,6 @@ all: $(PROJECTNAME).so
$(PROJECTNAME).so: $(SRC:.cpp=.o)
$(CXX) $(CXXFLAGS) $^ -shared $(LIBS) -o $@
-../../libcommon/libcommon.a:
- cd ../.. && $(MAKE) libcommon/libcommon.a
-
%.d: %.cpp
$(CXX) $(CXXFLAGS) -MM -MP -MF $@ -c $<
diff --git a/plugins/static-files/Makefile b/plugins/static-files/Makefile
index 7c817fb..689d085 100644
--- a/plugins/static-files/Makefile
+++ b/plugins/static-files/Makefile
@@ -7,7 +7,6 @@ CXXFLAGS+= -fvisibility=hidden -fPIC
CXXFLAGS+= -I../..
LDLIBS=\
--lcommon \
-lboost_context \
-lboost_coroutine \
-lboost_program_options \
@@ -19,8 +18,6 @@ LDLIBS=\
-lssl -lcrypto \
-ldl
-LDFLAGS+=-L../../libcommon
-
PROGSRC=\
static-files.cpp
@@ -28,12 +25,9 @@ SRC=$(PROGSRC)
all: $(PROJECTNAME).so
-$(PROJECTNAME).so: ../../libcommon/libcommon.a $(SRC:.cpp=.o)
+$(PROJECTNAME).so: $(SRC:.cpp=.o)
$(CXX) $(LDFLAGS) $^ -shared $(LDLIBS) $(LIBS) -o $@
-../../libcommon/libcommon.a:
- cd ../.. && $(MAKE) libcommon/libcommon.a
-
%.d: %.cpp
$(CXX) $(CXXFLAGS) -MM -MP -MF $@ -c $<
diff --git a/plugins/static-files/static-files.cpp b/plugins/static-files/static-files.cpp
index ad78e48..e889bc5 100644
--- a/plugins/static-files/static-files.cpp
+++ b/plugins/static-files/static-files.cpp
@@ -1,7 +1,7 @@
#include "static-files.h"
-#include "libcommon/mime.h"
-#include "libcommon/url.h"
+#include "libreichwein/mime.h"
+#include "libreichwein/url.h"
#include <boost/algorithm/string/predicate.hpp>
diff --git a/plugins/statistics/Makefile b/plugins/statistics/Makefile
index 26032c3..cece45e 100644
--- a/plugins/statistics/Makefile
+++ b/plugins/statistics/Makefile
@@ -7,7 +7,6 @@ CXXFLAGS+= -fvisibility=hidden -fPIC
CXXFLAGS+= -I../..
LDLIBS=\
--lcommon \
-lboost_context \
-lboost_coroutine \
-lboost_program_options \
@@ -19,8 +18,6 @@ LDLIBS=\
-lssl -lcrypto \
-ldl
-LDFLAGS+=-L../../libcommon
-
PROGSRC=\
statistics.cpp
@@ -28,12 +25,9 @@ SRC=$(PROGSRC)
all: $(PROJECTNAME).so
-$(PROJECTNAME).so: ../../libcommon/libcommon.a $(SRC:.cpp=.o)
+$(PROJECTNAME).so: $(SRC:.cpp=.o)
$(CXX) $(LDFLAGS) $^ -shared $(LDLIBS) $(LIBS) -o $@
-../../libcommon/libcommon.a:
- cd ../.. && $(MAKE) libcommon/libcommon.a
-
%.d: %.cpp
$(CXX) $(CXXFLAGS) -MM -MP -MF $@ -c $<
diff --git a/plugins/statistics/statistics.cpp b/plugins/statistics/statistics.cpp
index 415369d..54450a8 100644
--- a/plugins/statistics/statistics.cpp
+++ b/plugins/statistics/statistics.cpp
@@ -1,7 +1,7 @@
#include "statistics.h"
-#include "libcommon/file.h"
-#include "libcommon/tempfile.h"
+#include "libreichwein/file.h"
+#include "libreichwein/tempfile.h"
#include <boost/algorithm/string/predicate.hpp>
#include <boost/algorithm/string/split.hpp>
diff --git a/plugins/webbox/Makefile b/plugins/webbox/Makefile
index 4be08d1..5e4dab8 100644
--- a/plugins/webbox/Makefile
+++ b/plugins/webbox/Makefile
@@ -7,7 +7,6 @@ CXXFLAGS+= -fvisibility=hidden -fPIC
CXXFLAGS+= -I../..
LDLIBS=\
--lcommon \
-lboost_context \
-lboost_coroutine \
-lboost_program_options \
@@ -19,8 +18,6 @@ LDLIBS=\
-lssl -lcrypto \
-ldl
-LDFLAGS+=-L../../libcommon
-
PROGSRC=\
webbox.cpp
@@ -28,12 +25,9 @@ SRC=$(PROGSRC)
all: $(PROJECTNAME).so
-$(PROJECTNAME).so: ../../libcommon/libcommon.a $(SRC:.cpp=.o)
+$(PROJECTNAME).so: $(SRC:.cpp=.o)
$(CXX) $(LDFLAGS) $^ -shared $(LDLIBS) $(LIBS) -o $@
-../../libcommon/libcommon.a:
- cd ../.. && $(MAKE) libcommon/libcommon.a
-
%.d: %.cpp
$(CXX) $(CXXFLAGS) -MM -MP -MF $@ -c $<
diff --git a/plugins/webbox/webbox.cpp b/plugins/webbox/webbox.cpp
index ac54394..90975b5 100644
--- a/plugins/webbox/webbox.cpp
+++ b/plugins/webbox/webbox.cpp
@@ -1,10 +1,10 @@
#include "webbox.h"
-#include "libcommon/mime.h"
-#include "libcommon/tempfile.h"
-#include "libcommon/file.h"
-#include "libcommon/stringutil.h"
-#include "libcommon/url.h"
+#include "libreichwein/mime.h"
+#include "libreichwein/tempfile.h"
+#include "libreichwein/file.h"
+#include "libreichwein/stringutil.h"
+#include "libreichwein/url.h"
#include <boost/algorithm/string/predicate.hpp>
#include <boost/algorithm/string/replace.hpp>
diff --git a/plugins/weblog/Makefile b/plugins/weblog/Makefile
index 6cec97a..710a3cd 100644
--- a/plugins/weblog/Makefile
+++ b/plugins/weblog/Makefile
@@ -7,7 +7,6 @@ CXXFLAGS+= -fvisibility=hidden -fPIC
CXXFLAGS+= -I../..
LDLIBS=\
--lcommon \
-lboost_context \
-lboost_coroutine \
-lboost_program_options \
@@ -19,8 +18,6 @@ LDLIBS=\
-lssl -lcrypto \
-ldl
-LDFLAGS+=-L../../libcommon
-
PROGSRC=\
weblog.cpp
@@ -28,12 +25,9 @@ SRC=$(PROGSRC)
all: $(PROJECTNAME).so
-$(PROJECTNAME).so: ../../libcommon/libcommon.a $(SRC:.cpp=.o)
+$(PROJECTNAME).so: $(SRC:.cpp=.o)
$(CXX) $(LDFLAGS) $^ -shared $(LDLIBS) $(LIBS) -o $@
-../../libcommon/libcommon.a:
- cd ../.. && $(MAKE) libcommon/libcommon.a
-
%.d: %.cpp
$(CXX) $(CXXFLAGS) -MM -MP -MF $@ -c $<
diff --git a/plugins/weblog/weblog.cpp b/plugins/weblog/weblog.cpp
index c26a4fe..8be5b40 100644
--- a/plugins/weblog/weblog.cpp
+++ b/plugins/weblog/weblog.cpp
@@ -1,7 +1,7 @@
#include "weblog.h"
-#include "libcommon/mime.h"
-#include "libcommon/stringutil.h"
+#include "libreichwein/mime.h"
+#include "libreichwein/stringutil.h"
#include <boost/algorithm/string/predicate.hpp>
#include <boost/algorithm/string/replace.hpp>
diff --git a/response.cpp b/response.cpp
index 98abac4..4f535df 100644
--- a/response.cpp
+++ b/response.cpp
@@ -4,8 +4,8 @@
#include "base64.h"
#include "os.h"
-#include "libcommon/mime.h"
-#include "libcommon/file.h"
+#include "libreichwein/mime.h"
+#include "libreichwein/file.h"
#include <boost/algorithm/string/predicate.hpp>
diff --git a/tests/Makefile b/tests/Makefile
index 5903b52..d4c53cb 100644
--- a/tests/Makefile
+++ b/tests/Makefile
@@ -7,7 +7,7 @@ CXXFLAGS+= -I. -fPIE
CXXTESTFLAGS=
LIBS=\
--lcommon \
+-lreichwein \
-lboost_context \
-lboost_filesystem \
-lboost_timer \
@@ -17,7 +17,7 @@ LIBS=\
-lssl -lcrypto \
-ldl
-LDFLAGS+=-pie -L../libcommon
+LDFLAGS+=-pie
TESTSRC=\
test-environment.cpp \
@@ -27,7 +27,7 @@ TESTSRC=\
build: $(PROJECTNAME)
./$(PROJECTNAME)
-$(PROJECTNAME): ../libcommon/libcommon.a $(TESTSRC:.cpp=.o)
+$(PROJECTNAME): $(TESTSRC:.cpp=.o)
$(CXX) $(LDFLAGS) $^ $(LDLIBS) $(LIBS) -o $@
dep: $(TESTSRC:.cpp=.d)