From dcf82918603a419025ad3a0ddcc20a6b4850c13e Mon Sep 17 00:00:00 2001 From: Yuto Takei Date: Tue, 20 Nov 2012 13:08:40 +0900 Subject: [PATCH] fix for OCaml API build --- src/api/ml/build-lib.sh | 4 ++-- src/api/ml/z3.ml | 8 ++++---- src/api/ml/z3.mli | 7 +++---- src/api/ml/z3_stubs.c | 32 ++++++++++++++++---------------- 4 files changed, 25 insertions(+), 26 deletions(-) mode change 100644 => 100755 src/api/ml/build-lib.sh diff --git a/src/api/ml/build-lib.sh b/src/api/ml/build-lib.sh old mode 100644 new mode 100755 index 93c7262b1..8b73d7aa5 --- a/src/api/ml/build-lib.sh +++ b/src/api/ml/build-lib.sh @@ -3,7 +3,7 @@ # Script to compile the Z3 OCaml API # Expects to find ../lib/libz3{,_dbg}.{a,so,dylib} -CFLAGS="-ccopt -Wno-discard-qual -ccopt -I../include" +CFLAGS="-ccopt -Wno-discard-qual" XCDBG="-g -ccopt -g $CFLAGS" XCOPT="-ccopt -O3 -ccopt -fomit-frame-pointer $CFLAGS" @@ -26,6 +26,6 @@ ocamlopt -a $XCDBG -cclib -L$PWD/../lib -cclib -lz3_dbg -cclib -lcamlidl -cclib ocamlopt -a $XCOPT -cclib -L$PWD/../lib -cclib -lz3 -cclib -lcamlidl -cclib -lz3stubs z3.cmx -o z3.cmxa -ocamlmktop -o ocamlz3 z3.cma -cclib -L. +ocamlmktop -o ocamlz3 z3.cma -ccopt -L. -cclib -lz3 -cclib -lcamlidl rm z3.cm{o,x} *.o diff --git a/src/api/ml/z3.ml b/src/api/ml/z3.ml index 76536ef43..7498a0d46 100644 --- a/src/api/ml/z3.ml +++ b/src/api/ml/z3.ml @@ -1219,13 +1219,13 @@ external get_smtlib_sort : context -> int -> sort external get_smtlib_error : context -> string = "camlidl_z3_Z3_get_smtlib_error" - +(* external parse_z3_string : context -> string -> ast = "camlidl_z3_Z3_parse_z3_string" external parse_z3_file : context -> string -> ast = "camlidl_z3_Z3_parse_z3_file" - +*) external set_error : context -> error_code -> unit = "camlidl_z3_Z3_set_error" @@ -2930,13 +2930,13 @@ external get_smtlib_sort : context -> int -> sort external get_smtlib_error : context -> string = "camlidl_z3V3_Z3_get_smtlib_error" - +(* external parse_z3_string : context -> string -> ast = "camlidl_z3_Z3_parse_z3V3_string" external parse_z3_file : context -> string -> ast = "camlidl_z3_Z3_parse_z3V3_file" - +*) external get_version : unit -> int * int * int * int = "camlidl_z3V3_Z3_get_version" diff --git a/src/api/ml/z3.mli b/src/api/ml/z3.mli index b0935f03c..9f58ba06a 100644 --- a/src/api/ml/z3.mli +++ b/src/api/ml/z3.mli @@ -4787,7 +4787,6 @@ external get_smtlib_sort : context -> int -> sort external get_smtlib_error : context -> string = "camlidl_z3_Z3_get_smtlib_error" -*) (** Summary: \[ [ parse_z3_string c str ] \] Parse the given string using the Z3 native parser. @@ -4806,7 +4805,7 @@ external parse_z3_string : context -> string -> ast *) external parse_z3_file : context -> string -> ast = "camlidl_z3_Z3_parse_z3_file" - +*) (** {2 {L Error Handling}} *) @@ -10198,7 +10197,7 @@ external get_smtlib_sort : context -> int -> sort *) external get_smtlib_error : context -> string = "camlidl_z3V3_Z3_get_smtlib_error" - +(* (** Summary: \[ [ parse_z3_string c str ] \] Parse the given string using the Z3 native parser. @@ -10217,7 +10216,7 @@ external parse_z3_string : context -> string -> ast *) external parse_z3_file : context -> string -> ast = "camlidl_z3_Z3_parse_z3V3_file" - +*) (** {2 {L Miscellaneous}} *) diff --git a/src/api/ml/z3_stubs.c b/src/api/ml/z3_stubs.c index 0f32cb20e..08100573a 100644 --- a/src/api/ml/z3_stubs.c +++ b/src/api/ml/z3_stubs.c @@ -8169,13 +8169,13 @@ check_error_code(c); /* end user-supplied deallocation sequence */ return _vres; } - +/* value camlidl_z3_Z3_parse_z3_string( value _v_c, value _v_str) { - Z3_context c; /*in*/ - Z3_string str; /*in*/ + Z3_context c; /*in + Z3_string str; /*in Z3_ast _res; value _vres; @@ -8186,9 +8186,9 @@ value camlidl_z3_Z3_parse_z3_string( _res = Z3_parse_z3_string(c, str); _vres = camlidl_c2ml_z3_Z3_ast(&_res, _ctx); camlidl_free(_ctx); - /* begin user-supplied deallocation sequence */ + /* begin user-supplied deallocation sequence check_error_code(c); - /* end user-supplied deallocation sequence */ + /* end user-supplied deallocation sequence return _vres; } @@ -8196,8 +8196,8 @@ value camlidl_z3_Z3_parse_z3_file( value _v_c, value _v_file_name) { - Z3_context c; /*in*/ - Z3_string file_name; /*in*/ + Z3_context c; /*in + Z3_string file_name; /*in Z3_ast _res; value _vres; @@ -8208,12 +8208,12 @@ value camlidl_z3_Z3_parse_z3_file( _res = Z3_parse_z3_file(c, file_name); _vres = camlidl_c2ml_z3_Z3_ast(&_res, _ctx); camlidl_free(_ctx); - /* begin user-supplied deallocation sequence */ + /* begin user-supplied deallocation sequence check_error_code(c); - /* end user-supplied deallocation sequence */ + /* end user-supplied deallocation sequence return _vres; } - +*/ value camlidl_z3_Z3_set_error( value _v_c, value _v_e) @@ -17569,13 +17569,13 @@ value camlidl_z3V3_Z3_get_smtlib_error( camlidl_free(_ctx); return _vres; } - +/* value camlidl_z3_Z3_parse_z3V3_string( value _v_c, value _v_str) { - Z3_context c; /*in*/ - Z3_string str; /*in*/ + Z3_context c; /*in + Z3_string str; /*in Z3_ast _res; value _vres; @@ -17593,8 +17593,8 @@ value camlidl_z3_Z3_parse_z3V3_file( value _v_c, value _v_file_name) { - Z3_context c; /*in*/ - Z3_string file_name; /*in*/ + Z3_context c; /*in + Z3_string file_name; /*in Z3_ast _res; value _vres; @@ -17607,7 +17607,7 @@ value camlidl_z3_Z3_parse_z3V3_file( camlidl_free(_ctx); return _vres; } - +*/ value camlidl_z3V3_Z3_get_version(value _unit) { unsigned int *major; /*out*/