js2sh.sh: sed for was GNU-specific.
authorMichael Danilov <mike402@users.noreply.github.com>
Thu, 27 Apr 2017 14:33:08 +0000 (16:33 +0200)
committerDaniel Carl <danielcarl@gmx.de>
Fri, 12 May 2017 22:10:07 +0000 (00:10 +0200)
config.mk
src/scripts/js2h.sh

index 3a4964e..bf78a8b 100644 (file)
--- 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
index ce38d9d..18aa586 100755 (executable)
@@ -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 ""