[PATCH] Use pipe as a delimiter for sed(1) to fix build for libnjs target

Sergey A. Osokin osa at FreeBSD.org.ru
Fri May 12 03:15:32 UTC 2023


# HG changeset patch
# User Sergey A. Osokin <osa at FreeBSD.org.ru>
# Date 1683860927 -10800
#      Fri May 12 06:08:47 2023 +0300
# Node ID 9d717a336e89a34ac92b87a6294a5f552dc56f74
# Parent  1f84f3c34bb08b3489040319aac5cd46ca172bec
Use pipe as a delimiter for sed(1) to fix build for libnjs target.

sed(1) command line utility may fail with the following error:
sed: 1: "s, at EXTRA_LIBS@,-lm   -L ...": bad in substitute command: '-'
when a replacement for @EXTRA_LIBS@ contains a comma symbol.

diff -r 1f84f3c34bb0 -r 9d717a336e89 auto/make
--- a/auto/make	Wed May 10 22:36:53 2023 -0700
+++ b/auto/make	Fri May 12 06:08:47 2023 +0300
@@ -320,11 +320,11 @@
 pc: $NJS_BUILD_DIR/njs.pc
 
 $NJS_BUILD_DIR/njs.pc: $NJS_BUILD_DIR/njs_auto_config.h
-	sed -e "s, at PREFIX@,$(pwd)/$NJS_BUILD_DIR," \\
-		-e "s, at LIBDIR@,$(pwd)/$NJS_BUILD_DIR," \\
-		-e "s, at CFLAGS@,-I$(pwd)/$NJS_BUILD_DIR -I$(pwd)/src," \\
-		-e "s, at VERSION@,\$(NJS_VER)," \\
-		-e "s, at EXTRA_LIBS@,-lm $NJS_LIBS $NJS_LIB_AUX_LIBS," \\
+	sed -e "s|@PREFIX@|$(pwd)/$NJS_BUILD_DIR|" \\
+		-e "s|@LIBDIR@|$(pwd)/$NJS_BUILD_DIR|" \\
+		-e "s|@CFLAGS@|-I$(pwd)/$NJS_BUILD_DIR -I$(pwd)/src|" \\
+		-e "s|@VERSION@|\$(NJS_VER)|" \\
+		-e "s|@EXTRA_LIBS@|-lm $NJS_LIBS $NJS_LIB_AUX_LIBS|" \\
 		src/njs.pc.in > \$@
 END
 


More information about the nginx-devel mailing list