X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;ds=sidebyside;f=util%2Fyc.tcl;h=ae965c96ce8b05e66d1d6d7bf9ddfbdf8724aac6;hb=30cfc59b71c25923e2e9cfb63c310c095bb3b6c1;hp=76785d3fa90a36cb88cc66efc585984cf8c8dfa9;hpb=161ec45b40a3ab08e08946c9654ab6fea4604760;p=yaz-moved-to-github.git diff --git a/util/yc.tcl b/util/yc.tcl index 76785d3..ae965c9 100755 --- a/util/yc.tcl +++ b/util/yc.tcl @@ -2,13 +2,19 @@ # the next line restarts using tclsh \ exec tclsh "$0" "$@" # -# YC: YAZ ODR Compiler -# (c) Index Data 1996-1998 +# YC: ASN.1 Compiler for YAZ +# (c) Index Data 1996-1999 # See the file LICENSE for details. # Sebastian Hammer, Adam Dickmeiss # # $Log: yc.tcl,v $ -# Revision 1.1 1999-06-08 10:10:16 adam +# Revision 1.3 1999-11-30 13:47:12 adam +# Improved installation. Moved header files to include/yaz. +# +# Revision 1.2 1999/06/09 09:43:11 adam +# Added option -I and variable h-path to specify path for header files. +# +# Revision 1.1 1999/06/08 10:10:16 adam # New sub directory zutil. Moved YAZ Compiler to be part of YAZ tree. # # Revision 1.8 1999/04/20 10:37:04 adam @@ -904,7 +910,7 @@ proc asnImports {} { } else { set fname $val } - puts $file(outh) "\#include \"${fname}.h\"" + puts $file(outh) "\#include <$inf(h-dir)${fname}.h>" if {[info exists inf(prefix,$val)]} { set prefix $inf(prefix,$val) @@ -1101,12 +1107,12 @@ proc asnModules {} { if {![info exists inf(h-file)]} { set inf(h-file) ${fname}.h } - set file(outh) [open $inf(h-file) w] + set file(outh) [open $inf(h-path)/$inf(h-dir)$inf(h-file) w] if {![info exists inf(p-file)]} { set inf(p-file) ${fname}-p.h } - set file(outp) [open $inf(p-file) w] + set file(outp) [open $inf(h-path)/$inf(h-dir)$inf(p-file) w] set md [clock format [clock seconds]] @@ -1122,17 +1128,17 @@ proc asnModules {} { puts $file(outp) "/* Module-P: $inf(module) */" puts $file(outp) {} - puts $file(outc) "\#include \"$inf(p-file)\"" + puts $file(outc) "\#include <$inf(h-dir)$inf(p-file)>" puts $file(outh) "\#ifndef ${ppname}_H" puts $file(outh) "\#define ${ppname}_H" puts $file(outh) {} - puts $file(outh) "\#include " + puts $file(outh) "\#include <$inf(h-dir)odr.h>" puts $file(outp) "\#ifndef ${ppname}_P_H" puts $file(outp) "\#define ${ppname}_P_H" puts $file(outp) {} - puts $file(outp) "\#include \"$inf(h-file)\"" + puts $file(outp) "\#include <$inf(h-dir)$inf(h-file)>" puts $file(outp) "\#ifdef __cplusplus" @@ -1272,6 +1278,9 @@ proc userDef {name} { if {[info exists default-prefix]} { set inf(prefix) ${default-prefix} } + if {[info exists h-path]} { + set inf(h-path) ${h-path} + } foreach m [array names prefix] { set inf(prefix,$m) $prefix($m) } @@ -1297,6 +1306,8 @@ proc userDef {name} { set inf(verbose) 0 set inf(prefix) {yc_ Yc_ YC_} +set inf(h-path) . +set inf(h-dir) "" # Parse command line set l [llength $argv] @@ -1314,6 +1325,20 @@ while {$i < $l} { } set inf(c-file) $p } + -I* { + set p [string range $arg 2 end] + if {![string length $p]} { + set p [lindex $argv [incr i]] + } + set inf(h-path) $p + } + -i* { + set p [string range $arg 2 end] + if {![string length $p]} { + set p [lindex $argv [incr i]] + } + set inf(h-dir) [string trim $p \\/]/ + } -h* { set p [string range $arg 2 end] if {![string length $p]} { @@ -1365,9 +1390,9 @@ while {$i < $l} { } if {![info exists inf(iname)]} { - puts "YAZ ODR Compiler ${yc_version}" + puts "YAZ ASN.1 Compiler ${yc_version}" puts -nonewline "Usage: ${argv0}" - puts { [-v] [-c cfile] [-h hfile] [-p hfile] [-d dfile] } + puts { [-v] [-c cfile] [-h hfile] [-p hfile] [-d dfile] [-I path]} puts { [-x prefix] [-m module] file} exit 1 }