Build scripts & automatic generation of FFI files
authorAdam Chlipala <adamc@hcoop.net>
Thu, 16 Sep 2004 15:24:10 +0000 (15:24 +0000)
committerAdam Chlipala <adamc@hcoop.net>
Thu, 16 Sep 2004 15:24:10 +0000 (15:24 +0000)
build [new file with mode: 0755]
build.sml [new file with mode: 0644]
libpq/FFI/.cvsignore
libpq/build.sml [new file with mode: 0644]

diff --git a/build b/build
new file mode 100755 (executable)
index 0000000..e025e3e
--- /dev/null
+++ b/build
@@ -0,0 +1,26 @@
+#!/bin/sh
+
+SMLBIN=/usr/local/sml/bin
+POSTGRES_INCLUDE=/usr/include/postgresql
+
+if [ -d .cm ] ; then
+    rm -rf .cm
+fi
+if [ -d libpq/.cm ] ; then
+    rm -rf libpq/.cm
+fi
+if [ -d libpq/FFI/.cm ] ; then
+    rm -rf libpq/FFI/.cm
+fi
+
+if ! cat build.sml | $SMLBIN/sml ; then
+    exit 1
+fi
+
+cd libpq
+
+$SMLBIN/ml-nlffigen -d FFI -lh LibpqH.libh -include ../libpq-h.sml -cm libpq.h.cm -D__builtin_va_list="void*" $POSTGRES_INCLUDE/libpq-fe.h
+
+if ! cat build.sml | $SMLBIN/sml ; then
+    exit 1
+fi
\ No newline at end of file
diff --git a/build.sml b/build.sml
new file mode 100644 (file)
index 0000000..c3522b5
--- /dev/null
+++ b/build.sml
@@ -0,0 +1,4 @@
+(if CM.recomp "smlsql.cm" andalso CM.stabilize true "smlsql.cm" then
+     OS.Process.exit OS.Process.success
+ else
+     OS.Process.exit OS.Process.failure) : unit;
\ No newline at end of file
index 854c999..aa5bb9a 100644 (file)
@@ -1,2 +1,4 @@
 .cm
 .cm
-CM
\ No newline at end of file
+CM
+*.sml
+*.cm
\ No newline at end of file
diff --git a/libpq/build.sml b/libpq/build.sml
new file mode 100644 (file)
index 0000000..782b4b6
--- /dev/null
@@ -0,0 +1,4 @@
+(if CM.recomp "sources.cm" andalso CM.stabilize true "sources.cm" then
+     OS.Process.exit OS.Process.success
+ else
+     OS.Process.exit OS.Process.failure) : unit;
\ No newline at end of file