summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrandomdan <randomdan@localhost>2014-11-14 10:36:23 +0000
committerrandomdan <randomdan@localhost>2014-11-14 10:36:23 +0000
commitdacb7f365b9bf9125634f949472d74ce735efe60 (patch)
tree8957fafd41acab4b58e4bb9fc69ce88cd9db42c5
parentScattering of fixes to remove hacks around paths and fix running the build fr... (diff)
downloadp2pvr-dacb7f365b9bf9125634f949472d74ce735efe60.tar.bz2
p2pvr-dacb7f365b9bf9125634f949472d74ce735efe60.tar.xz
p2pvr-dacb7f365b9bf9125634f949472d74ce735efe60.zip
Build SQL embed asm from an m4 macro, not a hacky echo
-rw-r--r--p2pvr/Jamfile.jam18
-rw-r--r--p2pvr/embedSql.m419
2 files changed, 22 insertions, 15 deletions
diff --git a/p2pvr/Jamfile.jam b/p2pvr/Jamfile.jam
index 6851a3c..07e533a 100644
--- a/p2pvr/Jamfile.jam
+++ b/p2pvr/Jamfile.jam
@@ -45,23 +45,11 @@ type.register SQL : sql ;
generators.register-standard sql.embed.asm : SQL : ASM ;
+path-constant root : . ;
+
actions sql.embed.asm
{
- echo ".section .rodata
- .global sql_$(2:B)_start
- .type sql_$(2:B)_start, @object
-sql_$(2:B)_start:
- .incbin \"$(2)\"
-
- .global sql_$(2:B)_end
- .type sql_$(2:B)_end, @object
-sql_$(2:B)_end:
- .byte 0
-
- .global sql_$(2:B)_len
- .type sql_$(2:B)_len, @object
-sql_$(2:B)_len:
- .int sql_$(2:B)_end - sql_$(2:B)_start" > $(1)
+ m4 -DNAME="sql_$(2:B)" -DPATH="$(2)" "$(root)/embedSql.m4" > "$(1)"
}
IMPORT $(__name__) : sql.embed.asm : : sql.embed.asm ;
diff --git a/p2pvr/embedSql.m4 b/p2pvr/embedSql.m4
new file mode 100644
index 0000000..d94ee7c
--- /dev/null
+++ b/p2pvr/embedSql.m4
@@ -0,0 +1,19 @@
+define(`start', NAME`_start')
+define(`end', NAME`_end')
+define(`len', NAME`_len')
+.section .rodata
+ .global start
+ .type start, @object
+start:
+ .incbin "PATH"
+
+ .global end
+ .type end, @object
+end:
+ .byte 0
+
+ .global len
+ .type len, @object
+len:
+ .int end - start
+