X-Git-Url: https://git.gag.com/?p=fw%2Fsdcc;a=blobdiff_plain;f=configure_vc.awk;h=e9235abdcec966f8306c2360844a158f26757d9e;hp=f48422876e062001ee1066cf554afe3537638b87;hb=80972b2e54c9b88f11c27b878874fd2a6a681391;hpb=37425875dec591a8cc059ad700f840171469f9a6 diff --git a/configure_vc.awk b/configure_vc.awk index f4842287..e9235abd 100644 --- a/configure_vc.awk +++ b/configure_vc.awk @@ -1,7 +1,7 @@ #!/usr/bin/awk # configure_vc.awk - Genarate sdcc_vc.h using sdcc_vc_in.h as template -# and insert the version number definitions from configure.in +# and insert the version number definitions from .version # # Written By - Borut Razem borut.razem@siol.net # @@ -22,26 +22,17 @@ # Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. BEGIN { - # get the values from configure.in - - while (getline <"configure.in" > 0) { - if ($0 ~ "^AC_INIT\\(.*\\)") { - package = gensub("^AC_INIT\\(\\[([^]]*)\\].*", "\\1", "1", $0); - version = gensub("^AC_INIT\\(\\[[^]]*\\], \\[([^]]*)\\].*", "\\1", "1", $0); - bugreport = gensub("^AC_INIT\\(\\[[^]]*\\], \\[[^]]*\\], \\[([^]]*)\\].*", "\\1", "1", $0); - - version_high = gensub(/^([^.]*).([^.]*).([^.]*)/, "\\1", "1", version) - version_lo = gensub(/^([^.]*).([^.]*).([^.]*)/, "\\2", "1", version) - version_patch = gensub(/^([^.]*).([^.]*).([^.]*)/, "\\3", "1", version) - } - } + # get the values from .version + FS="."; + getline <".version"; + version_high = $1; + version_lo = $2; + version_patch = $3; print "/*" - print " * sdcc_vc.h" print " * Generated automatically by configure_vc.awk, DO NOT edit!" - print " * To make changes to sdcc_vc.h edit sdcc_vc_in.h instead." - print " */" - print "" + print " */" + print "" } /^#undef SDCC_VERSION_HI$/ { @@ -60,7 +51,7 @@ BEGIN { } /^#undef SDCC_VERSION_STR$/ { - print("#define SDCC_VERSION_STR " "\"" version "\""); + print("#define SDCC_VERSION_STR " "\"" version_high "." version_lo "." version_patch "\""); next }