Build scripts & automatic generation of FFI files
[hcoop/smlsql.git] / build
... / ...
CommitLineData
1#!/bin/sh
2
3SMLBIN=/usr/local/sml/bin
4POSTGRES_INCLUDE=/usr/include/postgresql
5
6if [ -d .cm ] ; then
7 rm -rf .cm
8fi
9if [ -d libpq/.cm ] ; then
10 rm -rf libpq/.cm
11fi
12if [ -d libpq/FFI/.cm ] ; then
13 rm -rf libpq/FFI/.cm
14fi
15
16if ! cat build.sml | $SMLBIN/sml ; then
17 exit 1
18fi
19
20cd libpq
21
22$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
23
24if ! cat build.sml | $SMLBIN/sml ; then
25 exit 1
26fi