dia2code-0.8.3/0040755000076400001440000000000010547514161012553 5ustar kelloggusersdia2code-0.8.3/TODO0100644000076400001440000000203607457104205013241 0ustar kelloggusersTO DO Documentation: - Add good (real life) examples to the docs and the web page. - Do a manual for Dia2Code. Core: - Virtual inheritance (C++) - A framework to allow custom code generator modules to be easily made by third parties. - Restructure the code, some parts really suck Code generators: - Default return value for non-void methods. - Custom extension for C++ files: .c++, .C, etc. - Custom visibility for Java classes: by default, all are public now. - Code generation for more languages. (CORBA IDL) Compilation, Installation and Distribution - Modify autoconf/automake files to install dia2code.1 and dia2code.kaptn into appropiate directories. - Install dia2code.h into /usr/local/include/dia2code or appropriate directory structure - Add modules to the regular build process - Make modules install into /usr/local/lib or something appropriate to allow all users to access the files Extra: - A nice improvement would be generating a classlist from existing code. For this task we need parsers for the supported languages. dia2code-0.8.3/depcomp0100755000076400001440000002752510310121754014126 0ustar kelloggusers#! /bin/sh # depcomp - compile a program generating dependencies as side-effects # Copyright 1999, 2000 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Alexandre Oliva . if test -z "$depmode" || test -z "$source" || test -z "$object"; then echo "depcomp: Variables source, object and depmode must be set" 1>&2 exit 1 fi # `libtool' can also be set to `yes' or `no'. depfile=${depfile-`echo "$object" | sed 's,\([^/]*\)$,.deps/\1,;s/\.\([^.]*\)$/.P\1/'`} tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} rm -f "$tmpdepfile" # Some modes work just like other modes, but use different flags. We # parameterize here, but still list the modes in the big case below, # to make depend.m4 easier to write. Note that we *cannot* use a case # here, because this file can only contain one case statement. if test "$depmode" = hp; then # HP compiler uses -M and no extra arg. gccflag=-M depmode=gcc fi if test "$depmode" = dashXmstdout; then # This is just like dashmstdout with a different argument. dashmflag=-xM depmode=dashmstdout fi case "$depmode" in gcc3) ## gcc 3 implements dependency tracking that does exactly what ## we want. Yay! Note: for some reason libtool 1.4 doesn't like ## it if -MD -MP comes after the -MF stuff. Hmm. "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi mv "$tmpdepfile" "$depfile" ;; gcc) ## There are various ways to get dependency output from gcc. Here's ## why we pick this rather obscure method: ## - Don't want to use -MD because we'd like the dependencies to end ## up in a subdir. Having to rename by hand is ugly. ## (We might end up doing this anyway to support other compilers.) ## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like ## -MM, not -M (despite what the docs say). ## - Using -M directly means running the compiler twice (even worse ## than renaming). if test -z "$gccflag"; then gccflag=-MD, fi "$@" -Wp,"$gccflag$tmpdepfile" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz ## The second -e expression handles DOS-style file names with drive letters. sed -e 's/^[^:]*: / /' \ -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" ## This next piece of magic avoids the `deleted header file' problem. ## The problem is that when a header file which appears in a .P file ## is deleted, the dependency causes make to die (because there is ## typically no way to rebuild the header). We avoid this by adding ## dummy dependencies for each header file. Too bad gcc doesn't do ## this for us directly. tr ' ' ' ' < "$tmpdepfile" | ## Some versions of gcc put a space before the `:'. On the theory ## that the space means something, we add a space to the output as ## well. ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; sgi) if test "$libtool" = yes; then "$@" "-Wp,-MDupdate,$tmpdepfile" else "$@" -MDupdate "$tmpdepfile" fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files echo "$object : \\" > "$depfile" # Clip off the initial element (the dependent). Don't try to be # clever and replace this with sed code, as IRIX sed won't handle # lines with more than a fixed number of characters (4096 in # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; # the IRIX cc adds comments like `#:fec' to the end of the # dependency line. tr ' ' ' ' < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \ tr ' ' ' ' >> $depfile echo >> $depfile # The second pass generates a dummy entry for each header file. tr ' ' ' ' < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ >> $depfile else # The sourcefile does not contain any dependencies, so just # store a dummy comment line, to avoid errors with the Makefile # "include basename.Plo" scheme. echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; aix) # The C for AIX Compiler uses -M and outputs the dependencies # in a .u file. This file always lives in the current directory. # Also, the AIX compiler puts `$object:' at the start of each line; # $object doesn't have directory information. stripped=`echo "$object" | sed -e 's,^.*/,,' -e 's/\(.*\)\..*$/\1/'` tmpdepfile="$stripped.u" outname="$stripped.o" if test "$libtool" = yes; then "$@" -Wc,-M else "$@" -M fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi if test -f "$tmpdepfile"; then # Each line is of the form `foo.o: dependent.h'. # Do two passes, one to just change these to # `$object: dependent.h' and one to simply `dependent.h:'. sed -e "s,^$outname:,$object :," < "$tmpdepfile" > "$depfile" sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile" else # The sourcefile does not contain any dependencies, so just # store a dummy comment line, to avoid errors with the Makefile # "include basename.Plo" scheme. echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; tru64) # The Tru64 AIX compiler uses -MD to generate dependencies as a side # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'. # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put # dependencies in `foo.d' instead, so we check for that too. # Subdirectories are respected. tmpdepfile1="$object.d" tmpdepfile2=`echo "$object" | sed -e 's/.o$/.d/'` if test "$libtool" = yes; then "$@" -Wc,-MD else "$@" -MD fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" exit $stat fi if test -f "$tmpdepfile1"; then tmpdepfile="$tmpdepfile1" else tmpdepfile="$tmpdepfile2" fi if test -f "$tmpdepfile"; then sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" # That's a space and a tab in the []. sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" else echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; #nosideeffect) # This comment above is used by automake to tell side-effect # dependency tracking mechanisms from slower ones. dashmstdout) # Important note: in order to support this mode, a compiler *must* # always write the proprocessed file to stdout, regardless of -o, # because we must use -o when running libtool. test -z "$dashmflag" && dashmflag=-M ( IFS=" " case " $* " in *" --mode=compile "*) # this is libtool, let us make it quiet for arg do # cycle over the arguments case "$arg" in "--mode=compile") # insert --quiet before "--mode=compile" set fnord "$@" --quiet shift # fnord ;; esac set fnord "$@" "$arg" shift # fnord shift # "$arg" done ;; esac "$@" $dashmflag | sed 's:^[^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile" ) & proc=$! "$@" stat=$? wait "$proc" if test "$stat" != 0; then exit $stat; fi rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" tr ' ' ' ' < "$tmpdepfile" | \ ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; dashXmstdout) # This case only exists to satisfy depend.m4. It is never actually # run, as this mode is specially recognized in the preamble. exit 1 ;; makedepend) # X makedepend ( shift cleared=no for arg in "$@"; do case $cleared in no) set ""; shift cleared=yes esac case "$arg" in -D*|-I*) set fnord "$@" "$arg"; shift;; -*) ;; *) set fnord "$@" "$arg"; shift;; esac done obj_suffix="`echo $object | sed 's/^.*\././'`" touch "$tmpdepfile" ${MAKEDEPEND-makedepend} 2>/dev/null -o"$obj_suffix" -f"$tmpdepfile" "$@" ) & proc=$! "$@" stat=$? wait "$proc" if test "$stat" != 0; then exit $stat; fi rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" tail +3 "$tmpdepfile" | tr ' ' ' ' | \ ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" "$tmpdepfile".bak ;; cpp) # Important note: in order to support this mode, a compiler *must* # always write the proprocessed file to stdout, regardless of -o, # because we must use -o when running libtool. ( IFS=" " case " $* " in *" --mode=compile "*) for arg do # cycle over the arguments case $arg in "--mode=compile") # insert --quiet before "--mode=compile" set fnord "$@" --quiet shift # fnord ;; esac set fnord "$@" "$arg" shift # fnord shift # "$arg" done ;; esac "$@" -E | sed -n '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' | sed '$ s: \\$::' > "$tmpdepfile" ) & proc=$! "$@" stat=$? wait "$proc" if test "$stat" != 0; then exit $stat; fi rm -f "$depfile" echo "$object : \\" > "$depfile" cat < "$tmpdepfile" >> "$depfile" sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; msvisualcpp) # Important note: in order to support this mode, a compiler *must* # always write the proprocessed file to stdout, regardless of -o, # because we must use -o when running libtool. ( IFS=" " case " $* " in *" --mode=compile "*) for arg do # cycle over the arguments case $arg in "--mode=compile") # insert --quiet before "--mode=compile" set fnord "$@" --quiet shift # fnord ;; esac set fnord "$@" "$arg" shift # fnord shift # "$arg" done ;; esac "$@" -E | sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile" ) & proc=$! "$@" stat=$? wait "$proc" if test "$stat" != 0; then exit $stat; fi rm -f "$depfile" echo "$object : \\" > "$depfile" . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile" echo " " >> "$depfile" . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile" rm -f "$tmpdepfile" ;; none) exec "$@" ;; *) echo "Unknown depmode $depmode" 1>&2 exit 1 ;; esac exit 0 dia2code-0.8.3/dia.ico0100644000076400001440000001135607457104215014010 0ustar kelloggusers ш6(00Ј F( @€€€€€€€€€€€€€РРРџџџџџџџџџџџџˆˆ€xxx€'€€xˆˆˆˆˆˆ€‡wpwwwwwxˆˆˆpxˆ€€ˆџџџџџ€xˆ€№ˆџџџџџџ€x€€ˆџˆˆˆˆˆјˆ€ˆˆˆˆˆˆˆџpx€ˆ‰™™™™˜€x€ˆ‰˜ˆˆ‰xˆ€(ˆˆ˜ˆˆy‡x‡r‡wwqqpwї€џљ˜‰јї€ˆџј˜yџџ€x№ˆџџ™—џџpx€ˆџџ‰˜џџј€€xˆ‰xˆˆ‡xˆ€xˆˆˆˆˆ‡p€€pwwwwwwx€ˆwwx""xЊЊxЊЊXЊЊp pў?џџў?џџќ?џџќџџјџџјџР?Рќќќќќќўўўќќќќќ№?Риџјџџјџџјџџјџџјџџјџџјџџ( €€€€€€€€€€РРР€€€џџџџџџџџџџџџџјџџџџџџјџџџџџџјџџџџџј€‡џџјџџp'џџјwwџјx˜y€‡џјˆ(€‡џј‡ˆˆ‡p‡џјљŸџ€џјјїџј€ˆˆˆ€џїx‡wwџџџr'џџџџџџzЈџџџџџџr'џџџџџ‡џџџˆ€‡‡џџџ€ˆ‡џџџџ—јџџџџsџџ(0` €€€€€€€€€РРРРмР№ЪІ """)))UUUMMMBBB999€|џPPџ“жџьЬЦжяжччЉ­3f™Ь3333f3™3Ь3џff3fff™fЬfџ™™3™f™™™Ь™џЬЬ3ЬfЬ™ЬЬЬџџfџ™џЬ3333f3™3Ь3џ3333333f33™33Ь33џ3f3f33ff3f™3fЬ3fџ3™3™33™f3™™3™Ь3™џ3Ь3Ь33Ьf3Ь™3ЬЬ3Ьџ3џ33џf3џ™3џЬ3џџff3fff™fЬfџf3f33f3ff3™f3Ьf3џffff3fffff™ffЬf™f™3f™ff™™f™Ьf™џfЬfЬ3fЬ™fЬЬfЬџfџfџ3fџ™fџЬЬџџЬ™™™3™™™™Ь™™33™f™3Ь™џ™f™f3™3f™f™™fЬ™3џ™™3™™f™™™™™Ь™™џ™Ь™Ь3fЬf™Ь™™ЬЬ™Ьџ™џ™џ3™Ьf™џ™™џЬ™џџЬ™3ЬfЬ™ЬЬ™3Ь33Ь3fЬ3™Ь3ЬЬ3џЬfЬf3™ffЬf™ЬfЬ™fџЬ™Ь™3Ь™fЬ™™Ь™ЬЬ™џЬЬЬЬ3ЬЬfЬЬ™ЬЬЬЬЬџЬџЬџ3™џfЬџ™ЬџЬЬџџЬ3џfџ™Ь3џ33џ3fџ3™џ3Ьџ3џџfџf3Ьffџf™џfЬЬfџџ™џ™3џ™fџ™™џ™Ьџ™џџЬџЬ3џЬfџЬ™џЬЬџЬџџџ3Ьџfџџ™џџЬffџfџffџџџffџfџџџf!Ѕ___www†††–––ЫЫЫВВВзззнннуууъъъёёёјјј№ћџЄ  €€€џџџџџџџџџџџџџџџџџџџџџџџџџѕџѕѕџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџѕѕџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџѕєєѕѕѕџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџѕѓѓѓѕџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџ№№ёђєѕіџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџМCјёёѓѕџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџэъ№ђєѕџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџђъыь№ёєџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџѕѕѕьmяјёєєєєѕєєєѕєєєѕѕѕѕџџџџџџџџџџџџџџџџџџџџџѕєѓѓь яМёђђђёђђђёђђѓђѓѓєєѕџџџџџџџџџџџџџџџџџџџѕєђђђя М№№№№№№№№№№№№М№№ёёѓєєџџџџџџџџџџџџџџџџѕ№юэ їїяяяяяяяяяяя№№МММ№ёѓєѕџџџџџџџџџџџџџџМ ыэяю№ёѓѕѕџџџџџџџџџџџџѓыmmmыъ ъъmmmmmmmmmmmmъ ъэяя№ђєѕџџџџџџџџџџџџџџџџџ№ ыѓѓџџџџџџџџџџџџџМј ьїя№ѓєџџџџџџџџџџџџџџџџџ№ mёёєѕѕѕѕѕѕєѕѕѕѕіџџёm m’їя№ѓєџџџџџџџџџџџџџџџџ№ mё№ѓєѓёёёёёёёёёёёѓѕѓј эїёєџџџџџџџџџџџџџџџџМ mё№ѓѓёМююМММ№ММюююёѕѓm ъэяюђєџџџџџџџџџџџџџџџ№ mёё™™“™™™™™™“““Мђџя ыї№ѓѕџџџџџџџџџџџџџџМ mё№š,,,,,,,,,,,,,tюёєѕ ьяМѓѕџџџџџџџџџџџџџџ№ m№М№S,Ltttt”u™t,MяММђєm mїёєџџџџџџџџџџџџџџ№ ъМ№™,RЛЛю№ёёt,tяяМ№ђь ’ёєџџџџџџџџџџџџџџ№ m№ю№МS,яюММ™,Mыьђ эёєџџџџџџџџџџџџџџ№ D##Dыї№C эёєџџџџџџџџџџџџџџ№  ъїьё эёєџџџџџџџџџџџџџџ№ ъМюёђѓ™,Lяt,tёјыєђC эМђѕџџџџџџџџџџџџџџ№ mђёѕџџіS,™МM,юѓџ№џџџМ ї№ѓџџџџџџџџџџџџџџџМ mёёєіџџš,tюt,t№ѓџџџџџѕь mюђєџџџџџџџџџџџџџџџ№ mё№єѕџџіS,“,,ёєџџџѕєѓъ ’ёѓѕџџџџџџџџџџџџџџџМ mёёєѕџџѕš,S,tМѓєѕѕѕєѓя m№ѓѕџџџџџџџџџџџѕѕѕѕџМ mё№ѓєєѕѕѓS,M™№ѓєєєєѓ яѓєџџџџџџџџџџџџѕєѓѓє ъМю№ђђѓѓє”,tМ№ёђѓђёm яѓѕџџџџџџџџџџџџџѕєђёђя ъМ№№№№№МS™М№№№№№я ъєєџџџџџџџџџџџџџџё№Мюї яя“яы CэёѕџџџџџџџџџџџџџџџМ  ь№ѕџџџџџџџџџџџџџџџџџёm ыьюєџџџџџџџџџџџџџџџџџџџџџџџџџџ m№Мёѓџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџюmя№ѓѕџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџ№ьыъъь№єџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџ’!!№ѓџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџ’њњњњ-№ѓіџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџїњњњњ-№єџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџїњњњњ-ю№єџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџїњњњњ-ъёђєџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџ’!----'mєѓѕџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџМыыыыыmяџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџdia2code-0.8.3/aclocal.m40100644000076400001440000007236210547513571014426 0ustar kelloggusers# generated automatically by aclocal 1.7.2 -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002 # Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. # Like AC_CONFIG_HEADER, but automatically create stamp file. -*- Autoconf -*- # Copyright 1996, 1997, 2000, 2001 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. AC_PREREQ([2.52]) # serial 6 # AM_CONFIG_HEADER is obsolete. It has been replaced by AC_CONFIG_HEADERS. AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)]) # Do all the work for Automake. -*- Autoconf -*- # This macro actually does too much some checks are only needed if # your package does certain things. But this isn't really a big deal. # Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002 # Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. # serial 8 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be # written in clear, in which case automake, when reading aclocal.m4, # will think it sees a *use*, and therefore will trigger all it's # C support machinery. Also note that it means that autoscan, seeing # CC etc. in the Makefile, will ask for an AC_PROG_CC use... AC_PREREQ([2.54]) # Autoconf 2.50 wants to disallow AM_ names. We explicitly allow # the ones we care about. m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) # AM_INIT_AUTOMAKE([OPTIONS]) # ----------------------------------------------- # The call with PACKAGE and VERSION arguments is the old style # call (pre autoconf-2.50), which is being phased out. PACKAGE # and VERSION should now be passed to AC_INIT and removed from # the call to AM_INIT_AUTOMAKE. # We support both call styles for the transition. After # the next Automake release, Autoconf can make the AC_INIT # arguments mandatory, and then we can depend on a new Autoconf # release and drop the old call support. AC_DEFUN([AM_INIT_AUTOMAKE], [AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl # test to see if srcdir already configured if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi AC_SUBST([CYGPATH_W]) # Define the identity of the package. dnl Distinguish between old-style and new-style calls. m4_ifval([$2], [m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl AC_SUBST([PACKAGE], [$1])dnl AC_SUBST([VERSION], [$2])], [_AM_SET_OPTIONS([$1])dnl AC_SUBST([PACKAGE], [AC_PACKAGE_TARNAME])dnl AC_SUBST([VERSION], [AC_PACKAGE_VERSION])])dnl _AM_IF_OPTION([no-define],, [AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl # Some tools Automake needs. AC_REQUIRE([AM_SANITY_CHECK])dnl AC_REQUIRE([AC_ARG_PROGRAM])dnl AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) AM_MISSING_PROG(AUTOCONF, autoconf) AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) AM_MISSING_PROG(AUTOHEADER, autoheader) AM_MISSING_PROG(MAKEINFO, makeinfo) AM_MISSING_PROG(AMTAR, tar) AM_PROG_INSTALL_SH AM_PROG_INSTALL_STRIP # We need awk for the "check" target. The system "awk" is bad on # some platforms. AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([AC_PROG_MAKE_SET])dnl _AM_IF_OPTION([no-dependencies],, [AC_PROVIDE_IFELSE([AC_PROG_CC], [_AM_DEPENDENCIES(CC)], [define([AC_PROG_CC], defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl AC_PROVIDE_IFELSE([AC_PROG_CXX], [_AM_DEPENDENCIES(CXX)], [define([AC_PROG_CXX], defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl ]) ]) # When config.status generates a header, we must update the stamp-h file. # This file resides in the same directory as the config header # that is generated. The stamp files are numbered to have different names. # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the # loop where config.status creates the headers, so we can generate # our stamp files there. AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], [_am_stamp_count=`expr ${_am_stamp_count-0} + 1` echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count]) # Copyright 2002 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # AM_AUTOMAKE_VERSION(VERSION) # ---------------------------- # Automake X.Y traces this macro to ensure aclocal.m4 has been # generated from the m4 files accompanying Automake X.Y. AC_DEFUN([AM_AUTOMAKE_VERSION],[am__api_version="1.7"]) # AM_SET_CURRENT_AUTOMAKE_VERSION # ------------------------------- # Call AM_AUTOMAKE_VERSION so it can be traced. # This function is AC_REQUIREd by AC_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], [AM_AUTOMAKE_VERSION([1.7.2])]) # Helper functions for option handling. -*- Autoconf -*- # Copyright 2001, 2002 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. # serial 2 # _AM_MANGLE_OPTION(NAME) # ----------------------- AC_DEFUN([_AM_MANGLE_OPTION], [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) # _AM_SET_OPTION(NAME) # ------------------------------ # Set option NAME. Presently that only means defining a flag for this option. AC_DEFUN([_AM_SET_OPTION], [m4_define(_AM_MANGLE_OPTION([$1]), 1)]) # _AM_SET_OPTIONS(OPTIONS) # ---------------------------------- # OPTIONS is a space-separated list of Automake options. AC_DEFUN([_AM_SET_OPTIONS], [AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) # ------------------------------------------- # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) # # Check to make sure that the build environment is sane. # # Copyright 1996, 1997, 2000, 2001 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. # serial 3 # AM_SANITY_CHECK # --------------- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane]) # Just in case sleep 1 echo timestamp > conftest.file # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` if test "$[*]" = "X"; then # -L didn't work. set X `ls -t $srcdir/configure conftest.file` fi rm -f conftest.file if test "$[*]" != "X $srcdir/configure conftest.file" \ && test "$[*]" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken alias in your environment]) fi test "$[2]" = conftest.file ) then # Ok. : else AC_MSG_ERROR([newly created file is older than distributed files! Check your system clock]) fi AC_MSG_RESULT(yes)]) # -*- Autoconf -*- # Copyright 1997, 1999, 2000, 2001 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. # serial 3 # AM_MISSING_PROG(NAME, PROGRAM) # ------------------------------ AC_DEFUN([AM_MISSING_PROG], [AC_REQUIRE([AM_MISSING_HAS_RUN]) $1=${$1-"${am_missing_run}$2"} AC_SUBST($1)]) # AM_MISSING_HAS_RUN # ------------------ # Define MISSING if not defined so far and test if it supports --run. # If it does, set am_missing_run to use it, otherwise, to nothing. AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" # Use eval to expand $SHELL if eval "$MISSING --run true"; then am_missing_run="$MISSING --run " else am_missing_run= AC_MSG_WARN([`missing' script is too old or missing]) fi ]) # AM_AUX_DIR_EXPAND # Copyright 2001 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets # $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to # `$srcdir', `$srcdir/..', or `$srcdir/../..'. # # Of course, Automake must honor this variable whenever it calls a # tool from the auxiliary directory. The problem is that $srcdir (and # therefore $ac_aux_dir as well) can be either absolute or relative, # depending on how configure is run. This is pretty annoying, since # it makes $ac_aux_dir quite unusable in subdirectories: in the top # source directory, any form will work fine, but in subdirectories a # relative path needs to be adjusted first. # # $ac_aux_dir/missing # fails when called from a subdirectory if $ac_aux_dir is relative # $top_srcdir/$ac_aux_dir/missing # fails if $ac_aux_dir is absolute, # fails when called from a subdirectory in a VPATH build with # a relative $ac_aux_dir # # The reason of the latter failure is that $top_srcdir and $ac_aux_dir # are both prefixed by $srcdir. In an in-source build this is usually # harmless because $srcdir is `.', but things will broke when you # start a VPATH build or use an absolute $srcdir. # # So we could use something similar to $top_srcdir/$ac_aux_dir/missing, # iff we strip the leading $srcdir from $ac_aux_dir. That would be: # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` # and then we would define $MISSING as # MISSING="\${SHELL} $am_aux_dir/missing" # This will work as long as MISSING is not called from configure, because # unfortunately $(top_srcdir) has no meaning in configure. # However there are other variables, like CC, which are often used in # configure, and could therefore not use this "fixed" $ac_aux_dir. # # Another solution, used here, is to always expand $ac_aux_dir to an # absolute PATH. The drawback is that using absolute paths prevent a # configured tree to be moved without reconfiguration. # Rely on autoconf to set up CDPATH properly. AC_PREREQ([2.50]) AC_DEFUN([AM_AUX_DIR_EXPAND], [ # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` ]) # AM_PROG_INSTALL_SH # ------------------ # Define $install_sh. # Copyright 2001 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl install_sh=${install_sh-"$am_aux_dir/install-sh"} AC_SUBST(install_sh)]) # AM_PROG_INSTALL_STRIP # Copyright 2001 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. # One issue with vendor `install' (even GNU) is that you can't # specify the program used to strip binaries. This is especially # annoying in cross-compiling environments, where the build's strip # is unlikely to handle the host's binaries. # Fortunately install-sh will honor a STRIPPROG variable, so we # always use install-sh in `make install-strip', and initialize # STRIPPROG with the value of the STRIP variable (set by the user). AC_DEFUN([AM_PROG_INSTALL_STRIP], [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl # Installed binaries are usually stripped using `strip' when the user # run `make install-strip'. However `strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the `STRIP' environment variable to overrule this program. dnl Don't test for $cross_compiling = yes, because it might be `maybe'. if test "$cross_compiling" != no; then AC_CHECK_TOOL([STRIP], [strip], :) fi INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) # serial 4 -*- Autoconf -*- # Copyright 1999, 2000, 2001 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be # written in clear, in which case automake, when reading aclocal.m4, # will think it sees a *use*, and therefore will trigger all it's # C support machinery. Also note that it means that autoscan, seeing # CC etc. in the Makefile, will ask for an AC_PROG_CC use... # _AM_DEPENDENCIES(NAME) # ---------------------- # See how the compiler implements dependency checking. # NAME is "CC", "CXX", "GCJ", or "OBJC". # We try a few techniques and use that to set a single cache variable. # # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular # dependency, and given that the user is not expected to run this macro, # just rely on AC_PROG_CC. AC_DEFUN([_AM_DEPENDENCIES], [AC_REQUIRE([AM_SET_DEPDIR])dnl AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl AC_REQUIRE([AM_MAKE_INCLUDE])dnl AC_REQUIRE([AM_DEP_TRACK])dnl ifelse([$1], CC, [depcc="$CC" am_compiler_list=], [$1], CXX, [depcc="$CXX" am_compiler_list=], [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], [depcc="$$1" am_compiler_list=]) AC_CACHE_CHECK([dependency style of $depcc], [am_cv_$1_dependencies_compiler_type], [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir am_cv_$1_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` fi for depmode in $am_compiler_list; do # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. echo '#include "conftest.h"' > conftest.c echo 'int i;' > conftest.h echo "${am__include} ${am__quote}conftest.Po${am__quote}" > confmf case $depmode in nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; none) break ;; esac # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. if depmode=$depmode \ source=conftest.c object=conftest.o \ depfile=conftest.Po tmpdepfile=conftest.TPo \ $SHELL ./depcomp $depcc -c -o conftest.o conftest.c >/dev/null 2>&1 && grep conftest.h conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then am_cv_$1_dependencies_compiler_type=$depmode break fi done cd .. rm -rf conftest.dir else am_cv_$1_dependencies_compiler_type=none fi ]) AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) AM_CONDITIONAL([am__fastdep$1], [ test "x$enable_dependency_tracking" != xno \ && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) ]) # AM_SET_DEPDIR # ------------- # Choose a directory name for dependency files. # This macro is AC_REQUIREd in _AM_DEPENDENCIES AC_DEFUN([AM_SET_DEPDIR], [rm -f .deps 2>/dev/null mkdir .deps 2>/dev/null if test -d .deps; then DEPDIR=.deps else # MS-DOS does not allow filenames that begin with a dot. DEPDIR=_deps fi rmdir .deps 2>/dev/null AC_SUBST([DEPDIR]) ]) # AM_DEP_TRACK # ------------ AC_DEFUN([AM_DEP_TRACK], [AC_ARG_ENABLE(dependency-tracking, [ --disable-dependency-tracking Speeds up one-time builds --enable-dependency-tracking Do not reject slow dependency extractors]) if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' fi AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) AC_SUBST([AMDEPBACKSLASH]) ]) # Generate code to set up dependency tracking. -*- Autoconf -*- # Copyright 1999, 2000, 2001, 2002 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. #serial 2 # _AM_OUTPUT_DEPENDENCY_COMMANDS # ------------------------------ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], [for mf in $CONFIG_FILES; do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named `Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # So let's grep whole file. if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then dirpart=`AS_DIRNAME("$mf")` else continue fi grep '^DEP_FILES *= *[[^ @%:@]]' < "$mf" > /dev/null || continue # Extract the definition of DEP_FILES from the Makefile without # running `make'. DEPDIR=`sed -n -e '/^DEPDIR = / s///p' < "$mf"` test -z "$DEPDIR" && continue # When using ansi2knr, U may be empty or an underscore; expand it U=`sed -n -e '/^U = / s///p' < "$mf"` test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR" # We invoke sed twice because it is the simplest approach to # changing $(DEPDIR) to its actual value in the expansion. for file in `sed -n -e ' /^DEP_FILES = .*\\\\$/ { s/^DEP_FILES = // :loop s/\\\\$// p n /\\\\$/ b loop p } /^DEP_FILES = / s/^DEP_FILES = //p' < "$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`AS_DIRNAME(["$file"])` AS_MKDIR_P([$dirpart/$fdir]) # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done ])# _AM_OUTPUT_DEPENDENCY_COMMANDS # AM_OUTPUT_DEPENDENCY_COMMANDS # ----------------------------- # This macro should only be invoked once -- use via AC_REQUIRE. # # This code is only required when automatic dependency tracking # is enabled. FIXME. This creates each `.P' file that we will # need in order to bootstrap the dependency handling code. AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], [AC_CONFIG_COMMANDS([depfiles], [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) ]) # Check to see how 'make' treats includes. -*- Autoconf -*- # Copyright (C) 2001, 2002 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. # serial 2 # AM_MAKE_INCLUDE() # ----------------- # Check to see how make treats includes. AC_DEFUN([AM_MAKE_INCLUDE], [am_make=${MAKE-make} cat > confinc << 'END' doit: @echo done END # If we don't find an include directive, just comment out the code. AC_MSG_CHECKING([for style of include used by $am_make]) am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # We grep out `Entering directory' and `Leaving directory' # messages which can occur if `w' ends up in MAKEFLAGS. # In particular we don't look at `^make:' because GNU make might # be invoked under some other name (usually "gmake"), in which # case it prints its new name instead of `make'. if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then am__include=include am__quote= _am_result=GNU fi # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then am__include=.include am__quote="\"" _am_result=BSD fi fi AC_SUBST(am__include) AC_SUBST(am__quote) AC_MSG_RESULT($_am_result) rm -f confinc confmf ]) # AM_CONDITIONAL -*- Autoconf -*- # Copyright 1997, 2000, 2001 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. # serial 5 AC_PREREQ(2.52) # AM_CONDITIONAL(NAME, SHELL-CONDITION) # ------------------------------------- # Define a conditional. AC_DEFUN([AM_CONDITIONAL], [ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl AC_SUBST([$1_TRUE]) AC_SUBST([$1_FALSE]) if $2; then $1_TRUE= $1_FALSE='#' else $1_TRUE='#' $1_FALSE= fi AC_CONFIG_COMMANDS_PRE( [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then AC_MSG_ERROR([conditional "$1" was never defined. Usually this means the macro was only invoked conditionally.]) fi])]) dia2code-0.8.3/dia2code.kaptn0100755000076400001440000000236410547512631015271 0ustar kelloggusers#!/usr/local/bin/kaptain start "Dia2Code" -> dia2code buttons; dia2code :tabbed -> main about; main "Dia2Code" -> "dia2code" language outdir classlist mask noclobber licensefile " " diagramfile; language "Output Language" -> " -t " outlanguage ; outlanguage :double :horizontal -> ada | c | ! cpp | idl | java | php | python | ruby | shp | sql ; c "C" -> "c"; cpp "C++" -> "cpp"; java "Java" -> "java"; ada "Ada" -> "ada"; python "Python" -> "python"; ruby "Ruby" -> "ruby"; sql "SQL" -> "sql"; shp "SHP" -> "shp"; php "PHP" -> "php"; idl "IDL" -> "idl"; outdir "Output Dir" -> " -d " @directory=`pwd`; classlist "Class list (foo,bar,...)" -> @ | " -cl " @string; mask "Reverse class list" -> @ | " -v"; noclobber "Don't overwrite existing files" -> @ | " -nc"; yesclobber -> ""; licensefile "License File" -> @ | " -l " @infile("*"); diagramfile "Diagram File" -> @infile("*.dia"); buttons :horizontal -> @action(dia2code)="Go" @preview(dia2code)="Preview Command" @close="Quit" ; about "About" -> @text("Kaptain grammar for Dia2Code\n\nVersion 1.2\n(c) 2001 Javier O'Hara\n\n\nDia2Code homepage:\nhttp://dia2code.sourceforge.net"); classlist="" "Generates code only for the classes specified\nin this comma-separated list"; dia2code-0.8.3/README0100644000076400001440000003637610547515336013454 0ustar kelloggusersDia2Code v. 0.8.3 SUMMARY This program generates code for many languages from an UML Dia Diagram. DESCRIPTION This program is a small utility that makes code from a Dia diagram. Supported languages are: Ada, C, C++, C#, IDL, Java, PHP(4,5), Python, Ruby, shapefiles, and SQL create statement files. Its intended purpose is to ease the programmer's work by generating the structure of the classes in an Object Oriented language (like C++, Java and C#) from a graphical representation of them (a Dia Diagram). STATUS Dia2Code generates Ada, C, C++, IDL, Java, PHP, Python, C#, and Ruby files. It can also generate a file with SQL's CREATE TABLE statements and .bat files for creating shapes. Templates and packages are supported but need testing. The basic functionality can now be considered complete. Minor releases should fix bugs and add small improvements. The generation of #include and import directives is done considering the types used in each class but, generally, only if those types are declared themselves in the diagram. Classes are searched in the types of: attributes, parents, method's return types, method's parameters, dependencies and associations. Dia2Code looks for Generalizations, Realizations, Implements, Dependencies and Associations and adds that information to the class list. Packages are implemented considering the geometry information of the objects (packages and classes). Feel free to have a try and send me your comments. LICENSE This program is distributed under the GNU GPL. Read the COPYING file for details. REQUIREMENTS I've only tested it under Linux/i386 and Win32. I have notices of successful compilation on *BSD and GNU Hurd. It should work with other platforms, but your mileage may vary. - Dia (I work with 0.88 but older versions *may* be OK). Not for the compilation part but to make some nice diagrams with it. - libxml2 headers and development libraries (I use 2.4.1 but it *may* be OK if you use any version greater than 2.0.0). - A C compiler. - automake and autoconf (actually, optional) INSTALLATION Usually: $ ./configure $ make # make install Read the INSTALL file for details. If that doesn't work for you, try (from the innermost dia2code directory): $ cc -I/usr/include/libxml *.c -O2 -o dia2code -lxml2 -ldl $ strip dia2code I've modified Makefile.am and configure.in so "configure" will hopefully find everything it needs. OPERATION $ dia2code Where can be any combination of: -h|--help prints help on parameters and exits inmediately -t (ada|c|cpp|idl|java|php|python|shp|sql|csharp) tells dia2code to either create C++ (cpp), Java (java), C (c), Ada (ada), Python (python), SQL "create table" files (sql) and C# (csharp). The default is C++. -d tells it to put the files in the specified directory. The default is to output files in the current directory. -nc asks dia2code to not overwrite existing files. - Default return value for non-void methods. -cl generates code only for the classes specified in the comma-separated . -v inverts the class list selection. When used without -cl, prevents any file from being created. -l prepends the contents of the specified file to each source file generated. Name of the dia file (compressed or not) that contains the UML diagram to be parsed. The only mandatory parameter is the diagram file name. Note: Parameters can be specified in any order. EXAMPLES $ dia2code -t java test.dia Will generate the *.java files for the classes in the test.dia diagram and put them in the current directory. $ dia2code -nc -d ~/C++ hw.dia Will generate the *.cpp and *.h files for the classes in the test.dia diagram and put them in the directory ~/C++. It won't overwrite any existant file. $ dia2code -t java -cl Base,Derived test.dia Will create the Java files only for classes "Base" and "Derived". $ dia2code -cl B*,*Foo test.dia Will create the *.cpp and *.h files for classes that begin with "B" or end with "Foo". NOTE: You can only specify one asterisk and either at the beginning or end of the pattern. NOTE2: You may have to quote the asterisks when typing on the shell (e.g. "\*" instead of "*") $ dia2code -cl Foo -v foobar.dia Will create C++ code for all classes but "Foo". $ dia2code -v test.dia Will not create any files. Don't know if it may be useful, but it surely is syntactically correct. HOW IT WORKS 1. Parse the diagram file with xmlParseFile(). 2. Parse the tree generated in 1 for UML classes to build an umlclasslist (type defined here). 3. Parse the tree again for UML Generalizations, Realizations, Implements, Dependencies, Associations and packages to add information to the class list. 4. Generate the structure of the classes (write it into files) from the class list. Steps 1-3 are done in parse_diagram(). Step 4 is done in generate_code_*(). Both functions are called from main(). NOTES ON UML What you should put into your diagram These are mandatory: - A non-empty class name. - For each attribute, the name and type. - For each method, the name. - For each method's parameter, the name and type. These are optional: - The stereotype of the class. - The default value of attributes. - The default value of parameters. - The return type of a method. If no type is declared, dia2code will output no type at all for it. Stereotypes In IDL, C++, and Ada, some stereotypes are supported that all begin with "CORBA". These are: CORBAConstant, CORBAEnum, CORBATypedef, CORBAStruct, CORBAUnion, CORBAValue. When generating IDL, the corresponding IDL syntax is generated for the UML class. When generating other languages, a rough mapping from the IDL to the other language is generated. The following conventions are followed by the code generation for CORBA stereotypes: Constant First attribute's type contains the const type; first attribute's value contains the const's value. Everything else unused. Enum Attribute names contain the enum literals, everything else unused. Typedef First attribute's type contains the original type; first attribute's value optionally contains the dimensions in case of an array. Everything else unused. Struct Attribute names and types contain the struct members. Everything else unused. Union First attribute's type contains the switch type. Only enum types are supported as the switch type. Following attributes contain the union cases as follows: Attribute value contains the switch value for the case (only exactly one value possible per case); attribute name and type contains the union member name and type for that case. Everything else unused. Value Use much like a normal class. Staticness not supported. In C++, an abstract class is not explicitly declared as it is in Java. To have a class declared as "abstract" you have to set its "abstract" flag. For generating Java, dia2code recognizes two stereotypes: "Interface" and "JavaBean". The former is a standard stereotype name, the latter a convention we use here. Both interfaces are only meaningful when generating Java code. If the stereotype is "JavaBean" then dia2code will output, for each attribute a of the class: - A "T getA();" method, with return type conformant to the type of the attribute. If the type of the attribute is "boolean" then the name will be: "boolean isA()". - A "void setA(T value);" method, with a paramter, "value", with type conformant to the type of the attribute. Note: actually, dia2code will not output these things, but it will create the methods and paste into each one the suggested implementation. These methods will be treated as the rest. The generate_code_java outputs an implementation if one's avaliable. The generate_code_cpp just happens to do the same, but I feel it is most useful when generating Java code. Visibility Dia2Code does not handle the "implementation" visibility for methods (yet). So when you have a class that implements a method that was declared abstract in a base class, you have to give it the same visibility of the parent class' method. The visibility of the method is not printed if it is "implementation"; this may be a source of bugs. Method's return type If you leave the "type" entry in the method declaration empty, then no type will be declared for it. This is useful with constructors, when the return type is implicit (both in C++ and Java). If the return type is void, you should explicitly declare it in the UML diagram. I don't know if this is a good practice, I just thought it was reasonable. Everyone is welcome to discuss it. Packages The UML standard states that there are (mostly) two ways of representing packages: a large box with all the elements inside (Large Package in Dia) or a small box (Small Package in Dia) to which the package's elements connect with a symbol that Dia does not (yet?) include: a line with a crossed out circle in the end of the container. You can put a normal line with a "Coordiate origin" arrow at one end, of course, and will be aestetically correct, but of no use to Dia2Code. Dia2code, currently, checks only for intersections of packages (Large or Small) with other objects like classes and other packages, so it will be mostly useful with diagrams that use Large Packages instead of Small ones. As of version 0.8.2, the Java, IDL, C++, and Ada code generators use package information. We should upgrade the other generators so they will generate better import/include directives. The Java code generator currently outputs all the files to the specified directory, does not create one for each package. The IDL, C++, and Ada generators generate files only for the outermost packages/classes. UML elements nested inside packages are generated as items nested with the IDL module, C++ namespace, or Ada package. INFORMATION FOR DEVELOPERS (more will come in the future) Code Generators: A code generator function is a function that takes a pointer to a batch structure. The structure looks like this: struct batch { umlclasslist classlist; char * outdir; int clobber; namelist classes; int mask; }; The classes to generate are in classlist. The output directory is outdir. The files that the generate_code opens for writing MUST have this output directory as a prefix, UNLESS it is NULL, in which case, it will default to ".". The function SHOULD check the length of the directory for possible buffer overflows inside the function. If the clobber flag is set, any already existing file in the output directory MUST NOT be overwritten. Classes is a list of the classes to create code for. Mask is a flag that inverts this selection. Some example code: #include "dia2code.h" #include "decls.h" #include "includes.h" generate_code_foo (batch *b) { umlclasslist tmplist; declaration *d; tmplist = b->classlist; while (tmplist != NULL) { if (! (is_present (b->classes, tmplist->key->name) ^ b->mask)) { push (tmplist, b); /* The class is pushed onto the global `decls'. We do this in order to support packages: A single package may contain multiple classes and these classes must be generated in the correct order, i.e. declare classes that depend on other classes towards the end. */ } tmplist=tmplist->next; } /* Generate a file for each outer declaration. */ d = decls; while (d != NULL) { char *name; char outfilename[256]; if (d->decl_kind == dk_module) { name = d->u.this_module->pkg->name; } else { /* dk_class */ name = d->u.this_class->key->name; } sprintf (outfilename, "%s.h", name); spec = open_outfile (outfilename, b); if (spec == NULL) { d = d->next; continue; } /* Determine include files needed. */ includes = NULL; determine_includes (d, b); if (includes) { namelist incfile = includes; while (incfile != NULL) { if (!eq (incfile->name, name)) { emit ("#include \"%s.h\"\n", incfile->name); } incfile = incfile->next; } emit ("\n"); } /* We generate all the code here */ fclose (spec); d = d->next; } } Generating import/include clauses: includes.h contains the function determine_includes() and the global variable `includes'. Handling is as shown in the example above. determine_includes() assumes that a file is generated for each outer package and for each class not nested inside a package. If this does not make sense for the programming language you are targeting, then there are two lower-level functions that can help the code generator know which classes are used inside the current class: find_classes() and list_classes(). The former is the eldest of the two. It returns a namelist (a list of char*) with the names of the classes used that are also declared in the same diagram (are on the classlist). The latter is a new addition in version 0.7. It does basically the same search but instead of a list of char* it returns a classlist with pointers to the diagram classes themselves. Which to use is up to you. For generators of C and SQL code the find_classes() will suffice. For generators of Java code, that use heavily the package information, the list_classes() is more suitable. BUGS Note: some bugs may not be listed here. - No checking for full filesystem while writing files. - Does not follow the DTD of a Dia Diagram, rather parses as it sees fit. - Allocates memory proportionally to the size of the diagrams. It should work OK with small diagrams but may slow down with BIG ones. AUTHOR Javier O'Hara MAINTAINER Richard Torkar Contributors: (in alphabetical order, by last name) - Cyrille Chepelov Pyhton code generation, Debian package management, Hurd conformance. - Harald Fielker PHP code generation. - Oliver Kellogg , CORBA stereotype and package support - Ruben Lopez , C code generation. - Steffen Macke batch shapefile generation, win32 installer. - Chris McGee Dependencies, Associations, C++ Templates, SQL, IDL code generation. - Takashi Okamoto License inclusion mechanism. - Thomas Preymesser Ada code generation. - Dmitry V. Sabanin Ruby code generation. - Jщrєme Slangen Wildcard class list mechanism. - Takaaki Tateishi <> Dynamic Shared Objects for dynamic code generator modules. - Martin Vidner Porting to libxml2. - Thomas Hansen C# code generation. THANKS Thanks to Collin Starkweather and Slush Gore for the extra help. Also, thanks to all the people that have contacted me with suggestions and bug reports. dia2code-0.8.3/configure0100755000076400001440000044702110547513573014475 0ustar kelloggusers#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.59. # # Copyright (C) 2003 Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## # Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then set -o posix fi DUALCASE=1; export DUALCASE # for MKS sh # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # Work around bugs in pre-3.0 UWIN ksh. $as_unset ENV MAIL MAILPATH PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else $as_unset $as_var fi done # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi # Name of the executable. as_me=`$as_basename "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)$' \| \ . : '\(.\)' 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } /^X\/\(\/\/\)$/{ s//\1/; q; } /^X\/\(\/\).*/{ s//\1/; q; } s/.*/./; q'` # PATH needs CR, and LINENO needs CR and PATH. # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" || { # Find who we are. Look in the path if we contain no path at all # relative or not. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2 { (exit 1); exit 1; }; } fi case $CONFIG_SHELL in '') as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for as_base in sh bash ksh sh5; do case $as_dir in /*) if ("$as_dir/$as_base" -c ' as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } CONFIG_SHELL=$as_dir/$as_base export CONFIG_SHELL exec "$CONFIG_SHELL" "$0" ${1+"$@"} fi;; esac done done ;; esac # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line before each line; the second 'sed' does the real # work. The second script uses 'N' to pair each line-number line # with the numbered line, and appends trailing '-' during # substitution so that $LINENO is not a special case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) sed '=' <$as_myself | sed ' N s,$,-, : loop s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, t loop s,-$,, s,^['$as_cr_digits']*\n,, ' >$as_me.lineno && chmod +x $as_me.lineno || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensible to this). . ./$as_me.lineno # Exit status is that of the last command. exit } case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in *c*,-n*) ECHO_N= ECHO_C=' ' ECHO_T=' ' ;; *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; *) ECHO_N= ECHO_C='\c' ECHO_T= ;; esac if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then # We could just check for DJGPP; but this test a) works b) is more generic # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). if test -f conf$$.exe; then # Don't use ln at all; we don't have any links as_ln_s='cp -p' else as_ln_s='ln -s' fi elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.file if mkdir -p . 2>/dev/null; then as_mkdir_p=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_executable_p="test -f" # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" # IFS # We need space, tab and new line, in precisely that order. as_nl=' ' IFS=" $as_nl" # CDPATH. $as_unset CDPATH # Name of the host. # hostname on some systems (SVR3.2, Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` exec 6>&1 # # Initializations. # ac_default_prefix=/usr/local ac_config_libobj_dir=. cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= SHELL=${CONFIG_SHELL-/bin/sh} # Maximum number of lines to put in a shell here document. # This variable seems obsolete. It should probably be removed, and # only ac_max_sed_lines should be used. : ${ac_max_here_lines=38} # Identity of this package. PACKAGE_NAME= PACKAGE_TARNAME= PACKAGE_VERSION= PACKAGE_STRING= PACKAGE_BUGREPORT= ac_unique_file="Makefile.am" # Factoring default headers for most tests. ac_includes_default="\ #include #if HAVE_SYS_TYPES_H # include #endif #if HAVE_SYS_STAT_H # include #endif #if STDC_HEADERS # include # include #else # if HAVE_STDLIB_H # include # endif #endif #if HAVE_STRING_H # if !STDC_HEADERS && HAVE_MEMORY_H # include # endif # include #endif #if HAVE_STRINGS_H # include #endif #if HAVE_INTTYPES_H # include #else # if HAVE_STDINT_H # include # endif #endif #if HAVE_UNISTD_H # include #endif" ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO AMTAR install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM AWK SET_MAKE CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE RANLIB ac_ct_RANLIB XML_CONFIG XML_INCLUDES CPP EGREP LIBOBJS LTLIBOBJS' ac_subst_files='' # Initialize some variables set by options. ac_init_help= ac_init_version=false # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datadir='${prefix}/share' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' libdir='${exec_prefix}/lib' includedir='${prefix}/include' oldincludedir='/usr/include' infodir='${prefix}/info' mandir='${prefix}/man' ac_prev= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval "$ac_prev=\$ac_option" ac_prev= continue fi ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'` # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_option in -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad | --data | --dat | --da) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ | --da=*) datadir=$ac_optarg ;; -disable-* | --disable-*) ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/-/_/g'` eval "enable_$ac_feature=no" ;; -enable-* | --enable-*) ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/-/_/g'` case $ac_option in *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; *) ac_optarg=yes ;; esac eval "enable_$ac_feature='$ac_optarg'" ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst \ | --locals | --local | --loca | --loc | --lo) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* \ | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package| sed 's/-/_/g'` case $ac_option in *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; *) ac_optarg=yes ;; esac eval "with_$ac_package='$ac_optarg'" ;; -without-* | --without-*) ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/-/_/g'` eval "with_$ac_package=no" ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) { echo "$as_me: error: unrecognized option: $ac_option Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 { (exit 1); exit 1; }; } ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` eval "$ac_envvar='$ac_optarg'" export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` { echo "$as_me: error: missing argument to $ac_option" >&2 { (exit 1); exit 1; }; } fi # Be sure to have absolute paths. for ac_var in exec_prefix prefix do eval ac_val=$`echo $ac_var` case $ac_val in [\\/$]* | ?:[\\/]* | NONE | '' ) ;; *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; };; esac done # Be sure to have absolute paths. for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \ localstatedir libdir includedir oldincludedir infodir mandir do eval ac_val=$`echo $ac_var` case $ac_val in [\\/$]* | ?:[\\/]* ) ;; *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; };; esac done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. If a cross compiler is detected then cross compile mode will be used." >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then its parent. ac_confdir=`(dirname "$0") 2>/dev/null || $as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$0" : 'X\(//\)[^/]' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$0" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` srcdir=$ac_confdir if test ! -r $srcdir/$ac_unique_file; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r $srcdir/$ac_unique_file; then if test "$ac_srcdir_defaulted" = yes; then { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2 { (exit 1); exit 1; }; } else { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 { (exit 1); exit 1; }; } fi fi (cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null || { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2 { (exit 1); exit 1; }; } srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'` ac_env_build_alias_set=${build_alias+set} ac_env_build_alias_value=$build_alias ac_cv_env_build_alias_set=${build_alias+set} ac_cv_env_build_alias_value=$build_alias ac_env_host_alias_set=${host_alias+set} ac_env_host_alias_value=$host_alias ac_cv_env_host_alias_set=${host_alias+set} ac_cv_env_host_alias_value=$host_alias ac_env_target_alias_set=${target_alias+set} ac_env_target_alias_value=$target_alias ac_cv_env_target_alias_set=${target_alias+set} ac_cv_env_target_alias_value=$target_alias ac_env_CC_set=${CC+set} ac_env_CC_value=$CC ac_cv_env_CC_set=${CC+set} ac_cv_env_CC_value=$CC ac_env_CFLAGS_set=${CFLAGS+set} ac_env_CFLAGS_value=$CFLAGS ac_cv_env_CFLAGS_set=${CFLAGS+set} ac_cv_env_CFLAGS_value=$CFLAGS ac_env_LDFLAGS_set=${LDFLAGS+set} ac_env_LDFLAGS_value=$LDFLAGS ac_cv_env_LDFLAGS_set=${LDFLAGS+set} ac_cv_env_LDFLAGS_value=$LDFLAGS ac_env_CPPFLAGS_set=${CPPFLAGS+set} ac_env_CPPFLAGS_value=$CPPFLAGS ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set} ac_cv_env_CPPFLAGS_value=$CPPFLAGS ac_env_CPP_set=${CPP+set} ac_env_CPP_value=$CPP ac_cv_env_CPP_set=${CPP+set} ac_cv_env_CPP_value=$CPP # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures this package to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] _ACEOF cat <<_ACEOF Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --datadir=DIR read-only architecture-independent data [PREFIX/share] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --infodir=DIR info documentation [PREFIX/info] --mandir=DIR man documentation [PREFIX/man] _ACEOF cat <<\_ACEOF Program names: --program-prefix=PREFIX prepend PREFIX to installed program names --program-suffix=SUFFIX append SUFFIX to installed program names --program-transform-name=PROGRAM run sed PROGRAM on installed program names _ACEOF fi if test -n "$ac_init_help"; then cat <<\_ACEOF Optional Features: --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --disable-dependency-tracking Speeds up one-time builds --enable-dependency-tracking Do not reject slow dependency extractors Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory CPPFLAGS C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory CPP C preprocessor Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. _ACEOF fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. ac_popdir=`pwd` for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d $ac_dir || continue ac_builddir=. if test "$ac_dir" != .; then ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A "../" for each directory in $ac_dir_suffix. ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` else ac_dir_suffix= ac_top_builddir= fi case $srcdir in .) # No --srcdir option. We are building in place. ac_srcdir=. if test -z "$ac_top_builddir"; then ac_top_srcdir=. else ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` fi ;; [\\/]* | ?:[\\/]* ) # Absolute path. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ;; *) # Relative path. ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_builddir$srcdir ;; esac # Do not use `cd foo && pwd` to compute absolute paths, because # the directories may not exist. case `pwd` in .) ac_abs_builddir="$ac_dir";; *) case "$ac_dir" in .) ac_abs_builddir=`pwd`;; [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; *) ac_abs_builddir=`pwd`/"$ac_dir";; esac;; esac case $ac_abs_builddir in .) ac_abs_top_builddir=${ac_top_builddir}.;; *) case ${ac_top_builddir}. in .) ac_abs_top_builddir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; esac;; esac case $ac_abs_builddir in .) ac_abs_srcdir=$ac_srcdir;; *) case $ac_srcdir in .) ac_abs_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; esac;; esac case $ac_abs_builddir in .) ac_abs_top_srcdir=$ac_top_srcdir;; *) case $ac_top_srcdir in .) ac_abs_top_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; esac;; esac cd $ac_dir # Check for guested configure; otherwise get Cygnus style configure. if test -f $ac_srcdir/configure.gnu; then echo $SHELL $ac_srcdir/configure.gnu --help=recursive elif test -f $ac_srcdir/configure; then echo $SHELL $ac_srcdir/configure --help=recursive elif test -f $ac_srcdir/configure.ac || test -f $ac_srcdir/configure.in; then echo $ac_configure --help else echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi cd $ac_popdir done fi test -n "$ac_init_help" && exit 0 if $ac_init_version; then cat <<\_ACEOF Copyright (C) 2003 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit 0 fi exec 5>config.log cat >&5 <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by $as_me, which was generated by GNU Autoconf 2.59. Invocation command line was $ $0 $@ _ACEOF { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` hostinfo = `(hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. echo "PATH: $as_dir" done } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_sep= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; 2) ac_configure_args1="$ac_configure_args1 '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'" # Get rid of the leading space. ac_sep=" " ;; esac done done $as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } $as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; } # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Be sure not to use single quotes in there, as some shells, # such as our DU 5.0 friend, will then `close' the trap. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo cat <<\_ASBOX ## ---------------- ## ## Cache variables. ## ## ---------------- ## _ASBOX echo # The following way of writing the cache mishandles newlines in values, { (set) 2>&1 | case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in *ac_space=\ *) sed -n \ "s/'"'"'/'"'"'\\\\'"'"''"'"'/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p" ;; *) sed -n \ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" ;; esac; } echo cat <<\_ASBOX ## ----------------- ## ## Output variables. ## ## ----------------- ## _ASBOX echo for ac_var in $ac_subst_vars do eval ac_val=$`echo $ac_var` echo "$ac_var='"'"'$ac_val'"'"'" done | sort echo if test -n "$ac_subst_files"; then cat <<\_ASBOX ## ------------- ## ## Output files. ## ## ------------- ## _ASBOX echo for ac_var in $ac_subst_files do eval ac_val=$`echo $ac_var` echo "$ac_var='"'"'$ac_val'"'"'" done | sort echo fi if test -s confdefs.h; then cat <<\_ASBOX ## ----------- ## ## confdefs.h. ## ## ----------- ## _ASBOX echo sed "/^$/d" confdefs.h | sort echo fi test "$ac_signal" != 0 && echo "$as_me: caught signal $ac_signal" echo "$as_me: exit $exit_status" } >&5 rm -f core *.core && rm -rf conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -rf conftest* confdefs.h # AIX cpp loses on an empty file, so make sure it contains at least a newline. echo >confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer explicitly selected file to automatically selected ones. if test -z "$CONFIG_SITE"; then if test "x$prefix" != xNONE; then CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" else CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" fi fi for ac_site_file in $CONFIG_SITE; do if test -r "$ac_site_file"; then { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special # files actually), so we avoid doing that. if test -f "$cache_file"; then { echo "$as_me:$LINENO: loading cache $cache_file" >&5 echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . $cache_file;; *) . ./$cache_file;; esac fi else { echo "$as_me:$LINENO: creating cache $cache_file" >&5 echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in `(set) 2>&1 | sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val="\$ac_cv_env_${ac_var}_value" eval ac_new_val="\$ac_env_${ac_var}_value" case $ac_old_set,$ac_new_set in set,) { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 echo "$as_me: former value: $ac_old_val" >&2;} { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 echo "$as_me: current value: $ac_new_val" >&2;} ac_cache_corrupted=: fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 echo "$as_me: error: changes in the environment can compromise the build" >&2;} { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} { (exit 1); exit 1; }; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_config_headers="$ac_config_headers config.h" am__api_version="1.7" ac_aux_dir= for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do if test -f $ac_dir/install-sh; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f $ac_dir/install.sh; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break elif test -f $ac_dir/shtool; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5 echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;} { (exit 1); exit 1; }; } fi ac_config_guess="$SHELL $ac_aux_dir/config.guess" ac_config_sub="$SHELL $ac_aux_dir/config.sub" ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure. # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6 if test -z "$INSTALL"; then if test "${ac_cv_path_install+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in ./ | .// | /cC/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi done done ;; esac done fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. We don't cache a # path for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the path is relative. INSTALL=$ac_install_sh fi fi echo "$as_me:$LINENO: result: $INSTALL" >&5 echo "${ECHO_T}$INSTALL" >&6 # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' echo "$as_me:$LINENO: checking whether build environment is sane" >&5 echo $ECHO_N "checking whether build environment is sane... $ECHO_C" >&6 # Just in case sleep 1 echo timestamp > conftest.file # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` if test "$*" = "X"; then # -L didn't work. set X `ls -t $srcdir/configure conftest.file` fi rm -f conftest.file if test "$*" != "X $srcdir/configure conftest.file" \ && test "$*" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". { { echo "$as_me:$LINENO: error: ls -t appears to fail. Make sure there is not a broken alias in your environment" >&5 echo "$as_me: error: ls -t appears to fail. Make sure there is not a broken alias in your environment" >&2;} { (exit 1); exit 1; }; } fi test "$2" = conftest.file ) then # Ok. : else { { echo "$as_me:$LINENO: error: newly created file is older than distributed files! Check your system clock" >&5 echo "$as_me: error: newly created file is older than distributed files! Check your system clock" >&2;} { (exit 1); exit 1; }; } fi echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 test "$program_prefix" != NONE && program_transform_name="s,^,$program_prefix,;$program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && program_transform_name="s,\$,$program_suffix,;$program_transform_name" # Double any \ or $. echo might interpret backslashes. # By default was `s,x,x', remove it if useless. cat <<\_ACEOF >conftest.sed s/[\\$]/&&/g;s/;s,x,x,$// _ACEOF program_transform_name=`echo $program_transform_name | sed -f conftest.sed` rm conftest.sed # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" # Use eval to expand $SHELL if eval "$MISSING --run true"; then am_missing_run="$MISSING --run " else am_missing_run= { echo "$as_me:$LINENO: WARNING: \`missing' script is too old or missing" >&5 echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} fi for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_AWK+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AWK="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then echo "$as_me:$LINENO: result: $AWK" >&5 echo "${ECHO_T}$AWK" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$AWK" && break done echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,:./+-,___p_,'` if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.make <<\_ACEOF all: @echo 'ac_maketemp="$(MAKE)"' _ACEOF # GNU make sometimes prints "make[1]: Entering...", which would confuse us. eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=` if test -n "$ac_maketemp"; then eval ac_cv_prog_make_${ac_make}_set=yes else eval ac_cv_prog_make_${ac_make}_set=no fi rm -f conftest.make fi if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 SET_MAKE= else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 SET_MAKE="MAKE=${MAKE-make}" fi # test to see if srcdir already configured if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then { { echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5 echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;} { (exit 1); exit 1; }; } fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi # Define the identity of the package. PACKAGE=dia2code VERSION=0.8.3 cat >>confdefs.h <<_ACEOF #define PACKAGE "$PACKAGE" _ACEOF cat >>confdefs.h <<_ACEOF #define VERSION "$VERSION" _ACEOF # Some tools Automake needs. ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} AMTAR=${AMTAR-"${am_missing_run}tar"} install_sh=${install_sh-"$am_aux_dir/install-sh"} # Installed binaries are usually stripped using `strip' when the user # run `make install-strip'. However `strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the `STRIP' environment variable to overrule this program. if test "$cross_compiling" != no; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_STRIP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then echo "$as_me:$LINENO: result: $STRIP" >&5 echo "${ECHO_T}$STRIP" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done test -z "$ac_cv_prog_ac_ct_STRIP" && ac_cv_prog_ac_ct_STRIP=":" fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 echo "${ECHO_T}$ac_ct_STRIP" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi STRIP=$ac_ct_STRIP else STRIP="$ac_cv_prog_STRIP" fi fi INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s" # We need awk for the "check" target. The system "awk" is bad on # some platforms. ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi CC=$ac_ct_CC else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi CC=$ac_ct_CC else CC="$ac_cv_prog_CC" fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$ac_ct_CC" && break done CC=$ac_ct_CC fi fi test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&5 echo "$as_me: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } # Provide some information about the compiler. echo "$as_me:$LINENO:" \ "checking for C compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 (eval $ac_compiler --version &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 (eval $ac_compiler -v &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 (eval $ac_compiler -V &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6 ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5 (eval $ac_link_default) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # Find the output, starting from the most likely. This scheme is # not robust to junk in `.', hence go to wildcards (a.*) only as a last # resort. # Be careful to initialize this variable, since it used to be cached. # Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile. ac_cv_exeext= # b.out is created by i960 compilers. for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;; conftest.$ac_ext ) # This is the source file. ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` # FIXME: I believe we export ac_cv_exeext for Libtool, # but it would be cool to find out if it's true. Does anybody # maintain Libtool? --akim. export ac_cv_exeext break;; * ) break;; esac done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: C compiler cannot create executables See \`config.log' for more details." >&5 echo "$as_me: error: C compiler cannot create executables See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } fi ac_exeext=$ac_cv_exeext echo "$as_me:$LINENO: result: $ac_file" >&5 echo "${ECHO_T}$ac_file" >&6 # Check the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. echo "$as_me:$LINENO: checking whether the C compiler works" >&5 echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6 # FIXME: These cross compiler hacks should be removed for Autoconf 3.0 # If not cross compiling, check that we can run a simple program. if test "$cross_compiling" != yes; then if { ac_try='./$ac_file' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { echo "$as_me:$LINENO: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&5 echo "$as_me: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi fi fi echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 rm -f a.out a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save # Check the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6 echo "$as_me:$LINENO: result: $cross_compiling" >&5 echo "${ECHO_T}$cross_compiling" >&6 echo "$as_me:$LINENO: checking for suffix of executables" >&5 echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` export ac_cv_exeext break;; * ) break;; esac done else { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest$ac_cv_exeext echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 echo "${ECHO_T}$ac_cv_exeext" >&6 rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT echo "$as_me:$LINENO: checking for suffix of object files" >&5 echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6 if test "${ac_cv_objext+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 echo "${ECHO_T}$ac_cv_objext" >&6 OBJEXT=$ac_cv_objext ac_objext=$OBJEXT echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6 if test "${ac_cv_c_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_compiler_gnu=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6 GCC=`test $ac_compiler_gnu = yes && echo yes` ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS CFLAGS="-g" echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6 if test "${ac_cv_prog_cc_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_prog_cc_g=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 echo "${ECHO_T}$ac_cv_prog_cc_g" >&6 if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5 echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6 if test "${ac_cv_prog_cc_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_prog_cc_stdc=no ac_save_CC=$CC cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std1 is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std1. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF # Don't try gcc -ansi; that turns off useful extensions and # breaks some systems' header files. # AIX -qlanglvl=ansi # Ultrix and OSF/1 -std1 # HP-UX 10.20 and later -Ae # HP-UX older versions -Aa -D_HPUX_SOURCE # SVR4 -Xc -D__EXTENSIONS__ for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_prog_cc_stdc=$ac_arg break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext done rm -f conftest.$ac_ext conftest.$ac_objext CC=$ac_save_CC fi case "x$ac_cv_prog_cc_stdc" in x|xno) echo "$as_me:$LINENO: result: none needed" >&5 echo "${ECHO_T}none needed" >&6 ;; *) echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5 echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6 CC="$CC $ac_cv_prog_cc_stdc" ;; esac # Some people use a C++ compiler to compile C. Since we use `exit', # in C++ we need to declare it. In case someone uses the same compiler # for both compiling C and C++ we need to have the C++ compiler decide # the declaration of exit, since it's the most demanding environment. cat >conftest.$ac_ext <<_ACEOF #ifndef __cplusplus choke me #endif _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then for ac_declaration in \ '' \ 'extern "C" void std::exit (int) throw (); using std::exit;' \ 'extern "C" void std::exit (int); using std::exit;' \ 'extern "C" void exit (int) throw ();' \ 'extern "C" void exit (int);' \ 'void exit (int);' do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_declaration #include int main () { exit (42); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 continue fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_declaration int main () { exit (42); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done rm -f conftest* if test -n "$ac_declaration"; then echo '#ifdef __cplusplus' >>confdefs.h echo $ac_declaration >>confdefs.h echo '#endif' >>confdefs.h fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu rm -f .deps 2>/dev/null mkdir .deps 2>/dev/null if test -d .deps; then DEPDIR=.deps else # MS-DOS does not allow filenames that begin with a dot. DEPDIR=_deps fi rmdir .deps 2>/dev/null ac_config_commands="$ac_config_commands depfiles" am_make=${MAKE-make} cat > confinc << 'END' doit: @echo done END # If we don't find an include directive, just comment out the code. echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5 echo $ECHO_N "checking for style of include used by $am_make... $ECHO_C" >&6 am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # We grep out `Entering directory' and `Leaving directory' # messages which can occur if `w' ends up in MAKEFLAGS. # In particular we don't look at `^make:' because GNU make might # be invoked under some other name (usually "gmake"), in which # case it prints its new name instead of `make'. if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then am__include=include am__quote= _am_result=GNU fi # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then am__include=.include am__quote="\"" _am_result=BSD fi fi echo "$as_me:$LINENO: result: $_am_result" >&5 echo "${ECHO_T}$_am_result" >&6 rm -f confinc confmf # Check whether --enable-dependency-tracking or --disable-dependency-tracking was given. if test "${enable_dependency_tracking+set}" = set; then enableval="$enable_dependency_tracking" fi; if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' fi if test "x$enable_dependency_tracking" != xno; then AMDEP_TRUE= AMDEP_FALSE='#' else AMDEP_TRUE='#' AMDEP_FALSE= fi depcc="$CC" am_compiler_list= echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6 if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir am_cv_CC_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi for depmode in $am_compiler_list; do # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. echo '#include "conftest.h"' > conftest.c echo 'int i;' > conftest.h echo "${am__include} ${am__quote}conftest.Po${am__quote}" > confmf case $depmode in nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; none) break ;; esac # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. if depmode=$depmode \ source=conftest.c object=conftest.o \ depfile=conftest.Po tmpdepfile=conftest.TPo \ $SHELL ./depcomp $depcc -c -o conftest.o conftest.c >/dev/null 2>&1 && grep conftest.h conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then am_cv_CC_dependencies_compiler_type=$depmode break fi done cd .. rm -rf conftest.dir else am_cv_CC_dependencies_compiler_type=none fi fi echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5 echo "${ECHO_T}$am_cv_CC_dependencies_compiler_type" >&6 CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then am__fastdepCC_TRUE= am__fastdepCC_FALSE='#' else am__fastdepCC_TRUE='#' am__fastdepCC_FALSE= fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_RANLIB+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then echo "$as_me:$LINENO: result: $RANLIB" >&5 echo "${ECHO_T}$RANLIB" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_RANLIB"; then ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_RANLIB"; then ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_RANLIB="ranlib" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB=":" fi fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 echo "${ECHO_T}$ac_ct_RANLIB" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi RANLIB=$ac_ct_RANLIB else RANLIB="$ac_cv_prog_RANLIB" fi # Extract the first word of "xml2-config", so it can be a program name with args. set dummy xml2-config; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_path_XML_CONFIG+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $XML_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_XML_CONFIG="$XML_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_XML_CONFIG="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done test -z "$ac_cv_path_XML_CONFIG" && ac_cv_path_XML_CONFIG="no" ;; esac fi XML_CONFIG=$ac_cv_path_XML_CONFIG if test -n "$XML_CONFIG"; then echo "$as_me:$LINENO: result: $XML_CONFIG" >&5 echo "${ECHO_T}$XML_CONFIG" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi if test "$XML_CONFIG" = "no"; then { { echo "$as_me:$LINENO: error: Cannot determine configuration of libxml. Perhaps you forgot to install the package libxml2-devel ?" >&5 echo "$as_me: error: Cannot determine configuration of libxml. Perhaps you forgot to install the package libxml2-devel ?" >&2;} { (exit 1); exit 1; }; } else XML_INCLUDES=`$XML_CONFIG --cflags` LIBXML_LIBS=`$XML_CONFIG --libs` LIBS="$LIBS $LIBXML_LIBS" fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if test "${ac_cv_prog_CPP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether non-existent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then break fi done ac_cv_prog_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi echo "$as_me:$LINENO: result: $CPP" >&5 echo "${ECHO_T}$CPP" >&6 ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether non-existent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&5 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu echo "$as_me:$LINENO: checking for egrep" >&5 echo $ECHO_N "checking for egrep... $ECHO_C" >&6 if test "${ac_cv_prog_egrep+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if echo a | (grep -E '(a|b)') >/dev/null 2>&1 then ac_cv_prog_egrep='grep -E' else ac_cv_prog_egrep='egrep' fi fi echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5 echo "${ECHO_T}$ac_cv_prog_egrep" >&6 EGREP=$ac_cv_prog_egrep echo "$as_me:$LINENO: checking for ANSI C header files" >&5 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 if test "${ac_cv_header_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_header_stdc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_stdc=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_header_stdc=no fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi fi echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 echo "${ECHO_T}$ac_cv_header_stdc" >&6 if test $ac_cv_header_stdc = yes; then cat >>confdefs.h <<\_ACEOF #define STDC_HEADERS 1 _ACEOF fi # On IRIX 5.3, sys/types and inttypes.h are conflicting. for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_Header=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Header=no" fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in dlfcn.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------------------ ## ## Report this to the AC_PACKAGE_NAME lists. ## ## ------------------------------------------ ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6 if test "${ac_cv_lib_dl_dlopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char dlopen (); int main () { dlopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_dl_dlopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dl_dlopen=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6 if test $ac_cv_lib_dl_dlopen = yes; then LDFLAGS="$LDFLAGS -rdynamic"; LIBS="$LIBS -ldl"; CPPFLAGS="$CPPFLAGS -DDSO" fi ac_config_files="$ac_config_files Makefile dia2code/Makefile dia2code/docs/Makefile dia2code/docs/en/Makefile" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, don't put newlines in cache variables' values. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. { (set) 2>&1 | case `(ac_space=' '; set | grep ac_space) 2>&1` in *ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote # substitution turns \\\\ into \\, and sed turns \\ into \). sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n \ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" ;; esac; } | sed ' t clear : clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ : end' >>confcache if diff $cache_file confcache >/dev/null 2>&1; then :; else if test -w $cache_file; then test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file" cat confcache >$cache_file else echo "not updating unwritable cache $cache_file" fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' # VPATH may cause trouble with some makes, so we remove $(srcdir), # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=/{ s/:*\$(srcdir):*/:/; s/:*\${srcdir}:*/:/; s/:*@srcdir@:*/:/; s/^\([^=]*=[ ]*\):*/\1/; s/:*$//; s/^[^=]*=[ ]*$//; }' fi DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_i=`echo "$ac_i" | sed 's/\$U\././;s/\.o$//;s/\.obj$//'` # 2. Add them. ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext" ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi : ${CONFIG_STATUS=./config.status} ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 echo "$as_me: creating $CONFIG_STATUS" >&6;} cat >$CONFIG_STATUS <<_ACEOF #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## # Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then set -o posix fi DUALCASE=1; export DUALCASE # for MKS sh # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # Work around bugs in pre-3.0 UWIN ksh. $as_unset ENV MAIL MAILPATH PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else $as_unset $as_var fi done # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi # Name of the executable. as_me=`$as_basename "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)$' \| \ . : '\(.\)' 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } /^X\/\(\/\/\)$/{ s//\1/; q; } /^X\/\(\/\).*/{ s//\1/; q; } s/.*/./; q'` # PATH needs CR, and LINENO needs CR and PATH. # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" || { # Find who we are. Look in the path if we contain no path at all # relative or not. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5 echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;} { (exit 1); exit 1; }; } fi case $CONFIG_SHELL in '') as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for as_base in sh bash ksh sh5; do case $as_dir in /*) if ("$as_dir/$as_base" -c ' as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } CONFIG_SHELL=$as_dir/$as_base export CONFIG_SHELL exec "$CONFIG_SHELL" "$0" ${1+"$@"} fi;; esac done done ;; esac # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line before each line; the second 'sed' does the real # work. The second script uses 'N' to pair each line-number line # with the numbered line, and appends trailing '-' during # substitution so that $LINENO is not a special case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) sed '=' <$as_myself | sed ' N s,$,-, : loop s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, t loop s,-$,, s,^['$as_cr_digits']*\n,, ' >$as_me.lineno && chmod +x $as_me.lineno || { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5 echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;} { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensible to this). . ./$as_me.lineno # Exit status is that of the last command. exit } case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in *c*,-n*) ECHO_N= ECHO_C=' ' ECHO_T=' ' ;; *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; *) ECHO_N= ECHO_C='\c' ECHO_T= ;; esac if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then # We could just check for DJGPP; but this test a) works b) is more generic # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). if test -f conf$$.exe; then # Don't use ln at all; we don't have any links as_ln_s='cp -p' else as_ln_s='ln -s' fi elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.file if mkdir -p . 2>/dev/null; then as_mkdir_p=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_executable_p="test -f" # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" # IFS # We need space, tab and new line, in precisely that order. as_nl=' ' IFS=" $as_nl" # CDPATH. $as_unset CDPATH exec 6>&1 # Open the log real soon, to keep \$[0] and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. Logging --version etc. is OK. exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX } >&5 cat >&5 <<_CSEOF This file was extended by $as_me, which was generated by GNU Autoconf 2.59. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ _CSEOF echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5 echo >&5 _ACEOF # Files that config.status was made for. if test -n "$ac_config_files"; then echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS fi if test -n "$ac_config_headers"; then echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS fi if test -n "$ac_config_links"; then echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS fi if test -n "$ac_config_commands"; then echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS fi cat >>$CONFIG_STATUS <<\_ACEOF ac_cs_usage="\ \`$as_me' instantiates files from templates according to the current configuration. Usage: $0 [OPTIONS] [FILE]... -h, --help print this help, then exit -V, --version print version number, then exit -q, --quiet do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration files: $config_files Configuration headers: $config_headers Configuration commands: $config_commands Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ config.status configured by $0, generated by GNU Autoconf 2.59, with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" Copyright (C) 2003 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." srcdir=$srcdir INSTALL="$INSTALL" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # If no file are specified by the user, then we need to provide default # value. By we need to know if files were specified by the user. ac_need_defaults=: while test $# != 0 do case $1 in --*=*) ac_option=`expr "x$1" : 'x\([^=]*\)='` ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'` ac_shift=: ;; -*) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; *) # This is not an option, so the user has probably given explicit # arguments. ac_option=$1 ac_need_defaults=false;; esac case $ac_option in # Handling of the options. _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --vers* | -V ) echo "$ac_cs_version"; exit 0 ;; --he | --h) # Conflict between --help and --header { { echo "$as_me:$LINENO: error: ambiguous option: $1 Try \`$0 --help' for more information." >&5 echo "$as_me: error: ambiguous option: $1 Try \`$0 --help' for more information." >&2;} { (exit 1); exit 1; }; };; --help | --hel | -h ) echo "$ac_cs_usage"; exit 0 ;; --debug | --d* | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift CONFIG_FILES="$CONFIG_FILES $ac_optarg" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" ac_need_defaults=false;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1 Try \`$0 --help' for more information." >&5 echo "$as_me: error: unrecognized option: $1 Try \`$0 --help' for more information." >&2;} { (exit 1); exit 1; }; } ;; *) ac_config_targets="$ac_config_targets $1" ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF if \$ac_cs_recheck; then echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF # # INIT-COMMANDS section. # AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF for ac_config_target in $ac_config_targets do case "$ac_config_target" in # Handling of arguments. "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;; "dia2code/Makefile" ) CONFIG_FILES="$CONFIG_FILES dia2code/Makefile" ;; "dia2code/docs/Makefile" ) CONFIG_FILES="$CONFIG_FILES dia2code/docs/Makefile" ;; "dia2code/docs/en/Makefile" ) CONFIG_FILES="$CONFIG_FILES dia2code/docs/en/Makefile" ;; "depfiles" ) CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason to put it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Create a temporary directory, and hook for its removal unless debugging. $debug || { trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0 trap '{ (exit 1); exit 1; }' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { tmp=./confstat$$-$RANDOM (umask 077 && mkdir $tmp) } || { echo "$me: cannot create a temporary directory in ." >&2 { (exit 1); exit 1; } } _ACEOF cat >>$CONFIG_STATUS <<_ACEOF # # CONFIG_FILES section. # # No need to generate the scripts if there are no CONFIG_FILES. # This happens for instance when ./config.status config.h if test -n "\$CONFIG_FILES"; then # Protect against being on the right side of a sed subst in config.status. sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g; s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF s,@SHELL@,$SHELL,;t t s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t s,@exec_prefix@,$exec_prefix,;t t s,@prefix@,$prefix,;t t s,@program_transform_name@,$program_transform_name,;t t s,@bindir@,$bindir,;t t s,@sbindir@,$sbindir,;t t s,@libexecdir@,$libexecdir,;t t s,@datadir@,$datadir,;t t s,@sysconfdir@,$sysconfdir,;t t s,@sharedstatedir@,$sharedstatedir,;t t s,@localstatedir@,$localstatedir,;t t s,@libdir@,$libdir,;t t s,@includedir@,$includedir,;t t s,@oldincludedir@,$oldincludedir,;t t s,@infodir@,$infodir,;t t s,@mandir@,$mandir,;t t s,@build_alias@,$build_alias,;t t s,@host_alias@,$host_alias,;t t s,@target_alias@,$target_alias,;t t s,@DEFS@,$DEFS,;t t s,@ECHO_C@,$ECHO_C,;t t s,@ECHO_N@,$ECHO_N,;t t s,@ECHO_T@,$ECHO_T,;t t s,@LIBS@,$LIBS,;t t s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t s,@INSTALL_DATA@,$INSTALL_DATA,;t t s,@CYGPATH_W@,$CYGPATH_W,;t t s,@PACKAGE@,$PACKAGE,;t t s,@VERSION@,$VERSION,;t t s,@ACLOCAL@,$ACLOCAL,;t t s,@AUTOCONF@,$AUTOCONF,;t t s,@AUTOMAKE@,$AUTOMAKE,;t t s,@AUTOHEADER@,$AUTOHEADER,;t t s,@MAKEINFO@,$MAKEINFO,;t t s,@AMTAR@,$AMTAR,;t t s,@install_sh@,$install_sh,;t t s,@STRIP@,$STRIP,;t t s,@ac_ct_STRIP@,$ac_ct_STRIP,;t t s,@INSTALL_STRIP_PROGRAM@,$INSTALL_STRIP_PROGRAM,;t t s,@AWK@,$AWK,;t t s,@SET_MAKE@,$SET_MAKE,;t t s,@CC@,$CC,;t t s,@CFLAGS@,$CFLAGS,;t t s,@LDFLAGS@,$LDFLAGS,;t t s,@CPPFLAGS@,$CPPFLAGS,;t t s,@ac_ct_CC@,$ac_ct_CC,;t t s,@EXEEXT@,$EXEEXT,;t t s,@OBJEXT@,$OBJEXT,;t t s,@DEPDIR@,$DEPDIR,;t t s,@am__include@,$am__include,;t t s,@am__quote@,$am__quote,;t t s,@AMDEP_TRUE@,$AMDEP_TRUE,;t t s,@AMDEP_FALSE@,$AMDEP_FALSE,;t t s,@AMDEPBACKSLASH@,$AMDEPBACKSLASH,;t t s,@CCDEPMODE@,$CCDEPMODE,;t t s,@am__fastdepCC_TRUE@,$am__fastdepCC_TRUE,;t t s,@am__fastdepCC_FALSE@,$am__fastdepCC_FALSE,;t t s,@RANLIB@,$RANLIB,;t t s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t s,@XML_CONFIG@,$XML_CONFIG,;t t s,@XML_INCLUDES@,$XML_INCLUDES,;t t s,@CPP@,$CPP,;t t s,@EGREP@,$EGREP,;t t s,@LIBOBJS@,$LIBOBJS,;t t s,@LTLIBOBJS@,$LTLIBOBJS,;t t CEOF _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # Split the substitutions into bite-sized pieces for seds with # small command number limits, like on Digital OSF/1 and HP-UX. ac_max_sed_lines=48 ac_sed_frag=1 # Number of current file. ac_beg=1 # First line for current file. ac_end=$ac_max_sed_lines # Line after last line for current file. ac_more_lines=: ac_sed_cmds= while $ac_more_lines; do if test $ac_beg -gt 1; then sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag else sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag fi if test ! -s $tmp/subs.frag; then ac_more_lines=false else # The purpose of the label and of the branching condition is to # speed up the sed processing (if there are no `@' at all, there # is no need to browse any of the substitutions). # These are the two extra sed commands mentioned above. (echo ':t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed if test -z "$ac_sed_cmds"; then ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed" else ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed" fi ac_sed_frag=`expr $ac_sed_frag + 1` ac_beg=$ac_end ac_end=`expr $ac_end + $ac_max_sed_lines` fi done if test -z "$ac_sed_cmds"; then ac_sed_cmds=cat fi fi # test -n "$CONFIG_FILES" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". case $ac_file in - | *:- | *:-:* ) # input from stdin cat >$tmp/stdin ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; * ) ac_file_in=$ac_file.in ;; esac # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories. ac_dir=`(dirname "$ac_file") 2>/dev/null || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` { if $as_mkdir_p; then mkdir -p "$ac_dir" else as_dir="$ac_dir" as_dirs= while test ! -d "$as_dir"; do as_dirs="$as_dir $as_dirs" as_dir=`(dirname "$as_dir") 2>/dev/null || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` done test ! -n "$as_dirs" || mkdir $as_dirs fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} { (exit 1); exit 1; }; }; } ac_builddir=. if test "$ac_dir" != .; then ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A "../" for each directory in $ac_dir_suffix. ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` else ac_dir_suffix= ac_top_builddir= fi case $srcdir in .) # No --srcdir option. We are building in place. ac_srcdir=. if test -z "$ac_top_builddir"; then ac_top_srcdir=. else ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` fi ;; [\\/]* | ?:[\\/]* ) # Absolute path. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ;; *) # Relative path. ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_builddir$srcdir ;; esac # Do not use `cd foo && pwd` to compute absolute paths, because # the directories may not exist. case `pwd` in .) ac_abs_builddir="$ac_dir";; *) case "$ac_dir" in .) ac_abs_builddir=`pwd`;; [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; *) ac_abs_builddir=`pwd`/"$ac_dir";; esac;; esac case $ac_abs_builddir in .) ac_abs_top_builddir=${ac_top_builddir}.;; *) case ${ac_top_builddir}. in .) ac_abs_top_builddir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; esac;; esac case $ac_abs_builddir in .) ac_abs_srcdir=$ac_srcdir;; *) case $ac_srcdir in .) ac_abs_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; esac;; esac case $ac_abs_builddir in .) ac_abs_top_srcdir=$ac_top_srcdir;; *) case $ac_top_srcdir in .) ac_abs_top_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; esac;; esac case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_builddir$INSTALL ;; esac if test x"$ac_file" != x-; then { echo "$as_me:$LINENO: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} rm -f "$ac_file" fi # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ if test x"$ac_file" = x-; then configure_input= else configure_input="$ac_file. " fi configure_input=$configure_input"Generated from `echo $ac_file_in | sed 's,.*/,,'` by configure." # First look for the input files in the build tree, otherwise in the # src tree. ac_file_inputs=`IFS=: for f in $ac_file_in; do case $f in -) echo $tmp/stdin ;; [\\/$]*) # Absolute (can't be DOS-style, as IFS=:) test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } echo "$f";; *) # Relative if test -f "$f"; then # Build tree echo "$f" elif test -f "$srcdir/$f"; then # Source tree echo "$srcdir/$f" else # /dev/null tree { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } fi;; esac done` || { (exit 1); exit 1; } _ACEOF cat >>$CONFIG_STATUS <<_ACEOF sed "$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s,@configure_input@,$configure_input,;t t s,@srcdir@,$ac_srcdir,;t t s,@abs_srcdir@,$ac_abs_srcdir,;t t s,@top_srcdir@,$ac_top_srcdir,;t t s,@abs_top_srcdir@,$ac_abs_top_srcdir,;t t s,@builddir@,$ac_builddir,;t t s,@abs_builddir@,$ac_abs_builddir,;t t s,@top_builddir@,$ac_top_builddir,;t t s,@abs_top_builddir@,$ac_abs_top_builddir,;t t s,@INSTALL@,$ac_INSTALL,;t t " $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out rm -f $tmp/stdin if test x"$ac_file" != x-; then mv $tmp/out $ac_file else cat $tmp/out rm -f $tmp/out fi done _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # # CONFIG_HEADER section. # # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where # NAME is the cpp macro being defined and VALUE is the value it is being given. # # ac_d sets the value in "#define NAME VALUE" lines. ac_dA='s,^\([ ]*\)#\([ ]*define[ ][ ]*\)' ac_dB='[ ].*$,\1#\2' ac_dC=' ' ac_dD=',;t' # ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE". ac_uA='s,^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' ac_uB='$,\1#\2define\3' ac_uC=' ' ac_uD=',;t' for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". case $ac_file in - | *:- | *:-:* ) # input from stdin cat >$tmp/stdin ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; * ) ac_file_in=$ac_file.in ;; esac test x"$ac_file" != x- && { echo "$as_me:$LINENO: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} # First look for the input files in the build tree, otherwise in the # src tree. ac_file_inputs=`IFS=: for f in $ac_file_in; do case $f in -) echo $tmp/stdin ;; [\\/$]*) # Absolute (can't be DOS-style, as IFS=:) test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } # Do quote $f, to prevent DOS paths from being IFS'd. echo "$f";; *) # Relative if test -f "$f"; then # Build tree echo "$f" elif test -f "$srcdir/$f"; then # Source tree echo "$srcdir/$f" else # /dev/null tree { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } fi;; esac done` || { (exit 1); exit 1; } # Remove the trailing spaces. sed 's/[ ]*$//' $ac_file_inputs >$tmp/in _ACEOF # Transform confdefs.h into two sed scripts, `conftest.defines' and # `conftest.undefs', that substitutes the proper values into # config.h.in to produce config.h. The first handles `#define' # templates, and the second `#undef' templates. # And first: Protect against being on the right side of a sed subst in # config.status. Protect against being in an unquoted here document # in config.status. rm -f conftest.defines conftest.undefs # Using a here document instead of a string reduces the quoting nightmare. # Putting comments in sed scripts is not portable. # # `end' is used to avoid that the second main sed command (meant for # 0-ary CPP macros) applies to n-ary macro definitions. # See the Autoconf documentation for `clear'. cat >confdef2sed.sed <<\_ACEOF s/[\\&,]/\\&/g s,[\\$`],\\&,g t clear : clear s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*\)\(([^)]*)\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1\2${ac_dC}\3${ac_dD},gp t end s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD},gp : end _ACEOF # If some macros were called several times there might be several times # the same #defines, which is useless. Nevertheless, we may not want to # sort them, since we want the *last* AC-DEFINE to be honored. uniq confdefs.h | sed -n -f confdef2sed.sed >conftest.defines sed 's/ac_d/ac_u/g' conftest.defines >conftest.undefs rm -f confdef2sed.sed # This sed command replaces #undef with comments. This is necessary, for # example, in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. cat >>conftest.undefs <<\_ACEOF s,^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */, _ACEOF # Break up conftest.defines because some shells have a limit on the size # of here documents, and old seds have small limits too (100 cmds). echo ' # Handle all the #define templates only if necessary.' >>$CONFIG_STATUS echo ' if grep "^[ ]*#[ ]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS echo ' # If there are no defines, we may have an empty if/fi' >>$CONFIG_STATUS echo ' :' >>$CONFIG_STATUS rm -f conftest.tail while grep . conftest.defines >/dev/null do # Write a limited-size here document to $tmp/defines.sed. echo ' cat >$tmp/defines.sed <>$CONFIG_STATUS # Speed up: don't consider the non `#define' lines. echo '/^[ ]*#[ ]*define/!b' >>$CONFIG_STATUS # Work around the forget-to-reset-the-flag bug. echo 't clr' >>$CONFIG_STATUS echo ': clr' >>$CONFIG_STATUS sed ${ac_max_here_lines}q conftest.defines >>$CONFIG_STATUS echo 'CEOF sed -f $tmp/defines.sed $tmp/in >$tmp/out rm -f $tmp/in mv $tmp/out $tmp/in ' >>$CONFIG_STATUS sed 1,${ac_max_here_lines}d conftest.defines >conftest.tail rm -f conftest.defines mv conftest.tail conftest.defines done rm -f conftest.defines echo ' fi # grep' >>$CONFIG_STATUS echo >>$CONFIG_STATUS # Break up conftest.undefs because some shells have a limit on the size # of here documents, and old seds have small limits too (100 cmds). echo ' # Handle all the #undef templates' >>$CONFIG_STATUS rm -f conftest.tail while grep . conftest.undefs >/dev/null do # Write a limited-size here document to $tmp/undefs.sed. echo ' cat >$tmp/undefs.sed <>$CONFIG_STATUS # Speed up: don't consider the non `#undef' echo '/^[ ]*#[ ]*undef/!b' >>$CONFIG_STATUS # Work around the forget-to-reset-the-flag bug. echo 't clr' >>$CONFIG_STATUS echo ': clr' >>$CONFIG_STATUS sed ${ac_max_here_lines}q conftest.undefs >>$CONFIG_STATUS echo 'CEOF sed -f $tmp/undefs.sed $tmp/in >$tmp/out rm -f $tmp/in mv $tmp/out $tmp/in ' >>$CONFIG_STATUS sed 1,${ac_max_here_lines}d conftest.undefs >conftest.tail rm -f conftest.undefs mv conftest.tail conftest.undefs done rm -f conftest.undefs cat >>$CONFIG_STATUS <<\_ACEOF # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ if test x"$ac_file" = x-; then echo "/* Generated by configure. */" >$tmp/config.h else echo "/* $ac_file. Generated by configure. */" >$tmp/config.h fi cat $tmp/in >>$tmp/config.h rm -f $tmp/in if test x"$ac_file" != x-; then if diff $ac_file $tmp/config.h >/dev/null 2>&1; then { echo "$as_me:$LINENO: $ac_file is unchanged" >&5 echo "$as_me: $ac_file is unchanged" >&6;} else ac_dir=`(dirname "$ac_file") 2>/dev/null || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` { if $as_mkdir_p; then mkdir -p "$ac_dir" else as_dir="$ac_dir" as_dirs= while test ! -d "$as_dir"; do as_dirs="$as_dir $as_dirs" as_dir=`(dirname "$as_dir") 2>/dev/null || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` done test ! -n "$as_dirs" || mkdir $as_dirs fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} { (exit 1); exit 1; }; }; } rm -f $ac_file mv $tmp/config.h $ac_file fi else cat $tmp/config.h rm -f $tmp/config.h fi _am_stamp_count=`expr ${_am_stamp_count-0} + 1` echo "timestamp for $ac_file" >`(dirname $ac_file) 2>/dev/null || $as_expr X$ac_file : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X$ac_file : 'X\(//\)[^/]' \| \ X$ac_file : 'X\(//\)$' \| \ X$ac_file : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X$ac_file | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'`/stamp-h$_am_stamp_count done _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # # CONFIG_COMMANDS section. # for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue ac_dest=`echo "$ac_file" | sed 's,:.*,,'` ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_dir=`(dirname "$ac_dest") 2>/dev/null || $as_expr X"$ac_dest" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_dest" : 'X\(//\)[^/]' \| \ X"$ac_dest" : 'X\(//\)$' \| \ X"$ac_dest" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$ac_dest" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` { if $as_mkdir_p; then mkdir -p "$ac_dir" else as_dir="$ac_dir" as_dirs= while test ! -d "$as_dir"; do as_dirs="$as_dir $as_dirs" as_dir=`(dirname "$as_dir") 2>/dev/null || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` done test ! -n "$as_dirs" || mkdir $as_dirs fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} { (exit 1); exit 1; }; }; } ac_builddir=. if test "$ac_dir" != .; then ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A "../" for each directory in $ac_dir_suffix. ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` else ac_dir_suffix= ac_top_builddir= fi case $srcdir in .) # No --srcdir option. We are building in place. ac_srcdir=. if test -z "$ac_top_builddir"; then ac_top_srcdir=. else ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` fi ;; [\\/]* | ?:[\\/]* ) # Absolute path. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ;; *) # Relative path. ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_builddir$srcdir ;; esac # Do not use `cd foo && pwd` to compute absolute paths, because # the directories may not exist. case `pwd` in .) ac_abs_builddir="$ac_dir";; *) case "$ac_dir" in .) ac_abs_builddir=`pwd`;; [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; *) ac_abs_builddir=`pwd`/"$ac_dir";; esac;; esac case $ac_abs_builddir in .) ac_abs_top_builddir=${ac_top_builddir}.;; *) case ${ac_top_builddir}. in .) ac_abs_top_builddir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; esac;; esac case $ac_abs_builddir in .) ac_abs_srcdir=$ac_srcdir;; *) case $ac_srcdir in .) ac_abs_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; esac;; esac case $ac_abs_builddir in .) ac_abs_top_srcdir=$ac_top_srcdir;; *) case $ac_top_srcdir in .) ac_abs_top_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; esac;; esac { echo "$as_me:$LINENO: executing $ac_dest commands" >&5 echo "$as_me: executing $ac_dest commands" >&6;} case $ac_dest in depfiles ) test x"$AMDEP_TRUE" != x"" || for mf in $CONFIG_FILES; do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named `Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # So let's grep whole file. if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then dirpart=`(dirname "$mf") 2>/dev/null || $as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$mf" : 'X\(//\)[^/]' \| \ X"$mf" : 'X\(//\)$' \| \ X"$mf" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$mf" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` else continue fi grep '^DEP_FILES *= *[^ #]' < "$mf" > /dev/null || continue # Extract the definition of DEP_FILES from the Makefile without # running `make'. DEPDIR=`sed -n -e '/^DEPDIR = / s///p' < "$mf"` test -z "$DEPDIR" && continue # When using ansi2knr, U may be empty or an underscore; expand it U=`sed -n -e '/^U = / s///p' < "$mf"` test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR" # We invoke sed twice because it is the simplest approach to # changing $(DEPDIR) to its actual value in the expansion. for file in `sed -n -e ' /^DEP_FILES = .*\\\\$/ { s/^DEP_FILES = // :loop s/\\\\$// p n /\\\\$/ b loop p } /^DEP_FILES = / s/^DEP_FILES = //p' < "$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`(dirname "$file") 2>/dev/null || $as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$file" : 'X\(//\)[^/]' \| \ X"$file" : 'X\(//\)$' \| \ X"$file" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` { if $as_mkdir_p; then mkdir -p $dirpart/$fdir else as_dir=$dirpart/$fdir as_dirs= while test ! -d "$as_dir"; do as_dirs="$as_dir $as_dirs" as_dir=`(dirname "$as_dir") 2>/dev/null || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` done test ! -n "$as_dirs" || mkdir $as_dirs fi || { { echo "$as_me:$LINENO: error: cannot create directory $dirpart/$fdir" >&5 echo "$as_me: error: cannot create directory $dirpart/$fdir" >&2;} { (exit 1); exit 1; }; }; } # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done ;; esac done _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF { (exit 0); exit 0; } _ACEOF chmod +x $CONFIG_STATUS ac_clean_files=$ac_clean_files_save # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || { (exit 1); exit 1; } fi dia2code-0.8.3/dia2code.lsm0100644000076400001440000000062607457104214014743 0ustar kelloggusersBegin3 Title: Dia2Code Version: 0.8 Entered-date: Description: Keywords: Author: Javier O'Hara Maintained-by: Javier O'Hara Primary-site: Home-page: http://sourceforge.net/projects/dia2code Original-site: Platforms: Linux and other Unices Copying-policy: GNU Public License End dia2code-0.8.3/dia2code.nsi0100644000076400001440000001064407457104215014743 0ustar kelloggusers; dia2code ; Win32 Installer Source Code for NSIS 1.44 ; (c) 2001 Steffen Macke ; *************************************************************************** ; * * ; * This program is free software; you can redistribute it and/or modify * ; * it under the terms of the GNU General Public License as published by * ; * the Free Software Foundation; either version 2 of the License, or * ; * (at your option) any later version. * ; * * ; *************************************************************************** Name "dia2code 0.7" LicenseText "Please read and agree to this license before continuiung." LicenseData COPYING ComponentText "This will install dia2code 0.7 on your system. Select which options you want set up." DirText "Select a directory to install the program in." UninstallText "This will uninstall the dia2code 0.7. Hit Next to uninstall, or Cancel to cancel." UninstallExeName uninstall-dia2code-0.7.exe OutFile dia2code-0.7-setup.exe InstallDir $PROGRAMFILES\dia2code Icon dia.ico EnabledBitmap dia1.bmp DisabledBitmap dia2.bmp InstType Typical InstallDirRegKey HKEY_LOCAL_MACHINE "Software\dia2code" "instpath" SetOverwrite on Section "dia2code 0.7" SetOutPath $INSTDIR File COPYING File README File README.win32 SetOutPath $INSTDIR\bin File dia2code\dia2code.exe File dia2code\libxml2.dll WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\dia2code" "DisplayName" "dia2code 0.7 (remove only)" WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\dia2code" "UninstallString" '"$INSTDIR\uninstall-dia2code-0.7.exe"' WriteRegStr HKEY_CLASSES_ROOT "diaFile\Shell\DefaultIcon" "" "$INSTDIR\bin\dia.exe" WriteRegStr HKEY_LOCAL_MACHINE "Software\dia2code" "instpath" $INSTDIR SectionEnd Section "Context Menu Entries" SectionIn 1 WriteRegStr HKEY_CLASSES_ROOT ".dia" "" "diaFile" WriteRegStr HKEY_CLASSES_ROOT ".dia" "Content Type" "application/dia" WriteRegStr HKEY_CLASSES_ROOT "diaFile" "" "diaFile" WriteRegBin HKEY_CLASSES_ROOT "diaFile" "EditFlags" 00000100 WriteRegStr HKEY_CLASSES_ROOT "diaFile\Shell\createsql" "" "Create SQL definition" WriteRegStr HKEY_CLASSES_ROOT "diaFile\Shell\createsql\command" "" '"$INSTDIR\bin\dia2code.exe" -t sql "%1"' WriteRegStr HKEY_CLASSES_ROOT "diaFile\Shell\createc" "" "Create C code" WriteRegStr HKEY_CLASSES_ROOT "diaFile\Shell\createc\command" "" '"$INSTDIR\bin\dia2code.exe" -t c "%1"' WriteRegStr HKEY_CLASSES_ROOT "diaFile\Shell\createcpp" "" "Create C++ code" WriteRegStr HKEY_CLASSES_ROOT "diaFile\Shell\createcpp\command" "" '"$INSTDIR\bin\dia2code.exe" -t cpp "%1"' WriteRegStr HKEY_CLASSES_ROOT "diaFile\Shell\createjava" "" "Create Java code" WriteRegStr HKEY_CLASSES_ROOT "diaFile\Shell\createjava\command" "" '"$INSTDIR\bin\dia2code.exe" -t java "%1"' WriteRegStr HKEY_CLASSES_ROOT "diaFile\Shell\createada" "" "Create ADA code" WriteRegStr HKEY_CLASSES_ROOT "diaFile\Shell\createada\command" "" '"$INSTDIR\bin\dia2code.exe" -t ada "%1"' WriteRegStr HKEY_CLASSES_ROOT "diaFile\Shell\createpython" "" "Create Python code" WriteRegStr HKEY_CLASSES_ROOT "diaFile\Shell\createpython\command" "" '"$INSTDIR\bin\dia2code.exe" -t python "%1"' SectionEnd Section "Start Menu Entries" SectionIn 1 SetOutPath "$SMPROGRAMS\dia2code" File "dia2code Homepage.url" File "Report a Bug.url" File /oname=README.txt README File /oname=README.win32.txt README.win32 SetOutPath $INSTDIR\bin CreateShortCut "$SMPROGRAMS\dia2code\Uninstall dia2code 0.7.lnk" "$INSTDIR\uninstall-dia2code-0.7.exe" "" "" 0 SectionEnd Section Uninstall Delete $INSTDIR\bin\dia2code.exe Delete $INSTDIR\bin\libxml2.dll RMDir $INSTDIR\bin Delete $INSTDIR\COPYING Delete $INSTDIR\README Delete $INSTDIR\README.win32 Delete $INSTDIR\uninstall-dia2code-0.7.exe RMDir $INSTDIR Delete "$SMPROGRAMS\dia2code\*.*" RMDir "$SMPROGRAMS\dia2code" DeleteRegValue HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\dia2code" "UninstallString" DeleteRegValue HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\dia2code" "DisplayName" DeleteRegKey HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\dia2code" SectionEnd dia2code-0.8.3/runtime/0040755000076400001440000000000010547513420014233 5ustar kelloggusersdia2code-0.8.3/runtime/cpp/0040755000076400001440000000000010547513420015015 5ustar kelloggusersdia2code-0.8.3/runtime/cpp/p_orb.h0100644000076400001440000000600607576416303016300 0ustar kelloggusers// p_orb.h -- Shield against CORBA system dependencies of C++ ORBs // // Based on the paper "Portability of C++ CORBA Applications" // by Ciaran McHale: // http://www.iona.com/devcenter/corba/portability_cpp_corba.pdf // // The name of the ORB system CORBA include file (the file where // basic CORBA types such as CORBA::Boolean etc. are defined) // is not standardized, and each ORB names this file differently. // For portability, just #include "p_orb.h". // // Currently following ORBs are supported: // // * ORBIX (http://www.iona.com/) // In order to use this configuration, define a C preprocessor symbol // named P_USE_ORBIX. // // * ORBacus (http://www.orbacus.com/) // In order to use this configuration, define a C preprocessor symbol // named P_USE_ORBACUS. // // * VisiBroker (http://www.borland.com/) // In order to use this configuration, define a C preprocessor symbol // named P_USE_VISIBROKER. // // * omniORB4 (http://omniorb.sourceforge.net/) // In order to use this configuration, define a C preprocessor symbol // named P_USE_OMNIORB. // // * MICO (http://www.mico.org/) // In order to use this configuration, define a C preprocessor symbol // named P_USE_MICO. // // * TAO (http://www.cs.wustl.edu/~schmidt/TAO.html) // In order to use this configuration, define a C preprocessor symbol // named P_USE_TAO. // // * ORBit-C++ (http://orbitcpp.sourceforge.net/) // In order to use this configuration, define a C preprocessor // symbol named P_USE_ORBITCPP. // // [...] Add others here [...] // // * No CORBA ORB // In order to use this configuration, define a C preprocessor // symbol named P_USE_NONE. // This configuration only supports the primitive IDL data types // excluding sequence, bounded string, and any. // It does not support any ORB operations. // #ifndef P_ORB_H_ #define P_ORB_H_ #if defined (P_USE_ORBIX) #include #elif defined (P_USE_ORBACUS) #include #elif defined (P_USE_VISIBROKER) #include #elif defined (P_USE_OMNIORB) # include #elif defined (P_USE_MICO) # include #elif defined (P_USE_TAO) # include namespace CORBA { typedef char* String; // For some reason this is missing in corbafwd. }; #elif defined (P_USE_ORBITCPP) # include /********** Add other ORB configurations here. **************/ #elif defined (P_USE_NONE) // If P_USE_NONE is defined then we use a minimal CORBA spec. namespace CORBA { typedef bool Boolean; typedef unsigned char Octet; typedef char Char; typedef short Short; typedef unsigned short UShort; typedef int Long; typedef unsigned int ULong; typedef long long LongLong; typedef unsigned long long ULongLong; typedef float Float; typedef double Double; typedef char * String; }; #else # error "ORB system not defined" #endif #endif // P_ORB_H_ dia2code-0.8.3/runtime/README0100644000076400001440000000015307576416303015121 0ustar kelloggusersThis directory contains subdirectories for languages for which the generated code required support files. dia2code-0.8.3/configure.in0100644000076400001440000000161710547512631015066 0ustar kelloggusersdnl Process this file with autoconf to produce a configure script. AC_INIT(Makefile.am) AM_CONFIG_HEADER(config.h) AM_INIT_AUTOMAKE(dia2code,0.8.3) dnl Checks for programs. AC_PROG_CC AC_PROG_RANLIB dnl Checks for libraries. AC_PATH_PROG(XML_CONFIG, xml2-config, no) if test "$XML_CONFIG" = "no"; then AC_MSG_ERROR([Cannot determine configuration of libxml. Perhaps you forgot to install the package libxml2-devel ?]) else XML_INCLUDES=`$XML_CONFIG --cflags` LIBXML_LIBS=`$XML_CONFIG --libs` AC_SUBST(XML_INCLUDES) LIBS="$LIBS $LIBXML_LIBS" fi dnl Checks for header files. AC_CHECK_HEADERS(dlfcn.h) AC_CHECK_LIB(dl, dlopen,[LDFLAGS="$LDFLAGS -rdynamic"; LIBS="$LIBS -ldl"; CPPFLAGS="$CPPFLAGS -DDSO"]) dnl Checks for typedefs, structures, and compiler characteristics. dnl Checks for library functions. AC_OUTPUT(Makefile dia2code/Makefile dia2code/docs/Makefile dia2code/docs/en/Makefile ) dia2code-0.8.3/install-sh0100755000076400001440000001272007457104212014554 0ustar kelloggusers#!/bin/sh # # install - install a program, script, or datafile # This comes from X11R5 (mit/util/scripts/install.sh). # # Copyright 1991 by the Massachusetts Institute of Technology # # Permission to use, copy, modify, distribute, and sell this software and its # documentation for any purpose is hereby granted without fee, provided that # the above copyright notice appear in all copies and that both that # copyright notice and this permission notice appear in supporting # documentation, and that the name of M.I.T. not be used in advertising or # publicity pertaining to distribution of the software without specific, # written prior permission. M.I.T. makes no representations about the # suitability of this software for any purpose. It is provided "as is" # without express or implied warranty. # # Calling this script install-sh is preferred over install.sh, to prevent # `make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. It can only install one file at a time, a restriction # shared with many OS's install programs. # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit="${DOITPROG-}" # put in absolute paths if you don't have them in your path; or use env. vars. mvprog="${MVPROG-mv}" cpprog="${CPPROG-cp}" chmodprog="${CHMODPROG-chmod}" chownprog="${CHOWNPROG-chown}" chgrpprog="${CHGRPPROG-chgrp}" stripprog="${STRIPPROG-strip}" rmprog="${RMPROG-rm}" mkdirprog="${MKDIRPROG-mkdir}" transformbasename="" transform_arg="" instcmd="$mvprog" chmodcmd="$chmodprog 0755" chowncmd="" chgrpcmd="" stripcmd="" rmcmd="$rmprog -f" mvcmd="$mvprog" src="" dst="" dir_arg="" while [ x"$1" != x ]; do case $1 in -c) instcmd="$cpprog" shift continue;; -d) dir_arg=true shift continue;; -m) chmodcmd="$chmodprog $2" shift shift continue;; -o) chowncmd="$chownprog $2" shift shift continue;; -g) chgrpcmd="$chgrpprog $2" shift shift continue;; -s) stripcmd="$stripprog" shift continue;; -t=*) transformarg=`echo $1 | sed 's/-t=//'` shift continue;; -b=*) transformbasename=`echo $1 | sed 's/-b=//'` shift continue;; *) if [ x"$src" = x ] then src=$1 else # this colon is to work around a 386BSD /bin/sh bug : dst=$1 fi shift continue;; esac done if [ x"$src" = x ] then echo "install: no input file specified" exit 1 else true fi if [ x"$dir_arg" != x ]; then dst=$src src="" if [ -d $dst ]; then instcmd=: else instcmd=mkdir fi else # Waiting for this to be detected by the "$instcmd $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if [ -f $src -o -d $src ] then true else echo "install: $src does not exist" exit 1 fi if [ x"$dst" = x ] then echo "install: no destination specified" exit 1 else true fi # If destination is a directory, append the input filename; if your system # does not like double slashes in filenames, you may need to add some logic if [ -d $dst ] then dst="$dst"/`basename $src` else true fi fi ## this sed command emulates the dirname command dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` # Make sure that the destination directory exists. # this part is taken from Noah Friedman's mkinstalldirs script # Skip lots of stat calls in the usual case. if [ ! -d "$dstdir" ]; then defaultIFS=' ' IFS="${IFS-${defaultIFS}}" oIFS="${IFS}" # Some sh's can't handle IFS=/ for some reason. IFS='%' set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'` IFS="${oIFS}" pathcomp='' while [ $# -ne 0 ] ; do pathcomp="${pathcomp}${1}" shift if [ ! -d "${pathcomp}" ] ; then $mkdirprog "${pathcomp}" else true fi pathcomp="${pathcomp}/" done fi if [ x"$dir_arg" != x ] then $doit $instcmd $dst && if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi && if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi && if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi && if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi else # If we're going to rename the final executable, determine the name now. if [ x"$transformarg" = x ] then dstfile=`basename $dst` else dstfile=`basename $dst $transformbasename | sed $transformarg`$transformbasename fi # don't allow the sed command to completely eliminate the filename if [ x"$dstfile" = x ] then dstfile=`basename $dst` else true fi # Make a temp file name in the proper directory. dsttmp=$dstdir/#inst.$$# # Move or copy the file name to the temp name $doit $instcmd $src $dsttmp && trap "rm -f ${dsttmp}" 0 && # and set any options; do chmod last to preserve setuid bits # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $instcmd $src $dsttmp" command. if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi && if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi && if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi && if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi && # Now rename the file to the real destination. $doit $rmcmd -f $dstdir/$dstfile && $doit $mvcmd $dsttmp $dstdir/$dstfile fi && exit 0 dia2code-0.8.3/missing0100644000076400001440000002453310531246402014144 0ustar kelloggusers#! /bin/sh # Common stub for a few missing GNU programs while installing. scriptversion=2004-09-07.08 # Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004 # Free Software Foundation, Inc. # Originally by Fran,cois Pinard , 1996. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. if test $# -eq 0; then echo 1>&2 "Try \`$0 --help' for more information" exit 1 fi run=: # In the cases where this matters, `missing' is being run in the # srcdir already. if test -f configure.ac; then configure_ac=configure.ac else configure_ac=configure.in fi msg="missing on your system" case "$1" in --run) # Try to run requested program, and just exit if it succeeds. run= shift "$@" && exit 0 # Exit code 63 means version mismatch. This often happens # when the user try to use an ancient version of a tool on # a file that requires a minimum version. In this case we # we should proceed has if the program had been absent, or # if --run hadn't been passed. if test $? = 63; then run=: msg="probably too old" fi ;; -h|--h|--he|--hel|--help) echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an error status if there is no known handling for PROGRAM. Options: -h, --help display this help and exit -v, --version output version information and exit --run try to run the given command, and emulate it if it fails Supported PROGRAM values: aclocal touch file \`aclocal.m4' autoconf touch file \`configure' autoheader touch file \`config.h.in' automake touch all \`Makefile.in' files bison create \`y.tab.[ch]', if possible, from existing .[ch] flex create \`lex.yy.c', if possible, from existing .c help2man touch the output file lex create \`lex.yy.c', if possible, from existing .c makeinfo touch the output file tar try tar, gnutar, gtar, then tar without non-portable flags yacc create \`y.tab.[ch]', if possible, from existing .[ch] Send bug reports to ." exit 0 ;; -v|--v|--ve|--ver|--vers|--versi|--versio|--version) echo "missing $scriptversion (GNU Automake)" exit 0 ;; -*) echo 1>&2 "$0: Unknown \`$1' option" echo 1>&2 "Try \`$0 --help' for more information" exit 1 ;; esac # Now exit if we have it, but it failed. Also exit now if we # don't have it and --version was passed (most likely to detect # the program). case "$1" in lex|yacc) # Not GNU programs, they don't have --version. ;; tar) if test -n "$run"; then echo 1>&2 "ERROR: \`tar' requires --run" exit 1 elif test "x$2" = "x--version" || test "x$2" = "x--help"; then exit 1 fi ;; *) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 elif test "x$2" = "x--version" || test "x$2" = "x--help"; then # Could not run --version or --help. This is probably someone # running `$TOOL --version' or `$TOOL --help' to check whether # $TOOL exists and not knowing $TOOL uses missing. exit 1 fi ;; esac # If it does not exist, or fails to run (possibly an outdated version), # try to emulate it. case "$1" in aclocal*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`acinclude.m4' or \`${configure_ac}'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." touch aclocal.m4 ;; autoconf) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`${configure_ac}'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." touch configure ;; autoheader) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`acconfig.h' or \`${configure_ac}'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}` test -z "$files" && files="config.h" touch_files= for f in $files; do case "$f" in *:*) touch_files="$touch_files "`echo "$f" | sed -e 's/^[^:]*://' -e 's/:.*//'`;; *) touch_files="$touch_files $f.in";; esac done touch $touch_files ;; automake*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." find . -type f -name Makefile.am -print | sed 's/\.am$/.in/' | while read f; do touch "$f"; done ;; autom4te) echo 1>&2 "\ WARNING: \`$1' is needed, but is $msg. You might have modified some files without having the proper tools for further handling them. You can get \`$1' as part of \`Autoconf' from any GNU archive site." file=`echo "$*" | sed -n 's/.*--output[ =]*\([^ ]*\).*/\1/p'` test -z "$file" && file=`echo "$*" | sed -n 's/.*-o[ ]*\([^ ]*\).*/\1/p'` if test -f "$file"; then touch $file else test -z "$file" || exec >$file echo "#! /bin/sh" echo "# Created by GNU Automake missing as a replacement of" echo "# $ $@" echo "exit 0" chmod +x $file exit 1 fi ;; bison|yacc) echo 1>&2 "\ WARNING: \`$1' $msg. You should only need it if you modified a \`.y' file. You may need the \`Bison' package in order for those modifications to take effect. You can get \`Bison' from any GNU archive site." rm -f y.tab.c y.tab.h if [ $# -ne 1 ]; then eval LASTARG="\${$#}" case "$LASTARG" in *.y) SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` if [ -f "$SRCFILE" ]; then cp "$SRCFILE" y.tab.c fi SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` if [ -f "$SRCFILE" ]; then cp "$SRCFILE" y.tab.h fi ;; esac fi if [ ! -f y.tab.h ]; then echo >y.tab.h fi if [ ! -f y.tab.c ]; then echo 'main() { return 0; }' >y.tab.c fi ;; lex|flex) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a \`.l' file. You may need the \`Flex' package in order for those modifications to take effect. You can get \`Flex' from any GNU archive site." rm -f lex.yy.c if [ $# -ne 1 ]; then eval LASTARG="\${$#}" case "$LASTARG" in *.l) SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` if [ -f "$SRCFILE" ]; then cp "$SRCFILE" lex.yy.c fi ;; esac fi if [ ! -f lex.yy.c ]; then echo 'main() { return 0; }' >lex.yy.c fi ;; help2man) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a dependency of a manual page. You may need the \`Help2man' package in order for those modifications to take effect. You can get \`Help2man' from any GNU archive site." file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` if test -z "$file"; then file=`echo "$*" | sed -n 's/.*--output=\([^ ]*\).*/\1/p'` fi if [ -f "$file" ]; then touch $file else test -z "$file" || exec >$file echo ".ab help2man is required to generate this page" exit 1 fi ;; makeinfo) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a \`.texi' or \`.texinfo' file, or any other file indirectly affecting the aspect of the manual. The spurious call might also be the consequence of using a buggy \`make' (AIX, DU, IRIX). You might want to install the \`Texinfo' package or the \`GNU make' package. Grab either from any GNU archive site." file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` if test -z "$file"; then file=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $file` fi touch $file ;; tar) shift # We have already tried tar in the generic part. # Look for gnutar/gtar before invocation to avoid ugly error # messages. if (gnutar --version > /dev/null 2>&1); then gnutar "$@" && exit 0 fi if (gtar --version > /dev/null 2>&1); then gtar "$@" && exit 0 fi firstarg="$1" if shift; then case "$firstarg" in *o*) firstarg=`echo "$firstarg" | sed s/o//` tar "$firstarg" "$@" && exit 0 ;; esac case "$firstarg" in *h*) firstarg=`echo "$firstarg" | sed s/h//` tar "$firstarg" "$@" && exit 0 ;; esac fi echo 1>&2 "\ WARNING: I can't seem to be able to run \`tar' with the given arguments. You may want to install GNU tar or Free paxutils, or check the command line arguments." exit 1 ;; *) echo 1>&2 "\ WARNING: \`$1' is needed, and is $msg. You might have modified some files without having the proper tools for further handling them. Check the \`README' file, it often tells you about the needed prerequisites for installing this package. You may also peek at any GNU archive site, in case some other package would contain this missing \`$1' program." exit 1 ;; esac exit 0 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-end: "$" # End: dia2code-0.8.3/mkinstalldirs0100755000076400001440000000133507457104214015360 0ustar kelloggusers#! /bin/sh # mkinstalldirs --- make directory hierarchy # Author: Noah Friedman # Created: 1993-05-16 # Public domain # $Id: mkinstalldirs,v 1.1.1.1 2002/04/16 20:24:44 joh314 Exp $ errstatus=0 for file do set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` shift pathcomp= for d do pathcomp="$pathcomp$d" case "$pathcomp" in -* ) pathcomp=./$pathcomp ;; esac if test ! -d "$pathcomp"; then echo "mkdir $pathcomp" 1>&2 mkdir "$pathcomp" || lasterr=$? if test ! -d "$pathcomp"; then errstatus=$lasterr fi fi pathcomp="$pathcomp/" done done exit $errstatus # mkinstalldirs ends here dia2code-0.8.3/dia2code_Homepage.url0100644000076400001440000000012707457104215016554 0ustar kelloggusers[InternetShortcut] URL=http://dia2code.sourceforge.net/ Modified=4030E34E7E58C10139 dia2code-0.8.3/Makefile.am0100644000076400001440000000064107457104204014604 0ustar kelloggusers####### kdevelop will overwrite this part!!! (begin)########## SUBDIRS = dia2code EXTRA_DIST = AUTHORS COPYING ChangeLog INSTALL README TODO dia2code.lsm Makefile.am aclocal.m4 configure.in dia2code.kaptn dia2code.spec dia2code.1 dia.ico dia1.bmp dia2.bmp dia2code.nsi README.win32 Report_a_Bug.url dia2code_Homepage.url ####### kdevelop will overwrite this part!!! (end)############ AUTOMAKE_OPTIONS = foreign dia2code-0.8.3/Makefile.in0100644000076400001440000004002510547513572014623 0ustar kelloggusers# Makefile.in generated by automake 1.7.2 from Makefile.am. # @configure_input@ # Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 # Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ ####### kdevelop will overwrite this part!!! (begin)########## srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = . am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : ACLOCAL = @ACLOCAL@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ XML_CONFIG = @XML_CONFIG@ XML_INCLUDES = @XML_INCLUDES@ ac_ct_CC = @ac_ct_CC@ ac_ct_RANLIB = @ac_ct_RANLIB@ ac_ct_STRIP = @ac_ct_STRIP@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__include = @am__include@ am__quote = @am__quote@ bindir = @bindir@ build_alias = @build_alias@ datadir = @datadir@ exec_prefix = @exec_prefix@ host_alias = @host_alias@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ mandir = @mandir@ oldincludedir = @oldincludedir@ prefix = @prefix@ program_transform_name = @program_transform_name@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ SUBDIRS = dia2code EXTRA_DIST = AUTHORS COPYING ChangeLog INSTALL README TODO dia2code.lsm Makefile.am aclocal.m4 configure.in dia2code.kaptn dia2code.spec dia2code.1 dia.ico dia1.bmp dia2.bmp dia2code.nsi README.win32 Report_a_Bug.url dia2code_Homepage.url ####### kdevelop will overwrite this part!!! (end)############ AUTOMAKE_OPTIONS = foreign subdir = . ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = config.h CONFIG_CLEAN_FILES = DIST_SOURCES = RECURSIVE_TARGETS = info-recursive dvi-recursive pdf-recursive \ ps-recursive install-info-recursive uninstall-info-recursive \ all-recursive install-data-recursive install-exec-recursive \ installdirs-recursive install-recursive uninstall-recursive \ check-recursive installcheck-recursive DIST_COMMON = README AUTHORS COPYING ChangeLog INSTALL Makefile.am \ Makefile.in TODO acconfig.h aclocal.m4 config.h.in configure \ configure.in depcomp install-sh missing mkinstalldirs DIST_SUBDIRS = $(SUBDIRS) all: config.h $(MAKE) $(AM_MAKEFLAGS) all-recursive .SUFFIXES: am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno $(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && \ $(AUTOMAKE) --foreign Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe) $(top_builddir)/config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck $(srcdir)/configure: $(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES) cd $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): configure.in cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) config.h: stamp-h1 @if test ! -f $@; then \ rm -f stamp-h1; \ $(MAKE) stamp-h1; \ else :; fi stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status @rm -f stamp-h1 cd $(top_builddir) && $(SHELL) ./config.status config.h $(srcdir)/config.h.in: $(top_srcdir)/configure.in $(ACLOCAL_M4) $(top_srcdir)/acconfig.h cd $(top_srcdir) && $(AUTOHEADER) touch $(srcdir)/config.h.in distclean-hdr: -rm -f config.h stamp-h1 uninstall-info-am: # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. # To change the values of `make' variables: instead of editing Makefiles, # (1) if the variable is set in `config.status', edit `config.status' # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): @set fnord $$MAKEFLAGS; amf=$$2; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" mostlyclean-recursive clean-recursive distclean-recursive \ maintainer-clean-recursive: @set fnord $$MAKEFLAGS; amf=$$2; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ETAGS = etags ETAGSFLAGS = CTAGS = ctags CTAGSFLAGS = tags: TAGS ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(ETAGS_ARGS)$$tags$$unique" \ || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) top_distdir = . distdir = $(PACKAGE)-$(VERSION) am__remove_distdir = \ { test ! -d $(distdir) \ || { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \ && rm -fr $(distdir); }; } GZIP_ENV = --best distuninstallcheck_listfiles = find . -type f -print distcleancheck_listfiles = find . -type f -print distdir: $(DISTFILES) $(am__remove_distdir) mkdir $(distdir) @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkinstalldirs) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d $(distdir)/$$subdir \ || mkdir $(distdir)/$$subdir \ || exit 1; \ (cd $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$(top_distdir)" \ distdir=../$(distdir)/$$subdir \ distdir) \ || exit 1; \ fi; \ done -find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ ! -type d ! -perm -444 -exec $(SHELL) $(install_sh) -c -m a+r {} {} \; \ || chmod -R a+r $(distdir) dist-gzip: distdir $(AMTAR) chof - $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__remove_distdir) dist dist-all: distdir $(AMTAR) chof - $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__remove_distdir) # This target untars the dist file and tries a VPATH configuration. Then # it guarantees that the distribution is self-contained by making another # tarfile. distcheck: dist $(am__remove_distdir) GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(AMTAR) xf - chmod -R a-w $(distdir); chmod a+w $(distdir) mkdir $(distdir)/=build mkdir $(distdir)/=inst chmod a-w $(distdir) dc_install_base=`$(am__cd) $(distdir)/=inst && pwd` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && cd $(distdir)/=build \ && ../configure --srcdir=.. --prefix="$$dc_install_base" \ $(DISTCHECK_CONFIGURE_FLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ && $(MAKE) $(AM_MAKEFLAGS) uninstall \ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ distuninstallcheck \ && chmod -R a-w "$$dc_install_base" \ && ({ \ (cd ../.. && $(mkinstalldirs) "$$dc_destdir") \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ } || { rm -rf "$$dc_destdir"; exit 1; }) \ && rm -rf "$$dc_destdir" \ && $(MAKE) $(AM_MAKEFLAGS) dist-gzip \ && rm -f $(distdir).tar.gz \ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck $(am__remove_distdir) @echo "$(distdir).tar.gz is ready for distribution" | \ sed 'h;s/./=/g;p;x;p;x' distuninstallcheck: cd $(distuninstallcheck_dir) \ && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \ || { echo "ERROR: files left after uninstall:" ; \ if test -n "$(DESTDIR)"; then \ echo " (check DESTDIR support)"; \ fi ; \ $(distuninstallcheck_listfiles) ; \ exit 1; } >&2 distcleancheck: distclean if test '$(srcdir)' = . ; then \ echo "ERROR: distcleancheck can only run from a VPATH build" ; \ exit 1 ; \ fi test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left in build directory after distclean:" ; \ $(distcleancheck_listfiles) ; \ exit 1; } >&2 check-am: all-am check: check-recursive all-am: Makefile config.h installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -rm -f Makefile $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic mostlyclean-am distclean: distclean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) distclean-am: clean-am distclean-generic distclean-hdr distclean-tags dvi: dvi-recursive dvi-am: info: info-recursive info-am: install-data-am: install-exec-am: install-info: install-info-recursive install-man: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf autom4te.cache maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-info-am uninstall-info: uninstall-info-recursive .PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am clean \ clean-generic clean-recursive ctags ctags-recursive dist \ dist-all dist-gzip distcheck distclean distclean-generic \ distclean-hdr distclean-recursive distclean-tags distcleancheck \ distdir distuninstallcheck dvi dvi-am dvi-recursive info \ info-am info-recursive install install-am install-data \ install-data-am install-data-recursive install-exec \ install-exec-am install-exec-recursive install-info \ install-info-am install-info-recursive install-man \ install-recursive install-strip installcheck installcheck-am \ installdirs installdirs-am installdirs-recursive \ maintainer-clean maintainer-clean-generic \ maintainer-clean-recursive mostlyclean mostlyclean-generic \ mostlyclean-recursive pdf pdf-am pdf-recursive ps ps-am \ ps-recursive tags tags-recursive uninstall uninstall-am \ uninstall-info-am uninstall-info-recursive uninstall-recursive # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: dia2code-0.8.3/README.win320100644000076400001440000000222207457104215014370 0ustar kelloggusersINSTALLATION The windows version of dia2code is distributed as an executable installer. Just run the installer to set up the program. USAGE The installer will add context menu entries for .dia files. These entries are accessible through right-mouse-clicks in the Windows Explorer. The following options are available in version 0.7: * Create SQL definition * Create C code * Create C++ code * Create Java code * Create ADA code * Create Python code UNINSTALLATION The dia2code installer adds an uninstall option to the Windows start menu. COMPILATION Developers interested in compiling dia2code for windows should install a recent version of cygwin (See http://www.cygwin.com) and a binary distribution of libxml2 (See http://http://www.fh-frankfurt.de/~igor/projects/libxml/index.html). The sourcecode of dia2code is available from http://dia2code.sourceforge.net Compiling the source *.c files (example): gcc -mno-cygwin -fnative-struct -I PATH_TO_LIBXML2_INCLUDES -c main.c Linking dia2code: gcc -mno-cygwin -fnative-struct -o dia2code.exe *.o -L PATH_TO_LIBXML2_DLL -lxml2 -- Steffen Macke dia2code-0.8.3/config.h.in0100644000076400001440000000312010547513601014565 0ustar kelloggusers/* config.h.in. Generated from configure.in by autoheader. */ /* Define if the C compiler supports BOOL */ #undef HAVE_BOOL #undef VERSION #undef PACKAGE /* Define if you need the GNU extensions to compile */ #undef _GNU_SOURCE /* Define to 1 if you have the header file. */ #undef HAVE_DLFCN_H /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H /* Define to 1 if you have the header file. */ #undef HAVE_STRINGS_H /* Define to 1 if you have the header file. */ #undef HAVE_STRING_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* Name of package */ #undef PACKAGE /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT /* Define to the full name of this package. */ #undef PACKAGE_NAME /* Define to the full name and version of this package. */ #undef PACKAGE_STRING /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME /* Define to the version of this package. */ #undef PACKAGE_VERSION /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS /* Version number of package */ #undef VERSION dia2code-0.8.3/stamp-h.in0100644000076400001440000000001207457104200014435 0ustar kellogguserstimestamp dia2code-0.8.3/AUTHORS0100644000076400001440000000220010547512631013612 0ustar kelloggusersAuthor: - Javier O'Hara : author and mantainer - Richard Torkar : maintainer Contributors: (in alphabetical order, by last name) - Cyrille Chepelov Pyhton code generation, Debian package management, Hurd conformance - Harald Fielker PHP code generation. - Ruben Lopez , C code generation - Steffen Macke batch shapefile generation, win32 installer - Chris McGee Dependencies, Associations, C++ Templates, SQL IDL code generation. - Takashi Okamoto License inclusion mechanism. - Thomas Preymesser Ada code generation - Jщrєme Slangen Wildcard class list mechanism. - Takaaki Tateishi <> Dynamic Shared Objects for dynamic code generator modules. - Martin Vidner Porting to libxml2. - Thomas Hansen C# code generation. - Oliver Kellogg Fixes for scan_tree.c and idl generation. - Dmitry V. Sabanin Ruby code generation. dia2code-0.8.3/INSTALL0100644000076400001440000001547207457104204013611 0ustar kelloggusersBasic Installation ================== These are generic installation instructions. The `configure' shell script attempts to guess correct values for various system-dependent variables used during compilation. It uses those values to create a `Makefile' in each directory of the package. It may also create one or more `.h' files containing system-dependent definitions. Finally, it creates a shell script `config.status' that you can run in the future to recreate the current configuration, a file `config.cache' that saves the results of its tests to speed up reconfiguring, and a file `config.log' containing compiler output (useful mainly for debugging `configure'). If you need to do unusual things to compile the package, please try to figure out how `configure' could check whether to do them, and mail diffs or instructions to the address given in the `README' so they can be considered for the next release. If at some point `config.cache' contains results you don't want to keep, you may remove or edit it. The file `configure.in' is used to create `configure' by a program called `autoconf'. You only need `configure.in' if you want to change it or regenerate `configure' using a newer version of `autoconf'. The simplest way to compile this package is: 1. `cd' to the directory containing the package's source code and type `./configure' to configure the package for your system. If you're using `csh' on an old version of System V, you might need to type `sh ./configure' instead to prevent `csh' from trying to execute `configure' itself. Running `configure' takes a while. While running, it prints some messages telling which features it is checking for. 2. Type `make' to compile the package. 3. Type `make install' to install the programs and any data files and documentation. 4. You can remove the program binaries and object files from the source code directory by typing `make clean'. Compilers and Options ===================== Some systems require unusual options for compilation or linking that the `configure' script does not know about. You can give `configure' initial values for variables by setting them in the environment. Using a Bourne-compatible shell, you can do that on the command line like this: CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure Or on systems that have the `env' program, you can do it like this: env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure Compiling For Multiple Architectures ==================================== You can compile the package for more than one kind of computer at the same time, by placing the object files for each architecture in their own directory. To do this, you must use a version of `make' that supports the `VPATH' variable, such as GNU `make'. `cd' to the directory where you want the object files and executables to go and run the `configure' script. `configure' automatically checks for the source code in the directory that `configure' is in and in `..'. If you have to use a `make' that does not supports the `VPATH' variable, you have to compile the package for one architecture at a time in the source code directory. After you have installed the package for one architecture, use `make distclean' before reconfiguring for another architecture. Installation Names ================== By default, `make install' will install the package's files in `/usr/local/bin', `/usr/local/man', etc. You can specify an installation prefix other than `/usr/local' by giving `configure' the option `--prefix=PATH'. You can specify separate installation prefixes for architecture-specific files and architecture-independent files. If you give `configure' the option `--exec-prefix=PATH', the package will use PATH as the prefix for installing programs and libraries. Documentation and other data files will still use the regular prefix. If the package supports it, you can cause programs to be installed with an extra prefix or suffix on their names by giving `configure' the option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. Optional Features ================= Some packages pay attention to `--enable-FEATURE' options to `configure', where FEATURE indicates an optional part of the package. They may also pay attention to `--with-PACKAGE' options, where PACKAGE is something like `gnu-as' or `x' (for the X Window System). The `README' should mention any `--enable-' and `--with-' options that the package recognizes. For packages that use the X Window System, `configure' can usually find the X include and library files automatically, but if it doesn't, you can use the `configure' options `--x-includes=DIR' and `--x-libraries=DIR' to specify their locations. Specifying the System Type ========================== There may be some features `configure' can not figure out automatically, but needs to determine by the type of host the package will run on. Usually `configure' can figure that out, but if it prints a message saying it can not guess the host type, give it the `--host=TYPE' option. TYPE can either be a short name for the system type, such as `sun4', or a canonical name with three fields: CPU-COMPANY-SYSTEM See the file `config.sub' for the possible values of each field. If `config.sub' isn't included in this package, then this package doesn't need to know the host type. If you are building compiler tools for cross-compiling, you can also use the `--target=TYPE' option to select the type of system they will produce code for and the `--build=TYPE' option to select the type of system on which you are compiling the package. Sharing Defaults ================ If you want to set default values for `configure' scripts to share, you can create a site shell script called `config.site' that gives default values for variables like `CC', `cache_file', and `prefix'. `configure' looks for `PREFIX/share/config.site' if it exists, then `PREFIX/etc/config.site' if it exists. Or, you can set the `CONFIG_SITE' environment variable to the location of the site script. A warning: not all `configure' scripts look for a site script. Operation Controls ================== `configure' recognizes the following options to control how it operates. `--cache-file=FILE' Use and save the results of the tests in FILE instead of `./config.cache'. Set FILE to `/dev/null' to disable caching, for debugging `configure'. `--help' Print a summary of the options to `configure', and exit. `--quiet' `--silent' `-q' Do not print messages saying which checks are being made. `--srcdir=DIR' Look for the package's source code in directory DIR. Usually `configure' can determine that directory automatically. `--version' Print the version of Autoconf used to generate the `configure' script, and exit. `configure' also accepts some other, not widely useful, options. dia2code-0.8.3/dia2code.10100644000076400001440000000425310547512631014310 0ustar kelloggusers.TH dia2code 1 "September 2, 2001" .LO 1 .SH NAME dia2code \- Generate code from Dia files .SH SYNOPSIS .B dia2code [\-h] [\-\-help] [\-t \fIada|c|cpp|java|php|python|shp|sql\fR] [\-d \fIdir\fR] [\-nc] [\-c] [\-cl \fIclasslist\fR] [\-v] diagramfile .SH DESCRIPTION .PP .B dia2code generates code from a Dia file containing a UML diagram. Output code can be: Ada, C, C++, C#, Java, PHP, Python, Ruby, Shape File or SQL create statements. .SH OPTIONS .PP .TP .B \-h \-\-help Print help text and exit. .TP .B \-t ada|c|cpp|cs|java|php|php5|python|ruby|shp|sql Selects the output language, default is C++. .TP .B \-d dir Output generated files to , default is "." .TP .B \-nc Do not overwrite files that already exist. .TP .B \-cl classlist Generate code only for the classes specified in the comma-separated . E.g: Base,Derived. .TP .B \-v Invert the class list selection. When used without -cl prevents any file from being created. .TP .B \-l licensefile Prepend the specified license to every source file generated. .TP .B diagramfile The Dia file that holds the diagram to be read. .SH AUTHOR .PP Written by Javier O'Hara with contributions from Ruben Lopez (C code generation), Chris McGee (Dependencies, Associations, C++ Templates, SQL), Takashi Okamoto (License inclusion mechanism), Thomas Preymesser (Ada code generation), Jщrєme Slangen (Wildcard class list mechanism), Takaaki Tateishi <> (Dynamic Shared Objects for dynamic code generator modules), Martin Vidner (Porting to libxml2). .SH THANKS .PP Thanks to Collin Starkweather, Richard Torkar and Slush Gore for the extra help. .SH REPORTING BUGS .PP Report bugs to .br . .SH COPYRIGHT .PP Copyright \(co 2000-2001 Javier O'Hara .br This is free software, and you are welcome to redistribute it under certain conditions; read the COPYING file for details. .SH SEE ALSO .PP dia(1) .SH ALSO SEE ALSO .PP The .B Dia homepage: .br The .B dia2code homepage: dia2code-0.8.3/ChangeLog0100644000076400001440000001514010547514161014323 0ustar kelloggusers05 Jan 2007: Version 0.8.3 - Added Ruby code generator by Dmitry V. Sabanin. 17 Nov 2006: Version 0.8.2 - Added PHP5 code generator by Tim Rodger. - Fixed the bug that caused SEGFAULTs when parsing a simple implementation (here called lolipop implementation) with no text associated. Thanks to Max Berger and Patrice Neff. 01 Jan 2002: Version 0.8.1 - The win32 files were not included in 0.8, now they are in. - Fixed the bug with grouped objects. - Fixed the bug with integer parsing in 64 bit systems. Thanks to Patrik Stфhli. - Updated generate_code_php. Thanks to Harald Fielker. The following changes where made by Chris McGee: - Fixed the NO_GENERATORS number to reflect the actual number of code generators that are actually there. - Added _basic_ CORBA idl support 27 Dec 2001: Version 0.8 - Fixed the bug that caused SEGFAULTs when parsing templates. - Fixed the endless loop bug in the Java code generator. - Fixed the bug that scrambled the formal parameters of a method. - Added support for wildcards to the list specified with "-cl". Now one can put an asterisk either at the beggining or the end. Example: "dia2code -cl Foo*,*bar", will create files only for classes which names start with "Foo" or end with "bar". Thanks to Jщrєme Slangen. - Added the PHP code generator. Thanks to Harald Fielker. - Added support for license file inclusion (-l). Thanks to Takashi Okamoto. The following changes were done by Steffen Macke: - Added support for shapefile generation (shp): New generate_code_shp.c - Added support to built with cygwin on win32: dia2code/makefile.mingw - Added files to built win32 installer with NSIS: dia.ico, dia1.bmp, dia2.bmp, dia2code Homepage.url dia2code.nsi, README.win32, Report a Bug.url 01 Oct 2001: Version 0.7 - Added support for packages. The classes now have a "package" pointer which points to an element of a new structure: package. The parser fills in info for the packages based on the geometry of the objects in the diagram. Currently, only the Java code generator uses this extra info. - Added list_classes(), a function like find_classes() that returns an umlclasslist instead. - Regrouped the scan in the parser so we'll pass through the diagram fewer times. - Added some comments here and there. - Updated the README and TODO files. 15 Sep 2001: Version 0.6.1 - Fixed the Association and Dependency parsing. They were broken because I rewrote the routines for libxml2. - Modified find_classes(): now it returns a list with the classes used in: attributes, method parameters, parents, dependencies and associations. The list has each "used" class at most once. - Modified code generators to use the above improvement. 03 Sep 2001: Version 0.6 - Dia2Code now uses libxml2. Thanks to Martin Vidner for the patch and guidelines to it. - Added configuration options for libxml2 in configure.in. Again, thanks to M. Vidner for the support. - New argument parsing: should be easier to understand and much more flexible: arguments can be specified in any order (even the filename). - Added my_malloc() that behaves like malloc() but exits if there's no more memory avaliable. - Added generate_code_ada, thanks to Thomas Preymesser - Added generate_code_sql, thanks to Chris McGee - Added generate_code_python, thanks to Cyrille Chepelov - Added dynamic shared objects capability for adding new code generators on the fly. (Thanks very much to Takaaki Tateishi) - Added dependency and aggregation/composition functionality to the cpp, java and c generators. Thanks to Chris McGee. - Added a Kaptain script for dia2code (dia2code.kaptn). Kaptain is a program that creates a QT GUI from a grammar file and can invoke a command-line program, like dia2code. Check out its home page: http://kaptain.sourceforge.net 23 Jan 2001: Version 0.5 - Fixed the .in files in the docs directory so "configure" will not complain any more. - There was a bug in generate_code_java; it didn't really checked for a string longer than the buffer, but it was NOT vulnerable to buffer overflows (see next bug). - Another bug in generate_code_java: the output directory was not prepended to the output filename, so specifying it while generating Java code was futile. My fault. - Added some comments here and there. - Added generate_code_c, thanks to Ruben Lopez. - Added the find_classes() function (again, thanks to Ruben Lopez). This function returns a list of names that a given class uses and are declared in the same diagram. With this, generate_code_c and generate_code_cpp now can generate more useful #include directives. - Added a char * field to umloperation named "implementation" so we can suggest an implementation while building the class list. The code generators MAY use it as a default implementation (example: a non-void function may return a default value). - Added support for JavaBeans(tm). If you want to automagically add a get() and set() (or is() if it is boolean) public method for each attribute, you should set "JavaBean" as the stereotype. The body of the method will be generated properly. This should also work when the target language is not Java. 01 Jan 2001: Version 0.4 - When you didn't specify a method's return type (left the space blank) the program would promptly crash. This was mostly a problem with constructors. - Added support for "UML - Implements" (the lolipop implementation). The interface name will be declared in the implementator's file but no code will be generated for it. 28 Dec 2000: Version 0.3 - There was bug with the list of classes to generate: the discrimination was done in the class parser, so we could end with a list of classes without parent information. Sorry. - The code generators now accept only a pointer to a structure that contains all the information they need. Please look into the README file for details. 20 Dec 2000: Version 0.2 - Added this Changelog - Added the online help options, "-h" and "--help" - Added the "-nc" option. When specified, dia2code will not overwrite files already present in the target directory. - Added the "-cl" option, which lets you specify the list of classes you want generated. Example: "-cl Base,Derived". Also added the "-v" optiion, that inverts the class selection. - Reorganized the structure of the project. Now it is divided into two modules: the parser and the code generators. - There was a bug in generate_code_java: tmpname is not initialized and the program could randomly crash. - The condition for the generation of abstract classes in Java was rather ugly. Now it looks for the Abstract flag instead of the Sterotype (which is much better than before). 26 Nov 2000: Version 0.1 - Initial release - Generates code for C++/Java - Does not support templates. dia2code-0.8.3/acconfig.h0100644000076400001440000000025107457104205014470 0ustar kelloggusers/* Define if the C compiler supports BOOL */ #undef HAVE_BOOL #undef VERSION #undef PACKAGE /* Define if you need the GNU extensions to compile */ #undef _GNU_SOURCE dia2code-0.8.3/COPYING0100644000076400001440000003543307457104201013607 0ustar kelloggusers GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 675 Mass Ave, Cambridge, MA 02139, USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS dia2code-0.8.3/dia2code.spec0100644000076400001440000000472610547512631015107 0ustar kelloggusers%define name dia2code %define ver 0.8.3 %define prefix /usr %define rel 1 ###################################################################### Summary: Dia2Code generates code from a Dia diagram Name: %name Version: %ver Release: %rel Copyright: GPL Distribution: N/A Vendor: N/A Group: Development/Tools Requires: libxml2 Buildroot: /var/tmp/%{name}-%{ver}-root Source: http://download.sourceforge.net/dia2code/dia2code-%{ver}.tar.gz Packager: Richard Torkar URL: http://dia2code.sourceforge.net/ ###################################################################### %description Dia2Code is a small utility used to generate code from a Dia diagram. Dia is a program to make diagrams. If you didn't know it, you might consider checking its homepage first. http://www.lysator.liu.se/~alla/dia/ Dia2Code is still under development, but you may find this version useful. ###################################################################### %prep %setup -q ###################################################################### %build if [ -x ./configure ]; then CFLAGS=$RPM_OPT_FLAGS ./configure --prefix=%{prefix} else CFLAGS=$RPM_OPT_FLAGS ./autogen.sh --prefix=%{prefix} fi make ###################################################################### %install rm -fr $RPM_BUILD_ROOT make prefix=$RPM_BUILD_ROOT%{prefix} install-strip mkdir $RPM_BUILD_ROOT/usr/man mkdir $RPM_BUILD_ROOT/usr/man/man1 cp dia2code.1 $RPM_BUILD_ROOT/usr/man/man1 ###################################################################### %clean rm -rf $RPM_BUILD_ROOT ###################################################################### %files %defattr(-,root,root) %doc AUTHORS ChangeLog COPYING README TODO dia2code.lsm %{prefix}/bin/dia2code %{prefix}/man/man1/dia2code.1.gz ##################################################################### %changelog * Sat Sep 15 2001 Javier O'Hara - Added the libxml2 dependency. - Assigned the group to Development/Tools. - Took out the kaptain script, as it would generate a dependency on Kaptain. - Added the man page. * Tue Sep 04 2001 Richard Torkar - Made sure dia2code.kaptn is copied, this should really be made by a autogen.sh script - Added kaptain as a prereq * Sun Sep 02 2001 Javier O'Hara - Added dia2code.kaptn to files section * Wed Jan 24 2001 Richard Torkar - Made the spec file for dia2code - Contacted the maintainer Javier O'Hara dia2code-0.8.3/dia1.bmp0100644000076400001440000000054607457104215014074 0ustar kelloggusersBMfv(№ `diF™FўЮ•ЇБКМПЭЯб‚иии†œќ§§DFIL№"vђЬЬЬЬЬЬЬЬЬЬЬЬЬЌЬЬЬЬЬЬЬЬТŒЬЬЬЬЬЬЬЬ‹КЬЬЬЬЬЬЬЬjЈŠЊЌЬЬЬЂбнн""xЌЬЬЬТŒЬЬЇzЬЬЬТŠ‡‡Ša'ЬЬЬТŽўюїСЌЬЬЭfћnВ}ЌЬЬТ""-"ВЌЬЬЭЌЮцЬЭЬЬЬТŒЮъЬqкЬЬЬ­zЊjІЌЬЬ­бнннвlЬЬЬЬЭxЬЬЬЬЬЬЬЬe;ЬЬЬЬЬЬЬЬ5[ЬЬЬЬЬЬЬЬ57ЬЬЬЬЬЬЬЬЬЌЬЬЬЬЬЬdia2code-0.8.3/dia2.bmp0100644000076400001440000000054607457104215014075 0ustar kelloggusersBMfv(№ы ы  `diF™FўЮ•ЇБКМПЭЯб‚иии†œќ§§DFIL№"vђЬЬЬЬЬЬЬЬЬЬЬOЬЬЬЬЬЪєЬФDч|ЬЬЬЮDLФDOwЬЬЬфDLЮDDчww~DDьЬфDNwwфDNЬЬЮDDŒШDDїЬЬЬфDFdDOwЬЬЬФDDDDGw|ЬЬЦDDDDgw|ЬЬЧdDDFww|ЬЬЧDDќЧwЬЬЬЧєDDOwwЬЬЧDDDDч|ЬЬwфDNєDNЬЬЬШDDьЮDDŒЬЬ„DO|ЬфDHЬЪDDG|ЬЯDDЌЯDDwЬЬЪDDќЬDF|ЬЬЬЄDЬdia2code-0.8.3/Report_a_Bug.url0100644000076400001440000000017207457104215015645 0ustar kelloggusers[InternetShortcut] URL=http://sourceforge.net/tracker/?func=add&group_id=15307&atid=115307 Modified=80D1A1867E58C10110 dia2code-0.8.3/dia2code/0040755000076400001440000000000010547514036014226 5ustar kelloggusersdia2code-0.8.3/dia2code/docs/0040755000076400001440000000000010547514036015156 5ustar kelloggusersdia2code-0.8.3/dia2code/docs/en/0040755000076400001440000000000010547514036015560 5ustar kelloggusersdia2code-0.8.3/dia2code/docs/en/Makefile.am0100644000076400001440000000023307457104226017611 0ustar kelloggusers####### kdevelop will overwrite this part!!! (begin)########## EXTRA_DIST = Makefile.in ####### kdevelop will overwrite this part!!! (end)############ dia2code-0.8.3/dia2code/docs/en/Makefile.in0100644000076400001440000001475110547513603017631 0ustar kelloggusers# Makefile.in generated by automake 1.7.2 from Makefile.am. # @configure_input@ # Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 # Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ ####### kdevelop will overwrite this part!!! (begin)########## srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = ../../.. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : ACLOCAL = @ACLOCAL@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ XML_CONFIG = @XML_CONFIG@ XML_INCLUDES = @XML_INCLUDES@ ac_ct_CC = @ac_ct_CC@ ac_ct_RANLIB = @ac_ct_RANLIB@ ac_ct_STRIP = @ac_ct_STRIP@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__include = @am__include@ am__quote = @am__quote@ bindir = @bindir@ build_alias = @build_alias@ datadir = @datadir@ exec_prefix = @exec_prefix@ host_alias = @host_alias@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ mandir = @mandir@ oldincludedir = @oldincludedir@ prefix = @prefix@ program_transform_name = @program_transform_name@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ EXTRA_DIST = Makefile.in subdir = dia2code/docs/en mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = DIST_SOURCES = DIST_COMMON = Makefile.am Makefile.in all: all-am .SUFFIXES: $(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && \ $(AUTOMAKE) --gnu dia2code/docs/en/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) uninstall-info-am: tags: TAGS TAGS: ctags: CTAGS CTAGS: DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) top_distdir = ../../.. distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkinstalldirs) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -rm -f Makefile $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic mostlyclean-am distclean: distclean-am distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: info: info-am info-am: install-data-am: install-exec-am: install-info: install-info-am install-man: installcheck-am: maintainer-clean: maintainer-clean-am maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-info-am .PHONY: all all-am check check-am clean clean-generic distclean \ distclean-generic distdir dvi dvi-am info info-am install \ install-am install-data install-data-am install-exec \ install-exec-am install-info install-info-am install-man \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic pdf pdf-am ps ps-am uninstall uninstall-am \ uninstall-info-am ####### kdevelop will overwrite this part!!! (end)############ # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: dia2code-0.8.3/dia2code/docs/Makefile.am0100644000076400001440000000025107457104226017207 0ustar kelloggusers####### kdevelop will overwrite this part!!! (begin)########## SUBDIRS = en EXTRA_DIST = Makefile.in ####### kdevelop will overwrite this part!!! (end)############ dia2code-0.8.3/dia2code/docs/Makefile.in0100644000076400001440000002677510547513602017237 0ustar kelloggusers# Makefile.in generated by automake 1.7.2 from Makefile.am. # @configure_input@ # Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 # Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ ####### kdevelop will overwrite this part!!! (begin)########## srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = ../.. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : ACLOCAL = @ACLOCAL@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ XML_CONFIG = @XML_CONFIG@ XML_INCLUDES = @XML_INCLUDES@ ac_ct_CC = @ac_ct_CC@ ac_ct_RANLIB = @ac_ct_RANLIB@ ac_ct_STRIP = @ac_ct_STRIP@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__include = @am__include@ am__quote = @am__quote@ bindir = @bindir@ build_alias = @build_alias@ datadir = @datadir@ exec_prefix = @exec_prefix@ host_alias = @host_alias@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ mandir = @mandir@ oldincludedir = @oldincludedir@ prefix = @prefix@ program_transform_name = @program_transform_name@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ SUBDIRS = en EXTRA_DIST = Makefile.in subdir = dia2code/docs mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = DIST_SOURCES = RECURSIVE_TARGETS = info-recursive dvi-recursive pdf-recursive \ ps-recursive install-info-recursive uninstall-info-recursive \ all-recursive install-data-recursive install-exec-recursive \ installdirs-recursive install-recursive uninstall-recursive \ check-recursive installcheck-recursive DIST_COMMON = Makefile.am Makefile.in DIST_SUBDIRS = $(SUBDIRS) all: all-recursive .SUFFIXES: $(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && \ $(AUTOMAKE) --gnu dia2code/docs/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) uninstall-info-am: # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. # To change the values of `make' variables: instead of editing Makefiles, # (1) if the variable is set in `config.status', edit `config.status' # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): @set fnord $$MAKEFLAGS; amf=$$2; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" mostlyclean-recursive clean-recursive distclean-recursive \ maintainer-clean-recursive: @set fnord $$MAKEFLAGS; amf=$$2; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ETAGS = etags ETAGSFLAGS = CTAGS = ctags CTAGSFLAGS = tags: TAGS ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(ETAGS_ARGS)$$tags$$unique" \ || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) top_distdir = ../.. distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkinstalldirs) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d $(distdir)/$$subdir \ || mkdir $(distdir)/$$subdir \ || exit 1; \ (cd $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$(top_distdir)" \ distdir=../$(distdir)/$$subdir \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -rm -f Makefile $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic mostlyclean-am distclean: distclean-recursive distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: info: info-recursive info-am: install-data-am: install-exec-am: install-info: install-info-recursive install-man: installcheck-am: maintainer-clean: maintainer-clean-recursive maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-info-am uninstall-info: uninstall-info-recursive .PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am clean \ clean-generic clean-recursive ctags ctags-recursive distclean \ distclean-generic distclean-recursive distclean-tags distdir \ dvi dvi-am dvi-recursive info info-am info-recursive install \ install-am install-data install-data-am install-data-recursive \ install-exec install-exec-am install-exec-recursive \ install-info install-info-am install-info-recursive install-man \ install-recursive install-strip installcheck installcheck-am \ installdirs installdirs-am installdirs-recursive \ maintainer-clean maintainer-clean-generic \ maintainer-clean-recursive mostlyclean mostlyclean-generic \ mostlyclean-recursive pdf pdf-am pdf-recursive ps ps-am \ ps-recursive tags tags-recursive uninstall uninstall-am \ uninstall-info-am uninstall-info-recursive uninstall-recursive ####### kdevelop will overwrite this part!!! (end)############ # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: dia2code-0.8.3/dia2code/decls.c0100644000076400001440000001072407574616325015477 0ustar kelloggusers#include "decls.h" declaration *decls = NULL; int use_corba = 0; module * create_nested_modules_from_pkglist (umlpackagelist pkglist, module *m) { /* Expects pkglist and m to be non-NULL and m->contents to be NULL. Returns a reference to the innermost module created. */ while (pkglist->next != NULL) { declaration *d = NEW (declaration); d->decl_kind = dk_module; d->prev = d->next = NULL; d->u.this_module = NEW (module); m->contents = d; pkglist = pkglist->next; m = d->u.this_module; m->pkg = pkglist->key; m->contents = NULL; } return m; } module * find_or_add_module (declaration **dptr, umlpackagelist pkglist) { declaration *d = *dptr; module *m; if (pkglist == NULL) return NULL; if (d == NULL) { *dptr = NEW (declaration); d = *dptr; } else { declaration *dprev = NULL; while (d != NULL) { if (d->decl_kind == dk_module && !strcmp (d->u.this_module->pkg->name, pkglist->key->name)) { m = d->u.this_module; if (pkglist->next == NULL) return m; if (m->contents == NULL) { return create_nested_modules_from_pkglist (pkglist, m); } return find_or_add_module (&m->contents, pkglist->next); } dprev = d; d = d->next; } if (dprev != NULL) { dprev->next = NEW (declaration); d = dprev->next; } } d->decl_kind = dk_module; d->next = NULL; d->u.this_module = NEW (module); m = d->u.this_module; m->pkg = pkglist->key; m->contents = NULL; return create_nested_modules_from_pkglist (pkglist, m); } module * find_module (declaration *d, umlpackagelist pkglist) { while (d != NULL) { if (d->decl_kind == dk_module) { module *m = d->u.this_module; if (!strcmp (m->pkg->name, pkglist->key->name)) { if (pkglist->next != NULL) return find_module (m->contents, pkglist->next); else return m; } } d = d->next; } return NULL; } declaration * find_class (umlclassnode *node) { declaration *d; if (node->key->package != NULL) { umlpackagelist pkglist = make_package_list (node->key->package); module *m = find_module (decls, pkglist); if (m == NULL || m->contents == NULL) return 0; d = m->contents; } else { d = decls; } while (d != NULL) { if (d->decl_kind == dk_class) { umlclassnode *cl = d->u.this_class; if (!strcmp (cl->key->name, node->key->name)) return d; } d = d->next; } return NULL; } declaration * append_decl (declaration *d) { while (d->next != NULL) { d = d->next; } d->next = NEW (declaration); d->next->prev = d; d = d->next; return d; } void push (umlclassnode *node, batch *b) { umlclasslist used_classes, tmpnode; module *m; declaration *d; if (node == NULL || find_class (node) != NULL) { return; } used_classes = list_classes (node, b); /* Make sure all classes that this one depends on are already pushed. */ tmpnode = used_classes; while (tmpnode != NULL) { push (tmpnode, b); tmpnode = tmpnode->next; } if (node->key->package != NULL) { umlpackagelist pkglist = make_package_list (node->key->package); m = find_or_add_module (&decls, pkglist); if (m->contents == NULL) { m->contents = NEW (declaration); d = m->contents; d->prev = NULL; } else { /* We can simply append because all classes that we depend on are already pushed. */ d = append_decl (m->contents); } } else { if (decls == NULL) { decls = NEW (declaration); d = decls; d->prev = NULL; } else { d = append_decl (decls); /* We can simply append because all classes that we depend on are already pushed. */ } } d->decl_kind = dk_class; d->next = NULL; d->u.this_class = NEW (umlclassnode); memcpy (d->u.this_class, node, sizeof(umlclassnode)); if (strncmp (node->key->stereotype, "CORBA", 5) == 0) use_corba = 1; } dia2code-0.8.3/dia2code/decls.h0100644000076400001440000000421707574616325015504 0ustar kelloggusers#ifndef DECLS_H #define DECLS_H #include "dia2code.h" /* Package processing auxiliary structure: "Declarations" are UML packages (which map to IDL module or C++ namespace or Ada package or ...) or UML classes (which map to various other language constructs.) For each top level declaration, a separate file is generated. Nested packages are generated into the same file as nested modules. `struct declaration' is a buffer that gathers together classes and packages ordered by their dependencies, going from least dependendcies to most. We cannot handle circular dependencies yet. */ struct declaration; struct module { /* UML package = IDL module What we call `module' equally applies to C++ (namespace) and Ada (package.) I don't know about other languages. */ umlpackage *pkg; struct declaration *contents; }; typedef struct module module; typedef enum { dk_module, dk_class } decl_kind_t; struct declaration { decl_kind_t decl_kind; union /* switch(decl_kind) */ { /* case dk_module: */ module *this_module; /* case dk_class: */ umlclassnode *this_class; /* In `this_class', `next' is not used since we use our own sequencing (see `prev' and `next' below.) */ } u; struct declaration *prev, *next; /* other declarations in this scope */ }; typedef struct declaration declaration; extern declaration *decls; #ifndef NEW #define NEW(c) ((c*)malloc(sizeof(c))) #endif /* Utilities for building the global `decls' from umlclassnodes and their parents. (`decls' contains everything in ascending order of interdependence.) */ extern module * create_nested_modules_from_pkglist (umlpackagelist pkglist, module *m); extern module * find_or_add_module (declaration **dptr, umlpackagelist pkglist); extern module * find_module (declaration *d, umlpackagelist pkglist); extern declaration * find_class (umlclassnode *node); extern declaration * append_decl (declaration *d); extern void push (umlclassnode *node, batch *b); extern int use_corba; /* Set by push() if CORBA stereotypes in use. */ #endif /* DECLS_H */ dia2code-0.8.3/dia2code/generate_code_python.c0100644000076400001440000001723710547512632020566 0ustar kelloggusers/*************************************************************************** generate_code_python.c - Function that generates Python code ------------------- begin : Sat Mar 24 2001 copyright : (C) 2001 by Cyrille Chepelov (based on code from Javier O'Hara) email : chepelov@calixo.net ***************************************************************************/ /*************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * ***************************************************************************/ #include "dia2code.h" void generate_code_python(batch *b) { umlclasslist tmplist, parents; umlattrlist umla, tmpa; umloplist umlo; char *tmpname; char outfilename[90]; FILE * outfile, *dummyfile, *licensefile = NULL; namelist used_classes, tmpnamelist; int tmpdirlgth, tmpfilelgth; int interface, abstract; if (b->outdir == NULL) { b->outdir = "."; } tmpdirlgth = strlen(b->outdir); tmplist = b->classlist; /* open license file */ if ( b->license != NULL ) { licensefile = fopen(b->license, "r"); if(!licensefile) { fprintf(stderr, "Can't open the license file.\n"); exit(2); } } while ( tmplist != NULL ) { if ( ! ( is_present(b->classes, tmplist->key->name) ^ b->mask ) ) { tmpname = tmplist->key->name; /* This prevents buffer overflows */ tmpfilelgth = strlen(tmpname); if (tmpfilelgth + tmpdirlgth > sizeof(*outfilename) - 2) { fprintf(stderr, "Sorry, name of file too long ...\nTry a smaller dir name\n"); exit(4); } sprintf(outfilename, "%s/%s.py", b->outdir, tmplist->key->name); dummyfile = fopen(outfilename, "r"); if ( b->clobber || ! dummyfile ) { outfile = fopen(outfilename, "w"); if ( outfile == NULL ) { fprintf(stderr, "Can't open file %s for writing\n", outfilename); exit(3); } /* add license to the header */ if(b->license != NULL){ char lc; rewind(licensefile); while((lc = fgetc(licensefile)) != EOF){ fprintf(outfile,"%c",lc); } } used_classes = find_classes(tmplist, b); tmpnamelist = used_classes; while (tmpnamelist != NULL) { fprintf(outfile, "from %s import %s\n", tmpnamelist->name, tmpnamelist->name); tmpnamelist = tmpnamelist->next; } fprintf(outfile, "\n"); tmpname = strtolower(tmplist->key->stereotype); interface = eq("interface", tmpname); abstract = tmplist->key->isabstract; free(tmpname); fprintf(outfile, "class %s", tmplist->key->name); parents = tmplist->parents; if (parents != NULL) { fprintf(outfile, "("); while ( parents != NULL ) { fprintf(outfile, "%s", parents->key->name); parents = parents->next; if (parents != NULL) fprintf(outfile, ", "); } fprintf(outfile, ")"); } fprintf(outfile, ":\n"); if (abstract) { fprintf(outfile, " \"\"\"Abstract class %s\n \"\"\"\n", tmplist->key->name); } else if (interface) { fprintf(outfile, " \"\"\"Interface %s\n \"\"\"\n", tmplist->key->name); } else { fprintf(outfile, " \"\"\"Class %s\n \"\"\"\n", tmplist->key->name); } fprintf(outfile, " # Attributes:\n"); umla = tmplist->key->attributes; while ( umla != NULL) { switch (umla->key.visibility) { case '0': fprintf (outfile, " "); break; case '1': fprintf (outfile, " __"); break; case '2': fprintf (outfile, " _"); break; } fprintf(outfile, "%s", umla->key.name); if ( umla->key.value[0] != 0 ) { fprintf(outfile, " = %s", umla->key.value); } else { fprintf(outfile, " = None"); } fprintf(outfile, " # (%s) \n", umla->key.type); umla = umla->next; } fprintf(outfile, " \n"); umlo = tmplist->key->operations; fprintf(outfile, " # Operations\n"); while ( umlo != NULL) { switch (umlo->key.attr.visibility) { case '0': fprintf (outfile, " def %s(self", umlo->key.attr.name); break; case '1': fprintf (outfile, " def __%s(self", umlo->key.attr.name); break; case '2': fprintf (outfile, " def _%s(self", umlo->key.attr.name); break; } tmpa = umlo->key.parameters; while (tmpa != NULL) { fprintf(outfile, ", %s", tmpa->key.name); if ( tmpa->key.value[0] != 0 ) { fprintf(outfile, " = %s", tmpa->key.value); } tmpa = tmpa->next; } fprintf(outfile, "):\n"); fprintf(outfile, " \"\"\"function %s\n", umlo->key.attr.name); tmpa = umlo->key.parameters; if (tmpa) fprintf(outfile, " \n"); while (tmpa != NULL) { fprintf(outfile, " %s: %s\n", tmpa->key.name, tmpa->key.type); tmpa = tmpa->next; } fprintf(outfile, " \n"); fprintf(outfile, " returns %s\n", umlo->key.attr.type); fprintf(outfile, " \"\"\"\n"); if (abstract || interface) { fprintf(outfile, " raise NotImplementedError()\n \n"); } else { fprintf(outfile, " return None # should raise NotImplementedError()\n \n"); } umlo = umlo->next; } fprintf(outfile, "\n"); fclose(outfile); } } tmplist = tmplist->next; } } dia2code-0.8.3/dia2code/generate_code_csharp.c0100644000076400001440000002152010547512631020512 0ustar kelloggusers/*************************************************************************** generate_code_csharp.c - Function that generates C# code ------------------- begin : Wed Dec 04 2002 copyright : (C) 2000-2002 by Javier O'Hara, email : joh314@users.sourceforge.net Authors : Javier O'Hara Thomas Hansen Oliver Kellogg ***************************************************************************/ /*************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * ***************************************************************************/ #include "dia2code.h" static char * pkgname (umlpackagelist pkg) { static char buf[512]; buf[0] = '\0'; while (pkg != NULL) { strcat (buf, pkg->key->name); pkg = pkg->next; if (pkg != NULL) strcat (buf, "."); } return buf; } void generate_code_csharp (batch *b) { umlclasslist tmplist = b->classlist; FILE *licensefile = NULL; /* open license file */ if (b->license != NULL) { licensefile = fopen (b->license, "r"); if (!licensefile) { fprintf (stderr, "Can't open the license file.\n"); exit (1); } } while (tmplist != NULL) { char *tmpname; char outfilename[90]; umlclasslist used_classes; if (is_present (b->classes, tmplist->key->name) ^ b->mask) { tmplist = tmplist->next; continue; } sprintf (outfilename, "%s.cs", tmplist->key->name); spec = open_outfile (outfilename, b); if (spec == NULL) { tmplist = tmplist->next; continue; } /* add license to the header */ if (b->license != NULL) { char lc; rewind (licensefile); while ((lc = fgetc (licensefile)) != EOF) print ("%c", lc); } emit ("%s", "using System;\n\n"); /* We generate the import clauses */ used_classes = list_classes (tmplist, b); if (used_classes != NULL) { while (used_classes != NULL) { umlpackagelist pkg = make_package_list (used_classes->key->package); if (pkg != NULL) { if (strcmp (pkg->key->id, tmplist->key->package->id)) { /* This class' package and our current class' package are not the same */ emit ("using %s.%s;\n", pkgname (pkg), used_classes->key->name); } } else { /* No info for this class' package, we include it directly */ /*emit ("import %s;\n",used_classes->key->name);*/ } used_classes = used_classes->next; } emit ("\n"); } if (tmplist->key->package != NULL) { umlpackagelist pkg = make_package_list (tmplist->key->package); emit ("namespace %s {\n\n", pkgname (pkg)); indentlevel++; } print ("public "); tmpname = strtolower (tmplist->key->stereotype); if (eq ("interface", tmpname)) { emit ("interface "); } else { if (tmplist->key->isabstract) { emit ("interface "); } else emit ("class "); } free (tmpname); emit ("%s", tmplist->key->name); if (tmplist->parents != NULL) { umlclasslist parents = tmplist->parents; while (parents != NULL) { tmpname = strtolower (parents->key->stereotype); if (eq (tmpname, "interface")) { emit (" : "); } else { emit (" : "); } free (tmpname); emit ("%s", parents->key->name); parents = parents->next; } } emit (" {\n\n"); indentlevel++; if (tmplist->key->attributes != NULL) { umlattrlist umla = tmplist->key->attributes; print ("// Attributes\n"); while (umla != NULL) { switch (umla->key.visibility) { case '0': print ("public "); break; case '1': print ("private "); break; case '2': print ("protected "); break; } if (umla->key.isstatic) { emit ("static "); } emit ("%s %s", umla->key.type, umla->key.name); if (umla->key.value[0] != 0) { emit (" = %s", umla->key.value); } emit (";\n"); umla = umla->next; } emit ("\n"); } if (tmplist->associations != NULL) { umlassoclist assoc = tmplist->associations; print ("// Associations \n"); while (assoc != NULL) { /* Not sure how to do this actually...*/ if (assoc->composite ) print ("protected "); else print ("private "); emit ("%s %s;\n", assoc->key->name, assoc->name); assoc = assoc->next; } emit ("\n"); } if (tmplist->key->operations != NULL) { umloplist umlo = tmplist->key->operations; while (umlo != NULL) { umlattrlist tmpa = umlo->key.parameters; print ("// Operation\n"); while (tmpa != NULL) { print ("// param %s\n", tmpa->key.name); tmpa = tmpa->next; } if (strcmp (umlo->key.attr.type, "void")) print ("// return %s\n", umlo->key.attr.type); print (""); if (umlo->key.attr.isabstract) { /*emit ("public ");*/ umlo->key.attr.value[0] = '0'; } else { switch (umlo->key.attr.visibility) { case '0': emit ("public "); break; case '1': emit ("private "); break; case '2': emit ("protected "); break; } } if (umlo->key.attr.isstatic) { emit ("static "); } if (strlen (umlo->key.attr.type) > 0) { emit ("%s ", umlo->key.attr.type); } emit ("%s (", umlo->key.attr.name); tmpa = umlo->key.parameters; while (tmpa != NULL) { emit ("%s %s", tmpa->key.type, tmpa->key.name); /* if ( tmpa->key.value[0] != 0 ){ emit (" = %s",tmpa->key.value); } */ tmpa = tmpa->next; if (tmpa != NULL) emit (", "); } emit (")"); if (umlo->key.attr.isabstract ) { emit (";\n"); } else { emit ("\n"); print ("{\n"); indentlevel++; if (umlo->key.implementation != NULL) { print ("%s\n", umlo->key.implementation); } else if (strcmp (umlo->key.attr.type, "void") != 0) { print ("%s\n", "throw new System.Exception (\"Not implemented yet!\");"); } indentlevel--; print ("}\n"); } umlo = umlo->next; } emit ("\n"); } indentlevel--; print ("}\n\n"); if (tmplist->key->package != NULL) { indentlevel--; print ("}\n\n"); } fclose (spec); tmplist = tmplist->next; } } dia2code-0.8.3/dia2code/code_generators.h0100644000076400001440000000306510547512631017542 0ustar kelloggusers/*************************************************************************** code_generators.h - Header for the code generating functions ------------------- begin : Sat Dec 16 2000 copyright : (C) 2000-2001 by Javier O'Hara email : joh314@users.sourceforge.net ***************************************************************************/ /*************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * ***************************************************************************/ #include "dia2code.h" #define NO_GENERATORS 12 void generate_code_c(batch *b); void generate_code_cpp(batch *b); void generate_code_java(batch *b); void generate_code_sql(batch *b); void generate_code_ada(batch *b); void generate_code_python(batch *b); void generate_code_php(batch *b); void generate_code_shp(batch *b); void generate_code_idl(batch *b); void generate_code_csharp(batch *b); void generate_code_php_five(batch *b); void generate_code_ruby(batch *b); void inherit_attributes(umlclasslist, umlattrlist); dia2code-0.8.3/dia2code/generate_code_c.c0100644000076400001440000003433707457104222017465 0ustar kelloggusers/*************************************************************************** generate_code_c.c - Function that generates C code ------------------- begin : Tue Jan 2 2001 copyright : (C) 2001 by Ruben Lopez email : ryu@gpul.org ***************************************************************************/ /*************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * ***************************************************************************/ #include "dia2code.h" void generate_code_c(batch *b) { umlclasslist tmplist, parents; umlassoclist associations; int tmpv; umlattrlist umla, tmpa; umloplist umlo; char *tmpname; char outfilename[256]; FILE * outfileh, *outfilecpp, *dummyfile, *licensefile = NULL; namelist classes_used, tmpclass; int tmpdirlgth, tmpfilelgth; if (b->outdir == NULL) { b->outdir = "."; } tmpdirlgth = strlen(b->outdir); tmplist = b->classlist; /* open license file */ if ( b->license != NULL ) { licensefile = fopen(b->license, "r"); if(!licensefile) { fprintf(stderr, "Can't open the license file.\n"); exit(2); } } while ( tmplist != NULL ) { if ( ! ( is_present(b->classes, tmplist->key->name) ^ b->mask ) ) { tmpname = strtolower(tmplist->key->name); /* This prevents buffer overflows */ tmpfilelgth = strlen(tmpname); if (tmpfilelgth + tmpdirlgth > sizeof(*outfilename) - 2) { fprintf(stderr, "Sorry, name of file too long ...\nTry a smaller dir name\n"); exit(4); } sprintf(outfilename, "%s/%s.h", b->outdir, tmpname); dummyfile = fopen(outfilename, "r"); if ( b->clobber || ! dummyfile ) { outfileh = fopen(outfilename, "w"); if ( outfileh == NULL ) { fprintf(stderr, "Can't open file %s for writing\n", outfilename); exit(3); } /* This prevents buffer overflows */ tmpfilelgth = strlen(tmpname); if (tmpfilelgth + tmpdirlgth > sizeof(*outfilename) - 2) { fprintf(stderr, "Sorry, name of file too long ...\nTry a smaller dir name\n"); exit(4); } sprintf(outfilename, "%s/%s.c", b->outdir, tmpname); outfilecpp = fopen(outfilename, "w"); if ( outfilecpp == NULL ) { fprintf(stderr, "Can't open file %s for writing\n", outfilename); exit(3); } /* add license to the header */ if(b->license != NULL){ char lc; rewind(licensefile); while((lc = fgetc(licensefile)) != EOF){ fprintf(outfileh,"%c",lc); fprintf(outfilecpp,"%c",lc); } } fprintf(outfilecpp, "#include \"%s.h\"\n\n", tmpname); free(tmpname); tmpname = strtoupper(tmplist->key->name); fprintf(outfileh, "#ifndef __%s_H__\n", tmpname); fprintf(outfileh, "#define __%s_H__\n\n", tmpname); fprintf(outfileh, "#define %s(OBJ) ((%s*)OBJ)\n\n", tmpname, tmplist->key->name); free(tmpname); fprintf(outfileh, "#ifndef String\n#define String char*\n#endif\n\n"); classes_used = find_classes(tmplist, b); tmpclass = classes_used; while (tmpclass != NULL) { tmpname = strtolower(tmpclass->name); fprintf(outfileh, "#include \"%s.h\"\n", tmpname); tmpclass = tmpclass->next; free(tmpname); } fprintf(outfileh, "\n"); if ( strlen(tmplist->key->stereotype) > 0 ) { fprintf(outfileh, "// %s\n", tmplist->key->stereotype); } fprintf(outfileh, "typedef struct _%s %s;\n\n", tmplist->key->name, tmplist->key->name); fprintf(outfileh, "struct _%s", tmplist->key->name); fprintf(outfileh, " {\n"); parents = tmplist->parents; if (parents != NULL) { fprintf(outfileh, "%s super;\n", parents->key->name); } fprintf(outfileh, " /** Attributes **/\n"); tmpv = -1; umla = tmplist->key->attributes; while ( umla != NULL) { if (!umla->key.isstatic) { fprintf(outfileh, " "); if ( tmpv != umla->key.visibility ) { switch (umla->key.visibility) { case '0': fprintf (outfileh, "/*public*/\n "); break; case '1': fprintf (outfileh, "/*private*/\n "); break; case '2': fprintf (outfileh, "/*protected*/\n "); break; } tmpv = umla->key.visibility; } else { fprintf (outfileh, " "); } fprintf(outfileh, "%s %s", umla->key.type, umla->key.name); /*if ( umla->key.value[0] != 0 && umla->key.isstatic) { fprintf(outfilecpp,"%s %s::%s",umla->key.type,tmplist->key->name,umla->key.name); fprintf(outfilecpp," = %s",umla->key.value); fprintf(outfilecpp,";\n"); }*/ fprintf(outfileh, ";\n"); } else { fprintf(outfilecpp, "static %s %s", umla->key.type, umla->key.name); fprintf(outfilecpp, " = %s", umla->key.value); fprintf(outfilecpp, ";\n"); } umla = umla->next; } fprintf(outfileh, " /** Associations **/\n"); associations = tmplist->associations; while ( associations != NULL) { fprintf(outfileh, " %s ", associations->key->name); if (associations->composite == 0) { fprintf(outfileh, "* "); } fprintf(outfileh, "%s;\n", associations->name); associations = associations->next; } /***** VIRTUAL METHODS *****/ /* Virtuald methods should be in the structure */ umlo = tmplist->key->operations; fprintf(outfileh, "/** Operations **/\n"); tmpv = -1; while ( umlo != NULL) { if ( umlo->key.attr.isabstract ) { if ( tmpv != umlo->key.attr.visibility ) { switch (umlo->key.attr.visibility) { case '0': fprintf(outfileh, "/*public*/\n"); break; case '1': fprintf(outfileh, "/*private*/\n"); break; case '2': fprintf(outfileh, "/*protected*/\n"); break; } tmpv = umlo->key.attr.visibility; } if ( umlo->key.attr.isstatic ) { /*static virtual methods are not supported yet */ } else { fprintf(outfileh, "%s (*%s) ( %s *this", umlo->key.attr.type, umlo->key.attr.name, tmplist->key->name); if ( ! umlo->key.attr.isabstract ) { fprintf(outfilecpp, "%s %s_%s ( %s *this", umlo->key.attr.type, tmplist->key->name, umlo->key.attr.name, tmplist->key->name); } } tmpa = umlo->key.parameters; if (tmpa != NULL) { fprintf(outfileh, ", "); } while (tmpa != NULL) { fprintf(outfileh, "%s %s", tmpa->key.type, tmpa->key.name); if ( ! umlo->key.attr.isabstract ) { fprintf(outfilecpp, "%s %s", tmpa->key.type, tmpa->key.name); } /*if ( tmpa->key.value[0] != 0 ) { fprintf(outfileh," = %s",tmpa->key.value); if ( ! umlo->key.attr.isabstract ) { fprintf(outfilecpp," = %s",tmpa->key.value); } }*/ tmpa = tmpa->next; if (tmpa != NULL) { fprintf(outfileh, ", "); } } fprintf(outfileh, " )"); if ( umlo->key.attr.value[0] != 0 ) { fprintf(outfileh, " = %s", umlo->key.attr.value); } fprintf(outfileh, ";\n"); } umlo = umlo->next; } fprintf(outfileh, "};\n\n"); /***** ALL METHODS ******/ umlo = tmplist->key->operations; fprintf(outfileh, "/** Operations **/\n"); tmpv = -1; while ( umlo != NULL) { if ( tmpv != umlo->key.attr.visibility ) { switch (umlo->key.attr.visibility) { case '0': fprintf(outfileh, "/*public*/\n"); break; case '1': fprintf(outfileh, "/*private*/\n"); break; case '2': fprintf(outfileh, "/*protected*/\n"); break; } tmpv = umlo->key.attr.visibility; } if ( umlo->key.attr.isstatic ) { /*static methods doesn't receive the instance */ fprintf(outfileh, "%s %s_%s ( ", umlo->key.attr.type, tmplist->key->name, umlo->key.attr.name); fprintf(outfilecpp, "%s %s_%s ( ", umlo->key.attr.type, tmplist->key->name, umlo->key.attr.name); } else { fprintf(outfileh, "%s %s_%s ( %s *this", umlo->key.attr.type, tmplist->key->name, umlo->key.attr.name, tmplist->key->name); fprintf(outfilecpp, "%s %s_%s ( %s *this", umlo->key.attr.type, tmplist->key->name, umlo->key.attr.name, tmplist->key->name); } tmpa = umlo->key.parameters; if (tmpa != NULL) { fprintf(outfileh, ", "); fprintf(outfilecpp, ", "); } while (tmpa != NULL) { fprintf(outfileh, "%s %s", tmpa->key.type, tmpa->key.name); fprintf(outfilecpp, "%s %s", tmpa->key.type, tmpa->key.name); /*if ( tmpa->key.value[0] != 0 ) { fprintf(outfileh," = %s",tmpa->key.value); if ( ! umlo->key.attr.isabstract ) { fprintf(outfilecpp," = %s",tmpa->key.value); } }*/ tmpa = tmpa->next; if (tmpa != NULL) { fprintf(outfileh, ", "); if ( ! umlo->key.attr.isabstract ) { fprintf(outfilecpp, ", "); } } } fprintf(outfileh, " )"); fprintf(outfilecpp, " )"); if ( umlo->key.attr.value[0] != 0 ) { fprintf(outfileh, " = %s", umlo->key.attr.value); } fprintf(outfileh, ";\n"); if ( umlo->key.attr.isabstract ) { fprintf(outfilecpp, "{\n this->%s(", umlo->key.attr.name); tmpa = umlo->key.parameters; if (tmpa != NULL) { fprintf(outfilecpp, "this, "); } else { fprintf(outfilecpp, "this"); } while (tmpa != NULL) { fprintf(outfilecpp, "%s", tmpa->key.name); tmpa = tmpa->next; if (tmpa != NULL) { fprintf(outfilecpp, ", "); } } fprintf(outfilecpp, ");\n}\n\n"); } else { fprintf(outfilecpp, "{\n}\n\n"); } umlo = umlo->next; } fprintf(outfileh, "#endif\n"); fclose(outfileh); fclose(outfilecpp); } } tmplist = tmplist->next; } } dia2code-0.8.3/dia2code/generate_code_ada.c0100644000076400001440000005162610547512631017771 0ustar kelloggusers/*************************************************************************** generate_code_ada.c - description ------------------- begin : 2001-07-18 copyright : (C) 2001 by Thomas Preymesser (C) 2002 by Oliver Kellogg email : tp@thopre.de okellogg@users.sourceforge.net ***************************************************************************/ /*************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * ***************************************************************************/ #include "dia2code.h" #include "decls.h" #include "includes.h" #define PACKAGE_EXT "_types" #define SPEC_EXT "ads" #define BODY_EXT "adb" int use_convention_c = 0; /* Temporarily here. */ int strict_corba = 0; /* Should be turned into command line options. */ static batch *gb; /* The current batch being processed. */ /* Utilities. */ static void check_umlattr (umlattribute *u, char *typename) { /* Check settings that don't make sense for Ada generation. */ if (u->visibility == '1') fprintf (stderr, "%s/%s: ignoring non-visibility\n", typename, u->name); if (u->isstatic) fprintf (stderr, "%s/%s: ignoring staticness\n", typename, u->name); } static char * subst (char *str, char search, char replace) { char *p; while ((p = strchr (str, search)) != NULL) *p = replace; return str; } static char * nospc (char *str) { return subst (str, ' ', '_'); } static int is_oo_class (umlclass *cl) { char *st; if (cl == NULL) return 0; st = cl->stereotype; if (strlen (st) == 0) return 1; return (!eq (st, "CORBAConstant") && !eq (st, "CORBATypedef") && !is_enum_stereo (st) && !eq (st, "CORBAStruct") && !eq (st, "CORBAUnion") && !eq (st, "CORBAException")); } static int has_oo_class (declaration *d) { while (d != NULL) { if (d->decl_kind == dk_module) { if (has_oo_class (d->u.this_module->contents)) return 1; } else { /* dk_class */ if (is_oo_class (d->u.this_class->key)) return 1; } d = d->next; } return 0; } static char * adaname (char *name) { static char buf[80]; if (use_corba && (eq (name, "boolean") || eq (name, "char") || eq (name, "octet") || eq (name, "short") || eq (name, "long") || eq (name, "long long") || eq (name, "unsigned short") || eq (name, "unsigned long") || eq (name, "unsigned long long") || eq (name, "float") || eq (name, "double") || eq (name, "string") || eq (name, "any"))) { sprintf (buf, "CORBA.%s", nospc (strtoupperfirst (name))); } else { umlclassnode *ref = find_by_name (gb->classlist, name); strcpy (buf, name); if (ref != NULL && is_oo_class (ref->key)) strcat (buf, ".Value_Ref"); } return buf; } static void do_operations (char *typename, umloplist umlo, int in_valuetype) { if (umlo == NULL) return; print ("-- Operations\n\n"); while (umlo != NULL) { int use_procedure = (strlen (umlo->key.attr.type) == 0 || eq (umlo->key.attr.type, "void")); umlattrlist parm = umlo->key.parameters; print (""); if (use_procedure) emit ("procedure"); else emit ("function "); emit (" %s (", umlo->key.attr.name); if (! umlo->key.attr.isstatic) { emit ("Self : access Object"); if (parm != NULL) emit (";\n"); } else { emit ("\n"); } indentlevel += 5; while (parm != NULL) { /* FIXME: Add support for parameter modes in dia. */ print ("%s : in %s", parm->key.name, adaname (parm->key.type)); if (parm->key.value[0] != 0) emit (" := %s", parm->key.value); parm = parm->next; if (parm != NULL) { emit (";\n"); } } emit (")"); if (! use_procedure) emit (" return %s", adaname (umlo->key.attr.type)); if (umlo->key.attr.isabstract || in_valuetype) emit (" is abstract"); /* TBH, we have no way of generating a meaningful implementation. Instead, the user shall derive from this class and implement the UML defined methods in the derived class. */ emit (";\n\n"); indentlevel -= 5; umlo = umlo->next; } } static char * fqname (umlclassnode *node, int use_ref_type) { static char buf[256]; buf[0] = '\0'; if (node == NULL) return buf; if (node->key->package != NULL) { umlpackagelist pkglist = make_package_list (node->key->package); while (pkglist != NULL) { strcat (buf, pkglist->key->name); strcat (buf, "."); pkglist = pkglist->next; } } strcat (buf, node->key->name); if (is_oo_class (node->key)) { if (use_ref_type) strcat (buf, ".Value_Ref"); else strcat (buf, ".Object"); } return buf; } static int gen_static_attributes (umlattrlist umla, int do_private) { int number_of_static_attributes = 0; int did_output = 0; while (umla != NULL) { char *member = umla->key.name; umlclassnode *ref; if (!umla->key.isstatic || (umla->key.visibility == '0' && do_private || umla->key.visibility != '0' && !do_private)) { umla = umla->next; continue; } number_of_static_attributes++; if (! did_output) { print ("-- Static attributes\n\n"); did_output = 1; } ref = find_by_name (gb->classlist, umla->key.type); if (umla->key.visibility == '0' && !do_private) { pboth ("procedure Set_%s (To : ", member); if (ref != NULL) eboth ("%s", fqname (ref, 1)); else eboth ("%s", adaname (umla->key.type)); eboth (")"); emit (";\n"); ebody (" is\n"); pbody ("begin\n"); pbody (" %s := To;\n", member); pbody ("end Set_%s;\n\n", member); pboth ("function Get_%s return ", member); if (ref != NULL) eboth ("%s", fqname (ref, 1)); else eboth ("%s", adaname (umla->key.type)); emit (";\n\n"); ebody (" is\n"); pbody ("begin\n"); pbody (" return %s;\n", member); pbody ("end Get_%s;\n\n", member); } if (do_private) { print ("%s : ", member); if (ref != NULL) emit ("%s", fqname (ref, 0)); else emit ("%s", adaname (umla->key.type)); emit (";\n\n"); } } return number_of_static_attributes; } static void gen_class (umlclassnode *node, int do_valuetype) { char *name = node->key->name; char parentname[80]; int n_static_attrs; pboth ("package "); ebody ("body "); eboth ("%s is\n\n", name); indentlevel++; n_static_attrs = gen_static_attributes (node->key->attributes, 0); if (do_valuetype && n_static_attrs > 0) { fprintf (stderr, "Static attributes not permitted for %s\n", name); } print ("type Object is "); if (node->key->isabstract) emit ("abstract "); parentname[0] = '\0'; if (node->parents != NULL) { umlclassnode *parent = node->parents; sprintf (parentname, "%s.Object", parent->key->name); if (parent->next != NULL) fprintf (stderr, "Warning: multiple inheritance NYI (%s)\n", name); } else if (do_valuetype) { sprintf (parentname, "CORBA.Value.Base"); } if (parentname[0]) emit ("new %s with", parentname); else emit ("tagged"); emit (" private;\n\n"); print ("type Value_Ref is access all Object'Class;\n\n"); if (node->key->attributes) { umlattrlist umla = node->key->attributes; int did_output = 0; while (umla != NULL) { char *member = umla->key.name; umlclassnode *ref; if (umla->key.visibility != '0' || umla->key.isstatic) { umla = umla->next; continue; } if (! did_output) { print ("-- Public attributes\n\n"); did_output = 1; } pboth ("procedure Set_%s (Self : access Object; To : ", member); ref = find_by_name (gb->classlist, umla->key.type); if (ref != NULL) eboth ("%s", fqname (ref, 1)); else eboth ("%s", adaname (umla->key.type)); eboth (")"); emit (";\n"); ebody (" is\n"); pbody ("begin\n"); pbody (" Self.%s := To;\n", member); pbody ("end Set_%s;\n\n", member); pboth ("function Get_%s (Self : access Object) return ", member); if (ref != NULL) eboth ("%s", fqname (ref, 1)); else eboth ("%s", adaname (umla->key.type)); emit (";\n\n"); ebody (" is\n"); pbody ("begin\n"); pbody (" return Self.%s;\n", member); pbody ("end Get_%s;\n\n", member); umla = umla->next; } } do_operations (name, node->key->operations, do_valuetype); indentlevel--; print ("private\n\n"); indentlevel++; n_static_attrs = gen_static_attributes (node->key->attributes, 1); if (do_valuetype && n_static_attrs > 0) { fprintf (stderr, "Static attributes not permitted for %s\n", name); } print ("type Object is "); if (node->key->isabstract) emit ("abstract "); if (parentname[0]) emit ("new %s with", parentname); else emit ("tagged"); emit (" record\n"); indentlevel++; if (node->key->attributes) { umlattrlist umla = node->key->attributes; print ("-- Attributes\n"); while (umla != NULL) { umlclassnode *ref; if (umla->key.isstatic) { umla = umla->next; continue; } print ("%s : ", umla->key.name); ref = find_by_name (gb->classlist, umla->key.type); if (ref != NULL) emit ("%s", fqname (ref, 1)); else emit ("%s", adaname (umla->key.type)); emit (";\n"); umla = umla->next; } } else if (node->associations == NULL) { print ("null;\n"); } if (node->associations) { umlassoclist assoc = node->associations; print ("-- Associations\n"); while (assoc != NULL) { umlclassnode *ref; ref = find_by_name (gb->classlist, assoc->key->name); print ("%s : ", assoc->name); if (ref != NULL) { if (is_oo_class (ref->key) && do_valuetype && assoc->composite) fprintf (stderr, "Association %s cannot be composite\n", assoc->key->name); emit ("%s", fqname (ref, !assoc->composite)); } else { emit ("%s", adaname (assoc->key->name)); } emit (";\n"); assoc = assoc->next; } } indentlevel--; print ("end record;\n\n"); indentlevel--; pboth ("end %s;\n\n", name); } static void convention_c (char *name) { if (use_convention_c) print ("pragma Convention (C, %s);\n", name); } static void gen_decl (declaration *d) { char *name; char *stype; umlclassnode *node; umlattrlist umla; if (d == NULL) return; if (d->decl_kind == dk_module) { name = d->u.this_module->pkg->name; pboth ("package "); ebody ("body "); eboth ("%s is\n\n", name); indentlevel++; d = d->u.this_module->contents; while (d != NULL) { gen_decl (d); d = d->next; } indentlevel--; pboth ("end %s;\n\n", name); return; } node = d->u.this_class; stype = node->key->stereotype; name = node->key->name; umla = node->key->attributes; if (strlen (stype) == 0) { gen_class (node, 0); return; } if (eq (stype, "CORBANative")) { print ("-- CORBANative: %s\n\n", name); } else if (eq (stype, "CORBAConstant")) { if (umla == NULL) { fprintf (stderr, "Error: first attribute not set at %s\n", name); exit (1); } if (strlen (umla->key.name) > 0) fprintf (stderr, "Warning: ignoring attribute name at %s\n", name); print ("%s : constant %s := %s;\n\n", name, adaname (umla->key.type), umla->key.value); } else if (is_enum_stereo (stype)) { print ("type %s is (\n", name); indentlevel++; while (umla != NULL) { char *literal = umla->key.name; check_umlattr (¨a->key, name); if (strlen (umla->key.type) > 0) fprintf (stderr, "%s/%s: ignoring type\n", name, literal); print ("%s", literal); if (umla->next) emit (",\n"); umla = umla->next; } emit (");\n"); indentlevel--; convention_c (name); emit ("\n"); } else if (eq (stype, "CORBAStruct")) { print ("type %s is record\n", name); indentlevel++; while (umla != NULL) { check_umlattr (¨a->key, name); print ("%s : %s", umla->key.name, adaname (umla->key.type)); if (strlen (umla->key.value) > 0) emit (" := %s", umla->key.value); emit (";\n"); umla = umla->next; } indentlevel--; print ("end record;\n"); convention_c (name); emit ("\n"); } else if (eq (stype, "CORBAException")) { print ("%s : exception;\n\n", name); if (strict_corba) { print ("type %s_Members is new CORBA.IDL_Exception_Members" " with record\n", name); indentlevel++; while (umla != NULL) { check_umlattr (¨a->key, name); print ("%s : %s;\n", umla->key.name, adaname (umla->key.type)); umla = umla->next; } indentlevel--; print ("end record;\n\n"); } } else if (eq (stype, "CORBAUnion")) { umlattrnode *sw = umla; char swname[80]; if (sw == NULL) { fprintf (stderr, "Error: attributes not set at union %s\n", name); exit (1); } if (strlen (sw->key.name) == 0) sprintf (swname, "Switch"); else sprintf (swname, "%s", sw->key.name); print ("type %s (%s : %s := %s'First) is record\n", name, swname, sw->key.type, sw->key.type); indentlevel++; print ("case %s is\n", swname); indentlevel++; umla = umla->next; while (umla != NULL) { check_umlattr (¨a->key, name); print ("when %s =>\n", umla->key.value); print (" %s : %s;\n", umla->key.name, adaname (umla->key.type)); umla = umla->next; } indentlevel--; print ("end case;\n"); indentlevel--; print ("end record;\n"); convention_c (name); emit ("\n"); } else if (eq (stype, "CORBATypedef")) { char dim[80]; /* Conventions for CORBATypedef: The first (and only) attribute contains the following: Name: Empty - the name is taken from the class. Type: Name of the original type which is typedefed. Value: Optionally contains array dimension(s) of the typedef. These dimensions are given in square brackets, e.g. [3][10] */ if (umla == NULL) { fprintf (stderr, "Error: first attribute (impl type) not set " "at typedef %s\n", name); exit (1); } if (strlen (umla->key.name) > 0) { fprintf (stderr, "Warning: typedef %s: ignoring name field " "in implementation type attribute\n", name); } if (*umla->key.value) { strcpy (dim, umla->key.value); subst (dim, '[', '('); subst (dim, ']', ')'); } else { dim[0] = '\0'; } print (""); if (!*dim && !strict_corba) emit ("sub"); emit ("type %s is ", name); if (*dim) { emit ("array ("); if (strict_corba) emit ("0 .. "); else emit ("1 .. "); emit ("%s", dim); /* multi-dimension support is TBD */ emit (" of "); } else if (strict_corba) { emit ("new "); } emit ("%s;\n\n", adaname (umla->key.type)); } else if (eq (stype, "CORBAValue")) { gen_class (node, 1); } else { print ("-- %s\n", stype); gen_class (node, 0); } } static char * make_filename (char *name, int do_body) { static char outfname[256]; char *filebase = strtolower (name); subst (filebase, '.', '-'); if (do_body) sprintf (outfname, "%s.%s", filebase, body_file_ext); else sprintf (outfname, "%s.%s", filebase, file_ext); return outfname; } void generate_code_ada (batch *b) { declaration *d; umlclasslist tmplist = b->classlist; FILE *licensefile = NULL; gb = b; if (file_ext == NULL) file_ext = SPEC_EXT; if (body_file_ext == NULL) body_file_ext = BODY_EXT; /* open license file */ if (b->license != NULL) { licensefile = fopen (b->license, "r"); if (!licensefile) { fprintf (stderr, "Can't open the license file.\n"); exit (1); } } while (tmplist != NULL) { if (! (is_present (b->classes, tmplist->key->name) ^ b->mask)) { push (tmplist, b); } tmplist = tmplist->next; } set_number_of_spaces_for_one_indentation (3); /* Generate a file for each outer declaration. */ d = decls; while (d != NULL) { char *name, basename[256]; int synthesize_package = 0; int need_body = 0; if (d->decl_kind == dk_module) { name = d->u.this_module->pkg->name; strcpy (basename, name); need_body = has_oo_class (d->u.this_module->contents); } else { /* dk_class */ name = d->u.this_class->key->name; strcpy (basename, name); if (is_oo_class (d->u.this_class->key)) { need_body = 1; } else { strcat (basename, PACKAGE_EXT); synthesize_package = 1; } } spec = open_outfile (make_filename (basename, 0), b); if (spec == NULL) { d = d->next; continue; } /* add license to the header */ if (b->license != NULL) { char lc; rewind (licensefile); while ((lc = fgetc (licensefile)) != EOF) print ("%c", lc); } includes = NULL; determine_includes (d, b); if (use_corba) print ("with CORBA.Value;\n\n"); if (includes) { namelist incfile = includes; while (incfile != NULL) { if (!eq (incfile->name, name)) { print ("with %s;\n", incfile->name); } incfile = incfile->next; } print ("\n"); } if (synthesize_package) { emit ("package %s is\n\n", basename); indentlevel++; } else if (need_body) { body = open_outfile (make_filename (basename, 1), b); } else { body = NULL; } gen_decl (d); if (synthesize_package) { indentlevel--; emit ("end %s;\n\n", basename); } else if (body != NULL) { fclose (body); body = NULL; } fclose (spec); d = d->next; } } dia2code-0.8.3/dia2code/generate_code_cpp.c0100644000076400001440000004526707631424565020042 0ustar kelloggusers/*************************************************************************** generate_code_cpp.c - Function that generates C++ code ------------------- begin : Sat Dec 16 2000 copyright : (C) 2000-2001 by Javier O'Hara (C) 2002 by Oliver Kellogg email : joh314@users.sourceforge.net okellogg@users.sourceforge.net ***************************************************************************/ /*************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * ***************************************************************************/ /* NB: If you use CORBA stereotypes, you will need the file p_orb.h found in the runtime/cpp directory. */ #include "dia2code.h" #include "decls.h" #include "includes.h" #define SPEC_EXT "h" #define BODY_EXT "cpp" #define eq !strcmp static batch *gb; /* The current batch being processed. */ /* Utilities. */ static void check_umlattr (umlattribute *u, char *typename) { /* Check settings that don't make sense for C++ generation. */ if (u->visibility == '1') fprintf (stderr, "%s/%s: ignoring non-visibility\n", typename, u->name); if (u->isstatic) fprintf (stderr, "%s/%s: ignoring staticness\n", typename, u->name); } static char * subst (char *str, char search, char replace) { char *p; while ((p = strchr (str, search)) != NULL) *p = replace; return str; } static char * nospc (char *str) { return subst (str, ' ', '_'); } static int pass_by_reference (umlclass *cl) { char *st; if (cl == NULL) return 0; st = cl->stereotype; if (strlen (st) == 0) return 1; if (eq (st, "CORBATypedef")) { umlattrlist umla = cl->attributes; umlclassnode *ref = find_by_name (gb->classlist, cl->name); if (ref == NULL) return 0; return pass_by_reference (ref->key); } return (!eq (st, "CORBAConstant") && !is_enum_stereo (st)); } static int is_oo_class (umlclass *cl) { char *st; if (cl == NULL) return 0; st = cl->stereotype; if (strlen (st) == 0) return 1; return (!eq (st, "CORBAConstant") && !eq (st, "CORBATypedef") && !is_enum_stereo (st) && !eq (st, "CORBAStruct") && !eq (st, "CORBAUnion") && !eq (st, "CORBAException")); } static int has_oo_class (declaration *d) { while (d != NULL) { if (d->decl_kind == dk_module) { if (has_oo_class (d->u.this_module->contents)) return 1; } else { /* dk_class */ if (is_oo_class (d->u.this_class->key)) return 1; } d = d->next; } return 0; } static char * cppname (char *name) { static char buf[80]; if (use_corba) { if (eq (name, "boolean") || eq (name, "char") || eq (name, "octet") || eq (name, "short") || eq (name, "long") || eq (name, "float") || eq (name, "double") || eq (name, "string") || eq (name, "any")) { sprintf (buf, "CORBA::%s", strtoupperfirst (name)); } else if (eq (name, "long long")) { sprintf (buf, "CORBA::LongLong"); } else if (eq (name, "unsigned short")) { sprintf (buf, "CORBA::UShort"); } else if (eq (name, "unsigned long")) { sprintf (buf, "CORBA::ULong"); } else if (eq (name, "unsigned long long")) { sprintf (buf, "CORBA::ULongLong"); } else { strcpy (buf, name); } } else { strcpy (buf, name); } return buf; } static char * fqname (umlclassnode *node, int use_ref_type) { static char buf[256]; buf[0] = '\0'; if (node == NULL) return buf; if (node->key->package != NULL) { umlpackagelist pkglist = make_package_list (node->key->package); while (pkglist != NULL) { strcat (buf, pkglist->key->name); strcat (buf, "::"); pkglist = pkglist->next; } } strcat (buf, node->key->name); if (use_ref_type) strcat (buf, "*"); return buf; } static void check_visibility (int *curr_vis, int new_vis) { if (*curr_vis == new_vis) return; indentlevel--; switch (new_vis) { case '0': print ("public:\n"); break; case '1': print ("private:\n"); break; case '2': print ("protected:\n"); break; } *curr_vis = new_vis; indentlevel++; } static void gen_class (umlclassnode *node) { char *name = node->key->name; char *stype = node->key->stereotype; int is_valuetype = 0; if (strlen (stype) > 0) { print ("// %s\n", stype); is_valuetype = eq (stype, "CORBAValue"); } print("/// class %s - %s\n", name, node->key->comment); if (node->key->templates != NULL) { umltemplatelist template = node->key->templates; if (is_valuetype) { fprintf (stderr, "CORBAValue %s: template ignored\n", name); } else { print ("template <"); while (template != NULL) { print ("%s %s", template->key.type, template->key.name); template = template->next; if (template != NULL) emit (", "); } emit (">\n"); } } print ("class %s", name); if (node->parents != NULL) { umlclasslist parent = node->parents; emit (" : "); while (parent != NULL) { emit ("public %s", parent->key->name); parent = parent->next; if (parent != NULL) emit (", "); } } else if (is_valuetype) { emit (" : CORBA::ValueBase"); } emit (" {\n"); indentlevel++; if (node->associations != NULL) { umlassoclist assoc = node->associations; print ("// Associations\n"); /* * The associations are mapped as private members. * Is that really what we want? * (For example, other UML tools additionally generate * setters/getters.) Ideas and comments welcome. */ while (assoc != NULL) { umlclassnode *ref; ref = find_by_name (gb->classlist, assoc->key->name); print (""); if (ref != NULL) emit ("%s", fqname (ref, !assoc->composite)); else emit ("%s", cppname (assoc->key->name)); emit (" %s;\n", assoc->name); assoc = assoc->next; } } if (node->key->attributes != NULL) { umlattrlist umla = node->key->attributes; if (is_valuetype) { print ("// Public state members\n"); indentlevel--; print ("public:\n"); indentlevel++; while (umla != NULL) { char *member = umla->key.name; umlclassnode *ref; if (umla->key.visibility != '0') { umla = umla->next; continue; } print (""); if (umla->key.isstatic) { fprintf (stderr, "CORBAValue %s/%s: static not supported\n", name, member); } ref = find_by_name (gb->classlist, umla->key.type); if (ref != NULL) eboth ("%s", fqname (ref, 1)); else eboth ("%s", cppname (umla->key.type)); emit (" %s () { return _%s; }\n", member, member); print ("void %s (", member); if (ref != NULL) { int by_ref = pass_by_reference (ref->key); if (by_ref) emit ("const "); emit ("%s", fqname (ref, 1)); if (by_ref) emit ("&"); } else { emit ("%s", cppname (umla->key.type)); } emit (" value_) { _%s = value_; }\n"); umla = umla->next; } } else { int tmpv = -1; print ("// Attributes\n"); while (umla != NULL) { check_visibility (&tmpv, umla->key.visibility); if (strlen(umla->key.comment)) { print("/// %s\n", umla->key.comment); } print (""); if (umla->key.isstatic) { emit ("static "); } emit ("%s %s", umla->key.type, umla->key.name); emit (";\n"); umla = umla->next; } } } if (node->key->operations != NULL) { umloplist umlo = node->key->operations; int tmpv = -1; print ("// Operations\n"); if (is_valuetype) { indentlevel--; print ("public:\n"); indentlevel++; } while (umlo != NULL) { umlattrlist tmpa = umlo->key.parameters; if (is_valuetype) { if (umlo->key.attr.visibility != '0') fprintf (stderr, "CORBAValue %s/%s: must be public\n", name, umlo->key.attr.name); } else { check_visibility (&tmpv, umlo->key.attr.visibility); } /* print comments on operation */ if (strlen(umlo->key.attr.comment)) { print("/// %s\n", umlo->key.attr.comment); tmpa = umlo->key.parameters; while (tmpa != NULL) { print("/// @param %s\t\t(%s) %s\n", tmpa->key.name, kind_str(tmpa->key.kind), tmpa->key.comment); tmpa = tmpa->next; } } /* print operation */ print (""); if (umlo->key.attr.isabstract || is_valuetype) { emit ("virtual "); umlo->key.attr.value[0] = '0'; } if (umlo->key.attr.isstatic) { if (is_valuetype) fprintf (stderr, "CORBAValue %s/%s: static not supported\n", name, umlo->key.attr.name); else emit ("static "); } if (strlen (umlo->key.attr.type) > 0) { emit ("%s ", cppname (umlo->key.attr.type)); } emit ("%s (", umlo->key.attr.name); while (tmpa != NULL) { emit ("%s %s", tmpa->key.type, tmpa->key.name); if (tmpa->key.value[0] != 0) { if (is_valuetype) fprintf (stderr, "CORBAValue %s/%s: param default " "not supported\n", name, umlo->key.attr.name); else emit (" = %s", tmpa->key.value); } tmpa = tmpa->next; if (tmpa != NULL) { emit (", "); } } emit (")"); if (umlo->key.attr.value[0]) { emit (" = %s", umlo->key.attr.value); } emit (";\n"); umlo = umlo->next; } } if (node->key->attributes != NULL && is_valuetype) { umlattrlist umla = node->key->attributes; emit ("\n"); indentlevel--; print ("private: // State member implementation\n"); indentlevel++; while (umla != NULL) { umlclassnode *ref = find_by_name (gb->classlist, umla->key.type); print (""); if (ref != NULL) { emit ("%s", fqname (ref, is_oo_class (ref->key))); /* * FIXME: Find a better way to decide whether to use * a pointer. */ } else emit ("%s", cppname (umla->key.type)); emit (" _%s;\n", umla->key.name); umla = umla->next; } } indentlevel--; print ("};\n\n"); } static void gen_decl (declaration *d) { char *name; char *stype; umlclassnode *node; umlattrlist umla; if (d == NULL) return; if (d->decl_kind == dk_module) { name = d->u.this_module->pkg->name; print ("namespace %s {\n\n", name); indentlevel++; d = d->u.this_module->contents; while (d != NULL) { gen_decl (d); d = d->next; } indentlevel--; print ("};\n\n", name); return; } node = d->u.this_class; stype = node->key->stereotype; name = node->key->name; umla = node->key->attributes; if (strlen (stype) == 0) { gen_class (node); return; } if (eq (stype, "CORBANative")) { print ("// CORBANative: %s \n\n", name); } else if (eq (stype, "CORBAConstant")) { if (umla == NULL) { fprintf (stderr, "Error: first attribute not set at %s\n", name); exit (1); } if (strlen (umla->key.name) > 0) fprintf (stderr, "Warning: ignoring attribute name at %s\n", name); print ("const %s %s = %s;\n\n", cppname (umla->key.type), name, umla->key.value); } else if (is_enum_stereo (stype)) { print ("enum %s {\n", name); indentlevel++; while (umla != NULL) { char *literal = umla->key.name; check_umlattr (¨a->key, name); if (strlen (umla->key.type) > 0) fprintf (stderr, "%s/%s: ignoring type\n", name, literal); print ("%s", literal); if (umla->next) emit (","); emit ("\n"); umla = umla->next; } indentlevel--; print ("};\n\n"); } else if (eq (stype, "CORBAStruct")) { print ("struct %s {\n", name); indentlevel++; while (umla != NULL) { check_umlattr (¨a->key, name); print ("%s %s", cppname (umla->key.type), umla->key.name); if (strlen (umla->key.value) > 0) fprintf (stderr, "%s/%s: ignoring value\n", name, umla->key.name); emit (";\n"); umla = umla->next; } indentlevel--; print ("};\n\n"); } else if (eq (stype, "CORBAException")) { fprintf (stderr, "%s: CORBAException not yet implemented\n", name); } else if (eq (stype, "CORBAUnion")) { umlattrnode *sw = umla; if (sw == NULL) { fprintf (stderr, "Error: attributes not set at union %s\n", name); exit (1); } fprintf (stderr, "%s: CORBAUnion not yet fully implemented\n", name); print ("class %s { // CORBAUnion\n", name); print ("public:\n", name); indentlevel++; print ("%s _d(); // body TBD\n\n", umla->key.type); umla = umla->next; while (umla != NULL) { check_umlattr (¨a->key, name); print ("%s %s (); // body TBD\n", cppname (umla->key.type), umla->key.name); print ("void %s (%s _value); // body TBD\n\n", umla->key.name, cppname (umla->key.type)); umla = umla->next; } indentlevel--; print ("};\n\n"); } else if (eq (stype, "CORBATypedef")) { /* Conventions for CORBATypedef: The first (and only) attribute contains the following: Name: Empty - the name is taken from the class. Type: Name of the original type which is typedefed. Value: Optionally contains array dimension(s) of the typedef. These dimensions are given in square brackets, e.g. [3][10] */ if (umla == NULL) { fprintf (stderr, "Error: first attribute (impl type) not set " "at typedef %s\n", name); exit (1); } if (strlen (umla->key.name) > 0) { fprintf (stderr, "Warning: typedef %s: ignoring name field " "in implementation type attribute\n", name); } print ("typedef %s %s%s;\n\n", cppname (umla->key.type), name, umla->key.value); } else { gen_class (node); } } void generate_code_cpp (batch *b) { declaration *d; umlclasslist tmplist = b->classlist; FILE *licensefile = NULL; gb = b; if (file_ext == NULL) file_ext = "h"; /* if (body_file_ext == NULL) body_file_ext = "cpp"; */ /* open license file */ if (b->license != NULL) { licensefile = fopen (b->license, "r"); if (!licensefile) { fprintf (stderr, "Can't open the license file.\n"); exit (1); } } while (tmplist != NULL) { if (! (is_present (b->classes, tmplist->key->name) ^ b->mask)) { push (tmplist, b); } tmplist = tmplist->next; } /* Generate a file for each outer declaration. */ d = decls; while (d != NULL) { char *name; char filename[256]; if (d->decl_kind == dk_module) { name = d->u.this_module->pkg->name; } else { /* dk_class */ name = d->u.this_class->key->name; } sprintf (filename, "%s.%s", name, file_ext); spec = open_outfile (filename, b); if (spec == NULL) { d = d->next; continue; } /* add license to the header */ if (b->license != NULL) { char lc; rewind (licensefile); while ((lc = fgetc (licensefile)) != EOF) print ("%c", lc); } includes = NULL; determine_includes (d, b); if (use_corba) print ("#include \n\n"); if (includes) { namelist incfile = includes; while (incfile != NULL) { if (!eq (incfile->name, name)) { print ("#include \"%s.%s\"\n", incfile->name, file_ext); } incfile = incfile->next; } print ("\n"); } gen_decl (d); fclose (spec); d = d->next; } } dia2code-0.8.3/dia2code/generate_code_idl.c0100644000076400001440000003057010547512632020010 0ustar kelloggusers/*************************************************************************** generate_code_idl.c - Function that generates CORBA IDL ------------------- begin : Sun Dec 30 2001 copyright : (C) 2000-2001 by Chris McGee (C) 2002 by Oliver Kellogg email : sirnewton_01@yahoo.ca okellogg@users.sourceforge.net ***************************************************************************/ /*************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * ***************************************************************************/ #include #include "dia2code.h" #include "decls.h" #include "includes.h" static void check_umlattr (umlattribute *u, char *typename) { /* Check settings that don't make sense for IDL generation. */ if (u->visibility == '1') fprintf (stderr, "%s/%s: ignoring non-visibility\n", typename, u->name); if (u->isstatic) fprintf (stderr, "%s/%s: ignoring staticness\n", typename, u->name); } static void do_operations (char *typename, umloplist umlo) { if (umlo == NULL) return; print ("// Operations\n"); while (umlo != NULL) { umlattrlist tmpa = umlo->key.parameters; print (""); if (umlo->key.attr.isabstract) { fprintf (stderr, "ignoring abstractness\n"); /* umlo->key.attr.value[0] = '0'; */ } check_umlattr (¨o->key.attr, typename); if (strlen (umlo->key.attr.type) > 0) emit ("%s ", umlo->key.attr.type); else emit ("void "); emit ("%s (", umlo->key.attr.name); while (tmpa != NULL) { emit ("in %s %s", tmpa->key.type, tmpa->key.name); if (tmpa->key.value[0] != 0) fprintf (stderr, "ignoring default value %s\n", tmpa->key.value); tmpa = tmpa->next; if (tmpa != NULL) { emit (", "); } } emit (")"); if (umlo->key.attr.value[0] != 0) fprintf (stderr, "ignoring default value %s", umlo->key.attr.value); emit (";\n"); umlo = umlo->next; } } static void close_scope () { indentlevel--; print ("};\n\n"); } static void gen_interface (umlclassnode *node) { char *typename = node->key->name; print ("interface %s", typename); if (node->parents != NULL) { umlclasslist parents = node->parents; emit (":"); while (parents != NULL) { emit (" %s", parents->key->name); parents = parents->next; if (parents != NULL) { emit (", "); } } } emit (" {\n"); indentlevel++; if (node->associations) { umlassoclist associations = node->associations; print ("// Associations\n"); while (associations != NULL) { /* Explicit usage of associations->composite is not supported by IDL. Perhaps we could give some intelligent warning here. */ print ("readonly attribute%s %s;\n", associations->key->name, associations->name); associations = associations->next; } } if (node->key->attributes != NULL) { umlattrlist umla = node->key->attributes; print ("// Attributes\n"); while (umla != NULL) { check_umlattr (¨a->key, typename); print ("attribute %s %s;\n", umla->key.type, umla->key.name); umla = umla->next; } } do_operations (typename, node->key->operations); close_scope (); } static void gen_decl (declaration *d) { char *name; char *stype; umlclassnode *node; umlattrlist umla; if (d == NULL) return; if (d->decl_kind == dk_module) { name = d->u.this_module->pkg->name; print ("module %s {\n", name); indentlevel++; d = d->u.this_module->contents; while (d != NULL) { gen_decl (d); d = d->next; } close_scope (); return; } node = d->u.this_class; stype = node->key->stereotype; name = node->key->name; umla = node->key->attributes; if (strlen (stype) == 0) { gen_interface (node); return; } if (eq (stype, "CORBANative")) { print ("native %s;\n\n", name); } else if (eq (stype, "CORBAConstant")) { if (umla == NULL) { fprintf (stderr, "Error: first attribute not set at const %s\n", name); exit (1); } if (strlen (umla->key.name) > 0) fprintf (stderr, "Warning: ignoring attribute name at const %s\n", name); print ("const %s %s = %s;\n\n", umla->key.type, name, umla->key.value); } else if (is_enum_stereo (stype)) { print ("enum %s {\n", name); indentlevel++; while (umla != NULL) { char *literal = umla->key.name; check_umlattr (¨a->key, name); if (strlen (umla->key.type) > 0) fprintf (stderr, "%s/%s: ignoring type\n", name, literal); print ("%s", literal); if (umla->next) emit (","); emit ("\n"); umla = umla->next; } close_scope (); } else if (eq (stype, "CORBAStruct") || eq (stype, "CORBAException")) { char *idlkeyword = strtolower (stype + 5); print ("%s %s {\n", idlkeyword, name); indentlevel++; while (umla != NULL) { char *member = umla->key.name; check_umlattr (¨a->key, name); print ("%s %s;\n", umla->key.type, member); umla = umla->next; } close_scope (); } else if (eq (stype, "CORBAUnion")) { umlattrnode *sw = umla; if (sw == NULL) { fprintf (stderr, "Error: attributes not set at union %s\n", name); exit (1); } if (strlen (sw->key.name) > 0 && !eq (sw->key.name, "switch")) { emit ("%s// #switchname %s %s\n\n", name, sw->key.name); } print ("union %s switch (%s) {\n", name, sw->key.type); indentlevel++; umla = umla->next; while (umla != NULL) { char *member = umla->key.name; check_umlattr (¨a->key, name); print ("case %s:\n", umla->key.value); print (" %s %s;\n", umla->key.type, member); umla = umla->next; } close_scope (); } else if (eq (stype, "CORBATypedef")) { /* Conventions for CORBATypedef: The first (and only) attribute contains the following: Name: Empty - the name is taken from the class. Type: Name of the original type which is typedefed. Value: Optionally contains array dimension(s) of the typedef. These dimensions are given in square brackets, e.g. [3][10] */ if (umla == NULL) { fprintf (stderr, "Error: first attribute (impl type) not set " "at typedef %s\n", name); exit (1); } if (umla->key.name != NULL && strlen (umla->key.name) > 0) { fprintf (stderr, "Warning: typedef %s: ignoring name field " "in implementation type attribute\n", name); } print ("typedef %s %s%s;\n\n", umla->key.type, name, umla->key.value); } else if (eq (stype, "CORBAValue")) { print (""); if (node->key->isabstract) { emit ("abstract "); } emit ("valuetype %s", name); if (node->parents != NULL) { umlclasslist parents = node->parents; emit (" :"); while (parents != NULL) { emit (" %s", parents->key->name); parents = parents->next; if (parents != NULL) { emit (", "); } } } emit (" {\n"); indentlevel++; if (node->associations) { umlassoclist associations = node->associations; print ("// Associations\n"); while (associations != NULL) { /* Explicit usage of associations->composite is not supported by IDL. Perhaps we could give some intelligent warning here. */ /* How to map valuetype associations is still an issue of discussion. For now, we follow the generate_code_java style and map them to private members. FIXME: The user currently has no control over the order in which the members are generated. */ print ("private %s %s;\n", associations->key->name, associations->name); associations = associations->next; } } if (umla) { print ("// State members\n"); while (umla != NULL) { char *member = umla->key.name; if (umla->key.isstatic) fprintf (stderr, "%s/%s: ignoring staticness\n", name, member); print (""); if (umla->key.visibility == '1') emit ("private"); else emit ("public"); emit (" %s %s;\n", umla->key.type, member); umla = umla->next; } } do_operations (name, node->key->operations); close_scope (); } else { print ("// %s\n", stype); gen_interface (node); } } static void put_hfence (char *name) { char *tmpname = strtoupper (name); emit ("#ifndef %s_IDL\n", tmpname); emit ("#define %s_IDL\n\n", tmpname); free (tmpname); } void generate_code_idl (batch *b) { declaration *d; umlclasslist tmplist = b->classlist; FILE *licensefile = NULL; if (file_ext == NULL) file_ext = "idl"; /* open license file */ if ( b->license != NULL ) { licensefile = fopen(b->license, "r"); if(!licensefile) { fprintf (stderr, "Can't open the license file.\n"); exit(2); } } while (tmplist != NULL) { char *name = tmplist->key->name; if (! (is_present (b->classes, name) ^ b->mask)) { push (tmplist, b); } tmplist = tmplist->next; } /* Generate a file for each outer declaration. Rose does it more elegantly. They use components for the files, and realizations for deciding which decl goes into which file. */ d = decls; while (d != NULL) { char *name; char filename[256]; if (d->decl_kind == dk_module) { name = d->u.this_module->pkg->name; } else { /* dk_class */ name = d->u.this_class->key->name; } sprintf (filename, "%s.%s", name, file_ext); /** * The filename is no longer lowercased. * Selectively do this as soon as we have a * command line option for it. */ spec = open_outfile (filename, b); if (spec == NULL) { d = d->next; continue; } /* add license to the header */ if (b->license != NULL) { char lc; rewind (licensefile); while ((lc = fgetc (licensefile)) != EOF) emit ("%c",lc); } put_hfence (name); includes = NULL; determine_includes (d, b); if (includes) { namelist incfile = includes; while (incfile != NULL) { if (!eq (incfile->name, name)) { emit ("#include \"%s.%s\"\n", incfile->name, file_ext); } incfile = incfile->next; } emit ("\n"); } gen_decl (d); emit ("#endif\n"); /* from hfence */ fclose (spec); d = d->next; } } dia2code-0.8.3/dia2code/generate_code_php.c0100644000076400001440000003027707650205711020031 0ustar kelloggusers/*************************************************************************** generate_code_php.c - Function that generates Php code ------------------- begin : Sat Dec 12 2001 copyright : (C) 2001 by Harald Fielker email : fielker@softsolutions.de modified by : Leandro Lucarella ***************************************************************************/ /*************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * ***************************************************************************/ #include "dia2code.h" #define TABS " " /* 4 */ void generate_code_php(batch *b) { umlclasslist tmplist, parents; umlassoclist associations; umlattrlist umla, tmpa, parama; umlpackagelist tmppcklist; umloplist umlo; char *tmpname; char outfilename[90]; FILE * outfile, *dummyfile, *licensefile = NULL; umlclasslist used_classes; int tmpdirlgth, tmpfilelgth; if (b->outdir == NULL) { b->outdir = "."; } tmpdirlgth = strlen(b->outdir); tmplist = b->classlist; /* open license file */ if ( b->license != NULL ) { licensefile = fopen(b->license, "r"); if(!licensefile) { fprintf(stderr, "Can't open the license file.\n"); exit(2); } } while ( tmplist != NULL ) { if ( ! ( is_present(b->classes, tmplist->key->name) ^ b->mask ) ) { tmpname = tmplist->key->name; /* This prevents buffer overflows */ tmpfilelgth = strlen(tmpname); if (tmpfilelgth + tmpdirlgth > sizeof(*outfilename) - 2) { fprintf(stderr, "Sorry, name of file too long ...\nTry a smaller dir name\n"); exit(4); } sprintf(outfilename, "%s/%s.php", b->outdir, tmplist->key->name); dummyfile = fopen(outfilename, "r"); if ( b->clobber || ! dummyfile ) { outfile = fopen(outfilename, "w"); if ( outfile == NULL ) { fprintf(stderr, "Can't open file %s for writing\n", outfilename); exit(3); } fprintf(outfile,"license != NULL){ char lc; rewind(licensefile); while((lc = fgetc(licensefile)) != EOF){ fprintf(outfile,"%c",lc); } } /* We generate the include clauses */ used_classes = list_classes(tmplist, b); while (used_classes != NULL) { tmppcklist = make_package_list(used_classes->key->package); if ( tmppcklist != NULL ){ if ( strcmp(tmppcklist->key->id,tmplist->key->package->id)){ /* This class' package and our current class' package are not the same */ fprintf(outfile, "require_once '"); fprintf(outfile, "%s",tmppcklist->key->name); tmppcklist=tmppcklist->next; while ( tmppcklist != NULL ){ fprintf(outfile, "/%s", tmppcklist->key->name); tmppcklist=tmppcklist->next; } fprintf(outfile,"/"); fprintf(outfile,"%s.php';\n",used_classes->key->name); } } else { /* XXX - If the used class is different from the actual class, we include it. I don't know if this is ok. */ if ( strcmp(used_classes->key->name, tmplist->key->name) ) { fprintf(outfile, "require_once '%s.php';\n", used_classes->key->name); } } used_classes = used_classes->next; } fprintf(outfile, "\n"); fprintf(outfile,"/**\n" ); fprintf(outfile," * XXX detailed description\n" ); fprintf(outfile," *\n" ); fprintf(outfile," * @author XXX\n" ); fprintf(outfile," * @version XXX\n" ); fprintf(outfile," * @copyright XXX\n" ); tmppcklist = make_package_list(tmplist->key->package); if ( tmppcklist != NULL ){ int packcounter = 0; fprintf(outfile," * @package %s",tmppcklist->key->name); tmppcklist=tmppcklist->next; while ( tmppcklist != NULL ){ if( packcounter == 1 ) { fprintf(outfile,"\n" ); fprintf(outfile," * @subpackage %s",tmppcklist->key->name); } else { fprintf(outfile,".%s",tmppcklist->key->name); } tmppcklist=tmppcklist->next; packcounter++; } fprintf(outfile,"\n"); } if (tmplist->key->isabstract) { fprintf(outfile," * @abstract\n" ); } fprintf(outfile," */\n" ); fprintf(outfile, "class %s", tmplist->key->name); parents = tmplist->parents; if (parents != NULL) { while ( parents != NULL ) { tmpname = strtolower(parents->key->stereotype); fprintf(outfile, " extends "); free(tmpname); fprintf(outfile, "%s", parents->key->name); parents = parents->next; } } fprintf(outfile, " {\n"); fprintf(outfile, "%s// Attributes\n", TABS); umla = tmplist->key->attributes; while ( umla != NULL) { fprintf(outfile, "%s/**\n", TABS); fprintf(outfile, "%s * XXX\n", TABS ); fprintf(outfile, "%s *\n", TABS ); fprintf(outfile, "%s * @var %s $%s\n", TABS, umla->key.type, umla->key.name); fprintf(outfile, "%s * @access ", TABS ); switch (umla->key.visibility) { case '0': fprintf (outfile, "public"); break; case '1': fprintf (outfile, "private"); break; case '2': fprintf (outfile, "protected"); break; } fprintf(outfile,"\n" ); if (umla->key.isstatic) { fprintf(outfile, "%s * @static ", TABS); } fprintf(outfile, "%s */\n", TABS); fprintf(outfile, "%svar $%s%s",TABS, (umla->key.visibility != '0') ? "_" : "", umla->key.name); if ( umla->key.value[0] != 0 ) { fprintf(outfile, " = %s", umla->key.value); } fprintf(outfile, ";\n\n"); umla = umla->next; } fprintf(outfile, "%s// Associations\n", TABS); associations = tmplist->associations; while ( associations != NULL ) { fprintf(outfile, "%s/**\n", TABS ); fprintf(outfile, "%s * XXX\n", TABS ); fprintf(outfile, "%s *\n", TABS ); fprintf(outfile, "%s * @var %s $%s\n", TABS, associations->key->name, associations->name); fprintf(outfile, "%s * @access private\n", TABS ); fprintf(outfile, "%s * @accociation %s to %s\n", TABS, associations->key->name, associations->name); fprintf(outfile, "%s */\n", TABS ); fprintf(outfile, "%s#var $%s;\n\n", TABS, associations->name); associations = associations->next; } umlo = tmplist->key->operations; fprintf(outfile, "%s// Operations\n", TABS); while ( umlo != NULL) { fprintf(outfile,"%s/**\n", TABS ); fprintf(outfile,"%s * XXX\n", TABS ); fprintf(outfile,"%s * \n", TABS ); parama = umlo->key.parameters; // document parameters while (parama != NULL) { fprintf(outfile,"%s * @param %s $%s XXX\n", TABS, parama->key.type, parama->key.name); parama= parama->next; } if (strlen(umlo->key.attr.type) > 0) { fprintf(outfile,"%s * @return %s XXX\n", TABS, umlo->key.attr.type); } fprintf(outfile,"%s * @access ", TABS ); switch (umlo->key.attr.visibility) { case '0': fprintf (outfile, "public"); break; case '1': fprintf (outfile, "private"); break; case '2': fprintf (outfile, "protected"); break; } fprintf(outfile,"\n" ); if ( umlo->key.attr.isabstract ) { fprintf(outfile,"%s * @abstract\n", TABS ); umlo->key.attr.value[0] = '0'; } if ( umlo->key.attr.isstatic ) { fprintf(outfile, "%s * @static ", TABS); } fprintf(outfile,"%s */\n", TABS ); fprintf(outfile, TABS); fprintf(outfile, "function %s%s(", (umlo->key.attr.visibility != '0') ? "_" : "", umlo->key.attr.name); tmpa = umlo->key.parameters; while (tmpa != NULL) { fprintf(outfile, "$%s", tmpa->key.name); if ( tmpa->key.value[0] != 0 ){ fprintf(outfile," = %s",tmpa->key.value); } tmpa = tmpa->next; if (tmpa != NULL) fprintf(outfile, ", "); } fprintf(outfile, ") "); fprintf(outfile, "{\n"); if ( umlo->key.implementation != NULL ) { fprintf(outfile, "%s\n", umlo->key.implementation); } else if (!umlo->key.attr.isabstract) { fprintf(outfile, "%s%strigger_error('Not Implemented!', E_USER_WARNING);\n", TABS, TABS); } fprintf(outfile, "%s}\n\n", TABS); umlo = umlo->next; } fprintf(outfile, "}\n\n"); fprintf(outfile,"?>\n" ); fclose(outfile); } } tmplist = tmplist->next; } } dia2code-0.8.3/dia2code/generate_code_shp.c0100644000076400001440000001207107457104220020022 0ustar kelloggusers/*************************************************************************** generate_code_shp.c - generate batch file for shapefile creation ------------------- begin : Tue Oct 16 2001 copyright : (C) by Steffen Macke email : sdteffen@yahoo.com ***************************************************************************/ /*************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * ***************************************************************************/ /* this requires shpcreate and dbfcreate from shapelib */ #include "dia2code.h" void generate_code_shp(batch *b) { /* umlclasslist tmplist,parents,dependencies; umlassoclist associations; namelist used_classes,tmpnamelist; int tmpv; umlattrlist umla,tmpa; umloplist umlo; */ umlclasslist tmplist; umlclasslist parentlist, parentlist2; umlattrlist umla; int tmpv; char *tmpname; char outfilename[256]; FILE * outfileshp, *dummyfile; int tmpdirlgth, tmpfilelgth; if (b->outdir == NULL) { b->outdir = "."; } tmpdirlgth = strlen(b->outdir); tmplist = b->classlist; while ( tmplist != NULL ) { if ( ! ( is_present(b->classes, tmplist->key->name) ^ b->mask ) ) { tmpname = strtolower(tmplist->key->name); /* This prevents buffer overflows */ tmpfilelgth = strlen(tmpname); if (tmpfilelgth + tmpdirlgth > sizeof(*outfilename) - 2) { fprintf(stderr, "Sorry, name of file too long ...\nTry a smaller dir name\n"); exit(4); } sprintf(outfilename, "%s/createshapefiles.bat", b->outdir); dummyfile = fopen(outfilename, "r"); if ( b->clobber || ! dummyfile ) { outfileshp = fopen(outfilename, "a"); if ( outfileshp == NULL ) { fprintf(stderr, "Can't open file %s for writing\n", outfilename); exit(3); } /* This prevents buffer overflows */ tmpfilelgth = strlen(tmpname); if (tmpfilelgth + tmpdirlgth > sizeof(*outfilename) - 2) { fprintf(stderr, "Sorry, name of file too long ...\nTry a smaller dir name\n"); exit(4); } free(tmpname); tmpv = -1; if(tmplist->key->isabstract == 0) { /* create attribute table */ umla = tmplist->key->attributes; parentlist = tmplist; fprintf(outfileshp, "dbfcreate %s", tmplist->key->name); while ( umla != NULL) { if((strcmp(umla->key.name,"Shape") != 0)&& (umla->key.visibility != 1)) { if(strcmp(umla->key.type,"String") == 0) { fprintf(outfileshp, " -s %s 255", umla->key.name); } else if((strcmp(umla->key.type, "CodedValue") == 0)|| strcmp(umla->key.type, "Integer") ==0 ) { fprintf(outfileshp, " -n %s 16 0", umla->key.name); } else if(strcmp(umla->key.type, "Float") == 0) { fprintf(outfileshp, " -n %s 16 3", umla->key.name); } } umla = umla->next; if((umla == NULL)&&(parentlist != NULL)) { parentlist = parentlist->parents; if(parentlist != NULL) { umla = parentlist->key->attributes; parentlist2 = b->classlist; while((strcmp(parentlist->key->name, parentlist2->key->name) != 0)&& (parentlist2 != NULL)) parentlist2 = parentlist2->next; parentlist = parentlist2; } } } fprintf(outfileshp, "\n"); /* create shp file */ umla = tmplist->key->attributes; parentlist = tmplist; while ( umla != NULL) { if(strcmp(umla->key.name,"Shape") == 0) { if(strcmp(strtolower(umla->key.type), "polyline") == 0) { strcpy(umla->key.type, "arc"); } fprintf(outfileshp, "shpcreate %s %s\n\n", tmplist->key->name, strtolower(umla->key.type)); break; } umla = umla->next; if((umla == NULL)&&(parentlist != NULL)) { parentlist = parentlist->parents; if(parentlist != NULL) { umla = parentlist->key->attributes; parentlist2 = b->classlist; while((strcmp(parentlist->key->name, parentlist2->key->name) != 0)&& (parentlist2 != NULL)) parentlist2 = parentlist2->next; parentlist = parentlist2; } } } } } fclose(outfileshp); } tmplist = tmplist->next; } } dia2code-0.8.3/dia2code/generate_code_sql.c0100644000076400001440000001245510261536254020040 0ustar kelloggusers/*************************************************************************** generate_code_sql.c - description ------------------- begin : Sat Jun 2 2001 email : sirnewton_01@yahoo.ca ***************************************************************************/ /*************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * ***************************************************************************/ #include "dia2code.h" #include "parse_diagram.h" #include "code_generators.h" void inherit_attributes(umlclasslist parents, umlattrlist umla) { umlattrlist pumla; while (parents != NULL) { pumla = parents->key->attributes; insert_attribute(copy_attributes(pumla), umla); parents = parents->next; } } void generate_code_sql(batch *b) { /* umlclasslist tmplist,parents,dependencies; umlassoclist associations; namelist used_classes,tmpnamelist; int tmpv; umlattrlist umla,tmpa; umloplist umlo; */ umlclasslist tmplist; umlattrlist umla; int tmpv; char *tmpname; char outfilename[256]; FILE * outfilesql, *dummyfile; int tmpdirlgth, tmpfilelgth; if (b->outdir == NULL) { b->outdir = "."; } tmpdirlgth = strlen(b->outdir); tmplist = b->classlist; tmpname = strtolower(tmplist->key->name); /* This prevents buffer overflows */ tmpfilelgth = strlen(tmpname); if (tmpfilelgth + tmpdirlgth > sizeof(*outfilename) - 2) { fprintf(stderr, "Sorry, name of file too long ...\nTry a smaller dir name\n"); exit(4); } sprintf(outfilename, "%s/DEFINITION.SQL", b->outdir); dummyfile = fopen(outfilename, "r"); if ( b->clobber || ! dummyfile ) { outfilesql = fopen(outfilename, "w"); /* Moved this one to be able to OVERWRITE old file, changed from "a" to "w"... */ if ( outfilesql == NULL ) { fprintf(stderr, "Can't open file %s for writing\n", outfilename); exit(3); } /* This prevents buffer overflows */ tmpfilelgth = strlen(tmpname); if (tmpfilelgth + tmpdirlgth > sizeof(*outfilename) - 2) { fprintf(stderr, "Sorry, name of file too long ...\nTry a smaller dir name\n"); exit(4); } free(tmpname); } while ( tmplist != NULL ) { if ( ! ( is_present(b->classes, tmplist->key->name) ^ b->mask ) ) { char seenFirst = 0; if (tmplist->key->isabstract) { tmplist = tmplist->next; continue; } /* Class (table) */ fprintf(outfilesql, "CREATE TABLE %s(\n", tmplist->key->name); /* Attributes (columns) */ fprintf(outfilesql, "-- Attributes --\n"); tmpv = -1; umla = tmplist->key->attributes; inherit_attributes (tmplist->parents, umla); while ( umla != NULL) { fprintf(outfilesql, "%s %s", umla->key.name, umla->key.type); if (umla->next != NULL) { fprintf(outfilesql, ",\n"); } umla = umla->next; } fprintf(outfilesql, ");\n\n"); /* IsStatic attribute (Primary Key) */ umla = tmplist->key->attributes; while ( umla != NULL) { if( umla->key.isstatic ) { if( !seenFirst ) { seenFirst = 1; fprintf(outfilesql, "ALTER TABLE %s ADD\n", tmplist->key->name); fprintf(outfilesql, " CONSTRAINT PK_%s PRIMARY KEY\n (\n", tmplist->key->name); } fprintf(outfilesql, " %s", umla->key.name); if (umla->next != NULL && umla->next->key.isstatic) { fprintf(outfilesql, ","); } fprintf(outfilesql, "\n"); } umla = umla->next; } if( seenFirst ) fprintf(outfilesql, " );\n\n\n"); } tmplist = tmplist->next; } /* Adding associations LAST since we want to have all tables around FIRST */ tmplist = b->classlist; while( tmplist != NULL ) { umlassocnode* temp = tmplist->associations; while( temp != NULL ) { fprintf( outfilesql, "\n\nALTER TABLE %s ADD\n", temp->key->name ); fprintf( outfilesql, " CONSTRAINT FK_%s_%s FOREIGN KEY(%s) REFERENCES %s (%s);\n", temp->key->name, tmplist->key->name, temp->name, tmplist->key->name, temp->name ); temp = temp->next; } tmplist = tmplist->next; } fprintf(stderr, "Finished!"); fclose(outfilesql); } dia2code-0.8.3/dia2code/makefile.mingw0100644000076400001440000000203107573447515017053 0ustar kelloggusers## Built mingw version of dia2code using cygwin. ## adjust to match your path to libxml2 ## Use: make -f makefile.mingw ################################################################ bin_PROGRAMS = dia2code.exe INCLUDES = -I. -I../../libxml2-2.4.3/include -I../../libxml2-2.4.3/include/libxml dia2code_SOURCES = dia2code.c main.c parse_diagram.c scan_tree.c generate_code_c.c generate_code_java.c generate_code_cpp.c generate_code_ada.c generate_code_sql.c generate_code_python.c generate_code_csharp.c LIBS = -L ../../libxml2-2.4.3/lib/so/ -lxml2 PROGRAMS = $(bin_PROGRAMS) LDFLAGS = -mno-cygwin -fnative-struct dia2code_OBJECTS = dia2code.o main.o parse_diagram.o scan_tree.o \ generate_code_c.o generate_code_java.o generate_code_cpp.o \ generate_code_ada.o generate_code_sql.o generate_code_python.o generate_code_csharp.o CFLAGS = -mno-cygwin -fnative-struct $(INCLUDES) all: \ $(PROGRAMS) dia2code.exe: $(dia2code_OBJECTS) gcc $(LDFLAGS) $(dia2code_OBJECTS) -o $@ $(LIBS) clean: rm $(dia2code_OBJECTS) $(bin_PROGRAMS) dia2code-0.8.3/dia2code/scan_tree.c0100644000076400001440000001601207573453632016343 0ustar kelloggusers/*************************************************************************** scan_tree.c ------------------- begin : Wed Jan 17 2001 copyright : (C) 2001 by Ruben Lopez email : ryu@gpul.org ***************************************************************************/ /*************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * ***************************************************************************/ #include "dia2code.h" #define NEW_KLASS(c) ((c*)malloc(sizeof(c))) /* Adds an item to a name list */ namelist name_list_add(namelist l, const char *data) { namenode *n = NEW_KLASS(namenode); n->name = strdup(data); n->next = l; return n; } /* Returns a list with all the classes declared in the diagram */ namelist scan_tree_classes(batch *b) { umlclasslist tmplist; namelist result = NULL; tmplist = b->classlist; while ( tmplist != NULL ) { result = name_list_add(result, tmplist->key->name); tmplist = tmplist->next; } return result; } /* Returns a list with all the classes declared in the diagram that current * class references */ namelist find_classes(umlclasslist current_class, batch *b) { umlclasslist parents, dependencies; umlassoclist associations; umlattrlist umla, tmpa; umloplist umlo; namelist result = NULL; namelist classes = scan_tree_classes(b); umla = current_class->key->attributes; while ( umla != NULL) { if (is_present(classes, umla->key.type) && !is_present(result, umla->key.type)) { result = name_list_add(result, umla->key.type); } umla = umla->next; } umlo = current_class->key->operations; while ( umlo != NULL) { if (is_present(classes, umlo->key.attr.type) && !is_present(result, umlo->key.attr.type)) { result = name_list_add(result, umlo->key.attr.type); } tmpa = umlo->key.parameters; while (tmpa != NULL) { if (is_present(classes, tmpa->key.type) && !is_present(result, tmpa->key.type)) { result = name_list_add(result, tmpa->key.type); } tmpa = tmpa->next; } umlo = umlo->next; } parents = current_class->parents; while ( parents != NULL ) { if ( is_present(classes, parents->key->name) && ! is_present(result, parents->key->name) ) { result = name_list_add(result, parents->key->name); } parents = parents->next; } dependencies = current_class->dependencies; while (dependencies != NULL) { if ( is_present(classes, dependencies->key->name) && ! is_present(result, dependencies->key->name) ) { result = name_list_add(result, dependencies->key->name); } dependencies = dependencies->next; } associations = current_class->associations; while (associations != NULL) { if ( is_present(classes, associations->key->name) && ! is_present(result, associations->key->name ) ) { result = name_list_add(result, associations->key->name); } associations = associations->next; } return result; } umlclasslist find_by_name(umlclasslist list, const char * name ){ if ( name != NULL && strlen(name) > 0 ) { while ( list != NULL ) { if ( ! strcmp(name, list->key->name) ) { return list; } list = list->next; } } return NULL; } /* Creates a new umlclasslist with class as the key, then appends it to the end of list */ umlclasslist append ( umlclasslist list, umlclass * class ){ umlclasslist tmplist = list, tmpnode = NULL; tmpnode = (umlclasslist) my_malloc ( sizeof(umlclassnode) ); tmpnode->key = class; tmpnode->parents = NULL; tmpnode->associations = NULL; tmpnode->dependencies = NULL; tmpnode->next = NULL; if ( tmplist != NULL ){ while ( tmplist->next != NULL ){ tmplist = tmplist->next; } tmplist->next = tmpnode; return list; } else { return tmpnode; } } /* Returns a freshly constructed list of the classes that are used by the given class AND are themselves in the classlist of the given batch */ umlclasslist list_classes(umlclasslist current_class, batch *b) { umlclasslist parents, dependencies; umlassoclist associations; umlattrlist umla, tmpa; umloplist umlo; umlclasslist result = NULL; umlclasslist classes = b->classlist; umlclasslist tmpnode = NULL; umla = current_class->key->attributes; while ( umla != NULL) { if ( strlen(umla->key.type) > 0 ) { tmpnode = find_by_name(classes, umla->key.type); if ( tmpnode && ! find_by_name(result, umla->key.type)) { result = append(result, tmpnode->key); } } umla = umla->next; } umlo = current_class->key->operations; while ( umlo != NULL) { tmpnode = find_by_name(classes, umlo->key.attr.type); if ( tmpnode && ! find_by_name(result, umlo->key.attr.type)) { result = append(result, tmpnode->key); } tmpa = umlo->key.parameters; while (tmpa != NULL) { tmpnode = find_by_name(classes, tmpa->key.type); if ( tmpnode && ! find_by_name(result, tmpa->key.type)) { result = append(result, tmpnode->key); } tmpa = tmpa->next; } umlo = umlo->next; } parents = current_class->parents; while ( parents != NULL ) { tmpnode = find_by_name(classes, parents->key->name); if ( tmpnode && ! find_by_name(result, parents->key->name) ) { result = append(result, tmpnode->key); } parents = parents->next; } dependencies = current_class->dependencies; while (dependencies != NULL) { tmpnode = find_by_name(classes, dependencies->key->name); if ( tmpnode && ! find_by_name(result, dependencies->key->name) ) { result = append(result, tmpnode->key); } dependencies = dependencies->next; } associations = current_class->associations; while (associations != NULL) { tmpnode = find_by_name(classes, associations->key->name); if ( tmpnode && ! find_by_name(result, associations->key->name ) ) { result = append(result, tmpnode->key); } associations = associations->next; } return result; } dia2code-0.8.3/dia2code/Makefile.am0100644000076400001440000000244310547512631016261 0ustar kelloggusers####### kdevelop will overwrite this part!!! (begin)########## noinst_LIBRARIES = libdia2code.a libdia2code_a_SOURCES = decls.c includes.c generate_code_idl.c generate_code_php.c generate_code_php_five.c generate_code_shp.c generate_code_python.c generate_code_ada.c generate_code_sql.c scan_tree.c generate_code_c.c parse_diagram.c dia2code.c generate_code_java.c generate_code_cpp.c generate_code_csharp.c generate_code_ruby.c main.c SUBDIRS = docs EXTRA_DIST = main.c generate_code_cpp.c generate_code_java.c code_generators.h dia2code.h dia2code.c parse_diagram.c parse_diagram.h generate_code_c.c scan_tree.c generate_code_sql.c generate_code_ada.c generate_code_python.c Makefile.am generate_code_shp.c generate_code_php.c generate_code_php_five.c makefile.mingw generate_code_idl.c generate_code_csharp.c generate_code_ruby.c decls.c includes.c ####### kdevelop will overwrite this part!!! (end)############ bin_PROGRAMS = dia2code INCLUDES = @XML_INCLUDES@ dia2code_SOURCES = dia2code.c main.c parse_diagram.c scan_tree.c generate_code_c.c \ generate_code_java.c generate_code_cpp.c generate_code_ada.c generate_code_sql.c \ generate_code_python.c generate_code_php.c generate_code_shp.c generate_code_idl.c \ generate_code_csharp.c generate_code_php_five.c generate_code_ruby.c decls.c includes.c dia2code-0.8.3/dia2code/Makefile.in0100644000076400001440000004716210547512631016301 0ustar kelloggusers# Makefile.in generated by automake 1.7.2 from Makefile.am. # @configure_input@ # Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 # Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = .. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : ACLOCAL = @ACLOCAL@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ XML_CONFIG = @XML_CONFIG@ XML_INCLUDES = @XML_INCLUDES@ ac_ct_CC = @ac_ct_CC@ ac_ct_RANLIB = @ac_ct_RANLIB@ ac_ct_STRIP = @ac_ct_STRIP@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__include = @am__include@ am__quote = @am__quote@ bindir = @bindir@ build_alias = @build_alias@ datadir = @datadir@ exec_prefix = @exec_prefix@ host_alias = @host_alias@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ mandir = @mandir@ oldincludedir = @oldincludedir@ prefix = @prefix@ program_transform_name = @program_transform_name@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ ####### kdevelop will overwrite this part!!! (begin)########## noinst_LIBRARIES = libdia2code.a libdia2code_a_SOURCES = decls.c includes.c generate_code_idl.c generate_code_php.c generate_code_php_five.c generate_code_shp.c generate_code_python.c generate_code_ada.c generate_code_sql.c scan_tree.c generate_code_c.c parse_diagram.c dia2code.c generate_code_java.c generate_code_cpp.c generate_code_csharp.c generate_code_ruby.c main.c SUBDIRS = docs EXTRA_DIST = main.c generate_code_cpp.c generate_code_java.c code_generators.h dia2code.h dia2code.c parse_diagram.c parse_diagram.h generate_code_c.c scan_tree.c generate_code_sql.c generate_code_ada.c generate_code_python.c Makefile.am generate_code_shp.c generate_code_php.c generate_code_php_five.c makefile.mingw generate_code_idl.c generate_code_csharp.c generate_code_ruby.c decls.c includes.c ####### kdevelop will overwrite this part!!! (end)############ bin_PROGRAMS = dia2code INCLUDES = @XML_INCLUDES@ dia2code_SOURCES = dia2code.c main.c parse_diagram.c scan_tree.c generate_code_c.c \ generate_code_java.c generate_code_cpp.c generate_code_ada.c generate_code_sql.c \ generate_code_python.c generate_code_php.c generate_code_shp.c generate_code_idl.c \ generate_code_csharp.c generate_code_php_five.c generate_code_ruby.c decls.c includes.c subdir = dia2code mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = LIBRARIES = $(noinst_LIBRARIES) libdia2code_a_AR = $(AR) cru libdia2code_a_LIBADD = am_libdia2code_a_OBJECTS = decls.$(OBJEXT) includes.$(OBJEXT) \ generate_code_idl.$(OBJEXT) generate_code_php.$(OBJEXT) \ generate_code_php_five.$(OBJEXT) generate_code_shp.$(OBJEXT) \ generate_code_python.$(OBJEXT) generate_code_ada.$(OBJEXT) \ generate_code_sql.$(OBJEXT) scan_tree.$(OBJEXT) \ generate_code_c.$(OBJEXT) parse_diagram.$(OBJEXT) \ dia2code.$(OBJEXT) generate_code_java.$(OBJEXT) \ generate_code_cpp.$(OBJEXT) generate_code_csharp.$(OBJEXT) \ generate_code_ruby.$(OBJEXT) main.$(OBJEXT) libdia2code_a_OBJECTS = $(am_libdia2code_a_OBJECTS) bin_PROGRAMS = dia2code$(EXEEXT) PROGRAMS = $(bin_PROGRAMS) am_dia2code_OBJECTS = dia2code.$(OBJEXT) main.$(OBJEXT) \ parse_diagram.$(OBJEXT) scan_tree.$(OBJEXT) \ generate_code_c.$(OBJEXT) generate_code_java.$(OBJEXT) \ generate_code_cpp.$(OBJEXT) generate_code_ada.$(OBJEXT) \ generate_code_sql.$(OBJEXT) generate_code_python.$(OBJEXT) \ generate_code_php.$(OBJEXT) generate_code_shp.$(OBJEXT) \ generate_code_idl.$(OBJEXT) generate_code_csharp.$(OBJEXT) \ generate_code_php_five.$(OBJEXT) generate_code_ruby.$(OBJEXT) \ decls.$(OBJEXT) includes.$(OBJEXT) dia2code_OBJECTS = $(am_dia2code_OBJECTS) dia2code_LDADD = $(LDADD) dia2code_DEPENDENCIES = dia2code_LDFLAGS = DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles @AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/decls.Po ./$(DEPDIR)/dia2code.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/generate_code_ada.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/generate_code_c.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/generate_code_cpp.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/generate_code_csharp.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/generate_code_idl.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/generate_code_java.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/generate_code_php.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/generate_code_php_five.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/generate_code_python.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/generate_code_ruby.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/generate_code_shp.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/generate_code_sql.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/includes.Po ./$(DEPDIR)/main.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/parse_diagram.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/scan_tree.Po COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ DIST_SOURCES = $(libdia2code_a_SOURCES) $(dia2code_SOURCES) RECURSIVE_TARGETS = info-recursive dvi-recursive pdf-recursive \ ps-recursive install-info-recursive uninstall-info-recursive \ all-recursive install-data-recursive install-exec-recursive \ installdirs-recursive install-recursive uninstall-recursive \ check-recursive installcheck-recursive DIST_COMMON = Makefile.am Makefile.in DIST_SUBDIRS = $(SUBDIRS) SOURCES = $(libdia2code_a_SOURCES) $(dia2code_SOURCES) all: all-recursive .SUFFIXES: .SUFFIXES: .c .o .obj $(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && \ $(AUTOMAKE) --gnu dia2code/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) AR = ar clean-noinstLIBRARIES: -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) libdia2code.a: $(libdia2code_a_OBJECTS) $(libdia2code_a_DEPENDENCIES) -rm -f libdia2code.a $(libdia2code_a_AR) libdia2code.a $(libdia2code_a_OBJECTS) $(libdia2code_a_LIBADD) $(RANLIB) libdia2code.a binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) $(mkinstalldirs) $(DESTDIR)$(bindir) @list='$(bin_PROGRAMS)'; for p in $$list; do \ p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ if test -f $$p \ ; then \ f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ echo " $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) $$p $(DESTDIR)$(bindir)/$$f"; \ $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) $$p $(DESTDIR)$(bindir)/$$f || exit 1; \ else :; fi; \ done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; for p in $$list; do \ f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ echo " rm -f $(DESTDIR)$(bindir)/$$f"; \ rm -f $(DESTDIR)$(bindir)/$$f; \ done clean-binPROGRAMS: -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS) dia2code$(EXEEXT): $(dia2code_OBJECTS) $(dia2code_DEPENDENCIES) @rm -f dia2code$(EXEEXT) $(LINK) $(dia2code_LDFLAGS) $(dia2code_OBJECTS) $(dia2code_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) core *.core distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/decls.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dia2code.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/generate_code_ada.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/generate_code_c.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/generate_code_cpp.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/generate_code_csharp.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/generate_code_idl.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/generate_code_java.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/generate_code_php.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/generate_code_php_five.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/generate_code_python.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/generate_code_ruby.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/generate_code_shp.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/generate_code_sql.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/includes.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/main.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse_diagram.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/scan_tree.Po@am__quote@ distclean-depend: -rm -rf ./$(DEPDIR) .c.o: @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \ @am__fastdepCC_TRUE@ -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<; \ @am__fastdepCC_TRUE@ then mv "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \ @am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \ @am__fastdepCC_TRUE@ fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `test -f '$<' || echo '$(srcdir)/'`$< .c.obj: @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \ @am__fastdepCC_TRUE@ -c -o $@ `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi`; \ @am__fastdepCC_TRUE@ then mv "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \ @am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \ @am__fastdepCC_TRUE@ fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi` uninstall-info-am: # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. # To change the values of `make' variables: instead of editing Makefiles, # (1) if the variable is set in `config.status', edit `config.status' # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): @set fnord $$MAKEFLAGS; amf=$$2; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" mostlyclean-recursive clean-recursive distclean-recursive \ maintainer-clean-recursive: @set fnord $$MAKEFLAGS; amf=$$2; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ETAGS = etags ETAGSFLAGS = CTAGS = ctags CTAGSFLAGS = tags: TAGS ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(ETAGS_ARGS)$$tags$$unique" \ || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) top_distdir = .. distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkinstalldirs) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d $(distdir)/$$subdir \ || mkdir $(distdir)/$$subdir \ || exit 1; \ (cd $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$(top_distdir)" \ distdir=../$(distdir)/$$subdir \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile $(LIBRARIES) $(PROGRAMS) installdirs: installdirs-recursive installdirs-am: $(mkinstalldirs) $(DESTDIR)$(bindir) install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -rm -f Makefile $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-binPROGRAMS clean-generic clean-noinstLIBRARIES \ mostlyclean-am distclean: distclean-recursive distclean-am: clean-am distclean-compile distclean-depend \ distclean-generic distclean-tags dvi: dvi-recursive dvi-am: info: info-recursive info-am: install-data-am: install-exec-am: install-binPROGRAMS install-info: install-info-recursive install-man: installcheck-am: maintainer-clean: maintainer-clean-recursive maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-compile mostlyclean-generic pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-binPROGRAMS uninstall-info-am uninstall-info: uninstall-info-recursive .PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am clean \ clean-binPROGRAMS clean-generic clean-noinstLIBRARIES \ clean-recursive ctags ctags-recursive distclean \ distclean-compile distclean-depend distclean-generic \ distclean-recursive distclean-tags distdir dvi dvi-am \ dvi-recursive info info-am info-recursive install install-am \ install-binPROGRAMS install-data install-data-am \ install-data-recursive install-exec install-exec-am \ install-exec-recursive install-info install-info-am \ install-info-recursive install-man install-recursive \ install-strip installcheck installcheck-am installdirs \ installdirs-am installdirs-recursive maintainer-clean \ maintainer-clean-generic maintainer-clean-recursive mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-recursive \ pdf pdf-am pdf-recursive ps ps-am ps-recursive tags \ tags-recursive uninstall uninstall-am uninstall-binPROGRAMS \ uninstall-info-am uninstall-info-recursive uninstall-recursive # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: dia2code-0.8.3/dia2code/generate_code_php_five.c0100644000076400001440000003321410547512632021036 0ustar kelloggusers/*************************************************************************** generate_code_php5.c - Function that generates Php 5 code ------------------- begin : Sat Dec 12 2001 copyright : (C) 2001 by Harald Fielker email : fielker@softsolutions.de modified by : Leandro Lucarella modified by : tim rodger ***************************************************************************/ /*************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * ***************************************************************************/ #include "dia2code.h" #define TABS " " /* 4 */ /* * return the string declaring the class type */ char *d2c_php_class_type(umlclasslist tmplist) { char* tmpname = strtolower(tmplist->key->stereotype); if (eq("interface", tmpname)) { return "interface"; } else { if (tmplist->key->isabstract) { return "abstract class"; } else { return "class"; } } } char *d2c_php_visibility(char vis) { switch (vis) { case '0': return "public"; case '1': return "private"; case '2': return "protected"; default: return "public"; } } /* * php5 allows declaration of method arg types, * but only for non-built in types, return empty string for them */ int d2c_php_show_arg(char *arg) { // convert to lower case ? char *tmp = strtolower(arg); int result = 1; if (eq("int", tmp)|| eq("integer", tmp)|| eq("bool", tmp) || eq("boolean", tmp) || eq("string", tmp) || eq("float", tmp) || eq("array", tmp)) { result = 0; } free(tmp); return result; } /** * write comment block for a function */ int d2c_php_print_func_comments(FILE *outfile, umloplist umlo) { umlattrlist parama; char *tmpname; // begin function comments fprintf(outfile, "%s/**\n", TABS ); fprintf(outfile, "%s * XXX\n", TABS ); fprintf(outfile, "%s * \n", TABS ); parama = umlo->key.parameters; // document parameters while (parama != NULL) { fprintf(outfile, "%s * @param %s $%s XXX\n", TABS, parama->key.type, parama->key.name); parama= parama->next; } if (strlen(umlo->key.attr.type) > 0) { fprintf(outfile, "%s * @return %s XXX\n", TABS, umlo->key.attr.type); } fprintf(outfile, "%s * @access ", TABS ); tmpname = d2c_php_visibility(umlo->key.attr.visibility); fprintf(outfile, "%s\n", tmpname); if (umlo->key.attr.isabstract) { fprintf(outfile, "%s * @abstract\n", TABS ); umlo->key.attr.value[0] = '0'; } if (umlo->key.attr.isstatic) { fprintf(outfile, "%s * @static ", TABS); } fprintf(outfile, "%s */\n", TABS ); return 0; } /* * write the function body */ int d2c_php_print_func_code(FILE *outfile, umloplist umlo) { char *tmpname = d2c_php_visibility(umlo->key.attr.visibility); fprintf(outfile, TABS); fprintf(outfile, "%s%s %sfunction %s(", (umlo->key.attr.isabstract) ? "abstract " : "", tmpname, (umlo->key.attr.isstatic) ? "static " : "", umlo->key.attr.name); umlattrlist tmpa = umlo->key.parameters; while (tmpa != NULL) { if (d2c_php_show_arg(tmpa->key.type)) { fprintf(outfile, "%s ", tmpa->key.type); } fprintf(outfile, "$%s", tmpa->key.name); if (tmpa->key.value[0] != 0) { fprintf(outfile, " = %s", tmpa->key.value); } tmpa = tmpa->next; if (tmpa != NULL) fprintf(outfile, ", "); } fprintf(outfile, ")"); if (!umlo->key.attr.isabstract) { fprintf(outfile, "\n%s {\n", TABS); if (umlo->key.implementation != NULL) { fprintf(outfile, "%s\n", umlo->key.implementation); } else if (!umlo->key.attr.isabstract) { fprintf(outfile, "%s%strigger_error('Not Implemented!', E_USER_WARNING);\n", TABS, TABS); } fprintf(outfile, "%s}\n\n", TABS); } else { // don't print an empty body for abstract methods fprintf(outfile, ";\n\n"); } return 0; } /* * print out classes associated with this class * */ int d2c_php_print_associations(FILE *outfile, umlclasslist tmplist) { fprintf(outfile, "%s// Associations\n", TABS); umlassoclist associations = tmplist->associations; while ( associations != NULL ) { fprintf(outfile, "%s/**\n", TABS ); fprintf(outfile, "%s * XXX\n", TABS ); fprintf(outfile, "%s *\n", TABS ); fprintf(outfile, "%s * @var %s $%s\n", TABS, associations->key->name, associations->name); fprintf(outfile, "%s * @access private\n", TABS ); fprintf(outfile, "%s * @accociation %s to %s\n", TABS, associations->key->name, associations->name); fprintf(outfile, "%s */\n", TABS ); fprintf(outfile, "%s#var $%s;\n\n", TABS, associations->name); associations = associations->next; } return 0; } /* * print out this classes atributes with appropriate comment blocks */ int d2c_php_print_attributes(FILE *outfile, umlclasslist tmplist) { fprintf(outfile, "%s// Attributes\n", TABS); umlattrlist umla = tmplist->key->attributes; while (umla != NULL) { fprintf(outfile, "%s/**\n", TABS); fprintf(outfile, "%s * XXX\n", TABS ); fprintf(outfile, "%s *\n", TABS ); fprintf(outfile, "%s * @var %s\n", TABS, umla->key.type); fprintf(outfile, "%s * @access ", TABS); char *tmpname = d2c_php_visibility(umla->key.visibility); fprintf(outfile, "%s\n", tmpname); if (umla->key.isstatic) { fprintf(outfile, "%s * @static", TABS); } fprintf(outfile, "%s */\n", TABS); // print the actual variable declaration fprintf(outfile, "%s%s %s$%s", TABS, tmpname, (umla->key.isstatic) ? "static " : "", umla->key.name); if (umla->key.value[0] != 0) { fprintf(outfile, " = %s", umla->key.value); } fprintf(outfile, ";\n\n"); umla = umla->next; } return 0; } /* * print class methods */ int d2c_php_print_operations(FILE *outfile, umlclasslist tmplist) { umloplist umlo = tmplist->key->operations; fprintf(outfile, "%s// Operations\n", TABS); while (umlo != NULL) { // print each function int result = d2c_php_print_func_comments(outfile, umlo); int r2 = d2c_php_print_func_code(outfile, umlo); umlo = umlo->next; } return 0; } int d2c_php_print_license(FILE *outfile, FILE *licensefile) { char lc; rewind(licensefile); while ((lc = fgetc(licensefile)) != EOF) { fprintf(outfile, "%c", lc); } return 0; } int d2c_php_print_includes(FILE *outfile, umlclasslist tmplist, batch *b) { /* We generate the include clauses */ umlpackagelist tmppcklist; umlclasslist used_classes = list_classes(tmplist, b); while (used_classes != NULL) { tmppcklist = make_package_list(used_classes->key->package); if ( tmppcklist != NULL ) { if ( strcmp(tmppcklist->key->id, tmplist->key->package->id)) { /* This class' package and our current class' package are not the same */ fprintf(outfile, "require_once '"); fprintf(outfile, "%s", tmppcklist->key->name); tmppcklist=tmppcklist->next; while ( tmppcklist != NULL ) { fprintf(outfile, "/%s", tmppcklist->key->name); tmppcklist=tmppcklist->next; } fprintf(outfile, "/"); fprintf(outfile, "%s.php';\n", used_classes->key->name); } } else { /* XXX - If the used class is different from the actual class, we include it. I don't know if this is ok. */ if ( strcmp(used_classes->key->name, tmplist->key->name) ) { fprintf(outfile, "require_once '%s.php';\n", used_classes->key->name); } } used_classes = used_classes->next; } fprintf(outfile, "\n"); return 0; } int d2c_php_print_class_desc(FILE *outfile, umlclasslist tmplist) { umlpackagelist tmppcklist; fprintf(outfile, "/**\n" ); fprintf(outfile, " * XXX detailed description\n" ); fprintf(outfile, " *\n" ); fprintf(outfile, " * @author XXX\n" ); fprintf(outfile, " * @version XXX\n" ); fprintf(outfile, " * @copyright XXX\n" ); tmppcklist = make_package_list(tmplist->key->package); if ( tmppcklist != NULL ) { int packcounter = 0; fprintf(outfile, " * @package %s", tmppcklist->key->name); tmppcklist=tmppcklist->next; while (tmppcklist != NULL) { if( packcounter == 1 ) { fprintf(outfile, "\n" ); fprintf(outfile, " * @subpackage %s", tmppcklist->key->name); } else { fprintf(outfile, ".%s", tmppcklist->key->name); } tmppcklist=tmppcklist->next; packcounter++; } fprintf(outfile, "\n"); } if (tmplist->key->isabstract) { fprintf(outfile, " * @abstract\n" ); } fprintf(outfile, " */\n" ); return 0; } /* * print out the first class declaration line */ int d2c_php_print_class_decl(FILE *outfile, umlclasslist tmplist) { char *tmpname; umlclasslist parents; tmpname = d2c_php_class_type(tmplist); // print class 'type' and name fprintf(outfile, "%s %s", tmpname, tmplist->key->name); parents = tmplist->parents; if (parents != NULL) { while (parents != NULL) { tmpname = strtolower(parents->key->stereotype); if (eq(tmpname, "interface")) { fprintf(outfile, " implements "); } else { fprintf(outfile, " extends "); } free(tmpname); fprintf(outfile, "%s", parents->key->name); parents = parents->next; } } fprintf(outfile, " {\n"); return 0; } /* * return an opened file handle, null for failure */ FILE *d2c_php_getoutfile(umlclasslist tmplist, batch *b, FILE *outfile, int maxlen) { char outfilename[maxlen+2]; int tmpfilelgth = strlen(tmplist->key->name); if (tmpfilelgth + strlen(b->outdir) > maxlen) { return NULL; } sprintf(outfilename, "%s/%s.php", b->outdir, tmplist->key->name); FILE *dummy = fopen(outfilename, "r"); if (b->clobber || !dummy) { outfile = fopen(outfilename, "w"); } fclose(dummy); return outfile; } /* * main function called to begin output * */ void generate_code_php_five(batch *b) { umlclasslist tmplist; char *tmpname; char outfilename[90]; FILE * outfile, *dummyfile, *licensefile = NULL; int tmpdirlgth, tmpfilelgth; if (b->outdir == NULL) { b->outdir = "."; } tmpdirlgth = strlen(b->outdir); tmplist = b->classlist; /* open license file */ if ( b->license != NULL ) { licensefile = fopen(b->license, "r"); if(!licensefile) { fprintf(stderr, "Can't open the license file.\n"); exit(2); } } // for each class while ( tmplist != NULL ) { if ( ! ( is_present(b->classes, tmplist->key->name) ^ b->mask ) ) { tmpname = tmplist->key->name; /* This prevents buffer overflows */ tmpfilelgth = strlen(tmpname); if (tmpfilelgth + tmpdirlgth > sizeof(*outfilename) - 2) { fprintf(stderr, "Sorry, name of file too long ...\nTry a smaller dir name\n"); exit(4); } sprintf(outfilename, "%s/%s.php", b->outdir, tmplist->key->name); dummyfile = fopen(outfilename, "r"); if ( b->clobber || ! dummyfile ) { outfile = fopen(outfilename, "w"); if ( outfile == NULL ) { fprintf(stderr, "Can't open file %s for writing\n", outfilename); exit(3); } fprintf(outfile, "license != NULL) { /* add license to the header */ d2c_php_print_license(outfile, licensefile); } d2c_php_print_includes(outfile, tmplist, b); d2c_php_print_class_desc(outfile, tmplist); d2c_php_print_class_decl(outfile, tmplist); d2c_php_print_attributes(outfile, tmplist); d2c_php_print_associations(outfile, tmplist); d2c_php_print_operations(outfile, tmplist); // end class declaration fprintf(outfile, "}\n\n"); fprintf(outfile, "?>\n" ); fclose(outfile); } } tmplist = tmplist->next; } } dia2code-0.8.3/dia2code/main.c0100644000076400001440000003257410547512632015326 0ustar kelloggusers/*************************************************************************** main.c ------------------- begin : Sun Oct 15 2000 copyright : (C) 2000-2001 by Javier O'Hara email : joh314@users.sourceforge.net ***************************************************************************/ /*************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * ***************************************************************************/ #include "dia2code.h" #include "code_generators.h" #include "parse_diagram.h" int process_initialization_file(char *filename, int exit_if_not_found); #define DEFAULT_TARGET 0 #ifdef DSO static void * find_dia2code_module(const char *lang) { char *homedir; char *modulepath; char *modulename; /* char *generatorname;*/ void *handle; void (*generator)(); homedir = getenv("HOME"); if ( homedir ) homedir = strdup(homedir); else homedir = strdup("."); modulename = (char*)malloc(strlen(DSO_PREFIX) + strlen(lang) + 1); sprintf(modulename, "%s%s", DSO_PREFIX, lang); modulepath = (char*)malloc(strlen(homedir) + strlen(modulename) + strlen(MODULE_DIR) + strlen(DSO_SUFFIX) + 3); sprintf(modulepath, "%s/%s/%s%s", homedir, MODULE_DIR, modulename, DSO_SUFFIX); handle = dlopen(modulepath, RTLD_NOW | RTLD_GLOBAL); if ( !handle ) { fprintf(stderr, "can't find the module: %s\n", dlerror()); exit(2); } printf("module name : %s\n", modulename); generator = dlsym(handle, modulename); if ( modulepath ) free(modulepath); if ( modulename ) free(modulename); if ( homedir ) free(homedir); return generator; } #endif /* DSO */ char *outdir = NULL; /* Output directory */ int INDENT_CNT = 4; // This should be a parameter in the command line int bOpenBraceOnNewline = 1; // This should also be a command-line parameter int main(int argc, char **argv) { int i; char *license = NULL; /* License file */ int clobber = 1; /* Overwrite files while generating code*/ char *infile = NULL; /* The input file */ namelist classestogenerate = NULL; int classmask = 0, parameter = 0; batch *thisbatch; int iniParameterProcessed; char inifile[HUGE_BUFFER]; void (*generator)(batch *); void (*generators[NO_GENERATORS])(batch *); char * notice = "\ dia2code version 0.8.3, Copyright (C) 2000-2001 Javier O'Hara\n\ Dia2Code comes with ABSOLUTELY NO WARRANTY\n\ This is free software, and you are welcome to redistribute it\n\ under certain conditions; read the COPYING file for details.\n"; char *help = "[-h|--help] [-d ] [-nc] [-cl ]\n\ [-t (ada|c|cpp|csharp|idl|java|php|php5|python|ruby|shp|sql)] [-v]\n\ [-l ] [-ini ]"; char *bighelp = "\ -h --help Print this help and exit\n\ -t Selects the output language. can be\n\ one of: ada,c,cpp,idl,java,php,php5,python,ruby,shp,sql or csharp. \n\ Default is C++\n\ -d Output generated files to , default is \".\" \n\ -l License file to prepend to generated files.\n\ -nc Do not overwrite files that already exist\n\ -cl Generate code only for the classes specified in\n\ the comma-separated . \n\ E.g: Base,Derived.\n\ -v Invert the class list selection. When used \n\ without -cl prevents any file from being created\n\ -ext Use as the file extension.\n\ Here are the defaults:\n\ ada:\"ads\", c:\"h\", cpp:\"h\", idl:\"idl\",\n\ java:\"java\", php:\"php\", python:\"py\", csharp:\"cs\".\n\ Not applicable to shp, sql.\n\ -bext Use as the body (implementation) file\n\ extension. Currently only applies only to ada.\n\ Here are the defaults:\n\ ada:\"adb\"\n\ -ini Can be used instead of command-line parameters\n\ The Dia file that holds the diagram to be read\n\n\ Note: parameters can be specified in any order."; generator = NULL; generators[0] = generate_code_cpp; generators[1] = generate_code_java; generators[2] = generate_code_c; generators[3] = generate_code_sql; generators[4] = generate_code_ada; generators[5] = generate_code_python; generators[6] = generate_code_php; generators[7] = generate_code_shp; generators[8] = generate_code_idl; generators[9] = generate_code_csharp; generators[10] = generate_code_php_five; generators[11] = generate_code_ruby; if (argc < 2) { fprintf(stderr, "%s\nUsage: %s %s\n", notice, argv[0], help); exit(2); } iniParameterProcessed = 0; /* Argument parsing: rewritten from scratch */ for (i = 1; i < argc; i++) { switch ( parameter ) { case 0: if ( eq (argv[i], "-t") ) { parameter = 1; } else if ( eq (argv[i], "-d") ) { parameter = 2; } else if ( eq (argv[i], "-nc") ) { clobber = 0; } else if ( eq (argv[i], "-cl") ) { parameter = 3; } else if ( eq (argv[i], "-l") ) { parameter = 4; } else if ( eq (argv[i], "-ext") ) { parameter = 5; } else if ( eq (argv[i], "-bext") ) { parameter = 6; } else if ( eq (argv[i], "-ini") ) { parameter = 7; } else if ( eq (argv[i], "-v") ) { classmask = 1 - classmask; } else if ( eq("-h", argv[i]) || eq("--help", argv[i]) ) { printf("%s\nUsage: %s %s\n\n%s\n", notice, argv[0], help, bighelp); exit(0); } else { infile = argv[i]; } break; case 1: /* Which code generator */ parameter = 0; if ( eq (argv[i], "cpp") ) { generator = generators[0]; } else if ( eq (argv[i], "java") ) { generator = generators[1]; } else if ( eq (argv[i], "c") ) { generator = generators[2]; } else if ( eq (argv[i], "sql") ) { generator = generators[3]; } else if ( eq (argv[i], "ada") ) { generator = generators[4]; } else if ( eq (argv[i], "python") ) { generator = generators[5]; } else if ( eq (argv[i], "php") ) { generator = generators[6]; } else if ( eq (argv[i], "shp") ) { generator = generators[7]; } else if ( eq (argv[i], "idl") ) { generator = generators[8]; } else if ( eq (argv[i], "csharp") ) { generator = generators[9]; } else if ( eq(argv[i], "php5") ) { generator = generators[10]; } else if ( eq(argv[i], "ruby") ) { generator = generators[11]; } else { #ifdef DSO generator = find_dia2code_module(argv[i]); if ( ! generator ) { fprintf(stderr, "can't find the generator: %s\n", dlerror()); parameter = -1; /* error */ } #else parameter = -1; /* error */ #endif } break; case 2: /* Which output directory */ outdir = argv[i]; parameter = 0; break; case 3: /* Which classes to consider */ classestogenerate = parse_class_names(argv[i]); classmask = 1 - classmask; parameter = 0; break; case 4: /* Which license file */ license = argv[i]; parameter = 0; break; case 5: /* Which file extension */ file_ext = argv[i]; parameter = 0; break; case 6: /* Which implementation file extension */ body_file_ext = argv[i]; parameter = 0; break; case 7: /* Use initialization file */ process_initialization_file(argv[i], 1); iniParameterProcessed = 1; parameter = 0; break; } } /* parameter != 0 means the command line was invalid */ if ( parameter != 0 || infile == NULL ) { printf("%s\nUsage: %s %s\n\n%s\n", notice, argv[0], help, bighelp); exit(2); } if (iniParameterProcessed == 0) { if (!process_initialization_file("dia2code.ini", 0)) { #ifdef WIN32 if (getenv("HOME") == NULL) strcpy(inifile, "c:"); else strcpy(inifile, getenv("HOME")); strcat(inifile, "\\dia2code\\dia2code.ini"); #else strcpy(inifile, "~/.dia2code/dia2code.ini"); #endif process_initialization_file(inifile, 0); } } thisbatch = (batch*)my_malloc(sizeof(batch)); LIBXML_TEST_VERSION; xmlKeepBlanksDefault(0); /* We build the class list from the dia file here */ thisbatch->classlist = parse_diagram(infile); thisbatch->outdir = outdir; thisbatch->license = license; thisbatch->clobber = clobber; thisbatch->classes = classestogenerate; thisbatch->mask = classmask; /* Code generation */ if ( !generator ) { generator = generators[DEFAULT_TARGET]; }; (*generator)(thisbatch); param_list_destroy(); return 0; } typedef struct ini_parse_command { char *name; int type; void *ref; } ini_parse_command; #define PARSE_TYPE_FUNCTION 0 #define PARSE_TYPE_INT 1 #define PARSE_TYPE_STRCPY 2 #define PARSE_TYPE_STRDUP 3 #define PARSE_TYPE_YESNO 4 #define PARSE_TYPE_TRUEFALSE 5 ini_parse_command ini_parse_commands[] = { {"file.outdir", PARSE_TYPE_STRDUP, &outdir}, {"indent.brace.newline", PARSE_TYPE_YESNO, &indent_open_brace_on_newline}, {"indent.size", PARSE_TYPE_INT, &indent_count}, {"generate.backup", PARSE_TYPE_YESNO, &generate_backup}, {NULL, -1, NULL} }; void parse_command(char *name, char *value) { int i = 0; void (*method)(char *, char *); char **css; while (1) { ini_parse_command *cmd = &ini_parse_commands[i]; if(cmd->name == NULL) break; if (eq(cmd->name, name) == 0) { i++; continue; } switch(cmd->type) { case PARSE_TYPE_FUNCTION: method = cmd->ref; (*method)(name, value); break; case PARSE_TYPE_INT: *(int *)(cmd->ref) = atoi(value); break; case PARSE_TYPE_STRCPY: strcpy(value, (char *)cmd->ref); break; case PARSE_TYPE_STRDUP: css = (char **)cmd->ref; if (*css) free(*css); *css = strdup(value); break; case PARSE_TYPE_YESNO: switch(tolower(value[0])) { case 'y': *(int *)(cmd->ref) = 1; break; case 'n': *(int *)(cmd->ref) = 0; break; default: fprintf(stderr, "Invalid yes/no value for %s(%s)\n", name, value); } break; case PARSE_TYPE_TRUEFALSE: switch(tolower(value[0])) { case 't': *(int *)(cmd->ref) = 1; break; case 'f': *(int *)(cmd->ref) = 0; break; default: fprintf(stderr, "Invalid true/false value for %s(%s)\n", name, value); } break; default: break; } return; } } int process_initialization_file(char *filename, int exit_if_not_found) { FILE *f = fopen(filename, "r"); int line = 0; int slen; char s[HUGE_BUFFER]; if (f == NULL) if (exit_if_not_found) { fprintf(stderr, "Could not open initialization file %s\n", filename); exit(-1); } else return 0; while (fgets(s, HUGE_BUFFER - 1, f) != NULL) { char *name = s; char *param = strchr(s, '='); line++; if (s[0] == '#') continue; if (param == NULL) { fprintf(stderr, "Invalid parameter entry in %s:%d\n", filename, line); } else { *(param++) = '\0'; slen = strlen(param) - 1; while (param[slen] == '\n' || param[slen] == '\r') { param[slen--] = '\0'; } } d2c_parameter_set(name, param); parse_command(name, param); } fclose(f); return 1; } dia2code-0.8.3/dia2code/parse_diagram.c0100644000076400001440000007046407631424566017210 0ustar kelloggusers/*************************************************************************** parse_diagram.c - The parser of the Dia file ------------------- begin : Sat Dec 16 2000 copyright : (C) 2000-2001 by Javier O'Hara email : joh314@users.sourceforge.net ***************************************************************************/ /*************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * ***************************************************************************/ #include "parse_diagram.h" umlclasslist find(umlclasslist list, char *id ) { if ( id != NULL ) { while ( list != NULL ) { if ( ! strcmp(id, list->key->id) ) { return list; } list = list->next; } } return NULL; } /* the buffer must have room for 79 characters and a \0 */ void parse_dia_string(xmlNodePtr stringnode, char *buffer) { xmlChar *content; content = xmlNodeGetContent(stringnode); if ( sscanf(content, "#%79[^#]#", buffer) == 0) { buffer[0] = 0; } free(content); } int parse_boolean(xmlNodePtr booleannode) { xmlChar *val; int result; val = xmlGetProp(booleannode, "val"); if ( val != NULL && ! strcmp(val, "true")) { result = 1; } else { result = 0; } free(val); return result; } void addparent(umlclasslist base, umlclasslist derived) { umlclasslist tmp; tmp = (umlclasslist) my_malloc ( sizeof(umlclassnode) ); tmp->key = base->key; tmp->next = derived->parents; derived->parents = tmp; } void adddependency(umlclasslist dependent, umlclasslist dependee) { umlclasslist tmp; tmp = (umlclasslist) my_malloc ( sizeof(umlclassnode) ); tmp->key = dependent->key; tmp->next = dependee->dependencies; dependee->dependencies = tmp; } void addaggregate(char * name, char composite, umlclasslist base, umlclasslist associate) { umlassoclist tmp; tmp = (umlassoclist) my_malloc ( sizeof(umlassocnode) ); if (name != NULL) { sscanf(name, "#%79[^#]#", tmp->name); } else { printf("warning: unnamed association between %s and %s\n", base->key->name, associate->key->name); strcpy(tmp->name, "unnamed"); } tmp->key = base->key; tmp->composite = composite; tmp->next = associate->associations; associate->associations = tmp; } void inherit_realize ( umlclasslist classlist, char * base, char * derived ) { umlclasslist umlbase, umlderived; umlbase = find(classlist, base); umlderived = find(classlist, derived); if ( umlbase != NULL && umlderived != NULL ) { addparent(umlbase, umlderived); } } void associate ( umlclasslist classlist, char * name, char composite, char * base, char * aggregate) { umlclasslist umlbase, umlaggregate; umlbase = find(classlist, base); umlaggregate = find(classlist, aggregate); if ( umlbase != NULL && umlaggregate != NULL) { addaggregate(name, composite, umlbase, umlaggregate); } } void make_depend ( umlclasslist classlist, char * dependent, char * dependee) { umlclasslist umldependent, umldependee; umldependent = find(classlist, dependent); umldependee = find(classlist, dependee); if ( umldependent != NULL && umldependee != NULL) { adddependency(umldependent, umldependee); } } /** * Inserts "n" into the list "l", in orderly fashion */ umlattrlist insert_attribute(umlattrlist n, umlattrlist l) { if ( l != NULL ) { if ( l->key.visibility <= n->key.visibility ) { l->next = insert_attribute(n, l->next); return l; } else { n->next = l; return n; } } else { return n; } } /** * Inserts "n" into the list "l", in orderly fashion */ umloplist insert_operation(umloplist n, umloplist l) { if ( l != NULL ) { if ( l->key.attr.visibility <= n->key.attr.visibility ) { l->next = insert_operation(n, l->next); return l; } else { n->next = l; return n; } } else { return n; } } umltemplatelist insert_template(umltemplatelist n, umltemplatelist l) { if ( l != NULL) { n->next = l; return n; } else { return n; } } void parse_attribute(xmlNodePtr node, umlattribute *tmp) { xmlChar *nodename; xmlChar *attrval; tmp->value[0] = 0; tmp->value[1] = 0; tmp->visibility = '0'; tmp->kind = '0'; while ( node != NULL ) { nodename = xmlGetProp(node, "name"); if ( ! strcmp("name", nodename) ) { parse_dia_string(node->xmlChildrenNode, tmp->name); } else if ( ! strcmp("value", nodename)) { if (node->xmlChildrenNode->xmlChildrenNode != NULL) { parse_dia_string(node->xmlChildrenNode, tmp->value); } } else if ( ! strcmp("type", nodename)) { if (node->xmlChildrenNode->xmlChildrenNode != NULL) { parse_dia_string(node->xmlChildrenNode, tmp->type); } else { tmp->type[0] = 0; } } else if ( ! strcmp("comment", nodename)) { if (node->xmlChildrenNode->xmlChildrenNode != NULL) { parse_dia_string(node->xmlChildrenNode, tmp->comment); } else { tmp->comment[0] = 0; } } else if ( ! strcmp("kind", nodename)) { attrval = xmlGetProp(node->xmlChildrenNode, "val"); sscanf(attrval, "%c", &(tmp->kind)); free(attrval); } else if ( ! strcmp("visibility", nodename)) { attrval = xmlGetProp(node->xmlChildrenNode, "val"); sscanf(attrval, "%c", &(tmp->visibility)); free(attrval); } else if ( ! strcmp("abstract", nodename)) { tmp->isabstract = parse_boolean(node->xmlChildrenNode); } else if ( ! strcmp("class_scope", nodename)) { tmp->isstatic = parse_boolean(node->xmlChildrenNode); } free(nodename); node = node->next; } } umlattrlist parse_attributes(xmlNodePtr node) { umlattrlist list = NULL, an; while ( node != NULL ) { an = (umlattrlist) my_malloc(sizeof(umlattrnode)); an->next = NULL; parse_attribute(node->xmlChildrenNode, &(an->key)); list = insert_attribute(an, list); node = node->next; } return list; } void parse_operation(xmlNodePtr node, umloperation *tmp) { xmlChar *nodename; parse_attribute(node, &(tmp->attr)); while ( node != NULL ) { nodename = xmlGetProp(node, "name"); if ( ! strcmp("parameters", nodename) ) { tmp->parameters = parse_attributes(node->xmlChildrenNode); } free(nodename); node = node->next; } } umloplist parse_operations(xmlNodePtr node) { umloplist list = NULL, on; while ( node != NULL ) { on = (umlopnode*) my_malloc(sizeof(umlopnode)); on->next = NULL; on->key.implementation = NULL; parse_operation(node->xmlChildrenNode, &(on->key)); list = insert_operation(on, list); node = node->next; } return list; } void parse_template(xmlNodePtr node, umltemplate *tmp) { sscanf(node->xmlChildrenNode->xmlChildrenNode->content, "#%79[^#]#", tmp->name); sscanf(node->next->xmlChildrenNode->xmlChildrenNode->content, "#%79[^#]#", tmp->type); } umltemplatelist parse_templates(xmlNodePtr node) { umltemplatelist list = NULL, tn; while ( node != NULL) { if ( node->xmlChildrenNode->xmlChildrenNode->xmlChildrenNode != NULL && node->xmlChildrenNode->next->xmlChildrenNode->xmlChildrenNode != NULL ) { tn = (umltemplatenode*) my_malloc(sizeof(umltemplatenode)); tn->next = NULL; parse_template(node->xmlChildrenNode, &(tn->key)); list = insert_template(tn, list); } node = node->next; } return list; } /** * Adds get() (or is()) and set() methods for each attribute * myself MUST be != null */ void make_javabean_methods(umlclass *myself) { char *tmpname; umloplist operation; umlattrlist attrlist, parameter; attrlist = myself->attributes; while (attrlist != NULL) { if ( ! attrlist->key.isabstract) { /* The SET method */ operation = (umloplist) my_malloc (sizeof(umlopnode)); parameter = (umlattrlist) my_malloc (sizeof(umlattrnode)); sprintf(parameter->key.name, "value"); strncpy(parameter->key.type, attrlist->key.type, 79); parameter->key.value[0] = 0; parameter->key.isstatic = 0; parameter->key.isabstract = 0; parameter->key.visibility = '0'; parameter->next = NULL; operation->key.parameters = parameter; operation->key.implementation = (char*) my_malloc (90); sprintf(operation->key.implementation, " "); strncat(operation->key.implementation, attrlist->key.name, 76); strcat(operation->key.implementation, " = value;"); tmpname = strtoupperfirst(attrlist->key.name); sprintf(operation->key.attr.name, "set"); strncat(operation->key.attr.name, tmpname, 76); free(tmpname); operation->key.attr.isabstract = 0; operation->key.attr.isstatic = 0; operation->key.attr.visibility = '0'; operation->key.attr.value[0] = 0; sprintf(operation->key.attr.type, "void"); operation->next = NULL; myself->operations = insert_operation(operation, myself->operations); /* The GET or IS method */ operation = (umloplist) my_malloc (sizeof(umlopnode)); operation->key.parameters = NULL; tmpname = strtoupperfirst(attrlist->key.name); if ( ! strcmp(attrlist->key.type, "boolean") ) { sprintf(operation->key.attr.name, "is"); } else { sprintf(operation->key.attr.name, "get"); } strncat(operation->key.attr.name, tmpname, 76); free(tmpname); operation->key.implementation = (char*) my_malloc (90); sprintf(operation->key.implementation, " return "); strncat(operation->key.implementation, attrlist->key.name, 76); strcat(operation->key.implementation, ";"); operation->key.attr.isabstract = 0; operation->key.attr.isstatic = 0; operation->key.attr.visibility = '0'; operation->key.attr.value[0] = 0; strncpy(operation->key.attr.type, attrlist->key.type, 79); operation->next = NULL; myself->operations = insert_operation(operation, myself->operations); } attrlist = attrlist->next; } } void parse_geom_position(xmlNodePtr attribute, geometry * geom ) { xmlChar *val; char * token; val = xmlGetProp(attribute, "val"); token = strtok(val,","); sscanf ( token, "%f", &(geom->pos_x) ); token = strtok(NULL,","); sscanf ( token, "%f", &(geom->pos_y) ); } void parse_geom_width(xmlNodePtr attribute, geometry * geom ) { xmlChar *val; val = xmlGetProp(attribute, "val"); sscanf ( val, "%f", &(geom->width) ); } void parse_geom_height(xmlNodePtr attribute, geometry * geom ) { xmlChar *val; val = xmlGetProp(attribute, "val"); sscanf ( val, "%f", &(geom->height) ); } /* returns 1 if the position point of the object with geom2 is inside the object with geom1 0 otherwise */ int is_inside(const geometry * geom1, const geometry * geom2) { return geom1->pos_x < geom2->pos_x && geom2->pos_x < (geom1->pos_x+geom1->width) && geom1->pos_y < geom2->pos_y && geom2->pos_y < (geom1->pos_y+geom1->height); } umlpackagelist parse_package(xmlNodePtr package) { xmlNodePtr attribute; umlpackagelist listmyself; umlpackage *myself; xmlChar *attrname; listmyself = (umlpackagelist) my_malloc ( sizeof ( umlpackagenode)); myself = (umlpackage*) my_malloc(sizeof(umlpackage)); myself->parent = NULL; listmyself->next = NULL; listmyself->key = myself; attribute = package->xmlChildrenNode; while ( attribute != NULL ) { attrname = xmlGetProp(attribute, "name"); if ( ! strcmp("name", attrname) ) { parse_dia_string(attribute->xmlChildrenNode, myself->name); } else if ( ! strcmp ( "obj_pos", attrname ) ) { parse_geom_position(attribute->xmlChildrenNode, &myself->geom ); } else if ( ! strcmp ( "elem_width", attrname ) ) { parse_geom_width(attribute->xmlChildrenNode, &myself->geom ); } else if ( ! strcmp ( "elem_height", attrname ) ) { parse_geom_height(attribute->xmlChildrenNode, &myself->geom ); } attribute = attribute->next; } return listmyself; } umlclasslist parse_class(xmlNodePtr class) { xmlNodePtr attribute; xmlChar *attrname; umlclasslist listmyself; umlclass *myself; listmyself = (umlclasslist) my_malloc (sizeof (umlclassnode)); myself = (umlclass*) my_malloc (sizeof(umlclass)); myself->package = NULL; listmyself->key = myself; listmyself->parents = NULL; listmyself->associations = NULL; listmyself->dependencies = NULL; listmyself->next = NULL; attribute = class->xmlChildrenNode; while ( attribute != NULL ) { attrname = xmlGetProp(attribute, "name"); if ( ! strcmp("name", attrname) ) { parse_dia_string(attribute->xmlChildrenNode, myself->name); } else if ( ! strcmp ( "obj_pos", attrname ) ) { parse_geom_position(attribute->xmlChildrenNode, &myself->geom ); } else if ( ! strcmp ( "elem_width", attrname ) ) { parse_geom_width(attribute->xmlChildrenNode, &myself->geom ); } else if ( ! strcmp ( "elem_height", attrname ) ) { parse_geom_height(attribute->xmlChildrenNode, &myself->geom ); } else if ( ! strcmp("comment", attrname)) { if (attribute->xmlChildrenNode->xmlChildrenNode != NULL) { parse_dia_string(attribute->xmlChildrenNode, myself->comment); } else { myself->comment[0] = 0; } } else if ( ! strcmp("stereotype", attrname) ) { if ( attribute->xmlChildrenNode->xmlChildrenNode != NULL ) { parse_dia_string(attribute->xmlChildrenNode, myself->stereotype); } else { myself->stereotype[0] = 0; } } else if ( ! strcmp("abstract", attrname) ) { myself->isabstract = parse_boolean(attribute->xmlChildrenNode); } else if ( ! strcmp("attributes", attrname) ) { myself->attributes = parse_attributes(attribute->xmlChildrenNode); } else if ( ! strcmp("operations", attrname) ) { myself->operations = parse_operations(attribute->xmlChildrenNode); if ( ! strcmp(myself->stereotype, "JavaBean")) { /* Javabean: we should now add a get() and set() methods for each attribute */ make_javabean_methods(myself); } } else if ( ! strcmp("templates", attrname) ) { myself->templates = parse_templates(attribute->xmlChildrenNode); } free(attrname); attribute = attribute->next; } return listmyself; } /** Simple, non-compromising, implementation declaration. This function creates a plain vanilla interface (an umlclasslist) and associates it to the implementator. The implementator's code should contain the interface name, but the interface itself will not be inserted into the classlist, so no code can be generated for it. */ void lolipop_implementation(umlclasslist classlist, xmlNodePtr object) { xmlNodePtr attribute; xmlChar *id = NULL, *name = NULL; xmlChar *attrname; umlclasslist interface, implementator; attribute = object->xmlChildrenNode; while ( attribute != NULL ) { if ( ! strcmp("connections", attribute->name) ) { id = xmlGetProp(attribute->xmlChildrenNode, "to"); } else { attrname = xmlGetProp(attribute, "name"); if ( ! strcmp("text", attrname) && attribute->xmlChildrenNode != NULL && attribute->xmlChildrenNode->xmlChildrenNode != NULL ){ name = attribute->xmlChildrenNode->xmlChildrenNode->content; } else { name = ""; } free(attrname); } attribute = attribute->next; } implementator = find(classlist, id); free(id); if (implementator != NULL && strlen(name) > 2) { interface = (umlclasslist) my_malloc (sizeof (umlclassnode)); interface->key = (umlclass *) my_malloc (sizeof(umlclass)); interface->parents = NULL; interface->next = NULL; sprintf(interface->key->id, "00"); sscanf(name, "#%79[^#]#", interface->key->name); sprintf(interface->key->stereotype, "Interface"); interface->key->isabstract = 1; interface->key->attributes = NULL; interface->key->operations = NULL; addparent(interface, implementator); /* we MUST NOT free interface at this point */ } } void ricursive_search(xmlNodePtr node, xmlNodePtr * object) { xmlNodePtr child; if ( *object != NULL ) { return; } if ( node != NULL ) { if ( ! strcmp(node->name,"object") ){ *object = node; return; } child = node->xmlChildrenNode; while ( child != NULL ) { ricursive_search(child,object); child=child->next; } } } /* Gets the next "object" node. Basically, gets from->next. When it is null it checks for from->parent->next. FIXME: the code is ugly */ xmlNodePtr getNextObject(xmlNodePtr from) { xmlNodePtr next = NULL; if ( from->next != NULL ){ next = from->next; if ( ! strcmp(next->name,"group") ){ next = next->xmlChildrenNode; while ( ! strcmp(next->name,"group") ){ next=next->xmlChildrenNode; } } return next; } next = from->parent->next; if ( next != NULL ){ if ( ! strcmp(next->name,"group") ){ next = next->xmlChildrenNode; while ( ! strcmp(next->name,"group") ){ next=next->xmlChildrenNode; } return next; } if ( ! strcmp(next->name,"layer") ){ return next->xmlChildrenNode; } return next; } return NULL; } umlclasslist parse_diagram(char *diafile) { xmlDocPtr ptr; xmlChar *objtype, *attrtype, *tmptype, *tmptype2; xmlChar *objid; xmlChar *end1; xmlChar *end2; xmlNodePtr object = NULL, attribute; umlclasslist classlist, tmplist, endlist = NULL; umlpackagelist packagelist, dummypcklist, tmppcklist, endpcklist = NULL; ptr = xmlParseFile(diafile); if (ptr == NULL) { fprintf(stderr, "That file does not exist or is not a Dia diagram\n"); exit(2); } /* we search for the first "object" node */ ricursive_search( ptr->xmlRootNode->xmlChildrenNode->next, &object ); classlist = NULL; packagelist = NULL; while (object != NULL) { objtype = xmlGetProp(object, "type"); /* Here we have a Dia object */ if ( !strcmp("UML - Class", objtype) ) { /* Here we have a class definition */ tmplist = parse_class(object); if (tmplist != NULL) { /* We get the ID of the object here*/ objid = xmlGetProp(object, "id"); sscanf(objid, "%79s", tmplist->key->id); free(objid); /* We insert it here*/ if ( classlist == NULL ) { classlist = endlist = tmplist; } else { endlist->next = tmplist; endlist = tmplist; } } } else if ( ! strcmp("UML - LargePackage",objtype) || ! strcmp("UML - SmallPackage",objtype)) { tmppcklist = parse_package(object); if ( tmppcklist != NULL ) { /* We get the ID of the object here*/ objid = xmlGetProp(object, "id"); sscanf(objid, "%79s", tmppcklist->key->id); free(objid); } /* We insert it here*/ if ( packagelist == NULL ) { packagelist = endpcklist = tmppcklist; } else { endpcklist->next = tmppcklist; endpcklist = tmppcklist; } } free(objtype); object = getNextObject(object); } /* Second pass - Implementations and associations */ /* The association is done as a queue, so we must first put in realizations (interfaces) and then generalizations (inheritance) so we will have the latter first and the former after (!) THIS STILL SUCKS !!! How soon is now? */ /* we search for the first "object" node */ ricursive_search( ptr->xmlRootNode->xmlChildrenNode->next, &object ); while ( object != NULL ) { objtype = xmlGetProp(object, "type"); if ( ! strcmp("UML - Association", objtype) ) { char * name = NULL; char direction = 0; char composite = 0; attribute = object->xmlChildrenNode; while ( attribute != NULL) { attrtype = xmlGetProp(attribute, "name"); if ( attrtype != NULL && ! strcmp("ends", attrtype) ) { tmptype = xmlGetProp(attribute->xmlChildrenNode->xmlChildrenNode->next->next->next->xmlChildrenNode, "val"); if ( ! strcmp("0", tmptype) ) { direction = 1; if (attribute->xmlChildrenNode->xmlChildrenNode->xmlChildrenNode->xmlChildrenNode != NULL) { name = attribute->xmlChildrenNode->xmlChildrenNode->xmlChildrenNode->xmlChildrenNode->content; } tmptype2 = xmlGetProp(attribute->xmlChildrenNode->next->xmlChildrenNode->next->next->next->xmlChildrenNode, "val"); if (!strcmp("1", tmptype2)) { composite = 1; } else { composite = 0; } free(tmptype2); } else { direction = 0; if (attribute->xmlChildrenNode->next->xmlChildrenNode->xmlChildrenNode->xmlChildrenNode != NULL) { name = attribute->xmlChildrenNode->next->xmlChildrenNode->xmlChildrenNode->xmlChildrenNode->content; } tmptype2 = xmlGetProp(attribute->xmlChildrenNode->xmlChildrenNode->next->next->next->xmlChildrenNode, "val"); if (!strcmp("1", tmptype2)) { composite = 1; } else { composite = 0; } free(tmptype2); } free(tmptype); } free(attrtype); attribute = attribute->next; } attribute = object->xmlChildrenNode; while ( attribute != NULL ) { if ( ! strcmp("connections", attribute->name) ) { end1 = xmlGetProp(attribute->xmlChildrenNode, "to"); end2 = xmlGetProp(attribute->xmlChildrenNode->next, "to"); if (direction == 1) { associate(classlist, name, composite, end1, end2); } else { associate(classlist, name, composite, end2, end1); } free(end1); free(end2); } attribute = attribute->next; } } else if ( ! strcmp("UML - Dependency", objtype) ) { attribute = object->xmlChildrenNode; while ( attribute != NULL ) { if ( ! strcmp("connections", attribute->name) ) { end1 = xmlGetProp(attribute->xmlChildrenNode, "to"); end2 = xmlGetProp(attribute->xmlChildrenNode->next, "to"); make_depend(classlist, end1, end2); free(end1); free(end2); } attribute = attribute->next; } } else if ( ! strcmp("UML - Realizes", objtype) ) { attribute = object->xmlChildrenNode; while ( attribute != NULL ) { if ( ! strcmp("connections", attribute->name) ) { end1 = xmlGetProp(attribute->xmlChildrenNode, "to"); end2 = xmlGetProp(attribute->xmlChildrenNode->next, "to"); inherit_realize(classlist, end1, end2); free(end2); free(end1); } attribute = attribute->next; } } else if ( ! strcmp("UML - Implements", objtype) ) { lolipop_implementation(classlist, object); } free(objtype); object = getNextObject(object); } /* Generalizations: we must put this AFTER all the interface implementations. generate_code_java relies on this. */ ricursive_search( ptr->xmlRootNode->xmlChildrenNode->next, &object ); while ( object != NULL ) { objtype = xmlGetProp(object, "type"); if ( ! strcmp("UML - Generalization", objtype) ) { attribute = object->xmlChildrenNode; while ( attribute != NULL ) { if ( ! strcmp("connections", attribute->name) ) { end1 = xmlGetProp(attribute->xmlChildrenNode, "to"); end2 = xmlGetProp(attribute->xmlChildrenNode->next, "to"); inherit_realize(classlist, end1, end2); free(end2); free(end1); } attribute = attribute->next; } } free(objtype); object = getNextObject(object); } /* Packages: we should scan the packagelist and then the classlist. Scanning the packagelist we'll build all relationships between packages. Scanning the classlist we'll associate its own package to each class. FIXME: maybe we can do both in the same pass */ /* Build the relationships between packages */ dummypcklist = packagelist; while ( dummypcklist != NULL ) { tmppcklist = packagelist; while ( tmppcklist != NULL ) { if ( is_inside(&dummypcklist->key->geom,&tmppcklist->key->geom) ) { if ( tmppcklist->key->parent == NULL ) { tmppcklist->key->parent = dummypcklist->key; } else { if ( ! is_inside ( &dummypcklist->key->geom, &tmppcklist->key->parent->geom ) ) { tmppcklist->key->parent = dummypcklist->key; } } } tmppcklist = tmppcklist->next; } dummypcklist = dummypcklist->next; } /* Associate packages to classes */ dummypcklist = packagelist; while ( dummypcklist != NULL ) { tmplist = classlist; while ( tmplist != NULL ) { if ( is_inside(&dummypcklist->key->geom,&tmplist->key->geom) ) { if ( tmplist->key->package == NULL ) { tmplist->key->package = dummypcklist->key; } else { if ( ! is_inside ( &dummypcklist->key->geom, &tmplist->key->package->geom ) ) { tmplist->key->package = dummypcklist->key; } } } tmplist = tmplist->next; } dummypcklist = dummypcklist->next; } return classlist; } dia2code-0.8.3/dia2code/parse_diagram.h0100644000076400001440000000214007457104226017171 0ustar kelloggusers/*************************************************************************** parse_diagram.h - The parser of the Dia file ------------------- begin : Sat Dec 16 2000 copyright : (C) 2000-2001 by Javier O'Hara email : joh314@users.sourceforge.net ***************************************************************************/ /*************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * ***************************************************************************/ #include "dia2code.h" umlclasslist parse_diagram(char *diafile); dia2code-0.8.3/dia2code/generate_code_java.c0100644000076400001440000003057310547512632020164 0ustar kelloggusers/*************************************************************************** generate_code_java.c - Function that generates Java code ------------------- begin : Sat Dec 16 2000 copyright : (C) 2000-2001 by Javier O'Hara email : joh314@users.sourceforge.net ***************************************************************************/ /*************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * ***************************************************************************/ #include "dia2code.h" // Other things to be fixed: // The code that determines the parent class and implementations needs to go in order from "extends" to "implements". #define JAVA_EXTENDS 0 #define JAVA_IMPLEMENTS 1 char *dia_visibility_to_string(int visibility) { switch (visibility) { case '0': return "public"; case '1': return "private"; case '2': return "protected"; default: return ""; } } // This function dumps out the list of interfaces and extensions, as necessary. // int java_manage_parents(FILE *f, umlclasslist parents, int stereotype) { char *tmpname; int cnt = 0; while ( parents != NULL ) { tmpname = strtolower(parents->key->stereotype); if (eq(tmpname, "interface")) { if (stereotype == JAVA_IMPLEMENTS) { d2c_fprintf(f, " implements %s", parents->key->name); cnt++; } } else { if (stereotype == JAVA_EXTENDS) { d2c_fprintf(f, " extends %s", parents->key->name); cnt++; } } free(tmpname); parents = parents->next; } return cnt; } void generate_code_java(batch *b) { umlclasslist tmplist, parents; umlassoclist associations; umlattrlist umla, tmpa; umlpackagelist tmppcklist; umloplist umlo; char *tmpname; char outfilename[90]; FILE * outfile, *dummyfile, *licensefile = NULL; int file_found = 0; umlclasslist used_classes; #define CLASSTYPE_CLASS 0 #define CLASSTYPE_ABSTRACT 1 #define CLASSTYPE_INTERFACE 2 int classtype; int tmpdirlgth, tmpfilelgth; if (b->outdir == NULL) b->outdir = "."; tmpdirlgth = strlen(b->outdir); tmplist = b->classlist; /* open license file */ if ( b->license != NULL ) { licensefile = fopen(b->license, "r"); if(!licensefile) { fprintf(stderr, "Can't open the license file.\n"); exit(2); } } while ( tmplist != NULL ) { if ( ! ( is_present(b->classes, tmplist->key->name) ^ b->mask ) ) { tmpname = tmplist->key->name; /* This prevents buffer overflows */ tmpfilelgth = strlen(tmpname); if (tmpfilelgth + tmpdirlgth > sizeof(*outfilename) - 2) { fprintf(stderr, "Sorry, name of file too long ...\nTry a smaller dir name\n"); exit(4); } sprintf(outfilename, "%s/%s.java", b->outdir, tmplist->key->name); dummyfile = fopen(outfilename, "r"); file_found = dummyfile != NULL; if (file_found) { d2c_parse_impl(dummyfile, "//", ""); close(dummyfile); if (d2c_backup(outfilename)) exit(5); } if ( b->clobber || ! file_found ) { outfile = fopen(outfilename, "w"); if ( outfile == NULL ) { fprintf(stderr, "Can't open file %s for writing\n", outfilename); exit(3); } d2c_dump_impl(outfile, "opening", ""); /* add license to the header */ if(b->license != NULL) { char lc; rewind(licensefile); while((lc = fgetc(licensefile)) != EOF) d2c_fputc(lc, outfile); } tmppcklist = make_package_list(tmplist->key->package); if ( tmppcklist != NULL ){ d2c_fprintf(outfile,"package %s",tmppcklist->key->name); tmppcklist=tmppcklist->next; while ( tmppcklist != NULL ) { d2c_fprintf(outfile,".%s",tmppcklist->key->name); tmppcklist=tmppcklist->next; } d2c_fputs(";\n\n", outfile); } /* We generate the import clauses */ used_classes = list_classes(tmplist, b); while (used_classes != NULL) { tmppcklist = make_package_list(used_classes->key->package); if ( tmppcklist != NULL ) { if ( strcmp(tmppcklist->key->id,tmplist->key->package->id)) { /* This class' package and our current class' package are not the same */ d2c_fprintf(outfile,"import %s",tmppcklist->key->name); tmppcklist=tmppcklist->next; while ( tmppcklist != NULL ) { d2c_fprintf(outfile, ".%s", tmppcklist->key->name); tmppcklist=tmppcklist->next; } d2c_fprintf(outfile,".%s;\n",used_classes->key->name); } } else { /* No info for this class' package, we include it directly */ d2c_fprintf(outfile, "import %s;\n",used_classes->key->name); } used_classes = used_classes->next; } d2c_dump_impl(outfile, "import", ""); d2c_fprintf(outfile, "\npublic "); tmpname = strtolower(tmplist->key->stereotype); if (eq("interface", tmpname) ) classtype = CLASSTYPE_INTERFACE; else { if (tmplist->key->isabstract) classtype = CLASSTYPE_ABSTRACT; else classtype = CLASSTYPE_CLASS; } free(tmpname); switch(classtype) { case CLASSTYPE_INTERFACE: d2c_fprintf(outfile, "interface "); break; case CLASSTYPE_ABSTRACT: d2c_fprintf(outfile, "abstract class "); break; case CLASSTYPE_CLASS: d2c_fprintf(outfile, "class "); break; } d2c_fprintf(outfile, "%s", tmplist->key->name); if (java_manage_parents(outfile, tmplist->parents, JAVA_EXTENDS) == 0) { d2c_fprintf(outfile, "\n"); d2c_dump_impl(outfile, "extends", ""); } java_manage_parents(outfile, tmplist->parents, JAVA_IMPLEMENTS); // At this point we need to make a decision: // If you want to implement flexibility to add "extends", then the brace must be on the next line. if (1) // if (dumping_implementations) d2c_fprintf(outfile, "\n"); d2c_dump_impl(outfile, "inheritence", ""); d2c_open_brace(outfile, ""); umla = tmplist->key->attributes; if( umla != NULL) d2c_fprintf(outfile, "/** Attributes */\n"); while ( umla != NULL) { d2c_fprintf(outfile, "%s ", dia_visibility_to_string(umla->key.visibility)); if (umla->key.isstatic) d2c_fprintf(outfile, "static "); d2c_fprintf(outfile, "%s %s", umla->key.type, umla->key.name); if ( umla->key.value[0] != 0 ) d2c_fprintf(outfile, " = %s", umla->key.value); d2c_fprintf(outfile, ";\n"); umla = umla->next; } if (classtype != CLASSTYPE_INTERFACE) d2c_dump_impl(outfile, "attributes", ""); associations = tmplist->associations; if (associations != NULL) d2c_fprintf(outfile, "/** Associations */\n"); while ( associations != NULL ) { d2c_fprintf(outfile, "private %s %s;\n", associations->key->name, associations->name); associations = associations->next; } d2c_dump_impl(outfile, "associations", ""); // Operations here // umlo = tmplist->key->operations; while ( umlo != NULL) { d2c_fprintf(outfile, "/**\n"); d2c_fprintf(outfile, " * Operation\n"); d2c_fprintf(outfile, " *\n"); tmpa = umlo->key.parameters; while (tmpa != NULL) { d2c_fprintf(outfile, " * @param %s\n", tmpa->key.name); tmpa = tmpa->next; } if(strcmp(umlo->key.attr.type, "void")) d2c_fprintf(outfile, " * @return %s\n", umlo->key.attr.type); d2c_fprintf(outfile, " */\n"); //d2c_fprintf(outfile, " "); if ( umlo->key.attr.isabstract ) { d2c_fprintf(outfile, "abstract "); umlo->key.attr.value[0] = '0'; } d2c_fprintf(outfile, "%s ", dia_visibility_to_string(umlo->key.attr.visibility)); if ( umlo->key.attr.isstatic ) d2c_fprintf(outfile, "static "); if (strlen(umlo->key.attr.type) > 0) d2c_fprintf(outfile, "%s ", umlo->key.attr.type); d2c_fprintf(outfile, "%s ( ", umlo->key.attr.name); tmpa = umlo->key.parameters; while (tmpa != NULL) { d2c_fprintf(outfile, "%s %s", tmpa->key.type, tmpa->key.name); /* if ( tmpa->key.value[0] != 0 ){ d2c_fprintf(outfile," = %s",tmpa->key.value); } */ tmpa = tmpa->next; if (tmpa != NULL) d2c_fprintf(outfile, ", "); } d2c_fprintf(outfile, " )"); // RK - Not sure this is right but I did it. This // prevents curly braces from being applied when CLASSTYPE is interface. if ( umlo->key.attr.isabstract || classtype == CLASSTYPE_INTERFACE) d2c_fprintf(outfile, ";\n"); else { d2c_open_brace(outfile, ""); d2c_dump_impl(outfile, "method", d2c_operation_mangle_name(umlo)); if ( umlo->key.implementation != NULL ) d2c_fprintf(outfile, "%s\n", umlo->key.implementation); d2c_close_brace(outfile, ""); } umlo = umlo->next; } if (classtype != CLASSTYPE_INTERFACE) d2c_dump_impl(outfile, "other.operations", ""); d2c_close_brace(outfile, "\n"); d2c_dump_impl(outfile, "closing", ""); d2c_deprecate_impl(outfile, "//", ""); fclose(outfile); } } tmplist = tmplist->next; } } dia2code-0.8.3/dia2code/includes.c0100644000076400001440000000243507574616325016213 0ustar kelloggusers#include "includes.h" namelist includes = NULL; int have_include (char *name) { namelist inc = includes; while (inc) { if (!strcmp (inc->name, name)) return 1; inc = inc->next; } return 0; } void add_include (char *name) { namelist inc = includes; if (have_include (name)) return; if (inc == NULL) { includes = NEW (namenode); inc = includes; } else { while (inc->next) inc = inc->next; inc->next = NEW (namenode); inc = inc->next; } inc->name = name; inc->next = NULL; } void push_include (umlclassnode *node) { if (node->key->package != NULL) { umlpackagelist pkglist = make_package_list (node->key->package); add_include (pkglist->key->name); } else { add_include (node->key->name); } } void determine_includes (declaration *d, batch *b) { if (d->decl_kind == dk_module) { declaration *inner = d->u.this_module->contents; while (inner != NULL) { determine_includes (inner, b); inner = inner->next; } } else { umlclasslist cl = list_classes (d->u.this_class, b); while (cl != NULL) { push_include (cl); cl = cl->next; } } } dia2code-0.8.3/dia2code/includes.h0100644000076400001440000000070307574616325016214 0ustar kelloggusers#ifndef INCLUDES_H #define INCLUDES_H /* Includefile computation related stuff (equally applicable to Ada with clause computation and Java package use computation) */ #include "dia2code.h" #include "decls.h" extern namelist includes; extern int have_include (char *name); extern void add_include (char *name); extern void push_include (umlclassnode *node); extern void determine_includes (declaration *d, batch *b); #endif /* INCLUDES_H */ dia2code-0.8.3/dia2code/dia2code.c0100644000076400001440000004614210261536254016047 0ustar kelloggusers/*************************************************************************** dia2code.c - Global functions ------------------- begin : Sat Dec 16 2000 copyright : (C) 2000-2001 by Javier O'Hara email : joh314@users.sourceforge.net ***************************************************************************/ /*************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * ***************************************************************************/ #include "dia2code.h" #include "errno.h" /** * This function returns the upper case char* of the one taken on input * The char * received may be freed by the caller */ char *strtoupper(char *s) { char *tmp = strdup(s); int i, n; if (tmp == NULL) { fprintf(stderr, "Out of memory\n"); exit(1); } n = strlen(tmp); for (i = 0; i < n; i++) { tmp[i] = toupper(tmp[i]); } return tmp; } /** * This function returns the lower case char* of the one taken on input * The char * received may be freed by the caller */ char *strtolower(char *s) { char *tmp = strdup(s); int i, n; if (tmp == NULL) { fprintf(stderr, "Out of memory\n"); exit(1); } n = strlen(tmp); for (i = 0; i < n; i++) { tmp[i] = tolower(tmp[i]); } return tmp; } /** * This function returns the a char* that has the first * character in upper case and the rest unchanged. * The char * received may be freed by the caller */ char *strtoupperfirst(char *s) { char *tmp = strdup(s); int i, n; if (tmp == NULL) { fprintf(stderr, "Out of memory\n"); exit(1); } n = strlen(tmp); tmp[0] = toupper(tmp[0]); for (i = 1; i < n; i++) { tmp[i] = tmp[i]; } return tmp; } namelist parse_class_names(const char *s) { char *cp, *token; const char *delim = ","; namelist list = NULL, tmp; cp = strdup(s); if (cp == NULL) { fprintf(stderr, "Out of memory\n"); exit(1); } token = strtok (cp, delim); while ( token != NULL ) { tmp = (namelist) malloc (sizeof(namenode)); if (tmp == NULL) { fprintf(stderr, "Out of memory\n"); exit(1); } tmp->name = strdup(token); if (tmp->name == NULL) { fprintf(stderr, "Out of memory\n"); exit(1); } tmp->next = list; list = tmp; token = strtok (NULL, delim); } free(cp); return list; } int is_present(namelist list, const char *name) { while (list != NULL) { int len; char* mask; if ( ! strcmp(list->name, name) ) { return 1; } if ( (len = strlen(list->name)) && (2 <= len <= strlen(name)) && (mask = strchr(list->name, '*')) != NULL && mask == strrchr(list->name, '*') ) { len--; if ( mask == list->name && ! strcmp(list->name+1, name+strlen(name)-len) ) { return 1; } if ( mask == list->name+len && ! strncmp(list->name, name, len) ) { return 1; } } list = list->next; } return 0; } void * my_malloc( size_t size ) { void * tmp; tmp = malloc(size); if (tmp == NULL) { fprintf(stderr, "Out of memory\n"); exit(1); } return tmp; } /* Builds a package list from the hierarchy of parents of package. The topmost package will be the first on the list and the initial package will be the last. */ umlpackagelist make_package_list(umlpackage * package){ umlpackagelist dummylist,tmplist=NULL; while ( package != NULL ){ dummylist = (umlpackagelist) my_malloc(sizeof(umlpackagenode)); dummylist->next = tmplist; tmplist = dummylist; tmplist->key = package; package = package -> parent; } return tmplist; } umlattrlist copy_attributes(umlattrlist src) { umlattrlist cpy = NULL, start = NULL; while (src != NULL) { umlattrlist tmp = (umlattrlist) my_malloc(sizeof(umlattrnode)); tmp->key = src->key; if (cpy == NULL) { cpy = tmp; start = tmp; } else { cpy->next = tmp; cpy = tmp; } src = src->next; } if (cpy != NULL) cpy->next = NULL; return start; } int indentlevel = 0; static int number_of_spaces_for_one_indentation = 2; void set_number_of_spaces_for_one_indentation(int n) { number_of_spaces_for_one_indentation = n; } char *spc() { static char spcbuf[132]; int n_spaces = number_of_spaces_for_one_indentation * indentlevel; if (n_spaces >= sizeof(spcbuf)) { fprintf (stderr, "spc(): spaces buffer overflow\n"); exit (1); } memset (spcbuf, ' ', n_spaces); spcbuf[n_spaces] = '\0'; return spcbuf; } FILE *spec = NULL, *body = NULL; /* Auxiliary define for the emit/print functions */ #define var_arg_to_str(first_arg) \ va_list vargu; \ char str[4096]; \ va_start (vargu, first_arg); \ vsnprintf (str, 4096, first_arg, vargu); \ va_end (vargu) void emit (char *msg, ...) { var_arg_to_str (msg); fputs (str, spec); } void ebody (char *msg, ...) { var_arg_to_str (msg); if (body != NULL) fputs (str, body); } void eboth (char *msg, ...) { var_arg_to_str (msg); fputs (str, spec); if (body != NULL) fputs (str, body); } void print (char *msg, ...) { var_arg_to_str (msg); fprintf (spec, "%s%s", spc(), str); } void pbody (char *msg, ...) { var_arg_to_str (msg); if (body != NULL) fprintf (body, "%s%s", spc(), str); } void pboth (char *msg, ...) { var_arg_to_str (msg); fprintf (spec, "%s%s", spc(), str); if (body != NULL) fprintf (body, "%s%s", spc(), str); } char *file_ext = NULL; char *body_file_ext = NULL; FILE * open_outfile (char *filename, batch *b) { static char outfilename[512]; FILE *o; int tmpdirlgth, tmpfilelgth; if (b->outdir == NULL) { b->outdir = "."; } tmpdirlgth = strlen (b->outdir); tmpfilelgth = strlen (filename); /* This prevents buffer overflows */ if (tmpfilelgth + tmpdirlgth > sizeof(outfilename) - 2) { fprintf (stderr, "Sorry, name of file too long ...\n" "Try a smaller dir name\n"); exit (1); } sprintf (outfilename, "%s/%s", b->outdir, filename); o = fopen (outfilename, "r"); if (o != NULL && !b->clobber) { fclose (o); return NULL; } o = fopen (outfilename, "w"); if (o == NULL) { fprintf (stderr, "Can't open file %s for writing\n", outfilename); exit (1); } return o; } int is_enum_stereo (char *stereo) { return (!strcmp (stereo, "CORBAEnum") || !strcmp (stereo, "Enumeration") || !strcmp (stereo, "enumeration")); } // Added by RK 2003-02-20 // This should become part of the uml_class object. struct endless_string_buf { char *buf; struct endless_string_buf *next; }; typedef struct endless_string_buf endless_string_buf; struct endless_string { endless_string_buf *start; endless_string_buf *end; }; typedef struct endless_string endless_string; void dump_endless_string(FILE *f, endless_string *es) { endless_string_buf *esb = es->start; while (esb != NULL) { fprintf(f, "%s", esb->buf); // We do not d2c_fprintf the buffer, cause it's read in indented. esb = esb->next; } } endless_string * new_endless_string() { endless_string *es = my_malloc(sizeof(endless_string)); es->start = NULL; es->end = NULL; } void destroy_endless_string(endless_string * es) { endless_string_buf *esb = es->start; endless_string_buf *esb_next; while (esb != NULL) { if (esb->buf != NULL) free(esb->buf); esb_next = esb->next; free(esb); esb = esb_next; } free (es); } void append_endless_string(endless_string * es, char *s) { endless_string_buf *esb = my_malloc(sizeof(endless_string_buf)); esb->buf = strdup(s); esb->next = NULL; if (es->start == NULL) es->start = esb; if (es->end != NULL) es->end->next = esb; es->end = esb; } struct d2c_impl{ char name[128]; endless_string *impl; int impl_len; int in_source; int in_class; struct d2c_impl *next; }; typedef struct d2c_impl d2c_impl; d2c_impl *d2c_impl_list = NULL; void d2c_impl_list_destroy() { d2c_impl *p = d2c_impl_list; while (p != NULL) { destroy_endless_string(p->impl); d2c_impl_list = p; p = p->next; free(d2c_impl_list); } d2c_impl_list = NULL; } d2c_impl * d2c_impl_add(char *name) { d2c_impl *d2ci; d2ci = malloc(sizeof(d2c_impl)); strcpy(d2ci->name, name); d2ci->impl = new_endless_string(); d2ci->impl_len = 0; d2ci->in_source = 0; d2ci->in_class = 0; d2ci->next = d2c_impl_list; d2c_impl_list = d2ci; return d2ci; } d2c_impl* d2c_impl_find(char *name) { d2c_impl *p = d2c_impl_list; while (p != NULL) { if (strcmp(p->name, name) == 0) return p; p = p->next; } return NULL; } d2c_impl *d2c_impl_find_or_add(char *name) { d2c_impl *p = d2c_impl_find(name); if (p == NULL) p = d2c_impl_add(name); return p; } #define IMPLEMENTATION "Implementation" void d2c_impl_comment(FILE *f, char *nm, char *range, int preserve, char *comment_start, char *comment_end) { d2c_fprintf(f, "%s ## %s %spreserve %s class %s %s\n", comment_start, IMPLEMENTATION, preserve?"":"no", range, nm, comment_end); } void d2c_dump_impl(FILE *f, char *section, char *name) { char nm[LARGE_BUFFER]; d2c_impl *d2ci; sprintf(nm, "%s.%s", section, name); d2ci = d2c_impl_find_or_add(nm); d2ci->in_class = 1; d2c_impl_comment(f, nm, "start", 1, "//", ""); dump_endless_string(f, d2ci->impl); d2c_impl_comment(f, nm, "end", 1, "//", ""); } void d2c_deprecate_impl(FILE *f, char *comment_start, char *comment_end) { d2c_impl *p = d2c_impl_list; int cnt = 0; endless_string_buf *esb; while (p != NULL) { if (p->in_class == 0 && p->in_source == 1) { fprintf(stderr, "Deprecating implementation %s\n", p->name); if (cnt == 0) { d2c_fprintf(f, "\n%s WARNING: %s\n", comment_start, comment_end); d2c_fprintf(f, "%s The following code blocks will be deleted the next time code is generated. %s\n\n", comment_start, comment_end); } d2c_impl_comment(f, p->name, "start", 0, comment_start, comment_end); esb = p->impl->start; while (esb != NULL) { // We do not d2c_fprintf the buffer, cause it's read in indented. fprintf(f, "// %s", esb->buf); esb = esb->next; } d2c_impl_comment(f, p->name, "end", 0, comment_start, comment_end); cnt++; } p = p->next; } if (cnt > 0) fprintf(stderr, "Warning: %d implementation blocks have been deprecated; examime source files.\n", cnt); } void d2c_parse_impl(FILE *f, char *cmt_start, char *cmt_end) { #define IN_SOURCE 0 #define START_IMPL 1 #define IN_IMPL 2 #define END_IMPL 3 #define STATE_WARNING(s) fprintf(stderr, "Warning: line %ld %s, state=%d, %p, %s\n", line, (s), state, d2ci, ((d2ci != NULL) ? d2ci->name : "")); char s[HUGE_BUFFER]; char s_comment[SMALL_BUFFER], s_dbl_hash[SMALL_BUFFER], s_implementation[SMALL_BUFFER], s_preserve[SMALL_BUFFER], s_marker[SMALL_BUFFER], s_class[LARGE_BUFFER], s_name[LARGE_BUFFER]; int state = IN_SOURCE; int count; d2c_impl *d2ci; endless_string *es; long line = 0; int preserve; d2c_impl_list_destroy(); while (fgets(s, HUGE_BUFFER - 1, f) != NULL) { line++; if (state == START_IMPL) state = IN_IMPL; if (state == END_IMPL) state = IN_SOURCE; count = sscanf(s, " %80s %80s %80s %80s %80s %8192s %8192s", s_comment, s_dbl_hash, s_implementation, s_preserve, s_marker, s_class, s_name); if (count == 7 && (strncmp(s_comment, cmt_start, SMALL_BUFFER) == 0) && (strncmp(s_dbl_hash, "##", SMALL_BUFFER) == 0) && (strncmp(s_implementation, IMPLEMENTATION, SMALL_BUFFER) == 0)) { if (strncmp(s_marker, "start", SMALL_BUFFER) == 0) { if (state != IN_SOURCE) { STATE_WARNING("found a nested implementation comment") } preserve = strcmp(s_preserve, "preserve")?0:1; state = START_IMPL; d2ci = d2c_impl_find_or_add(s_name); es = d2ci->impl; } else if (strncmp(s_marker, "end", SMALL_BUFFER) == 0) { if (state != IN_IMPL) { STATE_WARNING("found an end implemenataion comment without matching start") } if (d2ci && strcmp(d2ci->name, s_name) != 0) { STATE_WARNING("end implementation comment does not match start implementation comment") } state = END_IMPL; d2ci = NULL; es = NULL; } else { STATE_WARNING("unrecognized state marker") } } if (state == IN_IMPL && preserve) { append_endless_string(es, s); d2ci->in_source= 1; } } if (state != IN_SOURCE && state != END_IMPL) STATE_WARNING("found start implementation comment without end comment") } // This function takes a UML Operation and mangles it for implementation comments. // Because it uses an internal buffer to store and return, repeated calls to this // function will overwrite previous values. // char *d2c_operation_mangle_name(umlopnode *op) { static char d2c_mangle_name[LARGE_BUFFER]; umlattrlist params = op->key.parameters; char *p; sprintf(d2c_mangle_name, "%s@%s@@", op->key.attr.name, op->key.attr.type); while (params != NULL) { strcat(d2c_mangle_name, "@"); strcat(d2c_mangle_name, params->key.type); params = params->next; } // Convert whitespace to underbars for (p = d2c_mangle_name; *p != '\0'; p++) { if (*p == ' ' || *p == '\t') *p = '_'; } return d2c_mangle_name; } int d2c_backup(char *filename) { // This is not necessarily portable. (requires ability to just // tag-on four more characters - not DOS-friendly) // But I'll admit to being a bit out-of-the loop here. // char *backup_filename = my_malloc(strlen(filename) + 4); strcpy(backup_filename, filename); strcat(backup_filename, ".bak"); if (generate_backup) { if (remove(backup_filename)) { if (errno != ENOENT) { fprintf(stderr, "Error %d while trying to delete file %s\n", errno, backup_filename); return -1; } } if (rename(filename, backup_filename)) { if (errno != ENOENT) { fprintf(stderr, "Error %d while trying to rename %s to %s\n", errno, filename, backup_filename); return -1; } } } return 0; } // Todo on auto-indentation: // 1. Define meta-characters that are converted to braces int indent_count = 4; int indent_open_brace_on_newline = 1; typedef struct { FILE *f; int indentation; } D2C_INDENT_STRUCT; D2C_INDENT_STRUCT d2c_files[10]; int d2c_num_files = 0; int d2c_indent_offset(FILE *f) { int i; for (i = 0; i < d2c_num_files; i++) { if (d2c_files[i].f == f) { return i; } } d2c_files[i].f = f; d2c_files[i].indentation = 0; d2c_num_files++; return i; } void d2c_indent(FILE *f) { d2c_files[d2c_indent_offset(f)].indentation++; } void d2c_outdent(FILE *f) { d2c_files[d2c_indent_offset(f)].indentation--; } int d2c_fprint_indent(FILE *f) { int i; int indentation; indentation = d2c_files[d2c_indent_offset(f)].indentation; for (i = 0; i < indentation * indent_count; i++) fputc(' ', f); return i; } char d2c_io_lchar = 0; int _d2c_fputc(int c, FILE *f) { int indent_cnt = 0; int rc; if (d2c_io_lchar == '\n' && c != '\n') indent_cnt = d2c_fprint_indent(f); d2c_io_lchar = c; rc = fputc(c, f); if (rc == EOF) return rc; else return indent_cnt + 1; } int _d2c_fputs(const char *s, FILE *f) { const char *buf = s; //int len = 0; while (*buf != '\0') { if (fputc(*buf, f) == EOF) return EOF; //len++; } return 1; } char d2c_fprintf_buf[HUGE_BUFFER * 2]; int _d2c_fprintf(FILE *f, char *fmt, ...) { va_list argptr; int cnt; int extern_cnt; int i; va_start(argptr, fmt); cnt = vsprintf(d2c_fprintf_buf, fmt, argptr); va_end(argptr); extern_cnt = cnt; if (cnt != EOF) { for (i = 0; i < cnt; i++) { extern_cnt += _d2c_fputc(d2c_fprintf_buf[i], f); } } return extern_cnt; } void d2c_open_brace(FILE *f, char *suffix) { if (indent_open_brace_on_newline) { d2c_fputc('\n', f); } else { d2c_fputc(' ', f); } d2c_fprintf(f, "{%s\n", suffix); d2c_indent(f); } void d2c_close_brace(FILE *f, char *suffix) { d2c_outdent(f); d2c_fprintf(f, "}%s\n", suffix); } param_list *d2c_parameters = NULL; void param_list_destroy() { param_list *p = d2c_parameters; while (p != NULL) { free(p->name); free(p->value); d2c_parameters = p; p = p->next; free(d2c_parameters); } d2c_parameters = NULL; } param_list * d2c_parameter_add(char *name, char *value) { param_list *entry; entry = malloc(sizeof(d2c_parameters)); entry->name = strdup(name); entry->value = value ? strdup(value) : NULL; entry->next = d2c_parameters; d2c_parameters = entry; return entry; } param_list * d2c_parameter_set(char *name, char *value) { param_list *entry = d2c_parameter_find(name); if (entry == NULL) entry=d2c_parameter_add(name, value); else { free(entry->value); entry->value = value ? strdup(value) : NULL; } return entry; } char * d2c_parameter_value(char *name) { param_list *entry = d2c_parameter_find(name); if (entry != NULL) return entry->value; return NULL; } param_list *d2c_parameter_find(char *name) { param_list *p = d2c_parameters; while (p != NULL) { if (strcmp(p->name, name) == 0) return p; p = p->next; } return NULL; } dia2code-0.8.3/dia2code/dia2code.h0100644000076400001440000001646210547512631016056 0ustar kelloggusers/*********************************************1****************************** dia2code.h - Global types and functions ------------------- begin : Sat Dec 16 2000 copyright : (C) 2000-2001 by Javier O'Hara email : joh314@users.sourceforge.net ***************************************************************************/ /*************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * ***************************************************************************/ #ifndef DIA2CODE_H #define DIA2CODE_H #include #include #include #include #include #include /* libxml[2] headers */ #include #include #define VERSION "0.8.3" #ifdef DSO #include #define MODULE_DIR ".dia2code" #define DSO_PREFIX "generate_code_" #define DSO_SUFFIX ".so" #endif #define kind_str(A) ((A)=='1'?"in":((A)=='2'?"in/out":((A)=='3'?"out":"???"))) struct umlattribute { char name[80]; char value[80]; char type [80]; char comment [80]; char visibility; char isabstract; char isstatic; char kind; }; typedef struct umlattribute umlattribute; struct umlattrnode { umlattribute key; struct umlattrnode *next; }; typedef struct umlattrnode umlattrnode; typedef umlattrnode *umlattrlist; struct umloperation{ umlattribute attr; umlattrlist parameters; char *implementation; }; typedef struct umloperation umloperation; struct umlopnode { umloperation key; struct umlopnode *next; }; struct umltemplate{ char name[80]; char type[80]; }; typedef struct umltemplate umltemplate; typedef struct umlopnode umlopnode; typedef umlopnode *umloplist; struct umltemplatenode { umltemplate key; struct umltemplatenode *next; }; typedef struct umltemplatenode umltemplatenode; typedef umltemplatenode *umltemplatelist; struct geometry { float pos_x; float pos_y; float width; float height; }; typedef struct geometry geometry; struct umlpackage { char id[80]; char name[80]; geometry geom; struct umlpackage * parent; }; typedef struct umlpackage umlpackage; struct umlpackagenode { umlpackage * key; struct umlpackagenode * next; }; typedef struct umlpackagenode umlpackagenode; typedef umlpackagenode * umlpackagelist; struct umlclass { char id[80]; char name[80]; char stereotype[80]; char comment[80]; int isabstract; umlattrlist attributes; umloplist operations; umltemplatelist templates; umlpackage * package; geometry geom; }; typedef struct umlclass umlclass; struct umlassocnode { umlclass * key; char name[80]; char composite; struct umlassocnode * next; }; struct umlclassnode { umlclass * key; struct umlclassnode * parents; struct umlassocnode * associations; struct umlclassnode * dependencies; struct umlclassnode * next; }; typedef struct umlassocnode umlassocnode; typedef umlassocnode * umlassoclist; typedef struct umlclassnode umlclassnode; typedef umlclassnode * umlclasslist; struct namenode { char *name; struct namenode *next; }; typedef struct namenode namenode; typedef namenode * namelist; struct batch { umlclasslist classlist; // The classes in the diagram char *outdir; // Output directory int clobber; // Overwrite files in directory namelist classes; // Selection of classes to generate code for int mask; // Flag that inverts the above selection char *license; // License file }; typedef struct batch batch; char *strtoupper(char *s); char *strtolower(char *s); char *strtoupperfirst(char *s); namelist parse_class_names(const char *s); int is_present(namelist list, const char *name); namelist find_classes(umlclasslist current_class, batch *b); umlclasslist find_by_name(umlclasslist list, const char * name); int is_enum_stereo (char * stereo); umlattrlist copy_attributes(umlattrlist src); void * my_malloc( size_t size ); umlpackagelist make_package_list( umlpackage * package); umlclasslist list_classes(umlclasslist current_class, batch *b); extern char *file_ext; /* Set by switch "-ext". Language specific default applies when NULL. */ extern char *body_file_ext; /* Set by switch "-bext". Language specific default applies when NULL. */ extern int indentlevel; void set_number_of_spaces_for_one_indentation(int n); /* default: 2 spaces */ char *spc(); /* Returns a string consisting of (indentlevel * number_of_spaces_for_one_indentation) spaces. */ /** * Output target files: * All backends would use `spec', but not all backends require `body'. * Hence not all backends need the {e,p}{body,both} functions below. */ extern FILE *spec, *body; /* Emitters for file output */ void emit (char *msg, ...); /* print verbatim to spec */ void ebody (char *msg, ...); /* print verbatim to body (e stands for emit) */ void eboth (char *msg, ...); /* print verbatim to both spec and body */ void print (char *msg, ...); /* print with leading indentation to spec */ void pbody (char *msg, ...); /* print with leading indentation to body */ void pboth (char *msg, ...); /* print with leading indentation to both */ /** * open_outfile() returns NULL if the file exists and is not rewritten * due to a clobber prohibition. Does an exit(1) if serious problems happen. */ FILE * open_outfile (char *filename, batch *b); // Added by RK 2003-02-20 #define HUGE_BUFFER 8192 #define LARGE_BUFFER 1024 #define BIG_BUFFER 255 #define SMALL_BUFFER 80 #define NEW_AUTO_INDENT 1 #ifdef NEW_AUTO_INDENT #define d2c_fprintf _d2c_fprintf #define d2c_fputs _d2c_fputs #define d2c_fputc _d2c_fputc #else #define d2c_fprintf fprintf #define d2c_fputs fputs #define d2c_fputc fputc #endif void d2c_indent(); void d2c_outdent(); int _d2c_fputs(const char *s, FILE *f); int _d2c_fputc(int c, FILE *f); int _d2c_fprintf(FILE *f, char *fmt, ...); //void d2c_set_braces(char *open, char *close); void d2c_open_brace(FILE *outfile, char *suffix); void d2c_close_brace(FILE *outfile, char *suffix); void d2c_parse_impl(FILE *f, char *cmt_start, char *cmt_end); void d2c_dump_impl(FILE *f, char *section, char *name); void d2c_deprecate_impl(FILE *f, char *comment_start, char *comment_end); char *d2c_operation_mangle_name(umlopnode *op); int d2c_backup(char *filename); #define TAG fprintf(stderr, "%s %d\n", __FILE__, __LINE__); #define eq !strcmp struct param_list { char *name; char *value; struct param_list *next; }; typedef struct param_list param_list; void param_list_destroy(); param_list * d2c_parameter_add(char *name, char *value); param_list * d2c_parameter_set(char *name, char *value); char * d2c_parameter_value(char *name); param_list *d2c_parameter_find(char *name); int indent_count; int indent_open_brace_on_newline; int generate_backup; #endif dia2code-0.8.3/dia2code/generate_code_ruby.c0100644000076400001440000004014510547512632020220 0ustar kelloggusers /*************************************************************************** generate_code_ruby.c - Function that generates Ruby code ------------------- begin : Sun Jun 1 2003 copyright : (C) 2003 by Dmitry V. Sabanin email : sdmitry@lrn.ru minor modifications : (C) 2006 okellogg@users.sourceforge.net ***************************************************************************/ /*************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * ***************************************************************************/ /*************************************************************************** * Comments: * interface are implemented via Mixins * packages not implemented yet ***************************************************************************/ #include "dia2code.h" #define TABS " " /* 2 */ void generate_code_ruby(batch *b) { umlclasslist tmplist, parents, incparent; umlassoclist associations; umlattrlist umla, tmpa, parama; umlpackagelist tmppcklist; umloplist umlo; char *tmpname; char outfilename[90]; FILE * outfile, *dummyfile, *licensefile = NULL; umlclasslist used_classes; int tmpdirlgth, tmpfilelgth; if (b->outdir == NULL) { b->outdir = "."; } tmpdirlgth = strlen(b->outdir); tmplist = b->classlist; /* open license file */ if ( b->license != NULL ) { licensefile = fopen(b->license, "r"); if(!licensefile) { fprintf(stderr, "Can't open the license file.\n"); exit(2); } } while ( tmplist != NULL ) { if ( ! ( is_present(b->classes, tmplist->key->name) ^ b->mask ) ) { char *pretty_outfilename; tmpname = tmplist->key->name; /* This prevents buffer overflows */ tmpfilelgth = strlen(tmpname); if (tmpfilelgth + tmpdirlgth > sizeof(*outfilename) - 2) { fprintf(stderr, "Sorry, name of file too long ...\nTry a smaller dir name\n"); exit(4); } pretty_outfilename = strtolower(tmplist->key->name); sprintf(outfilename, "%s/%s.class.rb", b->outdir, pretty_outfilename); dummyfile = fopen(outfilename, "r"); if ( b->clobber || ! dummyfile ) { int have_parent = 0; outfile = fopen(outfilename, "w"); if ( outfile == NULL ) { fprintf(stderr, "Can't open file %s for writing\n", outfilename); exit(3); } /* header */ /* add license to the header */ if (b->license != NULL) { char lc; rewind(licensefile); while((lc = fgetc(licensefile)) != EOF){ fprintf(outfile,"%c",lc); } } fprintf(outfile,"#!/usr/bin/env ruby\n#Source generated by dia2code.\n\n" ); /* We generate the include clauses */ used_classes = list_classes(tmplist, b); while (used_classes != NULL) { tmppcklist = make_package_list(used_classes->key->package); if ( tmppcklist != NULL ){ if ( strcmp(tmppcklist->key->id,tmplist->key->package->id)){ /* This class' package and our current class' package are not the same */ fprintf(outfile, "include "); fprintf(outfile,"%s",tmppcklist->key->name); tmppcklist=tmppcklist->next; while (tmppcklist != NULL) { fprintf(outfile, "%s", tmppcklist->key->name); tmppcklist=tmppcklist->next; } fprintf(outfile,"%s\n",used_classes->key->name); } } else { /* No info for this class' package, we include it directly fprintf(outfile, "require \"%s.class.rb\"\n",strtolower(used_classes->key->name)); */ } used_classes = used_classes->next; } incparent = tmplist->parents; if (incparent != NULL) { while (incparent!= NULL) { tmpname = strtolower(incparent->key->stereotype); if (eq("interface", tmpname) ) { if (strcmp("Enumerable",incparent->key->name) && strcmp("Comparable",incparent->key->name)) { fprintf(outfile, "require \""); fprintf(outfile, "%s.module.rb\" \n", strtolower(incparent->key->name)); } else { break; } } else { fprintf(outfile, "require \""); fprintf(outfile, "%s.class.rb\" \n", strtolower(incparent->key->name)); } free(tmpname); incparent = incparent->next; } } fprintf(outfile,"\n\n"); fprintf(outfile,"# %s - short description\n", pretty_outfilename); fprintf(outfile,"# Author:: \n"); fprintf(outfile,"# Copyright:: (C) XXX\n"); fprintf(outfile,"# License:: GPL\n"); tmppcklist = make_package_list(tmplist->key->package); if ( tmppcklist != NULL ){ int packcounter = 0; /* fprintf(outfile,"# == MODULES\n#module %s",tmppcklist->key->name); tmppcklist=tmppcklist->next; while ( tmppcklist != NULL ){ if( packcounter == 1 ) { fprintf(outfile,"\n" ); fprintf(outfile,"# === SUBMODULES\n# submodule %s",tmppcklist->key->name); } else { fprintf(outfile,".%s",tmppcklist->key->name); } tmppcklist=tmppcklist->next; packcounter++; } fprintf(outfile,"\n"); */ } tmpname = strtolower(tmplist->key->stereotype); /* if (eq("interface", tmpname)) { fprintf(outfile," * @interface\n" ); } else { */ if ( strlen(tmplist->key->comment) > 0 ) { fprintf(outfile,"# %s\n",tmplist->key->comment); } else { fprintf(outfile,"# XXX\n",tmplist->key->comment); } if (tmplist->key->isabstract) { fprintf(outfile,"# * this class is abstract\n" ); } /* } */ fprintf(outfile,"\n"); free(tmpname); fprintf(outfile, "class %s", tmplist->key->name); parents = tmplist->parents; if (parents != NULL) { while ( parents != NULL ) { tmpname = strtolower(parents->key->stereotype); if (strcmp("interface", tmpname)) { /* printf("We're in: %s, type: %s",parents->key->name,tmpname); */ if (have_parent) { fprintf(outfile, " # can't inherit %s\n", parents->key->name); } else { fprintf(outfile, " < "); fprintf(outfile, "%s", parents->key->name); have_parent = 1; } } free(tmpname); parents = parents->next; } } free(parents); parents = tmplist->parents; fprintf(outfile,"\n"); if (parents != NULL) { while ( parents != NULL ) { tmpname = strtolower(parents->key->stereotype); if (eq("interface", tmpname)) { fprintf(outfile,"%sinclude %s\n",TABS,parents->key->name); } free(tmpname); parents = parents->next; } } fprintf(outfile, "\n"); umla = tmplist->key->attributes; while (umla != NULL) { if ( strlen(umla->key.comment) > 0 ) { fprintf(outfile, "%s# %s \n", TABS, umla->key.comment); } else { fprintf(outfile, "%s# XXX \n", TABS); } fprintf(outfile, "%s# * access ", TABS); switch (umla->key.visibility) { case '0': fprintf (outfile, "public"); break; case '1': fprintf (outfile, "private"); break; case '2': fprintf (outfile, "protected"); break; } fprintf(outfile,"\n" ); /* if (umla->key.isstatic) { fprintf(outfile, "static "); } */ /* fprintf(outfile, "%s %s", umla->key.type, umla->key.name); */ if ( umla->key.value[0] != 0 ) { fprintf(outfile, "%s@%s = %s\n", TABS, umla->key.name, umla->key.value); } if ( umla->key.isstatic ) { fprintf(outfile, "%s@@%s = nil\n", TABS, umla->key.name ); } fprintf(outfile, TABS); if (umla->key.visibility == '0') { // make it public fprintf(outfile, "attr_acessor :%s\n", umla->key.name); fprintf(outfile, "%spublic :%s\n\n",TABS, umla->key.name); } else if (umla->key.visibility == '1') { // make it private fprintf(outfile, "attr :%s\n", umla->key.name); fprintf(outfile, "%sprivate :%s\n\n", TABS, umla->key.name); } else { fprintf(outfile, "attr :%s\n", umla->key.name); fprintf(outfile, "%sprotected :%s\n\n",TABS, umla->key.name); } umla = umla->next; } associations = tmplist->associations; /* I've turned off associations coz they are: not working and * i can't think of how it could be used in source */ while ( associations != NULL && 0) { fprintf(outfile, "# association %s to %s\n", associations->key->name, associations->name); fprintf(outfile, "%s# access private\n", TABS ); fprintf(outfile, "%s# attribute @%s;\n\n", TABS, associations->name); associations = associations->next; } umlo = tmplist->key->operations; while ( umlo != NULL) { int bracket_opened = 0; if ( strlen(umlo->key.attr.comment) > 0 ) { fprintf(outfile,"%s# %s\n", TABS, umlo->key.attr.comment ); } else { fprintf(outfile,"%s# XXX\n", TABS ); } if ( umlo->key.attr.isabstract ) { fprintf(outfile,"%s# * abstract\n", TABS ); umlo->key.attr.value[0] = '0'; } fprintf(outfile,"%s# * access ", TABS ); switch (umlo->key.attr.visibility) { case '0': fprintf (outfile, "public "); break; case '1': fprintf (outfile, "private "); break; case '2': fprintf (outfile, "protected "); break; } fprintf(outfile,"\n" ); /* if ( umlo->key.attr.isstatic ) { fprintf(outfile, "static "); } */ if (strlen(umlo->key.attr.type) > 0) { fprintf(outfile,"%s# * returns %s\n", TABS,umlo->key.attr.type); } parama = umlo->key.parameters; /* document parameters */ while (parama != NULL) { char *comment = ""; if (strlen(parama->key.comment) > 0) comment = parama->key.comment; fprintf(outfile, "%s# * param %s %s %s\n", TABS, parama->key.type, parama->key.name, comment); parama= parama->next; } fprintf(outfile, TABS); fprintf(outfile, "def %s", umlo->key.attr.name); tmpa = umlo->key.parameters; if (tmpa != NULL) { fprintf(outfile, "( "); bracket_opened = 1; } while (tmpa != NULL) { fprintf(outfile, "%s", tmpa->key.name); if ( tmpa->key.value[0] != 0 ){ fprintf(outfile," = %s",tmpa->key.value); } tmpa = tmpa->next; if (tmpa != NULL) fprintf(outfile, ", "); } if (bracket_opened) { fprintf(outfile, " )"); } /* if ( umlo->key.attr.isabstract ) { fprintf(outfile, ";\n"); } else { */ fprintf(outfile, "\n"); if ( umlo->key.implementation != NULL ) { fprintf(outfile, "%s%s\n",TABS, umlo->key.implementation); } else { fprintf(outfile, "%s%sraise NotImplementedError, 'This is auto-gen. method, please implement.'\n", TABS, TABS); } fprintf(outfile, "%send\n", TABS); /* } */ switch (umlo->key.attr.visibility) { case '0': fprintf(outfile, "%spublic :%s\n\n", TABS, umlo->key.attr.name); break; case '1': fprintf(outfile, "%sprivate :%s\n\n", TABS, umlo->key.attr.name); break; case '2': fprintf(outfile, "%sprotected :%s\n\n", TABS, umlo->key.attr.name); break; } umlo = umlo->next; } fprintf(outfile, "end\n\n"); fprintf(outfile, "\n\n"); fclose(outfile); } } tmplist = tmplist->next; } }