Thank you. As an old mainframe system programmer I am not very
proficient at gawk. I lately met Python and I love it, but this is
another story.
The only reason I chose awk is that it is already available in any plain
USS environment.
If you don't mind I will incorporate your change in my script.
Thanks again.
mario
On 1/4/19 10:51 PM, James K. Lowden wrote:
On Fri, 4 Jan 2019 16:14:22 +0100
Mario Bezzi <subscriptions.mario.be...@gmail.com> wrote:
awk '($0 ~ /^CC = /) { $0 = "CC = xlc" }
($0 ~ /^CFLAGS = /) { $0 = "CFLAGS = -O2 -q32 -qfloat=ieee
-qnolist" } ($0 ~ /^LDFLAGS = /) { $0 = "LDFLAGS = -q32" }
($0 ~ /^DEFS = /) { for (i = 1; i <= NF; i++) \
{ if ($i == "-DHAVE_POSIX_FALLOCATE=1") $i =
"-DHAVE_POSIX_FALLOCATE=0 -D_XOPEN_SOURCE=600" } }
(1) { print $0 }' <Makefile.original >Makefile
echo "Makefile patched, original version saved as Makefile.original"
That might be more conventionally written, and easier to understand,
thus:
awk '
/^CC = / { $0 = "CC = xlc" }
/^CFLAGS = / { $0 = "CFLAGS = -O2 -q32 -qfloat=ieee -qnolist" }
/^LDFLAGS = / { $0 = "LDFLAGS = -q32" }
/^DEFS = / { gsub(/-DHAVE_POSIX_FALLOCATE=1/, \
"-DHAVE_POSIX_FALLOCATE=0 -D_XOPEN_SOURCE=600") } }
{ print }
' <Makefile.original >Makefile
echo "Makefile patched, original version saved as Makefile.original"
--jkl
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users