Skip to content

Commit

Permalink
external/nginx: Update nginx config script with new repo layout
Browse files Browse the repository at this point in the history
  • Loading branch information
ayrtonm committed Mar 6, 2024
1 parent 5167638 commit bffde15
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 15 deletions.
33 changes: 21 additions & 12 deletions external/nginx/auto/make
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,23 @@ LINK = $LINK

C_SYSTEM_INCLUDE = `$CC -print-file-name=include`
C_SYSTEM_INCLUDE_FIXED = `$CC -print-file-name=include-fixed`

# Directory for IA2 build artifacts
IA2_ROOT = $NGX_OBJS/../ia2
PAD_TLS = \$(IA2_ROOT)/pad-tls/pad-tls

LIBIA2_DIR = $REPO_ROOT/runtime/libia2
LIBIA2_BUILD_DIR = \$(IA2_ROOT)/runtime/libia2

PA_DIR = $REPO_ROOT/runtime/partition-alloc
PA_BUILD_DIR = \$(IA2_ROOT)/runtime/partition-alloc

PAD_TLS = \$(IA2_ROOT)/tools/pad-tls/pad-tls

IA2_ENABLE = 1

IA2_CALLGATES_TARGET = $NGX_OBJS/libia2_callgates.so
ifneq (\$(IA2_ENABLE),0)
IA2_LIBS = $NGX_OBJS/libia2_callgates.so \$(IA2_ROOT)/libia2/liblibia2.a
IA2_LIBS = $NGX_OBJS/libia2_callgates.so \$(LIBIA2_BUILD_DIR)/liblibia2.a
else
IA2_LIBS =
endif
Expand All @@ -50,8 +59,8 @@ IA2_CFLAGS = \\
-Wno-error \\
-Werror=incompatible-pointer-types \\
\$(IA2_EXTRA_CFLAGS) \\
-I $REPO_ROOT/libia2/include \\
-I $REPO_ROOT/partition-alloc/include
-I \$(LIBIA2_DIR)/include \\
-I \$(PA_DIR)/include

IA2_PREREWRITER_LDFLAGS = \\
-Wl,--wrap=pthread_create
Expand All @@ -61,10 +70,10 @@ IA2_LDFLAGS = \\
-Wl,--wrap=main \\
-Wl,-z,now \\
-Wl,-z,relro \\
-Wl,-T\$(IA2_ROOT)/libia2/padding.ld \\
-Wl,--dynamic-list=\$(IA2_ROOT)/libia2/dynsym.syms \\
-Wl,-T\$(LIBIA2_BUILD_DIR)/padding.ld \\
-Wl,--dynamic-list=\$(LIBIA2_BUILD_DIR)/dynsym.syms \\
-Wl,--export-dynamic \\
-Wl,--rpath=\$(IA2_ROOT)/partition-alloc/
-Wl,--rpath=\$(PA_BUILD_DIR)/

ifneq (\$(IA2_ENABLE),0)
IA2_LDFLAGS += \\
Expand All @@ -88,20 +97,20 @@ IA2_MODULE_CFLAGS = \\
-Wno-error \\
-Werror=incompatible-pointer-types \\
\$(IA2_EXTRA_CFLAGS) \\
-I $REPO_ROOT/libia2/include \\
-I $REPO_ROOT/partition-alloc/include
-I \$(LIBIA2_DIR)/include \\
-I \$(PA_DIR)/include

IA2_MODULE_LDFLAGS = \\
-Wl,-z,now \\
-Wl,-z,relro \\
-pthread \\
-Wl,--wrap=pthread_create \\
-Wl,@$NGX_OBJS/../wrapper_2.ld \\
-Wl,-T\$(IA2_ROOT)/libia2/padding.ld
-Wl,-T\$(LIBIA2_BUILD_DIR)/padding.ld

END

CORE_LIBS="$CORE_LIBS \$(IA2_ROOT)/partition-alloc/libpartition-alloc.so"
CORE_LIBS="$CORE_LIBS \$(PA_BUILD_DIR)/libpartition-alloc.so"

if test -n "$NGX_PERL_CFLAGS"; then
echo NGX_PERL_CFLAGS = $NGX_PERL_CFLAGS >> $NGX_MAKEFILE
Expand Down Expand Up @@ -305,7 +314,7 @@ binary: $NGX_OBJS${ngx_dirsep}nginx$ngx_binext

\$(IA2_CALLGATES_TARGET):
\$(CC) -shared -fPIC -Wl,-z,now $NGX_OBJS/../wrapper.c \
-I $REPO_ROOT/libia2/include -o \$(IA2_CALLGATES_TARGET)
-I \$(LIBIA2_DIR)/include -o \$(IA2_CALLGATES_TARGET)

$NGX_OBJS/ngx_rtmp_module_tls_padded.so: $NGX_OBJS/ngx_rtmp_module.so
cp $NGX_OBJS/ngx_rtmp_module.so $NGX_OBJS/ngx_rtmp_module_tls_padded.so
Expand Down
2 changes: 1 addition & 1 deletion external/nginx/auto/sources
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ CORE_DEPS="src/core/nginx.h \
src/core/ngx_crypt.h \
src/core/ngx_proxy_protocol.h \
src/core/ngx_syslog.h \
$REPO_ROOT/libia2/include/permissive_mode.h"
$REPO_ROOT/runtime/libia2/include/permissive_mode.h"


CORE_SRCS="src/core/nginx.c \
Expand Down
4 changes: 2 additions & 2 deletions external/nginx/reconfigure
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ IA2_BUILD_DIR=${BUILD_DIR}/ia2
NGINX_BUILD_DIR=${BUILD_DIR}/nginx
NGINX_ROOT=${EXTERNAL_ROOT}/nginx
NGINX_RTMP_ROOT=${EXTERNAL_ROOT}/nginx-rtmp-module
SRC_REWRITER=$IA2_BUILD_DIR/rewriter/ia2-rewriter
LIBIA2=$IA2_BUILD_DIR/libia2/liblibia2.a
SRC_REWRITER=$IA2_BUILD_DIR/tools/rewriter/ia2-rewriter
LIBIA2=$IA2_BUILD_DIR/runtime/libia2/liblibia2.a
TEMP_FILES=(
nginx.pid
err.log
Expand Down

0 comments on commit bffde15

Please sign in to comment.