From: Michael Danilov <mike402@users.noreply.github.com>
Date: Thu, 27 Apr 2017 14:33:08 +0000 (+0200)
Subject: js2sh.sh: sed for was GNU-specific.
X-Git-Url: https://git.owens.tech/112-editable-focus.html/112-editable-focus.html/git?a=commitdiff_plain;h=ad3bc486e63472f1472f6e049edf1bad472f3fb5;p=vimb.git

js2sh.sh: sed for was GNU-specific.
---

diff --git a/config.mk b/config.mk
index 3a4964e..bf78a8b 100644
--- a/config.mk
+++ b/config.mk
@@ -26,6 +26,7 @@ CFLAGS   += -std=c99 -pipe -Wall
 CPPFLAGS += -DVERSION=\"${VERSION}\" -DEXTENSIONDIR=\"${EXTENSIONDIR}\"
 CPPFLAGS += -DPROJECT=\"vimb\" -DPROJECT_UCFIRST=\"Vimb\"
 CPPFLAGS += -D_XOPEN_SOURCE=500
+CPPFLAGS += -D__BSD_VISIBLE
 CPPFLAGS += -DGSEAL_ENABLE
 CPPFLAGS += -DGTK_DISABLE_SINGLE_INCLUDES
 CPPFLAGS += -DGDK_DISABLE_DEPRECATED
diff --git a/src/scripts/js2h.sh b/src/scripts/js2h.sh
index ce38d9d..18aa586 100755
--- a/src/scripts/js2h.sh
+++ b/src/scripts/js2h.sh
@@ -15,7 +15,7 @@ fi
 
 # Put file extension and _ before file name, turn all to upper case to get the
 # constant name.
-CONSTANT=$(echo "$FILE" | sed 's:.*/::g' | sed 's:^\(.*\).\(css\|js\):\2_\1:g' | tr a-z A-Z)
+CONSTANT=$(echo "$FILE" | sed -e 's:.*/::g' -e's/.*\.css$/CSS_&/g' -e's/.*\.js$/JS_&/g' -e's/\.css$//' -e's/\.js$//' | tr a-z A-Z)
 
 # minify the script
 cat $FILE | \
@@ -35,4 +35,5 @@ sed -e 's|\\x20| |g' \
     -e 's|"|\\"|g' | \
 # write opener with the starting and ending quote char
 sed -e "1s/^/#define $CONSTANT \"/" \
-    -e '$s/$/"\n/'
+    -e '$s/$/"/'
+echo ""