Skip to content

Commit 7e867f6

Browse files
authored
Fix sed -i compatibility on macOS in configure (#1598)
macOS BSD sed requires an explicit empty string argument after -i (sed -i '' 'script' file), unlike GNU sed which takes -i without a suffix argument. Without this fix, BSD sed misinterprets the sed script as a backup suffix and treats the filename as the script, causing "unterminated substitute pattern" error.
1 parent 64c879a commit 7e867f6

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

configure

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24833,4 +24833,11 @@ fi
2483324833
# The configure args contain '-Wl,-rpath,\$$ORIGIN`, when it falls
2483424834
# as a C literal string, it's invalid, so converting `\` to `\\`
2483524835
# to be correct for C program.
24836-
sed -i '/define CONFIGURE_ARGS/s,\([^\\]\)\\\$\$,\1\\\\$$,g' src/include/pg_config.h
24836+
case $build_os in
24837+
darwin*)
24838+
sed -i '' '/define CONFIGURE_ARGS/s,\([^\\]\)\\\$\$,\1\\\\$$,g' src/include/pg_config.h
24839+
;;
24840+
*)
24841+
sed -i '/define CONFIGURE_ARGS/s,\([^\\]\)\\\$\$,\1\\\\$$,g' src/include/pg_config.h
24842+
;;
24843+
esac

0 commit comments

Comments
 (0)