mirror of
https://github.com/3proxy/3proxy.git
synced 2026-09-03 13:25:48 +08:00
pop3p, imapp and smtpp are built with MAILPROXY=true, and ftppr and the ftp:// scheme of the HTTP proxy with FTP=true; with CMake the switches are 3PROXY_USE_MAILPROXY and 3PROXY_USE_FTP. Neither is in a default build, and the standalone binaries follow what was built. A configuration naming one of them is still read either way. The three mail protocols amount to a STARTTLS negotiation now that mail is carried over TLS, so without a proxy of their own those names are tlspr speaking the protocol: the file holds a stand-in which sets the protocol for the connection and returns tlspr for the caller to run, which serves the service name and a parent chain alike and leaves conf.c and the redirect table untouched. FTP has no such fallback, so the service is known, answers nothing and logs the refusal. The Linux workflow builds both, so all of it is still compiled and run.
73 lines
2.8 KiB
Makefile
73 lines
2.8 KiB
Makefile
#
|
|
# 3 proxy Makefile for Solaris/SunCC
|
|
#
|
|
#
|
|
# add -DWITH_ODBC to CFLAGS and -lodbc to LDFLAGS to compile with ODBC
|
|
# library support. Add -DSAFESQL for poorely written ODBC library / drivers.
|
|
|
|
BUILDDIR = ../bin/
|
|
PREFIX ?= 3proxy_
|
|
CRYPT_PREFIX ?= $(PREFIX)
|
|
CC ?= cc
|
|
CFLAGS = -xO3 -c -D_SOLARIS -D_THREAD_SAFE -DGETHOSTBYNAME_R -D_REENTRANT -DFD_SETSIZE=4096 -DWITH_POLL
|
|
COUT = -o ./
|
|
LN = $(CC)
|
|
LDFLAGS = -xO3
|
|
DCFLAGS = -fPIC
|
|
MAILPROXY ?= false
|
|
ifeq ($(MAILPROXY),true)
|
|
CFLAGS += -DWITH_POP3P -DWITH_IMAPP -DWITH_SMTPP
|
|
MAIL_EXES = $(BUILDDIR)$(PREFIX)pop3p$(EXESUFFICS) $(BUILDDIR)$(PREFIX)imapp$(EXESUFFICS) $(BUILDDIR)$(PREFIX)smtpp$(EXESUFFICS)
|
|
endif
|
|
FTP ?= false
|
|
ifeq ($(FTP),true)
|
|
CFLAGS += -DWITH_FTP
|
|
FTP_EXES = $(BUILDDIR)$(PREFIX)ftppr$(EXESUFFICS)
|
|
endif
|
|
HTTPSRV ?= true
|
|
ifeq ($(HTTPSRV),true)
|
|
CFLAGS += -DWITH_HTTPSRV
|
|
HTTPSRV_OBJS = srvhttpsrv$(OBJSUFFICS) srvwebadmin$(OBJSUFFICS)
|
|
endif
|
|
DLFLAGS = -shared
|
|
DLSUFFICS = .ld.so
|
|
LIBS = -lpthread -lsocket -lnsl -lresolv -ldl
|
|
LIBSPREFIX = -l
|
|
LIBSSUFFIX =
|
|
LNOUT = -o ./
|
|
EXESUFFICS =
|
|
OBJSUFFICS = .o
|
|
DEFINEOPTION = -D
|
|
COMPFILES = *~
|
|
REMOVECOMMAND = rm -f
|
|
AFTERCLEAN = (find . -type f -name "*.o" -delete && find src/ -type f -name "Makefile.var" -delete && find bin/ -type f -executable -delete) || true
|
|
TYPECOMMAND = cat
|
|
COMPATLIBS =
|
|
MAKEFILE = Makefile.Solaris
|
|
PLUGINS = StringsPlugin TrafficPlugin FilePlugin
|
|
|
|
WOLFSSL_CHECK = $(shell printf "\#include <wolfssl/options.h>\\n\#include <wolfssl/openssl/ssl.h>\\n int main(){return 0;}" | tr -d \\\\ | $(CC) -x c $(CFLAGS) -o testwssl.o - 2>/dev/null && $(CC) $(LDFLAGS) -o testwssl testwssl.o -lwolfssl 2>/dev/null && rm testwssl testwssl.o && echo true||echo false)
|
|
ifeq ($(WOLFSSL_CHECK), true)
|
|
LIBS += -lwolfssl
|
|
CFLAGS += -DWITH_SSL -DWITH_WOLFSSL
|
|
SSL_OBJS = ssllib$(OBJSUFFICS) ssl$(OBJSUFFICS)
|
|
else
|
|
OPENSSL_CHECK = $(shell printf "\#include <openssl/ssl.h>\\n int main(){return 0;}" | tr -d \\\\ | $(CC) -x c $(CFLAGS) -o testssl.o - 2>/dev/null && $(CC) $(LDFLAGS) -o testssl testssl.o -lcrypto -lssl 2>/dev/null && rm testssl testssl.o && echo true||echo false)
|
|
ifeq ($(OPENSSL_CHECK), true)
|
|
LIBS += -l crypto -l ssl
|
|
CFLAGS += -DWITH_SSL
|
|
SSL_OBJS = ssllib$(OBJSUFFICS) ssl$(OBJSUFFICS)
|
|
endif
|
|
endif
|
|
PCRE_CHECK = $(shell printf "\#define PCRE2_CODE_UNIT_WIDTH 8\\n\#include <pcre2.h>\\n int main(){return 0;}" | tr -d \\\\ | $(CC) -x c $(CFLAGS) -o testpcre.o - 2>/dev/null && $(CC) -o testpcre testpcre.o $(LDFLAGS) -Wl,-Bstatic -lpcre2-8 -Wl,-Bdynamic 2>/dev/null && rm testpcre testpcre.o && echo true||echo false)
|
|
ifeq ($(PCRE_CHECK), true)
|
|
CFLAGS += -DWITH_PCRE
|
|
PCRE_OBJS = pcre$(OBJSUFFICS)
|
|
PCRE_LIBS = -Wl,-Bstatic -lpcre2-8 -Wl,-Bdynamic
|
|
endif
|
|
|
|
include Makefile.inc
|
|
|
|
allplugins:
|
|
@list='$(PLUGINS)'; for p in $$list; do cp Makefile Makefile.var plugins/$$p; cd plugins/$$p ; make ; cd ../.. ; done
|