summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRuben Undheim <ruben.undheim@gmail.com>2018-10-20 17:54:32 +0200
committerRuben Undheim <ruben.undheim@gmail.com>2018-10-20 17:54:32 +0200
commitca2442640f4394296d9d6b0c42d41d399dbf9667 (patch)
tree879c0a6065d6982d5a82b35dc3ff67299e2ea7d9
parent04d5d0ea0f65a434e568fe031f6396caec9b3a8d (diff)
New upstream version 3.9.73+dfsg.1
-rw-r--r--Makefile1007
-rw-r--r--Makefile.am100
-rw-r--r--Makefile.in433
-rw-r--r--Makefile.mingw6419
-rw-r--r--README15
-rw-r--r--README.CharEncoding (renamed from README.ISOLatin2)88
-rw-r--r--VERSION2
-rw-r--r--Xw/Makefile686
-rw-r--r--Xw/Makefile.in323
-rw-r--r--aclocal.m4905
-rw-r--r--cairo.c1415
-rw-r--r--cairo.c.orig991
-rw-r--r--colordefs.h34
-rwxr-xr-xcompile347
-rwxr-xr-xconfig.status1113
-rwxr-xr-xconfigure1748
-rw-r--r--configure.in803
-rw-r--r--elements.c634
-rw-r--r--events.c997
-rw-r--r--filelist.c44
-rw-r--r--files.c372
-rw-r--r--fontfile.c64
-rw-r--r--formats.c16
-rw-r--r--functions.c365
-rw-r--r--graphic.c149
-rw-r--r--help.c17
-rw-r--r--keybindings.c41
-rw-r--r--lib/analoglib3.lps229
-rw-r--r--lib/cyrillic.enc39
-rw-r--r--lib/digitaltcl.lps14
-rw-r--r--lib/fonts/courier_cyrillic.xfe50
-rw-r--r--lib/fonts/helvetica_cyrillic.xfe50
-rw-r--r--lib/fonts/testtest.ps206
-rw-r--r--lib/fonts/times_roman_cyrillic.xfe51
-rw-r--r--lib/isolatin2.enc39
-rw-r--r--lib/isolatin5.enc40
-rw-r--r--lib/tcl/bparams.tcl2
-rw-r--r--lib/tcl/edif.tcl38
-rw-r--r--lib/tcl/files.tcl1
-rw-r--r--lib/tcl/mousehint.tcl23
-rw-r--r--lib/tcl/resource.tcl166
-rw-r--r--lib/tcl/symbol.tcl126
-rw-r--r--lib/tcl/text.tcl1
-rwxr-xr-xlib/tcl/tkcon.tcl6
-rw-r--r--lib/tcl/wrapper.tcl488
-rwxr-xr-xlib/tcl/xcircuit.tcl.in2
-rw-r--r--lib/tcl/xcstartup.tcl20
-rw-r--r--lib/xcircps2.pro43
-rw-r--r--lib/xspice.lps591
-rw-r--r--libraries.c11
-rw-r--r--log_text.html0
-rw-r--r--menucalls.c140
-rw-r--r--menus.h33
-rw-r--r--netlist.c108
-rw-r--r--ngspice.c21
-rw-r--r--opengl.c445
-rw-r--r--parameter.c149
-rw-r--r--prototypes.h103
-rw-r--r--python.c13
-rw-r--r--rcfile.c1
-rw-r--r--render.c154
-rw-r--r--schema.c43
-rw-r--r--selection.c104
-rw-r--r--spiceparser/Makefile688
-rw-r--r--spiceparser/Makefile.in323
-rwxr-xr-xspiceparser/examplebin0 -> 131275 bytes
-rw-r--r--svg.c100
-rw-r--r--tclxcircuit.c475
-rw-r--r--text.c482
-rw-r--r--tutorial/footnote.html27
-rw-r--r--tutorial/giffiles/aggregate.gifbin5614 -> 0 bytes
-rw-r--r--tutorial/giffiles/alib.gifbin3730 -> 0 bytes
-rw-r--r--tutorial/giffiles/amp1.gifbin7855 -> 0 bytes
-rw-r--r--tutorial/giffiles/amp2.gifbin7628 -> 0 bytes
-rw-r--r--tutorial/giffiles/amp3.gifbin8405 -> 0 bytes
-rw-r--r--tutorial/giffiles/arcs1.gifbin4993 -> 0 bytes
-rw-r--r--tutorial/giffiles/bridge.gifbin14903 -> 0 bytes
-rw-r--r--tutorial/giffiles/bridge1.gifbin4576 -> 0 bytes
-rw-r--r--tutorial/giffiles/bridge2.gifbin3455 -> 0 bytes
-rw-r--r--tutorial/giffiles/bridge3.gifbin3988 -> 0 bytes
-rw-r--r--tutorial/giffiles/bridge4.gifbin8685 -> 0 bytes
-rw-r--r--tutorial/giffiles/bridge5.gifbin14752 -> 0 bytes
-rw-r--r--tutorial/giffiles/bridge6.gifbin13742 -> 0 bytes
-rw-r--r--tutorial/giffiles/dff.gifbin14834 -> 0 bytes
-rw-r--r--tutorial/giffiles/filter1.gifbin4844 -> 0 bytes
-rw-r--r--tutorial/giffiles/filter2.gifbin4901 -> 0 bytes
-rw-r--r--tutorial/giffiles/fullamp.gifbin15951 -> 0 bytes
-rw-r--r--tutorial/giffiles/fullamp_anno.gifbin24174 -> 0 bytes
-rw-r--r--tutorial/giffiles/halfamp.gifbin10330 -> 0 bytes
-rw-r--r--tutorial/giffiles/integrate1.gifbin4826 -> 0 bytes
-rw-r--r--tutorial/giffiles/lib1.gifbin1936 -> 0 bytes
-rw-r--r--tutorial/giffiles/load1.gifbin4431 -> 0 bytes
-rw-r--r--tutorial/giffiles/nand4.gifbin3934 -> 0 bytes
-rw-r--r--tutorial/giffiles/object.gifbin2378 -> 0 bytes
-rw-r--r--tutorial/giffiles/objedit.gifbin5098 -> 0 bytes
-rw-r--r--tutorial/giffiles/overunder.gifbin1932 -> 0 bytes
-rw-r--r--tutorial/giffiles/path1.gifbin3039 -> 0 bytes
-rw-r--r--tutorial/giffiles/path2.gifbin4081 -> 0 bytes
-rw-r--r--tutorial/giffiles/path3.gifbin5723 -> 0 bytes
-rw-r--r--tutorial/giffiles/path4.gifbin5181 -> 0 bytes
-rw-r--r--tutorial/giffiles/path5.gifbin3989 -> 0 bytes
-rw-r--r--tutorial/giffiles/pcbcap.gifbin14607 -> 0 bytes
-rw-r--r--tutorial/giffiles/pcbdiode.gifbin3802 -> 0 bytes
-rw-r--r--tutorial/giffiles/poly1.gifbin2023 -> 0 bytes
-rw-r--r--tutorial/giffiles/poly2.gifbin7834 -> 0 bytes
-rw-r--r--tutorial/giffiles/powersup.gifbin5191 -> 0 bytes
-rw-r--r--tutorial/giffiles/powersup2.gifbin6193 -> 0 bytes
-rw-r--r--tutorial/giffiles/quadparts.gifbin3461 -> 0 bytes
-rw-r--r--tutorial/giffiles/save1.gifbin5436 -> 0 bytes
-rw-r--r--tutorial/giffiles/save2.gifbin4492 -> 0 bytes
-rw-r--r--tutorial/giffiles/select1.gifbin1280 -> 0 bytes
-rw-r--r--tutorial/giffiles/select2.gifbin697 -> 0 bytes
-rw-r--r--tutorial/giffiles/spline1.gifbin915 -> 0 bytes
-rw-r--r--tutorial/giffiles/spline2.gifbin1747 -> 0 bytes
-rw-r--r--tutorial/giffiles/spline3.gifbin3888 -> 0 bytes
-rw-r--r--tutorial/giffiles/symbol_enc.gifbin17439 -> 0 bytes
-rw-r--r--tutorial/giffiles/text.gifbin1725 -> 0 bytes
-rw-r--r--tutorial/giffiles/text2.gifbin3437 -> 0 bytes
-rw-r--r--tutorial/giffiles/tut1.gifbin14286 -> 0 bytes
-rw-r--r--tutorial/giffiles/wramp1.gifbin7342 -> 0 bytes
l---------tutorial/index.html1
-rw-r--r--tutorial/netfiles/filter.spc6
-rw-r--r--tutorial/netfiles/integrator.spc17
-rw-r--r--tutorial/pcb/FlareLED.ps720
-rwxr-xr-xtutorial/pcb/LED1794
-rwxr-xr-xtutorial/pcb/LED.NET47
-rw-r--r--tutorial/pcb/bridge.pcb6
-rw-r--r--tutorial/pcb/flare_objects.gifbin15281 -> 0 bytes
-rw-r--r--tutorial/pcb/pic_instance.gifbin18944 -> 0 bytes
-rw-r--r--tutorial/pcb/pic_object.gifbin19324 -> 0 bytes
-rw-r--r--tutorial/pcb/powersup.pcb10
-rw-r--r--tutorial/psfiles/analoglib1.lps238
-rw-r--r--tutorial/psfiles/analoglib2.lps235
-rw-r--r--tutorial/psfiles/bridge.ps370
-rw-r--r--tutorial/psfiles/buses.ps245
-rw-r--r--tutorial/psfiles/dff.ps228
-rw-r--r--tutorial/psfiles/filter.ps260
-rw-r--r--tutorial/psfiles/integrator.ps327
-rw-r--r--tutorial/psfiles/powersup.ps429
-rw-r--r--tutorial/psfiles/test1.ps154
-rw-r--r--tutorial/tutorial.html803
-rw-r--r--tutorial/tutorial2.html1455
-rw-r--r--undo.c96
-rw-r--r--utf8encodings.c588
-rw-r--r--xcircuit-tcl.nsi2
-rw-r--r--xcircuit.c104
-rw-r--r--xcircuit.h189
-rw-r--r--xcwin32.c6
-rw-r--r--xtfuncs.c174
-rw-r--r--xtgui.c30
150 files changed, 14679 insertions, 12228 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..0725858
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,1007 @@
+# Makefile.in generated by automake 1.14.1 from Makefile.am.
+# Makefile. Generated from Makefile.in by configure.
+
+# Copyright (C) 1994-2013 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.
+
+
+
+
+am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__make_running_with_option = \
+ case $${target_option-} in \
+ ?) ;; \
+ *) echo "am__make_running_with_option: internal error: invalid" \
+ "target option '$${target_option-}' specified" >&2; \
+ exit 1;; \
+ esac; \
+ has_opt=no; \
+ sane_makeflags=$$MAKEFLAGS; \
+ if $(am__is_gnu_make); then \
+ sane_makeflags=$$MFLAGS; \
+ else \
+ case $$MAKEFLAGS in \
+ *\\[\ \ ]*) \
+ bs=\\; \
+ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
+ esac; \
+ fi; \
+ skip_next=no; \
+ strip_trailopt () \
+ { \
+ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+ }; \
+ for flg in $$sane_makeflags; do \
+ test $$skip_next = yes && { skip_next=no; continue; }; \
+ case $$flg in \
+ *=*|--*) continue;; \
+ -*I) strip_trailopt 'I'; skip_next=yes;; \
+ -*I?*) strip_trailopt 'I';; \
+ -*O) strip_trailopt 'O'; skip_next=yes;; \
+ -*O?*) strip_trailopt 'O';; \
+ -*l) strip_trailopt 'l'; skip_next=yes;; \
+ -*l?*) strip_trailopt 'l';; \
+ -[dEDm]) skip_next=yes;; \
+ -[JT]) skip_next=yes;; \
+ esac; \
+ case $$flg in \
+ *$$target_option*) has_opt=yes; break;; \
+ esac; \
+ done; \
+ test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
+pkgdatadir = $(datadir)/xcircuit
+pkgincludedir = $(includedir)/xcircuit
+pkglibdir = $(libdir)/xcircuit
+pkglibexecdir = $(libexecdir)/xcircuit
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+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 = :
+build_triplet = x86_64-unknown-linux-gnu
+host_triplet = x86_64-unknown-linux-gnu
+target_triplet = x86_64-unknown-linux-gnu
+bin_PROGRAMS = xcircuit$(EXEEXT)
+subdir = .
+DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
+ $(top_srcdir)/configure $(am__configure_deps) mkinstalldirs
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
+ configure.lineno config.status.lineno
+mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)"
+PROGRAMS = $(bin_PROGRAMS) $(noinst_PROGRAMS)
+menudep_SOURCES = menudep.c
+menudep_OBJECTS = menudep.$(OBJEXT)
+menudep_LDADD = $(LDADD)
+am_xcircuit_OBJECTS = elements.$(OBJEXT) events.$(OBJEXT) \
+ filelist.$(OBJEXT) files.$(OBJEXT) flate.$(OBJEXT) \
+ fontfile.$(OBJEXT) formats.$(OBJEXT) functions.$(OBJEXT) \
+ graphic.$(OBJEXT) help.$(OBJEXT) keybindings.$(OBJEXT) \
+ libraries.$(OBJEXT) menucalls.$(OBJEXT) netlist.$(OBJEXT) \
+ ngspice.$(OBJEXT) parameter.$(OBJEXT) python.$(OBJEXT) \
+ rcfile.$(OBJEXT) render.$(OBJEXT) schema.$(OBJEXT) \
+ selection.$(OBJEXT) svg.$(OBJEXT) text.$(OBJEXT) \
+ undo.$(OBJEXT) tclxcircuit.$(OBJEXT) tkSimple.$(OBJEXT) \
+ xcircuit.$(OBJEXT) xtfuncs.$(OBJEXT) xtgui.$(OBJEXT) \
+ cairo.$(OBJEXT) utf8encodings.$(OBJEXT)
+xcircuit_OBJECTS = $(am_xcircuit_OBJECTS)
+xcircuit_DEPENDENCIES =
+AM_V_P = $(am__v_P_$(V))
+am__v_P_ = $(am__v_P_$(AM_DEFAULT_VERBOSITY))
+am__v_P_0 = false
+am__v_P_1 = :
+AM_V_GEN = $(am__v_GEN_$(V))
+am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
+am__v_GEN_0 = @echo " GEN " $@;
+am__v_GEN_1 =
+AM_V_at = $(am__v_at_$(V))
+am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
+am__v_at_0 = @
+am__v_at_1 =
+DEFAULT_INCLUDES = -I.
+depcomp =
+am__depfiles_maybe =
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+AM_V_CC = $(am__v_CC_$(V))
+am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY))
+am__v_CC_0 = @echo " CC " $@;
+am__v_CC_1 =
+CCLD = $(CC)
+LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+AM_V_CCLD = $(am__v_CCLD_$(V))
+am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY))
+am__v_CCLD_0 = @echo " CCLD " $@;
+am__v_CCLD_1 =
+SOURCES = menudep.c $(xcircuit_SOURCES)
+RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \
+ ctags-recursive dvi-recursive html-recursive info-recursive \
+ install-data-recursive install-dvi-recursive \
+ install-exec-recursive install-html-recursive \
+ install-info-recursive install-pdf-recursive \
+ install-ps-recursive install-recursive installcheck-recursive \
+ installdirs-recursive pdf-recursive ps-recursive \
+ tags-recursive uninstall-recursive
+am__can_run_installinfo = \
+ case $$AM_UPDATE_INFO_DIR in \
+ n|no|NO) false;; \
+ *) (install-info --version) >/dev/null 2>&1;; \
+ esac
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+ *) f=$$p;; \
+ esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+ for p in $$list; do echo "$$p $$p"; done | \
+ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+ if (++n[$$2] == $(am__install_max)) \
+ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+ END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+ test -z "$$files" \
+ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+ $(am__cd) "$$dir" && rm -f $$files; }; \
+ }
+man1dir = $(mandir)/man1
+NROFF = nroff
+MANS = $(man_MANS)
+RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
+ distclean-recursive maintainer-clean-recursive
+am__recursive_targets = \
+ $(RECURSIVE_TARGETS) \
+ $(RECURSIVE_CLEAN_TARGETS) \
+ $(am__extra_recursive_targets)
+AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \
+ cscope
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+# Read a list of newline-separated strings from the standard input,
+# and print each of them once, without duplicates. Input order is
+# *not* preserved.
+am__uniquify_input = $(AWK) '\
+ BEGIN { nonempty = 0; } \
+ { items[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in items) print i; }; } \
+'
+# Make sure the list of sources is unique. This is necessary because,
+# e.g., the same source file might be shared among _SOURCES variables
+# for different programs/libraries.
+am__define_uniq_tagged_files = \
+ list='$(am__tagged_files)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | $(am__uniquify_input)`
+ETAGS = etags
+CTAGS = ctags
+CSCOPE = cscope
+DIST_SUBDIRS = $(SUBDIRS)
+ACLOCAL = aclocal-1.14
+
+# Override standard "make" target when compiling under TCL
+ALL_TARGET = all-recursive
+AMTAR = $${TAR-tar}
+AM_DEFAULT_VERBOSITY = 1
+AUTOCONF = autoconf
+AUTOHEADER = autoheader
+AUTOMAKE = automake-1.14
+AWK = gawk
+CC = gcc
+CCDEPMODE = depmode=none
+CFLAGS = -g -Wno-pointer-sign -fPIC
+CPP = gcc -E
+CPPFLAGS =
+CYGPATH_W = echo
+
+# Main compiler arguments
+DEFS = -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DPACKAGE=\"xcircuit\" -DVERSION=\"3.9\" -DHAVE_LIBM=1 -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DSIZEOF_VOID_P=8 -DSIZEOF_UNSIGNED_INT=4 -DSIZEOF_UNSIGNED_LONG=8 -DSIZEOF_UNSIGNED_LONG_LONG=8 -DHAVE_LIBXT=1 -DSTDC_HEADERS=1 -DHAVE_SETENV=1 -DHAVE_PUTENV=1 -DHAVE_DIRENT_H=1 -DHAVE_LIBZ=1 -DHAVE_VA_COPY=1 -DHAVE___VA_COPY=1 -DHAVE_U_CHAR=1 -DHAVE_X11_XPM_H=1 -DHAVE_XPM=1 -DHAVE_CAIRO=1 -DLGF=1 -DINPUT_FOCUS=1 -DGS_EXEC=\"gs\" -DSPICE_EXEC=\"ngspice\" -DTCL_WRAPPER=1 $(PATHNAMES)
+DEPDIR = .deps
+ECHO_C =
+ECHO_N = -n
+ECHO_T =
+EGREP = /bin/grep -E
+EXEEXT =
+EXTRA_LIB_SPECS = -lm
+GREP = /bin/grep
+GS_EXEC = gs
+GS_LIBS =
+HAVE_LGF = LGF
+INC_SPECS = -I/usr/include -I/usr/include
+INSTALL = /bin/install -c
+INSTALL_DATA = ${INSTALL} -m 644
+INSTALL_PROGRAM = ${INSTALL}
+INSTALL_SCRIPT = ${INSTALL}
+INSTALL_STRIP_PROGRAM = $(install_sh) -c -s
+INSTALL_TARGET = install-recursive
+INTERPRETER = TCL
+INTERP_PATH = tcl
+LD = /bin/ld
+LDDL_FLAGS = -Wl,-z,relro -Wl,--export-dynamic -Wl,--version-script=symbol.map
+LDFLAGS =
+LD_RUN_PATH = -Wl,-rpath,/usr/lib64
+LIBOBJS =
+LIBS = -ldl -lz -lpthread -lieee -lm -lz -lXt -lSM -lICE -lm -lX11 -lXpm $(cairo_LIBS) $(fontconfig_LIBS) ${GS_LIBS}
+LIB_SPECS = -L/usr/lib64 -ltcl8.6 -L/usr/lib64 -ltk8.6
+LTLIBOBJS =
+M4 = /bin/m4
+MAKEINFO = makeinfo
+MKDIR_P = /bin/mkdir -p
+OBJEXT = o
+PACKAGE = xcircuit
+PACKAGE_BUGREPORT =
+PACKAGE_NAME =
+PACKAGE_STRING =
+PACKAGE_TARNAME =
+PACKAGE_URL =
+PACKAGE_VERSION =
+PATH_SEPARATOR = :
+PKG_CONFIG = /bin/pkg-config
+PKG_CONFIG_LIBDIR =
+PKG_CONFIG_PATH =
+PYTHON =
+RANLIB = ranlib
+REVISION = 71
+SET_MAKE =
+SHDLIB_EXT = .so
+SHELL = /bin/sh
+SHLIB_LD = ${CC} -shared ${CFLAGS} ${LDFLAGS} -fPIC -Wl,-soname,${@}
+SHLIB_LIB_SPECS =
+SPICE_EXEC = ngspice
+STARTUP_FILE = xcstartup.tcl
+STDLIBS =
+STRIP =
+SUBDIRS =
+SUBLIB =
+TCL_LIB_DIR = /usr/lib64
+VERSION = 3.9
+WISH_EXE = /usr/bin/wish
+WRAPPER_SCRIPT = wrapper.tcl
+XCIRCUIT_TARGET = tcl
+XMKMF =
+X_CFLAGS =
+X_EXTRA_LIBS =
+X_LIBS =
+X_PRE_LIBS = -lSM -lICE
+abs_builddir = /home/tim/gitsrc/xcircuit-3.9
+abs_srcdir = /home/tim/gitsrc/xcircuit-3.9
+abs_top_builddir = /home/tim/gitsrc/xcircuit-3.9
+abs_top_srcdir = /home/tim/gitsrc/xcircuit-3.9
+ac_ct_CC = gcc
+am__include = include
+am__leading_dot = .
+am__quote =
+am__tar = $${TAR-tar} chof - "$$tardir"
+am__untar = $${TAR-tar} xf -
+bindir = ${exec_prefix}/bin
+build = x86_64-unknown-linux-gnu
+build_alias =
+build_cpu = x86_64
+build_os = linux-gnu
+build_vendor = unknown
+builddir = .
+cairo_CFLAGS = -I/usr/include/cairo -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/freetype2 -I/usr/include/libdrm -I/usr/include/libpng16
+cairo_LIBS = -lcairo
+datadir = ${datarootdir}
+datarootdir = ${prefix}/share
+docdir = ${datarootdir}/doc/${PACKAGE}
+dvidir = ${docdir}
+exec_prefix = ${prefix}
+fontconfig_CFLAGS = -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/freetype2 -I/usr/include/libpng16
+fontconfig_LIBS = -lfontconfig -lfreetype
+host = x86_64-unknown-linux-gnu
+host_alias =
+host_cpu = x86_64
+host_os = linux-gnu
+host_vendor = unknown
+htmldir = ${docdir}
+includedir = ${prefix}/include
+infodir = ${datarootdir}/info
+install_sh = ${SHELL} /home/tim/gitsrc/xcircuit-3.9/install-sh
+libdir = ${exec_prefix}/lib
+libexecdir = ${exec_prefix}/libexec
+localedir = ${datarootdir}/locale
+localstatedir = ${prefix}/var
+mandir = ${datarootdir}/man
+mkdir_p = $(MKDIR_P)
+oldincludedir = /usr/include
+pdfdir = ${docdir}
+prefix = /usr/local
+program_transform_name = s,x,x,
+psdir = ${docdir}
+sbindir = ${exec_prefix}/sbin
+sharedstatedir = ${prefix}/com
+srcdir = .
+sysconfdir = ${prefix}/etc
+target = x86_64-unknown-linux-gnu
+target_alias =
+target_cpu = x86_64
+target_os = linux-gnu
+target_vendor = unknown
+top_build_prefix =
+top_builddir = .
+top_srcdir = .
+AUTOMAKE_OPTIONS = foreign no-dependencies no-dist
+AM_CFLAGS = $(cairo_CFLAGS) $(fontconfig_CFLAGS) ${GS_CFLAGS}
+
+# Additional files to distribute
+EXTRA_DIST = COPYRIGHT README README.ISOLatin2 README.notes
+FULL_VERSION = 3.9.71
+
+# Menudep program generates menudep.h needed by some of the
+# source files for Xcircuit
+noinst_PROGRAMS = menudep$(EXEEXT)
+
+# Automake files
+ac_aux_dir = dist
+
+# Temporary directory (if not overridden by environment variable TMPDIR)
+tmpdir = /tmp
+
+# Directories for app-defaults file and manual page
+appdefaultsdir = $(libdir)/$(PACKAGE)-$(VERSION)/app-defaults
+appmandir = $(libdir)/$(PACKAGE)-$(VERSION)/man
+PATHNAMES = -DPROG_VERSION=$(VERSION) \
+ -DPROG_REVISION=$(REVISION) \
+ -DCAD_DIR=\"$(libdir)\" \
+ -DTEMP_DIR=\"$(tmpdir)\" \
+ -DRESOURCES_DIR=\"$(appdefaultsdir)\" \
+ -DSCRIPTS_DIR=\"$(scriptsdir)\" \
+ -DBUILTINS_DIR=\"$(librarydir)\" \
+ -DBUILTINS_FILE=\"$(BUILTINS_FILE)\" \
+ -DUSER_RC_FILE=\"$(USER_RC_FILE)\" \
+ -DPROLOGUE_DIR=\"$(librarydir)\" \
+ -DPROLOGUE_FILE=\"$(PROLOGUE_FILE)\" \
+ -DCYRILLIC_ENC_FILE=\"$(CYRILLIC_ENC_FILE)\" \
+ -DISOLATIN2_ENC_FILE=\"$(ISOLATIN2_ENC_FILE)\" \
+ -DISOLATIN5_ENC_FILE=\"$(ISOLATIN5_ENC_FILE)\" \
+ -DSTARTUP_FILE=\"$(STARTUP_FILE)\" \
+ -DLGF_LIB=\"$(LGF_LIB)\" \
+ -DASG_SPICE_LIB=\"$(ASG_SPICE_LIB)\"
+
+xcircuit_SOURCES = elements.c events.c filelist.c files.c \
+ flate.c fontfile.c formats.c functions.c graphic.c \
+ help.c keybindings.c libraries.c menucalls.c \
+ netlist.c ngspice.c parameter.c python.c \
+ rcfile.c render.c schema.c selection.c svg.c text.c undo.c \
+ tclxcircuit.c tkSimple.c xcircuit.c xtfuncs.c xtgui.c \
+ cairo.c utf8encodings.c
+
+xcircuit_DEPEND =
+xcircuit_LDADD =
+
+# Man page
+M4_DEFS = @M4_DEFS@ -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DPACKAGE=\"xcircuit\" -DVERSION=\"3.9\" -DHAVE_LIBM=1 -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DSIZEOF_VOID_P=8 -DSIZEOF_UNSIGNED_INT=4 -DSIZEOF_UNSIGNED_LONG=8 -DSIZEOF_UNSIGNED_LONG_LONG=8 -DHAVE_LIBXT=1 -DSTDC_HEADERS=1 -DHAVE_SETENV=1 -DHAVE_PUTENV=1 -DHAVE_DIRENT_H=1 -DHAVE_LIBZ=1 -DHAVE_VA_COPY=1 -DHAVE___VA_COPY=1 -DHAVE_U_CHAR=1 -DHAVE_X11_XPM_H=1 -DHAVE_XPM=1 -DHAVE_CAIRO=1 -DLGF=1 -DINPUT_FOCUS=1 -DGS_EXEC=\"gs\" -DSPICE_EXEC=\"ngspice\" -DTCL_WRAPPER=1
+man_MANS = lib/xcircuit.1
+INCLUDES = -IXw ${INC_SPECS}
+
+# Library directory and files
+librarydir = $(libdir)/$(PACKAGE)-$(VERSION)
+scriptsdir = $(libdir)/$(PACKAGE)-$(VERSION)
+USER_RC_FILE = .xcircuitrc
+PROLOGUE_FILE = xcircps2.pro
+CYRILLIC_ENC_FILE = cyrillic.enc
+ISOLATIN2_ENC_FILE = isolatin2.enc
+ISOLATIN5_ENC_FILE = isolatin5.enc
+ENCODING_FILES = ${CYRILLIC_ENC_FILE} ${ISOLATIN2_ENC_FILE} ${ISOLATIN5_ENC_FILE}
+LGF_LIB = lgf.lps
+ASG_SPICE_LIB = asg_spice.lps
+SIGNAL_LIB = signal.lps
+MUSIC_LIB = musiclib.lps
+FONTS_LPS = courier courieriso2 courieriso5 helvetica helveticaiso2 \
+ helveticaiso5 myfont symbol times_roman times_romaniso2 \
+ times_romaniso5
+
+FONTS_XFE = courier courieriso courieriso2 courieriso5 courier_cyrillic \
+ helvetica helveticaiso helveticaiso2 helveticaiso5 helvetica_cyrillic \
+ times_roman times_romaniso times_romaniso2 times_romaniso5 \
+ times_roman_cyrillic myfont symbol
+
+SCRIPTS_PY = spice gettext pagebbox
+WRAPPER_INIT = xcircuit.tcl
+WRAPPER_OBJ = xcircuit${SHDLIB_EXT}
+WRAPPER_SO = xcircuit.so
+WRAPPER_SH = xcircuit.sh
+CONSOLE = tkcon.tcl
+CONSOLE_SCRIPT = console.tcl
+all: all-recursive
+
+.SUFFIXES:
+.SUFFIXES: .c .o .obj
+am--refresh: Makefile
+ @:
+$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \
+ $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \
+ && exit 0; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \
+ $(am__cd) $(top_srcdir) && \
+ $(AUTOMAKE) --foreign Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ echo ' $(SHELL) ./config.status'; \
+ $(SHELL) ./config.status;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ $(SHELL) ./config.status --recheck
+
+$(top_srcdir)/configure: $(am__configure_deps)
+ $(am__cd) $(srcdir) && $(AUTOCONF)
+$(ACLOCAL_M4): $(am__aclocal_m4_deps)
+ $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
+$(am__aclocal_m4_deps):
+install-binPROGRAMS: $(bin_PROGRAMS)
+ @$(NORMAL_INSTALL)
+ @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+ if test -n "$$list"; then \
+ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \
+ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \
+ fi; \
+ for p in $$list; do echo "$$p $$p"; done | \
+ sed 's/$(EXEEXT)$$//' | \
+ while read p p1; do if test -f $$p \
+ ; then echo "$$p"; echo "$$p"; else :; fi; \
+ done | \
+ sed -e 'p;s,.*/,,;n;h' \
+ -e 's|.*|.|' \
+ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
+ sed 'N;N;N;s,\n, ,g' | \
+ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
+ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
+ if ($$2 == $$4) files[d] = files[d] " " $$1; \
+ else { print "f", $$3 "/" $$4, $$1; } } \
+ END { for (d in files) print "f", d, files[d] }' | \
+ while read type dir files; do \
+ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
+ test -z "$$files" || { \
+ echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \
+ $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
+ } \
+ ; done
+
+uninstall-binPROGRAMS:
+ @$(NORMAL_UNINSTALL)
+ @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+ files=`for p in $$list; do echo "$$p"; done | \
+ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
+ -e 's/$$/$(EXEEXT)/' \
+ `; \
+ test -n "$$list" || exit 0; \
+ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(bindir)" && rm -f $$files
+
+clean-binPROGRAMS:
+ -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
+
+clean-noinstPROGRAMS:
+ -test -z "$(noinst_PROGRAMS)" || rm -f $(noinst_PROGRAMS)
+
+xcircuit$(EXEEXT): $(xcircuit_OBJECTS) $(xcircuit_DEPENDENCIES) $(EXTRA_xcircuit_DEPENDENCIES)
+ @rm -f xcircuit$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(xcircuit_OBJECTS) $(xcircuit_LDADD) $(LIBS)
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+
+distclean-compile:
+ -rm -f *.tab.c
+
+.c.o:
+ $(AM_V_CC)$(COMPILE) -c -o $@ $<
+
+.c.obj:
+ $(AM_V_CC)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+install-man1: $(man_MANS)
+ @$(NORMAL_INSTALL)
+ @list1=''; \
+ list2='$(man_MANS)'; \
+ test -n "$(man1dir)" \
+ && test -n "`echo $$list1$$list2`" \
+ || exit 0; \
+ echo " $(MKDIR_P) '$(DESTDIR)$(man1dir)'"; \
+ $(MKDIR_P) "$(DESTDIR)$(man1dir)" || exit 1; \
+ { for i in $$list1; do echo "$$i"; done; \
+ if test -n "$$list2"; then \
+ for i in $$list2; do echo "$$i"; done \
+ | sed -n '/\.1[a-z]*$$/p'; \
+ fi; \
+ } | while read p; do \
+ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
+ echo "$$d$$p"; echo "$$p"; \
+ done | \
+ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \
+ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \
+ sed 'N;N;s,\n, ,g' | { \
+ list=; while read file base inst; do \
+ if test "$$base" = "$$inst"; then list="$$list $$file"; else \
+ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \
+ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \
+ fi; \
+ done; \
+ for i in $$list; do echo "$$i"; done | $(am__base_list) | \
+ while read files; do \
+ test -z "$$files" || { \
+ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \
+ $(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \
+ done; }
+
+uninstall-man1:
+ @$(NORMAL_UNINSTALL)
+ @list=''; test -n "$(man1dir)" || exit 0; \
+ files=`{ for i in $$list; do echo "$$i"; done; \
+ l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \
+ sed -n '/\.1[a-z]*$$/p'; \
+ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \
+ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \
+ dir='$(DESTDIR)$(man1dir)'; $(am__uninstall_files_from_dir)
+
+# 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.
+$(am__recursive_targets):
+ @fail=; \
+ if $(am__make_keepgoing); then \
+ failcom='fail=yes'; \
+ else \
+ failcom='exit 1'; \
+ fi; \
+ dot_seen=no; \
+ target=`echo $@ | sed s/-recursive//`; \
+ case "$@" in \
+ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+ *) list='$(SUBDIRS)' ;; \
+ esac; \
+ 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; \
+ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+ || eval $$failcom; \
+ done; \
+ if test "$$dot_seen" = "no"; then \
+ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+ fi; test -z "$$fail"
+
+ID: $(am__tagged_files)
+ $(am__define_uniq_tagged_files); mkid -fID $$unique
+tags: tags-recursive
+TAGS: tags
+
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+ set x; \
+ here=`pwd`; \
+ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+ include_option=--etags-include; \
+ empty_fix=.; \
+ else \
+ include_option=--include; \
+ empty_fix=; \
+ fi; \
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" = .; then :; else \
+ test ! -f $$subdir/TAGS || \
+ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
+ fi; \
+ done; \
+ $(am__define_uniq_tagged_files); \
+ shift; \
+ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ if test $$# -gt 0; then \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ "$$@" $$unique; \
+ else \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$unique; \
+ fi; \
+ fi
+ctags: ctags-recursive
+
+CTAGS: ctags
+ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+ $(am__define_uniq_tagged_files); \
+ test -z "$(CTAGS_ARGS)$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && $(am__cd) $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) "$$here"
+cscope: cscope.files
+ test ! -s cscope.files \
+ || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS)
+clean-cscope:
+ -rm -f cscope.files
+cscope.files: clean-cscope cscopelist
+cscopelist: cscopelist-recursive
+
+cscopelist-am: $(am__tagged_files)
+ list='$(am__tagged_files)'; \
+ case "$(srcdir)" in \
+ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+ *) sdir=$(subdir)/$(srcdir) ;; \
+ esac; \
+ for i in $$list; do \
+ if test -f "$$i"; then \
+ echo "$(subdir)/$$i"; \
+ else \
+ echo "$$sdir/$$i"; \
+ fi; \
+ done >> $(top_builddir)/cscope.files
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+ -rm -f cscope.out cscope.in.out cscope.po.out cscope.files
+check-am: all-am
+check: check-recursive
+all-am: Makefile $(PROGRAMS) $(MANS)
+installdirs: installdirs-recursive
+installdirs-am:
+ for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)"; do \
+ test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+ done
+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:
+ if test -z '$(STRIP)'; then \
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ install; \
+ else \
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+ fi
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+ -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_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-am: clean-binPROGRAMS clean-generic clean-noinstPROGRAMS \
+ mostlyclean-am
+
+distclean-am: clean-am distclean-compile distclean-generic \
+ distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+html-am:
+
+info: info-recursive
+
+info-am:
+
+install-data-am: install-data-local install-man
+
+install-dvi: install-dvi-recursive
+
+install-dvi-am:
+
+install-exec-am: install-binPROGRAMS
+
+install-html: install-html-recursive
+
+install-html-am:
+
+install-info: install-info-recursive
+
+install-info-am:
+
+install-man: install-man1
+
+install-pdf: install-pdf-recursive
+
+install-pdf-am:
+
+install-ps: install-ps-recursive
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+ -rm -f $(am__CONFIG_DISTCLEAN_FILES)
+ -rm -rf $(top_srcdir)/autom4te.cache
+ -rm -f Makefile
+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-man
+
+uninstall-man: uninstall-man1
+
+.MAKE: $(am__recursive_targets) install-am install-strip
+
+.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \
+ am--refresh check check-am clean clean-binPROGRAMS \
+ clean-cscope clean-generic clean-noinstPROGRAMS cscope \
+ cscopelist-am ctags ctags-am distclean distclean-compile \
+ distclean-generic distclean-tags dvi dvi-am html html-am info \
+ info-am install install-am install-binPROGRAMS install-data \
+ install-data-am install-data-local install-dvi install-dvi-am \
+ install-exec install-exec-am install-html install-html-am \
+ install-info install-info-am install-man install-man1 \
+ install-pdf install-pdf-am install-ps install-ps-am \
+ install-strip installcheck installcheck-am installdirs \
+ installdirs-am maintainer-clean maintainer-clean-generic \
+ mostlyclean mostlyclean-compile mostlyclean-generic pdf pdf-am \
+ ps ps-am tags tags-am uninstall uninstall-am \
+ uninstall-binPROGRAMS uninstall-man uninstall-man1
+
+cairo.$(OBJEXT) : CFLAGS += -pedantic -Wall -Wextra
+elements.$(OBJEXT) : CFLAGS += -pedantic -Wall -Wextra
+events.$(OBJEXT) : CFLAGS += -pedantic -Wall -Wextra
+fontfile.$(OBJEXT) : CFLAGS += -pedantic -Wall -Wextra
+text.$(OBJEXT) : CFLAGS += -pedantic -Wall -Wextra
+utf8encodings.$(OBJEXT) : CFLAGS += -pedantic -Wall -Wextra
+
+help.c: menudep.h
+menucalls.c: menudep.h
+rcfile.c: menudep.h
+schema.c: menudep.h
+xcircuit.c: menudep.h
+parameter.c: menudep.h
+python.c: menudep.h
+tclxcircuit.c: menudep.h
+xtgui.c: menudep.h
+xtfuncs.c: menudep.h
+
+menudep$(EXEEXT): menudep.o
+ $(CC) -o $@ menudep.o
+
+menudep.h: menudep$(EXEEXT)
+ ./menudep$(EXEEXT)
+
+xcwrap.o: xcwrap.c menudep.h
+ $(CC) ${CPPFLAGS} ${CFLAGS} ${DEFS} \
+ $(PATHNAMES) $(INCLUDES) \
+ xcwrap.c -c -o xcwrap.o
+
+lib/$(INTERP_PATH)/$(WRAPPER_OBJ): xcwrap.o ${xcircuit_OBJECTS} ${xcircuit_DEPEND}
+ $(RM) lib/$(INTERP_PATH)/$(WRAPPER_OBJ)
+ $(SHLIB_LD) ${CFLAGS} -o $@ ${LDDL_FLAGS} xcwrap.o \
+ ${xcircuit_OBJECTS} ${xcircuit_LDADD} ${SHLIB_LIB_SPECS} \
+ ${LDFLAGS} ${X_EXTRA_LIBS} ${EXTRA_LIBS} -lc ${LIBS} \
+ ${LIB_SPECS} ${EXTRA_LIB_SPECS}
+
+xcircexec$(EXEEXT): xcircexec.o
+ $(RM) ./xcircexec$(EXEEXT)
+ $(CC) ${CFLAGS} ${CPPFLAGS} ${DEFS} $(PATHNAMES) $(INCLUDES) \
+ xcircexec.c -o xcircexec$(EXEEXT) ${LIB_SPECS} \
+ ${LD_RUN_PATH} ${LDFLAGS} ${LIBS} ${EXTRA_LIB_SPECS}
+
+tcl:
+ @echo Making tcl library object
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ test "$$subdir" = . || (echo "Making tcl in $$subdir"; \
+ cd $$subdir && $(MAKE) $(AM_MAKEFLAGS)) \
+ done
+ $(MAKE) lib/$(INTERP_PATH)/$(WRAPPER_OBJ)
+ $(MAKE) lib/$(INTERP_PATH)/$(WRAPPER_SH)
+ $(MAKE) lib/$(INTERP_PATH)/$(WRAPPER_INIT)
+ $(MAKE) xcircexec$(EXEEXT)
+
+lib/$(INTERP_PATH)/$(WRAPPER_SH): lib/$(INTERP_PATH)/$(WRAPPER_SH).in
+ sed -e '/XCLIBDIR/s#XCLIBDIR#$(librarydir)#' \
+ -e '/WRAPPER_INIT/s/WRAPPER_INIT/$(WRAPPER_INIT)/' \
+ -e '/CONSOLE_SCRIPT/s/CONSOLE_SCRIPT/$(CONSOLE_SCRIPT)/' \
+ -e '/CONSOLE/s/CONSOLE/$(CONSOLE)/' \
+ -e '/PROG_VERSION/s/PROG_VERSION/$(VERSION)/' \
+ -e '/PROG_REVISION/s/PROG_REVISION/$(REVISION)/' \
+ -e '/TCLLIBDIR/s#TCLLIBDIR#$(TCL_LIB_DIR)#' \
+ -e '/WISH_EXE/s#WISH_EXE#$(WISH_EXE)#' \
+ lib/$(INTERP_PATH)/$(WRAPPER_SH).in > $@
+ chmod 0755 $@
+
+lib/$(INTERP_PATH)/$(WRAPPER_INIT): lib/$(INTERP_PATH)/$(WRAPPER_INIT).in
+ sed -e '/LIBDIR/s#LIBDIR#$(librarydir)#' \
+ -e '/SCRIPTSDIR/s#SCRIPTSDIR#$(scriptsdir)#' \
+ lib/$(INTERP_PATH)/$(WRAPPER_INIT).in > $@
+ chmod 0755 $@
+
+lib/xcircuit.1: lib/xcircuit.1.in
+ sed -e '/LIBDIR/s#LIBDIR#$(libdir)#' \
+ -e "/^${HAVE_LGF}/s/^${HAVE_LGF} //" \
+ -e "/^${INTERPRETER}/s/^${INTERPRETER} //" \
+ -e '/^PYTHON /d' \
+ -e '/^TCL /d' \
+ -e '/^LGF /d' \
+ -e '/^NOINTERP /d' \
+ lib/xcircuit.1.in > $@
+
+install-data-local: lib/xcircuit.1
+ @echo "Installing app-defaults file"
+ $(mkinstalldirs) $(DESTDIR)$(appdefaultsdir)
+ $(mkinstalldirs) $(DESTDIR)$(appmandir)
+ $(INSTALL_DATA) lib/XCircuit.ad $(DESTDIR)$(appdefaultsdir)/XCircuit
+ $(INSTALL_DATA) lib/xcircuit.1 $(DESTDIR)$(appmandir)/xcircuit.1
+ @echo "Installing library and netlist files"
+ $(mkinstalldirs) $(DESTDIR)$(librarydir)
+ ( cd lib ; for i in $(PROLOGUE_FILE) $(ENCODING_FILES) *.lps *.cir; do \
+ $(INSTALL_DATA) $$i $(DESTDIR)$(librarydir); \
+ done )
+ ( cd lib/$(INTERP_PATH) ; for i in $(STARTUP_FILE); do \
+ $(INSTALL_DATA) $$i $(DESTDIR)$(librarydir); \
+ done )
+ @echo "Installing .lps font files"
+ $(mkinstalldirs) $(DESTDIR)$(librarydir)/fonts
+ for i in $(FONTS_LPS); do \
+ $(INSTALL_DATA) lib/fonts/$$i.lps $(DESTDIR)$(librarydir)/fonts; \
+ done
+ @echo "Installing .xfe font files"
+ for i in $(FONTS_XFE); do \
+ $(INSTALL_DATA) lib/fonts/$$i.xfe $(DESTDIR)$(librarydir)/fonts; \
+ done
+ @echo "Installing scripts (if option enabled)"
+ if test "$(PYTHON)" != ""; then \
+ $(mkinstalldirs) $(DESTDIR)$(scriptsdir)/python; \
+ for i in $(SCRIPTS_PY); do \
+ $(INSTALL_DATA) lib/python/$$i.py \
+ $(DESTDIR)$(scriptsdir)/python; \
+ done; \
+ fi
+
+# Note that MacOS/Fink uses SHDLIB_EXT = .dylib but Tcl expects .so anyway.
+# So we make a symbolic link if SHDLIB_EXT != .so
+
+install-tcl: xcircexec$(EXEEXT) lib/$(INTERP_PATH)/$(WRAPPER_OBJ) lib/$(INTERP_PATH)/$(WRAPPER_SH) lib/$(INTERP_PATH)/$(WRAPPER_INIT)
+ @echo "Installing standard XCircuit library files"
+ $(MAKE) $(AM_MAKEFLAGS) install-data-local
+ @echo "Installing Tcl files"
+ $(mkinstalldirs) $(DESTDIR)$(librarydir)
+ $(mkinstalldirs) $(DESTDIR)$(scriptsdir)
+ ( cd lib/$(INTERP_PATH) ; for i in $(WRAPPER_OBJ) *.tcl ; do \
+ $(INSTALL_DATA) $$i $(DESTDIR)$(scriptsdir); \
+ done )
+ $(INSTALL_DATA) xcircexec$(EXEEXT) $(DESTDIR)$(librarydir)
+ chmod 0755 $(DESTDIR)$(librarydir)/$(CONSOLE)
+ chmod 0755 $(DESTDIR)$(librarydir)/$(CONSOLE_SCRIPT)
+ chmod 0755 $(DESTDIR)$(librarydir)/$(WRAPPER_OBJ)
+ chmod 0755 $(DESTDIR)$(librarydir)/xcircexec$(EXEEXT)
+
+ if test "${SHDLIB_EXT}" != ".so"; then \
+ ( cd $(DESTDIR)$(librarydir); \
+ $(RM) $(WRAPPER_SO) ; \
+ ln -s $(WRAPPER_OBJ) $(WRAPPER_SO) ) ; \
+ fi
+
+ @echo "Installing GIF images"
+ $(mkinstalldirs) $(DESTDIR)$(librarydir)/pixmaps
+ ( cd lib/pixmaps ; for i in `ls *.gif *.xbm *.ico` ; do \
+ $(INSTALL_DATA) $$i $(DESTDIR)$(librarydir)/pixmaps; \
+ done )
+ @echo "Installing shell script as xcircuit executable"
+ $(mkinstalldirs) $(DESTDIR)$(bindir)
+ $(INSTALL_DATA) lib/$(INTERP_PATH)/$(WRAPPER_SH) $(DESTDIR)$(bindir)/xcircuit
+ chmod 0755 $(DESTDIR)$(bindir)/xcircuit
+
+clean:
+ (cd ./Xw; $(RM) *.o *.a *.bak core)
+ (cd ./asg; $(MAKE) clean)
+ (cd ./spiceparser; $(MAKE) clean)
+ $(RM) lib/$(INTERP_PATH)/$(WRAPPER_OBJ) lib/$(INTERP_PATH)/$(WRAPPER_SH)
+ $(RM) lib/$(INTERP_PATH)/$(WRAPPER_INIT)
+ $(RM) xcircuit *.o *.bak lib/xcircuit.1 core xcircexec$(EXEEXT)
+ $(RM) menudep$(EXEEXT) menudep.h
+ $(RM) config.cache config.log
+
+distclean:
+ (cd ./Xw; $(RM) *.o *.a *.bak Makefile core)
+ (cd ./asg; $(MAKE) clean ; $(RM) Makefile)
+ (cd ./spiceparser; $(MAKE) clean ; $(RM) Makefile)
+ $(RM) xcircuit *.o *.bak core
+ $(RM) lib/$(INTERP_PATH)/$(WRAPPER_OBJ) lib/$(INTERP_PATH)/$(WRAPPER_SH)
+ $(RM) menudep$(EXEEXT) menudep.h lib/xcircuit.1 xcircexec$(EXEEXT)
+ $(RM) Makefile config.cache config.log config.status
+ $(RM) xcircuit-$(FULL_VERSION) xcircuit.spec xcircuit-$(FULL_VERSION).tgz
+
+dist:
+ $(RM) xcircuit.spec xcircuit-$(FULL_VERSION) xcircuit-$(FULL_VERSION).tgz
+ sed -e /%VERSION%/s/%VERSION%/$(FULL_VERSION)/ \
+ xcircuit.spec.in > xcircuit.spec
+ ln -nsf . xcircuit-$(FULL_VERSION)
+ tar zchvf xcircuit-$(FULL_VERSION).tgz --exclude CVS \
+ --exclude xcircuit-$(FULL_VERSION)/xcircuit-$(FULL_VERSION) \
+ --exclude xcircuit-$(FULL_VERSION)/xcircuit-$(FULL_VERSION).tgz \
+ xcircuit-$(FULL_VERSION)
+
+quiteclean:
+ (cd ./Xw; $(RM) *.o *.a *.bak Makefile.in Makefile core)
+ (cd ./asg; $(MAKE) clean ; $(RM) Makefile.in Makefile)
+ (cd ./spiceparser; $(MAKE) clean ; $(RM) Makefile.in Makefile)
+ $(RM) xcircuit *.o *.bak core
+ $(RM) lib/$(INTERP_PATH)/$(WRAPPER_OBJ) lib/$(INTERP_PATH)/$(WRAPPER_SH)
+ $(RM) menudep$(EXEEXT) menudep.h lib/xcircuit.1 xcircexec$(EXEEXT)
+ $(RM) install-sh missing mkinstalldirs Makefile.in Makefile
+ $(RM) config.* aclocal.m4
+
+$(ALL_TARGET):
+ $(MAKE) tcl
+
+$(INSTALL_TARGET):
+ $(MAKE) install-tcl
+
+# 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:
diff --git a/Makefile.am b/Makefile.am
index 0dd2053..f29e863 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -2,6 +2,9 @@
AUTOMAKE_OPTIONS = foreign no-dependencies no-dist
+AM_CFLAGS = $(cairo_CFLAGS) $(fontconfig_CFLAGS) ${GS_CFLAGS}
+LIBS += $(cairo_LIBS) $(fontconfig_LIBS) ${GS_LIBS}
+
# Additional files to distribute
EXTRA_DIST = COPYRIGHT README README.ISOLatin2 README.notes
@@ -18,40 +21,6 @@ INSTALL_TARGET = @INSTALL_TARGET@
# source files for Xcircuit
noinst_PROGRAMS = menudep$(EXEEXT)
-menudep$(EXEEXT): menudep.o
- $(CC) -o $@ menudep.o
-
-menudep.h: menudep$(EXEEXT)
- ./menudep$(EXEEXT)
-
-xcwrap.o: xcwrap.c menudep.h
- $(CC) ${CPPFLAGS} ${CFLAGS} ${DEFS} $(PATHNAMES) $(INCLUDES) \
- xcwrap.c -c -o xcwrap.o
-
-lib/tcl/xcircuit${SHDLIB_EXT}: xcwrap.o ${xcircuit_OBJECTS} ${xcircuit_DEPEND}
- $(RM) lib/xcircuit${SHDLIB_EXT}
- $(CC) ${CFLAGS} ${SHLIB_CFLAGS} -o $@ ${LDDL_FLAGS} xcwrap.o \
- ${xcircuit_OBJECTS} ${xcircuit_LDADD} ${SHLIB_LIB_SPECS} \
- ${LDFLAGS} ${X_EXTRA_LIBS} ${EXTRA_LIBS} -lc ${LIBS} \
- ${LIB_SPECS} ${EXTRA_LIB_SPECS}
-
-xcircexec$(EXEEXT): xcircexec.o
- $(RM) ./xcircexec$(EXEEXT)
- $(CC) ${CFLAGS} ${CPPFLAGS} ${DEFS} $(PATHNAMES) $(INCLUDES) \
- xcircexec.c -o xcircexec$(EXEEXT) ${LIB_SPECS} \
- ${LD_RUN_PATH} ${LDFLAGS} ${LIBS} ${EXTRA_LIB_SPECS}
-
-tcl:
- @echo Making tcl library object
- list='$(SUBDIRS)'; for subdir in $$list; do \
- test "$$subdir" = . || (echo "Making tcl in $$subdir"; \
- cd $$subdir && $(MAKE) $(AM_MAKEFLAGS)) \
- done
- $(MAKE) lib/tcl/xcircuit${SHDLIB_EXT}
- $(MAKE) lib/$(INTERP_PATH)/$(WRAPPER_SH)
- $(MAKE) lib/$(INTERP_PATH)/$(WRAPPER_INIT)
- $(MAKE) xcircexec$(EXEEXT)
-
# Automake files
ac_aux_dir = dist
@@ -76,6 +45,9 @@ PATHNAMES = -DPROG_VERSION=$(VERSION) \
-DUSER_RC_FILE=\"$(USER_RC_FILE)\" \
-DPROLOGUE_DIR=\"$(librarydir)\" \
-DPROLOGUE_FILE=\"$(PROLOGUE_FILE)\" \
+ -DCYRILLIC_ENC_FILE=\"$(CYRILLIC_ENC_FILE)\" \
+ -DISOLATIN2_ENC_FILE=\"$(ISOLATIN2_ENC_FILE)\" \
+ -DISOLATIN5_ENC_FILE=\"$(ISOLATIN5_ENC_FILE)\" \
-DSTARTUP_FILE=\"$(STARTUP_FILE)\" \
-DLGF_LIB=\"$(LGF_LIB)\" \
-DASG_SPICE_LIB=\"$(ASG_SPICE_LIB)\"
@@ -83,9 +55,16 @@ PATHNAMES = -DPROG_VERSION=$(VERSION) \
xcircuit_SOURCES = elements.c events.c filelist.c files.c \
flate.c fontfile.c formats.c functions.c graphic.c \
help.c keybindings.c libraries.c menucalls.c \
- netlist.c ngspice.c opengl.c parameter.c python.c \
+ netlist.c ngspice.c parameter.c python.c \
rcfile.c render.c schema.c selection.c svg.c text.c undo.c \
- tclxcircuit.c tkSimple.c xcircuit.c xtfuncs.c xtgui.c
+ tclxcircuit.c tkSimple.c xcircuit.c xtfuncs.c xtgui.c \
+ cairo.c utf8encodings.c
+cairo.$(OBJEXT) : CFLAGS += -pedantic -Wall -Wextra
+elements.$(OBJEXT) : CFLAGS += -pedantic -Wall -Wextra
+events.$(OBJEXT) : CFLAGS += -pedantic -Wall -Wextra
+fontfile.$(OBJEXT) : CFLAGS += -pedantic -Wall -Wextra
+text.$(OBJEXT) : CFLAGS += -pedantic -Wall -Wextra
+utf8encodings.$(OBJEXT) : CFLAGS += -pedantic -Wall -Wextra
xcircuit_DEPEND = @SUBLIB@
xcircuit_LDADD = @SUBLIB@ @STDLIBS@
@@ -110,7 +89,6 @@ DEFS = @DEFS@ $(PATHNAMES)
INCLUDES = -IXw ${INC_SPECS}
SHDLIB_EXT = @SHDLIB_EXT@
LDDL_FLAGS = @LDDL_FLAGS@
-SHLIB_CFLAGS = @SHLIB_CFLAGS@
LDFLAGS = @LDFLAGS@
EXTRA_LIB_SPECS = @EXTRA_LIB_SPECS@
TCL_LIB_DIR = @TCL_LIB_DIR@
@@ -122,6 +100,10 @@ librarydir = $(libdir)/$(PACKAGE)-$(VERSION)
scriptsdir = $(libdir)/$(PACKAGE)-$(VERSION)
USER_RC_FILE = .xcircuitrc
PROLOGUE_FILE = xcircps2.pro
+CYRILLIC_ENC_FILE = cyrillic.enc
+ISOLATIN2_ENC_FILE = isolatin2.enc
+ISOLATIN5_ENC_FILE = isolatin5.enc
+ENCODING_FILES = ${CYRILLIC_ENC_FILE} ${ISOLATIN2_ENC_FILE} ${ISOLATIN5_ENC_FILE}
LGF_LIB = lgf.lps
ASG_SPICE_LIB = asg_spice.lps
SIGNAL_LIB = signal.lps
@@ -132,9 +114,10 @@ INTERP_PATH = @INTERP_PATH@
FONTS_LPS = courier courieriso2 courieriso5 helvetica helveticaiso2 \
helveticaiso5 myfont symbol times_roman times_romaniso2 \
times_romaniso5
-FONTS_XFE = courier courieriso courieriso2 courieriso5 helvetica \
- helveticaiso helveticaiso2 helveticaiso5 myfont symbol \
- times_roman times_romaniso times_romaniso2 times_romaniso5
+FONTS_XFE = courier courieriso courieriso2 courieriso5 courier_cyrillic \
+ helvetica helveticaiso helveticaiso2 helveticaiso5 helvetica_cyrillic \
+ times_roman times_romaniso times_romaniso2 times_romaniso5 \
+ times_roman_cyrillic myfont symbol
SCRIPTS_PY = spice gettext pagebbox
WRAPPER_INIT = xcircuit.tcl
@@ -144,6 +127,41 @@ WRAPPER_SH = xcircuit.sh
CONSOLE = tkcon.tcl
CONSOLE_SCRIPT = console.tcl
+menudep$(EXEEXT): menudep.o
+ $(CC) -o $@ menudep.o
+
+menudep.h: menudep$(EXEEXT)
+ ./menudep$(EXEEXT)
+
+xcwrap.o: xcwrap.c menudep.h
+ $(CC) ${CPPFLAGS} ${CFLAGS} ${DEFS} \
+ $(PATHNAMES) $(INCLUDES) \
+ xcwrap.c -c -o xcwrap.o
+
+lib/$(INTERP_PATH)/$(WRAPPER_OBJ): xcwrap.o ${xcircuit_OBJECTS} ${xcircuit_DEPEND}
+ $(RM) lib/$(INTERP_PATH)/$(WRAPPER_OBJ)
+ $(SHLIB_LD) ${CFLAGS} -o $@ ${LDDL_FLAGS} xcwrap.o \
+ ${xcircuit_OBJECTS} ${xcircuit_LDADD} ${SHLIB_LIB_SPECS} \
+ ${LDFLAGS} ${X_EXTRA_LIBS} ${EXTRA_LIBS} -lc ${LIBS} \
+ ${LIB_SPECS} ${EXTRA_LIB_SPECS}
+
+xcircexec$(EXEEXT): xcircexec.o
+ $(RM) ./xcircexec$(EXEEXT)
+ $(CC) ${CFLAGS} ${CPPFLAGS} ${DEFS} $(PATHNAMES) $(INCLUDES) \
+ xcircexec.c -o xcircexec$(EXEEXT) ${LIB_SPECS} \
+ ${LD_RUN_PATH} ${LDFLAGS} ${LIBS} ${EXTRA_LIB_SPECS}
+
+tcl:
+ @echo Making tcl library object
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ test "$$subdir" = . || (echo "Making tcl in $$subdir"; \
+ cd $$subdir && $(MAKE) $(AM_MAKEFLAGS)) \
+ done
+ $(MAKE) lib/$(INTERP_PATH)/$(WRAPPER_OBJ)
+ $(MAKE) lib/$(INTERP_PATH)/$(WRAPPER_SH)
+ $(MAKE) lib/$(INTERP_PATH)/$(WRAPPER_INIT)
+ $(MAKE) xcircexec$(EXEEXT)
+
lib/$(INTERP_PATH)/$(WRAPPER_SH): lib/$(INTERP_PATH)/$(WRAPPER_SH).in
sed -e '/XCLIBDIR/s#XCLIBDIR#$(librarydir)#' \
-e '/WRAPPER_INIT/s/WRAPPER_INIT/$(WRAPPER_INIT)/' \
@@ -180,7 +198,7 @@ install-data-local: lib/xcircuit.1
$(INSTALL_DATA) lib/xcircuit.1 $(DESTDIR)$(appmandir)/xcircuit.1
@echo "Installing library and netlist files"
$(mkinstalldirs) $(DESTDIR)$(librarydir)
- ( cd lib ; for i in $(PROLOGUE_FILE) *.lps *.cir; do \
+ ( cd lib ; for i in $(PROLOGUE_FILE) $(ENCODING_FILES) *.lps *.cir; do \
$(INSTALL_DATA) $$i $(DESTDIR)$(librarydir); \
done )
( cd lib/$(INTERP_PATH) ; for i in $(STARTUP_FILE); do \
diff --git a/Makefile.in b/Makefile.in
index edd0ae0..f8eef88 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -1,9 +1,8 @@
-# Makefile.in generated by automake 1.11.1 from Makefile.am.
+# Makefile.in generated by automake 1.14.1 from Makefile.am.
# @configure_input@
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
-# Inc.
+# Copyright (C) 1994-2013 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.
@@ -16,6 +15,51 @@
@SET_MAKE@
VPATH = @srcdir@
+am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__make_running_with_option = \
+ case $${target_option-} in \
+ ?) ;; \
+ *) echo "am__make_running_with_option: internal error: invalid" \
+ "target option '$${target_option-}' specified" >&2; \
+ exit 1;; \
+ esac; \
+ has_opt=no; \
+ sane_makeflags=$$MAKEFLAGS; \
+ if $(am__is_gnu_make); then \
+ sane_makeflags=$$MFLAGS; \
+ else \
+ case $$MAKEFLAGS in \
+ *\\[\ \ ]*) \
+ bs=\\; \
+ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
+ esac; \
+ fi; \
+ skip_next=no; \
+ strip_trailopt () \
+ { \
+ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+ }; \
+ for flg in $$sane_makeflags; do \
+ test $$skip_next = yes && { skip_next=no; continue; }; \
+ case $$flg in \
+ *=*|--*) continue;; \
+ -*I) strip_trailopt 'I'; skip_next=yes;; \
+ -*I?*) strip_trailopt 'I';; \
+ -*O) strip_trailopt 'O'; skip_next=yes;; \
+ -*O?*) strip_trailopt 'O';; \
+ -*l) strip_trailopt 'l'; skip_next=yes;; \
+ -*l?*) strip_trailopt 'l';; \
+ -[dEDm]) skip_next=yes;; \
+ -[JT]) skip_next=yes;; \
+ esac; \
+ case $$flg in \
+ *$$target_option*) has_opt=yes; break;; \
+ esac; \
+ done; \
+ test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
pkgdatadir = $(datadir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
@@ -37,7 +81,7 @@ host_triplet = @host@
target_triplet = @target@
bin_PROGRAMS = xcircuit$(EXEEXT)
subdir = .
-DIST_COMMON = README $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
+DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
$(top_srcdir)/configure $(am__configure_deps) mkinstalldirs
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/configure.in
@@ -58,29 +102,55 @@ am_xcircuit_OBJECTS = elements.$(OBJEXT) events.$(OBJEXT) \
fontfile.$(OBJEXT) formats.$(OBJEXT) functions.$(OBJEXT) \
graphic.$(OBJEXT) help.$(OBJEXT) keybindings.$(OBJEXT) \
libraries.$(OBJEXT) menucalls.$(OBJEXT) netlist.$(OBJEXT) \
- ngspice.$(OBJEXT) opengl.$(OBJEXT) parameter.$(OBJEXT) \
- python.$(OBJEXT) rcfile.$(OBJEXT) render.$(OBJEXT) \
- schema.$(OBJEXT) selection.$(OBJEXT) svg.$(OBJEXT) \
- text.$(OBJEXT) undo.$(OBJEXT) tclxcircuit.$(OBJEXT) \
- tkSimple.$(OBJEXT) xcircuit.$(OBJEXT) xtfuncs.$(OBJEXT) \
- xtgui.$(OBJEXT)
+ ngspice.$(OBJEXT) parameter.$(OBJEXT) python.$(OBJEXT) \
+ rcfile.$(OBJEXT) render.$(OBJEXT) schema.$(OBJEXT) \
+ selection.$(OBJEXT) svg.$(OBJEXT) text.$(OBJEXT) \
+ undo.$(OBJEXT) tclxcircuit.$(OBJEXT) tkSimple.$(OBJEXT) \
+ xcircuit.$(OBJEXT) xtfuncs.$(OBJEXT) xtgui.$(OBJEXT) \
+ cairo.$(OBJEXT) utf8encodings.$(OBJEXT)
xcircuit_OBJECTS = $(am_xcircuit_OBJECTS)
xcircuit_DEPENDENCIES =
+AM_V_P = $(am__v_P_@AM_V@)
+am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
+am__v_P_0 = false
+am__v_P_1 = :
+AM_V_GEN = $(am__v_GEN_@AM_V@)
+am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
+am__v_GEN_0 = @echo " GEN " $@;
+am__v_GEN_1 =
+AM_V_at = $(am__v_at_@AM_V@)
+am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
+am__v_at_0 = @
+am__v_at_1 =
DEFAULT_INCLUDES = -I.@am__isrc@
depcomp =
am__depfiles_maybe =
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+AM_V_CC = $(am__v_CC_@AM_V@)
+am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
+am__v_CC_0 = @echo " CC " $@;
+am__v_CC_1 =
CCLD = $(CC)
LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+AM_V_CCLD = $(am__v_CCLD_@AM_V@)
+am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
+am__v_CCLD_0 = @echo " CCLD " $@;
+am__v_CCLD_1 =
SOURCES = menudep.c $(xcircuit_SOURCES)
-RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
- html-recursive info-recursive install-data-recursive \
- install-dvi-recursive install-exec-recursive \
- install-html-recursive install-info-recursive \
- install-pdf-recursive install-ps-recursive install-recursive \
- installcheck-recursive installdirs-recursive pdf-recursive \
- ps-recursive uninstall-recursive
+RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \
+ ctags-recursive dvi-recursive html-recursive info-recursive \
+ install-data-recursive install-dvi-recursive \
+ install-exec-recursive install-html-recursive \
+ install-info-recursive install-pdf-recursive \
+ install-ps-recursive install-recursive installcheck-recursive \
+ installdirs-recursive pdf-recursive ps-recursive \
+ tags-recursive uninstall-recursive
+am__can_run_installinfo = \
+ case $$AM_UPDATE_INFO_DIR in \
+ n|no|NO) false;; \
+ *) (install-info --version) >/dev/null 2>&1;; \
+ esac
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
am__vpath_adj = case $$p in \
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
@@ -102,21 +172,50 @@ am__nobase_list = $(am__nobase_strip_setup); \
am__base_list = \
sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+ test -z "$$files" \
+ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+ $(am__cd) "$$dir" && rm -f $$files; }; \
+ }
man1dir = $(mandir)/man1
NROFF = nroff
MANS = $(man_MANS)
RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
distclean-recursive maintainer-clean-recursive
-AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
- $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS
+am__recursive_targets = \
+ $(RECURSIVE_TARGETS) \
+ $(RECURSIVE_CLEAN_TARGETS) \
+ $(am__extra_recursive_targets)
+AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \
+ cscope
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+# Read a list of newline-separated strings from the standard input,
+# and print each of them once, without duplicates. Input order is
+# *not* preserved.
+am__uniquify_input = $(AWK) '\
+ BEGIN { nonempty = 0; } \
+ { items[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in items) print i; }; } \
+'
+# Make sure the list of sources is unique. This is necessary because,
+# e.g., the same source file might be shared among _SOURCES variables
+# for different programs/libraries.
+am__define_uniq_tagged_files = \
+ list='$(am__tagged_files)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | $(am__uniquify_input)`
ETAGS = etags
CTAGS = ctags
+CSCOPE = cscope
DIST_SUBDIRS = $(SUBDIRS)
ACLOCAL = @ACLOCAL@
# Override standard "make" target when compiling under TCL
ALL_TARGET = @ALL_TARGET@
AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
@@ -139,6 +238,7 @@ EXEEXT = @EXEEXT@
EXTRA_LIB_SPECS = @EXTRA_LIB_SPECS@
GREP = @GREP@
GS_EXEC = @GS_EXEC@
+GS_LIBS = @GS_LIBS@
HAVE_LGF = @HAVE_LGF@
INC_SPECS = @INC_SPECS@
INSTALL = @INSTALL@
@@ -154,7 +254,7 @@ LDDL_FLAGS = @LDDL_FLAGS@
LDFLAGS = @LDFLAGS@
LD_RUN_PATH = @LD_RUN_PATH@
LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
+LIBS = @LIBS@ $(cairo_LIBS) $(fontconfig_LIBS) ${GS_LIBS}
LIB_SPECS = @LIB_SPECS@
LTLIBOBJS = @LTLIBOBJS@
M4 = @M4@
@@ -169,13 +269,15 @@ PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
+PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
PYTHON = @PYTHON@
RANLIB = @RANLIB@
REVISION = @REVISION@
SET_MAKE = @SET_MAKE@
SHDLIB_EXT = @SHDLIB_EXT@
SHELL = @SHELL@
-SHLIB_CFLAGS = @SHLIB_CFLAGS@
SHLIB_LD = @SHLIB_LD@
SHLIB_LIB_SPECS = @SHLIB_LIB_SPECS@
SPICE_EXEC = @SPICE_EXEC@
@@ -211,11 +313,15 @@ build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
builddir = @builddir@
+cairo_CFLAGS = @cairo_CFLAGS@
+cairo_LIBS = @cairo_LIBS@
datadir = @datadir@
datarootdir = @datarootdir@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
+fontconfig_CFLAGS = @fontconfig_CFLAGS@
+fontconfig_LIBS = @fontconfig_LIBS@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
@@ -249,6 +355,7 @@ top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
AUTOMAKE_OPTIONS = foreign no-dependencies no-dist
+AM_CFLAGS = $(cairo_CFLAGS) $(fontconfig_CFLAGS) ${GS_CFLAGS}
# Additional files to distribute
EXTRA_DIST = COPYRIGHT README README.ISOLatin2 README.notes
@@ -278,6 +385,9 @@ PATHNAMES = -DPROG_VERSION=$(VERSION) \
-DUSER_RC_FILE=\"$(USER_RC_FILE)\" \
-DPROLOGUE_DIR=\"$(librarydir)\" \
-DPROLOGUE_FILE=\"$(PROLOGUE_FILE)\" \
+ -DCYRILLIC_ENC_FILE=\"$(CYRILLIC_ENC_FILE)\" \
+ -DISOLATIN2_ENC_FILE=\"$(ISOLATIN2_ENC_FILE)\" \
+ -DISOLATIN5_ENC_FILE=\"$(ISOLATIN5_ENC_FILE)\" \
-DSTARTUP_FILE=\"$(STARTUP_FILE)\" \
-DLGF_LIB=\"$(LGF_LIB)\" \
-DASG_SPICE_LIB=\"$(ASG_SPICE_LIB)\"
@@ -285,9 +395,10 @@ PATHNAMES = -DPROG_VERSION=$(VERSION) \
xcircuit_SOURCES = elements.c events.c filelist.c files.c \
flate.c fontfile.c formats.c functions.c graphic.c \
help.c keybindings.c libraries.c menucalls.c \
- netlist.c ngspice.c opengl.c parameter.c python.c \
+ netlist.c ngspice.c parameter.c python.c \
rcfile.c render.c schema.c selection.c svg.c text.c undo.c \
- tclxcircuit.c tkSimple.c xcircuit.c xtfuncs.c xtgui.c
+ tclxcircuit.c tkSimple.c xcircuit.c xtfuncs.c xtgui.c \
+ cairo.c utf8encodings.c
xcircuit_DEPEND = @SUBLIB@
xcircuit_LDADD = @SUBLIB@ @STDLIBS@
@@ -302,6 +413,10 @@ librarydir = $(libdir)/$(PACKAGE)-$(VERSION)
scriptsdir = $(libdir)/$(PACKAGE)-$(VERSION)
USER_RC_FILE = .xcircuitrc
PROLOGUE_FILE = xcircps2.pro
+CYRILLIC_ENC_FILE = cyrillic.enc
+ISOLATIN2_ENC_FILE = isolatin2.enc
+ISOLATIN5_ENC_FILE = isolatin5.enc
+ENCODING_FILES = ${CYRILLIC_ENC_FILE} ${ISOLATIN2_ENC_FILE} ${ISOLATIN5_ENC_FILE}
LGF_LIB = lgf.lps
ASG_SPICE_LIB = asg_spice.lps
SIGNAL_LIB = signal.lps
@@ -310,9 +425,10 @@ FONTS_LPS = courier courieriso2 courieriso5 helvetica helveticaiso2 \
helveticaiso5 myfont symbol times_roman times_romaniso2 \
times_romaniso5
-FONTS_XFE = courier courieriso courieriso2 courieriso5 helvetica \
- helveticaiso helveticaiso2 helveticaiso5 myfont symbol \
- times_roman times_romaniso times_romaniso2 times_romaniso5
+FONTS_XFE = courier courieriso courieriso2 courieriso5 courier_cyrillic \
+ helvetica helveticaiso helveticaiso2 helveticaiso5 helvetica_cyrillic \
+ times_roman times_romaniso times_romaniso2 times_romaniso5 \
+ times_roman_cyrillic myfont symbol
SCRIPTS_PY = spice gettext pagebbox
WRAPPER_INIT = xcircuit.tcl
@@ -325,7 +441,7 @@ all: all-recursive
.SUFFIXES:
.SUFFIXES: .c .o .obj
-am--refresh:
+am--refresh: Makefile
@:
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
@@ -361,14 +477,18 @@ $(ACLOCAL_M4): $(am__aclocal_m4_deps)
$(am__aclocal_m4_deps):
install-binPROGRAMS: $(bin_PROGRAMS)
@$(NORMAL_INSTALL)
- test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)"
@list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+ if test -n "$$list"; then \
+ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \
+ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \
+ fi; \
for p in $$list; do echo "$$p $$p"; done | \
sed 's/$(EXEEXT)$$//' | \
- while read p p1; do if test -f $$p; \
- then echo "$$p"; echo "$$p"; else :; fi; \
+ while read p p1; do if test -f $$p \
+ ; then echo "$$p"; echo "$$p"; else :; fi; \
done | \
- sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \
+ sed -e 'p;s,.*/,,;n;h' \
+ -e 's|.*|.|' \
-e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
sed 'N;N;N;s,\n, ,g' | \
$(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
@@ -389,7 +509,8 @@ uninstall-binPROGRAMS:
@list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
files=`for p in $$list; do echo "$$p"; done | \
sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
- -e 's/$$/$(EXEEXT)/' `; \
+ -e 's/$$/$(EXEEXT)/' \
+ `; \
test -n "$$list" || exit 0; \
echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
cd "$(DESTDIR)$(bindir)" && rm -f $$files
@@ -399,9 +520,10 @@ clean-binPROGRAMS:
clean-noinstPROGRAMS:
-test -z "$(noinst_PROGRAMS)" || rm -f $(noinst_PROGRAMS)
-xcircuit$(EXEEXT): $(xcircuit_OBJECTS) $(xcircuit_DEPENDENCIES)
+
+xcircuit$(EXEEXT): $(xcircuit_OBJECTS) $(xcircuit_DEPENDENCIES) $(EXTRA_xcircuit_DEPENDENCIES)
@rm -f xcircuit$(EXEEXT)
- $(LINK) $(xcircuit_OBJECTS) $(xcircuit_LDADD) $(LIBS)
+ $(AM_V_CCLD)$(LINK) $(xcircuit_OBJECTS) $(xcircuit_LDADD) $(LIBS)
mostlyclean-compile:
-rm -f *.$(OBJEXT)
@@ -410,17 +532,24 @@ distclean-compile:
-rm -f *.tab.c
.c.o:
- $(COMPILE) -c $<
+ $(AM_V_CC)$(COMPILE) -c -o $@ $<
.c.obj:
- $(COMPILE) -c `$(CYGPATH_W) '$<'`
+ $(AM_V_CC)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
install-man1: $(man_MANS)
@$(NORMAL_INSTALL)
- test -z "$(man1dir)" || $(MKDIR_P) "$(DESTDIR)$(man1dir)"
- @list=''; test -n "$(man1dir)" || exit 0; \
- { for i in $$list; do echo "$$i"; done; \
- l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \
- sed -n '/\.1[a-z]*$$/p'; \
+ @list1=''; \
+ list2='$(man_MANS)'; \
+ test -n "$(man1dir)" \
+ && test -n "`echo $$list1$$list2`" \
+ || exit 0; \
+ echo " $(MKDIR_P) '$(DESTDIR)$(man1dir)'"; \
+ $(MKDIR_P) "$(DESTDIR)$(man1dir)" || exit 1; \
+ { for i in $$list1; do echo "$$i"; done; \
+ if test -n "$$list2"; then \
+ for i in $$list2; do echo "$$i"; done \
+ | sed -n '/\.1[a-z]*$$/p'; \
+ fi; \
} | while read p; do \
if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
echo "$$d$$p"; echo "$$p"; \
@@ -449,27 +578,28 @@ uninstall-man1:
sed -n '/\.1[a-z]*$$/p'; \
} | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \
-e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \
- test -z "$$files" || { \
- echo " ( cd '$(DESTDIR)$(man1dir)' && rm -f" $$files ")"; \
- cd "$(DESTDIR)$(man1dir)" && rm -f $$files; }
+ dir='$(DESTDIR)$(man1dir)'; $(am__uninstall_files_from_dir)
# 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):
- @fail= failcom='exit 1'; \
- for f in x $$MAKEFLAGS; do \
- case $$f in \
- *=* | --[!k]*);; \
- *k*) failcom='fail=yes';; \
- esac; \
- done; \
+# 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.
+$(am__recursive_targets):
+ @fail=; \
+ if $(am__make_keepgoing); then \
+ failcom='fail=yes'; \
+ else \
+ failcom='exit 1'; \
+ fi; \
dot_seen=no; \
target=`echo $@ | sed s/-recursive//`; \
- list='$(SUBDIRS)'; for subdir in $$list; do \
+ case "$@" in \
+ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+ *) list='$(SUBDIRS)' ;; \
+ esac; \
+ for subdir in $$list; do \
echo "Making $$target in $$subdir"; \
if test "$$subdir" = "."; then \
dot_seen=yes; \
@@ -484,57 +614,12 @@ $(RECURSIVE_TARGETS):
$(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
fi; test -z "$$fail"
-$(RECURSIVE_CLEAN_TARGETS):
- @fail= failcom='exit 1'; \
- for f in x $$MAKEFLAGS; do \
- case $$f in \
- *=* | --[!k]*);; \
- *k*) failcom='fail=yes';; \
- esac; \
- done; \
- 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; \
- ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
- || eval $$failcom; \
- done && test -z "$$fail"
-tags-recursive:
- list='$(SUBDIRS)'; for subdir in $$list; do \
- test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
- done
-ctags-recursive:
- list='$(SUBDIRS)'; for subdir in $$list; do \
- test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
- done
+ID: $(am__tagged_files)
+ $(am__define_uniq_tagged_files); mkid -fID $$unique
+tags: tags-recursive
+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; nonempty = 1; } \
- END { if (nonempty) { for (i in files) print i; }; }'`; \
- mkid -fID $$unique
-tags: TAGS
-
-TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
- $(TAGS_FILES) $(LISP)
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
set x; \
here=`pwd`; \
if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
@@ -550,12 +635,7 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
set "$$@" "$$include_option=$$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; nonempty = 1; } \
- END { if (nonempty) { for (i in files) print i; }; }'`; \
+ $(am__define_uniq_tagged_files); \
shift; \
if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
@@ -567,15 +647,11 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$$unique; \
fi; \
fi
-ctags: CTAGS
-CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
- $(TAGS_FILES) $(LISP)
- 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; nonempty = 1; } \
- END { if (nonempty) { for (i in files) print i; }; }'`; \
+ctags: ctags-recursive
+
+CTAGS: ctags
+ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+ $(am__define_uniq_tagged_files); \
test -z "$(CTAGS_ARGS)$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$unique
@@ -584,9 +660,31 @@ GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
&& $(am__cd) $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) "$$here"
+cscope: cscope.files
+ test ! -s cscope.files \
+ || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS)
+clean-cscope:
+ -rm -f cscope.files
+cscope.files: clean-cscope cscopelist
+cscopelist: cscopelist-recursive
+
+cscopelist-am: $(am__tagged_files)
+ list='$(am__tagged_files)'; \
+ case "$(srcdir)" in \
+ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+ *) sdir=$(subdir)/$(srcdir) ;; \
+ esac; \
+ for i in $$list; do \
+ if test -f "$$i"; then \
+ echo "$(subdir)/$$i"; \
+ else \
+ echo "$$sdir/$$i"; \
+ fi; \
+ done >> $(top_builddir)/cscope.files
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+ -rm -f cscope.out cscope.in.out cscope.po.out cscope.files
check-am: all-am
check: check-recursive
all-am: Makefile $(PROGRAMS) $(MANS)
@@ -605,10 +703,15 @@ install-am: all-am
installcheck: installcheck-recursive
install-strip:
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
- `test -z '$(STRIP)' || \
- echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+ if test -z '$(STRIP)'; then \
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ install; \
+ else \
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+ fi
mostlyclean-generic:
clean-generic:
@@ -688,25 +791,41 @@ uninstall-am: uninstall-binPROGRAMS uninstall-man
uninstall-man: uninstall-man1
-.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \
- install-am install-strip tags-recursive
-
-.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
- all all-am am--refresh check check-am clean clean-binPROGRAMS \
- clean-generic clean-noinstPROGRAMS ctags ctags-recursive \
- distclean distclean-compile distclean-generic distclean-tags \
- dvi dvi-am html html-am info info-am install install-am \
- install-binPROGRAMS install-data install-data-am \
- install-data-local install-dvi install-dvi-am install-exec \
- install-exec-am install-html install-html-am install-info \
- install-info-am install-man install-man1 install-pdf \
- install-pdf-am install-ps install-ps-am install-strip \
- installcheck installcheck-am installdirs installdirs-am \
- maintainer-clean maintainer-clean-generic mostlyclean \
- mostlyclean-compile mostlyclean-generic pdf pdf-am ps ps-am \
- tags tags-recursive uninstall uninstall-am \
+.MAKE: $(am__recursive_targets) install-am install-strip
+
+.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \
+ am--refresh check check-am clean clean-binPROGRAMS \
+ clean-cscope clean-generic clean-noinstPROGRAMS cscope \
+ cscopelist-am ctags ctags-am distclean distclean-compile \
+ distclean-generic distclean-tags dvi dvi-am html html-am info \
+ info-am install install-am install-binPROGRAMS install-data \
+ install-data-am install-data-local install-dvi install-dvi-am \
+ install-exec install-exec-am install-html install-html-am \
+ install-info install-info-am install-man install-man1 \
+ install-pdf install-pdf-am install-ps install-ps-am \
+ install-strip installcheck installcheck-am installdirs \
+ installdirs-am maintainer-clean maintainer-clean-generic \
+ mostlyclean mostlyclean-compile mostlyclean-generic pdf pdf-am \
+ ps ps-am tags tags-am uninstall uninstall-am \
uninstall-binPROGRAMS uninstall-man uninstall-man1
+cairo.$(OBJEXT) : CFLAGS += -pedantic -Wall -Wextra
+elements.$(OBJEXT) : CFLAGS += -pedantic -Wall -Wextra
+events.$(OBJEXT) : CFLAGS += -pedantic -Wall -Wextra
+fontfile.$(OBJEXT) : CFLAGS += -pedantic -Wall -Wextra
+text.$(OBJEXT) : CFLAGS += -pedantic -Wall -Wextra
+utf8encodings.$(OBJEXT) : CFLAGS += -pedantic -Wall -Wextra
+
+help.c: menudep.h
+menucalls.c: menudep.h
+rcfile.c: menudep.h
+schema.c: menudep.h
+xcircuit.c: menudep.h
+parameter.c: menudep.h
+python.c: menudep.h
+tclxcircuit.c: menudep.h
+xtgui.c: menudep.h
+xtfuncs.c: menudep.h
menudep$(EXEEXT): menudep.o
$(CC) -o $@ menudep.o
@@ -715,12 +834,13 @@ menudep.h: menudep$(EXEEXT)
./menudep$(EXEEXT)
xcwrap.o: xcwrap.c menudep.h
- $(CC) ${CPPFLAGS} ${CFLAGS} ${DEFS} $(PATHNAMES) $(INCLUDES) \
+ $(CC) ${CPPFLAGS} ${CFLAGS} ${DEFS} \
+ $(PATHNAMES) $(INCLUDES) \
xcwrap.c -c -o xcwrap.o
-lib/tcl/xcircuit${SHDLIB_EXT}: xcwrap.o ${xcircuit_OBJECTS} ${xcircuit_DEPEND}
- $(RM) lib/xcircuit${SHDLIB_EXT}
- $(CC) ${CFLAGS} ${SHLIB_CFLAGS} -o $@ ${LDDL_FLAGS} xcwrap.o \
+lib/$(INTERP_PATH)/$(WRAPPER_OBJ): xcwrap.o ${xcircuit_OBJECTS} ${xcircuit_DEPEND}
+ $(RM) lib/$(INTERP_PATH)/$(WRAPPER_OBJ)
+ $(SHLIB_LD) ${CFLAGS} -o $@ ${LDDL_FLAGS} xcwrap.o \
${xcircuit_OBJECTS} ${xcircuit_LDADD} ${SHLIB_LIB_SPECS} \
${LDFLAGS} ${X_EXTRA_LIBS} ${EXTRA_LIBS} -lc ${LIBS} \
${LIB_SPECS} ${EXTRA_LIB_SPECS}
@@ -737,22 +857,11 @@ tcl:
test "$$subdir" = . || (echo "Making tcl in $$subdir"; \
cd $$subdir && $(MAKE) $(AM_MAKEFLAGS)) \
done
- $(MAKE) lib/tcl/xcircuit${SHDLIB_EXT}
+ $(MAKE) lib/$(INTERP_PATH)/$(WRAPPER_OBJ)
$(MAKE) lib/$(INTERP_PATH)/$(WRAPPER_SH)
$(MAKE) lib/$(INTERP_PATH)/$(WRAPPER_INIT)
$(MAKE) xcircexec$(EXEEXT)
-help.c: menudep.h
-menucalls.c: menudep.h
-rcfile.c: menudep.h
-schema.c: menudep.h
-xcircuit.c: menudep.h
-parameter.c: menudep.h
-python.c: menudep.h
-tclxcircuit.c: menudep.h
-xtgui.c: menudep.h
-xtfuncs.c: menudep.h
-
lib/$(INTERP_PATH)/$(WRAPPER_SH): lib/$(INTERP_PATH)/$(WRAPPER_SH).in
sed -e '/XCLIBDIR/s#XCLIBDIR#$(librarydir)#' \
-e '/WRAPPER_INIT/s/WRAPPER_INIT/$(WRAPPER_INIT)/' \
@@ -789,7 +898,7 @@ install-data-local: lib/xcircuit.1
$(INSTALL_DATA) lib/xcircuit.1 $(DESTDIR)$(appmandir)/xcircuit.1
@echo "Installing library and netlist files"
$(mkinstalldirs) $(DESTDIR)$(librarydir)
- ( cd lib ; for i in $(PROLOGUE_FILE) *.lps *.cir; do \
+ ( cd lib ; for i in $(PROLOGUE_FILE) $(ENCODING_FILES) *.lps *.cir; do \
$(INSTALL_DATA) $$i $(DESTDIR)$(librarydir); \
done )
( cd lib/$(INTERP_PATH) ; for i in $(STARTUP_FILE); do \
diff --git a/Makefile.mingw64 b/Makefile.mingw64
index a060520..6f01eff 100644
--- a/Makefile.mingw64
+++ b/Makefile.mingw64
@@ -24,7 +24,7 @@
###########################
# INSTALLDIR = C:\app\xcircuit-tcl
# INSTALLDIR = C:/MinGW/msys/1.0/home/TEdwards/xcircuit-tcl
-INSTALLDIR = C:/OpenCircuitDesign/XCircuit-3.8
+INSTALLDIR = C:/OpenCircuitDesign/XCircuit-3.9
# TEMPDIR = D:\Temp
# TEMPDIR = C:/Temp
TEMPDIR = C:/OpenCircuitDesign/Temp
@@ -78,9 +78,8 @@ xcircuit_OBJECTS = elements.$(OBJEXT) events.$(OBJEXT) \
fontfile.$(OBJEXT) formats.$(OBJEXT) functions.$(OBJEXT) \
graphic.$(OBJEXT) help.$(OBJEXT) keybindings.$(OBJEXT) \
libraries.$(OBJEXT) menucalls.$(OBJEXT) netlist.$(OBJEXT) \
- ngspice.$(OBJEXT) opengl.$(OBJEXT) parameter.$(OBJEXT) \
- python.$(OBJEXT) rcfile.$(OBJEXT) render.$(OBJEXT) \
- svg.$(OBJEXT) \
+ ngspice.$(OBJEXT) parameter.$(OBJEXT) python.$(OBJEXT) \
+ rcfile.$(OBJEXT) render.$(OBJEXT) svg.$(OBJEXT) \
schema.$(OBJEXT) selection.$(OBJEXT) text.$(OBJEXT) \
undo.$(OBJEXT) xcircuit.$(OBJEXT) $(WIN32_OBJECTS)
DEFAULT_INCLUDES = -I. -I$(srcdir)
@@ -172,8 +171,8 @@ OBJEXT = o
PACKAGE = xcircuit
PACKAGE_NAME = xcircuit
PATH_SEPARATOR = \\
-VERSION = 3.8
-REVISION = 17
+VERSION = 3.9
+REVISION = 44
SHDLIB_EXT = .dll
SHLIB_CFLAGS = -shared
SHLIB_LIB_SPECS =
@@ -214,9 +213,8 @@ PATHNAMES = -DPROG_VERSION=$(VERSION) \
xcircuit_SOURCES = elements.c events.c filelist.c files.c \
flate.c fontfile.c formats.c functions.c graphic.c \
help.c keybindings.c libraries.c menucalls.c \
- netlist.c ngspice.c opengl.c parameter.c python.c \
- rcfile.c render.c schema.c selection.c \
- svg.c \
+ netlist.c ngspice.c parameter.c python.c rcfile.c \
+ render.c schema.c selection.c svg.c \
text.c undo.c \
tclxcircuit.c tkSimple.c xcircuit.c w32x11.c
@@ -337,12 +335,14 @@ lib/$(INTERP_PATH)/$(WRAPPER_SH): $(PP) lib/$(INTERP_PATH)/$(WRAPPER_SH).in
$(PP) $(PATHNAMES) -DXCLIBDIR=\"$(subst \,/,$(librarydir))\" \
-DWRAPPER_INIT=\"$(WRAPPER_INIT)\" -DCONSOLE=\"$(CONSOLE)\" \
-DCONSOLE_SCRIPT=\"$(CONSOLE_SCRIPT)\" \
+ -DSCRIPTSDIR=\"$(scriptsdir)\" \
-DTCLLIBDIR=\"$(subst \,/,$(TCL_LIB_DIR))\" \
-DWISH_EXE=\"$(subst \,/,$(WISH_EXE))\" \
lib/$(INTERP_PATH)/$(WRAPPER_SH).in > $@
lib/$(INTERP_PATH)/$(WRAPPER_INIT): $(PP) lib/$(INTERP_PATH)/$(WRAPPER_INIT).in
$(PP) $(PATHNAMES) -DLIBDIR=\"$(subst \,/,$(librarydir))\" \
+ -DSCRIPTSDIR=\"$(scriptsdir)\" \
lib/$(INTERP_PATH)/$(WRAPPER_INIT).in > $@
lib/xcircuit.1: $(PP) lib/xcircuit.1.in
@@ -444,7 +444,6 @@ libraries.c: xcircuit.h
menucalls.c: xcircuit.h
netlist.c: xcircuit.h
ngspice.c: xcircuit.h
-opengl.c: xcircuit.h
parameter.c: xcircuit.h
python.c: xcircuit.h
rcfile.c: xcircuit.h
diff --git a/README b/README
index d2d3c55..9012a2e 100644
--- a/README
+++ b/README
@@ -1,9 +1,9 @@
-XCircuit v3.8
+XCircuit v3.9
-----------------------------------------------------------------------------
An X11 drawing program [especially for circuit schematics]
-(c) 2013 Tim Edwards (see copyright notice in ./COPYRIGHT)
-August 1993 -- January 2013
+(c) 2014 Tim Edwards (see copyright notice in ./COPYRIGHT)
+August 1993 -- May 2014
-----------------------------------------------------------------------------
Compilation/Installation notes:
@@ -13,6 +13,8 @@ Compilation/Installation notes:
Run "./configure --help" for a list of configure options. For most
users, the relevant options are the following:
+ --with-cairo Enable cairo graphics
+
--with-tcl Configure xcircuit as an extension to Tcl/Tk. Tcl
becomes the default interpreter. Option is mutually
exclusive with "--with-python". A feature of this
@@ -166,6 +168,13 @@ Compilation/Installation notes:
This has been fixed for the AMD Opteron under Fedora Core; other
64-bit systems are untested.
+7) aclocal problems: In case during the make process the system complains
+ about a missing or out of date aclocal, rebuild the configure file with:
+
+ autoreconf -fi
+
+ And restart the ./configure command
+
-----------------------------------------------------------------------------
Shared Python Library:
diff --git a/README.ISOLatin2 b/README.CharEncoding
index 6b17aa0..6c7a379 100644
--- a/README.ISOLatin2
+++ b/README.CharEncoding
@@ -1,35 +1,60 @@
-------------------------------------------------------------------
-ISO-Latin2 through ISO-Latin6 encoded fonts in xcircuit
+Charater font encoding in xcircuit
-------------------------------------------------------------------
Xcircuit supports ISO-Latin2 encoding (Eastern Europe) since
-version 2.0a9. This feature is not set up by default because
-PostScript output is not (yet) possible without the use of the
-program "ogonkify". This support has been extended to other
-Latin encodings: ISO-Latin5 (Turkish) version 2.0a10 (6/14/99).
-
-Here's how to get ISO-Latin2 and other Latin encodings in
-xcircuit:
+version 2.0a9. This support was extended to ISO-Latin5
+(Turkish) in version 2.0a10 (6/14/1999), and Cyrillic (ISO-8859-5)
+in version 3.9.64 (3/29/2017). Between 1999 and 2017, projects
+like fontforge made it much easier to obtain and use Type1
+PostScript fonts. While the fonts are not generally available
+on printers, generally files are converted to PDF for printing,
+and ps2pdf takes care of inserting the proper font glyphs, and
+most Linux systems have URW fonts installed, or at least they
+are easy to obtain.
+
+In the latest version the above encodings can be reached simply
+by selecting Text->Encoding->(name of encoding). As of this
+writing, Cyrillic fonts are not available in xcircuit drawn
+vector form, but are available from the font rendering engine
+if xcircuit is compiled with Cairo graphics. Font encodings
+using standard glyph names (e.g., from URW fonts and others)
+are kept in text files in the runtime directories and are
+inserted into the output so that no further manipulation is
+needed to view the proper text characters.
+
+The instructions below are generally deprecated; use of
+"ogonkify" works only on ISO-Latin-X encodings (not, for
+example, Cyrillic). It is needed to generate the correct
+glyphs for sending PostScript output directly to a printer.
+However, as noted above, modern usage is generally to first
+convert to PDF format, for which ogonkify is not needed.
+
+Version 3.6.36 corrects a long-existing mistake in which only X11
+keysyms 0-255 are accepted as keyboard-entry. By converting the
+X11 keysyms to keycodes, non-ASCII-encoded characters can be typed
+directly into XCircuit from the keyboard. It would be nice,
+though, if XCircuit would auto-detect the expected encoding from
+the keysym and insert the proper font encoding switch, loading
+fonts if necessary.
+
+When creating text in an encoding other than PostScript "standard",
+be sure to select "Text->Encoding->(encoding name)" from the menu.
+This can be enabled by default simply by having a .xcircuitrc file
+in your home directory containing a line such as:
+
+ label encoding ISOLatin2
-------------------------------------------------------------------
-1) Edit file lib/startup.script. Uncomment (remove the leading
- '%' from) lines 15-17 (the ISO-Latin2 font encoding files). Do
- this before "make install"; otherwise, the file will be in
- (depending on the definition of XCIRCUIT_LIB_DIR in the
- Makefile) /usr/local/lib/xcircuit-3.6/startup.script.
- In the Tcl/Tk version, this file is lib/tcl/xcstartup.tcl,
- or, after installation, /usr/local/lib/xcircuit-3.6/xcstartup.tcl.
-
-2) When creating text, be sure to select "Text->Encoding->
- ISO-Latin2" from the menu. This can be enabled by default
- simply by having a .xcircuitrc file in your home directory
- containing a line such as:
+1) The best practice is to convert all xcircuit output to PDF
+ using, typically, ps2pdf, and then ignore all the instruction
+ below, since the PDF file contains all font information needed
+ for printing.
- set default font Times-RomanISO2
-
-3) To get proper PostScript output on a printer, you will need to
- have the (separate) program "ogonkify", found at:
+2) To get proper PostScript output on a printer (when sending
+ PostScript directly---this does not apply to PDF files!), you
+ will need to have the (separate) program "ogonkify", found at:
http://www.dcs.ed.ac.uk/home/jec/ogonkify/
ftp://ftp.dcs.ed.ac.uk/pub/jec/programs
@@ -40,7 +65,7 @@ xcircuit:
alignments for putting them together need to be provided.
Ogonkify does this best.
-4) Every file containing ISO-Latin2 text must be postprocessed
+3) Every file containing ISO-Latin2 text must be postprocessed
through "ogonkify" using the following command, before it will
print correctly on a PostScript printer:
@@ -63,7 +88,7 @@ xcircuit:
encodings, so that any and all encodings can be "mixed and
matched" in the same file and even the same label.
-5) In a nutshell: xcircuit defines each ISO-Latin2 font name as
+4) In a nutshell: xcircuit defines each ISO-Latin2 font name as
the original name followed by the string "ISO2". Xcircuit
can then load the file and interpret the font encodings
unambiguously. However, the new ISO-Latin2 font names are not
@@ -73,14 +98,14 @@ xcircuit:
or interpreter will either produce an error or else substitute
a default font for the unrecognized one.
-6) The "ogonkification" of the file will not affect xcircuit's
+5) The "ogonkification" of the file will not affect xcircuit's
ability to read it back into the program. xcircuit will
continue to display the ISO-Latin2 text correctly regardless of
whether or not the file has been run through "ogonkify".
However, the header material inserted by "ogonkify" will be
lost every time xcircuit writes the file back out.
-7) Other ISO-LatinX encodings: Currently ISO-Latin5 is supported,
+6) Other ISO-LatinX encodings: Currently ISO-Latin5 is supported,
and additional encodings will be created as I get requests for
them. Follow the instructions above for ISO-Latin2, but replace
all occurences of "2" with "5".
@@ -99,10 +124,3 @@ xcircuit:
to psfiles/builtins.lps (or /usr/local/lib/xcircuit-2.0/builtins.lps, if
already installed).
-
-8) Version 3.6.36 corrects a long-existing mistake in which only X11 keysyms
- 0-255 are accepted as keyboard-entry. By converting the X11 keysyms to
- keycodes, ISO-Latin2 characters can be typed directly into XCircuit from
- the keyboard. It would be nice, though, if XCircuit would auto-detect
- the expected encoding from the keysym and insert the proper font switch,
- loading fonts if necessary.
diff --git a/VERSION b/VERSION
index 9722aed..de353ad 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-3.8.78
+3.9.73
diff --git a/Xw/Makefile b/Xw/Makefile
new file mode 100644
index 0000000..3308da7
--- /dev/null
+++ b/Xw/Makefile
@@ -0,0 +1,686 @@
+# Makefile.in generated by automake 1.14.1 from Makefile.am.
+# Xw/Makefile. Generated from Makefile.in by configure.
+
+# Copyright (C) 1994-2013 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.
+
+
+
+
+am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__make_running_with_option = \
+ case $${target_option-} in \
+ ?) ;; \
+ *) echo "am__make_running_with_option: internal error: invalid" \
+ "target option '$${target_option-}' specified" >&2; \
+ exit 1;; \
+ esac; \
+ has_opt=no; \
+ sane_makeflags=$$MAKEFLAGS; \
+ if $(am__is_gnu_make); then \
+ sane_makeflags=$$MFLAGS; \
+ else \
+ case $$MAKEFLAGS in \
+ *\\[\ \ ]*) \
+ bs=\\; \
+ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
+ esac; \
+ fi; \
+ skip_next=no; \
+ strip_trailopt () \
+ { \
+ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+ }; \
+ for flg in $$sane_makeflags; do \
+ test $$skip_next = yes && { skip_next=no; continue; }; \
+ case $$flg in \
+ *=*|--*) continue;; \
+ -*I) strip_trailopt 'I'; skip_next=yes;; \
+ -*I?*) strip_trailopt 'I';; \
+ -*O) strip_trailopt 'O'; skip_next=yes;; \
+ -*O?*) strip_trailopt 'O';; \
+ -*l) strip_trailopt 'l'; skip_next=yes;; \
+ -*l?*) strip_trailopt 'l';; \
+ -[dEDm]) skip_next=yes;; \
+ -[JT]) skip_next=yes;; \
+ esac; \
+ case $$flg in \
+ *$$target_option*) has_opt=yes; break;; \
+ esac; \
+ done; \
+ test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
+pkgdatadir = $(datadir)/xcircuit
+pkgincludedir = $(includedir)/xcircuit
+pkglibdir = $(libdir)/xcircuit
+pkglibexecdir = $(libexecdir)/xcircuit
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+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 = :
+build_triplet = x86_64-unknown-linux-gnu
+host_triplet = x86_64-unknown-linux-gnu
+target_triplet = x86_64-unknown-linux-gnu
+subdir = Xw
+DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
+ $(top_srcdir)/mkinstalldirs
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+LIBRARIES = $(noinst_LIBRARIES)
+AR = ar
+ARFLAGS = cru
+AM_V_AR = $(am__v_AR_$(V))
+am__v_AR_ = $(am__v_AR_$(AM_DEFAULT_VERBOSITY))
+am__v_AR_0 = @echo " AR " $@;
+am__v_AR_1 =
+libxcXw_a_AR = $(AR) $(ARFLAGS)
+libxcXw_a_LIBADD =
+am_libxcXw_a_OBJECTS = BBoard.$(OBJEXT) Button.$(OBJEXT) \
+ Cascade.$(OBJEXT) Display.$(OBJEXT) Form.$(OBJEXT) \
+ Manager.$(OBJEXT) MapEvents.$(OBJEXT) MenuBtn.$(OBJEXT) \
+ MenuMgr.$(OBJEXT) MenuPane.$(OBJEXT) PButton.$(OBJEXT) \
+ PopupMgr.$(OBJEXT) Primitive.$(OBJEXT) ResConvert.$(OBJEXT) \
+ SText.$(OBJEXT) SourceStr.$(OBJEXT) TextEdit.$(OBJEXT) \
+ Toggle.$(OBJEXT) Traversal.$(OBJEXT) WorkSpace.$(OBJEXT)
+libxcXw_a_OBJECTS = $(am_libxcXw_a_OBJECTS)
+AM_V_P = $(am__v_P_$(V))
+am__v_P_ = $(am__v_P_$(AM_DEFAULT_VERBOSITY))
+am__v_P_0 = false
+am__v_P_1 = :
+AM_V_GEN = $(am__v_GEN_$(V))
+am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
+am__v_GEN_0 = @echo " GEN " $@;
+am__v_GEN_1 =
+AM_V_at = $(am__v_at_$(V))
+am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
+am__v_at_0 = @
+am__v_at_1 =
+DEFAULT_INCLUDES = -I.
+depcomp =
+am__depfiles_maybe =
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+AM_V_CC = $(am__v_CC_$(V))
+am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY))
+am__v_CC_0 = @echo " CC " $@;
+am__v_CC_1 =
+CCLD = $(CC)
+LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+AM_V_CCLD = $(am__v_CCLD_$(V))
+am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY))
+am__v_CCLD_0 = @echo " CCLD " $@;
+am__v_CCLD_1 =
+SOURCES = $(libxcXw_a_SOURCES)
+DIST_SOURCES = $(libxcXw_a_SOURCES)
+RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \
+ ctags-recursive dvi-recursive html-recursive info-recursive \
+ install-data-recursive install-dvi-recursive \
+ install-exec-recursive install-html-recursive \
+ install-info-recursive install-pdf-recursive \
+ install-ps-recursive install-recursive installcheck-recursive \
+ installdirs-recursive pdf-recursive ps-recursive \
+ tags-recursive uninstall-recursive
+am__can_run_installinfo = \
+ case $$AM_UPDATE_INFO_DIR in \
+ n|no|NO) false;; \
+ *) (install-info --version) >/dev/null 2>&1;; \
+ esac
+RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
+ distclean-recursive maintainer-clean-recursive
+am__recursive_targets = \
+ $(RECURSIVE_TARGETS) \
+ $(RECURSIVE_CLEAN_TARGETS) \
+ $(am__extra_recursive_targets)
+AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \
+ distdir
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+# Read a list of newline-separated strings from the standard input,
+# and print each of them once, without duplicates. Input order is
+# *not* preserved.
+am__uniquify_input = $(AWK) '\
+ BEGIN { nonempty = 0; } \
+ { items[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in items) print i; }; } \
+'
+# Make sure the list of sources is unique. This is necessary because,
+# e.g., the same source file might be shared among _SOURCES variables
+# for different programs/libraries.
+am__define_uniq_tagged_files = \
+ list='$(am__tagged_files)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | $(am__uniquify_input)`
+ETAGS = etags
+CTAGS = ctags
+DIST_SUBDIRS = $(SUBDIRS)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+am__relativize = \
+ dir0=`pwd`; \
+ sed_first='s,^\([^/]*\)/.*$$,\1,'; \
+ sed_rest='s,^[^/]*/*,,'; \
+ sed_last='s,^.*/\([^/]*\)$$,\1,'; \
+ sed_butlast='s,/*[^/]*$$,,'; \
+ while test -n "$$dir1"; do \
+ first=`echo "$$dir1" | sed -e "$$sed_first"`; \
+ if test "$$first" != "."; then \
+ if test "$$first" = ".."; then \
+ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
+ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
+ else \
+ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
+ if test "$$first2" = "$$first"; then \
+ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
+ else \
+ dir2="../$$dir2"; \
+ fi; \
+ dir0="$$dir0"/"$$first"; \
+ fi; \
+ fi; \
+ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
+ done; \
+ reldir="$$dir2"
+ACLOCAL = aclocal-1.14
+ALL_TARGET = all-recursive
+AMTAR = $${TAR-tar}
+AM_DEFAULT_VERBOSITY = 1
+AUTOCONF = autoconf
+AUTOHEADER = autoheader
+AUTOMAKE = automake-1.14
+AWK = gawk
+CC = gcc
+CCDEPMODE = depmode=none
+CFLAGS = -g -Wno-pointer-sign -fPIC
+CPP = gcc -E
+CPPFLAGS =
+CYGPATH_W = echo
+DEFS = -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DPACKAGE=\"xcircuit\" -DVERSION=\"3.9\" -DHAVE_LIBM=1 -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DSIZEOF_VOID_P=8 -DSIZEOF_UNSIGNED_INT=4 -DSIZEOF_UNSIGNED_LONG=8 -DSIZEOF_UNSIGNED_LONG_LONG=8 -DHAVE_LIBXT=1 -DSTDC_HEADERS=1 -DHAVE_SETENV=1 -DHAVE_PUTENV=1 -DHAVE_DIRENT_H=1 -DHAVE_LIBZ=1 -DHAVE_VA_COPY=1 -DHAVE___VA_COPY=1 -DHAVE_U_CHAR=1 -DHAVE_X11_XPM_H=1 -DHAVE_XPM=1 -DHAVE_CAIRO=1 -DLGF=1 -DINPUT_FOCUS=1 -DGS_EXEC=\"gs\" -DSPICE_EXEC=\"ngspice\" -DTCL_WRAPPER=1
+DEPDIR = .deps
+ECHO_C =
+ECHO_N = -n
+ECHO_T =
+EGREP = /bin/grep -E
+EXEEXT =
+EXTRA_LIB_SPECS = -lm
+GREP = /bin/grep
+GS_EXEC = gs
+GS_LIBS =
+HAVE_LGF = LGF
+INC_SPECS = -I/usr/include -I/usr/include
+INSTALL = /bin/install -c
+INSTALL_DATA = ${INSTALL} -m 644
+INSTALL_PROGRAM = ${INSTALL}
+INSTALL_SCRIPT = ${INSTALL}
+INSTALL_STRIP_PROGRAM = $(install_sh) -c -s
+INSTALL_TARGET = install-recursive
+INTERPRETER = TCL
+INTERP_PATH = tcl
+LD = /bin/ld
+LDDL_FLAGS = -Wl,-z,relro -Wl,--export-dynamic -Wl,--version-script=symbol.map
+LDFLAGS =
+LD_RUN_PATH = -Wl,-rpath,/usr/lib64
+LIBOBJS =
+LIBS = -ldl -lz -lpthread -lieee -lm -lz -lXt -lSM -lICE -lm -lX11 -lXpm
+LIB_SPECS = -L/usr/lib64 -ltcl8.6 -L/usr/lib64 -ltk8.6
+LTLIBOBJS =
+M4 = /bin/m4
+MAKEINFO = makeinfo
+MKDIR_P = /bin/mkdir -p
+OBJEXT = o
+PACKAGE = xcircuit
+PACKAGE_BUGREPORT =
+PACKAGE_NAME =
+PACKAGE_STRING =
+PACKAGE_TARNAME =
+PACKAGE_URL =
+PACKAGE_VERSION =
+PATH_SEPARATOR = :
+PKG_CONFIG = /bin/pkg-config
+PKG_CONFIG_LIBDIR =
+PKG_CONFIG_PATH =
+PYTHON =
+RANLIB = ranlib
+REVISION = 71
+SET_MAKE =
+SHDLIB_EXT = .so
+SHELL = /bin/sh
+SHLIB_LD = ${CC} -shared ${CFLAGS} ${LDFLAGS} -fPIC -Wl,-soname,${@}
+SHLIB_LIB_SPECS =
+SPICE_EXEC = ngspice
+STARTUP_FILE = xcstartup.tcl
+STDLIBS =
+STRIP =
+SUBDIRS =
+SUBLIB =
+TCL_LIB_DIR = /usr/lib64
+VERSION = 3.9
+WISH_EXE = /usr/bin/wish
+WRAPPER_SCRIPT = wrapper.tcl
+XCIRCUIT_TARGET = tcl
+XMKMF =
+X_CFLAGS =
+X_EXTRA_LIBS =
+X_LIBS =
+X_PRE_LIBS = -lSM -lICE
+abs_builddir = /home/tim/gitsrc/xcircuit-3.9/Xw
+abs_srcdir = /home/tim/gitsrc/xcircuit-3.9/Xw
+abs_top_builddir = /home/tim/gitsrc/xcircuit-3.9
+abs_top_srcdir = /home/tim/gitsrc/xcircuit-3.9
+ac_ct_CC = gcc
+am__include = include
+am__leading_dot = .
+am__quote =
+am__tar = $${TAR-tar} chof - "$$tardir"
+am__untar = $${TAR-tar} xf -
+bindir = ${exec_prefix}/bin
+build = x86_64-unknown-linux-gnu
+build_alias =
+build_cpu = x86_64
+build_os = linux-gnu
+build_vendor = unknown
+builddir = .
+cairo_CFLAGS = -I/usr/include/cairo -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/freetype2 -I/usr/include/libdrm -I/usr/include/libpng16
+cairo_LIBS = -lcairo
+datadir = ${datarootdir}
+datarootdir = ${prefix}/share
+docdir = ${datarootdir}/doc/${PACKAGE}
+dvidir = ${docdir}
+exec_prefix = ${prefix}
+fontconfig_CFLAGS = -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/freetype2 -I/usr/include/libpng16
+fontconfig_LIBS = -lfontconfig -lfreetype
+host = x86_64-unknown-linux-gnu
+host_alias =
+host_cpu = x86_64
+host_os = linux-gnu
+host_vendor = unknown
+htmldir = ${docdir}
+includedir = ${prefix}/include
+infodir = ${datarootdir}/info
+install_sh = ${SHELL} /home/tim/gitsrc/xcircuit-3.9/install-sh
+libdir = ${exec_prefix}/lib
+libexecdir = ${exec_prefix}/libexec
+localedir = ${datarootdir}/locale
+localstatedir = ${prefix}/var
+mandir = ${datarootdir}/man
+mkdir_p = $(MKDIR_P)
+oldincludedir = /usr/include
+pdfdir = ${docdir}
+prefix = /usr/local
+program_transform_name = s,x,x,
+psdir = ${docdir}
+sbindir = ${exec_prefix}/sbin
+sharedstatedir = ${prefix}/com
+srcdir = .
+sysconfdir = ${prefix}/etc
+target = x86_64-unknown-linux-gnu
+target_alias =
+target_cpu = x86_64
+target_os = linux-gnu
+target_vendor = unknown
+top_build_prefix = ../
+top_builddir = ..
+top_srcdir = ..
+AUTOMAKE_OPTIONS = foreign no-dependencies
+EXTRA_DIST = sub.c
+INCLUDES = -I..
+
+# Requirements for Xw library
+noinst_LIBRARIES = libxcXw.a
+libxcXw_a_SOURCES = BBoard.c Button.c Cascade.c Display.c Form.c \
+ Manager.c MapEvents.c MenuBtn.c MenuMgr.c MenuPane.c \
+ PButton.c PopupMgr.c Primitive.c ResConvert.c SText.c \
+ SourceStr.c TextEdit.c Toggle.c Traversal.c WorkSpace.c
+
+all: all-recursive
+
+.SUFFIXES:
+.SUFFIXES: .c .o .obj
+$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+ && { if test -f $@; then exit 0; else break; fi; }; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Xw/Makefile'; \
+ $(am__cd) $(top_srcdir) && \
+ $(AUTOMAKE) --foreign Xw/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+
+clean-noinstLIBRARIES:
+ -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES)
+
+libxcXw.a: $(libxcXw_a_OBJECTS) $(libxcXw_a_DEPENDENCIES) $(EXTRA_libxcXw_a_DEPENDENCIES)
+ $(AM_V_at)-rm -f libxcXw.a
+ $(AM_V_AR)$(libxcXw_a_AR) libxcXw.a $(libxcXw_a_OBJECTS) $(libxcXw_a_LIBADD)
+ $(AM_V_at)$(RANLIB) libxcXw.a
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+
+distclean-compile:
+ -rm -f *.tab.c
+
+.c.o:
+ $(AM_V_CC)$(COMPILE) -c -o $@ $<
+
+.c.obj:
+ $(AM_V_CC)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+# 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.
+$(am__recursive_targets):
+ @fail=; \
+ if $(am__make_keepgoing); then \
+ failcom='fail=yes'; \
+ else \
+ failcom='exit 1'; \
+ fi; \
+ dot_seen=no; \
+ target=`echo $@ | sed s/-recursive//`; \
+ case "$@" in \
+ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+ *) list='$(SUBDIRS)' ;; \
+ esac; \
+ 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; \
+ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+ || eval $$failcom; \
+ done; \
+ if test "$$dot_seen" = "no"; then \
+ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+ fi; test -z "$$fail"
+
+ID: $(am__tagged_files)
+ $(am__define_uniq_tagged_files); mkid -fID $$unique
+tags: tags-recursive
+TAGS: tags
+
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+ set x; \
+ here=`pwd`; \
+ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+ include_option=--etags-include; \
+ empty_fix=.; \
+ else \
+ include_option=--include; \
+ empty_fix=; \
+ fi; \
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" = .; then :; else \
+ test ! -f $$subdir/TAGS || \
+ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
+ fi; \
+ done; \
+ $(am__define_uniq_tagged_files); \
+ shift; \
+ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ if test $$# -gt 0; then \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ "$$@" $$unique; \
+ else \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$unique; \
+ fi; \
+ fi
+ctags: ctags-recursive
+
+CTAGS: ctags
+ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+ $(am__define_uniq_tagged_files); \
+ test -z "$(CTAGS_ARGS)$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && $(am__cd) $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) "$$here"
+cscopelist: cscopelist-recursive
+
+cscopelist-am: $(am__tagged_files)
+ list='$(am__tagged_files)'; \
+ case "$(srcdir)" in \
+ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+ *) sdir=$(subdir)/$(srcdir) ;; \
+ esac; \
+ for i in $$list; do \
+ if test -f "$$i"; then \
+ echo "$(subdir)/$$i"; \
+ else \
+ echo "$$sdir/$$i"; \
+ fi; \
+ done >> $(top_builddir)/cscope.files
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ if test -d $$d/$$file; then \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d "$(distdir)/$$file"; then \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+ else \
+ test -f "$(distdir)/$$file" \
+ || cp -p $$d/$$file "$(distdir)/$$file" \
+ || exit 1; \
+ fi; \
+ done
+ @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" = .; then :; else \
+ $(am__make_dryrun) \
+ || test -d "$(distdir)/$$subdir" \
+ || $(MKDIR_P) "$(distdir)/$$subdir" \
+ || exit 1; \
+ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
+ $(am__relativize); \
+ new_distdir=$$reldir; \
+ dir1=$$subdir; dir2="$(top_distdir)"; \
+ $(am__relativize); \
+ new_top_distdir=$$reldir; \
+ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
+ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
+ ($(am__cd) $$subdir && \
+ $(MAKE) $(AM_MAKEFLAGS) \
+ top_distdir="$$new_top_distdir" \
+ distdir="$$new_distdir" \
+ am__remove_distdir=: \
+ am__skip_length_check=: \
+ am__skip_mode_fix=: \
+ distdir) \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: check-recursive
+all-am: Makefile $(LIBRARIES)
+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:
+ if test -z '$(STRIP)'; then \
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ install; \
+ else \
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+ fi
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+ -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_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 clean-noinstLIBRARIES mostlyclean-am
+
+distclean: distclean-recursive
+ -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+ distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+html-am:
+
+info: info-recursive
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-recursive
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-recursive
+
+install-html-am:
+
+install-info: install-info-recursive
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-recursive
+
+install-pdf-am:
+
+install-ps: install-ps-recursive
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+ -rm -f Makefile
+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:
+
+.MAKE: $(am__recursive_targets) install-am install-strip
+
+.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \
+ check-am clean clean-generic clean-noinstLIBRARIES \
+ cscopelist-am ctags ctags-am distclean distclean-compile \
+ distclean-generic distclean-tags distdir dvi dvi-am html \
+ html-am info info-am install install-am install-data \
+ install-data-am install-dvi install-dvi-am install-exec \
+ install-exec-am install-html install-html-am install-info \
+ install-info-am install-man install-pdf install-pdf-am \
+ install-ps install-ps-am install-strip installcheck \
+ installcheck-am installdirs installdirs-am maintainer-clean \
+ maintainer-clean-generic mostlyclean mostlyclean-compile \
+ mostlyclean-generic pdf pdf-am ps ps-am tags tags-am uninstall \
+ uninstall-am
+
+
+# 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:
diff --git a/Xw/Makefile.in b/Xw/Makefile.in
index 2c586b8..d9d360d 100644
--- a/Xw/Makefile.in
+++ b/Xw/Makefile.in
@@ -1,9 +1,8 @@
-# Makefile.in generated by automake 1.11.1 from Makefile.am.
+# Makefile.in generated by automake 1.14.1 from Makefile.am.
# @configure_input@
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
-# Inc.
+# Copyright (C) 1994-2013 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.
@@ -16,6 +15,51 @@
@SET_MAKE@
VPATH = @srcdir@
+am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__make_running_with_option = \
+ case $${target_option-} in \
+ ?) ;; \
+ *) echo "am__make_running_with_option: internal error: invalid" \
+ "target option '$${target_option-}' specified" >&2; \
+ exit 1;; \
+ esac; \
+ has_opt=no; \
+ sane_makeflags=$$MAKEFLAGS; \
+ if $(am__is_gnu_make); then \
+ sane_makeflags=$$MFLAGS; \
+ else \
+ case $$MAKEFLAGS in \
+ *\\[\ \ ]*) \
+ bs=\\; \
+ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
+ esac; \
+ fi; \
+ skip_next=no; \
+ strip_trailopt () \
+ { \
+ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+ }; \
+ for flg in $$sane_makeflags; do \
+ test $$skip_next = yes && { skip_next=no; continue; }; \
+ case $$flg in \
+ *=*|--*) continue;; \
+ -*I) strip_trailopt 'I'; skip_next=yes;; \
+ -*I?*) strip_trailopt 'I';; \
+ -*O) strip_trailopt 'O'; skip_next=yes;; \
+ -*O?*) strip_trailopt 'O';; \
+ -*l) strip_trailopt 'l'; skip_next=yes;; \
+ -*l?*) strip_trailopt 'l';; \
+ -[dEDm]) skip_next=yes;; \
+ -[JT]) skip_next=yes;; \
+ esac; \
+ case $$flg in \
+ *$$target_option*) has_opt=yes; break;; \
+ esac; \
+ done; \
+ test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
pkgdatadir = $(datadir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
@@ -36,7 +80,8 @@ build_triplet = @build@
host_triplet = @host@
target_triplet = @target@
subdir = Xw
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
+ $(top_srcdir)/mkinstalldirs
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/configure.in
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
@@ -47,6 +92,10 @@ CONFIG_CLEAN_VPATH_FILES =
LIBRARIES = $(noinst_LIBRARIES)
AR = ar
ARFLAGS = cru
+AM_V_AR = $(am__v_AR_@AM_V@)
+am__v_AR_ = $(am__v_AR_@AM_DEFAULT_V@)
+am__v_AR_0 = @echo " AR " $@;
+am__v_AR_1 =
libxcXw_a_AR = $(AR) $(ARFLAGS)
libxcXw_a_LIBADD =
am_libxcXw_a_OBJECTS = BBoard.$(OBJEXT) Button.$(OBJEXT) \
@@ -57,27 +106,73 @@ am_libxcXw_a_OBJECTS = BBoard.$(OBJEXT) Button.$(OBJEXT) \
SText.$(OBJEXT) SourceStr.$(OBJEXT) TextEdit.$(OBJEXT) \
Toggle.$(OBJEXT) Traversal.$(OBJEXT) WorkSpace.$(OBJEXT)
libxcXw_a_OBJECTS = $(am_libxcXw_a_OBJECTS)
+AM_V_P = $(am__v_P_@AM_V@)
+am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
+am__v_P_0 = false
+am__v_P_1 = :
+AM_V_GEN = $(am__v_GEN_@AM_V@)
+am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
+am__v_GEN_0 = @echo " GEN " $@;
+am__v_GEN_1 =
+AM_V_at = $(am__v_at_@AM_V@)
+am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
+am__v_at_0 = @
+am__v_at_1 =
DEFAULT_INCLUDES = -I.@am__isrc@
depcomp =
am__depfiles_maybe =
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+AM_V_CC = $(am__v_CC_@AM_V@)
+am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
+am__v_CC_0 = @echo " CC " $@;
+am__v_CC_1 =
CCLD = $(CC)
LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+AM_V_CCLD = $(am__v_CCLD_@AM_V@)
+am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
+am__v_CCLD_0 = @echo " CCLD " $@;
+am__v_CCLD_1 =
SOURCES = $(libxcXw_a_SOURCES)
DIST_SOURCES = $(libxcXw_a_SOURCES)
-RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
- html-recursive info-recursive install-data-recursive \
- install-dvi-recursive install-exec-recursive \
- install-html-recursive install-info-recursive \
- install-pdf-recursive install-ps-recursive install-recursive \
- installcheck-recursive installdirs-recursive pdf-recursive \
- ps-recursive uninstall-recursive
+RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \
+ ctags-recursive dvi-recursive html-recursive info-recursive \
+ install-data-recursive install-dvi-recursive \
+ install-exec-recursive install-html-recursive \
+ install-info-recursive install-pdf-recursive \
+ install-ps-recursive install-recursive installcheck-recursive \
+ installdirs-recursive pdf-recursive ps-recursive \
+ tags-recursive uninstall-recursive
+am__can_run_installinfo = \
+ case $$AM_UPDATE_INFO_DIR in \
+ n|no|NO) false;; \
+ *) (install-info --version) >/dev/null 2>&1;; \
+ esac
RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
distclean-recursive maintainer-clean-recursive
-AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
- $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \
+am__recursive_targets = \
+ $(RECURSIVE_TARGETS) \
+ $(RECURSIVE_CLEAN_TARGETS) \
+ $(am__extra_recursive_targets)
+AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \
distdir
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+# Read a list of newline-separated strings from the standard input,
+# and print each of them once, without duplicates. Input order is
+# *not* preserved.
+am__uniquify_input = $(AWK) '\
+ BEGIN { nonempty = 0; } \
+ { items[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in items) print i; }; } \
+'
+# Make sure the list of sources is unique. This is necessary because,
+# e.g., the same source file might be shared among _SOURCES variables
+# for different programs/libraries.
+am__define_uniq_tagged_files = \
+ list='$(am__tagged_files)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | $(am__uniquify_input)`
ETAGS = etags
CTAGS = ctags
DIST_SUBDIRS = $(SUBDIRS)
@@ -110,6 +205,7 @@ am__relativize = \
ACLOCAL = @ACLOCAL@
ALL_TARGET = @ALL_TARGET@
AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
@@ -130,6 +226,7 @@ EXEEXT = @EXEEXT@
EXTRA_LIB_SPECS = @EXTRA_LIB_SPECS@
GREP = @GREP@
GS_EXEC = @GS_EXEC@
+GS_LIBS = @GS_LIBS@
HAVE_LGF = @HAVE_LGF@
INC_SPECS = @INC_SPECS@
INSTALL = @INSTALL@
@@ -160,13 +257,15 @@ PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
+PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
PYTHON = @PYTHON@
RANLIB = @RANLIB@
REVISION = @REVISION@
SET_MAKE = @SET_MAKE@
SHDLIB_EXT = @SHDLIB_EXT@
SHELL = @SHELL@
-SHLIB_CFLAGS = @SHLIB_CFLAGS@
SHLIB_LD = @SHLIB_LD@
SHLIB_LIB_SPECS = @SHLIB_LIB_SPECS@
SPICE_EXEC = @SPICE_EXEC@
@@ -202,11 +301,15 @@ build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
builddir = @builddir@
+cairo_CFLAGS = @cairo_CFLAGS@
+cairo_LIBS = @cairo_LIBS@
datadir = @datadir@
datarootdir = @datarootdir@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
+fontconfig_CFLAGS = @fontconfig_CFLAGS@
+fontconfig_LIBS = @fontconfig_LIBS@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
@@ -287,10 +390,11 @@ $(am__aclocal_m4_deps):
clean-noinstLIBRARIES:
-test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES)
-libxcXw.a: $(libxcXw_a_OBJECTS) $(libxcXw_a_DEPENDENCIES)
- -rm -f libxcXw.a
- $(libxcXw_a_AR) libxcXw.a $(libxcXw_a_OBJECTS) $(libxcXw_a_LIBADD)
- $(RANLIB) libxcXw.a
+
+libxcXw.a: $(libxcXw_a_OBJECTS) $(libxcXw_a_DEPENDENCIES) $(EXTRA_libxcXw_a_DEPENDENCIES)
+ $(AM_V_at)-rm -f libxcXw.a
+ $(AM_V_AR)$(libxcXw_a_AR) libxcXw.a $(libxcXw_a_OBJECTS) $(libxcXw_a_LIBADD)
+ $(AM_V_at)$(RANLIB) libxcXw.a
mostlyclean-compile:
-rm -f *.$(OBJEXT)
@@ -299,28 +403,31 @@ distclean-compile:
-rm -f *.tab.c
.c.o:
- $(COMPILE) -c $<
+ $(AM_V_CC)$(COMPILE) -c -o $@ $<
.c.obj:
- $(COMPILE) -c `$(CYGPATH_W) '$<'`
+ $(AM_V_CC)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
# 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):
- @fail= failcom='exit 1'; \
- for f in x $$MAKEFLAGS; do \
- case $$f in \
- *=* | --[!k]*);; \
- *k*) failcom='fail=yes';; \
- esac; \
- done; \
+# 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.
+$(am__recursive_targets):
+ @fail=; \
+ if $(am__make_keepgoing); then \
+ failcom='fail=yes'; \
+ else \
+ failcom='exit 1'; \
+ fi; \
dot_seen=no; \
target=`echo $@ | sed s/-recursive//`; \
- list='$(SUBDIRS)'; for subdir in $$list; do \
+ case "$@" in \
+ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+ *) list='$(SUBDIRS)' ;; \
+ esac; \
+ for subdir in $$list; do \
echo "Making $$target in $$subdir"; \
if test "$$subdir" = "."; then \
dot_seen=yes; \
@@ -335,57 +442,12 @@ $(RECURSIVE_TARGETS):
$(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
fi; test -z "$$fail"
-$(RECURSIVE_CLEAN_TARGETS):
- @fail= failcom='exit 1'; \
- for f in x $$MAKEFLAGS; do \
- case $$f in \
- *=* | --[!k]*);; \
- *k*) failcom='fail=yes';; \
- esac; \
- done; \
- 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; \
- ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
- || eval $$failcom; \
- done && test -z "$$fail"
-tags-recursive:
- list='$(SUBDIRS)'; for subdir in $$list; do \
- test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
- done
-ctags-recursive:
- list='$(SUBDIRS)'; for subdir in $$list; do \
- test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
- done
+ID: $(am__tagged_files)
+ $(am__define_uniq_tagged_files); mkid -fID $$unique
+tags: tags-recursive
+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; nonempty = 1; } \
- END { if (nonempty) { for (i in files) print i; }; }'`; \
- mkid -fID $$unique
-tags: TAGS
-
-TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
- $(TAGS_FILES) $(LISP)
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
set x; \
here=`pwd`; \
if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
@@ -401,12 +463,7 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
set "$$@" "$$include_option=$$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; nonempty = 1; } \
- END { if (nonempty) { for (i in files) print i; }; }'`; \
+ $(am__define_uniq_tagged_files); \
shift; \
if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
@@ -418,15 +475,11 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$$unique; \
fi; \
fi
-ctags: CTAGS
-CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
- $(TAGS_FILES) $(LISP)
- 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; nonempty = 1; } \
- END { if (nonempty) { for (i in files) print i; }; }'`; \
+ctags: ctags-recursive
+
+CTAGS: ctags
+ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+ $(am__define_uniq_tagged_files); \
test -z "$(CTAGS_ARGS)$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$unique
@@ -435,6 +488,21 @@ GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
&& $(am__cd) $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) "$$here"
+cscopelist: cscopelist-recursive
+
+cscopelist-am: $(am__tagged_files)
+ list='$(am__tagged_files)'; \
+ case "$(srcdir)" in \
+ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+ *) sdir=$(subdir)/$(srcdir) ;; \
+ esac; \
+ for i in $$list; do \
+ if test -f "$$i"; then \
+ echo "$(subdir)/$$i"; \
+ else \
+ echo "$$sdir/$$i"; \
+ fi; \
+ done >> $(top_builddir)/cscope.files
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
@@ -471,13 +539,10 @@ distdir: $(DISTFILES)
done
@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
- test -d "$(distdir)/$$subdir" \
- || $(MKDIR_P) "$(distdir)/$$subdir" \
- || exit 1; \
- fi; \
- done
- @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
- if test "$$subdir" = .; then :; else \
+ $(am__make_dryrun) \
+ || test -d "$(distdir)/$$subdir" \
+ || $(MKDIR_P) "$(distdir)/$$subdir" \
+ || exit 1; \
dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
$(am__relativize); \
new_distdir=$$reldir; \
@@ -512,10 +577,15 @@ install-am: all-am
installcheck: installcheck-recursive
install-strip:
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
- `test -z '$(STRIP)' || \
- echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+ if test -z '$(STRIP)'; then \
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ install; \
+ else \
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+ fi
mostlyclean-generic:
clean-generic:
@@ -594,22 +664,21 @@ ps-am:
uninstall-am:
-.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \
- install-am install-strip tags-recursive
-
-.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
- all all-am check check-am clean clean-generic \
- clean-noinstLIBRARIES ctags ctags-recursive distclean \
- distclean-compile distclean-generic distclean-tags distdir dvi \
- dvi-am html html-am info info-am install install-am \
- install-data install-data-am install-dvi install-dvi-am \
- install-exec install-exec-am install-html install-html-am \
- install-info install-info-am install-man install-pdf \
- install-pdf-am install-ps install-ps-am install-strip \
- installcheck installcheck-am installdirs installdirs-am \
- maintainer-clean maintainer-clean-generic mostlyclean \
- mostlyclean-compile mostlyclean-generic pdf pdf-am ps ps-am \
- tags tags-recursive uninstall uninstall-am
+.MAKE: $(am__recursive_targets) install-am install-strip
+
+.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \
+ check-am clean clean-generic clean-noinstLIBRARIES \
+ cscopelist-am ctags ctags-am distclean distclean-compile \
+ distclean-generic distclean-tags distdir dvi dvi-am html \
+ html-am info info-am install install-am install-data \
+ install-data-am install-dvi install-dvi-am install-exec \
+ install-exec-am install-html install-html-am install-info \
+ install-info-am install-man install-pdf install-pdf-am \
+ install-ps install-ps-am install-strip installcheck \
+ installcheck-am installdirs installdirs-am maintainer-clean \
+ maintainer-clean-generic mostlyclean mostlyclean-compile \
+ mostlyclean-generic pdf pdf-am ps ps-am tags tags-am uninstall \
+ uninstall-am
# Tell versions [3.59,3.63) of GNU make to not export all variables.
diff --git a/aclocal.m4 b/aclocal.m4
index 1bc55f4..1f91f85 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -1,7 +1,7 @@
-# generated automatically by aclocal 1.11.1 -*- Autoconf -*-
+# generated automatically by aclocal 1.14.1 -*- Autoconf -*-
+
+# Copyright (C) 1996-2013 Free Software Foundation, Inc.
-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
-# 2005, 2006, 2007, 2008, 2009 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.
@@ -11,15 +11,231 @@
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
+m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])])
m4_ifndef([AC_AUTOCONF_VERSION],
[m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
-m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.68],,
-[m4_warning([this file was generated for autoconf 2.68.
+m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],,
+[m4_warning([this file was generated for autoconf 2.69.
You have another version of autoconf. It may work, but is not guaranteed to.
If you have problems, you may need to regenerate the build system entirely.
-To do so, use the procedure documented by the package, typically `autoreconf'.])])
+To do so, use the procedure documented by the package, typically 'autoreconf'.])])
+
+# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
+# serial 1 (pkg-config-0.24)
+#
+# Copyright © 2004 Scott James Remnant <scott@netsplit.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 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.
+
+# PKG_PROG_PKG_CONFIG([MIN-VERSION])
+# ----------------------------------
+AC_DEFUN([PKG_PROG_PKG_CONFIG],
+[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
+m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$])
+m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$])
+AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
+AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
+AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
+
+if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
+ AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
+fi
+if test -n "$PKG_CONFIG"; then
+ _pkg_min_version=m4_default([$1], [0.9.0])
+ AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
+ if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
+ AC_MSG_RESULT([yes])
+ else
+ AC_MSG_RESULT([no])
+ PKG_CONFIG=""
+ fi
+fi[]dnl
+])# PKG_PROG_PKG_CONFIG
+
+# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
+#
+# Check to see whether a particular set of modules exists. Similar
+# to PKG_CHECK_MODULES(), but does not set variables or print errors.
+#
+# Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
+# only at the first occurence in configure.ac, so if the first place
+# it's called might be skipped (such as if it is within an "if", you
+# have to call PKG_CHECK_EXISTS manually
+# --------------------------------------------------------------
+AC_DEFUN([PKG_CHECK_EXISTS],
+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
+if test -n "$PKG_CONFIG" && \
+ AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
+ m4_default([$2], [:])
+m4_ifvaln([$3], [else
+ $3])dnl
+fi])
+
+# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
+# ---------------------------------------------
+m4_define([_PKG_CONFIG],
+[if test -n "$$1"; then
+ pkg_cv_[]$1="$$1"
+ elif test -n "$PKG_CONFIG"; then
+ PKG_CHECK_EXISTS([$3],
+ [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`
+ test "x$?" != "x0" && pkg_failed=yes ],
+ [pkg_failed=yes])
+ else
+ pkg_failed=untried
+fi[]dnl
+])# _PKG_CONFIG
+
+# _PKG_SHORT_ERRORS_SUPPORTED
+# -----------------------------
+AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
+ _pkg_short_errors_supported=yes
+else
+ _pkg_short_errors_supported=no
+fi[]dnl
+])# _PKG_SHORT_ERRORS_SUPPORTED
+
-# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
+# [ACTION-IF-NOT-FOUND])
+#
+#
+# Note that if there is a possibility the first call to
+# PKG_CHECK_MODULES might not happen, you should be sure to include an
+# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
+#
+#
+# --------------------------------------------------------------
+AC_DEFUN([PKG_CHECK_MODULES],
+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
+AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
+AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
+
+pkg_failed=no
+AC_MSG_CHECKING([for $1])
+
+_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
+_PKG_CONFIG([$1][_LIBS], [libs], [$2])
+
+m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
+and $1[]_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details.])
+
+if test $pkg_failed = yes; then
+ AC_MSG_RESULT([no])
+ _PKG_SHORT_ERRORS_SUPPORTED
+ if test $_pkg_short_errors_supported = yes; then
+ $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1`
+ else
+ $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1`
+ fi
+ # Put the nasty error message in config.log where it belongs
+ echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
+
+ m4_default([$4], [AC_MSG_ERROR(
+[Package requirements ($2) were not met:
+
+$$1_PKG_ERRORS
+
+Consider adjusting the PKG_CONFIG_PATH environment variable if you
+installed software in a non-standard prefix.
+
+_PKG_TEXT])[]dnl
+ ])
+elif test $pkg_failed = untried; then
+ AC_MSG_RESULT([no])
+ m4_default([$4], [AC_MSG_FAILURE(
+[The pkg-config script could not be found or is too old. Make sure it
+is in your PATH or set the PKG_CONFIG environment variable to the full
+path to pkg-config.
+
+_PKG_TEXT
+
+To get pkg-config, see <http://pkg-config.freedesktop.org/>.])[]dnl
+ ])
+else
+ $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
+ $1[]_LIBS=$pkg_cv_[]$1[]_LIBS
+ AC_MSG_RESULT([yes])
+ $3
+fi[]dnl
+])# PKG_CHECK_MODULES
+
+
+# PKG_INSTALLDIR(DIRECTORY)
+# -------------------------
+# Substitutes the variable pkgconfigdir as the location where a module
+# should install pkg-config .pc files. By default the directory is
+# $libdir/pkgconfig, but the default can be changed by passing
+# DIRECTORY. The user can override through the --with-pkgconfigdir
+# parameter.
+AC_DEFUN([PKG_INSTALLDIR],
+[m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])])
+m4_pushdef([pkg_description],
+ [pkg-config installation directory @<:@]pkg_default[@:>@])
+AC_ARG_WITH([pkgconfigdir],
+ [AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],,
+ [with_pkgconfigdir=]pkg_default)
+AC_SUBST([pkgconfigdir], [$with_pkgconfigdir])
+m4_popdef([pkg_default])
+m4_popdef([pkg_description])
+]) dnl PKG_INSTALLDIR
+
+
+# PKG_NOARCH_INSTALLDIR(DIRECTORY)
+# -------------------------
+# Substitutes the variable noarch_pkgconfigdir as the location where a
+# module should install arch-independent pkg-config .pc files. By
+# default the directory is $datadir/pkgconfig, but the default can be
+# changed by passing DIRECTORY. The user can override through the
+# --with-noarch-pkgconfigdir parameter.
+AC_DEFUN([PKG_NOARCH_INSTALLDIR],
+[m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])])
+m4_pushdef([pkg_description],
+ [pkg-config arch-independent installation directory @<:@]pkg_default[@:>@])
+AC_ARG_WITH([noarch-pkgconfigdir],
+ [AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],,
+ [with_noarch_pkgconfigdir=]pkg_default)
+AC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir])
+m4_popdef([pkg_default])
+m4_popdef([pkg_description])
+]) dnl PKG_NOARCH_INSTALLDIR
+
+
+# PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE,
+# [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
+# -------------------------------------------
+# Retrieves the value of the pkg-config variable for the given module.
+AC_DEFUN([PKG_CHECK_VAR],
+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
+AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl
+
+_PKG_CONFIG([$1], [variable="][$3]["], [$2])
+AS_VAR_COPY([$1], [pkg_cv_][$1])
+
+AS_VAR_IF([$1], [""], [$5], [$4])dnl
+])# PKG_CHECK_VAR
+
+# Copyright (C) 2002-2013 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -31,10 +247,10 @@ To do so, use the procedure documented by the package, typically `autoreconf'.])
# generated from the m4 files accompanying Automake X.Y.
# (This private macro should not be called outside this file.)
AC_DEFUN([AM_AUTOMAKE_VERSION],
-[am__api_version='1.11'
+[am__api_version='1.14'
dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
dnl require some minimum version. Point them to the right macro.
-m4_if([$1], [1.11.1], [],
+m4_if([$1], [1.14.1], [],
[AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
])
@@ -50,22 +266,22 @@ m4_define([_AM_AUTOCONF_VERSION], [])
# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
-[AM_AUTOMAKE_VERSION([1.11.1])dnl
+[AM_AUTOMAKE_VERSION([1.14.1])dnl
m4_ifndef([AC_AUTOCONF_VERSION],
[m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
# AM_AUX_DIR_EXPAND -*- Autoconf -*-
-# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
+# Copyright (C) 2001-2013 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.
# 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/../..'.
+# $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
@@ -84,7 +300,7 @@ _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
#
# 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
+# 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,
@@ -110,22 +326,19 @@ am_aux_dir=`cd $ac_aux_dir && pwd`
# AM_CONDITIONAL -*- Autoconf -*-
-# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008
-# Free Software Foundation, Inc.
+# Copyright (C) 1997-2013 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.
-# serial 9
-
# AM_CONDITIONAL(NAME, SHELL-CONDITION)
# -------------------------------------
# Define a conditional.
AC_DEFUN([AM_CONDITIONAL],
-[AC_PREREQ(2.52)dnl
- ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])],
- [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
+[AC_PREREQ([2.52])dnl
+ m4_if([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])],
+ [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
AC_SUBST([$1_TRUE])dnl
AC_SUBST([$1_FALSE])dnl
_AM_SUBST_NOTMAKE([$1_TRUE])dnl
@@ -144,16 +357,14 @@ AC_CONFIG_COMMANDS_PRE(
Usually this means the macro was only invoked conditionally.]])
fi])])
-# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009
-# Free Software Foundation, Inc.
+# Copyright (C) 1999-2013 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.
-# serial 10
-# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
+# 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
@@ -163,7 +374,7 @@ fi])])
# _AM_DEPENDENCIES(NAME)
# ----------------------
# See how the compiler implements dependency checking.
-# NAME is "CC", "CXX", "GCJ", or "OBJC".
+# NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC".
# 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
@@ -176,12 +387,13 @@ 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], UPC, [depcc="$UPC" am_compiler_list=],
- [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'],
- [depcc="$$1" am_compiler_list=])
+m4_if([$1], [CC], [depcc="$CC" am_compiler_list=],
+ [$1], [CXX], [depcc="$CXX" am_compiler_list=],
+ [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
+ [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'],
+ [$1], [UPC], [depcc="$UPC" am_compiler_list=],
+ [$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],
@@ -189,8 +401,9 @@ AC_CACHE_CHECK([dependency style of $depcc],
# 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'.
+ # making a dummy file named 'D' -- because '-MD' means "put the output
+ # in D".
+ rm -rf conftest.dir
mkdir conftest.dir
# Copy depcomp to subdir because otherwise we won't find it if we're
# using a relative directory.
@@ -229,16 +442,16 @@ AC_CACHE_CHECK([dependency style of $depcc],
: > sub/conftest.c
for i in 1 2 3 4 5 6; do
echo '#include "conftst'$i'.h"' >> sub/conftest.c
- # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
- # Solaris 8's {/usr,}/bin/sh.
- touch sub/conftst$i.h
+ # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
+ # Solaris 10 /bin/sh.
+ echo '/* dummy */' > sub/conftst$i.h
done
echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
- # We check with `-c' and `-o' for the sake of the "dashmstdout"
+ # 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. Also, some Intel
- # versions had trouble with output in subdirs
+ # handle '-M -o', and we need to detect this. Also, some Intel
+ # versions had trouble with output in subdirs.
am__obj=sub/conftest.${OBJEXT-o}
am__minus_obj="-o $am__obj"
case $depmode in
@@ -247,16 +460,16 @@ AC_CACHE_CHECK([dependency style of $depcc],
test "$am__universal" = false || continue
;;
nosideeffect)
- # after this tag, mechanisms are not by side-effect, so they'll
- # only be used when explicitly requested
+ # 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
;;
- msvisualcpp | msvcmsys)
- # This compiler won't grok `-c -o', but also, the minuso test has
+ msvc7 | msvc7msys | msvisualcpp | msvcmsys)
+ # This compiler won't grok '-c -o', but also, the minuso test has
# not run yet. These depmodes are late enough in the game, and
# so weak that their functioning should not be impacted.
am__obj=conftest.${OBJEXT-o}
@@ -304,7 +517,7 @@ AM_CONDITIONAL([am__fastdep$1], [
# AM_SET_DEPDIR
# -------------
# Choose a directory name for dependency files.
-# This macro is AC_REQUIREd in _AM_DEPENDENCIES
+# This macro is AC_REQUIREd in _AM_DEPENDENCIES.
AC_DEFUN([AM_SET_DEPDIR],
[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
@@ -314,34 +527,39 @@ AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
# AM_DEP_TRACK
# ------------
AC_DEFUN([AM_DEP_TRACK],
-[AC_ARG_ENABLE(dependency-tracking,
-[ --disable-dependency-tracking speeds up one-time build
- --enable-dependency-tracking do not reject slow dependency extractors])
+[AC_ARG_ENABLE([dependency-tracking], [dnl
+AS_HELP_STRING(
+ [--enable-dependency-tracking],
+ [do not reject slow dependency extractors])
+AS_HELP_STRING(
+ [--disable-dependency-tracking],
+ [speeds up one-time build])])
if test "x$enable_dependency_tracking" != xno; then
am_depcomp="$ac_aux_dir/depcomp"
AMDEPBACKSLASH='\'
+ am__nodep='_no'
fi
AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
AC_SUBST([AMDEPBACKSLASH])dnl
_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
+AC_SUBST([am__nodep])dnl
+_AM_SUBST_NOTMAKE([am__nodep])dnl
])
# Generate code to set up dependency tracking. -*- Autoconf -*-
-# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008
-# Free Software Foundation, Inc.
+# Copyright (C) 1999-2013 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.
-#serial 5
# _AM_OUTPUT_DEPENDENCY_COMMANDS
# ------------------------------
AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
[{
- # Autoconf 2.62 quotes --file arguments for eval, but not when files
+ # Older Autoconf quotes --file arguments for eval, but not when files
# are listed without --file. Let's play safe and only enable the eval
# if we detect the quoting.
case $CONFIG_FILES in
@@ -354,7 +572,7 @@ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
# 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
+ # 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.
@@ -366,21 +584,19 @@ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
continue
fi
# Extract the definition of DEPDIR, am__include, and am__quote
- # from the Makefile without running `make'.
+ # from the Makefile without running 'make'.
DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
test -z "$DEPDIR" && continue
am__include=`sed -n 's/^am__include = //p' < "$mf"`
- test -z "am__include" && continue
+ test -z "$am__include" && continue
am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
- # When using ansi2knr, U may be empty or an underscore; expand it
- U=`sed -n 's/^U = //p' < "$mf"`
# Find all dependency output files, they are included files with
# $(DEPDIR) in their names. 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 "
s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
- sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
+ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do
# Make sure the directory exists.
test -f "$dirpart/$file" && continue
fdir=`AS_DIRNAME(["$file"])`
@@ -398,7 +614,7 @@ AC_DEFUN([_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
+# 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],
@@ -408,18 +624,21 @@ AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
# Do all the work for Automake. -*- Autoconf -*-
-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
-# 2005, 2006, 2008, 2009 Free Software Foundation, Inc.
+# Copyright (C) 1996-2013 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.
-# serial 16
-
# 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.
+dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O.
+m4_define([AC_PROG_CC],
+m4_defn([AC_PROG_CC])
+[_AM_PROG_CC_C_O
+])
+
# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
# AM_INIT_AUTOMAKE([OPTIONS])
# -----------------------------------------------
@@ -432,7 +651,7 @@ AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
# arguments mandatory, and then we can depend on a new Autoconf
# release and drop the old call support.
AC_DEFUN([AM_INIT_AUTOMAKE],
-[AC_PREREQ([2.62])dnl
+[AC_PREREQ([2.65])dnl
dnl Autoconf wants to disallow AM_ names. We explicitly allow
dnl the ones we care about.
m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
@@ -461,31 +680,40 @@ 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_DIAGNOSE([obsolete],
+ [$0: two- and three-arguments forms are deprecated.])
+m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
AC_SUBST([PACKAGE], [$1])dnl
AC_SUBST([VERSION], [$2])],
[_AM_SET_OPTIONS([$1])dnl
dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
-m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
+m4_if(
+ m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]),
+ [ok:ok],,
[m4_fatal([AC_INIT should be called with package and version arguments])])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
+[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([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])
AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
-AC_REQUIRE([AM_PROG_MKDIR_P])dnl
+AC_REQUIRE([AC_PROG_MKDIR_P])dnl
+# For better backward compatibility. To be removed once Automake 1.9.x
+# dies out for good. For more background, see:
+# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
+# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
+AC_SUBST([mkdir_p], ['$(MKDIR_P)'])
# We need awk for the "check" target. The system "awk" is bad on
# some platforms.
AC_REQUIRE([AC_PROG_AWK])dnl
@@ -496,34 +724,78 @@ _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
[_AM_PROG_TAR([v7])])])
_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
+ [_AM_DEPENDENCIES([CC])],
+ [m4_define([AC_PROG_CC],
+ m4_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
+ [_AM_DEPENDENCIES([CXX])],
+ [m4_define([AC_PROG_CXX],
+ m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl
AC_PROVIDE_IFELSE([AC_PROG_OBJC],
- [_AM_DEPENDENCIES(OBJC)],
- [define([AC_PROG_OBJC],
- defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
+ [_AM_DEPENDENCIES([OBJC])],
+ [m4_define([AC_PROG_OBJC],
+ m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl
+AC_PROVIDE_IFELSE([AC_PROG_OBJCXX],
+ [_AM_DEPENDENCIES([OBJCXX])],
+ [m4_define([AC_PROG_OBJCXX],
+ m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl
])
-_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl
-dnl The `parallel-tests' driver may need to know about EXEEXT, so add the
-dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This macro
-dnl is hooked onto _AC_COMPILER_EXEEXT early, see below.
+AC_REQUIRE([AM_SILENT_RULES])dnl
+dnl The testsuite driver may need to know about EXEEXT, so add the
+dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This
+dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below.
AC_CONFIG_COMMANDS_PRE(dnl
[m4_provide_if([_AM_COMPILER_EXEEXT],
[AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
-])
-dnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion. Do not
+# POSIX will say in a future version that running "rm -f" with no argument
+# is OK; and we want to be able to make that assumption in our Makefile
+# recipes. So use an aggressive probe to check that the usage we want is
+# actually supported "in the wild" to an acceptable degree.
+# See automake bug#10828.
+# To make any issue more visible, cause the running configure to be aborted
+# by default if the 'rm' program in use doesn't match our expectations; the
+# user can still override this though.
+if rm -f && rm -fr && rm -rf; then : OK; else
+ cat >&2 <<'END'
+Oops!
+
+Your 'rm' program seems unable to run without file operands specified
+on the command line, even when the '-f' option is present. This is contrary
+to the behaviour of most rm programs out there, and not conforming with
+the upcoming POSIX standard: <http://austingroupbugs.net/view.php?id=542>
+
+Please tell bug-automake@gnu.org about your system, including the value
+of your $PATH and any error possibly output before this message. This
+can help us improve future automake versions.
+
+END
+ if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then
+ echo 'Configuration will proceed anyway, since you have set the' >&2
+ echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2
+ echo >&2
+ else
+ cat >&2 <<'END'
+Aborting the configuration process, to ensure you take notice of the issue.
+
+You can download and install GNU coreutils to get an 'rm' implementation
+that behaves properly: <http://www.gnu.org/software/coreutils/>.
+
+If you want to complete the configuration process using your problematic
+'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
+to "yes", and re-run configure.
+
+END
+ AC_MSG_ERROR([Your 'rm' program is bad, sorry.])
+ fi
+fi])
+
+dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not
dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
dnl mangled by Autoconf and run in a shell conditional statement.
m4_define([_AC_COMPILER_EXEEXT],
m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
-
# 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.
@@ -545,7 +817,7 @@ for _am_header in $config_headers :; do
done
echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
-# Copyright (C) 2001, 2003, 2005, 2008 Free Software Foundation, Inc.
+# Copyright (C) 2001-2013 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -564,16 +836,14 @@ if test x"${install_sh}" != xset; then
install_sh="\${SHELL} $am_aux_dir/install-sh"
esac
fi
-AC_SUBST(install_sh)])
+AC_SUBST([install_sh])])
-# Copyright (C) 2003, 2005 Free Software Foundation, Inc.
+# Copyright (C) 2003-2013 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.
-# serial 2
-
# Check whether the underlying file-system supports filenames
# with a leading dot. For instance MS-DOS doesn't.
AC_DEFUN([AM_SET_LEADING_DOT],
@@ -589,14 +859,12 @@ AC_SUBST([am__leading_dot])])
# Check to see how 'make' treats includes. -*- Autoconf -*-
-# Copyright (C) 2001, 2002, 2003, 2005, 2009 Free Software Foundation, Inc.
+# Copyright (C) 2001-2013 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.
-# serial 4
-
# AM_MAKE_INCLUDE()
# -----------------
# Check to see how make treats includes.
@@ -614,7 +882,7 @@ am__quote=
_am_result=none
# First try GNU make style include.
echo "include confinc" > confmf
-# Ignore all kinds of additional output from `make'.
+# Ignore all kinds of additional output from 'make'.
case `$am_make -s -f confmf 2> /dev/null` in #(
*the\ am__doit\ target*)
am__include=include
@@ -641,15 +909,12 @@ rm -f confinc confmf
# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
-# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008
-# Free Software Foundation, Inc.
+# Copyright (C) 1997-2013 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.
-# serial 6
-
# AM_MISSING_PROG(NAME, PROGRAM)
# ------------------------------
AC_DEFUN([AM_MISSING_PROG],
@@ -657,11 +922,10 @@ AC_DEFUN([AM_MISSING_PROG],
$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.
+# Define MISSING if not defined so far and test if it is modern enough.
+# If it is, set am_missing_run to use it, otherwise, to nothing.
AC_DEFUN([AM_MISSING_HAS_RUN],
[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
AC_REQUIRE_AUX_FILE([missing])dnl
@@ -674,63 +938,35 @@ if test x"${MISSING+set}" != xset; then
esac
fi
# Use eval to expand $SHELL
-if eval "$MISSING --run true"; then
- am_missing_run="$MISSING --run "
+if eval "$MISSING --is-lightweight"; then
+ am_missing_run="$MISSING "
else
am_missing_run=
- AC_MSG_WARN([`missing' script is too old or missing])
+ AC_MSG_WARN(['missing' script is too old or missing])
fi
])
-# Copyright (C) 2003, 2004, 2005, 2006 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.
-
-# AM_PROG_MKDIR_P
-# ---------------
-# Check for `mkdir -p'.
-AC_DEFUN([AM_PROG_MKDIR_P],
-[AC_PREREQ([2.60])dnl
-AC_REQUIRE([AC_PROG_MKDIR_P])dnl
-dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P,
-dnl while keeping a definition of mkdir_p for backward compatibility.
-dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
-dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
-dnl Makefile.ins that do not define MKDIR_P, so we do our own
-dnl adjustment using top_builddir (which is defined more often than
-dnl MKDIR_P).
-AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
-case $mkdir_p in
- [[\\/$]]* | ?:[[\\/]]*) ;;
- */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
-esac
-])
-
# Helper functions for option handling. -*- Autoconf -*-
-# Copyright (C) 2001, 2002, 2003, 2005, 2008 Free Software Foundation, Inc.
+# Copyright (C) 2001-2013 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.
-# serial 4
-
# _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)])
+[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],
[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
@@ -741,24 +977,82 @@ AC_DEFUN([_AM_SET_OPTIONS],
AC_DEFUN([_AM_IF_OPTION],
[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
-# Check to make sure that the build environment is sane. -*- Autoconf -*-
+# Copyright (C) 1999-2013 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.
+
+# _AM_PROG_CC_C_O
+# ---------------
+# Like AC_PROG_CC_C_O, but changed for automake. We rewrite AC_PROG_CC
+# to automatically call this.
+AC_DEFUN([_AM_PROG_CC_C_O],
+[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+AC_REQUIRE_AUX_FILE([compile])dnl
+AC_LANG_PUSH([C])dnl
+AC_CACHE_CHECK(
+ [whether $CC understands -c and -o together],
+ [am_cv_prog_cc_c_o],
+ [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])])
+ # Make sure it works both with $CC and with simple cc.
+ # Following AC_PROG_CC_C_O, we do the test twice because some
+ # compilers refuse to overwrite an existing .o file with -o,
+ # though they will create one.
+ am_cv_prog_cc_c_o=yes
+ for am_i in 1 2; do
+ if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \
+ && test -f conftest2.$ac_objext; then
+ : OK
+ else
+ am_cv_prog_cc_c_o=no
+ break
+ fi
+ done
+ rm -f core conftest*
+ unset am_i])
+if test "$am_cv_prog_cc_c_o" != yes; then
+ # Losing compiler, so override with the script.
+ # FIXME: It is wrong to rewrite CC.
+ # But if we don't then we get into trouble of one sort or another.
+ # A longer-term fix would be to have automake use am__CC in this case,
+ # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
+ CC="$am_aux_dir/compile $CC"
+fi
+AC_LANG_POP([C])])
-# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008
-# Free Software Foundation, Inc.
+# For backward compatibility.
+AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])])
+
+# Copyright (C) 2001-2013 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.
-# serial 5
+# AM_RUN_LOG(COMMAND)
+# -------------------
+# Run COMMAND, save the exit status in ac_status, and log it.
+# (This has been adapted from Autoconf's _AC_RUN_LOG macro.)
+AC_DEFUN([AM_RUN_LOG],
+[{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD
+ ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
+ (exit $ac_status); }])
+
+# Check to make sure that the build environment is sane. -*- Autoconf -*-
+
+# Copyright (C) 1996-2013 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.
# 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
# Reject unsafe characters in $srcdir or the absolute working directory
# name. Accept space and tab only in the latter.
am_lf='
@@ -769,32 +1063,40 @@ case `pwd` in
esac
case $srcdir in
*[[\\\"\#\$\&\'\`$am_lf\ \ ]]*)
- AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);;
+ AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);;
esac
-# Do `set' in a subshell so we don't clobber the current shell's
+# 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
-
+ am_has_slept=no
+ for am_try in 1 2; do
+ echo "timestamp, slept: $am_has_slept" > conftest.file
+ 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
+ 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
+ if test "$[2]" = conftest.file || test $am_try -eq 2; then
+ break
+ fi
+ # Just in case.
+ sleep 1
+ am_has_slept=yes
+ done
test "$[2]" = conftest.file
)
then
@@ -804,9 +1106,85 @@ else
AC_MSG_ERROR([newly created file is older than distributed files!
Check your system clock])
fi
-AC_MSG_RESULT(yes)])
+AC_MSG_RESULT([yes])
+# If we didn't sleep, we still need to ensure time stamps of config.status and
+# generated files are strictly newer.
+am_sleep_pid=
+if grep 'slept: no' conftest.file >/dev/null 2>&1; then
+ ( sleep 1 ) &
+ am_sleep_pid=$!
+fi
+AC_CONFIG_COMMANDS_PRE(
+ [AC_MSG_CHECKING([that generated files are newer than configure])
+ if test -n "$am_sleep_pid"; then
+ # Hide warnings about reused PIDs.
+ wait $am_sleep_pid 2>/dev/null
+ fi
+ AC_MSG_RESULT([done])])
+rm -f conftest.file
+])
-# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
+# Copyright (C) 2009-2013 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.
+
+# AM_SILENT_RULES([DEFAULT])
+# --------------------------
+# Enable less verbose build rules; with the default set to DEFAULT
+# ("yes" being less verbose, "no" or empty being verbose).
+AC_DEFUN([AM_SILENT_RULES],
+[AC_ARG_ENABLE([silent-rules], [dnl
+AS_HELP_STRING(
+ [--enable-silent-rules],
+ [less verbose build output (undo: "make V=1")])
+AS_HELP_STRING(
+ [--disable-silent-rules],
+ [verbose build output (undo: "make V=0")])dnl
+])
+case $enable_silent_rules in @%:@ (((
+ yes) AM_DEFAULT_VERBOSITY=0;;
+ no) AM_DEFAULT_VERBOSITY=1;;
+ *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
+esac
+dnl
+dnl A few 'make' implementations (e.g., NonStop OS and NextStep)
+dnl do not support nested variable expansions.
+dnl See automake bug#9928 and bug#10237.
+am_make=${MAKE-make}
+AC_CACHE_CHECK([whether $am_make supports nested variables],
+ [am_cv_make_support_nested_variables],
+ [if AS_ECHO([['TRUE=$(BAR$(V))
+BAR0=false
+BAR1=true
+V=1
+am__doit:
+ @$(TRUE)
+.PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then
+ am_cv_make_support_nested_variables=yes
+else
+ am_cv_make_support_nested_variables=no
+fi])
+if test $am_cv_make_support_nested_variables = yes; then
+ dnl Using '$V' instead of '$(V)' breaks IRIX make.
+ AM_V='$(V)'
+ AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
+else
+ AM_V=$AM_DEFAULT_VERBOSITY
+ AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
+fi
+AC_SUBST([AM_V])dnl
+AM_SUBST_NOTMAKE([AM_V])dnl
+AC_SUBST([AM_DEFAULT_V])dnl
+AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl
+AC_SUBST([AM_DEFAULT_VERBOSITY])dnl
+AM_BACKSLASH='\'
+AC_SUBST([AM_BACKSLASH])dnl
+_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
+])
+
+# Copyright (C) 2001-2013 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -814,34 +1192,32 @@ AC_MSG_RESULT(yes)])
# AM_PROG_INSTALL_STRIP
# ---------------------
-# One issue with vendor `install' (even GNU) is that you can't
+# 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
+# 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
+# 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'.
+# 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="\$(install_sh) -c -s"
AC_SUBST([INSTALL_STRIP_PROGRAM])])
-# Copyright (C) 2006, 2008 Free Software Foundation, Inc.
+# Copyright (C) 2006-2013 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.
-# serial 2
-
# _AM_SUBST_NOTMAKE(VARIABLE)
# ---------------------------
# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
@@ -849,24 +1225,22 @@ AC_SUBST([INSTALL_STRIP_PROGRAM])])
AC_DEFUN([_AM_SUBST_NOTMAKE])
# AM_SUBST_NOTMAKE(VARIABLE)
-# ---------------------------
+# --------------------------
# Public sister of _AM_SUBST_NOTMAKE.
AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
# Check how to create a tarball. -*- Autoconf -*-
-# Copyright (C) 2004, 2005 Free Software Foundation, Inc.
+# Copyright (C) 2004-2013 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.
-# serial 2
-
# _AM_PROG_TAR(FORMAT)
# --------------------
# Check how to create a tarball in format FORMAT.
-# FORMAT should be one of `v7', `ustar', or `pax'.
+# FORMAT should be one of 'v7', 'ustar', or 'pax'.
#
# Substitute a variable $(am__tar) that is a command
# writing to stdout a FORMAT-tarball containing the directory
@@ -876,75 +1250,114 @@ AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
# Substitute a variable $(am__untar) that extract such
# a tarball read from stdin.
# $(am__untar) < result.tar
+#
AC_DEFUN([_AM_PROG_TAR],
-[# Always define AMTAR for backward compatibility.
-AM_MISSING_PROG([AMTAR], [tar])
-m4_if([$1], [v7],
- [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
- [m4_case([$1], [ustar],, [pax],,
- [m4_fatal([Unknown tar format])])
-AC_MSG_CHECKING([how to create a $1 tar archive])
-# Loop over all known methods to create a tar archive until one works.
+[# Always define AMTAR for backward compatibility. Yes, it's still used
+# in the wild :-( We should find a proper way to deprecate it ...
+AC_SUBST([AMTAR], ['$${TAR-tar}'])
+
+# We'll loop over all known methods to create a tar archive until one works.
_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
-_am_tools=${am_cv_prog_tar_$1-$_am_tools}
-# Do not fold the above two line into one, because Tru64 sh and
-# Solaris sh will not grok spaces in the rhs of `-'.
-for _am_tool in $_am_tools
-do
- case $_am_tool in
- gnutar)
- for _am_tar in tar gnutar gtar;
- do
- AM_RUN_LOG([$_am_tar --version]) && break
- done
- am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
- am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
- am__untar="$_am_tar -xf -"
- ;;
- plaintar)
- # Must skip GNU tar: if it does not support --format= it doesn't create
- # ustar tarball either.
- (tar --version) >/dev/null 2>&1 && continue
- am__tar='tar chf - "$$tardir"'
- am__tar_='tar chf - "$tardir"'
- am__untar='tar xf -'
- ;;
- pax)
- am__tar='pax -L -x $1 -w "$$tardir"'
- am__tar_='pax -L -x $1 -w "$tardir"'
- am__untar='pax -r'
- ;;
- cpio)
- am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
- am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
- am__untar='cpio -i -H $1 -d'
- ;;
- none)
- am__tar=false
- am__tar_=false
- am__untar=false
- ;;
- esac
- # If the value was cached, stop now. We just wanted to have am__tar
- # and am__untar set.
- test -n "${am_cv_prog_tar_$1}" && break
+m4_if([$1], [v7],
+ [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'],
+
+ [m4_case([$1],
+ [ustar],
+ [# The POSIX 1988 'ustar' format is defined with fixed-size fields.
+ # There is notably a 21 bits limit for the UID and the GID. In fact,
+ # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343
+ # and bug#13588).
+ am_max_uid=2097151 # 2^21 - 1
+ am_max_gid=$am_max_uid
+ # The $UID and $GID variables are not portable, so we need to resort
+ # to the POSIX-mandated id(1) utility. Errors in the 'id' calls
+ # below are definitely unexpected, so allow the users to see them
+ # (that is, avoid stderr redirection).
+ am_uid=`id -u || echo unknown`
+ am_gid=`id -g || echo unknown`
+ AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format])
+ if test $am_uid -le $am_max_uid; then
+ AC_MSG_RESULT([yes])
+ else
+ AC_MSG_RESULT([no])
+ _am_tools=none
+ fi
+ AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format])
+ if test $am_gid -le $am_max_gid; then
+ AC_MSG_RESULT([yes])
+ else
+ AC_MSG_RESULT([no])
+ _am_tools=none
+ fi],
+
+ [pax],
+ [],
+
+ [m4_fatal([Unknown tar format])])
+
+ AC_MSG_CHECKING([how to create a $1 tar archive])
+
+ # Go ahead even if we have the value already cached. We do so because we
+ # need to set the values for the 'am__tar' and 'am__untar' variables.
+ _am_tools=${am_cv_prog_tar_$1-$_am_tools}
+
+ for _am_tool in $_am_tools; do
+ case $_am_tool in
+ gnutar)
+ for _am_tar in tar gnutar gtar; do
+ AM_RUN_LOG([$_am_tar --version]) && break
+ done
+ am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
+ am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
+ am__untar="$_am_tar -xf -"
+ ;;
+ plaintar)
+ # Must skip GNU tar: if it does not support --format= it doesn't create
+ # ustar tarball either.
+ (tar --version) >/dev/null 2>&1 && continue
+ am__tar='tar chf - "$$tardir"'
+ am__tar_='tar chf - "$tardir"'
+ am__untar='tar xf -'
+ ;;
+ pax)
+ am__tar='pax -L -x $1 -w "$$tardir"'
+ am__tar_='pax -L -x $1 -w "$tardir"'
+ am__untar='pax -r'
+ ;;
+ cpio)
+ am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
+ am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
+ am__untar='cpio -i -H $1 -d'
+ ;;
+ none)
+ am__tar=false
+ am__tar_=false
+ am__untar=false
+ ;;
+ esac
- # tar/untar a dummy directory, and stop if the command works
- rm -rf conftest.dir
- mkdir conftest.dir
- echo GrepMe > conftest.dir/file
- AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
+ # If the value was cached, stop now. We just wanted to have am__tar
+ # and am__untar set.
+ test -n "${am_cv_prog_tar_$1}" && break
+
+ # tar/untar a dummy directory, and stop if the command works.
+ rm -rf conftest.dir
+ mkdir conftest.dir
+ echo GrepMe > conftest.dir/file
+ AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
+ rm -rf conftest.dir
+ if test -s conftest.tar; then
+ AM_RUN_LOG([$am__untar <conftest.tar])
+ AM_RUN_LOG([cat conftest.dir/file])
+ grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
+ fi
+ done
rm -rf conftest.dir
- if test -s conftest.tar; then
- AM_RUN_LOG([$am__untar <conftest.tar])
- grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
- fi
-done
-rm -rf conftest.dir
-AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
-AC_MSG_RESULT([$am_cv_prog_tar_$1])])
+ AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
+ AC_MSG_RESULT([$am_cv_prog_tar_$1])])
+
AC_SUBST([am__tar])
AC_SUBST([am__untar])
]) # _AM_PROG_TAR
diff --git a/cairo.c b/cairo.c
new file mode 100644
index 0000000..828e122
--- /dev/null
+++ b/cairo.c
@@ -0,0 +1,1415 @@
+/*-------------------------------------------------------------------------*/
+/* cairo.c --- mainly cairo versions of the UDraw... stuff in functions.c */
+/* Copyright (c) 2002 Tim Edwards, Johns Hopkins University */
+/*-------------------------------------------------------------------------*/
+/*-------------------------------------------------------------------------*/
+/* originally written by Tim Edwards, 8/13/93 */
+/* All cairo graphics library modifications by Erik van der Wal, May 2014 */
+/*-------------------------------------------------------------------------*/
+
+#ifdef HAVE_CAIRO
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <stdint.h>
+#include <assert.h>
+#include <math.h>
+#include <limits.h>
+
+#ifndef XC_WIN32
+#include <X11/Intrinsic.h>
+#endif
+
+#ifdef TCL_WRAPPER
+#include <tk.h>
+#endif /* TCL_WRAPPER */
+
+#include "xcircuit.h"
+#include "colordefs.h"
+#include "prototypes.h"
+
+#ifdef CAIRO_HAS_FC_FONT
+#include <cairo/cairo-ft.h>
+#endif /* CAIRO_HAS_FC_FONT */
+
+#ifdef HAVE_GS
+#include <ghostscript/ierrors.h>
+#include <ghostscript/iapi.h>
+#include <ghostscript/gdevdsp.h>
+#endif /* HAVE_GS */
+
+extern XCWindowData *areawin;
+extern Globaldata xobjs;
+extern int number_colors;
+extern colorindex *colorlist;
+extern short fontcount;
+extern fontinfo *fonts;
+extern Cursor appcursors[NUM_CURSORS];
+extern Display *dpy;
+extern gs_state_t gs_state;
+extern cairo_surface_t *bbuf;
+
+static cairo_user_data_key_t fontinfo_key;
+
+static void xc_cairo_strokepath(short style, float width);
+
+/*----------------------------------------------------------------------------*/
+
+void xc_cairo_set_matrix(const Matrix *xcm)
+{
+ cairo_matrix_t m;
+ m.xx = xcm->a; m.xy = xcm->b; m.x0 = xcm->c;
+ m.yx = xcm->d; m.yy = xcm->e; m.y0 = xcm->f;
+ cairo_set_matrix(areawin->cr, &m);
+}
+
+/*----------------------------------------------------------------------*/
+/* Set the color, based on the given color index */
+/*----------------------------------------------------------------------*/
+
+void xc_cairo_set_color(int coloridx)
+{
+ colorindex *xcc;
+
+ if (coloridx >= number_colors) return;
+
+ xcc = &colorlist[coloridx];
+ cairo_set_source_rgb(areawin->cr,
+ (double)xcc->color.red / 65535.,
+ (double)xcc->color.green / 65535.,
+ (double)xcc->color.blue / 65535.);
+}
+
+/*----------------------------------------------------------------------------*/
+
+void UDrawLine(XPoint *pt1, XPoint *pt2)
+{
+ if (!areawin->redraw_ongoing) {
+ areawin->redraw_needed = True;
+ return;
+ }
+
+ cairo_save(areawin->cr);
+
+ cairo_set_line_width(areawin->cr, xobjs.pagelist[areawin->page]->wirewidth);
+ cairo_set_dash(areawin->cr, NULL, 0, 0.);
+ cairo_set_line_cap(areawin->cr, CAIRO_LINE_CAP_ROUND);
+ cairo_set_line_join(areawin->cr, CAIRO_LINE_JOIN_BEVEL);
+
+ cairo_move_to(areawin->cr, pt1->x, pt1->y);
+ cairo_line_to(areawin->cr, pt2->x, pt2->y);
+ cairo_stroke(areawin->cr);
+
+ cairo_restore(areawin->cr);
+}
+
+/*----------------------------------------------------------------------*/
+/* Add circle at given point to indicate that the point is a parameter. */
+/* The circle is divided into quarters. For parameterized y-coordinate */
+/* the top and bottom quarters are drawn. For parameterized x- */
+/* coordinate, the left and right quarters are drawn. A full circle */
+/* indicates either both x- and y-coordinates are parameterized, or */
+/* else any other kind of parameterization (presently, not used). */
+/* */
+/* (note that the two angles in XDrawArc() are 1) the start angle, */
+/* measured in absolute 64th degrees from 0 (3 o'clock), and 2) the */
+/* path length, in relative 64th degrees (positive = counterclockwise, */
+/* negative = clockwise)). */
+/*----------------------------------------------------------------------*/
+
+void UDrawCircle(XPoint *upt, u_char which)
+{
+ XPoint wpt;
+
+ if (!areawin->redraw_ongoing) {
+ areawin->redraw_needed = True;
+ return;
+ }
+
+ cairo_save(areawin->cr);
+ cairo_identity_matrix(areawin->cr);
+
+ user_to_window(*upt, &wpt);
+ cairo_set_line_width(areawin->cr, .75);
+ cairo_set_dash(areawin->cr, NULL, 0, 0.);
+ cairo_set_line_cap(areawin->cr, CAIRO_LINE_CAP_BUTT);
+ cairo_set_line_join(areawin->cr, CAIRO_LINE_JOIN_MITER);
+
+ /* TODO: angles might be mirrored or turning the wrong way */
+ switch(which) {
+ case P_POSITION_X:
+ cairo_arc(areawin->cr, wpt.x, wpt.y, 4., M_PI * -.25, M_PI * .25);
+ cairo_arc(areawin->cr, wpt.x, wpt.y, 4., M_PI * .75, M_PI * 1.25);
+ break;
+ case P_POSITION_Y:
+ cairo_arc(areawin->cr, wpt.x, wpt.y, 4., M_PI * .25, M_PI * .75);
+ cairo_arc(areawin->cr, wpt.x, wpt.y, 4., M_PI * 1.25, M_PI * 1.75);
+ break;
+ default:
+ cairo_arc(areawin->cr, wpt.x, wpt.y, 4., 0., M_PI * 2.);
+ break;
+ }
+
+ cairo_restore(areawin->cr);
+}
+
+/*----------------------------------------------------------------------*/
+/* Add "X" at string origin */
+/*----------------------------------------------------------------------*/
+
+void UDrawXAt(XPoint *wpt)
+{
+ if (!areawin->redraw_ongoing) {
+ areawin->redraw_needed = True;
+ return;
+ }
+
+ cairo_save(areawin->cr);
+ cairo_identity_matrix(areawin->cr);
+
+ cairo_set_dash(areawin->cr, NULL, 0, 0.);
+ cairo_set_line_width(areawin->cr, .75);
+
+ cairo_move_to(areawin->cr, wpt->x - 3., wpt->y - 3.);
+ cairo_line_to(areawin->cr, wpt->x + 3., wpt->y + 3.);
+ cairo_move_to(areawin->cr, wpt->x + 3., wpt->y - 3.);
+ cairo_line_to(areawin->cr, wpt->x - 3., wpt->y + 3.);
+ cairo_stroke(areawin->cr);
+
+ cairo_restore(areawin->cr);
+}
+
+void UDrawXLine(XPoint opt, XPoint cpt)
+{
+ XPoint upt, vpt;
+ double dashes[] = {4., 4.};
+
+ if (!areawin->redraw_ongoing) {
+ areawin->redraw_needed = True;
+ return;
+ }
+
+ cairo_save(areawin->cr);
+ cairo_identity_matrix(areawin->cr);
+
+ xc_cairo_set_color(AUXCOLOR);
+ cairo_set_dash(areawin->cr, dashes, sizeof(dashes) / sizeof(double), 0.);
+ cairo_set_line_width(areawin->cr, .75);
+
+ user_to_window(cpt, &upt);
+ user_to_window(opt, &vpt);
+ cairo_move_to(areawin->cr, vpt.x, vpt.y);
+ cairo_line_to(areawin->cr, upt.x, upt.y);
+ cairo_stroke(areawin->cr);
+
+ cairo_set_dash(areawin->cr, NULL, 0, 0.);
+ cairo_move_to(areawin->cr, upt.x - 3., upt.y - 3.);
+ cairo_line_to(areawin->cr, upt.x + 3., upt.y + 3.);
+ cairo_move_to(areawin->cr, upt.x + 3., upt.y - 3.);
+ cairo_line_to(areawin->cr, upt.x - 3., upt.y + 3.);
+ cairo_stroke(areawin->cr);
+
+ cairo_restore(areawin->cr);
+}
+
+/*-------------------------------------------------------------------------*/
+
+void UDrawBox(XPoint origin, XPoint corner)
+{
+ XPoint worig, wcorn;
+ double r, g, b, a;
+
+ if (!areawin->redraw_ongoing) {
+ areawin->redraw_needed = True;
+ return;
+ }
+
+ user_to_window(origin, &worig);
+ user_to_window(corner, &wcorn);
+
+ cairo_save(areawin->cr);
+ cairo_identity_matrix(areawin->cr);
+
+ cairo_set_line_width(areawin->cr, 1.0);
+ cairo_set_dash(areawin->cr, NULL, 0, 0.);
+ cairo_set_line_cap(areawin->cr, CAIRO_LINE_CAP_SQUARE);
+ cairo_set_line_join(areawin->cr, CAIRO_LINE_JOIN_MITER);
+
+ cairo_move_to(areawin->cr, worig.x + .5, worig.y + .5);
+ cairo_line_to(areawin->cr, worig.x + .5, wcorn.y + .5);
+ cairo_line_to(areawin->cr, wcorn.x + .5, wcorn.y + .5);
+ cairo_line_to(areawin->cr, wcorn.x + .5, worig.y + .5);
+ cairo_close_path(areawin->cr);
+
+ xc_cairo_set_color(AUXCOLOR);
+ cairo_pattern_get_rgba(cairo_get_source(areawin->cr), &r, &g, &b, &a);
+ cairo_set_source_rgba(areawin->cr, r, g, b, .1 * a);
+ cairo_fill_preserve(areawin->cr);
+ cairo_set_source_rgba(areawin->cr, r, g, b, a);
+ cairo_stroke(areawin->cr);
+
+ cairo_restore(areawin->cr);
+}
+
+/*----------------------------------------------------------------------*/
+/* Draw a box indicating the dimensions of the edit element that most */
+/* closely reach the position "corner". */
+/*----------------------------------------------------------------------*/
+
+void UDrawRescaleBox(XPoint *corner)
+{
+ XPoint newpoints[5];
+
+ if (!areawin->redraw_ongoing) {
+ areawin->redraw_needed = True;
+ /* No return here, since the return value might be needed? */
+ }
+
+ if (areawin->selects == 0)
+ return;
+
+ if (areawin->redraw_ongoing) {
+ int i;
+ UGetRescaleBox(corner, newpoints);
+
+ cairo_save(areawin->cr);
+ xc_cairo_set_color(AUXCOLOR);
+ cairo_set_dash(areawin->cr, NULL, 0, 0.);
+ cairo_set_line_cap(areawin->cr, CAIRO_LINE_CAP_ROUND);
+ cairo_set_line_join(areawin->cr, CAIRO_LINE_JOIN_BEVEL);
+ cairo_move_to(areawin->cr, newpoints[0].x, newpoints[0].y);
+ for (i = 1; i < 4; i++)
+ cairo_line_to(areawin->cr, newpoints[i].x, newpoints[i].y);
+ xc_cairo_strokepath(0, 1);
+ cairo_restore(areawin->cr);
+ }
+}
+
+/*-------------------------------------------------------------------------*/
+
+void UDrawBBox()
+{
+ XPoint origin;
+ XPoint worig, wcorn, corner;
+ objinstptr bbinst = areawin->topinstance;
+
+ if (!areawin->redraw_ongoing) {
+ areawin->redraw_needed = True;
+ return;
+ }
+
+ if ((!areawin->bboxon) || (checkforbbox(topobject) != NULL)) return;
+
+ origin = bbinst->bbox.lowerleft;
+ corner.x = origin.x + bbinst->bbox.width;
+ corner.y = origin.y + bbinst->bbox.height;
+
+ /* Include any schematic labels in the bounding box. */
+ extendschembbox(bbinst, &origin, &corner);
+
+ user_to_window(origin, &worig);
+ user_to_window(corner, &wcorn);
+
+ cairo_save(areawin->cr);
+ cairo_identity_matrix(areawin->cr);
+
+ xc_cairo_set_color(BBOXCOLOR);
+ cairo_set_line_width(areawin->cr, 1.0);
+ cairo_set_dash(areawin->cr, NULL, 0, 0.);
+ cairo_set_line_cap(areawin->cr, CAIRO_LINE_CAP_SQUARE);
+ cairo_set_line_join(areawin->cr, CAIRO_LINE_JOIN_MITER);
+
+ cairo_move_to(areawin->cr, worig.x + .5, worig.y + .5);
+ cairo_line_to(areawin->cr, worig.x + .5, wcorn.y + .5);
+ cairo_line_to(areawin->cr, wcorn.x + .5, wcorn.y + .5);
+ cairo_line_to(areawin->cr, wcorn.x + .5, worig.y + .5);
+ cairo_close_path(areawin->cr);
+ cairo_stroke(areawin->cr);
+
+ cairo_restore(areawin->cr);
+}
+
+/*----------------------------------------------------------------------*/
+/* Main recursive object instance drawing routine. */
+/* context is the instance information passed down from above */
+/* theinstance is the object instance to be drawn */
+/* level is the level of recursion */
+/* passcolor is the inherited color value passed to object */
+/* passwidth is the inherited linewidth value passed to the object */
+/* stack contains graphics context information */
+/*----------------------------------------------------------------------*/
+
+void UDrawObject(objinstptr theinstance, short level, int passcolor,
+ float passwidth, pushlistptr *stack)
+{
+ genericptr *areagen;
+ float tmpwidth;
+ int defaultcolor = passcolor;
+ int curcolor = passcolor;
+ int thispart;
+ short savesel;
+ XPoint bboxin[2], bboxout[2];
+ u_char xm, ym;
+ objectptr theobject = theinstance->thisobject;
+
+ if (!areawin->redraw_ongoing) {
+ areawin->redraw_needed = True;
+ return;
+ }
+
+ /* Save the number of selections and set it to zero while we do the */
+ /* object drawing. */
+
+ savesel = areawin->selects;
+ areawin->selects = 0;
+
+ /* All parts are given in the coordinate system of the object, unless */
+ /* this is the top-level object, in which they will be interpreted as */
+ /* relative to the screen. */
+
+ UPushCTM();
+
+ /* Stack is not used by cairo but *is* used by expression evaluators */
+ if (stack) push_stack((pushlistptr *)stack, theinstance, (char *)NULL);
+
+ if (level != 0)
+ UPreMultCTM(DCTM, theinstance->position, theinstance->scale,
+ theinstance->rotation);
+
+ if (theinstance->style & LINE_INVARIANT)
+ passwidth /= fabs(theinstance->scale);
+
+ /* do a quick test for intersection with the display window */
+
+ bboxin[0].x = theobject->bbox.lowerleft.x;
+ bboxin[0].y = theobject->bbox.lowerleft.y;
+ bboxin[1].x = theobject->bbox.lowerleft.x + theobject->bbox.width;
+ bboxin[1].y = theobject->bbox.lowerleft.y + theobject->bbox.height;
+ if (level == 0)
+ extendschembbox(theinstance, &(bboxin[0]), &(bboxin[1]));
+ UTransformbyCTM(DCTM, bboxin, bboxout, 2);
+
+ xm = (bboxout[0].x < bboxout[1].x) ? 0 : 1;
+ ym = (bboxout[0].y < bboxout[1].y) ? 0 : 1;
+
+ if (bboxout[xm].x < areawin->width && bboxout[ym].y < areawin->height &&
+ bboxout[1 - xm].x > 0 && bboxout[1 - ym].y > 0) {
+
+ /* make parameter substitutions */
+ psubstitute(theinstance);
+
+ /* draw all of the elements */
+
+ tmpwidth = UTopTransScale(passwidth);
+ cairo_set_line_width(areawin->cr, tmpwidth);
+ cairo_set_dash(areawin->cr, NULL, 0, 0.);
+ cairo_set_line_cap(areawin->cr, CAIRO_LINE_CAP_ROUND);
+ cairo_set_line_join(areawin->cr, CAIRO_LINE_JOIN_BEVEL);
+
+ /* guard against plist being regenerated during a redraw by the */
+ /* expression parameter mechanism (should that be prohibited?) */
+
+ for (thispart = 0; thispart < theobject->parts; thispart++) {
+ areagen = theobject->plist + thispart;
+ if ((*areagen)->type & DRAW_HIDE) continue;
+
+ if (defaultcolor != DOFORALL) {
+ if ((*areagen)->color != curcolor) {
+ if ((*areagen)->color == DEFAULTCOLOR)
+ curcolor = defaultcolor;
+ else
+ curcolor = (*areagen)->color;
+
+ XcTopSetForeground(curcolor);
+ }
+ }
+
+ switch(ELEMENTTYPE(*areagen)) {
+ case(POLYGON):
+ if (level == 0 || !((TOPOLY(areagen))->style & BBOX))
+ UDrawPolygon(TOPOLY(areagen), passwidth);
+ break;
+
+ case(SPLINE):
+ UDrawSpline(TOSPLINE(areagen), passwidth);
+ break;
+
+ case(ARC):
+ UDrawArc(TOARC(areagen), passwidth);
+ break;
+
+ case(PATH):
+ UDrawPath(TOPATH(areagen), passwidth);
+ break;
+
+ case(GRAPHIC):
+ UDrawGraphic(TOGRAPHIC(areagen));
+ break;
+
+ case(OBJINST):
+ UDrawObject(TOOBJINST(areagen), level + 1, curcolor, passwidth, stack);
+ break;
+
+ case(LABEL):
+ if (level == 0 || TOLABEL(areagen)->pin == False)
+ UDrawString(TOLABEL(areagen), curcolor, theinstance);
+ else if ((TOLABEL(areagen)->anchor & PINVISIBLE) && areawin->pinpointon)
+ UDrawString(TOLABEL(areagen), curcolor, theinstance);
+ else if (TOLABEL(areagen)->anchor & PINVISIBLE)
+ UDrawStringNoX(TOLABEL(areagen), curcolor, theinstance);
+ else if (level == 1 && TOLABEL(areagen)->pin &&
+ TOLABEL(areagen)->pin != INFO && areawin->pinpointon)
+ UDrawXDown(TOLABEL(areagen));
+ break;
+ }
+ }
+
+ /* restore the color passed to the object, if different from current color */
+
+ if ((defaultcolor != DOFORALL) && (passcolor != curcolor)) {
+ XTopSetForeground(passcolor);
+ }
+ }
+
+ /* restore the selection list (if any) */
+ areawin->selects = savesel;
+ UPopCTM();
+
+ /* Stack is not used by cairo but *is* used by expression evaluators */
+ if (stack) pop_stack(stack);
+}
+
+/*-------------------------------------------------------------------------*/
+
+static void xc_cairo_strokepath(short style, float width)
+{
+ if (!(style & CLIPMASK) || (areawin->showclipmasks == TRUE)) {
+ if (style & FILLED || (!(style & FILLED) && style & OPAQUE)) {
+ if ((style & FILLSOLID) == FILLSOLID)
+ cairo_fill_preserve(areawin->cr);
+ else {
+ double red, green, blue, alpha;
+ cairo_pattern_get_rgba(cairo_get_source(areawin->cr),
+ &red, &green, &blue, &alpha);
+ if (!(style & FILLED))
+ cairo_set_source_rgba(areawin->cr, 1., 1., 1., alpha);
+ else {
+ double m = (1 + ((style & FILLSOLID) >> 5)) / 8.;
+ if (style & OPAQUE) {
+ double n = (1. - m);
+ cairo_set_source_rgba(areawin->cr, m * red + n,
+ m * green + n, m * blue + n, alpha);
+ }
+ else
+ cairo_set_source_rgba(areawin->cr, red, green, blue,
+ m * alpha);
+ }
+ cairo_fill_preserve(areawin->cr);
+ cairo_set_source_rgba(areawin->cr, red, green, blue, alpha);
+ }
+ }
+ if (!(style & NOBORDER)) {
+ cairo_set_line_width(areawin->cr, width);
+ cairo_set_line_join(areawin->cr, (style & SQUARECAP) ?
+ CAIRO_LINE_JOIN_MITER : CAIRO_LINE_JOIN_BEVEL);
+ if (style & (DASHED | DOTTED)) {
+ double dashes[2];
+ dashes[0] = dashes[1] = 4.0 * width;
+ if (style & DOTTED)
+ dashes[0] = width;
+ cairo_set_dash(areawin->cr, dashes, 2, 0.0);
+ cairo_set_line_width(areawin->cr, width);
+ cairo_set_line_cap(areawin->cr, CAIRO_LINE_CAP_BUTT);
+ }
+ else {
+ cairo_set_dash(areawin->cr, NULL, 0, 0.0);
+ cairo_set_line_cap(areawin->cr, (style & SQUARECAP) ?
+ CAIRO_LINE_CAP_SQUARE : CAIRO_LINE_CAP_ROUND);
+ }
+
+ /* draw the spline and close off if so specified */
+ if (!(style & UNCLOSED))
+ cairo_close_path(areawin->cr);
+ cairo_stroke_preserve(areawin->cr);
+ }
+ }
+ if (style & CLIPMASK)
+ cairo_clip_preserve(areawin->cr);
+ cairo_new_path(areawin->cr); /* clear preserved paths */
+}
+
+/*-------------------------------------------------------------------------*/
+
+void UDrawPolygon(polyptr thepoly, float passwidth)
+{
+ int i;
+
+ if (!areawin->redraw_ongoing) {
+ areawin->redraw_needed = True;
+ return;
+ }
+
+ if (thepoly->number) {
+ cairo_move_to(areawin->cr, thepoly->points[0].x, thepoly->points[0].y);
+ for (i = 1; i < thepoly->number; i++)
+ cairo_line_to(areawin->cr, thepoly->points[i].x, thepoly->points[i].y);
+ xc_cairo_strokepath(thepoly->style, thepoly->width * passwidth);
+ }
+}
+
+/*-------------------------------------------------------------------------*/
+
+void UDrawArc(arcptr thearc, float passwidth)
+{
+ if (!areawin->redraw_ongoing) {
+ areawin->redraw_needed = True;
+ return;
+ }
+
+ if (abs(thearc->radius) == thearc->yaxis)
+ cairo_arc(areawin->cr, thearc->position.x, thearc->position.y,
+ abs(thearc->radius), thearc->angle1 * M_PI / 180.0,
+ thearc->angle2 * M_PI / 180.0);
+ else if (thearc->yaxis) {
+ /* perform elliptical arc, as described in cairo manual */
+ cairo_save(areawin->cr);
+ cairo_translate(areawin->cr, thearc->position.x, thearc->position.y);
+ cairo_scale(areawin->cr, abs(thearc->radius), thearc->yaxis);
+ cairo_arc(areawin->cr, 0.0, 0.0, 1.0, thearc->angle1 * M_PI / 180.0,
+ thearc->angle2 * M_PI / 180.0);
+ cairo_restore(areawin->cr);
+ }
+ else { /* no y-axis dimension: draw a line */
+ /* can we do this in a more elegant manner? */
+ double theta;
+ double theta_start = thearc->angle1 * RADFAC;
+ double theta_stop = thearc->angle2 * RADFAC;
+ cairo_move_to(areawin->cr, thearc->position.x + fabs(thearc->radius)
+ * cos(theta_start), thearc->position.y);
+ for (theta = -M_PI; theta < theta_stop; theta += M_PI) {
+ if (theta <= theta_start) continue;
+ cairo_line_to(areawin->cr, thearc->position.x
+ + fabs(thearc->radius) * cos(theta), thearc->position.y);
+ }
+ cairo_line_to(areawin->cr, thearc->position.x + fabs(thearc->radius)
+ * cos(theta_stop), thearc->position.y);
+ }
+ xc_cairo_strokepath(thearc->style, thearc->width * passwidth);
+}
+
+/*-------------------------------------------------------------------------*/
+
+void UDrawPath(pathptr thepath, float passwidth)
+{
+ genericptr *genpath;
+ polyptr thepoly;
+ splineptr thespline;
+
+ if (!areawin->redraw_ongoing) {
+ areawin->redraw_needed = True;
+ return;
+ }
+
+ /* Draw first point */
+ if (thepath->parts) {
+ genpath = thepath->plist;
+ switch(ELEMENTTYPE(*genpath)) {
+ case POLYGON:
+ thepoly = TOPOLY(genpath);
+ cairo_move_to(areawin->cr, thepoly->points[0].x,
+ thepoly->points[0].y);
+ break;
+ case SPLINE:
+ thespline = TOSPLINE(genpath);
+ cairo_move_to(areawin->cr, thespline->ctrl[0].x,
+ thespline->ctrl[0].y);
+ break;
+ }
+ }
+ /* Draw all other points */
+ for (genpath = thepath->plist; genpath < thepath->plist + thepath->parts;
+ genpath++) {
+ int i;
+ switch(ELEMENTTYPE(*genpath)) {
+ case POLYGON:
+ thepoly = TOPOLY(genpath);
+ for (i = 1; i < thepoly->number; i++)
+ cairo_line_to(areawin->cr, thepoly->points[i].x,
+ thepoly->points[i].y);
+ break;
+ case SPLINE:
+ thespline = TOSPLINE(genpath);
+ cairo_curve_to(areawin->cr, thespline->ctrl[1].x,
+ thespline->ctrl[1].y, thespline->ctrl[2].x,
+ thespline->ctrl[2].y, thespline->ctrl[3].x,
+ thespline->ctrl[3].y);
+ break;
+ }
+ }
+ xc_cairo_strokepath(thepath->style, thepath->width * passwidth);
+}
+
+/*-------------------------------------------------------------------------*/
+
+void UDrawSpline(splineptr thespline, float passwidth)
+{
+ if (!areawin->redraw_ongoing) {
+ areawin->redraw_needed = True;
+ return;
+ }
+
+ cairo_move_to(areawin->cr, thespline->ctrl[0].x, thespline->ctrl[0].y);
+ cairo_curve_to(areawin->cr, thespline->ctrl[1].x, thespline->ctrl[1].y,
+ thespline->ctrl[2].x, thespline->ctrl[2].y,
+ thespline->ctrl[3].x, thespline->ctrl[3].y);
+ xc_cairo_strokepath(thespline->style, thespline->width * passwidth);
+}
+
+/*-------------------------------------------------------------------------*/
+
+void UDrawGraphic(graphicptr gp)
+{
+ double w, h;
+
+ if (!areawin->redraw_ongoing) {
+ areawin->redraw_needed = True;
+ return;
+ }
+
+ cairo_save(areawin->cr);
+ cairo_translate(areawin->cr,
+ gp->position.x,
+ gp->position.y);
+ cairo_rotate(areawin->cr, -gp->rotation * RADFAC);
+ cairo_scale(areawin->cr, gp->scale, -gp->scale);
+ w = cairo_image_surface_get_width(gp->source);
+ h = cairo_image_surface_get_height(gp->source);
+ cairo_set_source_surface(areawin->cr, gp->source,
+ -w / 2., -h / 2.);
+ cairo_rectangle(areawin->cr, -w / 2, -h / 2, w, h);
+ cairo_clip(areawin->cr);
+ cairo_paint(areawin->cr);
+ cairo_restore(areawin->cr);
+}
+
+/*----------------------------*/
+/* Draw the grids, axis, etc. */
+/*----------------------------*/
+
+void draw_grids(void)
+{
+ double spc, spc2, spc3;
+ cairo_matrix_t m = {1., 0., 0., -1., 0., 0.};
+ m.x0 = -areawin->pcorner.x * areawin->vscale;
+ m.y0 = areawin->height + areawin->pcorner.y * areawin->vscale;
+
+ if (!areawin->redraw_ongoing) {
+ areawin->redraw_needed = True;
+ return;
+ }
+
+ cairo_save(areawin->cr);
+
+ /* draw lines for grid */
+ spc = xobjs.pagelist[areawin->page]->gridspace * areawin->vscale;
+ if (areawin->gridon && spc > 8) {
+ double x, y;
+ int ix, iy;
+ /* find bottom-right point on the grid */
+ double xbegin = areawin->width;
+ double ybegin = areawin->height;
+ cairo_set_matrix(areawin->cr, &m);
+ cairo_scale(areawin->cr, spc, spc);
+ cairo_device_to_user(areawin->cr, &xbegin, &ybegin);
+ xbegin = floor(xbegin);
+ ybegin = ceil(ybegin);
+ ix = xbegin;
+ iy = ybegin;
+ cairo_user_to_device(areawin->cr, &xbegin, &ybegin);
+ cairo_identity_matrix(areawin->cr);
+ /* draw the grid */
+ xc_cairo_set_color(GRIDCOLOR);
+ cairo_set_line_width(areawin->cr, 1.);
+ for (x = xbegin; x >= 0.; x -= spc, ix--) {
+ if (!ix && areawin->axeson) continue; /* do not draw main axis */
+ cairo_move_to(areawin->cr, floor(x) + .5, .5);
+ cairo_line_to(areawin->cr, floor(x) + .5, areawin->height + .5);
+ }
+ for (y = ybegin; y >= 0.; y -= spc, iy++) {
+ if (!iy && areawin->axeson) continue; /* do not draw main axis */
+ cairo_move_to(areawin->cr, .5, floor(y) + .5);
+ cairo_line_to(areawin->cr, areawin->width + .5, floor(y) + .5);
+ }
+ cairo_stroke(areawin->cr);
+ }
+
+
+ if (areawin->axeson) {
+ /* find main axis */
+ double x = 0, y = 0;
+ cairo_set_matrix(areawin->cr, &m);
+ cairo_user_to_device(areawin->cr, &x, &y);
+ cairo_identity_matrix(areawin->cr);
+ /* draw the grid */
+ xc_cairo_set_color(AXESCOLOR);
+ cairo_set_line_width(areawin->cr, 1.);
+ cairo_move_to(areawin->cr, floor(x) + .5, .5);
+ cairo_line_to(areawin->cr, floor(x) + .5, areawin->height + .5);
+ cairo_move_to(areawin->cr, .5, floor(y) + .5);
+ cairo_line_to(areawin->cr, areawin->width + .5, floor(y) + .5);
+ cairo_stroke(areawin->cr);
+ }
+
+ /* bounding box goes beneath everything except grid/axis lines */
+ UDrawBBox();
+
+ /* draw a little red dot at each snap-to point */
+ spc2 = xobjs.pagelist[areawin->page]->snapspace * areawin->vscale;
+ if (areawin->snapto && spc2 > 8) {
+ double x, y;
+ /* find bottom-right point on the grid */
+ double xbegin = areawin->width;
+ double ybegin = areawin->height;
+ cairo_set_matrix(areawin->cr, &m);
+ cairo_scale(areawin->cr, spc2, spc2);
+ cairo_device_to_user(areawin->cr, &xbegin, &ybegin);
+ xbegin = floor(xbegin);
+ ybegin = ceil(ybegin);
+ cairo_user_to_device(areawin->cr, &xbegin, &ybegin);
+ cairo_identity_matrix(areawin->cr);
+ /* draw the grid */
+ xc_cairo_set_color(SNAPCOLOR);
+ cairo_set_line_width(areawin->cr, 1.);
+ cairo_set_line_cap(areawin->cr, CAIRO_LINE_CAP_ROUND);
+ for (x = xbegin; x >= 0.; x -= spc2) {
+ for (y = ybegin; y >= 0.; y -= spc2) {
+ cairo_move_to(areawin->cr, floor(x) + .5, floor(y) + .5);
+ cairo_close_path(areawin->cr);
+ }
+ }
+ cairo_stroke(areawin->cr);
+ }
+
+ /* Draw major snap points */
+ spc3 = spc * 20.;
+ if (spc > 4.) {
+ double x, y;
+ /* find bottom-right point on the grid */
+ double xbegin = areawin->width;
+ double ybegin = areawin->height;
+ cairo_set_matrix(areawin->cr, &m);
+ cairo_scale(areawin->cr, spc3, spc3);
+ cairo_device_to_user(areawin->cr, &xbegin, &ybegin);
+ xbegin = floor(xbegin);
+ ybegin = ceil(ybegin);
+ cairo_user_to_device(areawin->cr, &xbegin, &ybegin);
+ cairo_identity_matrix(areawin->cr);
+ /* draw the grid */
+ xc_cairo_set_color(GRIDCOLOR);
+ cairo_set_line_width(areawin->cr, 3.);
+ cairo_set_line_cap(areawin->cr, CAIRO_LINE_CAP_ROUND);
+ for (x = xbegin; x >= 0.; x -= spc3) {
+ for (y = ybegin; y >= 0.; y -= spc3) {
+ cairo_move_to(areawin->cr, floor(x) + .5, floor(y) + .5);
+ cairo_close_path(areawin->cr);
+ }
+ }
+ cairo_stroke(areawin->cr);
+ }
+ cairo_restore(areawin->cr);
+}
+
+/*---------------------------------------------------------------------*/
+/* Draw a string at position offset, starting at the start index and */
+/* ending before the end index. The offset is updated on return. */
+/*---------------------------------------------------------------------*/
+
+void UDrawCharString(u_char *text, int start, int end, XfPoint *offset,
+ short styles, short ffont, int groupheight, int passcolor, float tmpscale)
+{
+ int idx, nglyphs = 0;
+ cairo_matrix_t oldm;
+ double x, y;
+ cairo_glyph_t *glyphs;
+ UNUSED(passcolor);
+
+ cairo_get_matrix(areawin->cr, &oldm);
+ cairo_scale(areawin->cr, tmpscale, fabs(tmpscale));
+
+ /* under- and overlines */
+ if (styles & 8)
+ y = offset->y / tmpscale - 6.;
+ else if (styles & 16)
+ y = offset->y / tmpscale + groupheight + 4;
+ if (styles & 24) {
+ /* under/overline thickness scales if bold */
+ float tmpthick = ((fonts[ffont].flags & 0x21) == 0x21) ? 4.0 : 2.0;
+ cairo_set_line_width(areawin->cr, tmpthick);
+
+ x = offset->x / tmpscale;
+ }
+
+ glyphs = cairo_glyph_allocate(end - start);
+ for (idx = start; idx < end; idx++)
+ {
+ /* Add glyphs */
+ glyphs[nglyphs].index = fonts[ffont].glyph_index[text[idx]];
+ glyphs[nglyphs].x = offset->x / tmpscale;
+ glyphs[nglyphs].y = offset->y / fabs(tmpscale);
+ nglyphs++;
+ /* Determine character width */
+ offset->x += fonts[ffont].glyph_advance[text[idx]] * tmpscale;
+ }
+ if (nglyphs) {
+ cairo_show_glyphs(areawin->cr, glyphs, nglyphs);
+ cairo_new_path(areawin->cr);
+ }
+ cairo_glyph_free(glyphs);
+
+ if (styles & 24) {
+ cairo_move_to(areawin->cr, x, y);
+ cairo_line_to(areawin->cr, offset->x / tmpscale, y);
+ cairo_stroke(areawin->cr);
+ }
+ cairo_set_matrix(areawin->cr, &oldm);
+}
+
+/*----------------------------------------------------------------------*/
+/* A completely stripped down version of UDrawObject, used for stroke */
+/* font drawing in xc_user_font_render */
+/*----------------------------------------------------------------------*/
+
+static void xc_draw_glyph_object(objinstptr inst, float passwidth)
+{
+ int thispart;
+ genericptr *areagen;
+ objectptr obj = inst->thisobject;
+ objinstptr ptr;
+
+ for (thispart = 0; thispart < obj->parts; thispart++) {
+ areagen = obj->plist + thispart;
+ switch(ELEMENTTYPE(*areagen)) {
+ case(POLYGON):
+ UDrawPolygon(TOPOLY(areagen), passwidth);
+ break;
+ case(SPLINE):
+ UDrawSpline(TOSPLINE(areagen), passwidth);
+ break;
+ case(ARC):
+ UDrawArc(TOARC(areagen), passwidth);
+ break;
+ case(PATH):
+ UDrawPath(TOPATH(areagen), passwidth);
+ break;
+ case(OBJINST):
+ ptr = TOOBJINST(areagen);
+ cairo_save(areawin->cr);
+ cairo_translate(areawin->cr, ptr->position.x, ptr->position.y);
+ cairo_rotate(areawin->cr, -ptr->rotation * RADFAC);
+ cairo_scale(areawin->cr, ptr->scale, fabs(ptr->scale));
+ xc_draw_glyph_object(ptr, passwidth);
+ cairo_restore(areawin->cr);
+ break;
+ }
+ }
+}
+
+/*----------------------------------------------------------------------*/
+/* Rendering function for a cairo_user_font_face, to draw the stroke */
+/* fonts of xcircuit */
+/* TODO: always this factor 40 to match with cairo. Is it BASELINE? */
+/*----------------------------------------------------------------------*/
+
+static cairo_status_t xc_user_font_render(cairo_scaled_font_t *scaled_font,
+ unsigned long glyph, cairo_t *cr, cairo_text_extents_t *extents)
+{
+ objectptr chr;
+ objinst charinst;
+ objinstptr theinstance;
+ cairo_t *old_cr;
+ float passwidth;
+ double llx, lly, trx, try;
+
+ cairo_font_face_t *ff = cairo_scaled_font_get_font_face(scaled_font);
+ size_t fontidx = (size_t) cairo_font_face_get_user_data(ff, &fontinfo_key);
+ fontinfo *fi = &fonts[fontidx];
+
+ chr = fi->encoding[glyph];
+ theinstance = &charinst;
+ charinst.thisobject = chr;
+
+ llx = chr->bbox.lowerleft.x / 40.;
+ lly = chr->bbox.lowerleft.y / 40.;
+ trx = (chr->bbox.lowerleft.x + chr->bbox.width) / 40.;
+ try = (chr->bbox.lowerleft.y + chr->bbox.height) / 40.;
+
+ /* temporary override areawin->cr with the font context */
+ old_cr = areawin->cr;
+ areawin->cr = cr;
+
+ cairo_scale(cr, 1. / 40., -1. / 40.);
+ cairo_set_line_width(cr, 1);
+
+ /* if font is derived and italic, premultiply by slanting matrix */
+ if ((fi->flags & 0x22) == 0x22) {
+ cairo_matrix_t m = {1., 0., .25, 1., 0., 0.};
+ cairo_transform(areawin->cr, &m);
+ llx += .25 * lly;
+ trx += .25 * try;
+ }
+ /* simple boldface technique for derived fonts */
+ passwidth = ((fi->flags & 0x21) == 0x21) ? 4. : 2.;
+
+ /* Correct extentswith line width */
+ llx -= passwidth / 40.;
+ lly -= passwidth / 40.;
+ trx += passwidth / 40.;
+ try += passwidth / 40.;
+
+ xc_draw_glyph_object(theinstance, passwidth);
+
+ extents->x_bearing = llx;
+ extents->y_bearing = -try;
+ extents->width = trx - llx;
+ extents->height = try - lly;
+ extents->x_advance = (chr->bbox.lowerleft.x + chr->bbox.width) / 40.;
+ extents->y_advance = 0.;
+
+ areawin->cr = old_cr;
+ return CAIRO_STATUS_SUCCESS;
+}
+
+/*----------------------------------------------------------------------*/
+/* Function to translate unicode into a glyph index for the stroke font */
+/*----------------------------------------------------------------------*/
+
+static cairo_status_t xc_user_font_glyph(cairo_scaled_font_t *scaled_font,
+ unsigned long unicode, unsigned long *glyph_index)
+{
+ cairo_font_face_t *ff = cairo_scaled_font_get_font_face(scaled_font);
+ size_t fontidx = (size_t) cairo_font_face_get_user_data(ff, &fontinfo_key);
+ fontinfo *fi = &fonts[fontidx];
+ unsigned long idx;
+
+ /* search all glyphs in the utf8encoding. This is allowed to be slow, */
+ /* as the glyph list will be buffered anyway */
+ for (idx = 1; idx < 255; idx++) {
+ const char *s = fi->utf8encoding[idx];
+ int cidx = 0;
+
+ /* Convert utf-8 to unicode */
+ unsigned long uc = s[0];
+ if (uc & 0x80) {
+ unsigned long mask = 0x3f;
+ while ((s[++cidx] & 0xc0) == 0x80) {
+ uc = (uc << 6) | (s[cidx] & 0x3f);
+ mask = (mask << 5) | 0x1f;
+ }
+ uc &= mask;
+ }
+
+ if (unicode == uc) {
+ *glyph_index = idx;
+ return CAIRO_STATUS_SUCCESS;
+ }
+ }
+ /* This should not happen: replace unknown glyph with question mark */
+ *glyph_index = '?';
+ return CAIRO_STATUS_SUCCESS;
+}
+
+/*---------------------------------------------------------------------*/
+/* find the corresponing cairo fontface for a given fontinfo structure */
+/*---------------------------------------------------------------------*/
+
+typedef struct {
+ const char* postscript_name;
+ const char* replacement_name;
+ const char* foundry_name;
+} xc_font_replacement;
+
+static const xc_font_replacement replacement_fonts[] =
+{
+ /* First try to see if 'real' postscript fonts have been installed */
+ {"ITC Avant Garde Gothic", "ITC Avant Garde Gothic", "adobe"},
+ {"ITC Bookman", "ITC Bookman", "adobe"},
+ {"Courier", "Courier", "adobe"},
+ {"Helvetica", "Helvetica", "adobe"},
+ {"Helvetica Narrow", "Helvetica Narrow", "adobe"},
+ {"New Century Schoolbook", "New Century Schoolbook", "adobe"},
+ {"Palatino", "Palatino", "adobe"},
+ {"Symbol", "Symbol", "adobe"},
+ {"Times", "Times", "adobe"},
+ {"Times-Roman", "Times-Roman", "adobe"},
+ {"ITC ZapfChangery", "ITC ZapfChangery", "adobe"},
+ {"ITC ZapfDingbats", "ITC ZapfDingbats", "adobe"},
+ /* Next try the URW postscript fonts (guaranteed to have same extents) */
+ {"ITC Avant Garde Gothic", "URW Gothic L", "urw"},
+ {"ITC Bookman", "URW Bookman L", "urw"},
+ {"Courier", "Nimbus Mono L", "urw"},
+ {"Helvetica", "Nimbus Sans L", "urw"},
+ {"Helvetica Narrow", "Nimbus Sans L Condensed", "urw"},
+ {"New Century Schoolbook", "Century Schoolbook L", "urw"},
+ {"Palatino", "URW Palladio L", "urw"},
+ {"Symbol", "Standard Symbols L", "urw"},
+ {"Times", "Nimbus Roman No9 L", "urw"},
+ {"Times-Roman", "Nimbus Roman No9 L", "urw"},
+ {"ITC ZapfChangery", "URW Changery L", "urw"},
+ {"ITC ZapfDingbats", "Dingbats", "urw"},
+ /* No success, use the 'old' stroke fonts */
+ {NULL, NULL, NULL}
+};
+
+void xc_cairo_set_fontinfo(size_t fontidx)
+{
+ /* TODO: memory leak. font_face is created here. It should also be */
+ /* destroyed again somewhere */
+ fontinfo *fi = &fonts[fontidx];
+ const char *family = fi->family;
+ const xc_font_replacement *replace;
+ int c;
+
+#ifdef CAIRO_HAS_FC_FONT
+ int weight = FC_WEIGHT_NORMAL;
+ int slant = FC_SLANT_ROMAN;
+
+ fi->font_face = NULL;
+
+ if (fi->flags & 1)
+ weight = FC_WEIGHT_BOLD;
+
+ if (fi->flags & 2) {
+ if (!strcmp(family, "Helvetica"))
+ slant = FC_SLANT_OBLIQUE;
+ else
+ slant = FC_SLANT_ITALIC;
+ }
+ /* Try to find a proper postscript font */
+ for (replace = replacement_fonts; replace->postscript_name; replace++) {
+ if (!strcmp(replace->postscript_name, fi->family)) {
+ FcPattern *matched;
+ FcChar8 *matched_family, *matched_foundry;
+ FcResult result;
+ FcPattern *pattern = FcPatternBuild(NULL,
+ FC_FAMILY, FcTypeString, replace->replacement_name,
+ FC_WEIGHT, FcTypeInteger, weight,
+ FC_SLANT, FcTypeInteger, slant,
+ FC_FOUNDRY, FcTypeString, replace->foundry_name,
+ NULL);
+ FcConfigSubstitute(0, pattern, FcMatchPattern);
+ FcDefaultSubstitute(pattern);
+ matched = FcFontMatch(0, pattern, &result);
+ /* Check if the matched font is actually the replacement font */
+ FcPatternGetString(matched, FC_FAMILY, 0, &matched_family);
+ FcPatternGetString(matched, FC_FOUNDRY, 0, &matched_foundry);
+ if (!strcmp(matched_family, replace->replacement_name)
+ && !strcmp(matched_foundry, replace->foundry_name))
+ fi->font_face = cairo_ft_font_face_create_for_pattern(matched);
+ FcPatternDestroy(matched);
+ FcPatternDestroy(pattern);
+ if (fi->font_face)
+ break;
+ }
+ }
+#else /* CAIRO_HAS_FC_FONT */
+ fi->font_face = NULL;
+#endif /* CAIRO_HAS_FC_FONT */
+
+ /* Cache the dimensions and all glyphs of the font */
+ if (fi->font_face) {
+ int num_glyphs;
+ cairo_glyph_t *glyphs = NULL;
+ cairo_scaled_font_t *scaled_font;
+ cairo_text_extents_t extents;
+
+ cairo_save(areawin->cr);
+ cairo_identity_matrix(areawin->cr);
+ cairo_set_font_face(areawin->cr, fi->font_face);
+ cairo_set_font_size(areawin->cr, 100.);
+ scaled_font = cairo_get_scaled_font(areawin->cr);
+ for (c = 1; c < 256; c++) { /* skip encoding at index 0 */
+ cairo_scaled_font_text_to_glyphs(scaled_font, 0., 0.,
+ fi->utf8encoding[c], -1, &glyphs, &num_glyphs,
+ NULL, NULL, NULL);
+ fi->glyph_index[c] = glyphs[0].index;
+ cairo_scaled_font_glyph_extents(scaled_font, glyphs, 1, &extents);
+ fi->glyph_top[c] = -extents.y_bearing * 40. / 100.;
+ /* fi->glyph_bottom[c] = extents.height * 40. / 100. + fi->glyph_top[c]; */
+ fi->glyph_bottom[c] = fi->glyph_top[c] - extents.height * 40. / 100.;
+ fi->glyph_advance[c] = extents.x_advance * 40. / 100.;
+ }
+ cairo_glyph_free(glyphs);
+ cairo_restore(areawin->cr);
+ }
+ else {
+ /* No decent postscript font found. Backup using stroke fonts */
+ fi->font_face = cairo_user_font_face_create();
+ cairo_font_face_set_user_data(fi->font_face, &fontinfo_key,
+ (void*) fontidx, (cairo_destroy_func_t) cairo_font_face_destroy);
+ cairo_user_font_face_set_render_glyph_func(fi->font_face,
+ xc_user_font_render);
+ cairo_user_font_face_set_unicode_to_glyph_func(fi->font_face,
+ xc_user_font_glyph);
+ for (c = 0; c < 256; c++) {
+ objectptr chr = fi->encoding[c];
+ fi->glyph_index[c] = c;
+ fi->glyph_top[c] = chr->bbox.lowerleft.y + chr->bbox.height;
+ fi->glyph_bottom[c] = chr->bbox.lowerleft.y;
+ fi->glyph_advance[c] = chr->bbox.lowerleft.x + chr->bbox.width;
+ }
+ }
+}
+
+/*----------------------------------------------------------------------*/
+/* A light wrapper around cairo_surface_t, to a generalized xcImage */
+/*----------------------------------------------------------------------*/
+
+/* caching for cairo_surface_t */
+static xcImage *xcImagePixel_oldimg = NULL;
+static uint32_t *xcImagePixel_data;
+static int xcImagePixel_width;
+static int xcImagePixel_height;
+
+static inline void xcImageCheckCache(xcImage *img)
+{
+ if (img != xcImagePixel_oldimg) {
+ xcImagePixel_oldimg = img;
+ xcImagePixel_data = (uint32_t*) cairo_image_surface_get_data(img);
+ xcImagePixel_width = cairo_image_surface_get_width(img);
+ xcImagePixel_height = cairo_image_surface_get_height(img);
+ }
+}
+
+xcImage *xcImageCreate(int width, int height)
+{
+ return cairo_image_surface_create(CAIRO_FORMAT_RGB24, width, height);
+}
+
+void xcImageDestroy(xcImage *img)
+{
+ cairo_surface_destroy(img);
+}
+
+int xcImageGetWidth(xcImage *img)
+{
+ xcImageCheckCache(img);
+ return xcImagePixel_width;
+}
+
+int xcImageGetHeight(xcImage *img)
+{
+ xcImageCheckCache(img);
+ return xcImagePixel_height;
+}
+
+void xcImagePutPixel(xcImage *img, int x, int y, u_char r, u_char g, u_char b)
+{
+ xcImageCheckCache(img);
+ xcImagePixel_data[y * xcImagePixel_width + x] = (r << 16) | (g << 8) | b;
+}
+
+void xcImageGetPixel(xcImage *img, int x, int y, u_char *r, u_char *g,
+ u_char *b)
+{
+ uint32_t argb;
+ xcImageCheckCache(img);
+ argb = xcImagePixel_data[y * xcImagePixel_width + x];
+ *r = argb >> 16;
+ *g = argb >> 8;
+ *b = argb;
+}
+
+
+/*------------------------------------------------------------------------*/
+/* Ghostscript rendering function. In contrast to X11, direct calls to */
+/* ghostscriptapi are made */
+/*------------------------------------------------------------------------*/
+
+/*------------------------------------------------------------------------*/
+/* gsapi I/O redirection functions */
+/*------------------------------------------------------------------------*/
+
+#ifdef HAVE_GS
+static int GSDLLCALL gs_stdin_fn(void *caller_handle, char *buf, int len)
+{
+ UNUSED(caller_handle); UNUSED(buf); UNUSED(len);
+
+ return 0; /* EOF */
+}
+
+static int GSDLLCALL gs_stdout_fn(void *caller_handle, const char *str, int len)
+{
+#ifndef GS_DEBUG
+ UNUSED(caller_handle); UNUSED(str);
+#else
+ fwrite(str, 1, len, stdout);
+ fflush(stdout);
+#endif
+ return len;
+}
+
+static int GSDLLCALL gs_stderr_fn(void *caller_handle, const char *str, int len)
+{
+#ifndef GS_DEBUG
+ UNUSED(caller_handle); UNUSED(str);
+#else
+ fwrite(str, 1, len, stderr);
+ fflush(stderr);
+#endif
+ return len;
+}
+#endif /* HAVE_GS */
+
+/*------------------------------------------------------------------------*/
+/* gsapi displaycallback functions */
+/*------------------------------------------------------------------------*/
+
+#ifdef HAVE_GS
+static unsigned char *gs_pimage;
+static int gs_width, gs_height, gs_raster;
+
+static int gs_display_dummy(void)
+{
+ return 0;
+}
+#endif /* HAVE_GS */
+
+#ifdef HAVE_GS
+static int gs_display_size(void *handle, void *device, int width, int height,
+ int raster, unsigned int format, unsigned char *pimage)
+{
+ UNUSED(handle); UNUSED(device); UNUSED(format);
+
+ gs_pimage = pimage;
+ gs_width = width;
+ gs_height = height;
+ gs_raster = raster;
+ return 0;
+}
+#endif /* HAVE_GS */
+
+#ifdef HAVE_GS
+int gs_display_page(void *handle, void *device, int copies, int flush)
+{
+ cairo_surface_t *tbuf;
+ cairo_t *bbuf_cr;
+ UNUSED(handle); UNUSED(device); UNUSED(copies); UNUSED(flush);
+
+ if (bbuf)
+ cairo_surface_destroy(bbuf);
+ /* Since cairo_image_surface_create_for_data assumes the buffer to be */
+ /* valid until destruction, and ghostscript frees it immediately, */
+ /* first use a temporary buffer. Then immediately copy the buffer */
+ /* To the final location */
+ tbuf = cairo_image_surface_create_for_data(gs_pimage, CAIRO_FORMAT_RGB24,
+ gs_width, gs_height, gs_raster);
+ bbuf = cairo_image_surface_create(CAIRO_FORMAT_RGB24, gs_width, gs_height);
+ bbuf_cr = cairo_create(bbuf);
+ cairo_set_source_surface(bbuf_cr, tbuf, 0., 0.);
+ cairo_paint(bbuf_cr);
+ cairo_destroy(bbuf_cr);
+ cairo_surface_destroy(tbuf);
+ return 0;
+}
+#endif /* HAVE_GS */
+
+#ifdef HAVE_GS
+display_callback gs_display = {
+ sizeof(display_callback),
+ DISPLAY_VERSION_MAJOR,
+ DISPLAY_VERSION_MINOR,
+ (int (*)(void*, void*)) gs_display_dummy, /* display_open */
+ (int (*)(void*, void*)) gs_display_dummy, /* display_preclose */
+ (int (*)(void*, void*)) gs_display_dummy, /* display_close */
+ (int (*)(void*, void*, int, int, int, unsigned int)) gs_display_dummy,
+ /* display_presize */
+ gs_display_size,
+ (int (*)(void*, void*)) gs_display_dummy, /* display_sync */
+ gs_display_page,
+ NULL, /* display_update */
+ NULL, /* display_memalloc */
+ NULL, /* display_memfree */
+ NULL /* display_separation */
+};
+#endif /* HAVE_GS */
+
+/*------------------------------------------------------*/
+/* write scale and position to ghostscript */
+/* and tell ghostscript to run the requested file */
+/*------------------------------------------------------*/
+
+#ifdef HAVE_GS
+const char *gs_argv[] = {
+ "-dQUIET", /* Suppress startup messages */
+ "-dNOPAUSE", /* Disable pause at end of page */
+ "-dBATCH", /* Exit when all files done */
+ "-sDEVICE=display",
+ "-sDisplayHandle=0",
+ "-r75", /* Display resolution */
+ "-dGraphicsAlphaBits=4", /* Graphics anti-aliasing */
+ "-dTextAlphaBits=4" /* Text anti-aliasing */
+};
+#endif /* HAVE_GS */
+
+void write_scale_position_and_run_gs(float norm, float xpos, float ypos,
+ const char *bgfile)
+{
+#ifndef HAVE_GS
+ UNUSED(norm); UNUSED(xpos); UNUSED(ypos); UNUSED(bgfile);
+#endif
+#ifdef HAVE_GS
+ int i, code, exit_code;
+ void *instance;
+ char gs_cmd[256];
+ char display_format[] = "-dDisplayFormat=........";
+ char pixmap_size[] = "-g........x........";
+ int argc = sizeof(gs_argv) / sizeof(gs_argv[0]);
+ const char **argv = (const char**) malloc((argc + 2) * sizeof(const char*));
+
+ for (i = 0; i < argc; i++)
+ argv[i] = gs_argv[i];
+ argv[argc++] = display_format;
+ argv[argc++] = pixmap_size;
+
+ sprintf(gs_cmd,
+ " /GSobj save def"
+ " /setpagedevice {pop} def"
+ " gsave"
+ " %3.2f %3.2f translate"
+ " %3.2f %3.2f scale"
+ " (%s) run"
+ " GSobj restore"
+ " grestore",
+ xpos, ypos, norm, norm, bgfile);
+
+ sprintf(display_format, "-dDisplayFormat=%d", DISPLAY_COLORS_RGB
+ | DISPLAY_UNUSED_LAST | DISPLAY_DEPTH_8 | DISPLAY_LITTLEENDIAN
+ | DISPLAY_TOPFIRST | DISPLAY_ROW_ALIGN_DEFAULT);
+ sprintf(pixmap_size, "-g%dx%d", areawin->width, areawin->height);
+
+ XDefineCursor(dpy, areawin->window, WAITFOR);
+
+ if ((code = gsapi_new_instance(&instance, NULL)) == 0) {
+ gsapi_set_stdio(instance, gs_stdin_fn, gs_stdout_fn, gs_stderr_fn);
+ gsapi_set_display_callback(instance, &gs_display);
+ if (!(code = gsapi_init_with_args(instance, argc, (char**) argv)))
+ gsapi_run_string(instance, gs_cmd, 0, &exit_code);
+ gsapi_exit(instance);
+ gsapi_delete_instance(instance);
+ }
+ free(argv);
+#ifdef GS_DEBUG
+ fprintf(stdout, "Xcircuit: ghostscript done\n");
+#endif
+
+ XDefineCursor(dpy, areawin->window, DEFAULTCURSOR);
+ areawin->lastbackground = xobjs.pagelist[areawin->page]->background.name;
+ drawarea(areawin->area, NULL, NULL);
+#endif /* HAVE_GS */
+ gs_state = GS_READY;
+}
+
+#else /* HAVE_CAIRO */
+typedef int no_empty_translation_unit_warning;
+#endif /* HAVE_CAIRO */
+
diff --git a/cairo.c.orig b/cairo.c.orig
new file mode 100644
index 0000000..04a8fcb
--- /dev/null
+++ b/cairo.c.orig
@@ -0,0 +1,991 @@
+/*-------------------------------------------------------------------------*/
+/* cairo.c --- mainly cairo versions of the UDraw... stuff in functions.c */
+/* Copyright (c) 2002 Tim Edwards, Johns Hopkins University */
+/*-------------------------------------------------------------------------*/
+/*-------------------------------------------------------------------------*/
+/* originally written by Tim Edwards, 8/13/93 */
+/* All cairo graphics library modifications by Erik van der Wal, May 2014 */
+/*-------------------------------------------------------------------------*/
+
+#ifdef HAVE_CAIRO
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <stdint.h>
+#include <assert.h>
+#include <math.h>
+#include <limits.h>
+
+#ifndef XC_WIN32
+#include <X11/Intrinsic.h>
+#endif
+
+#ifdef TCL_WRAPPER
+#include <tk.h>
+#endif /* TCL_WRAPPER */
+
+#include "xcircuit.h"
+#include "colordefs.h"
+#include "prototypes.h"
+
+extern XCWindowData *areawin;
+extern int *appcolors;
+extern Globaldata xobjs;
+extern short fontcount;
+extern fontinfo *fonts;
+extern Display *dpy;
+
+static void xc_cairo_strokepath(short style, float width);
+
+/*----------------------------------------------------------------------------*/
+
+void xc_cairo_set_matrix(const Matrix *xcm)
+{
+ cairo_matrix_t m = {
+ .xx = xcm->a, .xy = xcm->b, .x0 = xcm->c,
+ .yx = xcm->d, .yy = xcm->e, .y0 = xcm->f
+ };
+ cairo_set_matrix(areawin->cr, &m);
+};
+
+/*----------------------------------------------------------------------*/
+/* Set the color, based on the given color index */
+/*----------------------------------------------------------------------*/
+
+void xc_cairo_set_color(unsigned long coloridx)
+{
+ unsigned short r, g, b;
+ double red, green, blue;
+ xc_get_color_rgb(coloridx, &r, &g, &b);
+ cairo_set_source_rgb(areawin->cr, r / 65535., g / 65535., b / 65535.);
+}
+
+/*----------------------------------------------------------------------------*/
+
+void UDrawLine(XPoint *pt1, XPoint *pt2)
+{
+ if (!areawin->redraw_ongoing) {
+ areawin->redraw_needed = True;
+ return;
+ }
+
+ cairo_save(areawin->cr);
+
+ cairo_set_line_width(areawin->cr, xobjs.pagelist[areawin->page]->wirewidth);
+ cairo_set_dash(areawin->cr, NULL, 0, 0.);
+ cairo_set_line_cap(areawin->cr, CAIRO_LINE_CAP_ROUND);
+ cairo_set_line_join(areawin->cr, CAIRO_LINE_JOIN_BEVEL);
+
+ cairo_move_to(areawin->cr, pt1->x, pt1->y);
+ cairo_line_to(areawin->cr, pt2->x, pt2->y);
+ cairo_stroke(areawin->cr);
+
+ cairo_restore(areawin->cr);
+}
+
+/*----------------------------------------------------------------------*/
+/* Add circle at given point to indicate that the point is a parameter. */
+/* The circle is divided into quarters. For parameterized y-coordinate */
+/* the top and bottom quarters are drawn. For parameterized x- */
+/* coordinate, the left and right quarters are drawn. A full circle */
+/* indicates either both x- and y-coordinates are parameterized, or */
+/* else any other kind of parameterization (presently, not used). */
+/* */
+/* (note that the two angles in XDrawArc() are 1) the start angle, */
+/* measured in absolute 64th degrees from 0 (3 o'clock), and 2) the */
+/* path length, in relative 64th degrees (positive = counterclockwise, */
+/* negative = clockwise)). */
+/*----------------------------------------------------------------------*/
+
+void UDrawCircle(XPoint *upt, u_char which)
+{
+ XPoint wpt;
+
+ if (!areawin->redraw_ongoing) {
+ areawin->redraw_needed = True;
+ return;
+ }
+
+ cairo_save(areawin->cr);
+ cairo_identity_matrix(areawin->cr);
+
+ user_to_window(*upt, &wpt);
+ cairo_set_line_width(areawin->cr, .75);
+ cairo_set_dash(areawin->cr, NULL, 0, 0.);
+ cairo_set_line_cap(areawin->cr, CAIRO_LINE_CAP_BUTT);
+ cairo_set_line_join(areawin->cr, CAIRO_LINE_JOIN_MITER);
+
+ /* TODO: angles might be mirrored or turning the wrong way */
+ switch(which) {
+ case P_POSITION_X:
+ cairo_arc(areawin->cr, wpt.x, wpt.y, 4., M_PI * -.25, M_PI * .25);
+ cairo_arc(areawin->cr, wpt.x, wpt.y, 4., M_PI * .75, M_PI * 1.25);
+ break;
+ case P_POSITION_Y:
+ cairo_arc(areawin->cr, wpt.x, wpt.y, 4., M_PI * .25, M_PI * .75);
+ cairo_arc(areawin->cr, wpt.x, wpt.y, 4., M_PI * 1.25, M_PI * 1.75);
+ break;
+ default:
+ cairo_arc(areawin->cr, wpt.x, wpt.y, 4., 0., M_PI * 2.);
+ break;
+ }
+
+ cairo_restore(areawin->cr);
+}
+
+/*----------------------------------------------------------------------*/
+/* Add "X" at string origin */
+/*----------------------------------------------------------------------*/
+
+void UDrawXAt(XPoint *wpt)
+{
+ if (!areawin->redraw_ongoing) {
+ areawin->redraw_needed = True;
+ return;
+ }
+
+ cairo_save(areawin->cr);
+ cairo_identity_matrix(areawin->cr);
+
+ cairo_set_dash(areawin->cr, NULL, 0, 0.);
+ cairo_set_line_width(areawin->cr, .75);
+
+ cairo_move_to(areawin->cr, wpt->x - 3., wpt->y - 3.);
+ cairo_line_to(areawin->cr, wpt->x + 3., wpt->y + 3.);
+ cairo_move_to(areawin->cr, wpt->x + 3., wpt->y - 3.);
+ cairo_line_to(areawin->cr, wpt->x - 3., wpt->y + 3.);
+ cairo_stroke(areawin->cr);
+
+ cairo_restore(areawin->cr);
+}
+
+void UDrawXLine(XPoint opt, XPoint cpt)
+{
+ XPoint upt, vpt;
+ double dashes[] = {4., 4.};
+
+ if (!areawin->redraw_ongoing) {
+ areawin->redraw_needed = True;
+ return;
+ }
+
+ cairo_save(areawin->cr);
+ cairo_identity_matrix(areawin->cr);
+
+ xc_cairo_set_color(AUXCOLOR);
+ cairo_set_dash(areawin->cr, dashes, sizeof(dashes) / sizeof(double), 0.);
+ cairo_set_line_width(areawin->cr, .75);
+
+ user_to_window(cpt, &upt);
+ user_to_window(opt, &vpt);
+ cairo_move_to(areawin->cr, vpt.x, vpt.y);
+ cairo_line_to(areawin->cr, upt.x, upt.y);
+ cairo_stroke(areawin->cr);
+
+ cairo_set_dash(areawin->cr, NULL, 0, 0.);
+ cairo_move_to(areawin->cr, upt.x - 3., upt.y - 3.);
+ cairo_line_to(areawin->cr, upt.x + 3., upt.y + 3.);
+ cairo_move_to(areawin->cr, upt.x + 3., upt.y - 3.);
+ cairo_line_to(areawin->cr, upt.x - 3., upt.y + 3.);
+ cairo_stroke(areawin->cr);
+
+ cairo_restore(areawin->cr);
+}
+
+/*-------------------------------------------------------------------------*/
+
+void UDrawBox(XPoint origin, XPoint corner)
+{
+ XPoint worig, wcorn;
+ double r, g, b, a;
+
+ if (!areawin->redraw_ongoing) {
+ areawin->redraw_needed = True;
+ return;
+ }
+
+ user_to_window(origin, &worig);
+ user_to_window(corner, &wcorn);
+
+ cairo_save(areawin->cr);
+ cairo_identity_matrix(areawin->cr);
+
+ cairo_set_line_width(areawin->cr, 1.0);
+ cairo_set_dash(areawin->cr, NULL, 0, 0.);
+ cairo_set_line_cap(areawin->cr, CAIRO_LINE_CAP_SQUARE);
+ cairo_set_line_join(areawin->cr, CAIRO_LINE_JOIN_MITER);
+
+ cairo_move_to(areawin->cr, worig.x + .5, worig.y + .5);
+ cairo_line_to(areawin->cr, worig.x + .5, wcorn.y + .5);
+ cairo_line_to(areawin->cr, wcorn.x + .5, wcorn.y + .5);
+ cairo_line_to(areawin->cr, wcorn.x + .5, worig.y + .5);
+ cairo_close_path(areawin->cr);
+
+ xc_cairo_set_color(AUXCOLOR);
+ cairo_pattern_get_rgba(cairo_get_source(areawin->cr), &r, &g, &b, &a);
+ cairo_set_source_rgba(areawin->cr, r, g, b, .1 * a);
+ cairo_fill_preserve(areawin->cr);
+ cairo_set_source_rgba(areawin->cr, r, g, b, a);
+ cairo_stroke(areawin->cr);
+
+ cairo_restore(areawin->cr);
+}
+
+/*----------------------------------------------------------------------*/
+/* Draw a box indicating the dimensions of the edit element that most */
+/* closely reach the position "corner". */
+/*----------------------------------------------------------------------*/
+
+float UDrawRescaleBox(XPoint *corner)
+{
+ XPoint newpoints[5];
+ float newscale;
+
+ if (!areawin->redraw_ongoing) {
+ areawin->redraw_needed = True;
+ /* No return here, since the return value might be needed? */
+ }
+
+ if (areawin->selects == 0)
+ return 0.;
+
+ newscale = UGetRescaleBox(corner, newpoints);
+
+ if (areawin->redraw_ongoing) {
+ int i;
+ cairo_save(areawin->cr);
+ xc_cairo_set_color(AUXCOLOR);
+ cairo_set_dash(areawin->cr, NULL, 0, 0.);
+ cairo_set_line_cap(areawin->cr, CAIRO_LINE_CAP_ROUND);
+ cairo_set_line_join(areawin->cr, CAIRO_LINE_JOIN_BEVEL);
+ cairo_move_to(areawin->cr, newpoints[0].x, newpoints[0].y);
+ for (i = 1; i < 4; i++)
+ cairo_line_to(areawin->cr, newpoints[i].x, newpoints[i].y);
+ xc_cairo_strokepath(0, 1);
+ cairo_restore(areawin->cr);
+ }
+
+ return newscale;
+}
+
+/*-------------------------------------------------------------------------*/
+
+void UDrawBBox()
+{
+ XPoint origin;
+ XPoint worig, wcorn, corner;
+ objinstptr bbinst = areawin->topinstance;
+
+ if (!areawin->redraw_ongoing) {
+ areawin->redraw_needed = True;
+ return;
+ }
+
+ if ((!areawin->bboxon) || (checkforbbox(topobject) != NULL)) return;
+
+ origin = bbinst->bbox.lowerleft;
+ corner.x = origin.x + bbinst->bbox.width;
+ corner.y = origin.y + bbinst->bbox.height;
+
+ /* Include any schematic labels in the bounding box. */
+ extendschembbox(bbinst, &origin, &corner);
+
+ user_to_window(origin, &worig);
+ user_to_window(corner, &wcorn);
+
+ cairo_save(areawin->cr);
+ cairo_identity_matrix(areawin->cr);
+
+ xc_cairo_set_color(BBOXCOLOR);
+ cairo_set_line_width(areawin->cr, 1.0);
+ cairo_set_dash(areawin->cr, NULL, 0, 0.);
+ cairo_set_line_cap(areawin->cr, CAIRO_LINE_CAP_SQUARE);
+ cairo_set_line_join(areawin->cr, CAIRO_LINE_JOIN_MITER);
+
+ cairo_move_to(areawin->cr, worig.x + .5, worig.y + .5);
+ cairo_line_to(areawin->cr, worig.x + .5, wcorn.y + .5);
+ cairo_line_to(areawin->cr, wcorn.x + .5, wcorn.y + .5);
+ cairo_line_to(areawin->cr, wcorn.x + .5, worig.y + .5);
+ cairo_close_path(areawin->cr);
+ cairo_stroke(areawin->cr);
+
+ cairo_restore(areawin->cr);
+}
+
+/*----------------------------------------------------------------------*/
+/* Main recursive object instance drawing routine. */
+/* context is the instance information passed down from above */
+/* theinstance is the object instance to be drawn */
+/* level is the level of recursion */
+/* passcolor is the inherited color value passed to object */
+/* passwidth is the inherited linewidth value passed to the object */
+/* stack contains graphics context information */
+/*----------------------------------------------------------------------*/
+
+void UDrawObject(objinstptr theinstance, short level, int passcolor,
+ float passwidth, pushlistptr *stack)
+{
+ genericptr *areagen;
+ float tmpwidth;
+ int defaultcolor = passcolor;
+ int curcolor = passcolor;
+ int thispart;
+ short savesel;
+ XPoint bboxin[2], bboxout[2];
+ u_char xm, ym;
+ objectptr theobject = theinstance->thisobject;
+
+ if (!areawin->redraw_ongoing) {
+ areawin->redraw_needed = True;
+ return;
+ }
+
+ /* Save the number of selections and set it to zero while we do the */
+ /* object drawing. */
+
+ savesel = areawin->selects;
+ areawin->selects = 0;
+
+ /* All parts are given in the coordinate system of the object, unless */
+ /* this is the top-level object, in which they will be interpreted as */
+ /* relative to the screen. */
+
+ UPushCTM();
+
+ if (level != 0)
+ UPreMultCTM(DCTM, theinstance->position, theinstance->scale,
+ theinstance->rotation);
+
+ if (theinstance->style & LINE_INVARIANT)
+ passwidth /= fabs(theinstance->scale);
+
+ /* do a quick test for intersection with the display window */
+
+ bboxin[0].x = theobject->bbox.lowerleft.x;
+ bboxin[0].y = theobject->bbox.lowerleft.y;
+ bboxin[1].x = theobject->bbox.lowerleft.x + theobject->bbox.width;
+ bboxin[1].y = theobject->bbox.lowerleft.y + theobject->bbox.height;
+ if (level == 0)
+ extendschembbox(theinstance, &(bboxin[0]), &(bboxin[1]));
+ UTransformbyCTM(DCTM, bboxin, bboxout, 2);
+
+ xm = (bboxout[0].x < bboxout[1].x) ? 0 : 1;
+ ym = (bboxout[0].y < bboxout[1].y) ? 0 : 1;
+
+ if (bboxout[xm].x < areawin->width && bboxout[ym].y < areawin->height &&
+ bboxout[1 - xm].x > 0 && bboxout[1 - ym].y > 0) {
+
+ /* make parameter substitutions */
+ psubstitute(theinstance);
+
+ /* draw all of the elements */
+
+ tmpwidth = UTopTransScale(passwidth);
+ cairo_set_line_width(areawin->cr, tmpwidth);
+ cairo_set_dash(areawin->cr, NULL, 0, 0.);
+ cairo_set_line_cap(areawin->cr, CAIRO_LINE_CAP_ROUND);
+ cairo_set_line_join(areawin->cr, CAIRO_LINE_JOIN_BEVEL);
+
+ /* guard against plist being regenerated during a redraw by the */
+ /* expression parameter mechanism (should that be prohibited?) */
+
+ for (thispart = 0; thispart < theobject->parts; thispart++) {
+ areagen = theobject->plist + thispart;
+ if ((*areagen)->type & DRAW_HIDE) continue;
+
+ if (defaultcolor != DOFORALL) {
+ if ((*areagen)->color != curcolor) {
+ if ((*areagen)->color == DEFAULTCOLOR)
+ curcolor = defaultcolor;
+ else
+ curcolor = (*areagen)->color;
+
+ XcTopSetForeground(curcolor);
+ }
+ }
+
+ switch(ELEMENTTYPE(*areagen)) {
+ case(POLYGON):
+ if (level == 0 || !((TOPOLY(areagen))->style & BBOX))
+ UDrawPolygon(TOPOLY(areagen), passwidth);
+ break;
+
+ case(SPLINE):
+ UDrawSpline(TOSPLINE(areagen), passwidth);
+ break;
+
+ case(ARC):
+ UDrawArc(TOARC(areagen), passwidth);
+ break;
+
+ case(PATH):
+ UDrawPath(TOPATH(areagen), passwidth);
+ break;
+
+ case(GRAPHIC):
+ UDrawGraphic(TOGRAPHIC(areagen));
+ break;
+
+ case(OBJINST):
+ UDrawObject(TOOBJINST(areagen), level + 1, curcolor, passwidth, stack);
+ break;
+
+ case(LABEL):
+ if (level == 0 || TOLABEL(areagen)->pin == False)
+ UDrawString(TOLABEL(areagen), curcolor, theinstance);
+ else if ((TOLABEL(areagen)->justify & PINVISIBLE) && areawin->pinpointon)
+ UDrawString(TOLABEL(areagen), curcolor, theinstance);
+ else if (TOLABEL(areagen)->justify & PINVISIBLE)
+ UDrawStringNoX(TOLABEL(areagen), curcolor, theinstance);
+ else if (level == 1 && TOLABEL(areagen)->pin &&
+ TOLABEL(areagen)->pin != INFO && areawin->pinpointon)
+ UDrawXDown(TOLABEL(areagen));
+ break;
+ }
+ }
+
+ /* restore the color passed to the object, if different from current color */
+
+ if ((defaultcolor != DOFORALL) && (passcolor != curcolor))
+ XTopSetForeground(passcolor);
+ }
+
+ /* restore the selection list (if any) */
+ areawin->selects = savesel;
+ UPopCTM();
+}
+
+/*-------------------------------------------------------------------------*/
+
+static void xc_cairo_strokepath(short style, float width)
+{
+ float tmpwidth;
+
+ if (!(style & CLIPMASK) || (areawin->showclipmasks == TRUE)) {
+ if (style & FILLED || (!(style & FILLED) && style & OPAQUE)) {
+ if ((style & FILLSOLID) == FILLSOLID)
+ cairo_fill_preserve(areawin->cr);
+ else {
+ double red, green, blue, alpha;
+ cairo_pattern_get_rgba(cairo_get_source(areawin->cr),
+ &red, &green, &blue, &alpha);
+ if (!(style & FILLED))
+ cairo_set_source_rgba(areawin->cr, 1., 1., 1., alpha);
+ else {
+ double m = (1 + ((style & FILLSOLID) >> 5)) / 8.;
+ if (style & OPAQUE) {
+ double n = (1. - m);
+ cairo_set_source_rgba(areawin->cr, m * red + n,
+ m * green + n, m * blue + n, alpha);
+ }
+ else
+ cairo_set_source_rgba(areawin->cr, red, green, blue,
+ m * alpha);
+ }
+ cairo_fill_preserve(areawin->cr);
+ cairo_set_source_rgba(areawin->cr, red, green, blue, alpha);
+ }
+ }
+ if (!(style & NOBORDER)) {
+ cairo_set_line_width(areawin->cr, width);
+ cairo_set_line_join(areawin->cr, (style & SQUARECAP) ?
+ CAIRO_LINE_JOIN_MITER : CAIRO_LINE_JOIN_BEVEL);
+ if (style & (DASHED | DOTTED)) {
+ double dashes[2] = {4.0 * width, 4.0 * width};
+ if (style & DOTTED)
+ dashes[0] = width;
+ cairo_set_dash(areawin->cr, dashes, 2, 0.0);
+ cairo_set_line_width(areawin->cr, width);
+ cairo_set_line_cap(areawin->cr, CAIRO_LINE_CAP_BUTT);
+ }
+ else {
+ cairo_set_dash(areawin->cr, NULL, 0, 0.0);
+ cairo_set_line_cap(areawin->cr, (style & SQUARECAP) ?
+ CAIRO_LINE_CAP_SQUARE : CAIRO_LINE_CAP_ROUND);
+ }
+
+ /* draw the spline and close off if so specified */
+ if (!(style & UNCLOSED))
+ cairo_close_path(areawin->cr);
+ cairo_stroke_preserve(areawin->cr);
+ }
+ }
+ if (style & CLIPMASK)
+ cairo_clip_preserve(areawin->cr);
+ cairo_new_path(areawin->cr); // clear preserved paths
+}
+
+/*-------------------------------------------------------------------------*/
+
+void UDrawPolygon(polyptr thepoly, float passwidth)
+{
+ int i;
+
+ if (!areawin->redraw_ongoing) {
+ areawin->redraw_needed = True;
+ return;
+ }
+
+ if (thepoly->number) {
+ cairo_move_to(areawin->cr, thepoly->points[0].x, thepoly->points[0].y);
+ for (i = 1; i < thepoly->number; i++)
+ cairo_line_to(areawin->cr, thepoly->points[i].x, thepoly->points[i].y);
+ xc_cairo_strokepath(thepoly->style, thepoly->width * passwidth);
+ }
+}
+
+/*-------------------------------------------------------------------------*/
+
+void UDrawArc(arcptr thearc, float passwidth)
+{
+ XPoint tmppoints[RSTEPS + 2];
+ float scaledwidth;
+
+ if (!areawin->redraw_ongoing) {
+ areawin->redraw_needed = True;
+ return;
+ }
+
+ scaledwidth = thearc->width * passwidth;
+
+ if (abs(thearc->radius) == thearc->yaxis)
+ cairo_arc(areawin->cr, thearc->position.x, thearc->position.y,
+ abs(thearc->radius), thearc->angle1 * M_PI / 180.0,
+ thearc->angle2 * M_PI / 180.0);
+ else {
+ // perform elliptical arc, as described in cairo manual
+ cairo_save(areawin->cr);
+ cairo_translate(areawin->cr, thearc->position.x, thearc->position.y);
+ cairo_scale(areawin->cr, abs(thearc->radius), thearc->yaxis);
+ cairo_arc(areawin->cr, 0.0, 0.0, 1.0, thearc->angle1 * M_PI / 180.0,
+ thearc->angle2 * M_PI / 180.0);
+ cairo_restore(areawin->cr);
+ }
+ xc_cairo_strokepath(thearc->style, thearc->width * passwidth);
+ if (thearc->cycle != NULL) {
+ UDrawXLine(thearc->position, areawin->save);
+ }
+}
+
+/*-------------------------------------------------------------------------*/
+
+void UDrawPath(pathptr thepath, float passwidth)
+{
+ genericptr *genpath;
+ polyptr thepoly;
+ splineptr thespline;
+ Boolean draweditlines = FALSE;
+
+ if (!areawin->redraw_ongoing) {
+ areawin->redraw_needed = True;
+ return;
+ }
+
+ /* First pass---check for any splines that are being edited. If */
+ /* any one is, then draw all control points for all splines in the */
+ /* path. */
+
+ for (genpath = thepath->plist; genpath < thepath->plist + thepath->parts;
+ genpath++) {
+ if (ELEMENTTYPE(*genpath) == SPLINE) {
+ thespline = TOSPLINE(genpath);
+ if (thespline->cycle != NULL) {
+ draweditlines = TRUE;
+ break;
+ }
+ }
+ }
+
+ /* Draw first point */
+ if (thepath->parts) {
+ genpath = thepath->plist;
+ switch(ELEMENTTYPE(*genpath)) {
+ case POLYGON:
+ thepoly = TOPOLY(genpath);
+ cairo_move_to(areawin->cr, thepoly->points[0].x,
+ thepoly->points[0].y);
+ break;
+ case SPLINE:
+ thespline = TOSPLINE(genpath);
+ cairo_move_to(areawin->cr, thespline->ctrl[0].x,
+ thespline->ctrl[0].y);
+ break;
+ }
+ }
+ /* Draw all other points */
+ for (genpath = thepath->plist; genpath < thepath->plist + thepath->parts;
+ genpath++) {
+ int i;
+ switch(ELEMENTTYPE(*genpath)) {
+ case POLYGON:
+ thepoly = TOPOLY(genpath);
+ for (i = 1; i < thepoly->number; i++)
+ cairo_line_to(areawin->cr, thepoly->points[i].x,
+ thepoly->points[i].y);
+ break;
+ case SPLINE:
+ thespline = TOSPLINE(genpath);
+ cairo_curve_to(areawin->cr, thespline->ctrl[1].x,
+ thespline->ctrl[1].y, thespline->ctrl[2].x,
+ thespline->ctrl[2].y, thespline->ctrl[3].x,
+ thespline->ctrl[3].y);
+ break;
+ }
+ }
+ xc_cairo_strokepath(thepath->style, thepath->width * passwidth);
+ /* Finally draw the edit lines */
+ if (draweditlines) {
+ for (genpath = thepath->plist; genpath < thepath->plist + thepath->parts;
+ genpath++) {
+ if (ELEMENTTYPE(*genpath) == SPLINE) {
+ thespline = TOSPLINE(genpath);
+ UDrawXLine(thespline->ctrl[0], thespline->ctrl[1]);
+ UDrawXLine(thespline->ctrl[3], thespline->ctrl[2]);
+ }
+ }
+ }
+}
+
+/*-------------------------------------------------------------------------*/
+
+void UDrawSpline(splineptr thespline, float passwidth)
+{
+ if (!areawin->redraw_ongoing) {
+ areawin->redraw_needed = True;
+ return;
+ }
+
+ cairo_move_to(areawin->cr, thespline->ctrl[0].x, thespline->ctrl[0].y);
+ cairo_curve_to(areawin->cr, thespline->ctrl[1].x, thespline->ctrl[1].y,
+ thespline->ctrl[2].x, thespline->ctrl[2].y,
+ thespline->ctrl[3].x, thespline->ctrl[3].y);
+ xc_cairo_strokepath(thespline->style, thespline->width * passwidth);
+ if (thespline->cycle != NULL) {
+ UDrawXLine(thespline->ctrl[0], thespline->ctrl[1]);
+ UDrawXLine(thespline->ctrl[3], thespline->ctrl[2]);
+ }
+}
+
+/*-------------------------------------------------------------------------*/
+
+void UDrawGraphic(graphicptr gp)
+{
+ if (!areawin->redraw_ongoing) {
+ areawin->redraw_needed = True;
+ return;
+ }
+
+ cairo_save(areawin->cr);
+ cairo_translate(areawin->cr,
+ gp->position.x,
+ gp->position.y);
+ cairo_rotate(areawin->cr, gp->rotation * M_PI / -180.);
+ cairo_scale(areawin->cr, gp->scale, -gp->scale);
+ cairo_set_source_surface(areawin->cr, gp->source,
+ - cairo_image_surface_get_width(gp->source) / 2.,
+ - cairo_image_surface_get_height(gp->source) / 2.);
+ cairo_paint(areawin->cr);
+ cairo_restore(areawin->cr);
+}
+
+/*----------------------------*/
+/* Draw the grids, axis, etc. */
+/*----------------------------*/
+
+void draw_grids(void)
+{
+ double spc, spc2, spc3;
+ cairo_matrix_t m = {
+ .xx = 1., .yx = 0., .xy = 0., .yy = -1.,
+ .x0 = -areawin->pcorner.x * areawin->vscale,
+ .y0 = areawin->height + areawin->pcorner.y * areawin->vscale
+ };
+
+ if (!areawin->redraw_ongoing) {
+ areawin->redraw_needed = True;
+ return;
+ }
+
+ cairo_save(areawin->cr);
+
+ /* draw lines for grid */
+ spc = xobjs.pagelist[areawin->page]->gridspace * areawin->vscale;
+ if (areawin->gridon && spc > 8) {
+ double x, y;
+ int ix, iy;
+ /* find bottom-right point on the grid */
+ double xbegin = areawin->width;
+ double ybegin = areawin->height;
+ cairo_set_matrix(areawin->cr, &m);
+ cairo_scale(areawin->cr, spc, spc);
+ cairo_device_to_user(areawin->cr, &xbegin, &ybegin);
+ xbegin = floor(xbegin);
+ ybegin = ceil(ybegin);
+ ix = xbegin;
+ iy = ybegin;
+ cairo_user_to_device(areawin->cr, &xbegin, &ybegin);
+ cairo_identity_matrix(areawin->cr);
+ /* draw the grid */
+ xc_cairo_set_color(GRIDCOLOR);
+ cairo_set_line_width(areawin->cr, 1.);
+ for (x = xbegin; x >= 0.; x -= spc, ix--) {
+ if (!ix && areawin->axeson) continue; /* do not draw main axis */
+ cairo_move_to(areawin->cr, floor(x) + .5, .5);
+ cairo_line_to(areawin->cr, floor(x) + .5, areawin->height + .5);
+ }
+ for (y = ybegin; y >= 0.; y -= spc, iy++) {
+ if (!iy && areawin->axeson) continue; /* do not draw main axis */
+ cairo_move_to(areawin->cr, .5, floor(y) + .5);
+ cairo_line_to(areawin->cr, areawin->width + .5, floor(y) + .5);
+ }
+ cairo_stroke(areawin->cr);
+ }
+
+
+ if (areawin->axeson) {
+ /* find main axis */
+ double x = 0, y = 0;
+ cairo_set_matrix(areawin->cr, &m);
+ cairo_user_to_device(areawin->cr, &x, &y);
+ cairo_identity_matrix(areawin->cr);
+ /* draw the grid */
+ xc_cairo_set_color(AXESCOLOR);
+ cairo_set_line_width(areawin->cr, 1.);
+ cairo_move_to(areawin->cr, floor(x) + .5, .5);
+ cairo_line_to(areawin->cr, floor(x) + .5, areawin->height + .5);
+ cairo_move_to(areawin->cr, .5, floor(y) + .5);
+ cairo_line_to(areawin->cr, areawin->width + .5, floor(y) + .5);
+ cairo_stroke(areawin->cr);
+ }
+
+ /* bounding box goes beneath everything except grid/axis lines */
+ UDrawBBox();
+
+ /* draw a little red dot at each snap-to point */
+ spc2 = xobjs.pagelist[areawin->page]->snapspace * areawin->vscale;
+ if (areawin->snapto && spc2 > 8) {
+ double x, y;
+ /* find bottom-right point on the grid */
+ double xbegin = areawin->width;
+ double ybegin = areawin->height;
+ cairo_set_matrix(areawin->cr, &m);
+ cairo_scale(areawin->cr, spc2, spc2);
+ cairo_device_to_user(areawin->cr, &xbegin, &ybegin);
+ xbegin = floor(xbegin);
+ ybegin = ceil(ybegin);
+ cairo_user_to_device(areawin->cr, &xbegin, &ybegin);
+ cairo_identity_matrix(areawin->cr);
+ /* draw the grid */
+ xc_cairo_set_color(SNAPCOLOR);
+ cairo_set_line_width(areawin->cr, 1.);
+ cairo_set_line_cap(areawin->cr, CAIRO_LINE_CAP_ROUND);
+ for (x = xbegin; x >= 0.; x -= spc2) {
+ for (y = ybegin; y >= 0.; y -= spc2) {
+ cairo_move_to(areawin->cr, floor(x) + .5, floor(y) + .5);
+ cairo_close_path(areawin->cr);
+ }
+ }
+ cairo_stroke(areawin->cr);
+ }
+
+ /* Draw major snap points */
+ spc3 = spc * 20.;
+ if (spc > 4.) {
+ double x, y;
+ /* find bottom-right point on the grid */
+ double xbegin = areawin->width;
+ double ybegin = areawin->height;
+ cairo_set_matrix(areawin->cr, &m);
+ cairo_scale(areawin->cr, spc3, spc3);
+ cairo_device_to_user(areawin->cr, &xbegin, &ybegin);
+ xbegin = floor(xbegin);
+ ybegin = ceil(ybegin);
+ cairo_user_to_device(areawin->cr, &xbegin, &ybegin);
+ cairo_identity_matrix(areawin->cr);
+ /* draw the grid */
+ xc_cairo_set_color(GRIDCOLOR);
+ cairo_set_line_width(areawin->cr, 3.);
+ cairo_set_line_cap(areawin->cr, CAIRO_LINE_CAP_ROUND);
+ for (x = xbegin; x >= 0.; x -= spc3) {
+ for (y = ybegin; y >= 0.; y -= spc3) {
+ cairo_move_to(areawin->cr, floor(x) + .5, floor(y) + .5);
+ cairo_close_path(areawin->cr);
+ }
+ }
+ cairo_stroke(areawin->cr);
+ }
+ cairo_restore(areawin->cr);
+}
+
+/*---------------------------------------------------------------------*/
+/* draw a single character at 0, 0 using current transformation matrix */
+/*---------------------------------------------------------------------*/
+
+float UDrawChar(u_char code, short styles, short ffont, int groupheight,
+ int passcolor, float passwidth)
+{
+ objectptr drawchar;
+ XPoint alphapts[2];
+ float localwidth;
+ objinst charinst;
+
+ if (!areawin->redraw_ongoing) {
+ areawin->redraw_needed = True;
+ /* No return here, since the return value might be needed? */
+ }
+
+ if ((ffont >= fontcount) || (fonts[ffont].encoding == NULL))
+ return 0;
+
+ alphapts[0].x = 0;
+ alphapts[0].y = 0;
+ charinst.type = OBJINST;
+ charinst.color = DEFAULTCOLOR;
+ charinst.rotation = 0;
+ charinst.scale = fonts[ffont].scale;
+ charinst.position = alphapts[0];
+ charinst.params = NULL;
+
+ /* get proper font and character */
+
+ drawchar = fonts[ffont].encoding[(u_char)code];
+ charinst.thisobject = drawchar;
+
+ if (fonts[ffont].cairo_family) {
+ cairo_save(areawin->cr);
+ cairo_text_extents_t extents;
+ cairo_select_font_face(areawin->cr, fonts[ffont].cairo_family,
+ fonts[ffont].slant, fonts[ffont].weight);
+ }
+
+ if (!fonts[ffont].cairo_family && (fonts[ffont].flags & 0x22) == 0x22) {
+ /* font is not a cairo font and it is derived and italic */
+ USlantCTM(DCTM, 0.25); /* premultiply by slanting function */
+ }
+
+ /* Draw glyph */
+ if (!(styles & 64) && areawin->redraw_ongoing) {
+ if (fonts[ffont].cairo_family) {
+ cairo_set_font_size (areawin->cr, 40.); /* TODO: Why 40? */
+ cairo_scale(areawin->cr, 1., -1.);
+ cairo_move_to (areawin->cr, 0., 0.);
+ cairo_show_text(areawin->cr, fonts[ffont].utf8encoding[code]);
+ cairo_new_path(areawin->cr);
+ }
+ else
+ UDrawObject(&charinst, SINGLE, passcolor, passwidth, NULL);
+ }
+
+ /* Determine character width */
+ if (fonts[ffont].cairo_family) {
+ /* Determine localwidth on a fixed font size of 100, to prevent hinting */
+ /* from destroying scale independance */
+ cairo_text_extents_t extents;
+ cairo_identity_matrix(areawin->cr);
+ cairo_set_font_size(areawin->cr, 100.);
+ cairo_text_extents(areawin->cr, fonts[ffont].utf8encoding[code],
+ &extents);
+ localwidth = extents.x_advance * fonts[ffont].scale / 100. * 40.; /* TODO: Why 40? */
+ cairo_restore(areawin->cr);
+ }
+ else
+ localwidth = (drawchar->bbox.lowerleft.x + drawchar->bbox.width)
+ * fonts[ffont].scale;
+
+ /* under- and overlines */
+ if (!(styles & 64)) {
+ if (styles & 8)
+ alphapts[0].y = alphapts[1].y = -6;
+ else if (styles & 16)
+ alphapts[0].y = alphapts[1].y = groupheight + 4;
+ if (styles & 24 && areawin->redraw_ongoing) {
+ alphapts[0].x = 0; alphapts[1].x = localwidth;
+ cairo_set_line_width(areawin->cr, passwidth);
+ cairo_move_to(areawin->cr, alphapts[0].x, alphapts[0].y);
+ cairo_line_to(areawin->cr, alphapts[1].x, alphapts[1].y);
+ cairo_stroke(areawin->cr);
+ }
+ }
+ return localwidth;
+}
+
+float xc_cairo_get_char_extents(const fontinfo *font, unsigned char c,
+ float *top, float *bottom)
+{
+ /* Determine localwidth on a fixed font size of 100, to */
+ /* prevent hinting from destroying scale independance */
+ cairo_text_extents_t extents;
+ cairo_save(areawin->cr);
+ cairo_identity_matrix(areawin->cr);
+ cairo_select_font_face(areawin->cr, font->cairo_family, font->slant,
+ fonts->weight);
+ cairo_set_font_size(areawin->cr, 100.);
+ cairo_text_extents(areawin->cr, font->utf8encoding[c], &extents);
+ cairo_restore(areawin->cr);
+
+ if (top)
+ *top = -extents.y_bearing * 40. / 100.;
+ if (bottom)
+ *bottom = (extents.height - extents.y_bearing) * 40. / 100.;
+ return extents.x_advance * 40. / 100.; /* TODO: Why 40? */
+}
+
+/*----------------------------------------------------------------------*/
+/* A light wrapper around cairo_surface_t, to a generalized xcImage */
+/*----------------------------------------------------------------------*/
+
+/* caching for cairo_surface_t */
+static xcImage *xcImagePixel_oldimg = NULL;
+static uint32_t *xcImagePixel_data;
+static int xcImagePixel_width;
+static int xcImagePixel_height;
+
+static inline void xcImageCheckCache(xcImage *img)
+{
+ if (img != xcImagePixel_oldimg) {
+ xcImagePixel_oldimg = img;
+ xcImagePixel_data = (uint32_t*) cairo_image_surface_get_data(img);
+ xcImagePixel_width = cairo_image_surface_get_width(img);
+ xcImagePixel_height = cairo_image_surface_get_height(img);
+ }
+}
+
+xcImage *xcImageCreate(int width, int height)
+{
+ return cairo_image_surface_create(CAIRO_FORMAT_RGB24, width, height);
+}
+
+void xcImageDestroy(xcImage *img)
+{
+ cairo_surface_destroy(img);
+}
+
+int xcImageGetWidth(xcImage *img)
+{
+ xcImageCheckCache(img);
+ return xcImagePixel_width;
+}
+
+int xcImageGetHeight(xcImage *img)
+{
+ xcImageCheckCache(img);
+ return xcImagePixel_height;
+}
+
+void xcImagePutPixel(xcImage *img, int x, int y, u_char r, u_char g, u_char b)
+{
+ xcImageCheckCache(img);
+ xcImagePixel_data[y * xcImagePixel_width + x] = (r << 16) | (g << 8) | b;
+}
+
+void xcImageGetPixel(xcImage *img, int x, int y, u_char *r, u_char *g,
+ u_char *b)
+{
+ xcImageCheckCache(img);
+ uint32_t argb = xcImagePixel_data[y * xcImagePixel_width + x];
+ *r = argb >> 16;
+ *g = argb >> 8;
+ *b = argb;
+}
+
+#endif /* HAVE_CAIRO */
diff --git a/colordefs.h b/colordefs.h
index c726855..1dd1a57 100644
--- a/colordefs.h
+++ b/colordefs.h
@@ -11,26 +11,26 @@
#define NUMBER_OF_COLORS 17
-#define BACKGROUND appcolors[0]
-#define FOREGROUND appcolors[1]
-#define SELECTCOLOR appcolors[2]
-#define FILTERCOLOR appcolors[3]
-#define GRIDCOLOR appcolors[4]
-#define SNAPCOLOR appcolors[5]
-#define AXESCOLOR appcolors[6]
-#define OFFBUTTONCOLOR appcolors[7]
-#define AUXCOLOR appcolors[8]
-#define BARCOLOR appcolors[9]
-#define PARAMCOLOR appcolors[10]
+#define BACKGROUND 0
+#define FOREGROUND 1
+#define SELECTCOLOR 2
+#define FILTERCOLOR 3
+#define GRIDCOLOR 4
+#define SNAPCOLOR 5
+#define AXESCOLOR 6
+#define OFFBUTTONCOLOR 7
+#define AUXCOLOR 8
+#define BARCOLOR 9
+#define PARAMCOLOR 10
/* The rest of the colors are layout colors, not GUI colors */
-#define BBOXCOLOR appcolors[11]
-#define LOCALPINCOLOR appcolors[12]
-#define GLOBALPINCOLOR appcolors[13]
-#define INFOLABELCOLOR appcolors[14]
-#define RATSNESTCOLOR appcolors[15]
-#define CLIPMASKCOLOR appcolors[15]
+#define BBOXCOLOR 11
+#define LOCALPINCOLOR 12
+#define GLOBALPINCOLOR 13
+#define INFOLABELCOLOR 14
+#define RATSNESTCOLOR 15
+#define CLIPMASKCOLOR 16
#define DEFAULTCOLOR -1 /* Inherits color of parent */
#define DOFORALL -2 /* All elements inherit same color */
diff --git a/compile b/compile
new file mode 100755
index 0000000..531136b
--- /dev/null
+++ b/compile
@@ -0,0 +1,347 @@
+#! /bin/sh
+# Wrapper for compilers which do not understand '-c -o'.
+
+scriptversion=2012-10-14.11; # UTC
+
+# Copyright (C) 1999-2013 Free Software Foundation, Inc.
+# Written by Tom Tromey <tromey@cygnus.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, 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, see <http://www.gnu.org/licenses/>.
+
+# 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.
+
+# This file is maintained in Automake, please report
+# bugs to <bug-automake@gnu.org> or send patches to
+# <automake-patches@gnu.org>.
+
+nl='
+'
+
+# We need space, tab and new line, in precisely that order. Quoting is
+# there to prevent tools from complaining about whitespace usage.
+IFS=" "" $nl"
+
+file_conv=
+
+# func_file_conv build_file lazy
+# Convert a $build file to $host form and store it in $file
+# Currently only supports Windows hosts. If the determined conversion
+# type is listed in (the comma separated) LAZY, no conversion will
+# take place.
+func_file_conv ()
+{
+ file=$1
+ case $file in
+ / | /[!/]*) # absolute file, and not a UNC file
+ if test -z "$file_conv"; then
+ # lazily determine how to convert abs files
+ case `uname -s` in
+ MINGW*)
+ file_conv=mingw
+ ;;
+ CYGWIN*)
+ file_conv=cygwin
+ ;;
+ *)
+ file_conv=wine
+ ;;
+ esac
+ fi
+ case $file_conv/,$2, in
+ *,$file_conv,*)
+ ;;
+ mingw/*)
+ file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'`
+ ;;
+ cygwin/*)
+ file=`cygpath -m "$file" || echo "$file"`
+ ;;
+ wine/*)
+ file=`winepath -w "$file" || echo "$file"`
+ ;;
+ esac
+ ;;
+ esac
+}
+
+# func_cl_dashL linkdir
+# Make cl look for libraries in LINKDIR
+func_cl_dashL ()
+{
+ func_file_conv "$1"
+ if test -z "$lib_path"; then
+ lib_path=$file
+ else
+ lib_path="$lib_path;$file"
+ fi
+ linker_opts="$linker_opts -LIBPATH:$file"
+}
+
+# func_cl_dashl library
+# Do a library search-path lookup for cl
+func_cl_dashl ()
+{
+ lib=$1
+ found=no
+ save_IFS=$IFS
+ IFS=';'
+ for dir in $lib_path $LIB
+ do
+ IFS=$save_IFS
+ if $shared && test -f "$dir/$lib.dll.lib"; then
+ found=yes
+ lib=$dir/$lib.dll.lib
+ break
+ fi
+ if test -f "$dir/$lib.lib"; then
+ found=yes
+ lib=$dir/$lib.lib
+ break
+ fi
+ if test -f "$dir/lib$lib.a"; then
+ found=yes
+ lib=$dir/lib$lib.a
+ break
+ fi
+ done
+ IFS=$save_IFS
+
+ if test "$found" != yes; then
+ lib=$lib.lib
+ fi
+}
+
+# func_cl_wrapper cl arg...
+# Adjust compile command to suit cl
+func_cl_wrapper ()
+{
+ # Assume a capable shell
+ lib_path=
+ shared=:
+ linker_opts=
+ for arg
+ do
+ if test -n "$eat"; then
+ eat=
+ else
+ case $1 in
+ -o)
+ # configure might choose to run compile as 'compile cc -o foo foo.c'.
+ eat=1
+ case $2 in
+ *.o | *.[oO][bB][jJ])
+ func_file_conv "$2"
+ set x "$@" -Fo"$file"
+ shift
+ ;;
+ *)
+ func_file_conv "$2"
+ set x "$@" -Fe"$file"
+ shift
+ ;;
+ esac
+ ;;
+ -I)
+ eat=1
+ func_file_conv "$2" mingw
+ set x "$@" -I"$file"
+ shift
+ ;;
+ -I*)
+ func_file_conv "${1#-I}" mingw
+ set x "$@" -I"$file"
+ shift
+ ;;
+ -l)
+ eat=1
+ func_cl_dashl "$2"
+ set x "$@" "$lib"
+ shift
+ ;;
+ -l*)
+ func_cl_dashl "${1#-l}"
+ set x "$@" "$lib"
+ shift
+ ;;
+ -L)
+ eat=1
+ func_cl_dashL "$2"
+ ;;
+ -L*)
+ func_cl_dashL "${1#-L}"
+ ;;
+ -static)
+ shared=false
+ ;;
+ -Wl,*)
+ arg=${1#-Wl,}
+ save_ifs="$IFS"; IFS=','
+ for flag in $arg; do
+ IFS="$save_ifs"
+ linker_opts="$linker_opts $flag"
+ done
+ IFS="$save_ifs"
+ ;;
+ -Xlinker)
+ eat=1
+ linker_opts="$linker_opts $2"
+ ;;
+ -*)
+ set x "$@" "$1"
+ shift
+ ;;
+ *.cc | *.CC | *.cxx | *.CXX | *.[cC]++)
+ func_file_conv "$1"
+ set x "$@" -Tp"$file"
+ shift
+ ;;
+ *.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO])
+ func_file_conv "$1" mingw
+ set x "$@" "$file"
+ shift
+ ;;
+ *)
+ set x "$@" "$1"
+ shift
+ ;;
+ esac
+ fi
+ shift
+ done
+ if test -n "$linker_opts"; then
+ linker_opts="-link$linker_opts"
+ fi
+ exec "$@" $linker_opts
+ exit 1
+}
+
+eat=
+
+case $1 in
+ '')
+ echo "$0: No command. Try '$0 --help' for more information." 1>&2
+ exit 1;
+ ;;
+ -h | --h*)
+ cat <<\EOF
+Usage: compile [--help] [--version] PROGRAM [ARGS]
+
+Wrapper for compilers which do not understand '-c -o'.
+Remove '-o dest.o' from ARGS, run PROGRAM with the remaining
+arguments, and rename the output as expected.
+
+If you are trying to build a whole package this is not the
+right script to run: please start by reading the file 'INSTALL'.
+
+Report bugs to <bug-automake@gnu.org>.
+EOF
+ exit $?
+ ;;
+ -v | --v*)
+ echo "compile $scriptversion"
+ exit $?
+ ;;
+ cl | *[/\\]cl | cl.exe | *[/\\]cl.exe )
+ func_cl_wrapper "$@" # Doesn't return...
+ ;;
+esac
+
+ofile=
+cfile=
+
+for arg
+do
+ if test -n "$eat"; then
+ eat=
+ else
+ case $1 in
+ -o)
+ # configure might choose to run compile as 'compile cc -o foo foo.c'.
+ # So we strip '-o arg' only if arg is an object.
+ eat=1
+ case $2 in
+ *.o | *.obj)
+ ofile=$2
+ ;;
+ *)
+ set x "$@" -o "$2"
+ shift
+ ;;
+ esac
+ ;;
+ *.c)
+ cfile=$1
+ set x "$@" "$1"
+ shift
+ ;;
+ *)
+ set x "$@" "$1"
+ shift
+ ;;
+ esac
+ fi
+ shift
+done
+
+if test -z "$ofile" || test -z "$cfile"; then
+ # If no '-o' option was seen then we might have been invoked from a
+ # pattern rule where we don't need one. That is ok -- this is a
+ # normal compilation that the losing compiler can handle. If no
+ # '.c' file was seen then we are probably linking. That is also
+ # ok.
+ exec "$@"
+fi
+
+# Name of file we expect compiler to create.
+cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'`
+
+# Create the lock directory.
+# Note: use '[/\\:.-]' here to ensure that we don't use the same name
+# that we are using for the .o file. Also, base the name on the expected
+# object file name, since that is what matters with a parallel build.
+lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d
+while true; do
+ if mkdir "$lockdir" >/dev/null 2>&1; then
+ break
+ fi
+ sleep 1
+done
+# FIXME: race condition here if user kills between mkdir and trap.
+trap "rmdir '$lockdir'; exit 1" 1 2 15
+
+# Run the compile.
+"$@"
+ret=$?
+
+if test -f "$cofile"; then
+ test "$cofile" = "$ofile" || mv "$cofile" "$ofile"
+elif test -f "${cofile}bj"; then
+ test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile"
+fi
+
+rmdir "$lockdir"
+exit $ret
+
+# Local Variables:
+# mode: shell-script
+# sh-indentation: 2
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-time-zone: "UTC"
+# time-stamp-end: "; # UTC"
+# End:
diff --git a/config.status b/config.status
new file mode 100755
index 0000000..50bedac
--- /dev/null
+++ b/config.status
@@ -0,0 +1,1113 @@
+#! /bin/sh
+# Generated by configure.
+# 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-/bin/sh}
+export SHELL
+## -------------------- ##
+## M4sh Initialization. ##
+## -------------------- ##
+
+# Be more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
+ emulate sh
+ NULLCMD=:
+ # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '${1+"$@"}'='"$@"'
+ setopt NO_GLOB_SUBST
+else
+ case `(set -o) 2>/dev/null` in #(
+ *posix*) :
+ set -o posix ;; #(
+ *) :
+ ;;
+esac
+fi
+
+
+as_nl='
+'
+export as_nl
+# Printing a long string crashes Solaris 7 /usr/bin/printf.
+as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
+# Prefer a ksh shell builtin over an external printf program on Solaris,
+# but without wasting forks for bash or zsh.
+if test -z "$BASH_VERSION$ZSH_VERSION" \
+ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
+ as_echo='print -r --'
+ as_echo_n='print -rn --'
+elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
+ as_echo='printf %s\n'
+ as_echo_n='printf %s'
+else
+ if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
+ as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
+ as_echo_n='/usr/ucb/echo -n'
+ else
+ as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
+ as_echo_n_body='eval
+ arg=$1;
+ case $arg in #(
+ *"$as_nl"*)
+ expr "X$arg" : "X\\(.*\\)$as_nl";
+ arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
+ esac;
+ expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
+ '
+ export as_echo_n_body
+ as_echo_n='sh -c $as_echo_n_body as_echo'
+ fi
+ export as_echo_body
+ as_echo='sh -c $as_echo_body as_echo'
+fi
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+ PATH_SEPARATOR=:
+ (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
+ (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
+ PATH_SEPARATOR=';'
+ }
+fi
+
+
+# IFS
+# We need space, tab and new line, in precisely that order. Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+IFS=" "" $as_nl"
+
+# Find who we are. Look in the path if we contain no directory separator.
+as_myself=
+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
+IFS=$as_save_IFS
+
+ ;;
+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
+ $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+ exit 1
+fi
+
+# Unset variables that we do not need and which cause bugs (e.g. in
+# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1"
+# suppresses any "Segmentation fault" message there. '((' could
+# trigger a bug in pdksh 5.2.14.
+for as_var in BASH_ENV ENV MAIL MAILPATH
+do eval test x\${$as_var+set} = xset \
+ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
+done
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+LC_ALL=C
+export LC_ALL
+LANGUAGE=C
+export LANGUAGE
+
+# CDPATH.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+
+# as_fn_error STATUS ERROR [LINENO LOG_FD]
+# ----------------------------------------
+# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
+# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
+# script with STATUS, using 1 if that was 0.
+as_fn_error ()
+{
+ as_status=$1; test $as_status -eq 0 && as_status=1
+ if test "$4"; then
+ as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
+ fi
+ $as_echo "$as_me: error: $2" >&2
+ as_fn_exit $as_status
+} # as_fn_error
+
+
+# as_fn_set_status STATUS
+# -----------------------
+# Set $? to STATUS, without forking.
+as_fn_set_status ()
+{
+ return $1
+} # as_fn_set_status
+
+# as_fn_exit STATUS
+# -----------------
+# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
+as_fn_exit ()
+{
+ set +e
+ as_fn_set_status $1
+ exit $1
+} # as_fn_exit
+
+# as_fn_unset VAR
+# ---------------
+# Portably unset VAR.
+as_fn_unset ()
+{
+ { eval $1=; unset $1;}
+}
+as_unset=as_fn_unset
+# as_fn_append VAR VALUE
+# ----------------------
+# Append the text in VALUE to the end of the definition contained in VAR. Take
+# advantage of any shell optimizations that allow amortized linear growth over
+# repeated appends, instead of the typical quadratic growth present in naive
+# implementations.
+if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
+ eval 'as_fn_append ()
+ {
+ eval $1+=\$2
+ }'
+else
+ as_fn_append ()
+ {
+ eval $1=\$$1\$2
+ }
+fi # as_fn_append
+
+# as_fn_arith ARG...
+# ------------------
+# Perform arithmetic evaluation on the ARGs, and store the result in the
+# global $as_val. Take advantage of shells that can avoid forks. The arguments
+# must be portable across $(()) and expr.
+if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
+ eval 'as_fn_arith ()
+ {
+ as_val=$(( $* ))
+ }'
+else
+ as_fn_arith ()
+ {
+ as_val=`expr "$@" || test $? -eq 1`
+ }
+fi # as_fn_arith
+
+
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+ test "X`expr 00001 : '.*\(...\)'`" = X001; 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
+
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+ as_dirname=dirname
+else
+ as_dirname=false
+fi
+
+as_me=`$as_basename -- "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+ X"$0" : 'X\(//\)$' \| \
+ X"$0" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X/"$0" |
+ sed '/^.*\/\([^/][^/]*\)\/*$/{
+ s//\1/
+ q
+ }
+ /^X\/\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\/\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+
+# 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
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in #(((((
+-n*)
+ case `echo 'xy\c'` in
+ *c*) ECHO_T=' ';; # ECHO_T is single tab character.
+ xy) ECHO_C='\c';;
+ *) echo `echo ksh88 bug on AIX 6.1` > /dev/null
+ ECHO_T=' ';;
+ esac;;
+*)
+ ECHO_N='-n';;
+esac
+
+rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+ rm -f conf$$.dir/conf$$.file
+else
+ rm -f conf$$.dir
+ mkdir conf$$.dir 2>/dev/null
+fi
+if (echo >conf$$.file) 2>/dev/null; then
+ if ln -s conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s='ln -s'
+ # ... but there are two gotchas:
+ # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+ # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+ # In both cases, we have to default to `cp -pR'.
+ ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+ as_ln_s='cp -pR'
+ elif ln conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s=ln
+ else
+ as_ln_s='cp -pR'
+ fi
+else
+ as_ln_s='cp -pR'
+fi
+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
+
+
+# as_fn_mkdir_p
+# -------------
+# Create "$as_dir" as a directory, including parents if necessary.
+as_fn_mkdir_p ()
+{
+
+ case $as_dir in #(
+ -*) as_dir=./$as_dir;;
+ esac
+ test -d "$as_dir" || eval $as_mkdir_p || {
+ as_dirs=
+ while :; do
+ case $as_dir in #(
+ *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
+ *) as_qdir=$as_dir;;
+ esac
+ as_dirs="'$as_qdir' $as_dirs"
+ as_dir=`$as_dirname -- "$as_dir" ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$as_dir" : 'X\(//\)[^/]' \| \
+ X"$as_dir" : 'X\(//\)$' \| \
+ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_dir" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ test -d "$as_dir" && break
+ done
+ test -z "$as_dirs" || eval "mkdir $as_dirs"
+ } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
+
+
+} # as_fn_mkdir_p
+if mkdir -p . 2>/dev/null; then
+ as_mkdir_p='mkdir -p "$as_dir"'
+else
+ test -d ./-p && rmdir ./-p
+ as_mkdir_p=false
+fi
+
+
+# as_fn_executable_p FILE
+# -----------------------
+# Test if FILE is an executable regular file.
+as_fn_executable_p ()
+{
+ test -f "$1" && test -x "$1"
+} # as_fn_executable_p
+as_test_x='test -x'
+as_executable_p=as_fn_executable_p
+
+# 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'"
+
+
+exec 6>&1
+## ----------------------------------- ##
+## Main body of $CONFIG_STATUS script. ##
+## ----------------------------------- ##
+# Save the log message, to keep $0 and so on meaningful, and to
+# report actual input values of CONFIG_FILES etc. instead of their
+# values after options handling.
+ac_log="
+This file was extended by $as_me, which was
+generated by GNU Autoconf 2.69. Invocation command line was
+
+ CONFIG_FILES = $CONFIG_FILES
+ CONFIG_HEADERS = $CONFIG_HEADERS
+ CONFIG_LINKS = $CONFIG_LINKS
+ CONFIG_COMMANDS = $CONFIG_COMMANDS
+ $ $0 $@
+
+on `(hostname || uname -n) 2>/dev/null | sed 1q`
+"
+
+# Files that config.status was made for.
+config_files=" Makefile Xw/Makefile asg/Makefile spiceparser/Makefile"
+config_commands=" depfiles"
+
+ac_cs_usage="\
+\`$as_me' instantiates files and other configuration actions
+from templates according to the current configuration. Unless the files
+and actions are specified as TAGs, all are instantiated by default.
+
+Usage: $0 [OPTION]... [TAG]...
+
+ -h, --help print this help, then exit
+ -V, --version print version number and configuration settings, then exit
+ --config print configuration, then exit
+ -q, --quiet, --silent
+ 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
+
+Configuration files:
+$config_files
+
+Configuration commands:
+$config_commands
+
+Report bugs to the package provider."
+
+ac_cs_config=""
+ac_cs_version="\
+config.status
+configured by ./configure, generated by GNU Autoconf 2.69,
+ with options \"$ac_cs_config\"
+
+Copyright (C) 2012 Free Software Foundation, Inc.
+This config.status script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it."
+
+ac_pwd='/home/tim/gitsrc/xcircuit-3.9'
+srcdir='.'
+INSTALL='/bin/install -c'
+MKDIR_P='/bin/mkdir -p'
+AWK='gawk'
+test -n "$AWK" || AWK=awk
+# The default lists apply if the user does not specify any file.
+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=`expr "X$1" : 'X\([^=]*\)='`
+ ac_optarg=
+ ac_shift=:
+ ;;
+ *)
+ ac_option=$1
+ ac_optarg=$2
+ ac_shift=shift
+ ;;
+ esac
+
+ case $ac_option in
+ # Handling of the options.
+ -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
+ ac_cs_recheck=: ;;
+ --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
+ $as_echo "$ac_cs_version"; exit ;;
+ --config | --confi | --conf | --con | --co | --c )
+ $as_echo "$ac_cs_config"; exit ;;
+ --debug | --debu | --deb | --de | --d | -d )
+ debug=: ;;
+ --file | --fil | --fi | --f )
+ $ac_shift
+ case $ac_optarg in
+ *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
+ '') as_fn_error $? "missing file argument" ;;
+ esac
+ as_fn_append CONFIG_FILES " '$ac_optarg'"
+ ac_need_defaults=false;;
+ --he | --h | --help | --hel | -h )
+ $as_echo "$ac_cs_usage"; exit ;;
+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+ | -silent | --silent | --silen | --sile | --sil | --si | --s)
+ ac_cs_silent=: ;;
+
+ # This is an error.
+ -*) as_fn_error $? "unrecognized option: \`$1'
+Try \`$0 --help' for more information." ;;
+
+ *) as_fn_append ac_config_targets " $1"
+ ac_need_defaults=false ;;
+
+ 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
+
+if $ac_cs_recheck; then
+ set X /bin/sh './configure' $ac_configure_extra_args --no-create --no-recursion
+ shift
+ $as_echo "running CONFIG_SHELL=/bin/sh $*" >&6
+ CONFIG_SHELL='/bin/sh'
+ export CONFIG_SHELL
+ exec "$@"
+fi
+
+exec 5>>config.log
+{
+ echo
+ sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
+## Running $as_me. ##
+_ASBOX
+ $as_echo "$ac_log"
+} >&5
+
+#
+# INIT-COMMANDS
+#
+AMDEP_TRUE="" ac_aux_dir="."
+
+
+# Handling of arguments.
+for ac_config_target in $ac_config_targets
+do
+ case $ac_config_target in
+ "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
+ "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
+ "Xw/Makefile") CONFIG_FILES="$CONFIG_FILES Xw/Makefile" ;;
+ "asg/Makefile") CONFIG_FILES="$CONFIG_FILES asg/Makefile" ;;
+ "spiceparser/Makefile") CONFIG_FILES="$CONFIG_FILES spiceparser/Makefile" ;;
+
+ *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
+ 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_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 against having it here, and in addition,
+# creating and moving files from /tmp can sometimes cause problems.
+# Hook for its removal unless debugging.
+# Note that there is a small window in which the directory will not be cleaned:
+# after its creation but before its name has been assigned to `$tmp'.
+$debug ||
+{
+ tmp= ac_tmp=
+ trap 'exit_status=$?
+ : "${ac_tmp:=$tmp}"
+ { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status
+' 0
+ trap 'as_fn_exit 1' 1 2 13 15
+}
+# Create a (secure) tmp directory for tmp files.
+
+{
+ tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
+ test -d "$tmp"
+} ||
+{
+ tmp=./conf$$-$RANDOM
+ (umask 077 && mkdir "$tmp")
+} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5
+ac_tmp=$tmp
+
+# Set up the scripts for CONFIG_FILES section.
+# No need to generate them if there are no CONFIG_FILES.
+# This happens for instance with `./config.status config.h'.
+if test -n "$CONFIG_FILES"; then
+
+
+ac_cr=`echo X | tr X '\015'`
+# On cygwin, bash can eat \r inside `` if the user requested igncr.
+# But we know of no other shell where ac_cr would be empty at this
+# point, so we can use a bashism as a fallback.
+if test "x$ac_cr" = x; then
+ eval ac_cr=\$\'\\r\'
+fi
+ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null`
+if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then
+ ac_cs_awk_cr='\\r'
+else
+ ac_cs_awk_cr=$ac_cr
+fi
+
+echo 'BEGIN {' >"$ac_tmp/subs1.awk" &&
+cat >>"$ac_tmp/subs1.awk" <<\_ACAWK &&
+S["am__EXEEXT_FALSE"]=""
+S["am__EXEEXT_TRUE"]="#"
+S["LTLIBOBJS"]=""
+S["LIBOBJS"]=""
+S["INSTALL_TARGET"]="install-recursive"
+S["ALL_TARGET"]="all-recursive"
+S["HAVE_LGF"]="LGF"
+S["INTERPRETER"]="TCL"
+S["LD"]="/bin/ld"
+S["XCIRCUIT_TARGET"]="tcl"
+S["WRAPPER_SCRIPT"]="wrapper.tcl"
+S["INTERP_PATH"]="tcl"
+S["STARTUP_FILE"]="xcstartup.tcl"
+S["GS_LIBS"]=""
+S["STDLIBS"]=""
+S["SUBLIB"]=""
+S["SUBDIRS"]=""
+S["PYTHON"]=""
+S["SPICE_EXEC"]="ngspice"
+S["GS_EXEC"]="gs"
+S["WISH_EXE"]="/usr/bin/wish"
+S["TCL_LIB_DIR"]="/usr/lib64 "
+S["LIB_SPECS"]=" -L/usr/lib64 -ltcl8.6 -L/usr/lib64 -ltk8.6"
+S["INC_SPECS"]=" -I/usr/include -I/usr/include"
+S["LD_RUN_PATH"]="-Wl,-rpath,/usr/lib64 "
+S["EXTRA_LIB_SPECS"]=" -lm"
+S["SHLIB_LIB_SPECS"]=""
+S["LDDL_FLAGS"]="-Wl,-z,relro -Wl,--export-dynamic -Wl,--version-script=symbol.map"
+S["SHLIB_LD"]="${CC} -shared ${CFLAGS} ${LDFLAGS} -fPIC -Wl,-soname,${@}"
+S["SHDLIB_EXT"]=".so"
+S["fontconfig_LIBS"]="-lfontconfig -lfreetype "
+S["fontconfig_CFLAGS"]="-I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/freetype2 -I/usr/include/libpng16 "
+S["cairo_LIBS"]="-lcairo "
+S["cairo_CFLAGS"]="-I/usr/include/cairo -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng16 "\
+"-I/usr/include/freetype2 -I/usr/include/libdrm -I/usr/include/libpng16 "
+S["PKG_CONFIG_LIBDIR"]=""
+S["PKG_CONFIG_PATH"]=""
+S["PKG_CONFIG"]="/bin/pkg-config"
+S["X_EXTRA_LIBS"]=""
+S["X_LIBS"]=""
+S["X_PRE_LIBS"]=" -lSM -lICE"
+S["X_CFLAGS"]=""
+S["XMKMF"]=""
+S["EGREP"]="/bin/grep -E"
+S["GREP"]="/bin/grep"
+S["CPP"]="gcc -E"
+S["M4"]="/bin/m4"
+S["RANLIB"]="ranlib"
+S["am__fastdepCC_FALSE"]=""
+S["am__fastdepCC_TRUE"]="#"
+S["CCDEPMODE"]="depmode=none"
+S["am__nodep"]="_no"
+S["AMDEPBACKSLASH"]="\\"
+S["AMDEP_FALSE"]="#"
+S["AMDEP_TRUE"]=""
+S["am__quote"]=""
+S["am__include"]="include"
+S["DEPDIR"]=".deps"
+S["OBJEXT"]="o"
+S["EXEEXT"]=""
+S["ac_ct_CC"]="gcc"
+S["CPPFLAGS"]=" "
+S["LDFLAGS"]=" "
+S["CFLAGS"]="-g -Wno-pointer-sign -fPIC "
+S["CC"]="gcc"
+S["REVISION"]="71"
+S["AM_BACKSLASH"]="\\"
+S["AM_DEFAULT_VERBOSITY"]="1"
+S["AM_DEFAULT_V"]="$(AM_DEFAULT_VERBOSITY)"
+S["AM_V"]="$(V)"
+S["am__untar"]="$${TAR-tar} xf -"
+S["am__tar"]="$${TAR-tar} chof - \"$$tardir\""
+S["AMTAR"]="$${TAR-tar}"
+S["am__leading_dot"]="."
+S["SET_MAKE"]=""
+S["AWK"]="gawk"
+S["mkdir_p"]="$(MKDIR_P)"
+S["MKDIR_P"]="/bin/mkdir -p"
+S["INSTALL_STRIP_PROGRAM"]="$(install_sh) -c -s"
+S["STRIP"]=""
+S["install_sh"]="${SHELL} /home/tim/gitsrc/xcircuit-3.9/install-sh"
+S["MAKEINFO"]="makeinfo"
+S["AUTOHEADER"]="autoheader"
+S["AUTOMAKE"]="automake-1.14"
+S["AUTOCONF"]="autoconf"
+S["ACLOCAL"]="aclocal-1.14"
+S["VERSION"]="3.9"
+S["PACKAGE"]="xcircuit"
+S["CYGPATH_W"]="echo"
+S["am__isrc"]=""
+S["INSTALL_DATA"]="${INSTALL} -m 644"
+S["INSTALL_SCRIPT"]="${INSTALL}"
+S["INSTALL_PROGRAM"]="${INSTALL}"
+S["target_os"]="linux-gnu"
+S["target_vendor"]="unknown"
+S["target_cpu"]="x86_64"
+S["target"]="x86_64-unknown-linux-gnu"
+S["host_os"]="linux-gnu"
+S["host_vendor"]="unknown"
+S["host_cpu"]="x86_64"
+S["host"]="x86_64-unknown-linux-gnu"
+S["build_os"]="linux-gnu"
+S["build_vendor"]="unknown"
+S["build_cpu"]="x86_64"
+S["build"]="x86_64-unknown-linux-gnu"
+S["target_alias"]=""
+S["host_alias"]=""
+S["build_alias"]=""
+S["LIBS"]="-ldl -lz -lpthread -lieee -lm -lz -lXt -lSM -lICE -lm -lX11 -lXpm"
+S["ECHO_T"]=""
+S["ECHO_N"]="-n"
+S["ECHO_C"]=""
+S["DEFS"]="-DPACKAGE_NAME=\\\"\\\" -DPACKAGE_TARNAME=\\\"\\\" -DPACKAGE_VERSION=\\\"\\\" -DPACKAGE_STRING=\\\"\\\" -DPACKAGE_BUGREPORT=\\\"\\\" -DPACKAGE_URL=\\\"\\\" -DPACKAGE=\\\"xcir"\
+"cuit\\\" -DVERSION=\\\"3.9\\\" -DHAVE_LIBM=1 -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H"\
+"=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DSIZEOF_VOID_P=8 -DSIZEOF_UNSIGNED_INT=4 -DSIZEOF_UNSIGNED_LONG=8 -DS"\
+"IZEOF_UNSIGNED_LONG_LONG=8 -DHAVE_LIBXT=1 -DSTDC_HEADERS=1 -DHAVE_SETENV=1 -DHAVE_PUTENV=1 -DHAVE_DIRENT_H=1 -DHAVE_LIBZ=1 -DHAVE_VA_COPY=1 -DHAVE__"\
+"_VA_COPY=1 -DHAVE_U_CHAR=1 -DHAVE_X11_XPM_H=1 -DHAVE_XPM=1 -DHAVE_CAIRO=1 -DLGF=1 -DINPUT_FOCUS=1 -DGS_EXEC=\\\"gs\\\" -DSPICE_EXEC=\\\"ngspice\\\" -DTCL_WR"\
+"APPER=1"
+S["mandir"]="${datarootdir}/man"
+S["localedir"]="${datarootdir}/locale"
+S["libdir"]="${exec_prefix}/lib"
+S["psdir"]="${docdir}"
+S["pdfdir"]="${docdir}"
+S["dvidir"]="${docdir}"
+S["htmldir"]="${docdir}"
+S["infodir"]="${datarootdir}/info"
+S["docdir"]="${datarootdir}/doc/${PACKAGE}"
+S["oldincludedir"]="/usr/include"
+S["includedir"]="${prefix}/include"
+S["localstatedir"]="${prefix}/var"
+S["sharedstatedir"]="${prefix}/com"
+S["sysconfdir"]="${prefix}/etc"
+S["datadir"]="${datarootdir}"
+S["datarootdir"]="${prefix}/share"
+S["libexecdir"]="${exec_prefix}/libexec"
+S["sbindir"]="${exec_prefix}/sbin"
+S["bindir"]="${exec_prefix}/bin"
+S["program_transform_name"]="s,x,x,"
+S["prefix"]="/usr/local"
+S["exec_prefix"]="${prefix}"
+S["PACKAGE_URL"]=""
+S["PACKAGE_BUGREPORT"]=""
+S["PACKAGE_STRING"]=""
+S["PACKAGE_VERSION"]=""
+S["PACKAGE_TARNAME"]=""
+S["PACKAGE_NAME"]=""
+S["PATH_SEPARATOR"]=":"
+S["SHELL"]="/bin/sh"
+_ACAWK
+cat >>"$ac_tmp/subs1.awk" <<_ACAWK &&
+ for (key in S) S_is_set[key] = 1
+ FS = ""
+
+}
+{
+ line = $ 0
+ nfields = split(line, field, "@")
+ substed = 0
+ len = length(field[1])
+ for (i = 2; i < nfields; i++) {
+ key = field[i]
+ keylen = length(key)
+ if (S_is_set[key]) {
+ value = S[key]
+ line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3)
+ len += length(value) + length(field[++i])
+ substed = 1
+ } else
+ len += 1 + keylen
+ }
+
+ print line
+}
+
+_ACAWK
+if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then
+ sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g"
+else
+ cat
+fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \
+ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5
+fi # test -n "$CONFIG_FILES"
+
+
+eval set X " :F $CONFIG_FILES :C $CONFIG_COMMANDS"
+shift
+for ac_tag
+do
+ case $ac_tag in
+ :[FHLC]) ac_mode=$ac_tag; continue;;
+ esac
+ case $ac_mode$ac_tag in
+ :[FHL]*:*);;
+ :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;;
+ :[FH]-) ac_tag=-:-;;
+ :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
+ esac
+ ac_save_IFS=$IFS
+ IFS=:
+ set x $ac_tag
+ IFS=$ac_save_IFS
+ shift
+ ac_file=$1
+ shift
+
+ case $ac_mode in
+ :L) ac_source=$1;;
+ :[FH])
+ ac_file_inputs=
+ for ac_f
+ do
+ case $ac_f in
+ -) ac_f="$ac_tmp/stdin";;
+ *) # Look for the file first in the build tree, then in the source tree
+ # (if the path is not absolute). The absolute path cannot be DOS-style,
+ # because $ac_f cannot contain `:'.
+ test -f "$ac_f" ||
+ case $ac_f in
+ [\\/$]*) false;;
+ *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
+ esac ||
+ as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;;
+ esac
+ case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
+ as_fn_append ac_file_inputs " '$ac_f'"
+ done
+
+ # 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. */
+ configure_input='Generated from '`
+ $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g'
+ `' by configure.'
+ if test x"$ac_file" != x-; then
+ configure_input="$ac_file. $configure_input"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5
+$as_echo "$as_me: creating $ac_file" >&6;}
+ fi
+ # Neutralize special characters interpreted by sed in replacement strings.
+ case $configure_input in #(
+ *\&* | *\|* | *\\* )
+ ac_sed_conf_input=`$as_echo "$configure_input" |
+ sed 's/[\\\\&|]/\\\\&/g'`;; #(
+ *) ac_sed_conf_input=$configure_input;;
+ esac
+
+ case $ac_tag in
+ *:-:* | *:-) cat >"$ac_tmp/stdin" \
+ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;;
+ esac
+ ;;
+ esac
+
+ ac_dir=`$as_dirname -- "$ac_file" ||
+$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$ac_file" : 'X\(//\)[^/]' \| \
+ X"$ac_file" : 'X\(//\)$' \| \
+ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$ac_file" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ as_dir="$ac_dir"; as_fn_mkdir_p
+ ac_builddir=.
+
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
+ ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
+ # A ".." for each directory in $ac_dir_suffix.
+ ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
+ case $ac_top_builddir_sub in
+ "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+ *) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+ esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
+
+case $srcdir in
+ .) # We are building in place.
+ ac_srcdir=.
+ ac_top_srcdir=$ac_top_builddir_sub
+ ac_abs_top_srcdir=$ac_pwd ;;
+ [\\/]* | ?:[\\/]* ) # Absolute name.
+ ac_srcdir=$srcdir$ac_dir_suffix;
+ ac_top_srcdir=$srcdir
+ ac_abs_top_srcdir=$srcdir ;;
+ *) # Relative name.
+ ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+ ac_top_srcdir=$ac_top_build_prefix$srcdir
+ ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
+esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
+
+
+ case $ac_mode in
+ :F)
+ #
+ # CONFIG_FILE
+ #
+
+ case $INSTALL in
+ [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
+ *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;;
+ esac
+ ac_MKDIR_P=$MKDIR_P
+ case $MKDIR_P in
+ [\\/$]* | ?:[\\/]* ) ;;
+ */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;;
+ esac
+# If the template does not know about datarootdir, expand it.
+# FIXME: This hack should be removed a few years after 2.60.
+ac_datarootdir_hack=; ac_datarootdir_seen=
+ac_sed_dataroot='
+/datarootdir/ {
+ p
+ q
+}
+/@datadir@/p
+/@docdir@/p
+/@infodir@/p
+/@localedir@/p
+/@mandir@/p'
+case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in
+*datarootdir*) ac_datarootdir_seen=yes;;
+*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
+$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
+ ac_datarootdir_hack='
+ s&@datadir@&${datarootdir}&g
+ s&@docdir@&${datarootdir}/doc/${PACKAGE}&g
+ s&@infodir@&${datarootdir}/info&g
+ s&@localedir@&${datarootdir}/locale&g
+ s&@mandir@&${datarootdir}/man&g
+ s&\${datarootdir}&${prefix}/share&g' ;;
+esac
+ac_sed_extra="/^[ ]*VPATH[ ]*=[ ]*/{
+h
+s///
+s/^/:/
+s/[ ]*$/:/
+s/:\$(srcdir):/:/g
+s/:\${srcdir}:/:/g
+s/:@srcdir@:/:/g
+s/^:*//
+s/:*$//
+x
+s/\(=[ ]*\).*/\1/
+G
+s/\n//
+s/^[^=]*=[ ]*$//
+}
+
+:t
+/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
+s|@configure_input@|$ac_sed_conf_input|;t t
+s&@top_builddir@&$ac_top_builddir_sub&;t t
+s&@top_build_prefix@&$ac_top_build_prefix&;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&@abs_top_builddir@&$ac_abs_top_builddir&;t t
+s&@INSTALL@&$ac_INSTALL&;t t
+s&@MKDIR_P@&$ac_MKDIR_P&;t t
+$ac_datarootdir_hack
+"
+eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \
+ >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+
+test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
+ { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } &&
+ { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \
+ "$ac_tmp/out"`; test -z "$ac_out"; } &&
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined. Please make sure it is defined" >&5
+$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined. Please make sure it is defined" >&2;}
+
+ rm -f "$ac_tmp/stdin"
+ case $ac_file in
+ -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";;
+ *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";;
+ esac \
+ || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+ ;;
+
+
+ :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5
+$as_echo "$as_me: executing $ac_file commands" >&6;}
+ ;;
+ esac
+
+
+ case $ac_file$ac_mode in
+ "depfiles":C) test x"$AMDEP_TRUE" != x"" || {
+ # Older Autoconf quotes --file arguments for eval, but not when files
+ # are listed without --file. Let's play safe and only enable the eval
+ # if we detect the quoting.
+ case $CONFIG_FILES in
+ *\'*) eval set x "$CONFIG_FILES" ;;
+ *) set x $CONFIG_FILES ;;
+ esac
+ shift
+ for mf
+ 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.
+ # Grep'ing the whole file is not good either: AIX grep has a line
+ # limit of 2048, but all sed's we know have understand at least 4000.
+ if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
+ dirpart=`$as_dirname -- "$mf" ||
+$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$mf" : 'X\(//\)[^/]' \| \
+ X"$mf" : 'X\(//\)$' \| \
+ X"$mf" : 'X\(/\)' \| . 2>/dev/null ||
+$as_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
+ # Extract the definition of DEPDIR, am__include, and am__quote
+ # from the Makefile without running 'make'.
+ DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
+ test -z "$DEPDIR" && continue
+ am__include=`sed -n 's/^am__include = //p' < "$mf"`
+ test -z "$am__include" && continue
+ am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
+ # Find all dependency output files, they are included files with
+ # $(DEPDIR) in their names. 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 "
+ s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
+ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do
+ # Make sure the directory exists.
+ test -f "$dirpart/$file" && continue
+ fdir=`$as_dirname -- "$file" ||
+$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$file" : 'X\(//\)[^/]' \| \
+ X"$file" : 'X\(//\)$' \| \
+ X"$file" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$file" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ as_dir=$dirpart/$fdir; as_fn_mkdir_p
+ # echo "creating $dirpart/$file"
+ echo '# dummy' > "$dirpart/$file"
+ done
+ done
+}
+ ;;
+
+ esac
+done # for ac_tag
+
+
+as_fn_exit 0
diff --git a/configure b/configure
index c740413..a672b55 100755
--- a/configure
+++ b/configure
@@ -1,11 +1,9 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.68.
+# Generated by GNU Autoconf 2.69.
#
#
-# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
-# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software
-# Foundation, Inc.
+# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
#
#
# This configure script is free software; the Free Software Foundation
@@ -134,6 +132,31 @@ export LANGUAGE
# CDPATH.
(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+# Use a proper internal environment variable to ensure we don't fall
+ # into an infinite loop, continuously re-executing ourselves.
+ if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then
+ _as_can_reexec=no; export _as_can_reexec;
+ # We cannot yet assume a decent shell, so we have to provide a
+# neutralization value for shells without unset; and this also
+# works around shells that cannot unset nonexistent variables.
+# Preserve -v and -x to the replacement shell.
+BASH_ENV=/dev/null
+ENV=/dev/null
+(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
+case $- in # ((((
+ *v*x* | *x*v* ) as_opts=-vx ;;
+ *v* ) as_opts=-v ;;
+ *x* ) as_opts=-x ;;
+ * ) as_opts= ;;
+esac
+exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
+# Admittedly, this is quite paranoid, since all the known shells bail
+# out after a failed `exec'.
+$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
+as_fn_exit 255
+ fi
+ # We don't want this to propagate to other subprocesses.
+ { _as_can_reexec=; unset _as_can_reexec;}
if test "x$CONFIG_SHELL" = x; then
as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then :
emulate sh
@@ -167,7 +190,8 @@ if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then :
else
exitcode=1; echo positional parameters were not saved.
fi
-test x\$exitcode = x0 || exit 1"
+test x\$exitcode = x0 || exit 1
+test -x / || exit 1"
as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO
as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO
eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" &&
@@ -212,21 +236,25 @@ IFS=$as_save_IFS
if test "x$CONFIG_SHELL" != x; then :
- # We cannot yet assume a decent shell, so we have to provide a
- # neutralization value for shells without unset; and this also
- # works around shells that cannot unset nonexistent variables.
- # Preserve -v and -x to the replacement shell.
- BASH_ENV=/dev/null
- ENV=/dev/null
- (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
- export CONFIG_SHELL
- case $- in # ((((
- *v*x* | *x*v* ) as_opts=-vx ;;
- *v* ) as_opts=-v ;;
- *x* ) as_opts=-x ;;
- * ) as_opts= ;;
- esac
- exec "$CONFIG_SHELL" $as_opts "$as_myself" ${1+"$@"}
+ export CONFIG_SHELL
+ # We cannot yet assume a decent shell, so we have to provide a
+# neutralization value for shells without unset; and this also
+# works around shells that cannot unset nonexistent variables.
+# Preserve -v and -x to the replacement shell.
+BASH_ENV=/dev/null
+ENV=/dev/null
+(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
+case $- in # ((((
+ *v*x* | *x*v* ) as_opts=-vx ;;
+ *v* ) as_opts=-v ;;
+ *x* ) as_opts=-x ;;
+ * ) as_opts= ;;
+esac
+exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
+# Admittedly, this is quite paranoid, since all the known shells bail
+# out after a failed `exec'.
+$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
+exit 255
fi
if test x$as_have_required = xno; then :
@@ -328,6 +356,14 @@ $as_echo X"$as_dir" |
} # as_fn_mkdir_p
+
+# as_fn_executable_p FILE
+# -----------------------
+# Test if FILE is an executable regular file.
+as_fn_executable_p ()
+{
+ test -f "$1" && test -x "$1"
+} # as_fn_executable_p
# as_fn_append VAR VALUE
# ----------------------
# Append the text in VALUE to the end of the definition contained in VAR. Take
@@ -449,6 +485,10 @@ as_cr_alnum=$as_cr_Letters$as_cr_digits
chmod +x "$as_me.lineno" ||
{ $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; }
+ # If we had to re-execute with $CONFIG_SHELL, we're ensured to have
+ # already done that, so ensure we don't try to do so again and fall
+ # in an infinite loop. This has already happened in practice.
+ _as_can_reexec=no; export _as_can_reexec
# 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 sensitive to this).
@@ -483,16 +523,16 @@ if (echo >conf$$.file) 2>/dev/null; then
# ... but there are two gotchas:
# 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
# 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
- # In both cases, we have to default to `cp -p'.
+ # In both cases, we have to default to `cp -pR'.
ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
- as_ln_s='cp -p'
+ as_ln_s='cp -pR'
elif ln conf$$.file conf$$ 2>/dev/null; then
as_ln_s=ln
else
- as_ln_s='cp -p'
+ as_ln_s='cp -pR'
fi
else
- as_ln_s='cp -p'
+ as_ln_s='cp -pR'
fi
rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
rmdir conf$$.dir 2>/dev/null
@@ -504,28 +544,8 @@ else
as_mkdir_p=false
fi
-if test -x / >/dev/null 2>&1; then
- as_test_x='test -x'
-else
- if ls -dL / >/dev/null 2>&1; then
- as_ls_L_option=L
- else
- as_ls_L_option=
- fi
- as_test_x='
- eval sh -c '\''
- if test -d "$1"; then
- test -d "$1/.";
- else
- case $1 in #(
- -*)set "./$1";;
- esac;
- case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #((
- ???[sx]*):;;*)false;;esac;fi
- '\'' sh
- '
-fi
-as_executable_p=$as_test_x
+as_test_x='test -x'
+as_executable_p=as_fn_executable_p
# 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'"
@@ -609,11 +629,11 @@ ALL_TARGET
HAVE_LGF
INTERPRETER
LD
-SHLIB_CFLAGS
XCIRCUIT_TARGET
WRAPPER_SCRIPT
INTERP_PATH
STARTUP_FILE
+GS_LIBS
STDLIBS
SUBLIB
SUBDIRS
@@ -630,6 +650,13 @@ SHLIB_LIB_SPECS
LDDL_FLAGS
SHLIB_LD
SHDLIB_EXT
+fontconfig_LIBS
+fontconfig_CFLAGS
+cairo_LIBS
+cairo_CFLAGS
+PKG_CONFIG_LIBDIR
+PKG_CONFIG_PATH
+PKG_CONFIG
X_EXTRA_LIBS
X_LIBS
X_PRE_LIBS
@@ -643,6 +670,7 @@ RANLIB
am__fastdepCC_FALSE
am__fastdepCC_TRUE
CCDEPMODE
+am__nodep
AMDEPBACKSLASH
AMDEP_FALSE
AMDEP_TRUE
@@ -657,6 +685,10 @@ LDFLAGS
CFLAGS
CC
REVISION
+AM_BACKSLASH
+AM_DEFAULT_VERBOSITY
+AM_DEFAULT_V
+AM_V
am__untar
am__tar
AMTAR
@@ -733,13 +765,13 @@ SHELL'
ac_subst_files=''
ac_user_opts='
enable_option_checking
+enable_silent_rules
enable_dependency_tracking
with_x
-with_opengl
-enable_double_buffer
enable_optimize
with_xpm
with_gnu_ld
+with_cairo
with_tcl
with_tk
with_tclincls
@@ -763,7 +795,14 @@ LDFLAGS
LIBS
CPPFLAGS
CPP
-XMKMF'
+XMKMF
+PKG_CONFIG
+PKG_CONFIG_PATH
+PKG_CONFIG_LIBDIR
+cairo_CFLAGS
+cairo_LIBS
+fontconfig_CFLAGS
+fontconfig_LIBS'
# Initialize some variables set by options.
@@ -1219,8 +1258,6 @@ target=$target_alias
if test "x$host_alias" != x; then
if test "x$build_alias" = x; then
cross_compiling=maybe
- $as_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
@@ -1387,9 +1424,12 @@ Optional Features:
--disable-option-checking ignore unrecognized --enable/--with options
--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 build
- --enable-dependency-tracking do not reject slow dependency extractors
- --disable-double-buffer disable graphics double-buffering
+ --enable-silent-rules less verbose build output (undo: "make V=1")
+ --disable-silent-rules verbose build output (undo: "make V=0")
+ --enable-dependency-tracking
+ do not reject slow dependency extractors
+ --disable-dependency-tracking
+ speeds up one-time build
--enable-optimize enable compile-time optimizer flag -O2
--enable-asg enable support for Automatic Schematic Generation
--disable-lgf disable support for reading Caltech tools
@@ -1401,9 +1441,9 @@ Optional Packages:
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
--without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
--with-x use the X Window System
- --with-opengl=DIR use OpenGL include files in DIR
--with-xpm=DIR use Xpm include/library files in DIR
--with-gnu-ld assume the C compiler uses GNU ld [default=no]
+ --with-cairo Use cairo graphics library [default=yes]
--with-tcl=DIR Find tclConfig.sh in DIR
--with-tk=DIR Find tkConfig.sh in DIR
--with-tclincls=DIR Find tcl.h in DIR
@@ -1424,6 +1464,18 @@ Some influential environment variables:
you have headers in a nonstandard directory <include dir>
CPP C preprocessor
XMKMF Path to xmkmf, Makefile generator for X Window System
+ PKG_CONFIG path to pkg-config utility
+ PKG_CONFIG_PATH
+ directories to add to pkg-config's search path
+ PKG_CONFIG_LIBDIR
+ path overriding pkg-config's built-in search path
+ cairo_CFLAGS
+ C compiler flags for cairo, overriding pkg-config
+ cairo_LIBS linker flags for cairo, overriding pkg-config
+ fontconfig_CFLAGS
+ C compiler flags for fontconfig, overriding pkg-config
+ fontconfig_LIBS
+ linker flags for fontconfig, overriding pkg-config
Use these variables to override the choices made by `configure' or to help
it to find libraries and programs with nonstandard names/locations.
@@ -1492,9 +1544,9 @@ test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
configure
-generated by GNU Autoconf 2.68
+generated by GNU Autoconf 2.69
-Copyright (C) 2010 Free Software Foundation, Inc.
+Copyright (C) 2012 Free Software Foundation, Inc.
This configure script is free software; the Free Software Foundation
gives unlimited permission to copy, distribute and modify it.
_ACEOF
@@ -1570,7 +1622,7 @@ $as_echo "$ac_try_echo"; } >&5
test ! -s conftest.err
} && test -s conftest$ac_exeext && {
test "$cross_compiling" = yes ||
- $as_test_x conftest$ac_exeext
+ test -x conftest$ac_exeext
}; then :
ac_retval=0
else
@@ -1648,7 +1700,8 @@ int
main ()
{
static int test_array [1 - 2 * !(($2) >= 0)];
-test_array [0] = 0
+test_array [0] = 0;
+return test_array [0];
;
return 0;
@@ -1664,7 +1717,8 @@ int
main ()
{
static int test_array [1 - 2 * !(($2) <= $ac_mid)];
-test_array [0] = 0
+test_array [0] = 0;
+return test_array [0];
;
return 0;
@@ -1690,7 +1744,8 @@ int
main ()
{
static int test_array [1 - 2 * !(($2) < 0)];
-test_array [0] = 0
+test_array [0] = 0;
+return test_array [0];
;
return 0;
@@ -1706,7 +1761,8 @@ int
main ()
{
static int test_array [1 - 2 * !(($2) >= $ac_mid)];
-test_array [0] = 0
+test_array [0] = 0;
+return test_array [0];
;
return 0;
@@ -1740,7 +1796,8 @@ int
main ()
{
static int test_array [1 - 2 * !(($2) <= $ac_mid)];
-test_array [0] = 0
+test_array [0] = 0;
+return test_array [0];
;
return 0;
@@ -2035,7 +2092,7 @@ 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.68. Invocation command line was
+generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
@@ -2529,7 +2586,7 @@ test -n "$target_alias" &&
PACKAGE=xcircuit
VERSION=`cat ./VERSION | cut -d. -f1-2`
-am__api_version='1.11'
+am__api_version='1.14'
# Find a good install program. We prefer a C program (faster),
# so one script is as good as another. But avoid the broken or
@@ -2568,7 +2625,7 @@ case $as_dir/ in #((
# by default.
for ac_prog in ginstall scoinst install; do
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then
+ if as_fn_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.
@@ -2626,9 +2683,6 @@ test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5
$as_echo_n "checking whether build environment is sane... " >&6; }
-# Just in case
-sleep 1
-echo timestamp > conftest.file
# Reject unsafe characters in $srcdir or the absolute working directory
# name. Accept space and tab only in the latter.
am_lf='
@@ -2639,32 +2693,40 @@ case `pwd` in
esac
case $srcdir in
*[\\\"\#\$\&\'\`$am_lf\ \ ]*)
- as_fn_error $? "unsafe srcdir value: \`$srcdir'" "$LINENO" 5;;
+ as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;;
esac
-# Do `set' in a subshell so we don't clobber the current shell's
+# 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".
- as_fn_error $? "ls -t appears to fail. Make sure there is not a broken
-alias in your environment" "$LINENO" 5
- fi
-
+ am_has_slept=no
+ for am_try in 1 2; do
+ echo "timestamp, slept: $am_has_slept" > conftest.file
+ 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
+ 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".
+ as_fn_error $? "ls -t appears to fail. Make sure there is not a broken
+ alias in your environment" "$LINENO" 5
+ fi
+ if test "$2" = conftest.file || test $am_try -eq 2; then
+ break
+ fi
+ # Just in case.
+ sleep 1
+ am_has_slept=yes
+ done
test "$2" = conftest.file
)
then
@@ -2676,6 +2738,16 @@ Check your system clock" "$LINENO" 5
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
+# If we didn't sleep, we still need to ensure time stamps of config.status and
+# generated files are strictly newer.
+am_sleep_pid=
+if grep 'slept: no' conftest.file >/dev/null 2>&1; then
+ ( sleep 1 ) &
+ am_sleep_pid=$!
+fi
+
+rm -f conftest.file
+
test "$program_prefix" != NONE &&
program_transform_name="s&^&$program_prefix&;$program_transform_name"
# Use a double $ so make ignores it.
@@ -2698,12 +2770,12 @@ if test x"${MISSING+set}" != xset; then
esac
fi
# Use eval to expand $SHELL
-if eval "$MISSING --run true"; then
- am_missing_run="$MISSING --run "
+if eval "$MISSING --is-lightweight"; then
+ am_missing_run="$MISSING "
else
am_missing_run=
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`missing' script is too old or missing" >&5
-$as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5
+$as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;}
fi
if test x"${install_sh}" != xset; then
@@ -2715,10 +2787,10 @@ if test x"${install_sh}" != xset; then
esac
fi
-# Installed binaries are usually stripped using `strip' when the user
-# run `make install-strip'. However `strip' might not be the right
+# 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.
+# 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.
@@ -2737,7 +2809,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_STRIP="${ac_tool_prefix}strip"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -2777,7 +2849,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_STRIP="strip"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -2828,7 +2900,7 @@ do
test -z "$as_dir" && as_dir=.
for ac_prog in mkdir gmkdir; do
for ac_exec_ext in '' $ac_executable_extensions; do
- { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue
+ as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue
case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #(
'mkdir (GNU coreutils) '* | \
'mkdir (coreutils) '* | \
@@ -2857,12 +2929,6 @@ fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5
$as_echo "$MKDIR_P" >&6; }
-mkdir_p="$MKDIR_P"
-case $mkdir_p in
- [\\/$]* | ?:[\\/]*) ;;
- */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
-esac
-
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.
@@ -2881,7 +2947,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_AWK="$ac_prog"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -2945,6 +3011,45 @@ else
fi
rmdir .tst 2>/dev/null
+# Check whether --enable-silent-rules was given.
+if test "${enable_silent_rules+set}" = set; then :
+ enableval=$enable_silent_rules;
+fi
+
+case $enable_silent_rules in # (((
+ yes) AM_DEFAULT_VERBOSITY=0;;
+ no) AM_DEFAULT_VERBOSITY=1;;
+ *) AM_DEFAULT_VERBOSITY=1;;
+esac
+am_make=${MAKE-make}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5
+$as_echo_n "checking whether $am_make supports nested variables... " >&6; }
+if ${am_cv_make_support_nested_variables+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if $as_echo 'TRUE=$(BAR$(V))
+BAR0=false
+BAR1=true
+V=1
+am__doit:
+ @$(TRUE)
+.PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then
+ am_cv_make_support_nested_variables=yes
+else
+ am_cv_make_support_nested_variables=no
+fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5
+$as_echo "$am_cv_make_support_nested_variables" >&6; }
+if test $am_cv_make_support_nested_variables = yes; then
+ AM_V='$(V)'
+ AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
+else
+ AM_V=$AM_DEFAULT_VERBOSITY
+ AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
+fi
+AM_BACKSLASH='\'
+
if test "`cd $srcdir && pwd`" != "`pwd`"; then
# Use -I$(srcdir) only when $(srcdir) != ., so that make's output
# is not polluted with repeated "-I."
@@ -2966,6 +3071,7 @@ fi
# Define the identity of the package.
+
PACKAGE=${PACKAGE}
VERSION=${VERSION}
@@ -2995,18 +3101,70 @@ AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"}
MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
+# For better backward compatibility. To be removed once Automake 1.9.x
+# dies out for good. For more background, see:
+# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
+# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
+mkdir_p='$(MKDIR_P)'
+
# We need awk for the "check" target. The system "awk" is bad on
# some platforms.
-# Always define AMTAR for backward compatibility.
+# Always define AMTAR for backward compatibility. Yes, it's still used
+# in the wild :-( We should find a proper way to deprecate it ...
+AMTAR='$${TAR-tar}'
+
+
+# We'll loop over all known methods to create a tar archive until one works.
+_am_tools='gnutar pax cpio none'
+
+am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'
+
-AMTAR=${AMTAR-"${am_missing_run}tar"}
-am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'
+# POSIX will say in a future version that running "rm -f" with no argument
+# is OK; and we want to be able to make that assumption in our Makefile
+# recipes. So use an aggressive probe to check that the usage we want is
+# actually supported "in the wild" to an acceptable degree.
+# See automake bug#10828.
+# To make any issue more visible, cause the running configure to be aborted
+# by default if the 'rm' program in use doesn't match our expectations; the
+# user can still override this though.
+if rm -f && rm -fr && rm -rf; then : OK; else
+ cat >&2 <<'END'
+Oops!
+
+Your 'rm' program seems unable to run without file operands specified
+on the command line, even when the '-f' option is present. This is contrary
+to the behaviour of most rm programs out there, and not conforming with
+the upcoming POSIX standard: <http://austingroupbugs.net/view.php?id=542>
+
+Please tell bug-automake@gnu.org about your system, including the value
+of your $PATH and any error possibly output before this message. This
+can help us improve future automake versions.
+
+END
+ if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then
+ echo 'Configuration will proceed anyway, since you have set the' >&2
+ echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2
+ echo >&2
+ else
+ cat >&2 <<'END'
+Aborting the configuration process, to ensure you take notice of the issue.
+
+You can download and install GNU coreutils to get an 'rm' implementation
+that behaves properly: <http://www.gnu.org/software/coreutils/>.
+If you want to complete the configuration process using your problematic
+'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
+to "yes", and re-run configure.
+END
+ as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5
+ fi
+fi
SUBDIRS=
SUBLIB=
@@ -3017,11 +3175,10 @@ INSTALL_TARGET="undefined-install-target"
REVISION=`cat ./VERSION | cut -d. -f3`
INTERPRETER=NOINTERP
HAVE_LGF=NOFORMATS
-xc_with_GL=
-SHLIB_CFLAGS=""
LIB_SPECS=""
WISH_EXE=""
+SHLIB_CFLAGS=""
@@ -3082,7 +3239,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_CC="${ac_tool_prefix}gcc"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -3122,7 +3279,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_CC="gcc"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -3175,7 +3332,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_CC="${ac_tool_prefix}cc"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -3216,7 +3373,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_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
@@ -3274,7 +3431,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -3318,7 +3475,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_CC="$ac_prog"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -3764,8 +3921,7 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <stdarg.h>
#include <stdio.h>
-#include <sys/types.h>
-#include <sys/stat.h>
+struct stat;
/* 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);
@@ -3849,6 +4005,65 @@ 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_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
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5
+$as_echo_n "checking whether $CC understands -c and -o together... " >&6; }
+if ${am_cv_prog_cc_c_o+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+ # Make sure it works both with $CC and with simple cc.
+ # Following AC_PROG_CC_C_O, we do the test twice because some
+ # compilers refuse to overwrite an existing .o file with -o,
+ # though they will create one.
+ am_cv_prog_cc_c_o=yes
+ for am_i in 1 2; do
+ if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5
+ ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } \
+ && test -f conftest2.$ac_objext; then
+ : OK
+ else
+ am_cv_prog_cc_c_o=no
+ break
+ fi
+ done
+ rm -f core conftest*
+ unset am_i
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5
+$as_echo "$am_cv_prog_cc_c_o" >&6; }
+if test "$am_cv_prog_cc_c_o" != yes; then
+ # Losing compiler, so override with the script.
+ # FIXME: It is wrong to rewrite CC.
+ # But if we don't then we get into trouble of one sort or another.
+ # A longer-term fix would be to have automake use am__CC in this case,
+ # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
+ CC="$am_aux_dir/compile $CC"
+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
+
DEPDIR="${am__leading_dot}deps"
ac_config_commands="$ac_config_commands depfiles"
@@ -3868,7 +4083,7 @@ am__quote=
_am_result=none
# First try GNU make style include.
echo "include confinc" > confmf
-# Ignore all kinds of additional output from `make'.
+# Ignore all kinds of additional output from 'make'.
case `$am_make -s -f confmf 2> /dev/null` in #(
*the\ am__doit\ target*)
am__include=include
@@ -3901,6 +4116,7 @@ fi
if test "x$enable_dependency_tracking" != xno; then
am_depcomp="$ac_aux_dir/depcomp"
AMDEPBACKSLASH='\'
+ am__nodep='_no'
fi
if test "x$enable_dependency_tracking" != xno; then
AMDEP_TRUE=
@@ -3923,8 +4139,9 @@ else
# 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'.
+ # making a dummy file named 'D' -- because '-MD' means "put the output
+ # in D".
+ rm -rf conftest.dir
mkdir conftest.dir
# Copy depcomp to subdir because otherwise we won't find it if we're
# using a relative directory.
@@ -3958,16 +4175,16 @@ else
: > sub/conftest.c
for i in 1 2 3 4 5 6; do
echo '#include "conftst'$i'.h"' >> sub/conftest.c
- # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
- # Solaris 8's {/usr,}/bin/sh.
- touch sub/conftst$i.h
+ # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
+ # Solaris 10 /bin/sh.
+ echo '/* dummy */' > sub/conftst$i.h
done
echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
- # We check with `-c' and `-o' for the sake of the "dashmstdout"
+ # 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. Also, some Intel
- # versions had trouble with output in subdirs
+ # handle '-M -o', and we need to detect this. Also, some Intel
+ # versions had trouble with output in subdirs.
am__obj=sub/conftest.${OBJEXT-o}
am__minus_obj="-o $am__obj"
case $depmode in
@@ -3976,16 +4193,16 @@ else
test "$am__universal" = false || continue
;;
nosideeffect)
- # after this tag, mechanisms are not by side-effect, so they'll
- # only be used when explicitly requested
+ # 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
;;
- msvisualcpp | msvcmsys)
- # This compiler won't grok `-c -o', but also, the minuso test has
+ msvc7 | msvc7msys | msvisualcpp | msvcmsys)
+ # This compiler won't grok '-c -o', but also, the minuso test has
# not run yet. These depmodes are late enough in the game, and
# so weak that their functioning should not be impacted.
am__obj=conftest.${OBJEXT-o}
@@ -4117,7 +4334,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -4157,7 +4374,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_RANLIB="ranlib"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -4213,7 +4430,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_path_M4="$as_dir/$ac_word$ac_exec_ext"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -4445,7 +4662,7 @@ do
for ac_prog in grep ggrep; do
for ac_exec_ext in '' $ac_executable_extensions; do
ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
- { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue
+ as_fn_executable_p "$ac_path_GREP" || continue
# Check for GNU ac_path_GREP and select it if it is found.
# Check for GNU $ac_path_GREP
case `"$ac_path_GREP" --version 2>&1` in
@@ -4511,7 +4728,7 @@ do
for ac_prog in egrep; do
for ac_exec_ext in '' $ac_executable_extensions; do
ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
- { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue
+ as_fn_executable_p "$ac_path_EGREP" || continue
# Check for GNU ac_path_EGREP and select it if it is found.
# Check for GNU $ac_path_EGREP
case `"$ac_path_EGREP" --version 2>&1` in
@@ -5946,38 +6163,6 @@ $as_echo "no" >&6; }
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-
-# Check whether --with-opengl was given.
-if test "${with_opengl+set}" = set; then :
- withval=$with_opengl;
- if test "$withval" = "no" -o "$withval" = "NO" ; then
- xc_with_GL=
- else
- xc_with_GL=1
- if test "$withval" != "no" -a "$withval" != "yes"; then
- OGL_INCLUDE_DIR=${withval}
- fi
- fi
-
-fi
-
-
-# Check whether --enable-double-buffer was given.
-if test "${enable_double_buffer+set}" = set; then :
- enableval=$enable_double_buffer;
-else
-
- if test "x$xc_with_GL" == "x" ; then
- $as_echo "#define DOUBLEBUFFER 1" >>confdefs.h
-
- else
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Double-buffering option not applicable to OpenGL version." >&5
-$as_echo "$as_me: WARNING: Double-buffering option not applicable to OpenGL version." >&2;}
- fi
-
-fi
-
-
# Check whether --enable-optimize was given.
if test "${enable_optimize+set}" = set; then :
enableval=$enable_optimize;
@@ -6178,156 +6363,367 @@ xc_with_tcl_includes=""
xc_with_tk_includes=""
xc_with_tcl_libraries=""
xc_with_tk_libraries=""
+xc_with_cairo="yes"
-# Check whether --with-tcl was given.
-if test "${with_tcl+set}" = set; then :
- withval=$with_tcl;
- xc_with_tcl=$withval
- if test "$withval" == "no" -o "$withval" == "NO"; then
- xc_with_tcl=""
- fi
+
+# Check whether --with-cairo was given.
+if test "${with_cairo+set}" = set; then :
+ withval=$with_cairo;
+ xc_with_cairo=$withval
+ if test "$withval" == "no" -o "$withval" == "NO"; then
+ xc_with_cairo=""
+ fi
fi
+if test "x$xc_with_cairo" != "x" ; then
+ $as_echo "#define HAVE_CAIRO 1" >>confdefs.h
+
-if test $xc_with_GL ; then
- ac_save_CPPFLAGS="$CPPFLAGS"
- if test $OGL_INCLUDE_DIR ; then
- CPPFLAGS="$CPPFLAGS -I$OGL_INCLUDE_DIR"
- fi
- CPPFLAGS="$CPPFLAGS $X_CFLAGS"
- ac_fn_c_check_header_mongrel "$LINENO" "GL/gl.h" "ac_cv_header_GL_gl_h" "$ac_includes_default"
-if test "x$ac_cv_header_GL_gl_h" = xyes; then :
-else
- echo "GL header files not found; disabling OpenGL"
- xc_with_GL=
-fi
- CPPFLAGS="$ac_save_CPPFLAGS"
+
+if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
+set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_PKG_CONFIG+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ case $PKG_CONFIG in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_PKG_CONFIG="$PKG_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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+ ;;
+esac
+fi
+PKG_CONFIG=$ac_cv_path_PKG_CONFIG
+if test -n "$PKG_CONFIG"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5
+$as_echo "$PKG_CONFIG" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
fi
-if test $xc_with_GL ; then
- ac_save_CPPFLAGS="$CPPFLAGS"
- ac_save_LDFLAGS="$LDFLAGS"
- LDFLAGS="$LDFLAGS $X_LIBS $X_EXTRA_LIBS"
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for glXCreateContext in -lGL" >&5
-$as_echo_n "checking for glXCreateContext in -lGL... " >&6; }
-if ${ac_cv_lib_GL_glXCreateContext+:} false; then :
+
+fi
+if test -z "$ac_cv_path_PKG_CONFIG"; then
+ ac_pt_PKG_CONFIG=$PKG_CONFIG
+ # Extract the first word of "pkg-config", so it can be a program name with args.
+set dummy pkg-config; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then :
$as_echo_n "(cached) " >&6
else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lGL $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
+ case $ac_pt_PKG_CONFIG in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char glXCreateContext ();
-int
-main ()
-{
-return glXCreateContext ();
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_GL_glXCreateContext=yes
+ ;;
+esac
+fi
+ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
+if test -n "$ac_pt_PKG_CONFIG"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5
+$as_echo "$ac_pt_PKG_CONFIG" >&6; }
else
- ac_cv_lib_GL_glXCreateContext=no
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
+
+ if test "x$ac_pt_PKG_CONFIG" = x; then
+ PKG_CONFIG=""
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ PKG_CONFIG=$ac_pt_PKG_CONFIG
+ fi
+else
+ PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
+fi
+
+fi
+if test -n "$PKG_CONFIG"; then
+ _pkg_min_version=0.9.0
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5
+$as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; }
+ if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+ PKG_CONFIG=""
+ fi
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_GL_glXCreateContext" >&5
-$as_echo "$ac_cv_lib_GL_glXCreateContext" >&6; }
-if test "x$ac_cv_lib_GL_glXCreateContext" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBGL 1
-_ACEOF
- LIBS="-lGL $LIBS"
+pkg_failed=no
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for cairo" >&5
+$as_echo_n "checking for cairo... " >&6; }
+if test -n "$cairo_CFLAGS"; then
+ pkg_cv_cairo_CFLAGS="$cairo_CFLAGS"
+ elif test -n "$PKG_CONFIG"; then
+ if test -n "$PKG_CONFIG" && \
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"cairo\""; } >&5
+ ($PKG_CONFIG --exists --print-errors "cairo") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ pkg_cv_cairo_CFLAGS=`$PKG_CONFIG --cflags "cairo" 2>/dev/null`
+ test "x$?" != "x0" && pkg_failed=yes
+else
+ pkg_failed=yes
+fi
+ else
+ pkg_failed=untried
+fi
+if test -n "$cairo_LIBS"; then
+ pkg_cv_cairo_LIBS="$cairo_LIBS"
+ elif test -n "$PKG_CONFIG"; then
+ if test -n "$PKG_CONFIG" && \
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"cairo\""; } >&5
+ ($PKG_CONFIG --exists --print-errors "cairo") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ pkg_cv_cairo_LIBS=`$PKG_CONFIG --libs "cairo" 2>/dev/null`
+ test "x$?" != "x0" && pkg_failed=yes
else
+ pkg_failed=yes
+fi
+ else
+ pkg_failed=untried
+fi
+
- echo "GL library files not found; disabling OpenGL"
- xc_with_GL=
+if test $pkg_failed = yes; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
+ _pkg_short_errors_supported=yes
+else
+ _pkg_short_errors_supported=no
fi
+ if test $_pkg_short_errors_supported = yes; then
+ cairo_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "cairo" 2>&1`
+ else
+ cairo_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "cairo" 2>&1`
+ fi
+ # Put the nasty error message in config.log where it belongs
+ echo "$cairo_PKG_ERRORS" >&5
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gluNewTess in -lGLU" >&5
-$as_echo_n "checking for gluNewTess in -lGLU... " >&6; }
-if ${ac_cv_lib_GLU_gluNewTess+:} false; then :
- $as_echo_n "(cached) " >&6
+ as_fn_error $? "Package requirements (cairo) were not met:
+
+$cairo_PKG_ERRORS
+
+Consider adjusting the PKG_CONFIG_PATH environment variable if you
+installed software in a non-standard prefix.
+
+Alternatively, you may set the environment variables cairo_CFLAGS
+and cairo_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details." "$LINENO" 5
+elif test $pkg_failed = untried; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it
+is in your PATH or set the PKG_CONFIG environment variable to the full
+path to pkg-config.
+
+Alternatively, you may set the environment variables cairo_CFLAGS
+and cairo_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details.
+
+To get pkg-config, see <http://pkg-config.freedesktop.org/>.
+See \`config.log' for more details" "$LINENO" 5; }
else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lGLU $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
+ cairo_CFLAGS=$pkg_cv_cairo_CFLAGS
+ cairo_LIBS=$pkg_cv_cairo_LIBS
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char gluNewTess ();
-int
-main ()
-{
-return gluNewTess ();
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_GLU_gluNewTess=yes
+fi
+
+pkg_failed=no
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for fontconfig" >&5
+$as_echo_n "checking for fontconfig... " >&6; }
+
+if test -n "$fontconfig_CFLAGS"; then
+ pkg_cv_fontconfig_CFLAGS="$fontconfig_CFLAGS"
+ elif test -n "$PKG_CONFIG"; then
+ if test -n "$PKG_CONFIG" && \
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"fontconfig\""; } >&5
+ ($PKG_CONFIG --exists --print-errors "fontconfig") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ pkg_cv_fontconfig_CFLAGS=`$PKG_CONFIG --cflags "fontconfig" 2>/dev/null`
+ test "x$?" != "x0" && pkg_failed=yes
else
- ac_cv_lib_GLU_gluNewTess=no
+ pkg_failed=yes
fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
+ else
+ pkg_failed=untried
+fi
+if test -n "$fontconfig_LIBS"; then
+ pkg_cv_fontconfig_LIBS="$fontconfig_LIBS"
+ elif test -n "$PKG_CONFIG"; then
+ if test -n "$PKG_CONFIG" && \
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"fontconfig\""; } >&5
+ ($PKG_CONFIG --exists --print-errors "fontconfig") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ pkg_cv_fontconfig_LIBS=`$PKG_CONFIG --libs "fontconfig" 2>/dev/null`
+ test "x$?" != "x0" && pkg_failed=yes
+else
+ pkg_failed=yes
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_GLU_gluNewTess" >&5
-$as_echo "$ac_cv_lib_GLU_gluNewTess" >&6; }
-if test "x$ac_cv_lib_GLU_gluNewTess" = xyes; then :
+ else
+ pkg_failed=untried
+fi
+
+
+
+if test $pkg_failed = yes; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
+ _pkg_short_errors_supported=yes
+else
+ _pkg_short_errors_supported=no
+fi
+ if test $_pkg_short_errors_supported = yes; then
+ fontconfig_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "fontconfig" 2>&1`
+ else
+ fontconfig_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "fontconfig" 2>&1`
+ fi
+ # Put the nasty error message in config.log where it belongs
+ echo "$fontconfig_PKG_ERRORS" >&5
+
+ as_fn_error $? "Package requirements (fontconfig) were not met:
+
+$fontconfig_PKG_ERRORS
+
+Consider adjusting the PKG_CONFIG_PATH environment variable if you
+installed software in a non-standard prefix.
+
+Alternatively, you may set the environment variables fontconfig_CFLAGS
+and fontconfig_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details." "$LINENO" 5
+elif test $pkg_failed = untried; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it
+is in your PATH or set the PKG_CONFIG environment variable to the full
+path to pkg-config.
+
+Alternatively, you may set the environment variables fontconfig_CFLAGS
+and fontconfig_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details.
+
+To get pkg-config, see <http://pkg-config.freedesktop.org/>.
+See \`config.log' for more details" "$LINENO" 5; }
+else
+ fontconfig_CFLAGS=$pkg_cv_fontconfig_CFLAGS
+ fontconfig_LIBS=$pkg_cv_fontconfig_LIBS
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+fi
+ for ac_header in ghostscript/gdevdsp.h
+do :
+ ac_fn_c_check_header_mongrel "$LINENO" "ghostscript/gdevdsp.h" "ac_cv_header_ghostscript_gdevdsp_h" "$ac_includes_default"
+if test "x$ac_cv_header_ghostscript_gdevdsp_h" = xyes; then :
cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBGLU 1
+#define HAVE_GHOSTSCRIPT_GDEVDSP_H 1
_ACEOF
- LIBS="-lGLU $LIBS"
+ GS_LIBS=-lgs
+ $as_echo "#define HAVE_GS 1" >>confdefs.h
+
else
- echo "GLU library files not found; disabling OpenGL"
- xc_with_GL=
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Building xcircuit without ghostscript rendering" >&5
+$as_echo "$as_me: WARNING: Building xcircuit without ghostscript rendering" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Install the ghostscript-devel package to solve this" >&5
+$as_echo "$as_me: WARNING: Install the ghostscript-devel package to solve this" >&2;}
+
fi
- CPPFLAGS="$ac_save_CPPFLAGS"
- LDFLAGS="$ac_save_LDFLAGS"
+done
+
fi
-if test $xc_with_GL ; then
- $as_echo "#define OPENGL 1" >>confdefs.h
- LIB_SPECS="${LIB_SPECS} -lGLU -lGL -lXi -lXmu -lXext"
+
+# Check whether --with-tcl was given.
+if test "${with_tcl+set}" = set; then :
+ withval=$with_tcl;
+ xc_with_tcl=$withval
+ if test "$withval" == "no" -o "$withval" == "NO"; then
+ xc_with_tcl=""
+ fi
+
fi
+
# Check whether --with-tk was given.
if test "${with_tk+set}" = set; then :
withval=$with_tk; xc_with_tk=$withval
@@ -6369,7 +6765,6 @@ if test "x$xc_with_tcl" != "x" ; then
TCL_INC_DIR="."
TK_INC_DIR="."
-
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for tclConfig.sh" >&5
$as_echo_n "checking for tclConfig.sh... " >&6; }
tcl_config_sh=""
@@ -6390,9 +6785,6 @@ $as_echo_n "checking for tclConfig.sh... " >&6; }
elif test -r "$dir/lib/tclConfig.sh" ; then
tcl_config_sh="$dir/lib/tclConfig.sh"
break
- elif test -r "$dir/unix/tclConfig.sh" ; then
- tcl_config_sh="$dir/unix/tclConfig.sh"
- break
fi
done
else
@@ -6412,9 +6804,6 @@ $as_echo_n "checking for tclConfig.sh... " >&6; }
elif test -r "$dir/lib/tclConfig.sh" ; then
tcl_config_sh="$dir/lib/tclConfig.sh"
break
- elif test -r "$dir/unix/tclConfig.sh" ; then
- tcl_config_sh="$dir/unix/tclConfig.sh"
- break
fi
done
@@ -6478,9 +6867,6 @@ $as_echo_n "checking for tkConfig.sh... " >&6; }
elif test -r "$dir/lib/tkConfig.sh" ; then
tk_config_sh="$dir/lib/tkConfig.sh"
break
- elif test -r "$dir/unix/tkConfig.sh" ; then
- tk_config_sh="$dir/unix/tkConfig.sh"
- break
fi
done
else
@@ -6501,9 +6887,6 @@ $as_echo_n "checking for tkConfig.sh... " >&6; }
elif test -r "$dir/lib/tkConfig.sh" ; then
tk_config_sh="$dir/lib/tkConfig.sh"
break
- elif test -r "$dir/unix/tkConfig.sh" ; then
- tk_config_sh="$dir/unix/tkConfig.sh"
- break
fi
done
#
@@ -6551,29 +6934,37 @@ fi
#
# Source in the Tcl/Tk configuration scripts.
#
-# BTW: Does anyone actually use the tclConfig.sh and tkConfig.sh
-# scripts? They seem to be always missing something. For example,
-# why don't they say where to find the Tcl and Tk header files?
-#
-# For example, give me the library directory paths separately
-# (I can't easily parse "-Ldir", but I can always paste a -L
-# on the front). If I want to specify equivalent of the -R flag,
-# I need the build a path of the library directories. Such as
-#
-# "-R $(BLTLIB):$(TKLIB):$(TCLLIB):($XLIB):$(JPEGLIB)"
+# This didn't work so well in the pre-8.5 days, but
+# seems to be okay now.
#
# -----------------------------------------------------------------------
if test "x$xc_with_tcl" != "x" ; then
. $tcl_config_sh
. $tk_config_sh
+
+ # Should probably trust the config file contents, but this configure
+ # file checks the Tcl and Tk include and lib directories. Since
+ # the config file doesn't separate out the libraries from the strings
+ # passed to the compiler/linker, do it manually here.
+ #
+ # Extract TCL_LIB_DIR from TCL_LIB_SPEC
+ # Extract TK_LIB_DIR from TK_LIB_SPEC
+ # Extract TCL_INC_DIR from TCL_INCLUDE_SPEC
+ # Extract TK_INC_DIR from TK_INCLUDE_SPEC
+ #
+ # These will be the defaults unless overridden by configure command line
+
+ tmpstr=${TCL_LIB_SPEC#*-L}
+ TCL_LIB_DIR=${tmpstr% -l*}
+ tmpstr=${TK_LIB_SPEC#*-L}
+ TK_LIB_DIR=${tmpstr% -l*}
+ TCL_INC_DIR=${TCL_INCLUDE_SPEC#*-I}
+ TK_INC_DIR=${TK_INCLUDE_SPEC#*-I}
+
LIBS="${TCL_LIBS} ${LIBS}"
- if test "$TCL_VERSION" = "7.6" -a "$TK_VERSION" = "4.2" ; then
- :
- elif test "$TCL_VERSION" = "7.5" -a "$TK_VERSION" = "4.1" ; then
- :
- elif test "$TCL_VERSION" = "$TK_VERSION" ; then
+ if test "$TCL_VERSION" = "$TK_VERSION" ; then
:
else
echo "Mismatched Tcl/Tk versions ($TCL_VERSION != $TK_VERSION)"
@@ -6582,6 +6973,11 @@ if test "x$xc_with_tcl" != "x" ; then
fi
fi
+# -----------------------------------------------------------------------
+# Rely on TCL_INCLUDE_SPEC from tclConfig.sh unless "--with-tclincls"
+# overrides. With TCL_INCLUDE_SPEC, pull out TCL_INC_DIR
+# -----------------------------------------------------------------------
+
if test "x$xc_with_tcl" != "x" ; then
if test "x${xc_with_tcl_includes}" != "x" ; then
if test -r "${xc_with_tcl_includes}/tcl.h" ; then
@@ -6600,6 +6996,7 @@ if test "x$xc_with_tcl" != "x" ; then
do
if test -r "$dir/tcl.h" ; then
TCL_INC_DIR=$dir
+ TCL_INCLUDE_SPEC="-I${TCL_INC_DIR}"
break
fi
done
@@ -6613,25 +7010,31 @@ if test "x$xc_with_tcl" != "x" ; then
fi
fi
+# -----------------------------------------------------------------------
+# Rely on TK_INCLUDE_SPEC from tkConfig.sh unless "--with-tkincls"
+# overrides. With TK_INCLUDE_SPEC, pull out TK_INC_DIR
+# -----------------------------------------------------------------------
+
if test "x$xc_with_tcl" != "x" ; then
if test "x${xc_with_tk_includes}" != "x" ; then
if test -r "${xc_with_tk_includes}/tk.h" ; then
TK_INC_DIR=${xc_with_tk_includes}
- else
+ elif test "x${TK_INCLUDE_SPEC}" == "x" ; then
echo "Can't find tk.h in \"${xc_with_tk_includes}\""
echo "Reverting to non-Tcl compilation"
xc_with_tcl=""
fi
- else
+ elif test "x${TK_INCLUDE_SPEC}" == "x" ; then
for dir in \
+ ${TK_PREFIX}/include/tcl${TCL_MAJOR_VERSION}.${TCL_MINOR_VERSION} \
${TK_PREFIX}/include/tk${TK_MAJOR_VERSION}.${TK_MINOR_VERSION} \
${TK_PREFIX}/include \
${TK_SRC_DIR}/generic \
- ${TK_INC_DIR} \
- ${TCL_INC_DIR}
+ ${TK_INC_DIR}
do
if test -r "$dir/tk.h" ; then
TK_INC_DIR=$dir
+ TK_INCLUDE_SPEC="-I${TK_INC_DIR}"
break
fi
done
@@ -6640,79 +7043,21 @@ if test "x$xc_with_tcl" != "x" ; then
echo "Reverting to non-Tcl compilation"
xc_with_tcl=""
fi
- fi
-fi
-
-if test "x$xc_with_tcl" != "x" ; then
- case $target in
- *-sunos4*|*-*-netbsd|NetBSD-*|FreeBSD-*|*-*-openbsd*|OpenBSD-*)
- TCL_LIB_NAME="tcl${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}"
- TK_LIB_NAME="tk${TK_MAJOR_VERSION}${TK_MINOR_VERSION}"
- ;;
- *)
- TCL_LIB_NAME="tcl${TCL_MAJOR_VERSION}.${TCL_MINOR_VERSION}"
- TK_LIB_NAME="tk${TK_MAJOR_VERSION}.${TK_MINOR_VERSION}"
- ;;
- esac
-
- TCL_LIB_SPEC="-l${TCL_LIB_NAME}"
- TK_LIB_SPEC="-l${TK_LIB_NAME}"
-
-# Find the version of "wish" that corresponds to TCL_EXEC_PREFIX
-# We really ought to run "ldd" to confirm that the linked libraries match.
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for wish executable" >&5
-$as_echo_n "checking for wish executable... " >&6; }
- for dir in \
- ${TK_EXEC_PREFIX}/bin \
- ${TK_EXEC_PREFIX}
- do
- for wishexe in \
- wish \
- wish${TK_VERSION} \
- wish.exe \
- wish${TK_VERSION}.exe
- do
- if test -r "$dir/$wishexe" ; then
- WISH_EXE=$dir/$wishexe
- break
- fi
- done
- if test "x${WISH_EXE}" != "x" ; then
- break
- fi
- done
- if test "x${WISH_EXE}" = "x" ; then
- echo "Warning: Can't find executable for \"wish\". You may have to"
- echo "manually set the value for WISH_EXE in the xcircuit startup script."
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${WISH_EXE}" >&5
-$as_echo "${WISH_EXE}" >&6; }
+ TK_INC_DIR=`echo ${TK_INCLUDE_SPEC} | sed -e '/-I/s/-I//'`
fi
+fi
-# Have to define SHDLIB_EXT here even though we have to do it below, too.
- case $target in
- *-hpux*)
- SHDLIB_EXT=".sl"
- ;;
- *cygwin*)
- SHDLIB_EXT=".dll"
- ;;
- *-darwin*)
- SHDLIB_EXT=".dylib"
- ;;
- *-openbsd*)
- SHDLIB_EXT=".so.${TCL_LIB_FILE##*.so.}"
- ;;
- *)
- SHDLIB_EXT=".so"
- ;;
- esac
+# --------------------------------------------------------------
+# Rely on TCL_LIB_SPEC from tclConfig.sh unless "--with-tcllibs"
+# overrides. With TCL_LIB_SPEC, pull out TCL_LIB_DIR
+# --------------------------------------------------------------
+if test "x$xc_with_tcl" != "x" ; then
if test "x${xc_with_tcl_libraries}" != "x" ; then
+ TCL_LIB_SPEC=""
for libname in \
+ "${xc_with_tcl_libraries}/${TCL_LIB_FILE}" \
"${xc_with_tcl_libraries}/lib${TCL_LIB_NAME}${SHDLIB_EXT}"
do
if test -r "$libname" ; then
@@ -6720,13 +7065,12 @@ $as_echo "${WISH_EXE}" >&6; }
break
fi
done
-
- if test "x${TCL_LIB_DIR}" = "x" ; then
+ if test "x${TCL_LIB_DIR}" == "x" ; then
echo "Can't find tcl library in \"${xc_with_tcl_libraries}\""
echo "Reverting to non-Tcl compile"
xc_with_tcl=""
fi
- else
+ elif test "x${TCL_LIB_SPEC}" == "x" ; then
for libpfix in "lib64" "lib"
do
libname="${TCL_EXEC_PREFIX}/${libpfix}/lib${TCL_LIB_NAME}${SHDLIB_EXT}"
@@ -6740,12 +7084,21 @@ $as_echo "${WISH_EXE}" >&6; }
echo "Reverting to non-Tcl compile"
xc_with_tcl=""
fi
+ else
+ TCL_LIB_DIR=`echo ${TCL_LIB_SPEC} | sed -e '/-L/s/-L//' -e '/-l/s/-l.*//'`
fi
fi
+# --------------------------------------------------------------
+# Rely on TK_LIB_SPEC from tkConfig.sh unless "--with-tklibs"
+# overrides. With TK_LIB_SPEC, pull out TK_LIB_DIR
+# --------------------------------------------------------------
+
if test "x$xc_with_tcl" != "x" ; then
if test "x${xc_with_tk_libraries}" != "x" ; then
+ TK_LIB_SPEC=""
for libname in \
+ "${xc_with_tk_libraries}/${TK_LIB_FILE}" \
"${xc_with_tk_libraries}/lib${TK_LIB_NAME}${SHDLIB_EXT}"
do
if test -r "$libname" ; then
@@ -6753,12 +7106,12 @@ if test "x$xc_with_tcl" != "x" ; then
break
fi
done
- if test "x${TK_LIB_DIR}" = "x" ; then
+ if test "x${TK_LIB_DIR}" == "x" ; then
echo "Can't find tk library in \"${xc_with_tk_libraries}\""
echo "Reverting to non-Tcl compile"
xc_with_tcl=""
fi
- else
+ elif test "x${TK_LIB_SPEC}" == "x" ; then
for libpfix in "lib64" "lib"
do
libname="${TK_EXEC_PREFIX}/${libpfix}/lib${TK_LIB_NAME}${SHDLIB_EXT}"
@@ -6772,306 +7125,179 @@ if test "x$xc_with_tcl" != "x" ; then
echo "Reverting to non-Tcl compile"
xc_with_tcl=""
fi
+ else
+ TK_LIB_DIR=`echo ${TCL_LIB_SPEC} | sed -e '/-L/s/-L//' -e '/-l/s/-l.*//'`
fi
fi
-
-# -----------------------------------------------------------------------
-#
-# Tk libraries and header files
-#
-# -----------------------------------------------------------------------
+#--------------------------------------------------------------------
+# If TCL_LIB_SPEC and/or TK_LIB_SPEC do not exist, construct them
+#--------------------------------------------------------------------
if test "x$xc_with_tcl" != "x" ; then
- if test "${TK_INC_DIR}" != "/usr/include" -a \
- "${TK_INC_DIR}" != "${TCL_INC_DIR}"; then
- INC_SPECS="${INC_SPECS} -I${TK_INC_DIR}"
- fi
- if test "${TK_LIB_DIR}" = "/usr/lib" -o \
- "${TK_LIB_DIR}" = "/usr/lib64" ; then
- LIB_SPECS="${TK_LIB_SPEC}"
- else
- LIB_SPECS="-L${TK_LIB_DIR} ${TK_LIB_SPEC}"
- if test "x${loader_run_path}" = "x" ; then
- loader_run_path="${TK_LIB_DIR}"
- else
- loader_run_path="${TK_LIB_DIR}:${loader_run_path}"
- fi
+ if test "x${TCL_LIB_SPEC}" == "x" ; then
+ case $target in
+ *-sunos4*|*-*-netbsd|NetBSD-*|FreeBSD-*|*-*-openbsd*|OpenBSD-*)
+ TCL_LIB_NAME="tcl${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}"
+ ;;
+ *)
+ TCL_LIB_NAME="tcl${TCL_MAJOR_VERSION}.${TCL_MINOR_VERSION}"
+ ;;
+ esac
+ TCL_LIB_SPEC="-L${TCL_LIB_DIR} -l${TCL_LIB_NAME}"
fi
-# -----------------------------------------------------------------------
-#
-# Tcl libraries and header files
-#
-# Add a header file directory specification only if the Tcl headers reside
-# in a different directory from Tk's.
-#
-#
-# -----------------------------------------------------------------------
- if test "x${TCL_INCLUDE_SPEC}" != "x" ; then
- INC_SPECS="${INC_SPECS} ${TCL_INCLUDE_SPEC}"
- elif test "${TCL_INC_DIR}" != "/usr/include" ; then
- INC_SPECS="${INC_SPECS} -I${TCL_INC_DIR}"
+ if test "x${TK_LIB_SPEC}" == "x" ; then
+ case $target in
+ *-sunos4*|*-*-netbsd|NetBSD-*|FreeBSD-*|*-*-openbsd*|OpenBSD-*)
+ TK_LIB_NAME="tk${TK_MAJOR_VERSION}${TK_MINOR_VERSION}"
+ ;;
+ *)
+ TK_LIB_NAME="tk${TK_MAJOR_VERSION}.${TK_MINOR_VERSION}"
+ ;;
+ esac
+ TK_LIB_SPEC="-L${TK_LIB_DIR} -l${TK_LIB_NAME}"
fi
- if test "${TCL_LIB_DIR}" = "/usr/lib" -o \
- "${TCL_LIB_DIR}" = "/usr/lib64" -o \
- "${TCL_LIB_DIR}" = "${TK_LIB_DIR}" ; then
- LIB_SPECS="${LIB_SPECS} ${TCL_LIB_SPEC}"
- else
- LIB_SPECS="${LIB_SPECS} -L${TCL_LIB_DIR} ${TCL_LIB_SPEC}"
- if test "x${loader_run_path}" = "x" ; then
- loader_run_path="${TCL_LIB_DIR}"
- else
- loader_run_path="${TCL_LIB_DIR}:${loader_run_path}"
+ # Find the version of "wish" that corresponds to TCL_EXEC_PREFIX
+ # We really ought to run "ldd" to confirm that the linked libraries match.
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for wish executable" >&5
+$as_echo_n "checking for wish executable... " >&6; }
+ for dir in \
+ ${TK_EXEC_PREFIX}/bin \
+ ${TK_EXEC_PREFIX}
+ do
+ for wishexe in \
+ wish \
+ wish${TK_VERSION} \
+ wish.exe \
+ wish${TK_VERSION}.exe
+ do
+ if test -r "$dir/$wishexe" ; then
+ WISH_EXE=$dir/$wishexe
+ break
+ fi
+ done
+ if test "x${WISH_EXE}" != "x" ; then
+ break
fi
+ done
+ if test "x${WISH_EXE}" = "x" ; then
+ echo "Warning: Can't find executable for \"wish\". You may have to"
+ echo "manually set the value for WISH_EXE in the xcircuit startup script."
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${WISH_EXE}" >&5
+$as_echo "${WISH_EXE}" >&6; }
fi
-#--------------------------------------------------------------------
-#
-# Check if we can generate shared libraries on this system. Set flags
-# to generate shared libraries for systems that we know about. Start
-# with the values found in tclConfig.sh, make changes as we know about
-# the different systems.
-#
-#--------------------------------------------------------------------
-
-# Initialize shared library build variables
-
- LDDL_FLAGS="-shared"
- SHDLIB_EXT=".so"
- LD_RUN_PATH=""
- EXTRA_LIB_SPECS=""
-
- build_shared="yes"
-
+ # Have to define SHDLIB_EXT here even though we have to do it below, too.
case $target in
- *-aix4.[2-9]*)
- # No Position-Independent flags needed
-
- # Use the installed export file or the one found in the source directory.
-
- if test -r "${TCL_LIB_DIR}/lib${TCL_LIB_NAME}.exp" ; then
- tcl_exp="${TCL_LIB_DIR}/lib${TCL_LIB_NAME}.exp"
- else
- tcl_exp="${TCL_SRC_DIR}/unix/lib.exp"
- fi
- if test -r "${TK_LIB_DIR}/lib${TK_LIB_NAME}.exp" ; then
- tk_exp="${TK_LIB_DIR}/lib${TK_LIB_NAME}.exp"
- else
- tk_exp="${TK_SRC_DIR}/unix/lib.exp"
- fi
-
- full_src_path=`cd ${srcdir}; pwd`
-
- # Use shell-script to link shared library
- SHLIB_LD="${full_src_path}/cf/ldAix /bin/ld -bhalt:4 -bM:SRE -bE:lib.exp -H512 -T512 -bnoentry -bI:${tk_exp} -bI:${tcl_exp}"
-
- SHLIB_LIB_SPEC="${aix_lib_specs} -lc"
-
- LDFLAGS="-L${loader_run_path}"
- EXTRA_LIB_SPECS="-ldl"
- ;;
-
- *-aix*)
- # No Position-Independent flags needed
-
- # Use the installed export file or the one found in the source directory.
-
- if test -r "${TCL_LIB_DIR}/lib${TCL_LIB_NAME}.exp" ; then
- tcl_exp="${TCL_LIB_DIR}/lib${TCL_LIB_NAME}.exp"
- else
- tcl_exp="${TCL_SRC_DIR}/unix/lib.exp"
- fi
- if test -r "${TK_LIB_DIR}/lib${TK_LIB_NAME}.exp" ; then
- tk_exp="${TK_LIB_DIR}/lib${TK_LIB_NAME}.exp"
- else
- tk_exp="${TK_SRC_DIR}/unix/lib.exp"
- fi
-
- full_src_path=`cd ${srcdir}/cf; pwd`
-
- # Use shell-script to link shared library
-
- SHLIB_LD="${full_src_path}/ldAix /bin/ld -bhalt:4 -bM:SRE -bE:lib.exp -H512 -T512 -bnoentry -bI:${tk_exp} -bI:${tcl_exp}"
-
- SHLIB_LIB_SPECS="${aix_lib_specs} -lc"
-
- LDFLAGS="-L${loader_run_path}"
- EXTRA_LIB_SPECS="-lld"
- ;;
-
- *-bsdi2*|*-bsdi3*)
- SHLIB_LD="shlicc"
- LDDL_FLAGS="-r"
-
- EXTRA_LIB_SPECS="-ldl"
- ;;
-
- *-darwin*)
- SHDLIB_EXT=".dylib"
- SHLIB_LIB_SPECS="${LIB_SPECS}"
- if test "${xc_with_gnu_ld}" = "yes" ; then
- LDDL_FLAGS="-dynamiclib -bind_at_load"
- else
- LDDL_FLAGS="-single_module -dynamiclib -flat_namespace"
- LDDL_FLAGS="${LDDL_FLAGS} -undefined suppress -noprebind"
- SHLIB_CFLAGS="-I/sw/include -fno-common"
- fi
- ;;
-
- *cygwin*)
- $as_echo "#define CYGWIN 1" >>confdefs.h
-
- SHDLIB_EXT=".dll"
- LDDL_FLAGS="-shared -Wl,--enable-auto-image-base -Wl,-rpath,${loader_run_path}"
- SHLIB_LIB_SPECS="${LIB_SPECS}"
- ;;
-
- *-bsdi4*)
- SHLIB_CFLAGS="-export-dynamic -fPIC"
- SHLIB_LD="${CC}"
- LDDL_FLAGS='-shared -Wl,-E -Wl,-soname,$@'
- ;;
-
- *-dgux*)
- SHLIB_CFLAGS="-K PIC"
- SHLIB_LD="cc"
- LDDL_FLAGS="-G"
-
- EXTRA_LIB_SPECS="-ldl"
- ;;
-
- *-hpux*)
- if test "$GCC" = "no" ; then
- DEFINES="$DEFINES -D_HPUX_SOURCE"
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5
-$as_echo_n "checking for shl_load in -ldld... " >&6; }
-if ${ac_cv_lib_dld_shl_load+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-ldld $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char shl_load ();
-int
-main ()
-{
-return shl_load ();
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_dld_shl_load=yes
-else
- ac_cv_lib_dld_shl_load=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5
-$as_echo "$ac_cv_lib_dld_shl_load" >&6; }
-if test "x$ac_cv_lib_dld_shl_load" = xyes; then :
- found=yes
-else
- found=no
+ *-hpux*)
+ SHDLIB_EXT=".sl"
+ ;;
+ *cygwin*)
+ SHDLIB_EXT=".dll.a"
+ ;;
+ *-darwin*)
+ SHDLIB_EXT=".dylib"
+ ;;
+ *-openbsd*)
+ SHDLIB_EXT=".so.${TCL_LIB_FILE##*.so.}"
+ ;;
+ *)
+ SHDLIB_EXT=".so"
+ ;;
+ esac
fi
- if test "${found}" = "yes" ; then
- SHLIB_CFLAGS="+z"
- SHLIB_LD="ld"
- LDDL_FLAGS="-b -E -n +s +b,${loader_run_path}:."
- SHDLIB_EXT=".sl"
-
- # The run path is included in both LDFLAGS and LDDL_FLAGS
- # because SHLIB_LD is ld and LD is cc/gcc.
- LDFLAGS="-Wl,-E -Wl,+s,+b,${loader_run_path}:."
- EXTRA_LIB_SPECS="-ldld"
- fi
- ;;
+# -----------------------------------------------------------------------
+#
+# Tk libraries and header files
+#
+# -----------------------------------------------------------------------
- *-irix64-6.5*)
- SHLIB_LD="ld"
- LDDL_FLAGS="-32 -shared -rdata_shared"
- LD_RUN_PATH="-Wl,-rpath,${loader_run_path}"
- ;;
+if test "x$xc_with_tcl" != "x" ; then
+ INC_SPECS="${INC_SPECS} ${TCL_INCLUDE_SPEC} ${TK_INCLUDE_SPEC}"
+ LIB_SPECS="${LIB_SPECS} ${TCL_LIB_SPEC} ${TK_LIB_SPEC}"
- *-irix-56.*|*-irix64-*)
- SHLIB_LD="ld"
- LDDL_FLAGS="-shared -rdata_shared"
- LD_RUN_PATH="-Wl,-rpath,${loader_run_path}"
- LDFLAGS=""
- if test "$GCC" = "yes" ; then
- SHLIB_CFLAGS="-mabi=n32 $SHLIB_CFLAGS"
- LDDL_FLAGS="-mabi=n32 $LDDL_FLAGS"
- LDFLAGS="-mabi=n32 $LDFLAGS"
- else
- CFLAGS="-n32 $CFLAGS"
- LDFLAGS="-n32 $LDFLAGS"
- fi
- ;;
+ if test "x${loader_run_path}" = "x" ; then
+ loader_run_path="${TCL_LIB_DIR}"
+ else
+ loader_run_path="${TCL_LIB_DIR}:${loader_run_path}"
+ fi
- *-linux*)
- SHLIB_CFLAGS="-fPIC"
- SHLIB_LD="${CC}"
- LDDL_FLAGS='-shared -Wl,-soname,$@'
- LD_RUN_PATH="-Wl,-rpath,${loader_run_path}"
+ #--------------------------------------------------------------------
+ #
+ # Check if we can generate shared libraries on this system. Set flags
+ # to generate shared libraries for systems that we know about. Start
+ # with the values found in tclConfig.sh, make changes as we know about
+ # the different systems.
+ #
+ #--------------------------------------------------------------------
- EXTRA_LIB_SPECS="-ldl"
+ # Initialize shared library build variables
- case $target in
- x86_64-*)
- # AMD 64-bit archictecture
- # Add -fPIC to standard compile switch
- CFLAGS="${CFLAGS} -fPIC"
- ;;
- esac
- ;;
+ if test "x${TCL_SHLIB_SUFFIX}" == "x" ; then
+ SHDLIB_EXT=".so"
+ else
+ SHDLIB_EXT="${TCL_SHLIB_SUFFIX}"
+ fi
- *-mp-ras-02*)
- SHLIB_CFLAGS="-G -K PIC"
- SHLIB_LD="${CC}"
- LDDL_FLAGS=""
- ;;
+ if test "x${TCL_SHLIB_LD}" == "x" ; then
+
+ # Construct shared library build arguments the painful way
+ # This is not expected to be necessary, so the number of
+ # supported systems has been pared down to a minimum.
+
+ LDDL_FLAGS="-shared"
+ LD_RUN_PATH=""
+ SHLIB_LD="${CC}"
+ EXTRA_LIB_SPECS=""
+
+ case $target in
+ *-darwin*)
+ SHDLIB_EXT=".dylib"
+ SHLIB_LIB_SPECS="${LIB_SPECS}"
+ if test "${xc_with_gnu_ld}" = "yes" ; then
+ LDDL_FLAGS="-dynamiclib -bind_at_load"
+ else
+ LDDL_FLAGS="-single_module -dynamiclib -flat_namespace"
+ LDDL_FLAGS="${LDDL_FLAGS} -undefined suppress -noprebind"
+ SHLIB_CFLAGS="-I/sw/include -fno-common"
+ fi
+ ;;
- *-mp-ras-*)
- SHLIB_CFLAGS="-G -K PIC"
- SHLIB_LD="${CC}"
- LDDL_FLAGS="-Wl,-Bexport"
- ;;
+ *cygwin*)
+ $as_echo "#define CYGWIN 1" >>confdefs.h
- *-ncr-sysv4-*2*)
- SHLIB_CFLAGS="-K PIC"
- SHLIB_LD="cc"
- LDDL_FLAGS="-G"
+ SHDLIB_EXT=".dll.a"
+ LDDL_FLAGS="-shared -Wl,--enable-auto-image-base -Wl,-rpath,${loader_run_path}"
+ SHLIB_LIB_SPECS="${LIB_SPECS}"
+ ;;
- EXTRA_LIB_SPECS="-ldl"
- ;;
+ *-linux*)
+ SHLIB_CFLAGS="-fPIC"
+ LDDL_FLAGS='-shared -Wl,-soname,$@'
+ LD_RUN_PATH="-Wl,-rpath,${loader_run_path}"
- *-ncr-sysv4*)
- SHLIB_CFLAGS="-K PIC"
- SHLIB_LD="cc"
- LDDL_FLAGS="-G -Wl,-Bexport"
+ EXTRA_LIB_SPECS="-ldl"
- LDFLAGS="-Wl,-Bexport"
- EXTRA_LIB_SPECS="-ldl"
- ;;
+ case $target in
+ x86_64-*)
+ # AMD 64-bit archictecture
+ # Add -fPIC to standard compile switch
+ CFLAGS="${CFLAGS} -fPIC"
+ ;;
+ esac
+ ;;
- *-netbsd*|*-freebsd*|*-openbsd*)
- # Not available on all versions: check for include file.
- ac_fn_c_check_header_mongrel "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default"
+ *-netbsd*|*-freebsd*|*-openbsd*)
+ # Not available on all versions: check for include file.
+ ac_fn_c_check_header_mongrel "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default"
if test "x$ac_cv_header_dlfcn_h" = xyes; then :
test_ok=yes
else
@@ -7079,110 +7305,47 @@ else
fi
- if test "$test_ok" = yes; then
- SHLIB_CFLAGS="-fpic"
- SHLIB_LD="ld"
- LDDL_FLAGS="-shared"
- fi
- ;;
-
- *-nextstep*)
- SHLIB_LD="cc"
- LDDL_FLAGS="-nostdlib -r"
- ;;
-
- *-osf1-1.012*)
- # OSF/1 1.[012] from OSF, and derivatives, including Paragon OSF/1
-
- # Warning: Ugly Makefile Hack
- # Make package name same as library name
-
- SHLIB_LD='ld -R -export $@:'
- ;;
-
- *-osf1-1.*)
- # OSF/1 1.3 from OSF using ELF, and derivatives, including AD2
-
- SHLIB_CFLAGS="-fpic"
- SHLIB_LD="ld -shared"
- ;;
-
- *-osf1V*)
- # Digital OSF/1
-
- SHLIB_LD='ld'
- LDDL_FLAGS='-shared -expect_unresolved "*"'
- LD_RUN_PATH="-Wl,-rpath,${loader_run_path}"
- LDFLAGS=""
- ;;
-
- *-sco*)
- # Note, dlopen is available only on SCO 3.2.5 and greater. However,
- # this test works, since "uname -s" was non-standard in 3.2.4 and
- # below.
-
- SHLIB_CFLAGS="-Kpic -belf"
- SHLIB_LD="ld"
- LDDL_FLAGS="-G"
- LDFLAGS="-belf -Wl,-Bexport"
- ;;
-
- *-sni-sysv*)
-
- SHLIB_CFLAGS="-K PIC"
- SHLIB_LD="cc"
- LDDL_FLAGS="-G"
-
- EXTRA_LIB_SPECS="-ldl"
- ;;
+ if test "$test_ok" = yes; then
+ SHLIB_CFLAGS="-fpic"
+ SHLIB_LD="ld"
+ LDDL_FLAGS="-shared"
+ fi
+ ;;
+ esac
- *-sunos4*)
+ if test "$GCC" = "yes" ; then
+ CFLAGS="-fPIC ${CFLAGS}"
+ fi
- SHLIB_CFLAGS="-PIC"
- SHLIB_LD="ld"
- LDDL_FLAGS="-assert pure-text"
+ else
- EXTRA_LIB_SPECS="-ldl"
- ;;
+ # Rely on shared lib arguments in tclConfig.sh
- *-solaris2*)
+ SHLIB_LD="${TCL_SHLIB_LD}"
+ EXTRA_LIB_FLAGS=""
+ LDDL_FLAGS="${TCL_LD_FLAGS}"
+ LD_RUN_PATH=""
- if test "${xc_with_gnu_ld}" = "yes" ; then
- LDDL_FLAGS='-rdynamic -shared -Wl,-E -Wl,-soname,$@'
+ case $target in
+ *-linux*)
LD_RUN_PATH="-Wl,-rpath,${loader_run_path}"
- else
- LDDL_FLAGS="-shared -mimpure-text"
- LD_RUN_PATH="-R ${loader_run_path}"
- fi
- EXTRA_LIB_SPECS="-ldl"
- SHLIB_LIB_SPECS="${LIB_SPECS}"
- ;;
-
- *-mips-dde-sysv*)
-
- SHLIB_CFLAGS="-KPIC"
- SHLIB_LD="cc"
- LDDL_FLAGS="-G"
-
- EXTRA_LIB_SPECS="-ldl"
- ;;
-
- *-pc-sysv4* | *-unixware-5*)
- SHLIB_CFLAGS="-G -KPIC"
- SHLIB_LD="${CC}"
- LDDL_FLAGS=" -Wl,-Bexport"
- ;;
-
- esac
+ ;;
+ esac
+ fi
-# If we're running gcc, then set SHLIB_CFLAGS flags for compiling
-# shared libraries for gcc, instead of those of the vendor's
-# compiler.
+ # If we're running gcc, then set SHLIB_CFLAGS flags for compiling
+ # shared libraries for gcc, instead of those of the vendor's
+ # compiler.
if test "$GCC" = "yes" ; then
-# SHLIB_CFLAGS="${SHLIB_CFLAGS} -fPIC"
- CFLAGS="-fPIC ${CFLAGS}"
+ if test "x${TCL_SHLIB_CFLAGS}" = "x" ; then
+ SHLIB_CFLAGS="-fPIC ${SHLIB_CFLAGS}"
+ else
+ SHLIB_CFLAGS="${TCL_SHLIB_CFLAGS} ${SHLIB_CFLAGS}"
+ fi
fi
+ CFLAGS="${CFLAGS} ${SHLIB_CFLAGS}"
+
if test "${xc_with_gnu_ld}" = "yes" ; then
LDDL_FLAGS="${LDDL_FLAGS} -Wl,--version-script=symbol.map"
fi
@@ -7265,7 +7428,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_GS_EXEC=""
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -7322,7 +7485,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_SPICE_EXEC=""
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -7385,7 +7548,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_path_PYTHON="$as_dir/$ac_word$ac_exec_ext"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -7718,6 +7881,14 @@ LIBOBJS=$ac_libobjs
LTLIBOBJS=$ac_ltlibobjs
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5
+$as_echo_n "checking that generated files are newer than configure... " >&6; }
+ if test -n "$am_sleep_pid"; then
+ # Hide warnings about reused PIDs.
+ wait $am_sleep_pid 2>/dev/null
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5
+$as_echo "done" >&6; }
if test -n "$EXEEXT"; then
am__EXEEXT_TRUE=
am__EXEEXT_FALSE='#'
@@ -8032,16 +8203,16 @@ if (echo >conf$$.file) 2>/dev/null; then
# ... but there are two gotchas:
# 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
# 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
- # In both cases, we have to default to `cp -p'.
+ # In both cases, we have to default to `cp -pR'.
ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
- as_ln_s='cp -p'
+ as_ln_s='cp -pR'
elif ln conf$$.file conf$$ 2>/dev/null; then
as_ln_s=ln
else
- as_ln_s='cp -p'
+ as_ln_s='cp -pR'
fi
else
- as_ln_s='cp -p'
+ as_ln_s='cp -pR'
fi
rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
rmdir conf$$.dir 2>/dev/null
@@ -8101,28 +8272,16 @@ else
as_mkdir_p=false
fi
-if test -x / >/dev/null 2>&1; then
- as_test_x='test -x'
-else
- if ls -dL / >/dev/null 2>&1; then
- as_ls_L_option=L
- else
- as_ls_L_option=
- fi
- as_test_x='
- eval sh -c '\''
- if test -d "$1"; then
- test -d "$1/.";
- else
- case $1 in #(
- -*)set "./$1";;
- esac;
- case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #((
- ???[sx]*):;;*)false;;esac;fi
- '\'' sh
- '
-fi
-as_executable_p=$as_test_x
+
+# as_fn_executable_p FILE
+# -----------------------
+# Test if FILE is an executable regular file.
+as_fn_executable_p ()
+{
+ test -f "$1" && test -x "$1"
+} # as_fn_executable_p
+as_test_x='test -x'
+as_executable_p=as_fn_executable_p
# 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'"
@@ -8144,7 +8303,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# values after options handling.
ac_log="
This file was extended by $as_me, which was
-generated by GNU Autoconf 2.68. Invocation command line was
+generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
CONFIG_HEADERS = $CONFIG_HEADERS
@@ -8201,10 +8360,10 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
config.status
-configured by $0, generated by GNU Autoconf 2.68,
+configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
-Copyright (C) 2010 Free Software Foundation, Inc.
+Copyright (C) 2012 Free Software Foundation, Inc.
This config.status script is free software; the Free Software Foundation
gives unlimited permission to copy, distribute and modify it."
@@ -8284,7 +8443,7 @@ fi
_ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
if \$ac_cs_recheck; then
- set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
+ set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
shift
\$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6
CONFIG_SHELL='$SHELL'
@@ -8753,7 +8912,7 @@ $as_echo "$as_me: executing $ac_file commands" >&6;}
case $ac_file$ac_mode in
"depfiles":C) test x"$AMDEP_TRUE" != x"" || {
- # Autoconf 2.62 quotes --file arguments for eval, but not when files
+ # Older Autoconf quotes --file arguments for eval, but not when files
# are listed without --file. Let's play safe and only enable the eval
# if we detect the quoting.
case $CONFIG_FILES in
@@ -8766,7 +8925,7 @@ $as_echo "$as_me: executing $ac_file commands" >&6;}
# 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
+ # 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.
@@ -8800,21 +8959,19 @@ $as_echo X"$mf" |
continue
fi
# Extract the definition of DEPDIR, am__include, and am__quote
- # from the Makefile without running `make'.
+ # from the Makefile without running 'make'.
DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
test -z "$DEPDIR" && continue
am__include=`sed -n 's/^am__include = //p' < "$mf"`
- test -z "am__include" && continue
+ test -z "$am__include" && continue
am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
- # When using ansi2knr, U may be empty or an underscore; expand it
- U=`sed -n 's/^U = //p' < "$mf"`
# Find all dependency output files, they are included files with
# $(DEPDIR) in their names. 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 "
s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
- sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
+ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do
# Make sure the directory exists.
test -f "$dirpart/$file" && continue
fdir=`$as_dirname -- "$file" ||
@@ -8885,3 +9042,32 @@ if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
fi
+
+echo ""
+echo "Configuration results:"
+echo "----------------------------------------------------"
+echo ""
+
+if test "x$xc_with_tcl" == "x" ; then
+ if test "x$PYTHON" != x; then
+ echo "Using Python interface (not recommended)"
+ else
+ echo "No Tcl/Tk, using standard Xlib/Xt interface."
+ echo "If that is not what you wanted, then make sure"
+ echo "you have Tcl/Tk development packages installed?"
+ fi
+else
+ echo "Using Tcl/Tk interface"
+fi
+echo ""
+
+if test "x$xc_with_cairo" == "x" ; then
+ echo "No Cairo graphics."
+ echo "If that is not what you wanted, then make sure"
+ echo "you have libcairo and fontconfig installed."
+ echo "Try installing package cairo-devel."
+else
+ echo "Using Cairo graphics"
+fi
+echo ""
+echo "CFLAGS=${CFLAGS}"
diff --git a/configure.in b/configure.in
index 34d0f4b..a11d817 100644
--- a/configure.in
+++ b/configure.in
@@ -23,11 +23,10 @@ INSTALL_TARGET="undefined-install-target"
REVISION=`cat ./VERSION | cut -d. -f3`
INTERPRETER=NOINTERP
HAVE_LGF=NOFORMATS
-xc_with_GL=
-SHLIB_CFLAGS=""
LIB_SPECS=""
WISH_EXE=""
+SHLIB_CFLAGS=""
dnl Default is to use Tcl; if it can't be found, then flag a warning
dnl and revert to the non-Tcl version.
@@ -148,29 +147,6 @@ foo = 0],[
AC_MSG_RESULT(yes)],
AC_MSG_RESULT(no))
-dnl OpenGL Graphics
-AC_ARG_WITH(opengl,
-[ --with-opengl=DIR use OpenGL include files in DIR], [
- if test "$withval" = "no" -o "$withval" = "NO" ; then
- xc_with_GL=
- else
- xc_with_GL=1
- if test "$withval" != "no" -a "$withval" != "yes"; then
- OGL_INCLUDE_DIR=${withval}
- fi
- fi
-])
-
-dnl Graphics double-buffering? Enabled by default unless OpenGL used.
-AC_ARG_ENABLE(double-buffer,
-[ --disable-double-buffer disable graphics double-buffering], , [
- if test "x$xc_with_GL" == "x" ; then
- AC_DEFINE(DOUBLEBUFFER)
- else
- AC_MSG_WARN(Double-buffering option not applicable to OpenGL version.)
- fi
-])
-
dnl Enable compile-time Optimization? Disable by default for debugging
AC_ARG_ENABLE(optimize,
[ --enable-optimize enable compile-time optimizer flag -O2], , [
@@ -299,7 +275,42 @@ xc_with_tcl_includes=""
xc_with_tk_includes=""
xc_with_tcl_libraries=""
xc_with_tk_libraries=""
+xc_with_cairo="yes"
+dnl -----------------------------------------------------------------------
+dnl --- Cairo library
+dnl -----------------------------------------------------------------------
+
+AC_ARG_WITH([cairo],
+ [AS_HELP_STRING([--with-cairo],
+ [Use cairo graphics library @<:@default=yes@:>@])],
+ [
+ xc_with_cairo=$withval
+ if test "$withval" == "no" -o "$withval" == "NO"; then
+ xc_with_cairo=""
+ fi
+ ], )
+
+if test "x$xc_with_cairo" != "x" ; then
+ AC_DEFINE([HAVE_CAIRO])
+ PKG_CHECK_MODULES([cairo], [cairo])
+ PKG_CHECK_MODULES([fontconfig], [fontconfig])
+ AC_CHECK_HEADERS([ghostscript/gdevdsp.h],
+ [
+ GS_LIBS=-lgs
+ AC_DEFINE([HAVE_GS])
+ ],
+ [
+ AC_MSG_WARN([Building xcircuit without ghostscript rendering])
+ AC_MSG_WARN([Install the ghostscript-devel package to solve this])
+ ]
+ )
+fi
+
+dnl -----------------------------------------------------------------------
+dnl --- Tcl/Tk support
+dnl -----------------------------------------------------------------------
+
AC_ARG_WITH(tcl,
[ --with-tcl=DIR Find tclConfig.sh in DIR], [
xc_with_tcl=$withval
@@ -309,44 +320,6 @@ AC_ARG_WITH(tcl,
], )
dnl -----------------------------------------------------------------------
-dnl Find OpenGL, if selected
-dnl -----------------------------------------------------------------------
-
-if test $xc_with_GL ; then
- ac_save_CPPFLAGS="$CPPFLAGS"
- if test $OGL_INCLUDE_DIR ; then
- CPPFLAGS="$CPPFLAGS -I$OGL_INCLUDE_DIR"
- fi
- CPPFLAGS="$CPPFLAGS $X_CFLAGS"
- AC_CHECK_HEADER(GL/gl.h, , [
- echo "GL header files not found; disabling OpenGL"
- xc_with_GL=
- ],)
- CPPFLAGS="$ac_save_CPPFLAGS"
-fi
-
-if test $xc_with_GL ; then
- ac_save_CPPFLAGS="$CPPFLAGS"
- ac_save_LDFLAGS="$LDFLAGS"
- LDFLAGS="$LDFLAGS $X_LIBS $X_EXTRA_LIBS"
- AC_CHECK_LIB(GL, glXCreateContext, , [
- echo "GL library files not found; disabling OpenGL"
- xc_with_GL=
- ],)
- AC_CHECK_LIB(GLU, gluNewTess, , [
- echo "GLU library files not found; disabling OpenGL"
- xc_with_GL=
- ],)
- CPPFLAGS="$ac_save_CPPFLAGS"
- LDFLAGS="$ac_save_LDFLAGS"
-fi
-
-if test $xc_with_GL ; then
- AC_DEFINE(OPENGL)
- LIB_SPECS="${LIB_SPECS} -lGLU -lGL -lXi -lXmu -lXext"
-fi
-
-dnl -----------------------------------------------------------------------
dnl If TCL is not disabled, do our best to find it
dnl -----------------------------------------------------------------------
@@ -372,7 +345,6 @@ if test "x$xc_with_tcl" != "x" ; then
TCL_INC_DIR="."
TK_INC_DIR="."
-
AC_MSG_CHECKING([for tclConfig.sh])
tcl_config_sh=""
@@ -392,9 +364,6 @@ if test "x$xc_with_tcl" != "x" ; then
elif test -r "$dir/lib/tclConfig.sh" ; then
tcl_config_sh="$dir/lib/tclConfig.sh"
break
- elif test -r "$dir/unix/tclConfig.sh" ; then
- tcl_config_sh="$dir/unix/tclConfig.sh"
- break
fi
done
else
@@ -414,9 +383,6 @@ if test "x$xc_with_tcl" != "x" ; then
elif test -r "$dir/lib/tclConfig.sh" ; then
tcl_config_sh="$dir/lib/tclConfig.sh"
break
- elif test -r "$dir/unix/tclConfig.sh" ; then
- tcl_config_sh="$dir/unix/tclConfig.sh"
- break
fi
done
@@ -478,9 +444,6 @@ if test "x$xc_with_tcl" != "x" ; then
elif test -r "$dir/lib/tkConfig.sh" ; then
tk_config_sh="$dir/lib/tkConfig.sh"
break
- elif test -r "$dir/unix/tkConfig.sh" ; then
- tk_config_sh="$dir/unix/tkConfig.sh"
- break
fi
done
else
@@ -501,9 +464,6 @@ if test "x$xc_with_tcl" != "x" ; then
elif test -r "$dir/lib/tkConfig.sh" ; then
tk_config_sh="$dir/lib/tkConfig.sh"
break
- elif test -r "$dir/unix/tkConfig.sh" ; then
- tk_config_sh="$dir/unix/tkConfig.sh"
- break
fi
done
#
@@ -550,29 +510,37 @@ fi
#
# Source in the Tcl/Tk configuration scripts.
#
-# BTW: Does anyone actually use the tclConfig.sh and tkConfig.sh
-# scripts? They seem to be always missing something. For example,
-# why don't they say where to find the Tcl and Tk header files?
-#
-# For example, give me the library directory paths separately
-# (I can't easily parse "-Ldir", but I can always paste a -L
-# on the front). If I want to specify equivalent of the -R flag,
-# I need the build a path of the library directories. Such as
-#
-# "-R $(BLTLIB):$(TKLIB):$(TCLLIB):($XLIB):$(JPEGLIB)"
+# This didn't work so well in the pre-8.5 days, but
+# seems to be okay now.
#
# -----------------------------------------------------------------------
if test "x$xc_with_tcl" != "x" ; then
. $tcl_config_sh
. $tk_config_sh
+
+ # Should probably trust the config file contents, but this configure
+ # file checks the Tcl and Tk include and lib directories. Since
+ # the config file doesn't separate out the libraries from the strings
+ # passed to the compiler/linker, do it manually here.
+ #
+ # Extract TCL_LIB_DIR from TCL_LIB_SPEC
+ # Extract TK_LIB_DIR from TK_LIB_SPEC
+ # Extract TCL_INC_DIR from TCL_INCLUDE_SPEC
+ # Extract TK_INC_DIR from TK_INCLUDE_SPEC
+ #
+ # These will be the defaults unless overridden by configure command line
+
+ tmpstr=${TCL_LIB_SPEC#*-L}
+ TCL_LIB_DIR=${tmpstr% -l*}
+ tmpstr=${TK_LIB_SPEC#*-L}
+ TK_LIB_DIR=${tmpstr% -l*}
+ TCL_INC_DIR=${TCL_INCLUDE_SPEC#*-I}
+ TK_INC_DIR=${TK_INCLUDE_SPEC#*-I}
+
LIBS="${TCL_LIBS} ${LIBS}"
- if test "$TCL_VERSION" = "7.6" -a "$TK_VERSION" = "4.2" ; then
- :
- elif test "$TCL_VERSION" = "7.5" -a "$TK_VERSION" = "4.1" ; then
- :
- elif test "$TCL_VERSION" = "$TK_VERSION" ; then
+ if test "$TCL_VERSION" = "$TK_VERSION" ; then
:
else
echo "Mismatched Tcl/Tk versions ($TCL_VERSION != $TK_VERSION)"
@@ -581,6 +549,11 @@ if test "x$xc_with_tcl" != "x" ; then
fi
fi
+# -----------------------------------------------------------------------
+# Rely on TCL_INCLUDE_SPEC from tclConfig.sh unless "--with-tclincls"
+# overrides. With TCL_INCLUDE_SPEC, pull out TCL_INC_DIR
+# -----------------------------------------------------------------------
+
if test "x$xc_with_tcl" != "x" ; then
if test "x${xc_with_tcl_includes}" != "x" ; then
if test -r "${xc_with_tcl_includes}/tcl.h" ; then
@@ -599,6 +572,7 @@ if test "x$xc_with_tcl" != "x" ; then
do
if test -r "$dir/tcl.h" ; then
TCL_INC_DIR=$dir
+ TCL_INCLUDE_SPEC="-I${TCL_INC_DIR}"
break
fi
done
@@ -612,25 +586,31 @@ if test "x$xc_with_tcl" != "x" ; then
fi
fi
+# -----------------------------------------------------------------------
+# Rely on TK_INCLUDE_SPEC from tkConfig.sh unless "--with-tkincls"
+# overrides. With TK_INCLUDE_SPEC, pull out TK_INC_DIR
+# -----------------------------------------------------------------------
+
if test "x$xc_with_tcl" != "x" ; then
if test "x${xc_with_tk_includes}" != "x" ; then
if test -r "${xc_with_tk_includes}/tk.h" ; then
TK_INC_DIR=${xc_with_tk_includes}
- else
+ elif test "x${TK_INCLUDE_SPEC}" == "x" ; then
echo "Can't find tk.h in \"${xc_with_tk_includes}\""
echo "Reverting to non-Tcl compilation"
xc_with_tcl=""
fi
- else
+ elif test "x${TK_INCLUDE_SPEC}" == "x" ; then
for dir in \
+ ${TK_PREFIX}/include/tcl${TCL_MAJOR_VERSION}.${TCL_MINOR_VERSION} \
${TK_PREFIX}/include/tk${TK_MAJOR_VERSION}.${TK_MINOR_VERSION} \
${TK_PREFIX}/include \
${TK_SRC_DIR}/generic \
- ${TK_INC_DIR} \
- ${TCL_INC_DIR}
+ ${TK_INC_DIR}
do
if test -r "$dir/tk.h" ; then
TK_INC_DIR=$dir
+ TK_INCLUDE_SPEC="-I${TK_INC_DIR}"
break
fi
done
@@ -639,76 +619,21 @@ if test "x$xc_with_tcl" != "x" ; then
echo "Reverting to non-Tcl compilation"
xc_with_tcl=""
fi
- fi
-fi
-
-if test "x$xc_with_tcl" != "x" ; then
- case $target in
- *-sunos4*|*-*-netbsd|NetBSD-*|FreeBSD-*|*-*-openbsd*|OpenBSD-*)
- TCL_LIB_NAME="tcl${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}"
- TK_LIB_NAME="tk${TK_MAJOR_VERSION}${TK_MINOR_VERSION}"
- ;;
- *)
- TCL_LIB_NAME="tcl${TCL_MAJOR_VERSION}.${TCL_MINOR_VERSION}"
- TK_LIB_NAME="tk${TK_MAJOR_VERSION}.${TK_MINOR_VERSION}"
- ;;
- esac
-
- TCL_LIB_SPEC="-l${TCL_LIB_NAME}"
- TK_LIB_SPEC="-l${TK_LIB_NAME}"
-
-# Find the version of "wish" that corresponds to TCL_EXEC_PREFIX
-# We really ought to run "ldd" to confirm that the linked libraries match.
-
- AC_MSG_CHECKING([for wish executable])
- for dir in \
- ${TK_EXEC_PREFIX}/bin \
- ${TK_EXEC_PREFIX}
- do
- for wishexe in \
- wish \
- wish${TK_VERSION} \
- wish.exe \
- wish${TK_VERSION}.exe
- do
- if test -r "$dir/$wishexe" ; then
- WISH_EXE=$dir/$wishexe
- break
- fi
- done
- if test "x${WISH_EXE}" != "x" ; then
- break
- fi
- done
- if test "x${WISH_EXE}" = "x" ; then
- echo "Warning: Can't find executable for \"wish\". You may have to"
- echo "manually set the value for WISH_EXE in the xcircuit startup script."
- AC_MSG_RESULT(no)
else
- AC_MSG_RESULT([${WISH_EXE}])
+ TK_INC_DIR=`echo ${TK_INCLUDE_SPEC} | sed -e '/-I/s/-I//'`
fi
+fi
-# Have to define SHDLIB_EXT here even though we have to do it below, too.
- case $target in
- *-hpux*)
- SHDLIB_EXT=".sl"
- ;;
- *cygwin*)
- SHDLIB_EXT=".dll"
- ;;
- *-darwin*)
- SHDLIB_EXT=".dylib"
- ;;
- *-openbsd*)
- SHDLIB_EXT=".so.${TCL_LIB_FILE##*.so.}"
- ;;
- *)
- SHDLIB_EXT=".so"
- ;;
- esac
+# --------------------------------------------------------------
+# Rely on TCL_LIB_SPEC from tclConfig.sh unless "--with-tcllibs"
+# overrides. With TCL_LIB_SPEC, pull out TCL_LIB_DIR
+# --------------------------------------------------------------
+if test "x$xc_with_tcl" != "x" ; then
if test "x${xc_with_tcl_libraries}" != "x" ; then
+ TCL_LIB_SPEC=""
for libname in \
+ "${xc_with_tcl_libraries}/${TCL_LIB_FILE}" \
"${xc_with_tcl_libraries}/lib${TCL_LIB_NAME}${SHDLIB_EXT}"
do
if test -r "$libname" ; then
@@ -716,13 +641,12 @@ if test "x$xc_with_tcl" != "x" ; then
break
fi
done
-
- if test "x${TCL_LIB_DIR}" = "x" ; then
+ if test "x${TCL_LIB_DIR}" == "x" ; then
echo "Can't find tcl library in \"${xc_with_tcl_libraries}\""
echo "Reverting to non-Tcl compile"
xc_with_tcl=""
fi
- else
+ elif test "x${TCL_LIB_SPEC}" == "x" ; then
for libpfix in "lib64" "lib"
do
libname="${TCL_EXEC_PREFIX}/${libpfix}/lib${TCL_LIB_NAME}${SHDLIB_EXT}"
@@ -736,12 +660,21 @@ if test "x$xc_with_tcl" != "x" ; then
echo "Reverting to non-Tcl compile"
xc_with_tcl=""
fi
+ else
+ TCL_LIB_DIR=`echo ${TCL_LIB_SPEC} | sed -e '/-L/s/-L//' -e '/-l/s/-l.*//'`
fi
fi
+# --------------------------------------------------------------
+# Rely on TK_LIB_SPEC from tkConfig.sh unless "--with-tklibs"
+# overrides. With TK_LIB_SPEC, pull out TK_LIB_DIR
+# --------------------------------------------------------------
+
if test "x$xc_with_tcl" != "x" ; then
if test "x${xc_with_tk_libraries}" != "x" ; then
+ TK_LIB_SPEC=""
for libname in \
+ "${xc_with_tk_libraries}/${TK_LIB_FILE}" \
"${xc_with_tk_libraries}/lib${TK_LIB_NAME}${SHDLIB_EXT}"
do
if test -r "$libname" ; then
@@ -749,12 +682,12 @@ if test "x$xc_with_tcl" != "x" ; then
break
fi
done
- if test "x${TK_LIB_DIR}" = "x" ; then
+ if test "x${TK_LIB_DIR}" == "x" ; then
echo "Can't find tk library in \"${xc_with_tk_libraries}\""
echo "Reverting to non-Tcl compile"
xc_with_tcl=""
fi
- else
+ elif test "x${TK_LIB_SPEC}" == "x" ; then
for libpfix in "lib64" "lib"
do
libname="${TK_EXEC_PREFIX}/${libpfix}/lib${TK_LIB_NAME}${SHDLIB_EXT}"
@@ -768,371 +701,218 @@ if test "x$xc_with_tcl" != "x" ; then
echo "Reverting to non-Tcl compile"
xc_with_tcl=""
fi
+ else
+ TK_LIB_DIR=`echo ${TCL_LIB_SPEC} | sed -e '/-L/s/-L//' -e '/-l/s/-l.*//'`
fi
fi
-dnl --------------------------------
-dnl End of Tcl/Tk search
-dnl --------------------------------
-
-# -----------------------------------------------------------------------
-#
-# Tk libraries and header files
-#
-# -----------------------------------------------------------------------
+#--------------------------------------------------------------------
+# If TCL_LIB_SPEC and/or TK_LIB_SPEC do not exist, construct them
+#--------------------------------------------------------------------
if test "x$xc_with_tcl" != "x" ; then
- if test "${TK_INC_DIR}" != "/usr/include" -a \
- "${TK_INC_DIR}" != "${TCL_INC_DIR}"; then
- INC_SPECS="${INC_SPECS} -I${TK_INC_DIR}"
- fi
- if test "${TK_LIB_DIR}" = "/usr/lib" -o \
- "${TK_LIB_DIR}" = "/usr/lib64" ; then
- LIB_SPECS="${TK_LIB_SPEC}"
- else
- LIB_SPECS="-L${TK_LIB_DIR} ${TK_LIB_SPEC}"
- if test "x${loader_run_path}" = "x" ; then
- loader_run_path="${TK_LIB_DIR}"
- else
- loader_run_path="${TK_LIB_DIR}:${loader_run_path}"
- fi
+ if test "x${TCL_LIB_SPEC}" == "x" ; then
+ case $target in
+ *-sunos4*|*-*-netbsd|NetBSD-*|FreeBSD-*|*-*-openbsd*|OpenBSD-*)
+ TCL_LIB_NAME="tcl${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}"
+ ;;
+ *)
+ TCL_LIB_NAME="tcl${TCL_MAJOR_VERSION}.${TCL_MINOR_VERSION}"
+ ;;
+ esac
+ TCL_LIB_SPEC="-L${TCL_LIB_DIR} -l${TCL_LIB_NAME}"
fi
-# -----------------------------------------------------------------------
-#
-# Tcl libraries and header files
-#
-# Add a header file directory specification only if the Tcl headers reside
-# in a different directory from Tk's.
-#
-#
-# -----------------------------------------------------------------------
- if test "x${TCL_INCLUDE_SPEC}" != "x" ; then
- INC_SPECS="${INC_SPECS} ${TCL_INCLUDE_SPEC}"
- elif test "${TCL_INC_DIR}" != "/usr/include" ; then
- INC_SPECS="${INC_SPECS} -I${TCL_INC_DIR}"
+ if test "x${TK_LIB_SPEC}" == "x" ; then
+ case $target in
+ *-sunos4*|*-*-netbsd|NetBSD-*|FreeBSD-*|*-*-openbsd*|OpenBSD-*)
+ TK_LIB_NAME="tk${TK_MAJOR_VERSION}${TK_MINOR_VERSION}"
+ ;;
+ *)
+ TK_LIB_NAME="tk${TK_MAJOR_VERSION}.${TK_MINOR_VERSION}"
+ ;;
+ esac
+ TK_LIB_SPEC="-L${TK_LIB_DIR} -l${TK_LIB_NAME}"
fi
- if test "${TCL_LIB_DIR}" = "/usr/lib" -o \
- "${TCL_LIB_DIR}" = "/usr/lib64" -o \
- "${TCL_LIB_DIR}" = "${TK_LIB_DIR}" ; then
- LIB_SPECS="${LIB_SPECS} ${TCL_LIB_SPEC}"
- else
- LIB_SPECS="${LIB_SPECS} -L${TCL_LIB_DIR} ${TCL_LIB_SPEC}"
- if test "x${loader_run_path}" = "x" ; then
- loader_run_path="${TCL_LIB_DIR}"
- else
- loader_run_path="${TCL_LIB_DIR}:${loader_run_path}"
+ # Find the version of "wish" that corresponds to TCL_EXEC_PREFIX
+ # We really ought to run "ldd" to confirm that the linked libraries match.
+
+ AC_MSG_CHECKING([for wish executable])
+ for dir in \
+ ${TK_EXEC_PREFIX}/bin \
+ ${TK_EXEC_PREFIX}
+ do
+ for wishexe in \
+ wish \
+ wish${TK_VERSION} \
+ wish.exe \
+ wish${TK_VERSION}.exe
+ do
+ if test -r "$dir/$wishexe" ; then
+ WISH_EXE=$dir/$wishexe
+ break
+ fi
+ done
+ if test "x${WISH_EXE}" != "x" ; then
+ break
fi
+ done
+ if test "x${WISH_EXE}" = "x" ; then
+ echo "Warning: Can't find executable for \"wish\". You may have to"
+ echo "manually set the value for WISH_EXE in the xcircuit startup script."
+ AC_MSG_RESULT(no)
+ else
+ AC_MSG_RESULT([${WISH_EXE}])
fi
-#--------------------------------------------------------------------
-#
-# Check if we can generate shared libraries on this system. Set flags
-# to generate shared libraries for systems that we know about. Start
-# with the values found in tclConfig.sh, make changes as we know about
-# the different systems.
-#
-#--------------------------------------------------------------------
-
-# Initialize shared library build variables
-
- LDDL_FLAGS="-shared"
- SHDLIB_EXT=".so"
- LD_RUN_PATH=""
- EXTRA_LIB_SPECS=""
-
- build_shared="yes"
-
+ # Have to define SHDLIB_EXT here even though we have to do it below, too.
case $target in
- *-aix4.[[2-9]]*)
- # No Position-Independent flags needed
-
- # Use the installed export file or the one found in the source directory.
-
- if test -r "${TCL_LIB_DIR}/lib${TCL_LIB_NAME}.exp" ; then
- tcl_exp="${TCL_LIB_DIR}/lib${TCL_LIB_NAME}.exp"
- else
- tcl_exp="${TCL_SRC_DIR}/unix/lib.exp"
- fi
- if test -r "${TK_LIB_DIR}/lib${TK_LIB_NAME}.exp" ; then
- tk_exp="${TK_LIB_DIR}/lib${TK_LIB_NAME}.exp"
- else
- tk_exp="${TK_SRC_DIR}/unix/lib.exp"
- fi
-
- full_src_path=`cd ${srcdir}; pwd`
-
- # Use shell-script to link shared library
- SHLIB_LD="${full_src_path}/cf/ldAix /bin/ld -bhalt:4 -bM:SRE -bE:lib.exp -H512 -T512 -bnoentry -bI:${tk_exp} -bI:${tcl_exp}"
-
- SHLIB_LIB_SPEC="${aix_lib_specs} -lc"
-
- LDFLAGS="-L${loader_run_path}"
- EXTRA_LIB_SPECS="-ldl"
- ;;
-
- *-aix*)
- # No Position-Independent flags needed
-
- # Use the installed export file or the one found in the source directory.
-
- if test -r "${TCL_LIB_DIR}/lib${TCL_LIB_NAME}.exp" ; then
- tcl_exp="${TCL_LIB_DIR}/lib${TCL_LIB_NAME}.exp"
- else
- tcl_exp="${TCL_SRC_DIR}/unix/lib.exp"
- fi
- if test -r "${TK_LIB_DIR}/lib${TK_LIB_NAME}.exp" ; then
- tk_exp="${TK_LIB_DIR}/lib${TK_LIB_NAME}.exp"
- else
- tk_exp="${TK_SRC_DIR}/unix/lib.exp"
- fi
-
- full_src_path=`cd ${srcdir}/cf; pwd`
-
- # Use shell-script to link shared library
+ *-hpux*)
+ SHDLIB_EXT=".sl"
+ ;;
+ *cygwin*)
+ SHDLIB_EXT=".dll.a"
+ ;;
+ *-darwin*)
+ SHDLIB_EXT=".dylib"
+ ;;
+ *-openbsd*)
+ SHDLIB_EXT=".so.${TCL_LIB_FILE##*.so.}"
+ ;;
+ *)
+ SHDLIB_EXT=".so"
+ ;;
+ esac
+fi
- SHLIB_LD="${full_src_path}/ldAix /bin/ld -bhalt:4 -bM:SRE -bE:lib.exp -H512 -T512 -bnoentry -bI:${tk_exp} -bI:${tcl_exp}"
+dnl End of Tcl/Tk search
+dnl --------------------------------
- SHLIB_LIB_SPECS="${aix_lib_specs} -lc"
-
- LDFLAGS="-L${loader_run_path}"
- EXTRA_LIB_SPECS="-lld"
- ;;
-
- *-bsdi2*|*-bsdi3*)
- SHLIB_LD="shlicc"
- LDDL_FLAGS="-r"
+# -----------------------------------------------------------------------
+#
+# Tk libraries and header files
+#
+# -----------------------------------------------------------------------
- EXTRA_LIB_SPECS="-ldl"
- ;;
+if test "x$xc_with_tcl" != "x" ; then
+ INC_SPECS="${INC_SPECS} ${TCL_INCLUDE_SPEC} ${TK_INCLUDE_SPEC}"
+ LIB_SPECS="${LIB_SPECS} ${TCL_LIB_SPEC} ${TK_LIB_SPEC}"
- *-darwin*)
- SHDLIB_EXT=".dylib"
- SHLIB_LIB_SPECS="${LIB_SPECS}"
- if test "${xc_with_gnu_ld}" = "yes" ; then
- LDDL_FLAGS="-dynamiclib -bind_at_load"
- else
- LDDL_FLAGS="-single_module -dynamiclib -flat_namespace"
- LDDL_FLAGS="${LDDL_FLAGS} -undefined suppress -noprebind"
- SHLIB_CFLAGS="-I/sw/include -fno-common"
- fi
- ;;
+ if test "x${loader_run_path}" = "x" ; then
+ loader_run_path="${TCL_LIB_DIR}"
+ else
+ loader_run_path="${TCL_LIB_DIR}:${loader_run_path}"
+ fi
- *cygwin*)
- AC_DEFINE(CYGWIN)
- SHDLIB_EXT=".dll"
- LDDL_FLAGS="-shared -Wl,--enable-auto-image-base -Wl,-rpath,${loader_run_path}"
- SHLIB_LIB_SPECS="${LIB_SPECS}"
- ;;
+ #--------------------------------------------------------------------
+ #
+ # Check if we can generate shared libraries on this system. Set flags
+ # to generate shared libraries for systems that we know about. Start
+ # with the values found in tclConfig.sh, make changes as we know about
+ # the different systems.
+ #
+ #--------------------------------------------------------------------
- *-bsdi4*)
- SHLIB_CFLAGS="-export-dynamic -fPIC"
- SHLIB_LD="${CC}"
- LDDL_FLAGS='-shared -Wl,-E -Wl,-soname,$@'
- ;;
+ # Initialize shared library build variables
- *-dgux*)
- SHLIB_CFLAGS="-K PIC"
- SHLIB_LD="cc"
- LDDL_FLAGS="-G"
-
- EXTRA_LIB_SPECS="-ldl"
- ;;
-
- *-hpux*)
- if test "$GCC" = "no" ; then
- DEFINES="$DEFINES -D_HPUX_SOURCE"
- fi
- AC_CHECK_LIB(dld, shl_load, [found=yes], [found=no])
- if test "${found}" = "yes" ; then
- SHLIB_CFLAGS="+z"
- SHLIB_LD="ld"
- LDDL_FLAGS="-b -E -n +s +b,${loader_run_path}:."
- SHDLIB_EXT=".sl"
-
- # The run path is included in both LDFLAGS and LDDL_FLAGS
- # because SHLIB_LD is ld and LD is cc/gcc.
-
- LDFLAGS="-Wl,-E -Wl,+s,+b,${loader_run_path}:."
- EXTRA_LIB_SPECS="-ldld"
- fi
- ;;
-
- *-irix64-6.5*)
- SHLIB_LD="ld"
- LDDL_FLAGS="-32 -shared -rdata_shared"
- LD_RUN_PATH="-Wl,-rpath,${loader_run_path}"
- ;;
+ if test "x${TCL_SHLIB_SUFFIX}" == "x" ; then
+ SHDLIB_EXT=".so"
+ else
+ SHDLIB_EXT="${TCL_SHLIB_SUFFIX}"
+ fi
- *-irix-[56].*|*-irix64-*)
- SHLIB_LD="ld"
- LDDL_FLAGS="-shared -rdata_shared"
- LD_RUN_PATH="-Wl,-rpath,${loader_run_path}"
- LDFLAGS=""
- if test "$GCC" = "yes" ; then
- SHLIB_CFLAGS="-mabi=n32 $SHLIB_CFLAGS"
- LDDL_FLAGS="-mabi=n32 $LDDL_FLAGS"
- LDFLAGS="-mabi=n32 $LDFLAGS"
- else
- CFLAGS="-n32 $CFLAGS"
- LDFLAGS="-n32 $LDFLAGS"
- fi
- ;;
-
- *-linux*)
- SHLIB_CFLAGS="-fPIC"
- SHLIB_LD="${CC}"
- LDDL_FLAGS='-shared -Wl,-soname,$@'
- LD_RUN_PATH="-Wl,-rpath,${loader_run_path}"
+ if test "x${TCL_SHLIB_LD}" == "x" ; then
+
+ # Construct shared library build arguments the painful way
+ # This is not expected to be necessary, so the number of
+ # supported systems has been pared down to a minimum.
+
+ LDDL_FLAGS="-shared"
+ LD_RUN_PATH=""
+ SHLIB_LD="${CC}"
+ EXTRA_LIB_SPECS=""
+
+ case $target in
+ *-darwin*)
+ SHDLIB_EXT=".dylib"
+ SHLIB_LIB_SPECS="${LIB_SPECS}"
+ if test "${xc_with_gnu_ld}" = "yes" ; then
+ LDDL_FLAGS="-dynamiclib -bind_at_load"
+ else
+ LDDL_FLAGS="-single_module -dynamiclib -flat_namespace"
+ LDDL_FLAGS="${LDDL_FLAGS} -undefined suppress -noprebind"
+ SHLIB_CFLAGS="-I/sw/include -fno-common"
+ fi
+ ;;
+
+ *cygwin*)
+ AC_DEFINE(CYGWIN)
+ SHDLIB_EXT=".dll.a"
+ LDDL_FLAGS="-shared -Wl,--enable-auto-image-base -Wl,-rpath,${loader_run_path}"
+ SHLIB_LIB_SPECS="${LIB_SPECS}"
+ ;;
+
+ *-linux*)
+ SHLIB_CFLAGS="-fPIC"
+ LDDL_FLAGS='-shared -Wl,-soname,$@'
+ LD_RUN_PATH="-Wl,-rpath,${loader_run_path}"
- EXTRA_LIB_SPECS="-ldl"
-
- case $target in
- x86_64-*)
- # AMD 64-bit archictecture
- # Add -fPIC to standard compile switch
- CFLAGS="${CFLAGS} -fPIC"
- ;;
- esac
- ;;
+ EXTRA_LIB_SPECS="-ldl"
+
+ case $target in
+ x86_64-*)
+ # AMD 64-bit archictecture
+ # Add -fPIC to standard compile switch
+ CFLAGS="${CFLAGS} -fPIC"
+ ;;
+ esac
+ ;;
- *-mp-ras-02*)
- SHLIB_CFLAGS="-G -K PIC"
- SHLIB_LD="${CC}"
- LDDL_FLAGS=""
- ;;
-
- *-mp-ras-*)
- SHLIB_CFLAGS="-G -K PIC"
- SHLIB_LD="${CC}"
- LDDL_FLAGS="-Wl,-Bexport"
- ;;
-
- *-ncr-sysv4-*2*)
- SHLIB_CFLAGS="-K PIC"
- SHLIB_LD="cc"
- LDDL_FLAGS="-G"
-
- EXTRA_LIB_SPECS="-ldl"
- ;;
-
- *-ncr-sysv4*)
- SHLIB_CFLAGS="-K PIC"
- SHLIB_LD="cc"
- LDDL_FLAGS="-G -Wl,-Bexport"
-
- LDFLAGS="-Wl,-Bexport"
- EXTRA_LIB_SPECS="-ldl"
- ;;
-
- *-netbsd*|*-freebsd*|*-openbsd*)
- # Not available on all versions: check for include file.
- AC_CHECK_HEADER(dlfcn.h, test_ok=yes, test_ok=no)
- if test "$test_ok" = yes; then
- SHLIB_CFLAGS="-fpic"
- SHLIB_LD="ld"
- LDDL_FLAGS="-shared"
- fi
- ;;
-
- *-nextstep*)
- SHLIB_LD="cc"
- LDDL_FLAGS="-nostdlib -r"
- ;;
-
- *-osf1-1.[012]*)
- # OSF/1 1.[012] from OSF, and derivatives, including Paragon OSF/1
-
- # Warning: Ugly Makefile Hack
- # Make package name same as library name
-
- SHLIB_LD='ld -R -export $@:'
- ;;
-
- *-osf1-1.*)
- # OSF/1 1.3 from OSF using ELF, and derivatives, including AD2
-
- SHLIB_CFLAGS="-fpic"
- SHLIB_LD="ld -shared"
- ;;
-
- *-osf1V*)
- # Digital OSF/1
-
- SHLIB_LD='ld'
- LDDL_FLAGS='-shared -expect_unresolved "*"'
- LD_RUN_PATH="-Wl,-rpath,${loader_run_path}"
- LDFLAGS=""
- ;;
-
- *-sco*)
- # Note, dlopen is available only on SCO 3.2.5 and greater. However,
- # this test works, since "uname -s" was non-standard in 3.2.4 and
- # below.
-
- SHLIB_CFLAGS="-Kpic -belf"
- SHLIB_LD="ld"
- LDDL_FLAGS="-G"
- LDFLAGS="-belf -Wl,-Bexport"
- ;;
-
- *-sni-sysv*)
-
- SHLIB_CFLAGS="-K PIC"
- SHLIB_LD="cc"
- LDDL_FLAGS="-G"
-
- EXTRA_LIB_SPECS="-ldl"
- ;;
+ *-netbsd*|*-freebsd*|*-openbsd*)
+ # Not available on all versions: check for include file.
+ AC_CHECK_HEADER(dlfcn.h, test_ok=yes, test_ok=no)
+ if test "$test_ok" = yes; then
+ SHLIB_CFLAGS="-fpic"
+ SHLIB_LD="ld"
+ LDDL_FLAGS="-shared"
+ fi
+ ;;
+ esac
- *-sunos4*)
+ if test "$GCC" = "yes" ; then
+ CFLAGS="-fPIC ${CFLAGS}"
+ fi
- SHLIB_CFLAGS="-PIC"
- SHLIB_LD="ld"
- LDDL_FLAGS="-assert pure-text"
+ else
- EXTRA_LIB_SPECS="-ldl"
- ;;
+ # Rely on shared lib arguments in tclConfig.sh
- *-solaris2*)
+ SHLIB_LD="${TCL_SHLIB_LD}"
+ EXTRA_LIB_FLAGS=""
+ LDDL_FLAGS="${TCL_LD_FLAGS}"
+ LD_RUN_PATH=""
- if test "${xc_with_gnu_ld}" = "yes" ; then
- LDDL_FLAGS='-rdynamic -shared -Wl,-E -Wl,-soname,$@'
+ case $target in
+ *-linux*)
LD_RUN_PATH="-Wl,-rpath,${loader_run_path}"
- else
- LDDL_FLAGS="-shared -mimpure-text"
- LD_RUN_PATH="-R ${loader_run_path}"
- fi
- EXTRA_LIB_SPECS="-ldl"
- SHLIB_LIB_SPECS="${LIB_SPECS}"
- ;;
-
- *-mips-dde-sysv*)
-
- SHLIB_CFLAGS="-KPIC"
- SHLIB_LD="cc"
- LDDL_FLAGS="-G"
-
- EXTRA_LIB_SPECS="-ldl"
- ;;
-
- *-pc-sysv4* | *-unixware-5*)
- SHLIB_CFLAGS="-G -KPIC"
- SHLIB_LD="${CC}"
- LDDL_FLAGS=" -Wl,-Bexport"
- ;;
-
- esac
+ ;;
+ esac
+ fi
-# If we're running gcc, then set SHLIB_CFLAGS flags for compiling
-# shared libraries for gcc, instead of those of the vendor's
-# compiler.
+ # If we're running gcc, then set SHLIB_CFLAGS flags for compiling
+ # shared libraries for gcc, instead of those of the vendor's
+ # compiler.
if test "$GCC" = "yes" ; then
-# SHLIB_CFLAGS="${SHLIB_CFLAGS} -fPIC"
- CFLAGS="-fPIC ${CFLAGS}"
+ if test "x${TCL_SHLIB_CFLAGS}" = "x" ; then
+ SHLIB_CFLAGS="-fPIC ${SHLIB_CFLAGS}"
+ else
+ SHLIB_CFLAGS="${TCL_SHLIB_CFLAGS} ${SHLIB_CFLAGS}"
+ fi
fi
+ CFLAGS="${CFLAGS} ${SHLIB_CFLAGS}"
+
if test "${xc_with_gnu_ld}" = "yes" ; then
LDDL_FLAGS="${LDDL_FLAGS} -Wl,--version-script=symbol.map"
fi
@@ -1335,11 +1115,11 @@ AC_ARG_ENABLE(memdebug,
AC_SUBST(SUBDIRS)
AC_SUBST(SUBLIB)
AC_SUBST(STDLIBS)
+AC_SUBST(GS_LIBS)
AC_SUBST(STARTUP_FILE)
AC_SUBST(INTERP_PATH)
AC_SUBST(WRAPPER_SCRIPT)
AC_SUBST(XCIRCUIT_TARGET)
-AC_SUBST(SHLIB_CFLAGS)
AC_SUBST(CFLAGS)
AC_SUBST(LD)
AC_SUBST(LDFLAGS)
@@ -1357,3 +1137,32 @@ AC_SUBST(AUTOMAKE)
AC_SUBST(AUTOHEADER)
AC_OUTPUT(Makefile Xw/Makefile asg/Makefile spiceparser/Makefile)
+
+echo ""
+echo "Configuration results:"
+echo "----------------------------------------------------"
+echo ""
+
+if test "x$xc_with_tcl" == "x" ; then
+ if test "x$PYTHON" != x; then
+ echo "Using Python interface (not recommended)"
+ else
+ echo "No Tcl/Tk, using standard Xlib/Xt interface."
+ echo "If that is not what you wanted, then make sure"
+ echo "you have Tcl/Tk development packages installed?"
+ fi
+else
+ echo "Using Tcl/Tk interface"
+fi
+echo ""
+
+if test "x$xc_with_cairo" == "x" ; then
+ echo "No Cairo graphics."
+ echo "If that is not what you wanted, then make sure"
+ echo "you have libcairo and fontconfig installed."
+ echo "Try installing package cairo-devel."
+else
+ echo "Using Cairo graphics"
+fi
+echo ""
+echo "CFLAGS=${CFLAGS}"
diff --git a/elements.c b/elements.c
index 7187691..ec50433 100644
--- a/elements.c
+++ b/elements.c
@@ -41,7 +41,6 @@
/*----------------------------------------------------------------------*/
extern Display *dpy; /* Works well to make this globally accessible */
-extern int *appcolors;
extern Cursor appcursors[NUM_CURSORS];
extern XCWindowData *areawin;
extern Globaldata xobjs;
@@ -50,6 +49,10 @@ extern fontinfo *fonts;
extern short fontcount;
extern char _STR[150], _STR2[250];
extern int number_colors;
+extern colorindex *colorlist;
+#if !defined(HAVE_CAIRO)
+extern Pixmap dbuf;
+#endif
extern double atan2();
@@ -76,6 +79,9 @@ u_char texttype;
/* calling routine. */
/* "pintype" is NORMAL, LOCAL, GLOBAL, or INFO */
/* "x" and "y" are the label coordinates. */
+/* if "dochange" is FALSE, then this label is being drawn */
+/* as part of a font or library and should not cause */
+/* changes count to increment. */
/* */
/* Other properties must be set individually by the calling */
/* routine. */
@@ -84,7 +90,7 @@ u_char texttype;
/*--------------------------------------------------------------*/
labelptr new_label(objinstptr destinst, stringpart *strptr, int pintype,
- int x, int y)
+ int x, int y, u_char dochange)
{
labelptr *newlab;
objectptr destobject;
@@ -105,7 +111,7 @@ labelptr new_label(objinstptr destinst, stringpart *strptr, int pintype,
calcbboxvalues(locdestinst, (genericptr *)newlab);
updatepagebounds(destobject);
- incr_changes(destobject);
+ if (dochange != (u_char)0) incr_changes(destobject);
return *newlab;
}
@@ -126,7 +132,7 @@ labelptr new_simple_label(objinstptr destinst, char *cstr,
strptr->nextpart = NULL;
strptr->data.string = cstr;
- return new_label(destinst, strptr, pintype, x, y);
+ return new_label(destinst, strptr, pintype, x, y, (u_char)0);
}
/*--------------------------------------------------------------*/
@@ -328,6 +334,9 @@ void remove_element(objinstptr destinst, genericptr genelem)
void pathdefaults(pathptr newpath, int x, int y)
{
+ UNUSED(x);
+ UNUSED(y);
+
newpath->style = NORMAL;
newpath->width = areawin->linewidth;
newpath->style = areawin->style;
@@ -345,7 +354,7 @@ void instancedefaults(objinstptr newinst, objectptr thisobj, int x, int y)
{
newinst->position.x = x;
newinst->position.y = y;
- newinst->rotation = 0;
+ newinst->rotation = 0.0;
newinst->scale = 1.0;
newinst->style = LINE_INVARIANT;
newinst->thisobject = thisobj;
@@ -399,7 +408,7 @@ void drawdot(int xpos, int ypos)
void labeldefaults(labelptr newlabel, u_char dopin, int x, int y)
{
- newlabel->rotation = 0;
+ newlabel->rotation = 0.0;
newlabel->color = areawin->color;
newlabel->scale = areawin->textscale;
newlabel->string = (stringpart *)malloc(sizeof(stringpart));
@@ -416,7 +425,7 @@ void labeldefaults(labelptr newlabel, u_char dopin, int x, int y)
else if (dopin == GLOBAL) newlabel->color = GLOBALPINCOLOR;
else if (dopin == INFO) newlabel->color = INFOLABELCOLOR;
- newlabel->justify = areawin->justify;
+ newlabel->anchor = areawin->anchor;
newlabel->position.x = x;
newlabel->position.y = y;
}
@@ -445,12 +454,13 @@ void textbutton(u_char dopin, int x, int y)
labeldefaults(*newlabel, dopin, userpt.x, userpt.y);
tmpheight = (short)(TEXTHEIGHT * (*newlabel)->scale);
- userpt.y -= ((*newlabel)->justify & NOTBOTTOM) ?
- (((*newlabel)->justify & TOP) ? tmpheight : tmpheight / 2) : 0;
- UDrawTLine(*newlabel);
+ userpt.y -= ((*newlabel)->anchor & NOTBOTTOM) ?
+ (((*newlabel)->anchor & TOP) ? tmpheight : tmpheight / 2) : 0;
areawin->origin.x = userpt.x;
areawin->origin.y = userpt.y;
areawin->textpos = 1; /* Text position is *after* the font declaration */
+
+ text_mode_draw(xcDRAW_EDIT, *newlabel);
}
/*----------------------------------------------------------------------*/
@@ -519,7 +529,7 @@ Boolean labeltext(int keypressed, char *clientdata)
stringpart *curpos, *labelbuf;
int locpos;
Boolean r = True, do_redraw = False;
- short tmplength, tmpheight, cfont;
+ short cfont;
TextExtents tmpext;
TechPtr oldtech, newtech;
@@ -527,6 +537,7 @@ Boolean labeltext(int keypressed, char *clientdata)
if (curlabel == NULL || curlabel->type != LABEL) {
Wprintf("Error: Bad label string");
+ text_mode_draw(xcDRAW_EMPTY, curlabel);
eventmode = NORMAL_MODE;
return FALSE;
}
@@ -535,8 +546,6 @@ Boolean labeltext(int keypressed, char *clientdata)
curpos = findstringpart(areawin->textpos, &locpos, curlabel->string,
areawin->topinstance);
- UDrawTLine(curlabel);
-
if (clientdata != NULL && keypressed == TEXT_DELETE) {
if (areawin->textpos > 1) {
int curloc, strpos;
@@ -578,15 +587,21 @@ Boolean labeltext(int keypressed, char *clientdata)
int curloc, strpos;
stringpart *strptr;
- strptr = findstringpart(areawin->textpos - 1, &curloc, curlabel->string,
+ strpos = areawin->textpos - 1;
+ strptr = findstringpart(strpos, &curloc, curlabel->string,
areawin->topinstance);
- if ((curloc < 0) && (strptr != NULL) && (strptr->type == PARAM_END)) {
- undrawtext(curlabel);
- while (strptr->type != PARAM_START)
- strptr = findstringpart(--strpos, &curloc, curlabel->string,
+ if (curloc > 0) strpos -= curloc; /* move to beginning of string */
+ if ((strptr != NULL) && (strptr->type != PARAM_START) && (strpos > 0)) {
+ strpos--;
+ strptr = findstringpart(strpos--, &curloc, curlabel->string,
areawin->topinstance);
- unmakeparam(curlabel, strptr);
- do_redraw = True;
+ }
+ if ((strptr != NULL) && (strptr->type == PARAM_START)) {
+ if (strpos >= 0) {
+ undrawtext(curlabel);
+ unmakeparam(curlabel, areawin->topinstance, strptr);
+ do_redraw = True;
+ }
}
}
}
@@ -629,14 +644,17 @@ Boolean labeltext(int keypressed, char *clientdata)
}
if ((!hasstuff) && (eventmode == CATTEXT_MODE)) { /* can't have null labels! */
- undo_action();
- XcSetFunction(GXcopy);
- redrawtext(curlabel);
- Wprintf("Object must have a name!");
- eventmode = CATALOG_MODE;
+ undo_action();
+ redrawtext(curlabel);
+ areawin->redraw_needed = False; /* ignore previous redraw requests */
+ text_mode_draw(xcDRAW_FINAL, curlabel);
+ Wprintf("Object must have a name!");
+ eventmode = CATALOG_MODE;
}
else if (!hasstuff) {
- eventmode = NORMAL_MODE;
+ areawin->redraw_needed = False; /* ignore previous redraw requests */
+ text_mode_draw(xcDRAW_FINAL, curlabel);
+ eventmode = NORMAL_MODE;
}
else if (eventmode == CATTEXT_MODE) {
objectptr libobj;
@@ -673,7 +691,6 @@ Boolean labeltext(int keypressed, char *clientdata)
curlabel->string->nextpart->data.string,
(strlen(libobj->name) + 1) * sizeof(char));
strcpy(curlabel->string->nextpart->data.string, libobj->name);
- XcSetFunction(GXcopy);
redrawtext(curlabel);
}
AddObjectTechnology(libobj);
@@ -706,10 +723,14 @@ Boolean labeltext(int keypressed, char *clientdata)
Wprintf("Error: Cannot match name to any object, page, or library!");
refresh(NULL, NULL, NULL);
}
+ areawin->redraw_needed = False; /* ignore previous redraw requests */
+ text_mode_draw(xcDRAW_FINAL, curlabel);
eventmode = CATALOG_MODE;
}
else { /* (hasstuff && eventmode != CATTEXT_MODE) */
+ areawin->redraw_needed = False; /* ignore previous redraw requests */
+ text_mode_draw(xcDRAW_FINAL, curlabel);
eventmode = NORMAL_MODE;
incr_changes(topobject);
if (curlabel->pin != False) invalidate_netlist(topobject);
@@ -824,7 +845,6 @@ Boolean labeltext(int keypressed, char *clientdata)
(*newlabel)->position.x += (points[3].x - points2[3].x);
(*newlabel)->position.y += (points[3].y - points2[3].y);
- XcSetFunction(GXcopy);
redrawtext(*newlabel);
do_redraw = True;
}
@@ -836,6 +856,7 @@ Boolean labeltext(int keypressed, char *clientdata)
oparamptr ops;
stringpart *newpart;
Boolean errcond = False;
+ TextLinesInfo tlinfo;
/* erase first before redrawing unless the string is empty */
undrawtext(curlabel);
@@ -843,8 +864,13 @@ Boolean labeltext(int keypressed, char *clientdata)
/* Get text width first. Don't back up over spaces; this */
/* allows the margin width to be padded out with spaces. */
- if (keypressed == MARGINSTOP)
- tmpext = ULength(curlabel, areawin->topinstance, areawin->textpos, NULL);
+ if (keypressed == MARGINSTOP) {
+ tlinfo.dostop = areawin->textpos;
+ tlinfo.tbreak = NULL;
+ tlinfo.padding = NULL;
+ tmpext = ULength(curlabel, areawin->topinstance, &tlinfo);
+ if (tlinfo.padding != NULL) free(tlinfo.padding);
+ }
if (locpos > 0) {
if (keypressed == MARGINSTOP) {
@@ -864,7 +890,7 @@ Boolean labeltext(int keypressed, char *clientdata)
newpart->type = keypressed;
switch (keypressed) {
case RETURN:
- // Identify this as an explicitly placed line break
+ /* Identify this as an explicitly placed line break */
newpart->data.flags = 0;
break;
case FONT_SCALE:
@@ -969,11 +995,11 @@ Boolean labeltext(int keypressed, char *clientdata)
/* Generate automatic line breaks if there is a MARGINSTOP directive */
CheckMarginStop(curlabel, areawin->topinstance, TRUE);
- XcSetFunction(GXcopy);
redrawtext(curlabel);
}
- UDrawTLine(curlabel);
+ areawin->redraw_needed = False; /* ignore previous full redraw requests */
+ text_mode_draw(xcDRAW_EDIT, curlabel);
if (r || do_redraw) {
@@ -1005,34 +1031,34 @@ void textreturn()
labeltext(TEXT_RETURN, (char *)1);
}
-/*-------------------------------------*/
-/* Change the justification of a label */
-/*-------------------------------------*/
+/*--------------------------------------*/
+/* Change the anchoring of a label */
+/*--------------------------------------*/
-void rejustify(short mode)
+void reanchor(short mode)
{
labelptr curlabel = NULL;
short *tsel;
short jsave;
Boolean preselected = False, changed = False;
- static short transjust[] = {15, 13, 12, 7, 5, 4, 3, 1, 0};
+ static short transanchor[] = {15, 13, 12, 7, 5, 4, 3, 1, 0};
if (eventmode == TEXT_MODE || eventmode == ETEXT_MODE) {
curlabel = TOLABEL(EDITPART);
UDrawTLine(curlabel);
undrawtext(curlabel);
- jsave = curlabel->justify;
- curlabel->justify = transjust[mode] |
- (curlabel->justify & NONJUSTFIELD);
- if (jsave != curlabel->justify) {
- register_for_undo(XCF_Justify, UNDO_MORE, areawin->topinstance,
+ jsave = curlabel->anchor;
+ curlabel->anchor = transanchor[mode] |
+ (curlabel->anchor & NONANCHORFIELD);
+ if (jsave != curlabel->anchor) {
+ register_for_undo(XCF_Anchor, UNDO_MORE, areawin->topinstance,
(genericptr)curlabel, (int)jsave);
changed = True;
}
redrawtext(curlabel);
UDrawTLine(curlabel);
- setfontmarks(-1, curlabel->justify);
+ setfontmarks(-1, curlabel->anchor);
}
else {
if (areawin->selects == 0) {
@@ -1045,12 +1071,12 @@ void rejustify(short mode)
areawin->selects; tsel++) {
if (SELECTTYPE(tsel) == LABEL) {
curlabel = SELTOLABEL(tsel);
- jsave = curlabel->justify;
+ jsave = curlabel->anchor;
undrawtext(curlabel);
- curlabel->justify = transjust[mode] |
- (curlabel->justify & NONJUSTFIELD);
- if (jsave != curlabel->justify) {
- register_for_undo(XCF_Justify, UNDO_MORE, areawin->topinstance,
+ curlabel->anchor = transanchor[mode] |
+ (curlabel->anchor & NONANCHORFIELD);
+ if (jsave != curlabel->anchor) {
+ register_for_undo(XCF_Anchor, UNDO_MORE, areawin->topinstance,
(genericptr)curlabel, (int)jsave);
changed = True;
}
@@ -1062,7 +1088,7 @@ void rejustify(short mode)
draw_all_selected();
}
if (curlabel == NULL)
- Wprintf("No labels chosen to rejustify");
+ Wprintf("No labels chosen to reanchor");
else if (changed) {
pwriteback(areawin->topinstance);
calcbbox(areawin->topinstance);
@@ -1112,9 +1138,7 @@ void splinebutton(int x, int y)
addcycle((genericptr *)newspline, 3, 0);
makerefcycle((*newspline)->cycle, 3);
- XcSetXORFg(areawin->color, BACKGROUND);
- XcSetFunction(GXxor);
- UDrawSpline(*newspline, xobjs.pagelist[areawin->page]->wirewidth);
+ spline_mode_draw(xcDRAW_EDIT, *newspline);
xcAddEventHandler(areawin->area, PointerMotionMask, False,
(xcEventHandler)trackelement, NULL);
@@ -1137,7 +1161,7 @@ void splinebutton(int x, int y)
void updatepath(pathptr thepath)
{
genericptr *ggen, *ngen;
- short locparts, cycle, ncycle;
+ short locparts, cycle;
pointselect *cptr;
polyptr thispoly;
splineptr thisspline;
@@ -1262,9 +1286,7 @@ void arcbutton(int x, int y)
arcdefaults(*newarc, userpt.x, userpt.y);
addcycle((genericptr *)newarc, 0, 0);
- XcSetXORFg((*newarc)->color, BACKGROUND);
- XcSetFunction(GXxor);
- UDrawArc(*newarc, xobjs.pagelist[areawin->page]->wirewidth);
+ arc_mode_draw(xcDRAW_EDIT, *newarc);
xcAddEventHandler(areawin->area, PointerMotionMask, False,
(xcEventHandler)trackarc, NULL);
@@ -1282,6 +1304,7 @@ void trackarc(xcWidget w, caddr_t clientdata, caddr_t calldata)
arcptr newarc;
double adjrat;
short cycle;
+ UNUSED(w); UNUSED(clientdata); UNUSED(calldata);
newarc = TOARC(EDITPART);
@@ -1289,9 +1312,6 @@ void trackarc(xcWidget w, caddr_t clientdata, caddr_t calldata)
u2u_snap(&newpos);
if (areawin->save.x == newpos.x && areawin->save.y == newpos.y) return;
- UDrawArc(newarc, xobjs.pagelist[areawin->page]->wirewidth);
- UDrawXLine(areawin->save, newarc->position);
-
cycle = (newarc->cycle == NULL) ? -1 : newarc->cycle->number;
if (cycle == 1 || cycle == 2) {
float *angleptr, tmpang;
@@ -1331,14 +1351,12 @@ void trackarc(xcWidget w, caddr_t clientdata, caddr_t calldata)
calcarc(newarc);
- XcSetXORFg(newarc->color, BACKGROUND);
- UDrawArc(newarc, xobjs.pagelist[areawin->page]->wirewidth);
- UDrawXLine(newpos, newarc->position);
- printpos(newpos.x, newpos.y);
-
areawin->save.x = newpos.x;
areawin->save.y = newpos.y;
+ arc_mode_draw(xcDRAW_EDIT, newarc);
+ printpos(newpos.x, newpos.y);
+
flusharea();
}
@@ -1386,9 +1404,7 @@ void boxbutton(int x, int y)
snap(x, y, &userpt);
polydefaults(*newbox, 4, userpt.x, userpt.y);
- XcSetXORFg((*newbox)->color, BACKGROUND);
- XcSetFunction(GXxor);
- UDrawPolygon(*newbox, xobjs.pagelist[areawin->page]->wirewidth);
+ poly_mode_draw(xcDRAW_EDIT, *newbox);
xcAddEventHandler(areawin->area, PointerMotionMask, False,
(xcEventHandler)trackbox, NULL);
@@ -1405,6 +1421,7 @@ void trackbox(xcWidget w, caddr_t clientdata, caddr_t calldata)
XPoint newpos;
polyptr newbox;
pointlist pointptr;
+ UNUSED(w); UNUSED(clientdata); UNUSED(calldata);
newbox = TOPOLY(EDITPART);
newpos = UGetCursorPos();
@@ -1412,14 +1429,11 @@ void trackbox(xcWidget w, caddr_t clientdata, caddr_t calldata)
if (areawin->save.x == newpos.x && areawin->save.y == newpos.y) return;
- UDrawPolygon(newbox, xobjs.pagelist[areawin->page]->wirewidth);
-
pointptr = newbox->points + 1; pointptr->y = newpos.y;
pointptr++; pointptr->y = newpos.y; pointptr->x = newpos.x;
pointptr++; pointptr->x = newpos.x;
- XcSetXORFg(newbox->color, BACKGROUND);
- UDrawPolygon(newbox, xobjs.pagelist[areawin->page]->wirewidth);
+ poly_mode_draw(xcDRAW_EDIT, newbox);
printpos(newpos.x, newpos.y);
areawin->save.x = newpos.x;
@@ -1441,6 +1455,7 @@ void trackwire(xcWidget w, caddr_t clientdata, caddr_t calldata)
{
XPoint newpos, upos, *tpoint;
polyptr newwire;
+ UNUSED(w); UNUSED(clientdata); UNUSED(calldata);
newwire = TOPOLY(EDITPART);
@@ -1457,13 +1472,12 @@ void trackwire(xcWidget w, caddr_t clientdata, caddr_t calldata)
if (areawin->save.x != newpos.x || areawin->save.y != newpos.y) {
tpoint = newwire->points + newwire->number - 1;
- UDrawPolygon(newwire, xobjs.pagelist[areawin->page]->wirewidth);
if (areawin->manhatn && (newwire->number > 2))
manhattanize(&newpos, newwire, -1, TRUE);
tpoint->x = newpos.x;
tpoint->y = newpos.y;
- XcSetXORFg(newwire->color, BACKGROUND);
- UDrawPolygon(newwire, xobjs.pagelist[areawin->page]->wirewidth);
+ XcTopSetForeground(newwire->color);
+ poly_mode_draw(xcDRAW_EDIT, newwire);
areawin->save.x = newpos.x;
areawin->save.y = newpos.y;
printpos(newpos.x, newpos.y);
@@ -1500,9 +1514,7 @@ void startwire(XPoint *userpt)
pointptr->x = (pointptr + 1)->x = areawin->save.x = userpt->x;
pointptr->y = (pointptr + 1)->y = areawin->save.y = userpt->y;
- XcSetXORFg((*newwire)->color, BACKGROUND);
- XcSetFunction(GXxor);
- UDrawPolygon(*newwire, xobjs.pagelist[areawin->page]->wirewidth);
+ poly_mode_draw(xcDRAW_EDIT, *newwire);
xcAddEventHandler(areawin->area, PointerMotionMask, False,
(xcEventHandler)trackwire, NULL);
@@ -1632,12 +1644,11 @@ void findconstrained(polyptr lastpoly)
void trackelement(xcWidget w, caddr_t clientdata, caddr_t calldata)
{
- XPoint newpos, origpt, *curpt;
- polyptr editpoly;
- genericptr *ggen;
- short cycle, *selobj;
+ XPoint newpos, *curpt;
+ short *selobj;
pointselect *cptr;
int deltax, deltay;
+ UNUSED(w); UNUSED(clientdata); UNUSED(calldata);
newpos = UGetCursorPos();
u2u_snap(&newpos);
@@ -1673,20 +1684,32 @@ void trackelement(xcWidget w, caddr_t clientdata, caddr_t calldata)
curpt = &(TOGRAPHIC(EDITPART)->position);
break;
}
- origpt = *curpt;
deltax = newpos.x - curpt->x;
deltay = newpos.y - curpt->y;
/* Now adjust all edited elements relative to the reference point */
-
for (selobj = areawin->selectlist; selobj < areawin->selectlist +
- areawin->selects; selobj++)
- {
- easydraw(*selobj, DOFORALL);
- editpoints(SELTOGENERICPTR(selobj), deltax, deltay);
- XcSetXORFg(topobject->plist[*selobj]->color, BACKGROUND);
- easydraw(*selobj, DOFORALL);
- }
+ areawin->selects; selobj++) {
+ if (eventmode == ARC_MODE || eventmode == EARC_MODE)
+ editpoints(SELTOGENERICPTR(selobj), deltax, deltay);
+ else if (eventmode == SPLINE_MODE || eventmode == ESPLINE_MODE)
+ editpoints(SELTOGENERICPTR(selobj), deltax, deltay);
+ else if (eventmode == BOX_MODE || eventmode == EPOLY_MODE
+ || eventmode == WIRE_MODE)
+ editpoints(SELTOGENERICPTR(selobj), deltax, deltay);
+ else if (eventmode == EPATH_MODE)
+ editpoints(SELTOGENERICPTR(selobj), deltax, deltay);
+ }
+
+ if (eventmode == ARC_MODE || eventmode == EARC_MODE)
+ arc_mode_draw(xcDRAW_EDIT, TOARC(EDITPART));
+ else if (eventmode == SPLINE_MODE || eventmode == ESPLINE_MODE)
+ spline_mode_draw(xcDRAW_EDIT, TOSPLINE(EDITPART));
+ else if (eventmode == BOX_MODE || eventmode == EPOLY_MODE
+ || eventmode == WIRE_MODE)
+ poly_mode_draw(xcDRAW_EDIT, TOPOLY(EDITPART));
+ else if (eventmode == EPATH_MODE)
+ path_mode_draw(xcDRAW_EDIT, TOPATH(EDITPART));
printpos(newpos.x, newpos.y);
areawin->save.x = newpos.x;
@@ -1830,11 +1853,9 @@ void unjoin()
/* for each selected path or polygon */
- XcSetFunction(GXcopy);
-
for (selectobj = areawin->selectlist; selectobj < areawin->selectlist
+ areawin->selects; selectobj++) {
- XSetForeground(dpy, areawin->gc, BACKGROUND);
+ SetForeground(dpy, areawin->gc, BACKGROUND);
if (SELECTTYPE(selectobj) == PATH) {
oldpath = SELTOPATH(selectobj);
@@ -2226,9 +2247,6 @@ void wire_op(int op, int x, int y)
newwire = TOPOLY(EDITPART);
- /* This undraws the wire */
- UDrawPolygon(newwire, xobjs.pagelist[areawin->page]->wirewidth);
-
if (areawin->attachto >= 0) {
XPoint apos;
findattach(&apos, NULL, &userpt);
@@ -2295,13 +2313,13 @@ void wire_op(int op, int x, int y)
newwire->number--;
}
- XcSetFunction(GXcopy);
- XcTopSetForeground(newwire->color);
incr_changes(topobject);
if (!nonnetwork(newwire)) invalidate_netlist(topobject);
register_for_undo(XCF_Wire, UNDO_MORE, areawin->topinstance, newwire);
+ poly_mode_draw(xcDRAW_FINAL, newwire);
}
- UDrawPolygon(newwire, xobjs.pagelist[areawin->page]->wirewidth);
+ else
+ poly_mode_draw(xcDRAW_EDIT, newwire);
if (op == XCF_Cancel_Last)
checkwarp(newwire->points + newwire->number - 1);
}
@@ -2313,3 +2331,419 @@ void wire_op(int op, int x, int y)
}
/*-------------------------------------------------------------------------*/
+/* Helper functions for the xxx_mode_draw functions */
+/* Functions to be used around the drawing of the edited element */
+/* begin_event_mode_drawing starts double buffering and copies the */
+/* fixed pixmap. end_event_mode stops the double buffering and displays */
+/* everything on screen. */
+/*-------------------------------------------------------------------------*/
+
+#ifndef HAVE_CAIRO
+static Window old_win;
+#endif /* !HAVE_CAIRO */
+
+static void begin_event_mode_drawing(void)
+{
+ /* Start double buffering */
+#ifdef HAVE_CAIRO
+ cairo_identity_matrix(areawin->cr);
+ cairo_translate(areawin->cr, areawin->panx, areawin->pany);
+ cairo_push_group(areawin->cr);
+#else /* HAVE_CAIRO */
+ old_win = areawin->window;
+ areawin->window = (Window) dbuf;
+#endif /* HAVE_CAIRO */
+
+ /* Copy background pixmap with the element(s) not currently being edited */
+#ifdef HAVE_CAIRO
+ if (areawin->panx || areawin->pany) {
+ SetForeground(dpy, areawin->gc, BACKGROUND);
+ cairo_paint(areawin->cr);
+ }
+ cairo_set_source(areawin->cr, areawin->fixed_pixmap);
+ cairo_paint(areawin->cr);
+#else /* HAVE_CAIRO */
+ if (areawin->panx || areawin->pany) {
+ int x = max(0, -areawin->panx);
+ int y = max(0, -areawin->pany);
+ unsigned int w = areawin->width - x;
+ unsigned int h = areawin->height - y;
+ SetForeground(dpy, areawin->gc, BACKGROUND);
+ XSetFillStyle(dpy, areawin->gc, FillSolid);
+ XFillRectangle(dpy, areawin->window, areawin->gc, 0, 0, areawin->width,
+ areawin->height);
+ XCopyArea(dpy, areawin->fixed_pixmap, areawin->window, areawin->gc,
+ x, y, w, h, max(0, areawin->panx), max(0, areawin->pany));
+ }
+ else
+ XCopyArea(dpy, areawin->fixed_pixmap, areawin->window, areawin->gc, 0, 0,
+ areawin->width, areawin->height, 0, 0);
+#endif /* HAVE_CAIRO */
+
+ areawin->redraw_ongoing = True;
+ newmatrix();
+}
+
+static void end_event_mode_drawing(void)
+{
+ /* End double buffering */
+#ifdef HAVE_CAIRO
+ cairo_pop_group_to_source(areawin->cr);
+ cairo_paint(areawin->cr);
+#else /* HAVE_CAIRO */
+ areawin->window = old_win;
+ XCopyArea(dpy, dbuf, areawin->window, areawin->gc, 0, 0, areawin->width,
+ areawin->height, 0, 0);
+#endif /* HAVE_CAIRO */
+
+ areawin->redraw_ongoing = False;
+}
+
+/*-------------------------------------------------------------------------*/
+/* Helper functions for the xxx_mode_draw functions */
+/* Functions to be used when finishing the element. The final state is */
+/* drawn into the fixed pixmap, which is show when the */
+/* end_event_mode_drawing_final is called */
+/* (Sorry about the name :-) ) */
+/*-------------------------------------------------------------------------*/
+
+static void begin_event_mode_drawing_final(void)
+{
+#ifdef HAVE_CAIRO
+ cairo_identity_matrix(areawin->cr);
+ cairo_push_group(areawin->cr);
+ cairo_set_source(areawin->cr, areawin->fixed_pixmap);
+ cairo_paint(areawin->cr);
+#else /* HAVE_CAIRO */
+ old_win = areawin->window;
+ areawin->window = (Window) areawin->fixed_pixmap;
+#endif /* HAVE_CAIRO */
+
+ areawin->redraw_ongoing = True;
+ newmatrix();
+}
+
+static void end_event_mode_drawing_final(void)
+{
+#ifdef HAVE_CAIRO
+ cairo_pattern_destroy(areawin->fixed_pixmap);
+ areawin->fixed_pixmap = cairo_pop_group(areawin->cr);
+#else /* HAVE_CAIRO */
+ areawin->window = old_win;
+#endif /* HAVE_CAIRO */
+
+ /* Show fixed pixmap */
+#ifdef HAVE_CAIRO
+ cairo_identity_matrix(areawin->cr);
+ cairo_set_source(areawin->cr, areawin->fixed_pixmap);
+ cairo_paint(areawin->cr);
+#else /* HAVE_CAIRO */
+ XCopyArea(dpy, areawin->fixed_pixmap, areawin->window, areawin->gc, 0, 0,
+ areawin->width, areawin->height, 0, 0);
+#endif /* HAVE_CAIRO */
+
+ areawin->redraw_ongoing = False;
+}
+
+/*-------------------------------------------------------------------------*/
+/* Helper function for the xxx_mode_draw functions */
+/* Hide all the selected elements and draw all the element not currently */
+/* being edited to fixed_pixmap */
+/*-------------------------------------------------------------------------*/
+
+static void draw_fixed_without_selection(void)
+{
+ int idx;
+ for (idx = 0; idx < areawin->selects; idx++)
+ SELTOGENERIC(&areawin->selectlist[idx])->type |= DRAW_HIDE;
+ draw_fixed();
+ for (idx = 0; idx < areawin->selects; idx++)
+ SELTOGENERIC(&areawin->selectlist[idx])->type &= ~DRAW_HIDE;
+}
+
+/*-------------------------------------------------------------------------*/
+/* generic xxx_mode_draw function, that handles most of the thing needed */
+/* for arcs, splines and paths. */
+/*-------------------------------------------------------------------------*/
+
+static void generic_mode_draw(xcDrawType type, generic *newgen,
+ void (*decorations)(generic *newgen))
+{
+ int idx;
+
+ switch (type) {
+ case xcDRAW_INIT:
+ case xcREDRAW_FORCED:
+ draw_fixed_without_selection();
+ /* fallthrough */
+
+ case xcDRAW_EDIT:
+ begin_event_mode_drawing();
+ for (idx = 0; idx < areawin->selects; idx++) {
+ int scolor = SELTOCOLOR(&areawin->selectlist[idx]);
+ XcTopSetForeground(scolor);
+ easydraw(areawin->selectlist[idx], scolor);
+ }
+ if (decorations)
+ (*decorations)(newgen);
+ end_event_mode_drawing();
+ break;
+
+ case xcDRAW_FINAL:
+ begin_event_mode_drawing_final();
+ for (idx = 0; idx < areawin->selects; idx++) {
+ int scolor = SELTOCOLOR(&areawin->selectlist[idx]);
+ XcTopSetForeground(scolor);
+ easydraw(areawin->selectlist[idx], scolor);
+ }
+ end_event_mode_drawing_final();
+ if (areawin->selects > 1) /* FIXME: Temp. fix for multiple selects */
+ areawin->redraw_needed = True; /* Will be removed later on */
+ break;
+
+ case xcDRAW_EMPTY:
+ /* Do not remove the empty begin/end. For cairo, this renders the */
+ /* background with the fixed elements */
+ begin_event_mode_drawing_final();
+ end_event_mode_drawing_final();
+ break;
+ }
+}
+
+/*-------------------------------------------------------------------------*/
+/* Drawing function for ARC_MODE and EARC_MODE */
+/*-------------------------------------------------------------------------*/
+
+static void arc_mode_decorations(generic *newgen)
+{
+ UDrawXLine(((arc*) newgen)->position, areawin->save);
+}
+
+void arc_mode_draw(xcDrawType type, arc *newarc)
+{
+ generic_mode_draw(type, (generic*) newarc, arc_mode_decorations);
+}
+
+/*-------------------------------------------------------------------------*/
+/* Drawing function for SPLINE_MODE and ESPLINE_MODE */
+/*-------------------------------------------------------------------------*/
+
+static void spline_mode_decorations(generic *newgen)
+{
+ spline *newspline = (spline*) newgen;
+ UDrawXLine(newspline->ctrl[0], newspline->ctrl[1]);
+ UDrawXLine(newspline->ctrl[3], newspline->ctrl[2]);
+}
+
+void spline_mode_draw(xcDrawType type, spline *newspline)
+{
+ generic_mode_draw(type, (generic*) newspline, spline_mode_decorations);
+}
+
+/*-------------------------------------------------------------------------*/
+/* Drawing function for WIRE_MODE, BOX_MODE and EPOLY_MODE */
+/*-------------------------------------------------------------------------*/
+
+void poly_mode_draw(xcDrawType type, polygon *newpoly)
+{
+ generic_mode_draw(type, (generic*) newpoly, NULL);
+}
+
+/*-------------------------------------------------------------------------*/
+/* Drawing function for EPATH_MODE */
+/*-------------------------------------------------------------------------*/
+
+static void path_mode_decorations(generic *newgen)
+{
+ genericptr *ggen;
+ path *newpath = (path*) newgen;
+ for (ggen = newpath->plist; ggen < newpath->plist + newpath->parts; ggen++) {
+ if (ELEMENTTYPE(*ggen) == SPLINE) {
+ spline *lastspline = TOSPLINE(ggen);
+ UDrawXLine(lastspline->ctrl[0], lastspline->ctrl[1]);
+ UDrawXLine(lastspline->ctrl[3], lastspline->ctrl[2]);
+ }
+ }
+}
+
+void path_mode_draw(xcDrawType type, path *newpath)
+{
+ generic_mode_draw(type, (generic*) newpath, path_mode_decorations);
+}
+
+/*-------------------------------------------------------------------------*/
+/* Drawing function for TEXT_MODE, CATTEXT_MODE and ETEXT_MODE */
+/*-------------------------------------------------------------------------*/
+
+static void text_mode_decorations(generic *newgen)
+{
+ UDrawTLine((label*) newgen);
+}
+
+void text_mode_draw(xcDrawType type, label *newlabel)
+{
+ generic_mode_draw(type, (generic*) newlabel, text_mode_decorations);
+}
+
+/*-------------------------------------------------------------------------*/
+/* Drawing function for SELAREA_MODE */
+/*-------------------------------------------------------------------------*/
+
+void selarea_mode_draw(xcDrawType type, void *unused)
+{
+ UNUSED(unused);
+
+ switch (type) {
+ case xcREDRAW_FORCED:
+ draw_fixed();
+ /* fallthrough */
+
+ case xcDRAW_INIT:
+ case xcDRAW_EDIT:
+ begin_event_mode_drawing();
+ draw_all_selected();
+ UDrawBox(areawin->origin, areawin->save);
+ end_event_mode_drawing();
+ break;
+
+ case xcDRAW_FINAL:
+ case xcDRAW_EMPTY:
+ /* No need for rendering the background, since it will be */
+ /* overwritten by the select_area() function anyway */
+ break;
+ }
+}
+
+/*-------------------------------------------------------------------------*/
+/* Drawing function for RESCALE_MODE */
+/*-------------------------------------------------------------------------*/
+
+void rescale_mode_draw(xcDrawType type, void *unused)
+{
+ UNUSED(unused);
+
+ switch (type) {
+ case xcREDRAW_FORCED:
+ draw_fixed();
+ /* fallthrough */
+
+ case xcDRAW_INIT:
+ case xcDRAW_EDIT:
+ begin_event_mode_drawing();
+ UDrawRescaleBox(&areawin->save);
+ end_event_mode_drawing();
+ break;
+
+ case xcDRAW_FINAL:
+ case xcDRAW_EMPTY:
+ /* No need for rendering the background, since it will be */
+ /* overwritten by the select_area() function anyway */
+ break;
+ }
+}
+
+/*-------------------------------------------------------------------------*/
+/* Drawing function for CATMOVE_MODE, MOVE_MODE and COPY_MODE */
+/*-------------------------------------------------------------------------*/
+
+void move_mode_draw(xcDrawType type, void *unused)
+{
+ float wirewidth = xobjs.pagelist[areawin->page]->wirewidth;
+ short *selectobj;
+ genericptr *pgen;
+ int idx;
+ UNUSED(unused);
+
+ switch (type) {
+ case xcREDRAW_FORCED:
+ case xcDRAW_INIT:
+ draw_fixed_without_selection();
+ /* fallthrough */
+
+ case xcDRAW_EDIT:
+ begin_event_mode_drawing();
+ XTopSetForeground(SELECTCOLOR);
+ for (idx = 0; idx < areawin->selects; idx++)
+ easydraw(areawin->selectlist[idx], DOFORALL);
+ for (selectobj = areawin->selectlist; selectobj < areawin->selectlist
+ + areawin->selects; selectobj++) {
+ if (SELECTTYPE(selectobj) == LABEL) {
+ label *labelobj = SELTOLABEL(selectobj);
+ if (labelobj->pin == False)
+ UDrawX(labelobj);
+ }
+ }
+ if (areawin->pinattach) {
+ for (pgen = topobject->plist; pgen < topobject->plist +
+ topobject->parts; pgen++) {
+ if (ELEMENTTYPE(*pgen) == POLYGON) {
+ polygon *cpoly = TOPOLY(pgen);
+ if (cpoly->cycle != NULL)
+ UDrawPolygon(cpoly, wirewidth);
+ }
+ }
+ }
+ end_event_mode_drawing();
+ break;
+
+ case xcDRAW_FINAL:
+ begin_event_mode_drawing_final();
+ for (selectobj = areawin->selectlist; selectobj
+ < areawin->selectlist + areawin->selects; selectobj++) {
+ XTopSetForeground(SELTOCOLOR(selectobj));
+ easydraw(*selectobj, DOFORALL);
+ }
+ end_event_mode_drawing_final();
+ break;
+
+ case xcDRAW_EMPTY:
+ /* Do not remove the empty begin/end. For cairo, this renders the */
+ /* background with the fixed elements */
+ begin_event_mode_drawing_final();
+ end_event_mode_drawing_final();
+ break;
+ }
+}
+
+/*-------------------------------------------------------------------------*/
+/* Drawing function for ASSOC_MODE, EINST_MODE, (E)FONTCAT_MODE, PAN_MODE, */
+/* NORMAL_MODE, UNDO_MODE and CATALOG_MODE */
+/*-------------------------------------------------------------------------*/
+
+void normal_mode_draw(xcDrawType type, void *unused)
+{
+ UNUSED(unused);
+
+ switch (type) {
+ case xcDRAW_INIT:
+ case xcREDRAW_FORCED:
+ draw_fixed_without_selection();
+ /* fallthrough */
+
+ case xcDRAW_EDIT:
+ begin_event_mode_drawing();
+
+ /* draw the highlighted netlist, if any */
+ if (checkvalid(topobject) != -1)
+ if (topobject->highlight.netlist != NULL)
+ highlightnetlist(topobject, areawin->topinstance, 1);
+
+ if ((areawin->selects == 1) && SELECTTYPE(areawin->selectlist) == LABEL
+ && areawin->textend > 0 && areawin->textpos > areawin->textend) {
+ labelptr drawlabel = SELTOLABEL(areawin->selectlist);
+ UDrawString(drawlabel, DOSUBSTRING, areawin->topinstance);
+ }
+ else if (eventmode == NORMAL_MODE || eventmode == CATALOG_MODE)
+ draw_all_selected();
+ end_event_mode_drawing();
+ break;
+
+ case xcDRAW_FINAL:
+ break;
+
+ case xcDRAW_EMPTY:
+ break;
+ }
+}
+
+
diff --git a/events.c b/events.c
index 75edfd7..2154640 100644
--- a/events.c
+++ b/events.c
@@ -27,10 +27,9 @@
#endif
#endif
-#ifdef OPENGL
-#include <GL/gl.h>
-#include <GL/glx.h>
-#endif /* OPENGL */
+#ifdef HAVE_CAIRO
+#include <cairo/cairo-xlib.h>
+#endif
/*-------------------------------------------------------------------------*/
/* Local includes */
@@ -56,11 +55,11 @@
extern XtAppContext app;
extern Display *dpy;
-extern int *appcolors;
extern Cursor appcursors[NUM_CURSORS];
extern Globaldata xobjs;
extern XCWindowData *areawin;
extern ApplicationData appdata;
+extern colorindex *colorlist;
extern short popups;
extern int pressmode;
extern xcWidget message2, top;
@@ -77,14 +76,10 @@ extern short help_up;
#endif
/* double buffer */
-#ifdef DOUBLEBUFFER
+#if !defined(HAVE_CAIRO)
Pixmap dbuf = (Pixmap)NULL;
#endif
-#ifdef OPENGL
-extern GLXContext grXcontext;
-#endif
-
Boolean was_preselected;
/*----------------------------------------------------------------------------*/
@@ -213,7 +208,7 @@ int changepage(short pagenumber)
xobjs.pagelist[pagenumber]->background.name = NULL;
xobjs.pagelist[pagenumber]->pageinst = NULL;
- // If we skipped ahead to pagenumber, fill in the pages in between
+ /* If we skipped ahead to pagenumber, fill in the pages in between */
for (npage = xobjs.pages; npage < pagenumber; npage++) {
xobjs.pagelist[npage] = (Pagedata *)malloc(sizeof(Pagedata));
xobjs.pagelist[npage]->pageinst = NULL;
@@ -408,6 +403,7 @@ void pushobject(objinstptr thisinst)
void popobject(xcWidget w, pointertype no_undo, caddr_t calldata)
{
u_char undo_type = UNDO_DONE;
+ UNUSED(w); UNUSED(calldata);
if (areawin->stack == NULL || (eventmode != NORMAL_MODE && eventmode != MOVE_MODE
&& eventmode != COPY_MODE && eventmode != FONTCAT_MODE &&
@@ -464,6 +460,7 @@ void resetbutton(xcWidget button, pointertype pageno, caddr_t calldata)
short page;
objectptr pageobj;
objinstptr pageinst;
+ UNUSED(button); UNUSED(calldata);
if (eventmode != NORMAL_MODE) return;
@@ -508,6 +505,7 @@ void resetbutton(xcWidget button, pointertype pageno, caddr_t calldata)
flush_undo_stack();
if (page == areawin->page) {
+ areawin->redraw_needed = True;
drawarea(areawin->area, NULL, NULL);
printname(pageobj);
renamepage(page);
@@ -524,6 +522,7 @@ void drawhbar(xcWidget bar, caddr_t clientdata, caddr_t calldata)
Window bwin;
float frac;
long rleft, rright, rmid;
+ UNUSED(clientdata); UNUSED(calldata);
if (!xcIsRealized(bar)) return;
if (xobjs.suspend >= 0) return;
@@ -546,7 +545,7 @@ void drawhbar(xcWidget bar, caddr_t clientdata, caddr_t calldata)
if (rright > areawin->width) rright = areawin->width;
XSetFunction(dpy, areawin->gc, GXcopy);
- XSetForeground(dpy, areawin->gc, BARCOLOR);
+ XSetForeground(dpy, areawin->gc, colorlist[BARCOLOR].color.pixel);
if (rmid > 0 && rleft > 0)
XClearArea(dpy, bwin, 0, 0, (int)rleft, SBARSIZE, FALSE);
XFillRectangle(dpy, bwin, areawin->gc, (int)rleft + 1, 1,
@@ -556,8 +555,7 @@ void drawhbar(xcWidget bar, caddr_t clientdata, caddr_t calldata)
- (int)rright, SBARSIZE, FALSE);
XClearArea(dpy, bwin, (int)rmid - 1, 1, 3, SBARSIZE, FALSE);
- XSetFunction(dpy, areawin->gc, areawin->gctype);
- XSetForeground(dpy, areawin->gc, areawin->gccolor);
+ XSetForeground(dpy, areawin->gc, colorlist[areawin->gccolor].color.pixel);
}
/*------------------------------------------------------*/
@@ -569,6 +567,7 @@ void drawvbar(xcWidget bar, caddr_t clientdata, caddr_t calldata)
Window bwin = xcWindow(bar);
float frac;
long rtop, rbot, rmid;
+ UNUSED(clientdata); UNUSED(calldata);
if (!xcIsRealized(bar)) return;
if (xobjs.suspend >= 0) return;
@@ -589,7 +588,7 @@ void drawvbar(xcWidget bar, caddr_t clientdata, caddr_t calldata)
if (rbot > areawin->height) rbot = areawin->height;
XSetFunction(dpy, areawin->gc, GXcopy);
- XSetForeground(dpy, areawin->gc, BARCOLOR);
+ XSetForeground(dpy, areawin->gc, colorlist[BARCOLOR].color.pixel);
if (rmid > 0 && rtop > 0)
XClearArea(dpy, bwin, 0, 0, SBARSIZE, (int)rtop, FALSE);
XFillRectangle(dpy, bwin, areawin->gc, 0, (int)rtop + 2, SBARSIZE,
@@ -599,8 +598,7 @@ void drawvbar(xcWidget bar, caddr_t clientdata, caddr_t calldata)
- (int)rbot, FALSE);
XClearArea(dpy, bwin, 0, (int)rmid - 1, SBARSIZE, 3, FALSE);
- XSetFunction(dpy, areawin->gc, areawin->gctype);
- XSetForeground(dpy, areawin->gc, areawin->gccolor);
+ XSetForeground(dpy, areawin->gc, colorlist[areawin->gccolor].color.pixel);
}
/*------------------------------------------------------*/
@@ -612,6 +610,7 @@ void panhbar(xcWidget bar, caddr_t clientdata, XButtonEvent *event)
{
long newx, newpx;
short savex = areawin->pcorner.x;
+ UNUSED(clientdata);
if (eventmode == SELAREA_MODE) return;
@@ -621,22 +620,12 @@ void panhbar(xcWidget bar, caddr_t clientdata, XButtonEvent *event)
areawin->pcorner.x = (short)newx;
drawhbar(bar, NULL, NULL);
areawin->pcorner.x = savex;
+
+ if ((newpx = (long)(newx - savex) * areawin->vscale) == 0)
+ return;
-#ifdef DOUBLEBUFFER
- if ((newpx = (long)(newx - savex) * areawin->vscale) == 0) return;
- SetFunction(dpy, areawin->gc, GXcopy);
- if (newpx > 0) {
- XCopyArea(dpy, dbuf, areawin->window, areawin->gc, newpx, 0,
- areawin->width - newpx, areawin->height, 0, 0);
- XClearArea(dpy, areawin->window, areawin->width - newpx, 0, newpx,
- areawin->height, FALSE);
- }
- else {
- XCopyArea(dpy, dbuf, areawin->window, areawin->gc, 0, 0,
- areawin->width + newpx, areawin->height, -newpx, 0);
- XClearArea(dpy, areawin->window, 0, 0, -newpx, areawin->height, FALSE);
- }
-#endif
+ areawin->panx = -newpx;
+ drawarea(NULL, NULL, NULL);
}
/*------------------------------------------------------*/
@@ -647,6 +636,9 @@ void endhbar(xcWidget bar, caddr_t clientdata, XButtonEvent *event)
{
long newx;
short savex = areawin->pcorner.x;
+ UNUSED(clientdata);
+
+ areawin->panx = 0;
newx = (long)(event->x * ((float)topobject->bbox.width /
areawin->width) + topobject->bbox.lowerleft.x - 0.5 *
@@ -661,6 +653,7 @@ void endhbar(xcWidget bar, caddr_t clientdata, XButtonEvent *event)
else
W3printf(" ");
+ areawin->redraw_needed = True;
areawin->lastbackground = NULL;
renderbackground();
drawhbar(bar, NULL, NULL);
@@ -676,6 +669,7 @@ void panvbar(xcWidget bar, caddr_t clientdata, XButtonEvent *event)
{
long newy, newpy;
short savey = areawin->pcorner.y;
+ UNUSED(clientdata);
if (eventmode == SELAREA_MODE) return;
@@ -686,23 +680,12 @@ void panvbar(xcWidget bar, caddr_t clientdata, XButtonEvent *event)
areawin->pcorner.y = (short)newy;
drawvbar(bar, NULL, NULL);
areawin->pcorner.y = savey;
-
-#ifdef DOUBLEBUFFER
- if ((newpy = (long)(newy - savey) * areawin->vscale) == 0) return;
- SetFunction(dpy, areawin->gc, GXcopy);
- if (newpy > 0) {
- XCopyArea(dpy, dbuf, areawin->window, areawin->gc, 0, 0,
- areawin->width, areawin->height - newpy, 0, newpy);
- XClearArea(dpy, areawin->window, 0, 0, areawin->width, newpy, FALSE);
- }
- else {
- XCopyArea(dpy, dbuf, areawin->window, areawin->gc, 0, -newpy,
- areawin->width, areawin->height + newpy, 0, 0);
- XClearArea(dpy, areawin->window, 0, areawin->height + newpy,
- areawin->width, -newpy, FALSE);
- }
-#endif
-
+
+ if ((newpy = (long)(newy - savey) * areawin->vscale) == 0)
+ return;
+
+ areawin->pany = newpy;
+ drawarea(NULL, NULL, NULL);
}
/*------------------------------------------------------*/
@@ -711,7 +694,6 @@ void panvbar(xcWidget bar, caddr_t clientdata, XButtonEvent *event)
void trackpan(int x, int y)
{
- long newpx, newpy;
XPoint newpos;
short savey = areawin->pcorner.y;
short savex = areawin->pcorner.x;
@@ -725,20 +707,10 @@ void trackpan(int x, int y)
drawhbar(areawin->scrollbarh, NULL, NULL);
drawvbar(areawin->scrollbarv, NULL, NULL);
-#ifdef DOUBLEBUFFER
- newpx = (long)areawin->pcorner.x * areawin->vscale;
- newpy = (long)areawin->pcorner.y * areawin->vscale;
-
- SetFunction(dpy, areawin->gc, GXcopy);
- /* To-do: Clear or repaint areas not in copy region */
+ areawin->panx = -newpos.x;
+ areawin->pany = newpos.y;
-/*
- XCopyArea(dpy, dbuf, areawin->window, areawin->gc, 0, 0,
- areawin->width, areawin->height, newpx,
- areawin->height - newpy);
-*/
drawarea(NULL, NULL, NULL);
-#endif
areawin->pcorner.x = savex;
areawin->pcorner.y = savey;
@@ -753,6 +725,9 @@ void endvbar(xcWidget bar, caddr_t clientdata, XButtonEvent *event)
{
long newy;
short savey = areawin->pcorner.y;
+ UNUSED(clientdata);
+
+ areawin->pany = 0;
newy = (int)((areawin->height - event->y) *
((float)topobject->bbox.height / areawin->height) +
@@ -768,6 +743,7 @@ void endvbar(xcWidget bar, caddr_t clientdata, XButtonEvent *event)
else
W3printf(" ");
+ areawin->redraw_needed = True;
areawin->lastbackground = NULL;
renderbackground();
drawvbar(bar, NULL, NULL);
@@ -793,6 +769,7 @@ void zoominbox(int x, int y)
float savescale;
float delxscale, delyscale;
XPoint savell; /* ucenter, ncenter, (jdk)*/
+ UNUSED(x); UNUSED(y);
savescale = areawin->vscale;
savell.x = areawin->pcorner.x;
@@ -901,6 +878,7 @@ void zoomoutbox(int x, int y)
float delxscale, delyscale, scalefac;
XPoint savell; /* ucenter, ncenter, (jdk)*/
XlPoint newll;
+ UNUSED(x); UNUSED(y);
savescale = areawin->vscale;
savell.x = areawin->pcorner.x;
@@ -1507,6 +1485,9 @@ void makepress(XtPointer clientdata, xcIntervalId *id)
#endif
{
int keywstate = (int)((pointertype)clientdata);
+#ifndef TCL_WRAPPER
+ UNUSED(id);
+#endif
/* Button/Key was pressed long enough to make a "press", not a "tap" */
@@ -1569,7 +1550,6 @@ void poly_edit_op(int op)
/* Remove a point from the polygon */
if (op == XCF_Edit_Delete) {
if (lwire->number < 3) return;
- UDrawPolygon(lwire, xobjs.pagelist[areawin->page]->wirewidth);
if (lwire->number == 3 && !(lwire->style & UNCLOSED))
lwire->style |= UNCLOSED;
cycle = checkcycle((genericptr)lwire, 0);
@@ -1577,13 +1557,15 @@ void poly_edit_op(int op)
for (lpoint = lwire->points + cycle; lpoint <
lwire->points + lwire->number; lpoint++)
*lpoint = *(lpoint + 1);
- UDrawPolygon(lwire, xobjs.pagelist[areawin->page]->wirewidth);
+ if (eventmode == EPOLY_MODE)
+ poly_mode_draw(xcDRAW_EDIT, TOPOLY(EDITPART));
+ else
+ path_mode_draw(xcDRAW_EDIT, TOPATH(EDITPART));
nextpolycycle(&lwire, -1);
}
/* Add a point to the polygon */
else if (op == XCF_Edit_Insert || op == XCF_Edit_Append) {
- UDrawPolygon(lwire, xobjs.pagelist[areawin->page]->wirewidth);
lwire->number++;
lwire->points = (XPoint *)realloc(lwire->points, lwire->number
* sizeof(XPoint));
@@ -1591,7 +1573,10 @@ void poly_edit_op(int op)
for (lpoint = lwire->points + lwire->number - 1; lpoint > lwire->
points + cycle; lpoint--)
*lpoint = *(lpoint - 1);
- UDrawPolygon(lwire, xobjs.pagelist[areawin->page]->wirewidth);
+ if (eventmode == EPOLY_MODE)
+ poly_mode_draw(xcDRAW_EDIT, TOPOLY(EDITPART));
+ else
+ path_mode_draw(xcDRAW_EDIT, TOPATH(EDITPART));
if (op == XCF_Edit_Append)
nextpolycycle(&lwire, 1);
}
@@ -1635,12 +1620,10 @@ void attach_to()
areawin->attachto = *(refsel + areawin->selects - 1);
areawin->selects--;
if (areawin->selects == 0) freeselects();
- SetFunction(dpy, areawin->gc, GXcopy);
XTopSetForeground(SELTOCOLOR(refsel));
easydraw(areawin->attachto, DEFAULTCOLOR);
/* restore graphics state */
- SetFunction(dpy, areawin->gc, areawin->gctype);
SetForeground(dpy, areawin->gc, areawin->gccolor);
Wprintf("Constrained attach");
@@ -1682,6 +1665,7 @@ Boolean compatible_function(int function)
case XCF_Text_Left: case XCF_Text_Right:
case XCF_Text_Home: case XCF_Text_End:
case XCF_Text_Return: case XCF_Text_Delete:
+ case XCF_Text_Delete_Param:
r = (eventmode == CATTEXT_MODE || eventmode == TEXT_MODE ||
eventmode == ETEXT_MODE) ?
TRUE : FALSE;
@@ -1702,7 +1686,7 @@ Boolean compatible_function(int function)
TRUE : FALSE;
break;
- case XCF_Justify:
+ case XCF_Anchor:
r = (eventmode == TEXT_MODE || eventmode == ETEXT_MODE ||
eventmode == MOVE_MODE || eventmode == COPY_MODE ||
eventmode == NORMAL_MODE) ?
@@ -1883,6 +1867,7 @@ int eventdispatch(int keywstate, int x, int y)
{
short value; /* For return values from boundfunction() */
int function; /* What function should be invoked */
+ int handled = -1; /* event was handled */
/* Invalid key state returned from getkeysignature(); usually this */
/* means a modifier key pressed by itself. */
@@ -1899,26 +1884,32 @@ int eventdispatch(int keywstate, int x, int y)
if (eventmode == CATTEXT_MODE || eventmode == TEXT_MODE ||
eventmode == ETEXT_MODE) {
if (function != XCF_Special)
- return labeltext(keywstate, NULL);
+ handled = labeltext(keywstate, NULL);
else if (eventmode != CATTEXT_MODE) {
labelptr elabel = TOLABEL(EDITPART);
- if (elabel->justify & LATEXLABEL)
- return labeltext(keywstate, NULL);
+ if (elabel->anchor & LATEXLABEL)
+ handled = labeltext(keywstate, NULL);
}
}
}
- if (function > -1)
- return functiondispatch(function, value, x, y);
- else {
- char *keystring = key_to_string(keywstate);
+ if (handled == -1) {
+ if (function > -1)
+ handled = functiondispatch(function, value, x, y);
+ else {
+ char *keystring = key_to_string(keywstate);
#ifdef HAVE_PYTHON
- if (python_key_command(keywstate) < 0)
+ if (python_key_command(keywstate) < 0)
#endif
- Wprintf("Key \'%s\' is not bound to a macro", keystring);
- free(keystring);
+ Wprintf("Key \'%s\' is not bound to a macro", keystring);
+ free(keystring);
+ }
}
- return -1;
+
+ if (areawin->redraw_needed)
+ drawarea(NULL, NULL, NULL);
+
+ return handled;
}
/*----------------------------------------------------------------------*/
@@ -1938,6 +1929,8 @@ int functiondispatch(int function, short value, int x, int y)
case NORMAL_MODE:
window_to_user(x, y, &areawin->save);
break;
+ default:
+ break;
}
switch(function) {
@@ -1947,8 +1940,8 @@ int functiondispatch(int function, short value, int x, int y)
else
newpage(value - 1);
break;
- case XCF_Justify:
- rejustify(value);
+ case XCF_Anchor:
+ reanchor(value);
break;
case XCF_Superscript:
labeltext(SUPERSCRIPT, (char *)1);
@@ -2009,6 +2002,9 @@ int functiondispatch(int function, short value, int x, int y)
case XCF_Text_Delete:
labeltext(TEXT_DELETE, (char *)1);
break;
+ case XCF_Text_Delete_Param:
+ labeltext(TEXT_DEL_PARAM, (char *)1);
+ break;
case XCF_Text_Right:
labeltext(TEXT_RIGHT, (char *)1);
break;
@@ -2088,7 +2084,7 @@ int functiondispatch(int function, short value, int x, int y)
starthelp(NULL, NULL, NULL);
break;
case XCF_Redraw:
- drawarea(NULL, NULL, NULL);
+ areawin->redraw_needed = True;
break;
case XCF_View:
zoomview(NULL, NULL, NULL);
@@ -2200,6 +2196,7 @@ int functiondispatch(int function, short value, int x, int y)
reset_cycles();
select_connected_pins();
XDefineCursor(dpy, areawin->window, ARROW);
+ move_mode_draw(xcDRAW_INIT, NULL);
#ifdef TCL_WRAPPER
Tk_CreateEventHandler(areawin->area, ButtonMotionMask |
PointerMotionMask, (Tk_EventProc *)xctk_drag,
@@ -2250,6 +2247,7 @@ int functiondispatch(int function, short value, int x, int y)
case XCF_Dot:
snap(x, y, &areawin->save);
drawdot(areawin->save.x, areawin->save.y);
+ areawin->redraw_needed = True;
drawarea(NULL, NULL, NULL);
break;
case XCF_Wire:
@@ -2284,7 +2282,7 @@ int functiondispatch(int function, short value, int x, int y)
case XCF_Rescale:
if (checkselect(LABEL | OBJINST | GRAPHIC) == TRUE) {
eventmode = RESCALE_MODE;
- UDrawRescaleBox(&areawin->save);
+ rescale_mode_draw(xcDRAW_INIT, NULL);
#ifdef TCL_WRAPPER
Tk_CreateEventHandler(areawin->area, PointerMotionMask |
ButtonMotionMask, (Tk_EventProc *)xctk_drag, NULL);
@@ -2340,10 +2338,6 @@ int functiondispatch(int function, short value, int x, int y)
Wprintf("Action not handled");
result = -1;
break;
- case XCF_Text_Delete_Param:
- Wprintf("Action not handled");
- result = -1;
- break;
case XCF_ChangeStyle:
Wprintf("Action not handled");
result = -1;
@@ -2425,7 +2419,8 @@ int getkeysignature(XKeyEvent *event)
void keyhandler(xcWidget w, caddr_t clientdata, XKeyEvent *event)
{
int keywstate; /* KeySym with prepended state information */
- int j, func;
+ int func;
+ UNUSED(w); UNUSED(clientdata);
#ifdef TCL_WRAPPER
if (popups > 0) return;
@@ -2453,6 +2448,8 @@ void keyhandler(xcWidget w, caddr_t clientdata, XKeyEvent *event)
finish_op(XCF_Finish, event->x, event->y);
pressmode = 0;
+ if (areawin->redraw_needed)
+ drawarea(NULL, NULL, NULL);
}
return; /* Ignore all other release events */
}
@@ -2468,7 +2465,6 @@ void keyhandler(xcWidget w, caddr_t clientdata, XKeyEvent *event)
/* Establish whether a HOLD modifier binding would apply in */
/* the current eventmode. If so, set the HOLD timer. */
- j = 0;
func = boundfunction(areawin->area, keywstate | HOLD_MASK, NULL);
if (func != -1) {
areawin->save.x = event->x;
@@ -2504,6 +2500,7 @@ void setsnap(short direction)
if (xobjs.pagelist[areawin->page]->snapspace != oldsnap) {
measurestr(xobjs.pagelist[areawin->page]->snapspace, buffer);
Wprintf("Snap spacing set to %s", buffer);
+ areawin->redraw_needed = True;
drawarea(NULL, NULL, NULL);
}
}
@@ -2519,7 +2516,6 @@ void snapelement()
preselected = (areawin->selects > 0) ? TRUE : FALSE;
if (!checkselect(ALL_TYPES)) return;
- SetFunction(dpy, areawin->gc, GXcopy);
SetForeground(dpy, areawin->gc, BACKGROUND);
for (selectobj = areawin->selectlist; selectobj < areawin->selectlist
+ areawin->selects; selectobj++) {
@@ -2705,7 +2701,7 @@ void printpos(short xval, short yval)
polyptr lwire = (eventmode == BOX_MODE) ? TOPOLY(ENDPART) : TOPOLY(EDITPART);
if ((eventmode == EPOLY_MODE) && (lwire->number > 2)) {
/* sanity check on edit cycle */
- cycle = lwire->cycle->number;
+ cycle = (lwire->cycle) ? lwire->cycle->number : -1;
if (cycle < 0 || cycle >= lwire->number) {
advancecycle((genericptr *)(&lwire), 0);
cycle = 0;
@@ -2831,7 +2827,7 @@ void printpos(short xval, short yval)
/*---------------------------------------------------*/
void findwirex(XPoint *endpt1, XPoint *endpt2, XPoint *userpt,
- XPoint *newpos, int *rot)
+ XPoint *newpos, float *rot)
{
long xsq, ysq, zsq;
float frac;
@@ -2845,16 +2841,8 @@ void findwirex(XPoint *endpt1, XPoint *endpt2, XPoint *userpt,
newpos->x = endpt1->x + (int)((endpt2->x - endpt1->x) * frac);
newpos->y = endpt1->y + (int)((endpt2->y - endpt1->y) * frac);
- *rot = 180 + (int)(INVRFAC * atan2((double)(endpt1->x -
- endpt2->x), (double)(endpt1->y - endpt2->y)));
-
- /* make adjustment for nearest-integer calculation */
- /* ((*rot)++, (*rot)-- works if (360 / RSTEPS >= 2)) */ /* ? */
-
- if (*rot > 0)
- (*rot)++;
- else if (*rot < 0)
- (*rot)--;
+ *rot = 180.0 + INVRFAC * atan2((double)(endpt1->x -
+ endpt2->x), (double)(endpt1->y - endpt2->y));
}
/*----------------------------------------------------------------*/
@@ -2862,12 +2850,12 @@ void findwirex(XPoint *endpt1, XPoint *endpt2, XPoint *userpt,
/* to the "attachto" element. */
/*----------------------------------------------------------------*/
-void findattach(XPoint *newpos, int *rot, XPoint *userpt)
+void findattach(XPoint *newpos, float *rot, XPoint *userpt)
{
XPoint *endpt1, *endpt2;
float frac;
double tmpang;
- int locrot = 0;
+ float locrot = 0.0;
if (rot) locrot = *rot;
@@ -2922,8 +2910,8 @@ void findattach(XPoint *newpos, int *rot, XPoint *userpt)
/* rotation of object is normal to the curve of the ellipse */
if (rot) {
- *rot = 90 - (int)(INVRFAC * tmpang);
- if (*rot < 0) *rot += 360;
+ *rot = 90.0 - INVRFAC * tmpang;
+ if (*rot < 0.0) *rot += 360.0;
}
}
else if (SELECTTYPE(&areawin->attachto) == SPLINE) {
@@ -3097,15 +3085,13 @@ void drag(int x, int y)
/* set up the graphics state for moving a selected object */
- XSetXORFg(SELECTCOLOR, BACKGROUND);
- SetFunction(dpy, areawin->gc, GXxor);
+ XTopSetForeground(SELECTCOLOR);
placeselects(deltax, deltay, &userpt);
/* restore graphics state */
SetForeground(dpy, areawin->gc, areawin->gccolor);
- SetFunction(dpy, areawin->gc, areawin->gctype);
/* print the position and other useful measurements */
@@ -3119,14 +3105,18 @@ void drag(int x, int y)
void xlib_drag(xcWidget w, caddr_t clientdata, XEvent *event)
{
XButtonEvent *bevent = (XButtonEvent *)event;
+ UNUSED(w); UNUSED(clientdata);
+
drag(bevent->x, bevent->y);
+ if (areawin->redraw_needed)
+ drawarea(NULL, NULL, NULL);
}
/*----------------------------------------------*/
/* Rotate an element of a path */
/*----------------------------------------------*/
-void elemrotate(genericptr *genobj, short direction, XPoint *position)
+void elemrotate(genericptr *genobj, float direction, XPoint *position)
{
XPoint negpt, *newpts = (XPoint *)NULL;
@@ -3136,8 +3126,8 @@ void elemrotate(genericptr *genobj, short direction, XPoint *position)
switch(ELEMENTTYPE(*genobj)) {
case(ARC):{
arcptr rotatearc = TOARC(genobj);
- rotatearc->angle1 -= (float)(direction);
- rotatearc->angle2 -= (float)(direction);
+ rotatearc->angle1 -= direction;
+ rotatearc->angle2 -= direction;
if (rotatearc->angle1 >= 360) {
rotatearc->angle1 -= 360;
rotatearc->angle2 -= 360;
@@ -3181,7 +3171,7 @@ void elemrotate(genericptr *genobj, short direction, XPoint *position)
/* and groups, rotate about the cursor point. */
/*------------------------------------------------------*/
-void elementrotate(short direction, XPoint *position)
+void elementrotate(float direction, XPoint *position)
{
short *selectobj; /* , ld; (jdk) */
Boolean single = False;
@@ -3201,7 +3191,6 @@ void elementrotate(short direction, XPoint *position)
/* erase the element */
if (!need_refresh) {
- SetFunction(dpy, areawin->gc, GXcopy);
SetForeground(dpy, areawin->gc, BACKGROUND);
easydraw(*selectobj, DOFORALL);
}
@@ -3241,7 +3230,9 @@ void elementrotate(short direction, XPoint *position)
rotateg->rotation += direction;
while (rotateg->rotation >= 360) rotateg->rotation -= 360;
while (rotateg->rotation <= 0) rotateg->rotation += 360;
+#ifndef HAVE_CAIRO
rotateg->valid = FALSE;
+#endif /* !HAVE_CAIRO */
if (!single) {
UTransformPoints(&rotateg->position, &newpt, 1, negpt, 1.0, 0);
UTransformPoints(&newpt, &rotateg->position, 1, *position,
@@ -3282,7 +3273,7 @@ void elementrotate(short direction, XPoint *position)
if (eventmode != COPY_MODE)
register_for_undo(XCF_Rotate, UNDO_MORE, areawin->topinstance,
(eventmode == MOVE_MODE) ? &areawin->origin : position,
- (int)direction);
+ (double)direction);
/* New rule (6/15/07) to be applied generally: If objects were */
/* selected prior to calling elementrotate() and similar functions, */
@@ -3351,24 +3342,21 @@ void elementrescale(float newscale)
void edit(int x, int y)
{
- short *selectobj, saveselects;
- Boolean preselected = False;
+ short *selectobj;
if (areawin->selects == 0) {
- short savemode = eventmode;
- eventmode = PENDING_MODE;
+ Boolean saveredraw = areawin->redraw_needed;
selectobj = select_element(ALL_TYPES);
- eventmode = savemode;
+ areawin->redraw_needed = saveredraw;
}
- else {
- preselected = True;
+ else
selectobj = areawin->selectlist;
- }
if (areawin->selects == 0)
return;
else if (areawin->selects != 1) { /* Multiple object edit */
- int seltype, selnum;
+ int selnum;
short *selectlist, selrefno;
+ Boolean save_redraw = areawin->redraw_needed;
/* Find the closest part to use as a reference */
selnum = areawin->selects;
@@ -3383,6 +3371,7 @@ void edit(int x, int y)
freeselects();
areawin->selects = selnum;
areawin->selectlist = selectlist;
+ areawin->redraw_needed = save_redraw;
for (selectobj = areawin->selectlist; selectobj < areawin->selectlist
+ areawin->selects; selectobj++) {
if (*selectobj == selrefno) break;
@@ -3416,23 +3405,31 @@ void edit(int x, int y)
/* unless textend is set. . . */
if (areawin->textend == 0) {
+ TextLinesInfo tlinfo;
+ tlinfo.dostop = 0;
+ tlinfo.tbreak = NULL;
+ tlinfo.padding = NULL;
+
window_to_user(x, y, &areawin->save);
InvTransformPoints(&areawin->save, &tmppt, 1, (*lastlabel)->position,
(*lastlabel)->scale, (*lastlabel)->rotation);
- tmpext = ULength(*lastlabel, areawin->topinstance, 0, NULL);
- tmppt.x += ((*lastlabel)->justify & NOTLEFT ?
- ((*lastlabel)->justify & RIGHT ? tmpext.maxwidth
+ tmpext = ULength(*lastlabel, areawin->topinstance, &tlinfo);
+ tmppt.x += ((*lastlabel)->anchor & NOTLEFT ?
+ ((*lastlabel)->anchor & RIGHT ? tmpext.maxwidth
: tmpext.maxwidth >> 1) : 0);
- tmppt.y += ((*lastlabel)->justify & NOTBOTTOM ?
- ((*lastlabel)->justify & TOP ? tmpext.ascent :
+ tmppt.y += ((*lastlabel)->anchor & NOTBOTTOM ?
+ ((*lastlabel)->anchor & TOP ? tmpext.ascent :
(tmpext.ascent + tmpext.base) >> 1) : tmpext.base);
if ((*lastlabel)->pin)
- pinadjust((*lastlabel)->justify, &tmppt.x, NULL, -1);
+ pinadjust((*lastlabel)->anchor, &tmppt.x, NULL, -1);
+
+ /* Where tbreak is passed to ULength, the character position */
+ /* is returned in the TextLinesInfo dostop field. */
+ tlinfo.tbreak = &tmppt;
+ tmpext = ULength(*lastlabel, areawin->topinstance, &tlinfo);
+ areawin->textpos = tlinfo.dostop;
- // Where tbreak is passed to ULength, the character position,
- // not the dimension, is held in tmpext.width field.
- tmpext = ULength(*lastlabel, areawin->topinstance, 0, &tmppt);
- areawin->textpos = tmpext.width;
+ if (tlinfo.padding != NULL) free(tlinfo.padding);
}
/* find current font */
@@ -3442,17 +3439,21 @@ void edit(int x, int y)
/* change menu buttons accordingly */
- setfontmarks(curfont, (*lastlabel)->justify);
+ setfontmarks(curfont, (*lastlabel)->anchor);
if (eventmode == CATALOG_MODE) {
/* CATTEXT_MODE may show an otherwise hidden library namespace */
undrawtext(*lastlabel);
eventmode = CATTEXT_MODE;
redrawtext(*lastlabel);
+ areawin->redraw_needed = False; /* ignore prev. redraw requests */
+ text_mode_draw(xcDRAW_INIT, *lastlabel);
+ }
+ else {
+ eventmode = ETEXT_MODE;
+ text_mode_draw(xcDRAW_INIT, *lastlabel);
}
- else eventmode = ETEXT_MODE;
- UDrawTLine(*lastlabel);
XDefineCursor(dpy, areawin->window, TEXTPTR);
/* write the text at the bottom */
@@ -3463,15 +3464,6 @@ void edit(int x, int y)
case POLYGON: case ARC: case SPLINE: case PATH:
window_to_user(x, y, &areawin->save);
- /* Redraw without drawing selections */
- saveselects = areawin->selects;
- selectobj = areawin->selectlist;
- areawin->selects = 0;
- areawin->selectlist = NULL;
- drawarea(NULL, NULL, NULL);
- areawin->selectlist = selectobj;
- areawin->selects = saveselects;
-
pathedit(*(EDITPART));
break;
@@ -3570,18 +3562,8 @@ void pathedit(genericptr editpart)
areawin->origin = areawin->save;
checkwarp(savept);
- /* Draw edit lines on all splines in the path */
- for (ggen = lastpath->plist; ggen < lastpath->plist + lastpath->parts;
- ggen++) {
- if (ELEMENTTYPE(*ggen) == SPLINE) {
- lastspline = TOSPLINE(ggen);
- UDrawXLine(lastspline->ctrl[0], lastspline->ctrl[1]);
- UDrawXLine(lastspline->ctrl[3], lastspline->ctrl[2]);
- }
- }
- XcSetXORFg((lastpoly) ? lastpoly->color : lastspline->color, BACKGROUND);
- XcSetFunction(GXxor);
-
+ path_mode_draw(xcDRAW_INIT, lastpath);
+
xcAddEventHandler(areawin->area, PointerMotionMask, False,
(xcEventHandler)trackelement, NULL);
eventmode = EPATH_MODE;
@@ -3612,8 +3594,7 @@ void pathedit(genericptr editpart)
checkwarp(savept);
- XcSetXORFg(lastpoly->color, BACKGROUND);
- XcSetFunction(GXxor);
+ poly_mode_draw(xcDRAW_INIT, lastpoly);
xcAddEventHandler(areawin->area, PointerMotionMask, False,
(xcEventHandler)trackelement, NULL);
@@ -3647,10 +3628,7 @@ void pathedit(genericptr editpart)
checkwarp(curpt);
- UDrawXLine(lastspline->ctrl[0], lastspline->ctrl[1]);
- UDrawXLine(lastspline->ctrl[3], lastspline->ctrl[2]);
- XcSetXORFg(lastspline->color, BACKGROUND);
- XcSetFunction(GXxor);
+ spline_mode_draw(xcDRAW_INIT, lastspline);
xcAddEventHandler(areawin->area, PointerMotionMask, False,
(xcEventHandler)trackelement, NULL);
eventmode = ESPLINE_MODE;
@@ -3679,11 +3657,9 @@ void pathedit(genericptr editpart)
checkwarp(&curpt);
- UDrawXLine(curpt, lastarc->position);
areawin->save.x = curpt.x; /* for redrawing dotted edit line */
areawin->save.y = curpt.y;
- XcSetXORFg(lastarc->color, BACKGROUND);
- XcSetFunction(GXxor);
+ arc_mode_draw(xcDRAW_INIT, lastarc);
xcAddEventHandler(areawin->area, PointerMotionMask, False,
(xcEventHandler)trackarc, NULL);
eventmode = EARC_MODE;
@@ -3719,7 +3695,6 @@ void xc_top(short *selectno, short *orderlist)
/* Lower an element to the bottom of the list */
/*------------------------------------------------------*/
-
void xc_bottom(short *selectno, short *orderlist)
{
short i;
@@ -4043,22 +4018,23 @@ void elementflip(XPoint *position)
+ areawin->selects; selectobj++) {
/* erase the object */
- SetFunction(dpy, areawin->gc, GXcopy);
SetForeground(dpy, areawin->gc, BACKGROUND);
easydraw(*selectobj, DOFORALL);
switch(SELECTTYPE(selectobj)) {
case LABEL:{
labelptr fliplab = SELTOLABEL(selectobj);
- if ((fliplab->justify & (RIGHT | NOTLEFT)) != NOTLEFT)
- fliplab->justify ^= (RIGHT | NOTLEFT);
+ if ((fliplab->anchor & (RIGHT | NOTLEFT)) != NOTLEFT)
+ fliplab->anchor ^= (RIGHT | NOTLEFT);
if (!single)
fliplab->position.x = (position->x << 1) - fliplab->position.x;
}break;
case GRAPHIC:{
graphicptr flipg = SELTOGRAPHIC(selectobj);
flipg->scale = -flipg->scale;
+#ifndef HAVE_CAIRO
flipg->valid = FALSE;
+#endif /* !HAVE_CAIRO */
if (!single)
flipg->position.x = (position->x << 1) - flipg->position.x;
}break;
@@ -4130,15 +4106,14 @@ void elementvflip(XPoint *position)
+ areawin->selects; selectobj++) {
/* erase the object */
- SetFunction(dpy, areawin->gc, GXcopy);
SetForeground(dpy, areawin->gc, BACKGROUND);
easydraw(*selectobj, DOFORALL);
switch(SELECTTYPE(selectobj)) {
case(LABEL):{
labelptr fliplab = SELTOLABEL(selectobj);
- if ((fliplab->justify & (TOP | NOTBOTTOM)) != NOTBOTTOM)
- fliplab->justify ^= (TOP | NOTBOTTOM);
+ if ((fliplab->anchor & (TOP | NOTBOTTOM)) != NOTBOTTOM)
+ fliplab->anchor ^= (TOP | NOTBOTTOM);
if (!single)
fliplab->position.y = (position->y << 1) - fliplab->position.y;
} break;
@@ -4204,6 +4179,8 @@ void elementvflip(XPoint *position)
void deletebutton(int x, int y)
{
+ UNUSED(x); UNUSED(y);
+
if (checkselect(ALL_TYPES)) {
standard_element_delete(ERASE);
calcbbox(areawin->topinstance);
@@ -4273,7 +4250,6 @@ objectptr delete_element(objinstptr thisinstance, short *slist, int selects,
initmem(delobj);
if (drawmode) {
- SetFunction(dpy, areawin->gc, GXcopy);
SetForeground(dpy, areawin->gc, BACKGROUND);
}
@@ -4317,8 +4293,8 @@ void standard_element_delete(short drawmode)
{
objectptr delobj;
-// register_for_undo(XCF_Select, UNDO_MORE, areawin->topinstance,
-// areawin->selectlist, areawin->selects);
+/* register_for_undo(XCF_Select, UNDO_MORE, areawin->topinstance, */
+/* areawin->selectlist, areawin->selects); */
select_invalidate_netlist();
delobj = delete_element(areawin->topinstance, areawin->selectlist,
areawin->selects, drawmode);
@@ -4381,10 +4357,6 @@ short *xc_undelete(objinstptr thisinstance, objectptr delobj, short mode,
slist = (short *)malloc(delobj->parts * sizeof(short));
count = 0;
- if (mode) {
- SetFunction(dpy, areawin->gc, GXcopy);
- }
-
for (regen = delobj->plist; regen < delobj->plist + delobj->parts; regen++) {
PLIST_INCR(thisobject);
if (olist == NULL) {
@@ -4779,6 +4751,8 @@ void editpoints(genericptr *ssgen, short deltax, short deltay)
void xlib_makeobject(xcWidget w, caddr_t nulldata)
{
+ UNUSED(w); UNUSED(nulldata);
+
domakeobject(-1, (char *)_STR2, FALSE);
}
@@ -4930,7 +4904,6 @@ objinstptr domakeobject(int libnum, char *name, Boolean forceempty)
/* (netlist invalidation was taken care of by delete_element() */
/* Also, incr_changes(topobject) was done by delete_element()) */
- SetFunction(dpy, areawin->gc, GXcopy);
XTopSetForeground((*newinst)->color);
UDrawObject(*newinst, SINGLE, (*newinst)->color,
xobjs.pagelist[areawin->page]->wirewidth, NULL);
@@ -4966,6 +4939,7 @@ objinstptr domakeobject(int libnum, char *name, Boolean forceempty)
void selectsave(xcWidget w, caddr_t clientdata, caddr_t calldata)
{
buttonsave *popdata = (buttonsave *)malloc(sizeof(buttonsave));
+ UNUSED(clientdata); UNUSED(calldata);
if (areawin->selects == 0) return; /* nothing was selected */
@@ -5055,9 +5029,11 @@ void graphiccopy(graphicptr newg, graphicptr copyg)
newg->color = copyg->color;
newg->passed = NULL;
copyalleparams((genericptr)newg, (genericptr)copyg);
+#ifndef HAVE_CAIRO
newg->valid = FALSE;
newg->target = NULL;
newg->clipmask = (Pixmap)NULL;
+#endif /* HAVE_CAIRO */
/* Update the refcount of the source image */
for (i = 0; i < xobjs.images; i++) {
@@ -5078,7 +5054,7 @@ void labelcopy(labelptr newtext, labelptr copytext)
newtext->position.y = copytext->position.y;
newtext->rotation = copytext->rotation;
newtext->scale = copytext->scale;
- newtext->justify = copytext->justify;
+ newtext->anchor = copytext->anchor;
newtext->color = copytext->color;
newtext->passed = NULL;
newtext->cycle = NULL;
@@ -5314,12 +5290,11 @@ void placeselects(short deltax, short deltay, XPoint *userpt)
{
short *dragselect;
XPoint newpos, *ppt;
- int rot;
- short closest, cycle;
+ float rot;
+ short closest;
Boolean doattach;
genericptr *pgen;
polyptr cpoly;
- pointselect *cptr;
doattach = ((userpt == NULL) || (areawin->attachto < 0)) ? FALSE : TRUE;
@@ -5328,7 +5303,11 @@ void placeselects(short deltax, short deltay, XPoint *userpt)
if (doattach) findattach(&newpos, &rot, userpt);
+#ifdef HAVE_CAIRO
+#else
areawin->clipped = -1; /* Prevent clipping */
+#endif /* HAVE_CAIRO */
+
for (dragselect = areawin->selectlist; dragselect < areawin->selectlist
+ areawin->selects; dragselect++) {
@@ -5336,35 +5315,26 @@ void placeselects(short deltax, short deltay, XPoint *userpt)
case OBJINST: {
objinstptr draginst = SELTOOBJINST(dragselect);
- UDrawObject(draginst, SINGLE, DOFORALL,
- xobjs.pagelist[areawin->page]->wirewidth, NULL);
if (doattach) {
draginst->position.x = newpos.x;
draginst->position.y = newpos.y;
- while (rot >= 360) rot -= 360;
- while (rot < 0) rot += 360;
+ while (rot >= 360.0) rot -= 360.0;
+ while (rot < 0.0) rot += 360.0;
draginst->rotation = rot;
}
else {
draginst->position.x += deltax;
draginst->position.y += deltay;
}
- UDrawObject(draginst, SINGLE, DOFORALL,
- xobjs.pagelist[areawin->page]->wirewidth, NULL);
} break;
case GRAPHIC: {
graphicptr dragg = SELTOGRAPHIC(dragselect);
- UDrawGraphic(dragg);
dragg->position.x += deltax;
dragg->position.y += deltay;
- UDrawGraphic(dragg);
} break;
case LABEL: {
labelptr draglabel = SELTOLABEL(dragselect);
- UDrawString(draglabel, DOFORALL, areawin->topinstance);
- if (draglabel->pin == False)
- UDrawX(draglabel);
if (doattach) {
draglabel->position.x = newpos.x;
draglabel->position.y = newpos.y;
@@ -5374,15 +5344,11 @@ void placeselects(short deltax, short deltay, XPoint *userpt)
draglabel->position.x += deltax;
draglabel->position.y += deltay;
}
- UDrawString(draglabel, DOFORALL, areawin->topinstance);
- if (draglabel->pin == False)
- UDrawX(draglabel);
} break;
case PATH: {
pathptr dragpath = SELTOPATH(dragselect);
genericptr *pathlist;
- UDrawPath(dragpath, xobjs.pagelist[areawin->page]->wirewidth);
if (doattach) {
XPoint *pdelta = pathclosepoint(dragpath, &newpos);
deltax = newpos.x - pdelta->x;
@@ -5392,14 +5358,12 @@ void placeselects(short deltax, short deltay, XPoint *userpt)
+ dragpath->parts; pathlist++) {
movepoints(pathlist, deltax, deltay);
}
- UDrawPath(dragpath, xobjs.pagelist[areawin->page]->wirewidth);
} break;
case POLYGON: {
polyptr dragpoly = SELTOPOLY(dragselect);
pointlist dragpoints;
- // if (dragpoly->cycle != NULL) continue;
- UDrawPolygon(dragpoly, xobjs.pagelist[areawin->page]->wirewidth);
+ /* if (dragpoly->cycle != NULL) continue; */
if (doattach) {
closest = closepoint(dragpoly, &newpos);
deltax = newpos.x - dragpoly->points[closest].x;
@@ -5410,15 +5374,13 @@ void placeselects(short deltax, short deltay, XPoint *userpt)
dragpoints->x += deltax;
dragpoints->y += deltay;
}
- UDrawPolygon(dragpoly, xobjs.pagelist[areawin->page]->wirewidth);
} break;
case SPLINE: {
splineptr dragspline = SELTOSPLINE(dragselect);
short j;
fpointlist dragpoints;
- // if (dragspline->cycle != NULL) continue;
- UDrawSpline(dragspline, xobjs.pagelist[areawin->page]->wirewidth);
+ /* if (dragspline->cycle != NULL) continue; */
if (doattach) {
closest = (wirelength(&dragspline->ctrl[0], &newpos)
> wirelength(&dragspline->ctrl[3], &newpos)) ? 3 : 0;
@@ -5434,13 +5396,11 @@ void placeselects(short deltax, short deltay, XPoint *userpt)
dragspline->ctrl[j].x += deltax;
dragspline->ctrl[j].y += deltay;
}
- UDrawSpline(dragspline, xobjs.pagelist[areawin->page]->wirewidth);
} break;
case ARC: {
arcptr dragarc = SELTOARC(dragselect);
fpointlist dragpoints;
- UDrawArc(dragarc, xobjs.pagelist[areawin->page]->wirewidth);
if (doattach) {
deltax = newpos.x - dragarc->position.x;
deltay = newpos.y - dragarc->position.y;
@@ -5452,7 +5412,6 @@ void placeselects(short deltax, short deltay, XPoint *userpt)
dragpoints->x += deltax;
dragpoints->y += deltay;
}
- UDrawArc(dragarc, xobjs.pagelist[areawin->page]->wirewidth);
} break;
}
}
@@ -5464,19 +5423,22 @@ void placeselects(short deltax, short deltay, XPoint *userpt)
cpoly = TOPOLY(pgen);
if (cpoly->cycle != NULL) {
ppt = cpoly->points + cpoly->cycle->number;
- UDrawPolygon(cpoly, xobjs.pagelist[areawin->page]->wirewidth);
newpos.x = ppt->x + deltax;
newpos.y = ppt->y + deltay;
if (areawin->manhatn)
manhattanize(&newpos, cpoly, cpoly->cycle->number, FALSE);
ppt->x = newpos.x;
ppt->y = newpos.y;
- UDrawPolygon(cpoly, xobjs.pagelist[areawin->page]->wirewidth);
}
}
}
}
+
+ move_mode_draw(xcDRAW_EDIT, NULL);
+#ifdef HAVE_CAIRO
+#else
areawin->clipped = 0;
+#endif /* HAVE_CAIRO */
}
/*----------------------------------------------------------------------*/
@@ -5556,18 +5518,8 @@ void createcopies()
void copydrag()
{
- short *selectobj;
-
if (areawin->selects > 0) {
- /* Put all selected objects into the "select" color */
-
- SetFunction(dpy, areawin->gc, GXxor);
- for (selectobj = areawin->selectlist; selectobj < areawin->selectlist
- + areawin->selects; selectobj++) {
- XSetXORFg(SELTOCOLOR(selectobj), BACKGROUND);
- easydraw(*selectobj, DOFORALL);
- }
-
+ move_mode_draw(xcDRAW_INIT, NULL);
if (eventmode == NORMAL_MODE) {
XDefineCursor(dpy, areawin->window, COPYCURSOR);
eventmode = COPY_MODE;
@@ -5590,8 +5542,6 @@ void copydrag()
void copy_op(int op, int x, int y)
{
- short *csel;
-
if (op == XCF_Copy) {
window_to_user(x, y, &areawin->save);
createcopies(); /* This function does all the hard work */
@@ -5613,14 +5563,11 @@ void copy_op(int op, int x, int y)
XDefineCursor(dpy, areawin->window, DEFAULTCURSOR);
u2u_snap(&areawin->save);
if (op == XCF_Cancel) {
+ move_mode_draw(xcDRAW_EMPTY, NULL);
delete_noundo(NORMAL);
-
- /* Redraw the screen so that an object directly under */
- /* the delete object won't get painted black */
-
- drawarea(NULL, NULL, NULL);
}
else if (op == XCF_Finish_Copy) {
+ move_mode_draw(xcDRAW_FINAL, NULL);
/* If selected objects are the only ones on the page, */
/* then do a full bbox calculation. */
if (topobject->parts == areawin->selects)
@@ -5634,11 +5581,7 @@ void copy_op(int op, int x, int y)
incr_changes(topobject);
}
else { /* XCF_Continue_Copy */
- SetFunction(dpy, areawin->gc, GXcopy);
- SetForeground(dpy, areawin->gc, SELECTCOLOR);
- for (csel = areawin->selectlist; csel < areawin->selectlist +
- areawin->selects; csel++)
- easydraw(*csel, DOFORALL);
+ move_mode_draw(xcDRAW_FINAL, NULL);
if (topobject->parts == areawin->selects)
calcbbox(areawin->topinstance);
else
@@ -5700,6 +5643,8 @@ void continue_op(int op, int x, int y)
case(BOX_MODE):
finish_op(XCF_Finish_Element, x, y);
break;
+ default:
+ break;
}
}
@@ -5733,6 +5678,7 @@ void finish_op(int op, int x, int y)
case (EFONTCAT_MODE):
fontcat_op(op, x, y);
eventmode = (eventmode == FONTCAT_MODE) ? TEXT_MODE : ETEXT_MODE;
+ text_mode_draw(xcDRAW_INIT, TOLABEL(EDITPART));
XDefineCursor (dpy, areawin->window, TEXTPTR);
break;
@@ -5751,9 +5697,10 @@ void finish_op(int op, int x, int y)
case(TEXT_MODE):
curlabel = TOLABEL(EDITPART);
- UDrawTLine(curlabel);
if (op == XCF_Cancel) {
redrawtext(curlabel);
+ areawin->redraw_needed = False; /* ignore previous requests */
+ text_mode_draw(xcDRAW_EMPTY, curlabel);
freelabel(curlabel->string);
free(curlabel);
topobject->parts--;
@@ -5763,6 +5710,7 @@ void finish_op(int op, int x, int y)
singlebbox(EDITPART);
incr_changes(topobject);
select_invalidate_netlist();
+ text_mode_draw(xcDRAW_FINAL, curlabel);
}
setdefaultfontmarks();
eventmode = NORMAL_MODE;
@@ -5770,14 +5718,15 @@ void finish_op(int op, int x, int y)
case(ETEXT_MODE): case(CATTEXT_MODE):
curlabel = TOLABEL(EDITPART);
- UDrawTLine(curlabel);
if (op == XCF_Cancel) {
/* restore the original text */
undrawtext(curlabel);
undo_finish_series();
undo_action();
- if (eventmode == CATTEXT_MODE) eventmode = CATALOG_MODE;
redrawtext(curlabel);
+ areawin->redraw_needed = False; /* ignore previous requests */
+ text_mode_draw(xcDRAW_EMPTY, curlabel);
+ if (eventmode == CATTEXT_MODE) eventmode = CATALOG_MODE;
W3printf("");
setdefaultfontmarks();
}
@@ -5840,7 +5789,7 @@ void finish_op(int op, int x, int y)
else {
if (areawin->selects > 0) {
register_for_undo(XCF_Move,
- // (was_preselected) ? UNDO_DONE : UNDO_MORE,
+ /* (was_preselected) ? UNDO_DONE : UNDO_MORE, */
UNDO_MORE,
areawin->topinstance,
(int)(areawin->save.x - areawin->origin.x),
@@ -5848,13 +5797,13 @@ void finish_op(int op, int x, int y)
pwriteback(areawin->topinstance);
incr_changes(topobject);
select_invalidate_netlist();
- unselect_all(); // The way it used to be. . .
+ unselect_all(); /* The way it used to be. . . */
}
W3printf("");
/* full calc needed: move may shrink bbox */
calcbbox(areawin->topinstance);
checkoverlap();
- // if (!was_preselected) clearselects();
+ /* if (!was_preselected) clearselects(); */
}
areawin->attachto = -1;
break;
@@ -5869,15 +5818,20 @@ void finish_op(int op, int x, int y)
ButtonMotionMask, FALSE, (xcEventHandler)xlib_drag,
NULL);
#endif
+ rescale_mode_draw(xcDRAW_FINAL, NULL);
if (op != XCF_Cancel) {
- fscale = UDrawRescaleBox(&areawin->save);
- if (fscale != 0.0) elementrescale(fscale);
+ XPoint newpoints[5];
+ fscale = UGetRescaleBox(&areawin->save, newpoints);
+ if (fscale != 0.) {
+ elementrescale(fscale);
+ areawin->redraw_needed = True;
+ }
}
eventmode = NORMAL_MODE;
break;
case(SELAREA_MODE):
- UDrawBox(areawin->origin, areawin->save);
+ selarea_mode_draw(xcDRAW_FINAL, NULL);
#ifdef TCL_WRAPPER
Tk_DeleteEventHandler(areawin->area, ButtonMotionMask |
@@ -5915,16 +5869,22 @@ void finish_op(int op, int x, int y)
ButtonMotionMask, False, (xcEventHandler)xlib_drag,
NULL);
#endif
+ areawin->panx = areawin->pany = 0;
if (op != XCF_Cancel)
panbutton((u_int) 5, (areawin->width >> 1) - (x - areawin->origin.x),
(areawin->height >> 1) - (y - areawin->origin.y), 0);
break;
+ default:
+ break;
}
/* Remove any selections */
if ((eventmode == SELAREA_MODE) || (eventmode == PAN_MODE)
|| (eventmode == MOVE_MODE))
+ {
eventmode = NORMAL_MODE;
+ areawin->redraw_needed = True;
+ }
else if (eventmode != MOVE_MODE && eventmode != EPATH_MODE &&
eventmode != EPOLY_MODE && eventmode != ARC_MODE &&
eventmode != EARC_MODE && eventmode != SPLINE_MODE &&
@@ -5939,10 +5899,6 @@ void finish_op(int op, int x, int y)
highlightnetlist(topobject, areawin->topinstance, 0);
XDefineCursor(dpy, areawin->window, DEFAULTCURSOR);
-
-#ifdef DOUBLEBUFFER
- drawarea(NULL, NULL, NULL);
-#endif
}
snap(x, y, &snappt);
@@ -5958,6 +5914,7 @@ void finish_op(int op, int x, int y)
void inst_op(genericptr editpart, int op, int x, int y)
{
+ UNUSED(editpart); UNUSED(op); UNUSED(x); UNUSED(y);
}
/*--------------------------------------------------------------*/
@@ -5968,9 +5925,8 @@ void path_op(genericptr editpart, int op, int x, int y)
{
polyptr newpoly;
splineptr newspline;
- genericptr *ggen;
Boolean donecycles = False;
- XPoint *refpt, *cptr;
+ UNUSED(x); UNUSED(y);
/* Don't allow point cycling in a multi-part edit. */
/* Allowing it is just confusing. Instead, we treat */
@@ -5988,16 +5944,13 @@ void path_op(genericptr editpart, int op, int x, int y)
if (op != XCF_Continue_Element) {
dotrack = False;
- UDrawPath(newpath, xobjs.pagelist[areawin->page]->wirewidth);
}
if (op == XCF_Continue_Element) {
nextpathcycle(newpath, 1);
patheditpush(newpath);
}
else if (op == XCF_Finish_Element) {
- SetFunction(dpy, areawin->gc, GXcopy);
- XTopSetForeground(newpath->color);
- UDrawPath(newpath, xobjs.pagelist[areawin->page]->wirewidth);
+ path_mode_draw(xcDRAW_FINAL, newpath);
incr_changes(topobject);
}
else { /* restore previous path from edit stack */
@@ -6019,18 +5972,17 @@ void path_op(genericptr editpart, int op, int x, int y)
if (areawin->editstack->parts > 0) {
dotrack = True;
nextpathcycle(newpath, 1);
+ path_mode_draw(xcDRAW_EDIT, newpath);
}
else {
XPoint warppt;
-
- XcSetFunction(GXcopy);
- XcTopSetForeground(newpath->color);
user_to_window(areawin->origin, &warppt);
warppointer(warppt.x, warppt.y);
+ path_mode_draw(xcDRAW_FINAL, newpath);
}
- UDrawPath(newpath, xobjs.pagelist[areawin->page]->wirewidth);
}
else {
+ path_mode_draw(xcDRAW_EMPTY, newpath);
topobject->parts--;
free_single((genericptr)newpath);
free(newpath);
@@ -6053,27 +6005,27 @@ void path_op(genericptr editpart, int op, int x, int y)
polyptr newbox;
newbox = (polyptr)editpart;
- UDrawPolygon(newbox, xobjs.pagelist[areawin->page]->wirewidth);
/* prevent length and/or width zero boxes */
if (newbox->points->x != (newbox->points + 2)->x && (newbox->points
+ 1)->y != (newbox->points + 3)->y) {
if (op != XCF_Cancel) {
- SetFunction(dpy, areawin->gc, GXcopy);
- XTopSetForeground(newbox->color);
- UDrawPolygon(newbox, xobjs.pagelist[areawin->page]->wirewidth);
+ poly_mode_draw(xcDRAW_FINAL, newbox);
incr_changes(topobject);
if (!nonnetwork(newbox)) invalidate_netlist(topobject);
register_for_undo(XCF_Box, UNDO_MORE, areawin->topinstance,
newbox);
}
else {
+ poly_mode_draw(xcDRAW_EMPTY, newbox);
free_single((genericptr)newbox);
free(newbox);
topobject->parts--;
+
}
}
else {
+ poly_mode_draw(xcDRAW_EMPTY, newbox);
free_single((genericptr)newbox);
free(newbox);
topobject->parts--;
@@ -6092,7 +6044,6 @@ void path_op(genericptr editpart, int op, int x, int y)
if (op != XCF_Continue_Element) {
dotrack = False;
- UDrawPolygon(newpoly, xobjs.pagelist[areawin->page]->wirewidth);
}
if (op == XCF_Continue_Element) {
@@ -6108,15 +6059,14 @@ void path_op(genericptr editpart, int op, int x, int y)
(newpoly->points[i].y != newpoly->points[i - 1].y))
break;
if (i == newpoly->number) {
+ poly_mode_draw(xcDRAW_EMPTY, newpoly);
/* Remove this polygon with the standard delete */
/* method (saves polygon on undo stack). */
newpoly->type |= REMOVE_TAG;
delete_tagged(areawin->topinstance);
}
else {
- SetFunction(dpy, areawin->gc, GXcopy);
- XTopSetForeground(newpoly->color);
- UDrawPolygon(newpoly, xobjs.pagelist[areawin->page]->wirewidth);
+ poly_mode_draw(xcDRAW_FINAL, newpoly);
if (!nonnetwork(newpoly)) invalidate_netlist(topobject);
incr_changes(topobject);
}
@@ -6141,16 +6091,17 @@ void path_op(genericptr editpart, int op, int x, int y)
if (areawin->editstack->parts > 0) {
dotrack = True;
nextpolycycle(&newpoly, -1);
+ poly_mode_draw(xcDRAW_EDIT, newpoly);
}
else {
- XcSetFunction(GXcopy);
XcTopSetForeground(newpoly->color);
user_to_window(areawin->origin, &warppt);
warppointer(warppt.x, warppt.y);
+ poly_mode_draw(xcDRAW_FINAL, newpoly);
}
- UDrawPolygon(newpoly, xobjs.pagelist[areawin->page]->wirewidth);
}
else {
+ poly_mode_draw(xcDRAW_EMPTY, newpoly);
topobject->parts--;
free(newpoly);
}
@@ -6177,8 +6128,6 @@ void path_op(genericptr editpart, int op, int x, int y)
if (op != XCF_Continue_Element) {
dotrack = False;
- UDrawArc(newarc, xobjs.pagelist[areawin->page]->wirewidth);
- UDrawXLine(areawin->save, newarc->position);
}
if (op == XCF_Continue_Element) {
@@ -6191,15 +6140,13 @@ void path_op(genericptr editpart, int op, int x, int y)
if (newarc->radius != 0 && newarc->yaxis != 0 &&
(newarc->angle1 != newarc->angle2)) {
- SetFunction(dpy, areawin->gc, GXcopy);
XTopSetForeground(newarc->color);
incr_changes(topobject);
if (eventmode == ARC_MODE) {
register_for_undo(XCF_Arc, UNDO_MORE, areawin->topinstance,
newarc);
}
- UDrawArc(newarc, xobjs.pagelist[areawin->page]->wirewidth);
-
+ arc_mode_draw(xcDRAW_FINAL, newarc);
}
else {
@@ -6208,6 +6155,7 @@ void path_op(genericptr editpart, int op, int x, int y)
/* never existed. If we were editing an arc, use the */
/* standard delete method (saves arc on undo stack). */
+ arc_mode_draw(xcDRAW_EMPTY, newarc);
if (eventmode == ARC_MODE) {
free_single((genericptr)newarc);
free(newarc);
@@ -6240,21 +6188,21 @@ void path_op(genericptr editpart, int op, int x, int y)
if (areawin->editstack->parts > 0) {
dotrack = True;
nextarccycle(&newarc, -1);
- UDrawXLine(areawin->save, newarc->position);
+ arc_mode_draw(xcDRAW_EDIT, newarc);
}
else {
- SetFunction(dpy, areawin->gc, GXcopy);
- XTopSetForeground(newarc->color);
if (eventmode != ARC_MODE) {
XPoint warppt;
user_to_window(areawin->origin, &warppt);
warppointer(warppt.x, warppt.y);
}
+ arc_mode_draw(xcDRAW_FINAL, newarc);
}
- UDrawArc(newarc, xobjs.pagelist[areawin->page]->wirewidth);
}
- else
+ else {
+ arc_mode_draw(xcDRAW_EMPTY, newarc);
topobject->parts--;
+ }
}
pwriteback(areawin->topinstance);
@@ -6275,7 +6223,6 @@ void path_op(genericptr editpart, int op, int x, int y)
newspline = (splineptr)editpart;
if (op != XCF_Continue_Element) {
- UDrawSpline(newspline, xobjs.pagelist[areawin->page]->wirewidth);
dotrack = False;
}
@@ -6298,14 +6245,12 @@ void path_op(genericptr editpart, int op, int x, int y)
newspline->ctrl[0].y != newspline->ctrl[1].y ||
newspline->ctrl[0].y != newspline->ctrl[2].y) {
if (op == XCF_Finish_Element) {
- SetFunction(dpy, areawin->gc, GXcopy);
- XTopSetForeground(newspline->color);
incr_changes(topobject);
if (eventmode == SPLINE_MODE) {
register_for_undo(XCF_Spline, UNDO_MORE, areawin->topinstance,
newspline);
}
- UDrawSpline(newspline, xobjs.pagelist[areawin->page]->wirewidth);
+ spline_mode_draw(xcDRAW_FINAL, newspline);
}
else { /* restore previous spline from edit stack */
free_single((genericptr)newspline);
@@ -6326,24 +6271,25 @@ void path_op(genericptr editpart, int op, int x, int y)
if (areawin->editstack->parts > 0) {
dotrack = True;
nextsplinecycle(&newspline, 1);
- UDrawSpline(newspline, xobjs.pagelist[areawin->page]->wirewidth);
+ spline_mode_draw(xcDRAW_EDIT, newspline);
}
else {
- SetFunction(dpy, areawin->gc, GXcopy);
- XTopSetForeground(newspline->color);
if (eventmode != SPLINE_MODE) {
XPoint warppt;
user_to_window(areawin->origin, &warppt);
warppointer(warppt.x, warppt.y);
}
- UDrawSpline(newspline, xobjs.pagelist[areawin->page]->wirewidth);
+ spline_mode_draw(xcDRAW_FINAL, newspline);
}
}
- else
+ else {
+ spline_mode_draw(xcDRAW_EMPTY, newspline);
topobject->parts--;
+ }
}
}
else {
+ spline_mode_draw(xcDRAW_EMPTY, newspline);
free_single((genericptr)newspline);
free(newspline);
topobject->parts--;
@@ -6369,17 +6315,11 @@ void path_op(genericptr editpart, int op, int x, int y)
/* then register the move for the remaining items. */
if (donecycles) {
- short *eselect, cycle, *sellist, *newsel, selects;
- Boolean fullmove = False;
+ short *eselect;
for (eselect = areawin->selectlist; eselect < areawin->selectlist +
- areawin->selects; eselect++) {
- cycle = checkcycle(SELTOGENERIC(eselect), 0);
- if (cycle < 0) {
- fullmove = True; /* At least 1 object moved */
- break;
- }
- }
+ areawin->selects; eselect++)
+ checkcycle(SELTOGENERIC(eselect), 0);
/* Remove all (remaining) cycles */
for (eselect = areawin->selectlist; eselect < areawin->selectlist +
@@ -6408,7 +6348,10 @@ void resizearea(xcWidget w, caddr_t clientdata, caddr_t calldata)
XEvent discard;
int savewidth = areawin->width, saveheight = areawin->height;
XCWindowData *thiswin;
+#ifndef HAVE_CAIRO
XGCValues values;
+#endif /* !HAVE_CAIRO */
+ UNUSED(w); UNUSED(clientdata); UNUSED(calldata);
if ((dpy != NULL) && xcIsRealized(areawin->area)) {
@@ -6428,11 +6371,19 @@ void resizearea(xcWidget w, caddr_t clientdata, caddr_t calldata)
if (thiswin->width > maxwidth) maxwidth = thiswin->width;
if (thiswin->height > maxheight) maxheight = thiswin->height;
}
-#ifdef DOUBLEBUFFER
+#if !defined(HAVE_CAIRO)
if (dbuf != (Pixmap)NULL) XFreePixmap(dpy, dbuf);
dbuf = XCreatePixmap(dpy, areawin->window, maxwidth, maxheight,
DefaultDepthOfScreen(xcScreen(w)));
#endif
+#ifdef HAVE_CAIRO
+ /* TODO: probably make this a generalized function call, which */
+ /* should be handled depending on the surface in the xtgui.c, */
+ /* xcwin32.c, etc. files. */
+ /* For now only support xlib surface */
+ cairo_xlib_surface_set_size(areawin->surface, areawin->width,
+ areawin->height);
+#else
if (areawin->clipmask != (Pixmap)NULL) XFreePixmap(dpy, areawin->clipmask);
areawin->clipmask = XCreatePixmap(dpy, areawin->window,
maxwidth, maxheight, 1);
@@ -6448,6 +6399,18 @@ void resizearea(xcWidget w, caddr_t clientdata, caddr_t calldata)
values.background = 0;
areawin->cmgc = XCreateGC(dpy, areawin->clipmask,
GCForeground | GCBackground, &values);
+#endif /* !HAVE_CAIRO */
+
+ /* Clear fixed_pixmap */
+ if (areawin->fixed_pixmap) {
+#ifdef HAVE_CAIRO
+ cairo_pattern_destroy(areawin->fixed_pixmap);
+ areawin->fixed_pixmap = NULL;
+#else /* !HAVE_CAIRO */
+ XFreePixmap(dpy, areawin->fixed_pixmap);
+ areawin->fixed_pixmap = (Pixmap) NULL;
+#endif /* !HAVE_CAIRO */
+ }
reset_gs();
@@ -6460,83 +6423,160 @@ void resizearea(xcWidget w, caddr_t clientdata, caddr_t calldata)
}
/* Flush all expose events from the buffer */
-
while (XCheckWindowEvent(dpy, areawin->window, ExposureMask, &discard) == True);
}
}
-/*--------------------------------------*/
-/* Draw the primary graphics window */
-/*--------------------------------------*/
+/*----------------------*/
+/* Draw the grids, etc. */
+/*----------------------*/
-void drawwindow(xcWidget w, caddr_t clientdata, caddr_t calldata)
+#ifndef HAVE_CAIRO
+void draw_grids(void)
{
- Window win, tmpwin;
float x, y, spc, spc2, i, j, fpart;
- /*short *selectobj; (jdk) */
- XPoint originpt;
- XEvent discard;
-#ifdef OPENGL
- GLsizei width, height;
+ float major_snapspace, spc3;
+
+ spc = xobjs.pagelist[areawin->page]->gridspace * areawin->vscale;
+ if (areawin->gridon && spc > 8) {
+ fpart = (float)(-areawin->pcorner.x)
+ / xobjs.pagelist[areawin->page]->gridspace;
+ x = xobjs.pagelist[areawin->page]->gridspace *
+ (fpart - (float)((int)fpart)) * areawin->vscale;
+ fpart = (float)(-areawin->pcorner.y)
+ / xobjs.pagelist[areawin->page]->gridspace;
+ y = xobjs.pagelist[areawin->page]->gridspace *
+ (fpart - (float)((int)fpart)) * areawin->vscale;
+
+ SetForeground(dpy, areawin->gc, GRIDCOLOR);
+ for (i = x; i < (float)areawin->width; i += spc)
+ DrawLine (dpy, areawin->window, areawin->gc, (int)(i + 0.5),
+ 0, (int)(i + 0.5), areawin->height);
+ for (j = (float)areawin->height - y; j > 0; j -= spc)
+ DrawLine (dpy, areawin->window, areawin->gc, 0, (int)(j - 0.5),
+ areawin->width, (int)(j - 0.5));
+ }
+
+ if (areawin->axeson) {
+ XPoint originpt, zeropt;
+ zeropt.x = zeropt.y = 0;
+ SetForeground(dpy, areawin->gc, AXESCOLOR);
+ user_to_window(zeropt, &originpt);
+ DrawLine(dpy, areawin->window, areawin->gc, originpt.x, 0,
+ originpt.x, areawin->height);
+ DrawLine(dpy, areawin->window, areawin->gc, 0, originpt.y,
+ areawin->width, originpt.y);
+ }
+
+ /* bounding box goes beneath everything except grid/axis lines */
+ UDrawBBox();
+
+ /* draw a little red dot at each snap-to point */
+
+ spc2 = xobjs.pagelist[areawin->page]->snapspace * areawin->vscale;
+ if (areawin->snapto && spc2 > 8) {
+ float x2, y2;
+
+ fpart = (float)(-areawin->pcorner.x)
+ / xobjs.pagelist[areawin->page]->snapspace;
+ x2 = xobjs.pagelist[areawin->page]->snapspace *
+ (fpart - (float)((int)fpart)) * areawin->vscale;
+ fpart = (float)(-areawin->pcorner.y)
+ / xobjs.pagelist[areawin->page]->snapspace;
+ y2 = xobjs.pagelist[areawin->page]->snapspace *
+ (fpart - (float)((int)fpart)) * areawin->vscale;
+
+#if defined(TCL_WRAPPER) && defined(XC_WIN32)
+ {
+ HDC hdc = CreateCompatibleDC(NULL);
+ SelectObject(hdc, Tk_GetHWND(areawin->window));
#endif
+ SetForeground(dpy, areawin->gc, SNAPCOLOR);
+ for (i = x2; i < areawin->width; i += spc2)
+ for (j = areawin->height - y2; j > 0; j -= spc2)
+#if defined(TCL_WRAPPER) && defined(XC_WIN32)
+ SetPixelV(hdc, (int)(i + 0.5), (int)(j - 0.05), areawin->gc->foreground);
+#endif
+ DrawPoint (dpy, areawin->window, areawin->gc, (int)(i + 0.5),
+ (int)(j - 0.5));
+#if defined(TCL_WRAPPER) && defined(XC_WIN32)
+ DeleteDC(hdc);
+ }
+#endif
+ };
+
+ /* Draw major snap points (code contributed by John Barry) */
+
+ major_snapspace = xobjs.pagelist[areawin->page]->gridspace * 20;
+ spc3 = major_snapspace * areawin->vscale;
+ if (spc > 4) {
+ fpart = (float)(-areawin->pcorner.x) / major_snapspace;
+ x = major_snapspace * (fpart - (float)((int)fpart)) * areawin->vscale;
+ fpart = (float)(-areawin->pcorner.y) / major_snapspace;
+ y = major_snapspace * (fpart - (float)((int)fpart)) * areawin->vscale;
+
+ SetForeground(dpy, areawin->gc, GRIDCOLOR);
+ for (i = x; i < (float)areawin->width; i += spc3) {
+ for (j = (float)areawin->height - y; j > 0; j -= spc3) {
+ XDrawArc(dpy, areawin->window, areawin->gc, (int)(i + 0.5) - 1,
+ (int)(j - 0.5) - 1, 2, 2, 0, 360*64);
+ }
+ }
+ }
- if (!xcIsRealized(areawin->area)) return;
-
- newmatrix();
-
-#ifdef OPENGL
- glXMakeCurrent(dpy, (GLXDrawable)areawin->window, grXcontext);
- glDrawBuffer(GL_BACK);
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
-
- width = (GLsizei)Tk_Width(areawin->area);
- height = (GLsizei)Tk_Height(areawin->area);
-
- glViewport((GLsizei)0, (GLsizei)0, width, height);
-
- /* Need to twiddle with these? */
- glScalef(1.0 / (float)(width >> 1), -1.0 / (float)(height >> 1), 1.0);
- glTranslated(-(width >> 1), -(height >> 1), 0);
-
- glClearColor(1.0, 1.0, 1.0, 0.0);
- glClear(GL_COLOR_BUFFER_BIT);
-
- glEnable(GL_BLEND);
- glEnable(GL_POINT_SMOOTH);
- glEnable(GL_LINE_SMOOTH);
- glEnable(GL_POLYGON_SMOOTH);
- glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
-
- XcSetFunction(GXcopy);
+ SetBackground(dpy, areawin->gc, BACKGROUND);
+}
+#endif /* !HAVE_CAIRO */
-#else
+/*------------------------------------------------------*/
+/* Draw fixed parts of the primary graphics window */
+/*------------------------------------------------------*/
- XcSetFunction(GXcopy);
+void draw_fixed(void)
+{
+ Boolean old_ongoing;
+#ifndef HAVE_CAIRO
+ Window old_window;
+#endif /* !HAVE_CAIRO */
-#ifdef DOUBLEBUFFER
- tmpwin = areawin->window;
- win = (Window)dbuf;
- areawin->window = win;
+ if (xobjs.suspend >= 0) return;
+ old_ongoing = areawin->redraw_ongoing;
+ areawin->redraw_ongoing = True;
+
+ /* Set drawing context to fixed_pixmap */
+#ifdef HAVE_CAIRO
+ cairo_identity_matrix(areawin->cr);
+ cairo_push_group(areawin->cr);
+#else /* HAVE_CAIRO */
+ old_window = areawin->window;
+ areawin->window = areawin->fixed_pixmap;
+#endif /* HAVE_CAIRO */
+
+ /* Clear background */
+#ifdef HAVE_CAIRO
+ if (xobjs.pagelist[areawin->page]->background.name != (char *)NULL) {
+#ifdef HAVE_GS
+ copybackground();
+#else /* HAVE_GS */
+ SetForeground(dpy, areawin->gc, BACKGROUND);
+ cairo_paint(areawin->cr);
+#endif /* HAVE_GS */
+ }
+ else {
+ SetForeground(dpy, areawin->gc, BACKGROUND);
+ cairo_paint(areawin->cr);
+ }
+#else /* HAVE_CAIRO */
if (xobjs.pagelist[areawin->page]->background.name == (char *)NULL
|| (copybackground() < 0)) {
- XSetForeground(dpy, areawin->gc, BACKGROUND);
- XFillRectangle(dpy, win, areawin->gc, 0, 0, areawin->width,
+ SetForeground(dpy, areawin->gc, BACKGROUND);
+ XFillRectangle(dpy, areawin->window, areawin->gc, 0, 0, areawin->width,
areawin->height);
}
-#else
-
- if (xobjs.pagelist[areawin->page]->background.name != (char *)NULL)
- copybackground();
- else
- XClearWindow(dpy, areawin->window);
-#endif
-
-#endif /* OPENGL */
-
- win = areawin->window;
-
SetThinLineAttributes(dpy, areawin->gc, 0, LineSolid, CapRound, JoinBevel);
+#endif /* !HAVE_CAIRO */
+
+ newmatrix();
/* draw GRIDCOLOR lines for grid; mark axes in AXESCOLOR */
@@ -6544,95 +6584,7 @@ void drawwindow(xcWidget w, caddr_t clientdata, caddr_t calldata)
&& eventmode != FONTCAT_MODE && eventmode != EFONTCAT_MODE
&& eventmode != CATMOVE_MODE && eventmode != CATTEXT_MODE) {
- float major_snapspace, spc3;
-
- spc = xobjs.pagelist[areawin->page]->gridspace * areawin->vscale;
- if (areawin->gridon && spc > 8) {
- fpart = (float)(-areawin->pcorner.x)
- / xobjs.pagelist[areawin->page]->gridspace;
- x = xobjs.pagelist[areawin->page]->gridspace *
- (fpart - (float)((int)fpart)) * areawin->vscale;
- fpart = (float)(-areawin->pcorner.y)
- / xobjs.pagelist[areawin->page]->gridspace;
- y = xobjs.pagelist[areawin->page]->gridspace *
- (fpart - (float)((int)fpart)) * areawin->vscale;
-
- SetForeground(dpy, areawin->gc, GRIDCOLOR);
- for (i = x; i < (float)areawin->width; i += spc)
- DrawLine (dpy, win, areawin->gc, (int)(i + 0.5),
- 0, (int)(i + 0.5), areawin->height);
- for (j = (float)areawin->height - y; j > 0; j -= spc)
- DrawLine (dpy, win, areawin->gc, 0, (int)(j - 0.5),
- areawin->width, (int)(j - 0.5));
- };
- if (areawin->axeson) {
- XPoint zeropt;
- zeropt.x = zeropt.y = 0;
- SetForeground(dpy, areawin->gc, AXESCOLOR);
- user_to_window(zeropt, &originpt);
- DrawLine (dpy, win, areawin->gc, originpt.x, 0,
- originpt.x, areawin->height);
- DrawLine (dpy, win, areawin->gc, 0, originpt.y,
- areawin->width, originpt.y);
- }
-
- /* bounding box goes beneath everything except grid/axis lines */
- UDrawBBox();
-
- /* draw a little red dot at each snap-to point */
-
- spc2 = xobjs.pagelist[areawin->page]->snapspace * areawin->vscale;
- if (areawin->snapto && spc2 > 8) {
- float x2, y2;
-
- fpart = (float)(-areawin->pcorner.x)
- / xobjs.pagelist[areawin->page]->snapspace;
- x2 = xobjs.pagelist[areawin->page]->snapspace *
- (fpart - (float)((int)fpart)) * areawin->vscale;
- fpart = (float)(-areawin->pcorner.y)
- / xobjs.pagelist[areawin->page]->snapspace;
- y2 = xobjs.pagelist[areawin->page]->snapspace *
- (fpart - (float)((int)fpart)) * areawin->vscale;
-
-#if defined(TCL_WRAPPER) && defined(XC_WIN32) && defined(DOUBLEBUFFER)
- {
- HDC hdc = CreateCompatibleDC(NULL);
- SelectObject(hdc, Tk_GetHWND(win));
-#endif
- SetForeground(dpy, areawin->gc, SNAPCOLOR);
- for (i = x2; i < areawin->width; i += spc2)
- for (j = areawin->height - y2; j > 0; j -= spc2)
-#if defined(TCL_WRAPPER) && defined(XC_WIN32) && defined(DOUBLEBUFFER)
- SetPixelV(hdc, (int)(i + 0.5), (int)(j - 0.05), areawin->gc->foreground);
-#endif
- DrawPoint (dpy, win, areawin->gc, (int)(i + 0.5),
- (int)(j - 0.5));
-#if defined(TCL_WRAPPER) && defined(XC_WIN32) && defined(DOUBLEBUFFER)
- DeleteDC(hdc);
- }
-#endif
- };
-
- /* Draw major snap points (code contributed by John Barry) */
-
- major_snapspace = xobjs.pagelist[areawin->page]->gridspace * 20;
- spc3 = major_snapspace * areawin->vscale;
- if (spc > 4) {
- fpart = (float)(-areawin->pcorner.x) / major_snapspace;
- x = major_snapspace * (fpart - (float)((int)fpart)) * areawin->vscale;
- fpart = (float)(-areawin->pcorner.y) / major_snapspace;
- y = major_snapspace * (fpart - (float)((int)fpart)) * areawin->vscale;
-
- SetForeground(dpy, areawin->gc, GRIDCOLOR);
- for (i = x; i < (float)areawin->width; i += spc3) {
- for (j = (float)areawin->height - y; j > 0; j -= spc3) {
- XDrawArc(dpy, win, areawin->gc, (int)(i + 0.5) - 1,
- (int)(j - 0.5) - 1, 2, 2, 0, 360*64);
- }
- }
- }
-
- SetBackground(dpy, areawin->gc, BACKGROUND);
+ draw_grids();
/* Determine the transformation matrix for the topmost object */
/* and draw the hierarchy above the current edit object (if */
@@ -6699,10 +6651,37 @@ void drawwindow(xcWidget w, caddr_t clientdata, caddr_t calldata)
xobjs.pagelist[areawin->page]->wirewidth, &areawin->hierstack);
if (areawin->hierstack) free_stack(&areawin->hierstack);
- /* draw the highlighted netlist, if any */
- if (checkvalid(topobject) != -1)
- if (topobject->highlight.netlist != NULL)
- highlightnetlist(topobject, areawin->topinstance, 1);
+#ifdef HAVE_CAIRO
+ if (areawin->fixed_pixmap)
+ cairo_pattern_destroy(areawin->fixed_pixmap);
+ areawin->fixed_pixmap = cairo_pop_group(areawin->cr);
+#else /* HAVE_CAIRO */
+ areawin->window = old_window;
+#endif /* HAVE_CAIRO */
+ areawin->redraw_ongoing = old_ongoing;
+}
+
+/*--------------------------------------*/
+/* Draw the primary graphics window */
+/*--------------------------------------*/
+
+void drawwindow(xcWidget w, caddr_t clientdata, caddr_t calldata)
+{
+ XEvent discard;
+ xcDrawType redrawtype = xcDRAW_EDIT;
+ UNUSED(w); UNUSED(clientdata); UNUSED(calldata);
+
+ if (!xcIsRealized(areawin->area)) return;
+ if (xobjs.suspend >= 0) return;
+
+#ifndef HAVE_CAIRO
+ /* Make sure a fixed pixmap exists */
+ if (!areawin->fixed_pixmap) {
+ areawin->fixed_pixmap = XCreatePixmap(dpy, areawin->window,
+ areawin->width, areawin->height,
+ DefaultDepthOfScreen(xcScreen(areawin->area)));
+ }
+#endif /* !HAVE_CAIRO */
/* Sanity check---specifically to track down an error */
if ((areawin->selects == 1) && *(areawin->selectlist) >= topobject->parts) {
@@ -6711,88 +6690,46 @@ void drawwindow(xcWidget w, caddr_t clientdata, caddr_t calldata)
unselect_all();
}
- /* draw selected elements in the SELECTION color */
- /* special case---single label partial text selected */
-
- if ((areawin->selects == 1) && SELECTTYPE(areawin->selectlist) == LABEL
- && areawin->textend > 0 && areawin->textpos > areawin->textend) {
- labelptr drawlabel = SELTOLABEL(areawin->selectlist);
- UDrawString(drawlabel, DOSUBSTRING, areawin->topinstance);
- }
- else {
- if (eventmode == NORMAL_MODE || eventmode == MOVE_MODE || eventmode == COPY_MODE
- || eventmode == SELAREA_MODE || eventmode == CATALOG_MODE)
- draw_all_selected();
- }
+ if (areawin->redraw_needed)
+ redrawtype = xcREDRAW_FORCED;
- /* fast copy of buffer */
-
-#ifdef OPENGL
- glXSwapBuffers(dpy, (GLXDrawable)areawin->window);
-
- /* Draw interactive elements into the front buffer */
- glDrawBuffer(GL_FRONT);
-
-#else
-#ifdef DOUBLEBUFFER
- areawin->window = tmpwin;
- SetFunction(dpy, areawin->gc, GXcopy);
- XCopyArea(dpy, dbuf, areawin->window, areawin->gc, 0, 0, areawin->width,
- areawin->height, 0, 0);
-#endif
-#endif /* OPENGL */
-
- /* draw pending elements, if any */
-
- if (eventmode != NORMAL_MODE) {
- SetFunction(dpy, areawin->gc, GXcopy);
- if (eventmode == TEXT_MODE || eventmode == ETEXT_MODE ||
- eventmode == CATTEXT_MODE) {
- labelptr newlabel = TOLABEL(EDITPART);
- UDrawTLine(newlabel);
- }
- else if (eventmode == SELAREA_MODE) {
- UDrawBox(areawin->origin, areawin->save);
- }
- else if (eventmode == RESCALE_MODE) {
- UDrawRescaleBox(&areawin->save);
- }
- else if (eventmode == BOX_MODE || eventmode == WIRE_MODE) {
- SetForeground(dpy, areawin->gc, BACKGROUND);
- UDrawPolygon(TOPOLY(ENDPART), xobjs.pagelist[areawin->page]->wirewidth);
- XcSetXORFg(areawin->color, BACKGROUND);
- XcSetFunction(GXxor);
- UDrawPolygon(TOPOLY(ENDPART), xobjs.pagelist[areawin->page]->wirewidth);
- }
- else if (eventmode == ARC_MODE) {
- SetForeground(dpy, areawin->gc, BACKGROUND);
- UDrawArc(TOARC(ENDPART), xobjs.pagelist[areawin->page]->wirewidth);
- XcSetXORFg(areawin->color, BACKGROUND);
- XcSetFunction(GXxor);
- UDrawArc(TOARC(ENDPART), xobjs.pagelist[areawin->page]->wirewidth);
- }
- else if (eventmode == SPLINE_MODE) {
- SetForeground(dpy, areawin->gc, BACKGROUND);
- UDrawSpline(TOSPLINE(ENDPART), xobjs.pagelist[areawin->page]->wirewidth);
- XcSetXORFg(areawin->color, BACKGROUND);
- XcSetFunction(GXxor);
- UDrawSpline(TOSPLINE(ENDPART), xobjs.pagelist[areawin->page]->wirewidth);
- }
- else if (eventmode == EPOLY_MODE || eventmode == EARC_MODE ||
- eventmode == ESPLINE_MODE || eventmode == EPATH_MODE) {
- XcSetXORFg(areawin->color, BACKGROUND);
- XcSetFunction(GXxor);
- }
+ switch (eventmode) {
+ case ARC_MODE: case EARC_MODE:
+ arc_mode_draw(redrawtype, TOARC(EDITPART));
+ break;
+ case SPLINE_MODE: case ESPLINE_MODE:
+ spline_mode_draw(redrawtype, TOSPLINE(EDITPART));
+ break;
+ case BOX_MODE: case EPOLY_MODE: case WIRE_MODE:
+ poly_mode_draw(redrawtype, TOPOLY(EDITPART));
+ break;
+ case EPATH_MODE:
+ path_mode_draw(redrawtype, TOPATH(EDITPART));
+ break;
+ case TEXT_MODE: case CATTEXT_MODE: case ETEXT_MODE:
+ text_mode_draw(redrawtype, TOLABEL(EDITPART));
+ break;
+ case SELAREA_MODE:
+ selarea_mode_draw(redrawtype, NULL);
+ break;
+ case RESCALE_MODE:
+ rescale_mode_draw(redrawtype, NULL);
+ break;
+ case CATMOVE_MODE: case MOVE_MODE: case COPY_MODE:
+ move_mode_draw(redrawtype, NULL);
+ break;
+ case ASSOC_MODE: case EINST_MODE: case FONTCAT_MODE: case EFONTCAT_MODE:
+ case PAN_MODE: case NORMAL_MODE: case UNDO_MODE: case CATALOG_MODE:
+ normal_mode_draw(redrawtype, NULL);
}
/* flush out multiple expose/resize events from the event queue */
-
- while (XCheckWindowEvent(dpy, areawin->window, ExposureMask, &discard) == True);
+ while (XCheckWindowEvent(dpy, areawin->window, ExposureMask, &discard));
/* end by restoring graphics state */
-
SetForeground(dpy, areawin->gc, areawin->gccolor);
- SetFunction(dpy, areawin->gc, areawin->gctype);
+
+ areawin->redraw_needed = False;
}
/*----------------------------------------------------------------------*/
@@ -6818,7 +6755,13 @@ void drawarea(xcWidget w, caddr_t clientdata, caddr_t calldata)
/* Note: need to check ancestry here, not just blindly redraw */
/* all the windows all the time. */
areawin = thiswin;
- drawwindow(NULL, NULL, NULL);
+
+#ifdef HAVE_CAIRO
+ /* Don't respond to an expose event if the graphics context */
+ /* has not yet been created. */
+ if (areawin->cr != NULL)
+#endif
+ drawwindow(NULL, NULL, NULL);
}
areawin = focuswin;
drawwindow(w, clientdata, calldata);
diff --git a/filelist.c b/filelist.c
index 62fd93c..1271f6f 100644
--- a/filelist.c
+++ b/filelist.c
@@ -76,7 +76,7 @@ extern Tcl_Interp *xcinterp;
extern Display *dpy;
extern XCWindowData *areawin;
extern ApplicationData appdata;
-extern int *appcolors;
+extern colorindex *colorlist;
extern short popups; /* total number of popup windows */
extern char _STR2[250];
extern char _STR[150];
@@ -149,7 +149,7 @@ void startfiletrack(xcWidget w, caddr_t clientdata, XCrossingEvent *event)
#endif
XSetFunction(dpy, areawin->gc, GXcopy);
- XSetForeground(dpy, areawin->gc, AUXCOLOR);
+ XSetForeground(dpy, areawin->gc, colorlist[AUXCOLOR].color.pixel);
XSetLineAttributes(dpy, areawin->gc, 1, LineSolid, CapRound, JoinMiter);
/* draw initial box */
@@ -158,7 +158,8 @@ void startfiletrack(xcWidget w, caddr_t clientdata, XCrossingEvent *event)
dragfilebox(w, NULL, (XMotionEvent *)event);
XSetFunction(dpy, areawin->gc, GXxor);
- XSetForeground(dpy, areawin->gc, AUXCOLOR ^ BACKGROUND);
+ XSetForeground(dpy, areawin->gc, colorlist[AUXCOLOR].color.pixel ^
+ colorlist[BACKGROUND].color.pixel);
}
/*-------------------------------------------------------------------------*/
@@ -182,8 +183,8 @@ void endfiletrack(xcWidget w, caddr_t clientdata, XCrossingEvent *event)
#endif
/* Restore graphics state values */
- XSetForeground(dpy, areawin->gc, areawin->gccolor);
- XSetFunction(dpy, areawin->gc, areawin->gctype);
+ XSetForeground(dpy, areawin->gc, colorlist[areawin->gccolor].color.pixel);
+ XSetFunction(dpy, areawin->gc, GXcopy);
}
#endif
@@ -232,10 +233,15 @@ void crashrecover()
if (xobjs.tempfile != NULL) {
unlink(xobjs.tempfile);
free(xobjs.tempfile);
+ xobjs.tempfile = NULL;
+ }
+ if (strlen(_STR2) == 0) {
+ Wprintf("Error: No temp file name for crash recovery!");
+ }
+ else {
+ xobjs.tempfile = strdup(_STR2);
+ startloadfile(-1);
}
- xobjs.tempfile = strdup(_STR2);
-
- startloadfile(-1);
}
/*----------------------------------------------------------------------*/
@@ -378,7 +384,7 @@ void listfiles(xcWidget w, popupstruct *okaystruct, caddr_t calldata)
filter = okaystruct->filter;
if (sgc == NULL) {
- values.foreground = FOREGROUND;
+ values.foreground = colorlist[FOREGROUND].color.pixel;
values.font = appdata.filefont->fid;
values.function = GXcopy;
values.graphics_exposures = False;
@@ -417,9 +423,9 @@ void listfiles(xcWidget w, popupstruct *okaystruct, caddr_t calldata)
/* print "Invalid Directory" to the file list window. */
if (cwd == NULL) {
- XSetForeground(dpy, sgc, BACKGROUND);
+ XSetForeground(dpy, sgc, colorlist[BACKGROUND].color.pixel);
XFillRectangle(dpy, lwin, sgc, 0, 0, textwidth, textheight);
- XSetForeground(dpy, sgc, AUXCOLOR);
+ XSetForeground(dpy, sgc, colorlist[AUXCOLOR].color.pixel);
XDrawString(dpy, lwin, sgc, 10, textheight / 2,
"(Invalid Directory)", 19);
return;
@@ -476,19 +482,19 @@ void listfiles(xcWidget w, popupstruct *okaystruct, caddr_t calldata)
/* Write the filenames onto the pixmap */
- XSetForeground(dpy, sgc, BACKGROUND);
+ XSetForeground(dpy, sgc, colorlist[BACKGROUND].color.pixel);
XFillRectangle(dpy, flistpix, sgc, 0, 0, textwidth, pixheight);
- XSetForeground(dpy, sgc, FOREGROUND);
+ XSetForeground(dpy, sgc, colorlist[FOREGROUND].color.pixel);
for (n = 0; n < flfiles; n++) {
switch (files[n].filetype) {
case DIRECTORY:
- XSetForeground(dpy, sgc, SELECTCOLOR);
+ XSetForeground(dpy, sgc, colorlist[SELECTCOLOR].color.pixel);
break;
case MATCH:
- XSetForeground(dpy, sgc, FILTERCOLOR);
+ XSetForeground(dpy, sgc, colorlist[FILTERCOLOR].color.pixel);
break;
case NONMATCH:
- XSetForeground(dpy, sgc, FOREGROUND);
+ XSetForeground(dpy, sgc, colorlist[FOREGROUND].color.pixel);
break;
}
XDrawString(dpy, flistpix, sgc, 10, 10 + FILECHARASCENT + n * FILECHARHEIGHT,
@@ -498,7 +504,7 @@ void listfiles(xcWidget w, popupstruct *okaystruct, caddr_t calldata)
/* Copy the pixmap of filenames into the file list window */
- XSetForeground(dpy, sgc, BACKGROUND);
+ XSetForeground(dpy, sgc, colorlist[BACKGROUND].color.pixel);
XFillRectangle(dpy, lwin, sgc, 0, 0, textwidth, textheight);
XCopyArea(dpy, flistpix, lwin, sgc, 0, flstart * FILECHARHEIGHT,
textwidth, textheight, 0, 0);
@@ -604,7 +610,7 @@ void fileselect(xcWidget w, popupstruct *okaystruct, XButtonEvent *event)
/* highlight the entry. . . */
- XSetForeground(dpy, sgc, AUXCOLOR);
+ XSetForeground(dpy, sgc, colorlist[AUXCOLOR].color.pixel);
XDrawString(dpy, flistpix, sgc, 10, 10 + FILECHARASCENT + filenum * FILECHARHEIGHT,
files[filenum].filename, strlen(files[filenum].filename));
XCopyArea(dpy, flistpix, lwin, sgc, 0, flstart * FILECHARHEIGHT,
@@ -709,7 +715,7 @@ void showlscroll(xcWidget w, caddr_t clientdata, caddr_t calldata)
pstart = (flstart * sheight) / flfiles;
pheight = (finscr * sheight) / flfiles;
- XSetForeground(dpy, sgc, BARCOLOR);
+ XSetForeground(dpy, sgc, colorlist[BARCOLOR].color.pixel);
XFillRectangle(dpy, swin, sgc, 0, pstart, swidth, pheight);
}
flcurrent = -1;
diff --git a/files.c b/files.c
index 900b032..5678ec7 100644
--- a/files.c
+++ b/files.c
@@ -75,7 +75,6 @@ extern XtAppContext app;
extern Display *dpy;
extern Window win;
extern short beeper;
-extern int *appcolors;
extern int number_colors;
extern colorindex *colorlist;
@@ -487,6 +486,7 @@ void initmem(objectptr localdata)
localdata->ports = NULL;
localdata->calls = NULL;
localdata->valid = False;
+ localdata->infolabels = False;
localdata->traversed = False;
}
@@ -564,7 +564,7 @@ Boolean compare_single(genericptr *compgen, genericptr *gchk)
TOLABEL(compgen)->position.y == TOLABEL(gchk)->position.y &&
TOLABEL(compgen)->rotation == TOLABEL(gchk)->rotation &&
TOLABEL(compgen)->scale == TOLABEL(gchk)->scale &&
- TOLABEL(compgen)->justify == TOLABEL(gchk)->justify &&
+ TOLABEL(compgen)->anchor == TOLABEL(gchk)->anchor &&
TOLABEL(compgen)->pin == TOLABEL(gchk)->pin &&
!stringcomp(TOLABEL(compgen)->string, TOLABEL(gchk)->string));
break;
@@ -826,6 +826,9 @@ void getfile(xcWidget button, pointertype mode, caddr_t nulldata)
#ifdef ASG
{importspice, "import", "spice"}, /* mode IMPORTSPICE */
#endif
+#ifdef HAVE_CAIRO
+ {importgraphic, "import", "ppm"}, /* mode IMPORTGRAPHIC */
+#endif
};
buttonsave *savebutton = NULL;
@@ -1317,7 +1320,7 @@ objinstptr new_library_instance(short mode, char *objname, char *buffer,
/* May declare instanced scale and rotation first */
lineptr = varfscan(localdata, lineptr, &newobjinst->scale,
(genericptr)newobjinst, P_SCALE);
- lineptr = varscan(localdata, lineptr, &newobjinst->rotation,
+ lineptr = varfscan(localdata, lineptr, &newobjinst->rotation,
(genericptr)newobjinst, P_ROTATION);
}
readparams(NULL, newobjinst, libobj, lineptr);
@@ -1887,6 +1890,36 @@ void importfile()
loadfile(1, -1);
}
+/*------------------------------------------------------*/
+/* Import an PPM graphic file onto the current page */
+/*------------------------------------------------------*/
+
+#ifdef HAVE_CAIRO
+void importgraphic(void)
+{
+ char inname[250];
+ FILE *spcfile;
+
+ if (eventmode == CATALOG_MODE) {
+ Wprintf("Cannot import a graphic while in the library window.");
+ return;
+ }
+
+ if (!nextfilename()) {
+ xc_tilde_expand(_STR, 149);
+ sscanf(_STR, "%149s", inname);
+ if (!new_graphic(NULL, inname, 0, 0)) {
+ Wprintf("Error: Graphic file not found.");
+ return;
+ }
+ }
+ else {
+ Wprintf("Error: No graphic file to read.");
+ return;
+ }
+}
+#endif /* HAVE_CAIRO */
+
/*--------------------------------------------------------------*/
/* Skip forward in the input file to the next comment line */
/*--------------------------------------------------------------*/
@@ -2273,9 +2306,9 @@ Boolean loadfile(short mode, int libnum)
#ifndef TCL_WRAPPER
setgridtype(teststr2);
#else
- if (strstr(teststr2, "inch"))
+ if (strstr(teststr2, "inch"))
Tcl_Eval(xcinterp, "xcircuit::coordstyle inches");
- else
+ else
Tcl_Eval(xcinterp, "xcircuit::coordstyle centimeters");
#endif
xobjs.pagelist[areawin->page]->outscale = tmpfl;
@@ -2669,15 +2702,8 @@ void readlabel(objectptr localdata, char *lineptr, stringpart **strhead)
int cval, cindex;
sscanf(segptr, "%f %f %f", &cr, &cg, &cb);
newpart->type = FONT_COLOR;
- cval = rgb_alloccolor((int)(cr * 65535), (int)(cg * 65535),
+ cindex = rgb_alloccolor((int)(cr * 65535), (int)(cg * 65535),
(int)(cb * 65535));
- for (cindex = 0; cindex < number_colors; cindex++)
- if (colorlist[cindex].color.pixel == cval)
- break;
- if (cindex == number_colors) {
- Wprintf("Error: Cannot allocate another color");
- cindex = DEFAULTCOLOR;
- }
newpart->data.color = cindex;
}
else if (!strcmp(cmdptr, "cf")) { /* change font or scale command */
@@ -2954,7 +2980,6 @@ void readparams(objectptr localdata, objinstptr newinst, objectptr libobj,
newops->which = P_COLOR;
newops->parameter.ivalue = rgb_alloccolor((int)(r * 65535),
(int)(g * 65535), (int)(b * 65535));
- addnewcolorentry(newops->parameter.ivalue);
*substrend = csave;
}
else {
@@ -3081,15 +3106,6 @@ char *varpscan(objectptr localdata, char *lineptr, short *hvalue,
if (sscanf(lineptr, "%hd", hvalue) != 1) {
parse_ps_string(lineptr, key, 99, FALSE, TRUE);
- /* This bit of a hack takes care of scale-variant */
- /* linewidth specifiers for object instances. */
-
- if (!strncmp(key, "/sv", 3)) {
- ((objinstptr)thiselem)->style &= ~LINE_INVARIANT;
- return varpscan(localdata, advancetoken(skipwhitespace(lineptr)),
- hvalue, thiselem, pointno, offset, which);
- }
-
ops = match_param(localdata, key);
newepp = make_new_eparam(key);
@@ -3149,6 +3165,16 @@ char *varfscan(objectptr localdata, char *lineptr, float *fvalue,
if (sscanf(lineptr, "%f", fvalue) != 1) {
parse_ps_string(lineptr, key, 99, FALSE, TRUE);
+
+ /* This bit of a hack takes care of scale-variant */
+ /* linewidth specifiers for object instances. */
+
+ if (!strncmp(key, "/sv", 3)) {
+ ((objinstptr)thiselem)->style &= ~LINE_INVARIANT;
+ return varfscan(localdata, advancetoken(skipwhitespace(lineptr)),
+ fvalue, thiselem, which);
+ }
+
ops = match_param(localdata, key);
newepp = make_new_eparam(key);
@@ -3161,7 +3187,7 @@ char *varfscan(objectptr localdata, char *lineptr, float *fvalue,
*fvalue = ops->parameter.fvalue;
}
else
- Fprintf(stderr, "Error: no parameter defined!\n");
+ Fprintf(stderr, "Error: no parameter \"%s\" defined!\n", key);
}
/* advance to next token */
@@ -3596,16 +3622,15 @@ void readimagedata(FILE *ps, int width, int height)
flatebuf = filtbuf;
- pixel.b[3] = 0;
q = 0;
- for (y = 0; y < height; y++) {
+ for (y = 0; y < height; y++)
for (x = 0; x < width; x++) {
- pixel.b[2] = flatebuf[q++];
- pixel.b[1] = flatebuf[q++];
- pixel.b[0] = flatebuf[q++];
- XPutPixel(iptr->image, x, y, pixel.i);
+ u_char r, g, b;
+ r = flatebuf[q++];
+ g = flatebuf[q++];
+ b = flatebuf[q++];
+ xcImagePutPixel(iptr->image, x, y, r, g, b);
}
- }
free(flatebuf);
@@ -3696,8 +3721,58 @@ Boolean objectread(FILE *ps, objectptr localdata, short offx, short offy,
}
}
if (lgen == localdata->plist + localdata->parts) {
+ char *cptr, *d1ptr, *d2ptr;
char *pch = textprint(plab->string, areawin->topinstance);
- Fprintf(stderr, "Warning: Unattached pin \"%s\" in "
+
+ /* Check for likely delimiters before applying warning */
+
+ if ((cptr = strchr(pch, ':')) != NULL) {
+ d1ptr = strchr(pch, '[');
+ d2ptr = strchr(pch, ']');
+ if (d1ptr != NULL && d2ptr != NULL &&
+ d1ptr < cptr && d2ptr > cptr) {
+ if (areawin->buschar != '[') {
+ areawin->buschar = '[';
+ Fprintf(stderr, "Warning: Bus character \'[\'"
+ " apparently used but not declared.\n");
+ }
+ }
+ d1ptr = strchr(pch, '{');
+ d2ptr = strchr(pch, '}');
+ if (d1ptr != NULL && d2ptr != NULL &&
+ d1ptr < cptr && d2ptr > cptr) {
+ if (areawin->buschar != '{') {
+ areawin->buschar = '{';
+ Fprintf(stderr, "Warning: Bus character \'{\'"
+ " apparently used in pin \"%s\""
+ " but not declared.\n", pch);
+ }
+ }
+ d1ptr = strchr(pch, '<');
+ d2ptr = strchr(pch, '>');
+ if (d1ptr != NULL && d2ptr != NULL &&
+ d1ptr < cptr && d2ptr > cptr) {
+ if (areawin->buschar != '<') {
+ areawin->buschar = '<';
+ Fprintf(stderr, "Warning: Bus character \'<\'"
+ " apparently used in pin \"%s\""
+ " but not declared.\n", pch);
+ }
+ }
+ d1ptr = strchr(pch, '(');
+ d2ptr = strchr(pch, ')');
+ if (d1ptr != NULL && d2ptr != NULL &&
+ d1ptr < cptr && d2ptr > cptr) {
+ if (areawin->buschar != '(') {
+ areawin->buschar = '(';
+ Fprintf(stderr, "Warning: Bus character \'(\'"
+ " apparently used in pin \"%s\""
+ " but not declared.\n", pch);
+ }
+ }
+ }
+ else
+ Fprintf(stderr, "Warning: Unattached pin \"%s\" in "
"symbol %s\n", pch,
localdata->symschem->name);
free(pch);
@@ -3716,7 +3791,6 @@ Boolean objectread(FILE *ps, objectptr localdata, short offx, short offy,
if (sscanf(buffer, "%f %f %f", &red, &green, &blue) == 3) {
curcolor = rgb_alloccolor((int)(red * 65535), (int)(green * 65535),
(int)(blue * 65535));
- addnewcolorentry(curcolor);
colorkey = NULL;
}
else {
@@ -4285,9 +4359,11 @@ Boolean objectread(FILE *ps, objectptr localdata, short offx, short offy,
NEW_GRAPHIC(newgp, localdata);
(*newgp)->color = curcolor;
(*newgp)->passed = NULL;
+#ifndef HAVE_CAIRO
(*newgp)->clipmask = (Pixmap)NULL;
(*newgp)->target = NULL;
(*newgp)->valid = False;
+#endif /* HAVE_CAIRO */
(*newgp)->source = img->image;
img->refcount++;
lineptr += strlen(img->filename) + 1;
@@ -4323,7 +4399,7 @@ Boolean objectread(FILE *ps, objectptr localdata, short offx, short offy,
if ((newgp != NULL) && (*newgp != NULL)) {
lineptr = varfscan(localdata, lineptr, &(*newgp)->scale,
(genericptr)*newgp, P_SCALE);
- lineptr = varscan(localdata, lineptr, &(*newgp)->rotation,
+ lineptr = varfscan(localdata, lineptr, &(*newgp)->rotation,
(genericptr)*newgp, P_ROTATION);
lineptr = varpscan(localdata, lineptr, &(*newgp)->position.x,
(genericptr)*newgp, 0, offx, P_POSITION_X);
@@ -4375,7 +4451,7 @@ Boolean objectread(FILE *ps, objectptr localdata, short offx, short offy,
}
/* no. segments is ignored---may be a derived quantity, anyway */
if (version < 2.25) {
- sscanf(lineptr, "%*s %hd %hd %hd %hd", &(*newlabel)->justify,
+ sscanf(lineptr, "%*s %hd %hf %hd %hd", &(*newlabel)->anchor,
&(*newlabel)->rotation, &(*newlabel)->position.x,
&(*newlabel)->position.y);
(*newlabel)->position.x -= offx; (*newlabel)->position.y -= offy;
@@ -4384,9 +4460,9 @@ Boolean objectread(FILE *ps, objectptr localdata, short offx, short offy,
else {
*lineptr++ = '\0';
lineptr = advancetoken(lineptr); /* skip string token */
- lineptr = varscan(localdata, lineptr, &(*newlabel)->justify,
- (genericptr)*newlabel, P_JUSTIFY);
- lineptr = varscan(localdata, lineptr, &(*newlabel)->rotation,
+ lineptr = varscan(localdata, lineptr, &(*newlabel)->anchor,
+ (genericptr)*newlabel, P_ANCHOR);
+ lineptr = varfscan(localdata, lineptr, &(*newlabel)->rotation,
(genericptr)*newlabel, P_ROTATION);
lineptr = varfscan(localdata, lineptr, &(*newlabel)->scale,
(genericptr)*newlabel, P_SCALE);
@@ -4397,7 +4473,7 @@ Boolean objectread(FILE *ps, objectptr localdata, short offx, short offy,
}
if (version < 2.4)
(*newlabel)->rotation = -(*newlabel)->rotation;
- while ((*newlabel)->rotation < 0) (*newlabel)->rotation += 360;
+ while ((*newlabel)->rotation < 0.0) (*newlabel)->rotation += 360.0;
(*newlabel)->pin = False;
if (strcmp(keyword, "label")) { /* all the schematic types */
@@ -4717,7 +4793,7 @@ Boolean objectread(FILE *ps, objectptr localdata, short offx, short offy,
}
if (!matchtech && ((*libobj)->name != objnamestart))
- if (version > 3.7)
+ if (version > 3.7)
continue; // no prefix in file must match
// null prefix in library object.
@@ -4746,7 +4822,7 @@ Boolean objectread(FILE *ps, objectptr localdata, short offx, short offy,
else
(*newinst)->style = LINE_INVARIANT;
- lineptr = varscan(localdata, lineptr, &(*newinst)->rotation,
+ lineptr = varfscan(localdata, lineptr, &(*newinst)->rotation,
(genericptr)*newinst, P_ROTATION);
lineptr = varpscan(localdata, lineptr, &(*newinst)->position.x,
(genericptr)*newinst, 0, offx, P_POSITION_X);
@@ -4757,15 +4833,17 @@ Boolean objectread(FILE *ps, objectptr localdata, short offx, short offy,
/* earlier. Later versions don't allow negative rotation */
if (version < 2.4) {
- if ((*newinst)->rotation < 0) {
+ if ((*newinst)->rotation < 0.0) {
(*newinst)->scale = -((*newinst)->scale);
- (*newinst)->rotation++;
+ (*newinst)->rotation += 1.0;
}
(*newinst)->rotation = -(*newinst)->rotation;
}
- while ((*newinst)->rotation > 360) (*newinst)->rotation -= 360;
- while ((*newinst)->rotation < 0) (*newinst)->rotation += 360;
+ while ((*newinst)->rotation > 360.0)
+ (*newinst)->rotation -= 360.0;
+ while ((*newinst)->rotation < 0.0)
+ (*newinst)->rotation += 360.0;
std_eparam((genericptr)(*newinst), colorkey);
@@ -5216,8 +5294,9 @@ void savetechnology(char *technology, char *outname)
&written, DEFAULTCOLOR);
}
else {
- if ((spec->thisinst->scale != 1.0) || (spec->thisinst->rotation != 0)) {
- fprintf(ps, "%3.3f %d ", spec->thisinst->scale,
+ if ((spec->thisinst->scale != 1.0) ||
+ (spec->thisinst->rotation != 0.0)) {
+ fprintf(ps, "%3.3f %3.3f ", spec->thisinst->scale,
spec->thisinst->rotation);
}
printparams(ps, spec->thisinst, 0);
@@ -5296,10 +5375,12 @@ void output_graphic_data(FILE *ps, short *glist)
u_long i;
u_char b[4];
} pixel;
+ int width = xcImageGetWidth(img->image);
+ int height = xcImageGetHeight(img->image);
if (glist[i] == 0) continue;
- fprintf(ps, "%%imagedata %d %d\n", img->image->width, img->image->height);
+ fprintf(ps, "%%imagedata %d %d\n", width, height);
fprintf(ps, "currentfile /ASCII85Decode filter ");
#ifdef HAVE_LIBZ
@@ -5311,19 +5392,18 @@ void output_graphic_data(FILE *ps, short *glist)
/* creating a stream buffer is wasteful if we're just using ASCII85 */
/* decoding but is a must for compression filters. */
- ilen = 3 * img->image->width * img->image->height;
+ ilen = 3 * width * height;
filtbuf = (u_char *)malloc(ilen + 4);
q = 0;
- for (j = 0; j < img->image->height; j++) {
- for (k = 0; k < img->image->width; k++) {
- pixel.i = XGetPixel(img->image, k, j);
- filtbuf[q++] = (u_char)pixel.b[2];
- filtbuf[q++] = (u_char)pixel.b[1];
- filtbuf[q++] = (u_char)pixel.b[0];
+
+ for (j = 0; j < height; j++)
+ for (k = 0; k < width; k++) {
+ unsigned char r, g, b;
+ xcImageGetPixel(img->image, k, j, &r, &g, &b);
+ filtbuf[q++] = r;
+ filtbuf[q++] = g;
+ filtbuf[q++] = b;
}
- }
- for (j = 0; j < 4; j++)
- filtbuf[q++] = 0;
/* Extra encoding goes here */
#ifdef HAVE_LIBZ
@@ -5336,6 +5416,7 @@ void output_graphic_data(FILE *ps, short *glist)
#endif
ascbuf[5] = '\0';
+ pixel.i = 0;
for (j = 0; j < ilen; j += 4) {
if ((j + 4) > ilen) lastpix = TRUE;
if (!lastpix && (flatebuf[j] + flatebuf[j + 1] + flatebuf[j + 2]
@@ -5382,11 +5463,11 @@ void output_graphic_data(FILE *ps, short *glist)
fprintf(ps, "/%sdata exch def\n", fptr);
fprintf(ps, "/%s <<\n", fptr);
fprintf(ps, " /ImageType 1 /Width %d /Height %d /BitsPerComponent 8\n",
- img->image->width, img->image->height);
+ width, height);
fprintf(ps, " /MultipleDataSources false\n");
fprintf(ps, " /Decode [0 1 0 1 0 1]\n");
fprintf(ps, " /ImageMatrix [1 0 0 -1 %d %d]\n",
- (img->image->width >> 1), (img->image->height >> 1));
+ width >> 1, height >> 1);
fprintf(ps, " /DataSource %sdata >> def\n\n", fptr);
}
}
@@ -5407,7 +5488,7 @@ void output_graphic_data(FILE *ps, short *glist)
void savefile(short mode)
{
- FILE *ps, *pro;
+ FILE *ps, *pro, *enc;
char outname[150], temp[150], prologue[150], *fname, *fptr, ascbuf[6];
/* u_char decodebuf[6]; (jdk */
short written, fontsused[256], i, page, curpage, multipage;
@@ -5570,10 +5651,80 @@ void savefile(short mode)
for(;;) {
if (fgets(temp, 149, pro) == NULL) break;
+ if (!strncmp(temp, "%%EndProlog", 11)) break;
fputs(temp, ps);
}
fclose(pro);
+ /* Special font encodings not known to PostScript */
+ /* (anything other than Standard and ISOLatin-1) */
+
+ for (findex = 0; findex < fontcount; findex++) {
+ if ((fontsused[findex] & 0xf80) == 0x400) {
+ /* Cyrillic (ISO8859-5) */
+ sprintf(prologue, "%s/%s", PROLOGUE_DIR, CYRILLIC_ENC_FILE);
+ pro = fopen(prologue, "r");
+ if (pro == NULL) {
+ sprintf(prologue, "%s", CYRILLIC_ENC_FILE);
+ pro = fopen(prologue, "r");
+ if (pro == NULL) {
+ Wprintf("Warning: Missing font encoding vectors.");
+ Wprintf("Output may not print properly.");
+ }
+ }
+ if (pro != NULL) {
+ for(;;) {
+ if (fgets(temp, 149, pro) == NULL) break;
+ fputs(temp, ps);
+ }
+ fclose(pro);
+ }
+ }
+ else if ((fontsused[findex] & 0xf80) == 0x180) {
+ /* Eastern European (ISOLatin2) */
+ sprintf(prologue, "%s/%s", PROLOGUE_DIR, ISOLATIN2_ENC_FILE);
+ pro = fopen(prologue, "r");
+ if (pro == NULL) {
+ sprintf(prologue, "%s", ISOLATIN2_ENC_FILE);
+ pro = fopen(prologue, "r");
+ if (pro == NULL) {
+ Wprintf("Warning: Missing font encoding vectors.");
+ Wprintf("Output may not print properly.");
+ }
+ }
+ if (pro != NULL) {
+ for(;;) {
+ if (fgets(temp, 149, pro) == NULL) break;
+ fputs(temp, ps);
+ }
+ fclose(pro);
+ }
+ }
+ else if ((fontsused[findex] & 0xf80) == 0x300) {
+ /* Turkish (ISOLatin5) */
+ sprintf(prologue, "%s/%s", PROLOGUE_DIR, ISOLATIN5_ENC_FILE);
+ pro = fopen(prologue, "r");
+ if (pro == NULL) {
+ sprintf(prologue, "%s", ISOLATIN5_ENC_FILE);
+ pro = fopen(prologue, "r");
+ if (pro == NULL) {
+ Wprintf("Warning: Missing font encoding vectors.");
+ Wprintf("Output may not print properly.");
+ }
+ }
+ if (pro != NULL) {
+ for(;;) {
+ if (fgets(temp, 149, pro) == NULL) break;
+ fputs(temp, ps);
+ }
+ fclose(pro);
+ }
+ }
+ }
+
+ /* Finish off prolog */
+ fputs("%%EndProlog\n", ps);
+
/* Special font handling */
for (findex = 0; findex < fontcount; findex++) {
@@ -5593,19 +5744,79 @@ void savefile(short mode)
for (i = 0; i < fontcount; i++) {
if (i == findex) continue;
if (!strcmp(fonts[i].family, fonts[findex].family) &&
- ((fonts[i].flags & 0x03) == (fonts[findex].flags & 0x03)))
+ ((fonts[i].flags & 0x03) == (fonts[findex].flags & 0x03))) {
fontorig = fonts[i].psname;
- if (fontorig == NULL) fontorig = fonts[findex].psname;
+ break;
+ }
}
+ if (fontorig == NULL) fontorig = fonts[findex].psname;
fprintf(ps, "/%s findfont dup length dict begin\n", fontorig);
fprintf(ps, "{1 index /FID ne {def} {pop pop} ifelse} forall\n");
fprintf(ps, "/Encoding ISOLatin1Encoding def currentdict end\n");
fprintf(ps, "/%s exch definefont pop\n\n", fonts[findex].psname);
}
- /* To do: ISO-Latin2 encoding */
+ /* Derived Cyrillic (ISO8859-5) encoding */
+
+ if ((fontsused[findex] & 0xf80) == 0x400) {
+ char *fontorig = NULL;
+ short i;
+ /* find the original standard-encoded font (can be itself) */
+ for (i = 0; i < fontcount; i++) {
+ if (i == findex) continue;
+ if (!strcmp(fonts[i].family, fonts[findex].family) &&
+ ((fonts[i].flags & 0x03) == (fonts[findex].flags & 0x03))) {
+ fontorig = fonts[i].psname;
+ break;
+ }
+ }
+ if (fontorig == NULL) fontorig = fonts[findex].psname;
+ fprintf(ps, "/%s findfont dup length dict begin\n", fontorig);
+ fprintf(ps, "{1 index /FID ne {def} {pop pop} ifelse} forall\n");
+ fprintf(ps, "/Encoding ISO8859_5Encoding def currentdict end\n");
+ fprintf(ps, "/%s exch definefont pop\n\n", fonts[findex].psname);
+ }
+
+ /* ISO-Latin2 encoding */
if ((fontsused[findex] & 0xf80) == 0x180) {
+ char *fontorig = NULL;
+ short i;
+ /* find the original standard-encoded font (can be itself) */
+ for (i = 0; i < fontcount; i++) {
+ if (i == findex) continue;
+ if (!strcmp(fonts[i].family, fonts[findex].family) &&
+ ((fonts[i].flags & 0x03) == (fonts[findex].flags & 0x03))) {
+ fontorig = fonts[i].psname;
+ break;
+ }
+ }
+ if (fontorig == NULL) fontorig = fonts[findex].psname;
+ fprintf(ps, "/%s findfont dup length dict begin\n", fontorig);
+ fprintf(ps, "{1 index /FID ne {def} {pop pop} ifelse} forall\n");
+ fprintf(ps, "/Encoding ISOLatin2Encoding def currentdict end\n");
+ fprintf(ps, "/%s exch definefont pop\n\n", fonts[findex].psname);
+ }
+
+ /* ISO-Latin5 encoding */
+
+ if ((fontsused[findex] & 0xf80) == 0x300) {
+ char *fontorig = NULL;
+ short i;
+ /* find the original standard-encoded font (can be itself) */
+ for (i = 0; i < fontcount; i++) {
+ if (i == findex) continue;
+ if (!strcmp(fonts[i].family, fonts[findex].family) &&
+ ((fonts[i].flags & 0x03) == (fonts[findex].flags & 0x03))) {
+ fontorig = fonts[i].psname;
+ break;
+ }
+ }
+ if (fontorig == NULL) fontorig = fonts[findex].psname;
+ fprintf(ps, "/%s findfont dup length dict begin\n", fontorig);
+ fprintf(ps, "{1 index /FID ne {def} {pop pop} ifelse} forall\n");
+ fprintf(ps, "/Encoding ISOLatin5Encoding def currentdict end\n");
+ fprintf(ps, "/%s exch definefont pop\n\n", fonts[findex].psname);
}
/* To do: Special encoding */
@@ -5731,15 +5942,13 @@ void savefile(short mode)
int printRGBvalues(char *tstr, int index, const char *postfix)
{
int i;
- for (i = 0; i < number_colors; i++) {
- if (colorlist[i].color.pixel == index) {
- sprintf(tstr, "%4.3f %4.3f %4.3f %s",
- (float)colorlist[i].color.red / 65535,
- (float)colorlist[i].color.green / 65535,
- (float)colorlist[i].color.blue / 65535,
- postfix);
- return 0;
- }
+ if (index >= 0 && index < number_colors) {
+ sprintf(tstr, "%4.3f %4.3f %4.3f %s",
+ (float)colorlist[index].color.red / 65535,
+ (float)colorlist[index].color.green / 65535,
+ (float)colorlist[index].color.blue / 65535,
+ postfix);
+ return 0;
}
/* The program can reach this point for any color which is */
@@ -5978,8 +6187,7 @@ char *writesegment(stringpart *chrptr, float *lastscale, int *lastfont, int *mar
if (chrptr->data.color == DEFAULTCOLOR)
strcat(_STR, "sce} ");
else
- if (printRGBvalues(_STR + 1,
- colorlist[chrptr->data.color].color.pixel, "scb} ") < 0)
+ if (printRGBvalues(_STR + 1, chrptr->data.color, "scb} ") < 0)
strcat(_STR, "sce} ");
break;
case MARGINSTOP:
@@ -6213,8 +6421,8 @@ short printparams(FILE *ps, objinstptr sinst, short stcount)
case XC_STRING:
segs = writelabelsegs(ps, &loccount, ops->parameter.string);
if (segs == 0) {
- /* When writing object parameters, we cannot allow a */
- /* NULL value. Instead, print an empty string (). */
+ /* When writing object parameters, we cannot allow a */
+ /* NULL value. Instead, print an empty string (). */
dostcount(ps, &stcount, 3);
fputs("() ", ps);
}
@@ -6518,7 +6726,7 @@ void printOneObject(FILE *ps, objectptr localdata, int ccolor)
sobj = TOOBJINST(savegen);
varfcheck(ps, sobj->scale, localdata, &stcount, *savegen, P_SCALE);
if (!(sobj->style & LINE_INVARIANT)) fprintf(ps, "/sv ");
- varcheck(ps, sobj->rotation, localdata, &stcount, *savegen, P_ROTATION);
+ varfcheck(ps, sobj->rotation, localdata, &stcount, *savegen, P_ROTATION);
xyvarcheck(sobj->position, 0, savegen);
opsubstitute(sobj->thisobject, sobj);
@@ -6552,7 +6760,7 @@ void printOneObject(FILE *ps, objectptr localdata, int ccolor)
stcount += (2 + strlen(fptr));
varfcheck(ps, sg->scale, localdata, &stcount, *savegen, P_SCALE);
- varcheck(ps, sg->rotation, localdata, &stcount, *savegen, P_ROTATION);
+ varfcheck(ps, sg->rotation, localdata, &stcount, *savegen, P_ROTATION);
xyvarcheck(sg->position, 0, savegen);
fprintf(ps, "graphic\n");
break;
@@ -6579,9 +6787,9 @@ void printOneObject(FILE *ps, objectptr localdata, int ccolor)
sprintf(_STR, "%hd ", segs);
dostcount(ps, &stcount, strlen(_STR));
fputs(_STR, ps);
- varcheck(ps, TOLABEL(savegen)->justify, localdata, &stcount,
- *savegen, P_JUSTIFY);
- varcheck(ps, TOLABEL(savegen)->rotation, localdata, &stcount,
+ varcheck(ps, TOLABEL(savegen)->anchor, localdata, &stcount,
+ *savegen, P_ANCHOR);
+ varfcheck(ps, TOLABEL(savegen)->rotation, localdata, &stcount,
*savegen, P_ROTATION);
varfcheck(ps, TOLABEL(savegen)->scale, localdata, &stcount,
*savegen, P_SCALE);
diff --git a/fontfile.c b/fontfile.c
index 19bf64a..5ff9a12 100644
--- a/fontfile.c
+++ b/fontfile.c
@@ -43,6 +43,10 @@ extern fontinfo *fonts;
extern Globaldata xobjs;
extern short beeper;
+#ifdef HAVE_CAIRO
+extern XCWindowData *areawin;
+extern const char *utf8encodings[][256];
+#endif
extern float version;
@@ -56,7 +60,7 @@ extern Tcl_Interp *xcinterp;
FILE *findfontfile(char *fontname)
{
- int i;
+ size_t i;
char tempname[256];
FILE *fd;
@@ -147,7 +151,7 @@ FILE *findfontfile(char *fontname)
/* other error occurred. */
/*----------------------------------------------------------------------*/
-int loadfontfile(char *fontname)
+int loadfontfile(char *fname)
{
FILE *fd;
char temp[250], commandstr[30], tempname[100];
@@ -159,11 +163,16 @@ int loadfontfile(char *fontname)
objectptr *j, *eptr;
objectptr *encoding = NULL;
float saveversion = version;
+ char *fontname = strdup(fname);
+#ifdef HAVE_CAIRO
+ const char **utf8enc = NULL;
+#endif /* HAVE_CAIRO */
/* check to see if font name is in list of fonts */
for (i = 0; i < fontcount; i++) {
if (!strcmp(fonts[i].psname, fontname)) {
+ free(fontname);
return 0;
}
}
@@ -188,6 +197,7 @@ int loadfontfile(char *fontname)
if (!strcmp(fonts[i].psname, tempname)) {
/* Fprintf(stdout, "Font already loaded.\n"); */
fclose(fd);
+ free(fontname);
return 0;
}
}
@@ -257,8 +267,9 @@ int loadfontfile(char *fontname)
sscanf(temp, "%*s %*s %99s", tempname);
tempname[0] = tolower(tempname[0]);
- if (!strcmp(tempname, "bold"))
+ if (!strcmp(tempname, "bold")) {
flags |= 0x1;
+ }
sscanf(temp, "%*s %*s %*s %99s", tempname);
tempname[0] = tolower(tempname[0]);
@@ -283,13 +294,20 @@ int loadfontfile(char *fontname)
fonts[fontcount].encoding = encoding; /* use original encoding */
fonts[fontcount].flags = flags;
fonts[fontcount].scale = fontscale;
+#ifdef HAVE_CAIRO
+ fonts[fontcount].utf8encoding = utf8enc;
+ xc_cairo_set_fontinfo(fontcount);
+#endif /* HAVE_CAIRO */
fontcount++;
}
}
else if (!strcmp(cmdptr, "encoding:")) {
+ #ifdef HAVE_CAIRO
+ const char *findencstr;
+ #endif /* HAVE_CAIRO */
sscanf(temp, "%*s %99s", tempname);
-
+
if (!strcmp(tempname, "special") || !strcmp(tempname, "Special")) {
flags |= 0x80;
#ifdef TCL_WRAPPER
@@ -298,10 +316,28 @@ int loadfontfile(char *fontname)
makenewencodingbutton("Special", (char)1);
#endif
}
+
+#ifdef HAVE_CAIRO
+ utf8enc = utf8encodings[0];
+ /* treat encoding of symbol font in a special way */
+ if (!strcmp(family, "Symbol"))
+ findencstr = "Symbol";
+ else
+ findencstr = tempname;
+
+ /* Now try to find the encoding, */
+ /* default to the first encoding (stdenc) if not found */
+ utf8enc = utf8encodings[0];
+ for (i = 0; utf8encodings[i][0]; i++)
+ if (!strcmp(utf8encodings[i][0], findencstr)) {
+ utf8enc = utf8encodings[i];
+ break;
+ }
+#endif /* HAVE_CAIRO */
/* ISO-LatinX encodings where X=1 to 6 */
- if (strstr(tempname, "ISO") != NULL) {
+ if (strstr(tempname, "Latin") != NULL) {
char estr[12];
for (i = 0; i < 6; i++) {
if (strchr(tempname, '1' + (char)i) != NULL) {
@@ -317,6 +353,19 @@ int loadfontfile(char *fontname)
}
}
}
+ /* i == 6 maps to ISO8859-5 */
+ if (strstr(tempname, "8859-5") != NULL) {
+#ifndef TCL_WRAPPER
+ char estr[12];
+#endif
+ flags |= ((6 + 2) << 7);
+#ifdef TCL_WRAPPER
+ XcInternalTagCall(xcinterp, 3, "label", "encoding", "ISO8859-5");
+#else
+ snprintf(estr, sizeof(estr), "ISO-8859-5");
+ makenewencodingbutton(estr, (char)8);
+#endif
+ }
/* Make space for the font encoding vector */
@@ -365,6 +414,10 @@ int loadfontfile(char *fontname)
fonts[fontcount].encoding = encoding;
fonts[fontcount].flags = flags;
fonts[fontcount].scale = fontscale;
+#ifdef HAVE_CAIRO
+ fonts[fontcount].utf8encoding = utf8enc;
+ xc_cairo_set_fontinfo(fontcount);
+#endif /* HAVE_CAIRO */
fontcount++;
/* Create a new menu button for the font family, if this is the first */
@@ -380,5 +433,6 @@ int loadfontfile(char *fontname)
}
}
fclose(fd);
+ free(fontname);
return 1;
}
diff --git a/formats.c b/formats.c
index 5c86c99..9b29a2b 100644
--- a/formats.c
+++ b/formats.c
@@ -44,7 +44,6 @@ extern char _STR[150];
extern Globaldata xobjs;
extern XCWindowData *areawin;
extern Display *dpy;
-extern int *appcolors;
/*----------------------------------------------*/
#ifdef LGF
@@ -236,7 +235,7 @@ void loadlgf(int mode)
NEW_LABEL(newlabel, topobject);
labeldefaults(*newlabel, False, xmat(pvalx), ymat(pvaly));
- (*newlabel)->justify = TOP | NOTBOTTOM;
+ (*newlabel)->anchor = TOP | NOTBOTTOM;
(*newlabel)->color = DEFAULTCOLOR;
(*newlabel)->string->data.font = 0;
strptr = makesegment(&((*newlabel)->string), NULL);
@@ -391,8 +390,10 @@ void loadlgf(int mode)
(*newinst)->passed = NULL;
if (pvalx2 & 0x01) pvalx2 ^= 0x02;
- if (pvalx2 >= 4) (*newinst)->rotation = -(((pvalx2 - 4) * 90) + 1);
- else (*newinst)->rotation = (pvalx2 * 90) + 1;
+ if (pvalx2 >= 4)
+ (*newinst)->rotation = (float)(-((pvalx2 - 4) * 90) + 1);
+ else
+ (*newinst)->rotation = (float)((pvalx2 * 90) + 1);
(*newinst)->thisobject = *libobj;
(*newinst)->bbox.lowerleft.x = (*libobj)->bbox.lowerleft.x;
(*newinst)->bbox.lowerleft.y = (*libobj)->bbox.lowerleft.y;
@@ -427,8 +428,8 @@ void loadlgf(int mode)
else
(*newlabel)->position.x += ((flip) ? 54 : -54);
- (*newlabel)->justify = NOTBOTTOM;
- if (flip) (*newlabel)->justify |= (RIGHT | NOTLEFT);
+ (*newlabel)->anchor = NOTBOTTOM;
+ if (flip) (*newlabel)->anchor |= (RIGHT | NOTLEFT);
(*newlabel)->string->data.font = 0;
strptr = makesegment(&((*newlabel)->string), NULL);
strptr->type = TEXT_STRING;
@@ -498,7 +499,7 @@ void loadlgf(int mode)
for (iolabel = topobject->plist; iolabel < topobject->plist +
topobject->parts; iolabel++)
if (IS_LABEL(*iolabel)) {
- if (TOLABEL(iolabel)->rotation == 500) {
+ if (TOLABEL(iolabel)->rotation == 500.0) {
genericptr *tmplabel;
free(TOLABEL(iolabel)->string);
@@ -630,7 +631,6 @@ void loadmat4(caddr_t nullval)
sscanf(bb + 1, "%f %f %f", &red, &green, &blue);
curcolor = rgb_alloccolor((int)(red * 65535), (int)(green * 65535),
(int)(blue * 65535));
- addnewcolorentry(curcolor);
}
if ((bb = strchr(buffer, '/')) != NULL) {
sscanf(bb, "%4s", &colorstr[matcolors]);
diff --git a/functions.c b/functions.c
index f13e971..7d61eef 100644
--- a/functions.c
+++ b/functions.c
@@ -42,7 +42,8 @@ extern Display *dpy;
extern Pixmap STIPPLE[8];
extern XCWindowData *areawin;
extern Globaldata xobjs;
-extern int *appcolors;
+extern int number_colors;
+extern colorindex *colorlist;
/*------------------------------------------------------------------------*/
/* find the squared length of a wire (or distance between two points in */
@@ -309,7 +310,7 @@ void calcspline(splineptr thespline)
/* Find the (x,y) position and tangent rotation of a point on a spline */
/*------------------------------------------------------------------------*/
-void findsplinepos(splineptr thespline, float t, XPoint *retpoint, int *retrot)
+void findsplinepos(splineptr thespline, float t, XPoint *retpoint, float *retrot)
{
float ax, bx, cx, ay, by, cy;
float tsq = t * t;
@@ -323,7 +324,7 @@ void findsplinepos(splineptr thespline, float t, XPoint *retpoint, int *retrot)
if (retrot != NULL) {
dxdt = (double)(3 * ax * tsq + 2 * bx * t + cx);
dydt = (double)(3 * ay * tsq + 2 * by * t + cy);
- *retrot = (int)(INVRFAC * atan2(dxdt, dydt)); /* reversed y, x */
+ *retrot = INVRFAC * atan2(dxdt, dydt); /* reversed y, x */
if (*retrot < 0) *retrot += 360;
}
}
@@ -635,10 +636,10 @@ void user_to_window(XPoint upt, XPoint *wpt)
/* Return rotation relative to a specific CTM */
/*----------------------------------------------------------------------*/
-int UGetCTMRotation(Matrix *ctm)
+float UGetCTMRotation(Matrix *ctm)
{
float rads = (float)atan2((double)(ctm->d), (double)(ctm->a));
- return (int)(rads / RADFAC);
+ return rads / RADFAC;
}
/*----------------------------------------------------------------------*/
@@ -648,7 +649,7 @@ int UGetCTMRotation(Matrix *ctm)
/* window. Thus, there is no routine UTopDrawingRotation(). */
/*----------------------------------------------------------------------*/
-int UTopRotation()
+float UTopRotation()
{
return UGetCTMRotation(DCTM);
}
@@ -835,6 +836,11 @@ void UResetCTM(Matrix *ctm)
ctm->a = ctm->e = 1;
ctm->b = ctm->d = 0;
ctm->c = ctm->f = 0; /* 0.5 for nearest-int real->int conversion? */
+
+#ifdef HAVE_CAIRO
+ if (ctm == DCTM && areawin->redraw_ongoing)
+ xc_cairo_set_matrix(ctm);
+#endif /* HAVE_CAIRO */
}
/*------------------------------------------------------------------------*/
@@ -854,6 +860,11 @@ void InvertCTM(Matrix *ctm)
ctm->e = tmpa / det;
ctm->c = tx / det;
ctm->f = ty / det;
+
+#ifdef HAVE_CAIRO
+ if (ctm == DCTM && areawin->redraw_ongoing)
+ xc_cairo_set_matrix(ctm);
+#endif /* HAVE_CAIRO */
}
/*------------------------------------------------------------------------*/
@@ -867,6 +878,11 @@ void UCopyCTM(fctm, tctm)
tctm->d = fctm->d;
tctm->e = fctm->e;
tctm->f = fctm->f;
+
+#ifdef HAVE_CAIRO
+ if (tctm == DCTM && areawin->redraw_ongoing)
+ xc_cairo_set_matrix(tctm);
+#endif /* HAVE_CAIRO */
}
/*-------------------------------------------------------------------------*/
@@ -878,17 +894,23 @@ void UMakeWCTM(Matrix *ctm)
{
ctm->a *= areawin->vscale;
ctm->b *= areawin->vscale;
- ctm->c = (ctm->c - (float)areawin->pcorner.x) * areawin->vscale;
+ ctm->c = (ctm->c - (float)areawin->pcorner.x) * areawin->vscale
+ + areawin->panx;
ctm->d *= -areawin->vscale;
ctm->e *= -areawin->vscale;
ctm->f = (float)areawin->height + ((float)areawin->pcorner.y - ctm->f) *
- areawin->vscale;
+ areawin->vscale + areawin->pany;
+
+#ifdef HAVE_CAIRO
+ if (ctm == DCTM && areawin->redraw_ongoing)
+ xc_cairo_set_matrix(ctm);
+#endif /* HAVE_CAIRO */
}
/*------------------------------------------------------------------------*/
-void UMultCTM(Matrix *ctm, XPoint position, float scale, short rotate)
+void UMultCTM(Matrix *ctm, XPoint position, float scale, float rotate)
{
float tmpa, tmpb, tmpd, tmpe, yscale;
float mata, matb, matc;
@@ -912,6 +934,11 @@ void UMultCTM(Matrix *ctm, XPoint position, float scale, short rotate)
ctm->a = mata;
ctm->b = matb;
ctm->c = matc;
+
+#ifdef HAVE_CAIRO
+ if (ctm == DCTM && areawin->redraw_ongoing)
+ xc_cairo_set_matrix(ctm);
+#endif /* HAVE_CAIRO */
}
/*----------------------------------------------------------------------*/
@@ -922,6 +949,11 @@ void USlantCTM(Matrix *ctm, float beta)
{
ctm->b += ctm->a * beta;
ctm->e += ctm->d * beta;
+
+#ifdef HAVE_CAIRO
+ if (ctm == DCTM && areawin->redraw_ongoing)
+ xc_cairo_set_matrix(ctm);
+#endif /* HAVE_CAIRO */
}
#define EPS 1e-9
@@ -950,34 +982,40 @@ void UPreScaleCTM(Matrix *ctm)
/* with the PostScript output due to roundoff error. This code */
/* matches what PostScript produces. */
+#ifdef HAVE_CAIRO
+ if (ctm == DCTM && areawin->redraw_ongoing)
+ xc_cairo_set_matrix(ctm);
+#endif /* HAVE_CAIRO */
}
/*----------------------------------------------------------------------*/
-/* Adjust justification and CTM as necessary for flip invariance */
+/* Adjust anchoring and CTM as necessary for flip invariance */
/*----------------------------------------------------------------------*/
-short flipadjust(short justify)
+short flipadjust(short anchor)
{
- short tmpjust = justify & (~FLIPINV);
+ short tmpanchor = anchor & (~FLIPINV);
- if (justify & FLIPINV) {
+ if (anchor & FLIPINV) {
if (((DCTM)->a < -EPS) || (((DCTM)->a < EPS) && ((DCTM)->a > -EPS) &&
(((DCTM)->d * (DCTM)->b) < 0))) {
- if ((tmpjust & (RIGHT | NOTLEFT)) != NOTLEFT)
- tmpjust ^= (RIGHT | NOTLEFT);
+ if ((tmpanchor & (RIGHT | NOTLEFT)) != NOTLEFT)
+ tmpanchor ^= (RIGHT | NOTLEFT);
+
+ /* NOTE: Justification does not change under flip invariance. */
}
if ((DCTM)->e > EPS) {
- if ((tmpjust & (TOP | NOTBOTTOM)) != NOTBOTTOM)
- tmpjust ^= (TOP | NOTBOTTOM);
+ if ((tmpanchor & (TOP | NOTBOTTOM)) != NOTBOTTOM)
+ tmpanchor ^= (TOP | NOTBOTTOM);
}
UPreScaleCTM(DCTM);
}
- return tmpjust;
+ return tmpanchor;
}
/*------------------------------------------------------------------------*/
-void UPreMultCTM(Matrix *ctm, XPoint position, float scale, short rotate)
+void UPreMultCTM(Matrix *ctm, XPoint position, float scale, float rotate)
{
float tmpa, tmpb, tmpd, tmpe, yscale;
float mata, matd;
@@ -1001,6 +1039,11 @@ void UPreMultCTM(Matrix *ctm, XPoint position, float scale, short rotate)
ctm->a = mata;
ctm->d = matd;
+
+#ifdef HAVE_CAIRO
+ if (ctm == DCTM && areawin->redraw_ongoing)
+ xc_cairo_set_matrix(ctm);
+#endif /* HAVE_CAIRO */
}
/*----------------------------------------------------------------------*/
@@ -1020,6 +1063,11 @@ void UPreMultCTMbyMat(Matrix *ctm, Matrix *pre)
ctm->f += pre->c * ctm->d + pre->f * ctm->e;
ctm->e = pre->b * ctm->d + pre->e * ctm->e;
ctm->d = matd;
+
+#ifdef HAVE_CAIRO
+ if (ctm == DCTM && areawin->redraw_ongoing)
+ xc_cairo_set_matrix(ctm);
+#endif /* HAVE_CAIRO */
}
/*------------------------------------------------------------------------*/
@@ -1071,6 +1119,10 @@ void UPopCTM()
lastmatrix = areawin->MatStack->nextmatrix;
free(areawin->MatStack);
areawin->MatStack = lastmatrix;
+
+#ifdef HAVE_CAIRO
+ xc_cairo_set_matrix(lastmatrix);
+#endif /* HAVE_CAIRO */
}
/*------------------------------------------------------------------------*/
@@ -1091,7 +1143,7 @@ void UPushCTM()
/*------------------------------------------------------------------------*/
void UTransformPoints(XPoint *points, XPoint *newpoints, short number,
- XPoint atpt, float scale, short rotate)
+ XPoint atpt, float scale, float rotate)
{
Matrix LCTM;
@@ -1105,7 +1157,7 @@ void UTransformPoints(XPoint *points, XPoint *newpoints, short number,
/*----------------------------------------------------*/
void InvTransformPoints(XPoint *points, XPoint *newpoints, short number,
- XPoint atpt, float scale, short rotate)
+ XPoint atpt, float scale, float rotate)
{
Matrix LCTM;
@@ -1287,13 +1339,13 @@ void labelbbox(labelptr labox, XPoint *npoints, objinstptr callinst)
TextExtents tmpext;
short j;
- tmpext = ULength(labox, callinst, 0, NULL);
- points[0].x = points[1].x = (labox->justify & NOTLEFT ?
- (labox->justify & RIGHT ? -tmpext.maxwidth :
+ tmpext = ULength(labox, callinst, NULL);
+ points[0].x = points[1].x = (labox->anchor & NOTLEFT ?
+ (labox->anchor & RIGHT ? -tmpext.maxwidth :
-tmpext.maxwidth / 2) : 0);
points[2].x = points[3].x = points[0].x + tmpext.maxwidth;
- points[0].y = points[3].y = (labox->justify & NOTBOTTOM ?
- (labox->justify & TOP ? -tmpext.ascent :
+ points[0].y = points[3].y = (labox->anchor & NOTBOTTOM ?
+ (labox->anchor & TOP ? -tmpext.ascent :
-(tmpext.ascent + tmpext.base) / 2) : -tmpext.base)
+ tmpext.descent;
points[1].y = points[2].y = points[0].y + tmpext.ascent - tmpext.descent;
@@ -1302,7 +1354,7 @@ void labelbbox(labelptr labox, XPoint *npoints, objinstptr callinst)
if (labox->pin)
for (j = 0; j < 4; j++)
- pinadjust(labox->justify, &points[j].x, &points[j].y, 1);
+ pinadjust(labox->anchor, &points[j].x, &points[j].y, 1);
UTransformPoints(points, npoints, 4, labox->position,
labox->scale, labox->rotation);
@@ -1315,8 +1367,8 @@ void labelbbox(labelptr labox, XPoint *npoints, objinstptr callinst)
void graphicbbox(graphicptr gp, XPoint *npoints)
{
XPoint points[4];
- int hw = gp->source->width >> 1;
- int hh = gp->source->height >> 1;
+ int hw = xcImageGetWidth(gp->source) >> 1;
+ int hh = xcImageGetHeight(gp->source) >> 1;
points[1].x = points[2].x = hw;
points[0].x = points[3].x = -hw;
@@ -1520,7 +1572,7 @@ void calcbboxinst(objinstptr thisinst)
if (IS_LABEL(*gelem)) {
labelptr btext = TOLABEL(gelem);
- if (btext->pin && !(btext->justify & PINVISIBLE)) {
+ if (btext->pin && !(btext->anchor & PINVISIBLE)) {
hasschembbox = TRUE;
calcbboxsingle(gelem, thisinst, &pllx, &plly, &purx, &pury);
continue;
@@ -1679,7 +1731,7 @@ void calcbboxvalues(objinstptr thisinst, genericptr *newelement)
if (IS_LABEL(*bboxgen)) {
labelptr btext = TOLABEL(bboxgen);
- if (btext->pin && !(btext->justify & PINVISIBLE)) {
+ if (btext->pin && !(btext->anchor & PINVISIBLE)) {
goto nextgen;
}
}
@@ -1766,7 +1818,7 @@ void centerview(objinstptr tinst)
/* Copy new position values to the current window */
- if (tobj == topobject) {
+ if ((areawin->topinstance != NULL) && (tobj == topobject)) {
areawin->pcorner = tobj->pcorner;
areawin->vscale = tobj->viewscale;
}
@@ -1778,6 +1830,7 @@ void centerview(objinstptr tinst)
void refresh(xcWidget bw, caddr_t clientdata, caddr_t calldata)
{
+ areawin->redraw_needed = True;
drawarea(NULL, NULL, NULL);
if (areawin->scrollbarh)
drawhbar(areawin->scrollbarh, NULL, NULL);
@@ -1797,7 +1850,8 @@ void zoomview(xcWidget w, caddr_t clientdata, caddr_t calldata)
eventmode == FONTCAT_MODE || eventmode == EFONTCAT_MODE ||
eventmode == CATMOVE_MODE) {
- centerview(areawin->topinstance);
+ if (areawin->topinstance)
+ centerview(areawin->topinstance);
areawin->lastbackground = NULL;
renderbackground();
refresh(NULL, NULL, NULL);
@@ -1808,26 +1862,40 @@ void zoomview(xcWidget w, caddr_t clientdata, caddr_t calldata)
/* Basic X Graphics Routines in the User coordinate system */
/*---------------------------------------------------------*/
+#ifndef HAVE_CAIRO
void UDrawSimpleLine(XPoint *pt1, XPoint *pt2)
{
XPoint newpt1, newpt2;
+ if (!areawin->redraw_ongoing) {
+ areawin->redraw_needed = True;
+ return;
+ }
+
UTransformbyCTM(DCTM, pt1, &newpt1, 1);
UTransformbyCTM(DCTM, pt2, &newpt2, 1);
DrawLine(dpy, areawin->window, areawin->gc,
newpt1.x, newpt1.y, newpt2.x, newpt2.y);
}
+#endif /* !HAVE_CAIRO */
/*-------------------------------------------------------------------------*/
+#ifndef HAVE_CAIRO
void UDrawLine(XPoint *pt1, XPoint *pt2)
{
float tmpwidth = UTopTransScale(xobjs.pagelist[areawin->page]->wirewidth);
+ if (!areawin->redraw_ongoing) {
+ areawin->redraw_needed = True;
+ return;
+ }
+
SetLineAttributes(dpy, areawin->gc, tmpwidth, LineSolid, CapRound, JoinBevel);
UDrawSimpleLine(pt1, pt2);
}
+#endif /* !HAVE_CAIRO */
/*----------------------------------------------------------------------*/
/* Add circle at given point to indicate that the point is a parameter. */
@@ -1843,10 +1911,16 @@ void UDrawLine(XPoint *pt1, XPoint *pt2)
/* negative = clockwise)). */
/*----------------------------------------------------------------------*/
+#ifndef HAVE_CAIRO
void UDrawCircle(XPoint *upt, u_char which)
{
XPoint wpt;
+ if (!areawin->redraw_ongoing) {
+ areawin->redraw_needed = True;
+ return;
+ }
+
user_to_window(*upt, &wpt);
SetThinLineAttributes(dpy, areawin->gc, 0, LineSolid, CapButt, JoinMiter);
@@ -1869,19 +1943,27 @@ void UDrawCircle(XPoint *upt, u_char which)
break;
}
}
+#endif /* !HAVE_CAIRO */
/*----------------------------------------------------------------------*/
/* Add "X" at string origin */
/*----------------------------------------------------------------------*/
+#ifndef HAVE_CAIRO
void UDrawXAt(XPoint *wpt)
{
+ if (!areawin->redraw_ongoing) {
+ areawin->redraw_needed = True;
+ return;
+ }
+
SetThinLineAttributes(dpy, areawin->gc, 0, LineSolid, CapButt, JoinMiter);
DrawLine(dpy, areawin->window, areawin->gc, wpt->x - 3,
wpt->y - 3, wpt->x + 3, wpt->y + 3);
DrawLine(dpy, areawin->window, areawin->gc, wpt->x + 3,
wpt->y - 3, wpt->x - 3, wpt->y + 3);
}
+#endif /* !HAVE_CAIRO */
/*----------------------------------------------------------------------*/
/* Draw "X" on current level */
@@ -1986,14 +2068,14 @@ void extendschembbox(objinstptr bbinst, XPoint *origin, XPoint *corner)
/* Adjust a pinlabel position to account for pad spacing */
/*----------------------------------------------------------------------*/
-void pinadjust (short justify, short *xpoint, short *ypoint, short dir)
+void pinadjust (short anchor, short *xpoint, short *ypoint, short dir)
{
int delx, dely;
- dely = (justify & NOTBOTTOM) ?
- ((justify & TOP) ? -PADSPACE : 0) : PADSPACE;
- delx = (justify & NOTLEFT) ?
- ((justify & RIGHT) ? -PADSPACE : 0) : PADSPACE;
+ dely = (anchor & NOTBOTTOM) ?
+ ((anchor & TOP) ? -PADSPACE : 0) : PADSPACE;
+ delx = (anchor & NOTLEFT) ?
+ ((anchor & RIGHT) ? -PADSPACE : 0) : PADSPACE;
if (xpoint != NULL) *xpoint += (dir > 0) ? delx : -delx;
if (ypoint != NULL) *ypoint += (dir > 0) ? dely : -dely;
@@ -2007,36 +2089,51 @@ void pinadjust (short justify, short *xpoint, short *ypoint, short dir)
void UDrawTextLine(labelptr curlabel, short tpos)
{
XPoint points[2]; /* top and bottom of text cursor line */
- short xdist, xbase, tmpjust;
+ short tmpanchor, xbase;
+ int maxwidth;
TextExtents tmpext;
+ TextLinesInfo tlinfo;
+
+ if (!areawin->redraw_ongoing) {
+ areawin->redraw_needed = True;
+ return;
+ }
/* correct for position, rotation, scale, and flip invariance of text */
UPushCTM();
UPreMultCTM(DCTM, curlabel->position, curlabel->scale, curlabel->rotation);
- tmpjust = flipadjust(curlabel->justify);
+ tmpanchor = flipadjust(curlabel->anchor);
- SetFunction(dpy, areawin->gc, GXxor);
- SetForeground(dpy, areawin->gc, AUXCOLOR ^ BACKGROUND);
+ SetForeground(dpy, areawin->gc, AUXCOLOR);
- tmpext = ULength(curlabel, areawin->topinstance, tpos, NULL);
- xdist = tmpext.width;
+ tlinfo.dostop = 0;
+ tlinfo.tbreak = NULL;
+ tlinfo.padding = NULL;
+
+ tmpext = ULength(curlabel, areawin->topinstance, &tlinfo);
+ maxwidth = tmpext.maxwidth;
xbase = tmpext.base;
- tmpext = ULength(curlabel, areawin->topinstance, 0, NULL);
-
- points[0].x = (tmpjust & NOTLEFT ?
- (tmpjust & RIGHT ? -tmpext.maxwidth : -tmpext.maxwidth >> 1) : 0)
- + xdist;
- points[0].y = (tmpjust & NOTBOTTOM ?
- (tmpjust & TOP ? -tmpext.ascent : -(tmpext.ascent + tmpext.base) / 2)
- : -tmpext.base) + xbase - 3;
+ tlinfo.dostop = tpos;
+ tmpext = ULength(curlabel, areawin->topinstance, &tlinfo);
+
+ points[0].x = (tmpanchor & NOTLEFT ?
+ (tmpanchor & RIGHT ? -maxwidth : -maxwidth >> 1) : 0) + tmpext.width;
+ if ((tmpanchor & JUSTIFYRIGHT) && tlinfo.padding)
+ points[0].x += tlinfo.padding[tlinfo.line];
+ else if ((tmpanchor & TEXTCENTERED) && tlinfo.padding)
+ points[0].x += 0.5 * tlinfo.padding[tlinfo.line];
+ points[0].y = (tmpanchor & NOTBOTTOM ?
+ (tmpanchor & TOP ? -tmpext.ascent : -(tmpext.ascent + xbase) / 2)
+ : -xbase) + tmpext.base - 3;
points[1].x = points[0].x;
points[1].y = points[0].y + TEXTHEIGHT + 6;
if (curlabel->pin) {
- pinadjust(tmpjust, &(points[0].x), &(points[0].y), 1);
- pinadjust(tmpjust, &(points[1].x), &(points[1].y), 1);
+ pinadjust(tmpanchor, &(points[0].x), &(points[0].y), 1);
+ pinadjust(tmpanchor, &(points[1].x), &(points[1].y), 1);
}
+ if (tlinfo.padding != NULL) free(tlinfo.padding);
/* draw the line */
@@ -2062,12 +2159,17 @@ void UDrawTLine(labelptr curlabel)
/* Draw an X */
/*----------------------*/
+#ifndef HAVE_CAIRO
void UDrawXLine(XPoint opt, XPoint cpt)
{
XPoint upt, vpt;
- SetForeground(dpy, areawin->gc, AUXCOLOR ^ BACKGROUND);
- SetFunction(dpy, areawin->gc, GXxor);
+ if (!areawin->redraw_ongoing) {
+ areawin->redraw_needed = True;
+ return;
+ }
+
+ SetForeground(dpy, areawin->gc, AUXCOLOR);
user_to_window(cpt, &upt);
user_to_window(opt, &vpt);
@@ -2081,23 +2183,27 @@ void UDrawXLine(XPoint opt, XPoint cpt)
DrawLine(dpy, areawin->window, areawin->gc, upt.x + 3, upt.y - 3,
upt.x - 3, upt.y + 3);
- SetFunction(dpy, areawin->gc, areawin->gctype);
SetForeground(dpy, areawin->gc, areawin->gccolor);
}
+#endif /* HAVE_CAIRO */
/*-------------------------------------------------------------------------*/
+#ifndef HAVE_CAIRO
void UDrawBox(XPoint origin, XPoint corner)
{
XPoint worig, wcorn;
+ if (!areawin->redraw_ongoing) {
+ areawin->redraw_needed = True;
+ return;
+ }
+
user_to_window(origin, &worig);
user_to_window(corner, &wcorn);
- SetFunction(dpy, areawin->gc, GXxor);
- SetForeground(dpy, areawin->gc, AUXCOLOR ^ BACKGROUND);
+ SetForeground(dpy, areawin->gc, AUXCOLOR);
SetThinLineAttributes(dpy, areawin->gc, 0, LineSolid, CapRound, JoinBevel);
-
DrawLine(dpy, areawin->window, areawin->gc, worig.x, worig.y,
worig.x, wcorn.y);
DrawLine(dpy, areawin->window, areawin->gc, worig.x, wcorn.y,
@@ -2107,15 +2213,15 @@ void UDrawBox(XPoint origin, XPoint corner)
DrawLine(dpy, areawin->window, areawin->gc, wcorn.x, worig.y,
worig.x, worig.y);
}
+#endif /* HAVE_CAIRO */
/*----------------------------------------------------------------------*/
-/* Draw a box indicating the dimensions of the edit element that most */
+/* Get a box indicating the dimensions of the edit element that most */
/* closely reach the position "corner". */
/*----------------------------------------------------------------------*/
-float UDrawRescaleBox(XPoint *corner)
+float UGetRescaleBox(XPoint *corner, XPoint *newpoints)
{
- XPoint origpoints[5], newpoints[5];
genericptr rgen;
float savescale, newscale;
long mindist, testdist, refdist;
@@ -2124,12 +2230,13 @@ float UDrawRescaleBox(XPoint *corner)
objinstptr rinst;
int i;
+ if (!areawin->redraw_ongoing) {
+ areawin->redraw_needed = True;
+ // return 0.0;
+ }
+
if (areawin->selects == 0) return 0.0;
- SetFunction(dpy, areawin->gc, GXxor);
- SetForeground(dpy, areawin->gc, AUXCOLOR ^ BACKGROUND);
- SetThinLineAttributes(dpy, areawin->gc, 0, LineSolid, CapRound, JoinBevel);
-
/* Use only the 1st selection as a reference to set the scale */
rgen = SELTOGENERIC(areawin->selectlist);
@@ -2232,18 +2339,51 @@ float UDrawRescaleBox(XPoint *corner)
break;
}
+ return newscale;
+}
+
+/*----------------------------------------------------------------------*/
+/* Draw a box indicating the dimensions of the edit element that most */
+/* closely reach the position "corner". */
+/*----------------------------------------------------------------------*/
+
+#ifndef HAVE_CAIRO
+void UDrawRescaleBox(XPoint *corner)
+{
+ XPoint origpoints[5], newpoints[5];
+
+ if (!areawin->redraw_ongoing) {
+ areawin->redraw_needed = True;
+ return;
+ }
+
+ if (areawin->selects == 0)
+ return;
+
+ UGetRescaleBox(corner, newpoints);
+
+ SetForeground(dpy, areawin->gc, AUXCOLOR);
+ SetThinLineAttributes(dpy, areawin->gc, 0, LineSolid, CapRound, JoinBevel);
+
UTransformbyCTM(DCTM, newpoints, origpoints, 4);
strokepath(origpoints, 4, 0, 1);
- return newscale;
}
+#endif /* HAVE_CAIRO */
/*-------------------------------------------------------------------------*/
+
+#ifndef HAVE_CAIRO
void UDrawBBox()
{
XPoint origin;
XPoint worig, wcorn, corner;
objinstptr bbinst = areawin->topinstance;
+ if (!areawin->redraw_ongoing) {
+ areawin->redraw_needed = True;
+ return;
+ }
+
if ((!areawin->bboxon) || (checkforbbox(topobject) != NULL)) return;
origin = bbinst->bbox.lowerleft;
@@ -2266,11 +2406,13 @@ void UDrawBBox()
DrawLine(dpy, areawin->window, areawin->gc, wcorn.x, worig.y,
worig.x, worig.y);
}
+#endif /* !HAVE_CAIRO */
/*----------------------------------------------------------------------*/
/* Fill and/or draw a border around the stroking path */
/*----------------------------------------------------------------------*/
+#ifndef HAVE_CAIRO
void strokepath(XPoint *pathlist, short number, short style, float width)
{
float tmpwidth;
@@ -2365,6 +2507,7 @@ void strokepath(XPoint *pathlist, short number, short style, float width)
}
}
}
+#endif /* !HAVE_CAIRO */
/*-------------------------------------------------------------------------*/
@@ -2379,53 +2522,68 @@ void makesplinepath(splineptr thespline, XPoint *pathlist)
/*-------------------------------------------------------------------------*/
+#ifndef HAVE_CAIRO
void UDrawSpline(splineptr thespline, float passwidth)
{
XPoint tmppoints[SPLINESEGS];
float scaledwidth;
+ if (!areawin->redraw_ongoing) {
+ areawin->redraw_needed = True;
+ return;
+ }
+
scaledwidth = thespline->width * passwidth;
makesplinepath(thespline, tmppoints);
strokepath(tmppoints, SPLINESEGS, thespline->style, scaledwidth);
- if (thespline->cycle != NULL) {
- UDrawXLine(thespline->ctrl[0], thespline->ctrl[1]);
- UDrawXLine(thespline->ctrl[3], thespline->ctrl[2]);
- }
}
+#endif /* HAVE_CAIRO */
/*-------------------------------------------------------------------------*/
+#ifndef HAVE_CAIRO
void UDrawPolygon(polyptr thepoly, float passwidth)
{
XPoint *tmppoints = (pointlist) malloc(thepoly->number * sizeof(XPoint));
float scaledwidth;
+ if (!areawin->redraw_ongoing) {
+ areawin->redraw_needed = True;
+ return;
+ }
+
scaledwidth = thepoly->width * passwidth;
UTransformbyCTM(DCTM, thepoly->points, tmppoints, thepoly->number);
strokepath(tmppoints, thepoly->number, thepoly->style, scaledwidth);
free(tmppoints);
}
+#endif /* HAVE_CAIRO */
/*-------------------------------------------------------------------------*/
+#ifndef HAVE_CAIRO
void UDrawArc(arcptr thearc, float passwidth)
{
XPoint tmppoints[RSTEPS + 2];
float scaledwidth;
+ if (!areawin->redraw_ongoing) {
+ areawin->redraw_needed = True;
+ return;
+ }
+
scaledwidth = thearc->width * passwidth;
UfTransformbyCTM(DCTM, thearc->points, tmppoints, thearc->number);
strokepath(tmppoints, thearc->number, thearc->style, scaledwidth);
- if (thearc->cycle != NULL) {
- UDrawXLine(thearc->position, areawin->save);
- }
}
+#endif /* HAVE_CAIRO */
/*-------------------------------------------------------------------------*/
+#ifndef HAVE_CAIRO
void UDrawPath(pathptr thepath, float passwidth)
{
XPoint *tmppoints = (pointlist) malloc(sizeof(XPoint));
@@ -2434,22 +2592,10 @@ void UDrawPath(pathptr thepath, float passwidth)
splineptr thespline;
int pathsegs = 0, curseg = 0;
float scaledwidth;
- Boolean draweditlines = FALSE;
- /* First pass---check for any splines that are being edited. If */
- /* any one is, then draw all control points for all splines in the */
- /* path. */
-
- for (genpath = thepath->plist; genpath < thepath->plist + thepath->parts;
- genpath++) {
- switch(ELEMENTTYPE(*genpath)) {
- case SPLINE:
- thespline = TOSPLINE(genpath);
- if (thespline->cycle != NULL)
- draweditlines = TRUE;
- break;
- }
- if (draweditlines) break;
+ if (!areawin->redraw_ongoing) {
+ areawin->redraw_needed = True;
+ return;
}
for (genpath = thepath->plist; genpath < thepath->plist + thepath->parts;
@@ -2468,11 +2614,6 @@ void UDrawPath(pathptr thepath, float passwidth)
tmppoints = (pointlist) realloc(tmppoints, pathsegs * sizeof(XPoint));
makesplinepath(thespline, tmppoints + curseg);
curseg = pathsegs;
-
- if (draweditlines) {
- UDrawXLine(thespline->ctrl[0], thespline->ctrl[1]);
- UDrawXLine(thespline->ctrl[3], thespline->ctrl[2]);
- }
break;
}
}
@@ -2481,6 +2622,7 @@ void UDrawPath(pathptr thepath, float passwidth)
strokepath(tmppoints, pathsegs, thepath->style, scaledwidth);
free(tmppoints);
}
+#endif /* HAVE_CAIRO */
/*----------------------------------------------------------------------*/
/* Main recursive object instance drawing routine. */
@@ -2492,6 +2634,7 @@ void UDrawPath(pathptr thepath, float passwidth)
/* stack contains graphics context information */
/*----------------------------------------------------------------------*/
+#ifndef HAVE_CAIRO
void UDrawObject(objinstptr theinstance, short level, int passcolor,
float passwidth, pushlistptr *stack)
{
@@ -2505,6 +2648,11 @@ void UDrawObject(objinstptr theinstance, short level, int passcolor,
u_char xm, ym;
objectptr theobject = theinstance->thisobject;
+ if (!areawin->redraw_ongoing) {
+ areawin->redraw_needed = True;
+ return;
+ }
+
/* Save the number of selections and set it to zero while we do the */
/* object drawing. */
@@ -2631,9 +2779,9 @@ void UDrawObject(objinstptr theinstance, short level, int passcolor,
case(LABEL):
if (level == 0 || TOLABEL(areagen)->pin == False)
UDrawString(TOLABEL(areagen), curcolor, theinstance);
- else if ((TOLABEL(areagen)->justify & PINVISIBLE) && areawin->pinpointon)
+ else if ((TOLABEL(areagen)->anchor & PINVISIBLE) && areawin->pinpointon)
UDrawString(TOLABEL(areagen), curcolor, theinstance);
- else if (TOLABEL(areagen)->justify & PINVISIBLE)
+ else if (TOLABEL(areagen)->anchor & PINVISIBLE)
UDrawStringNoX(TOLABEL(areagen), curcolor, theinstance);
else if (level == 1 && TOLABEL(areagen)->pin &&
TOLABEL(areagen)->pin != INFO && areawin->pinpointon)
@@ -2692,6 +2840,7 @@ void UDrawObject(objinstptr theinstance, short level, int passcolor,
pop_stack(stack);
}
}
+#endif /* HAVE_CAIRO */
/*----------------------------------------------------------------------*/
/* Recursively run through the current page and find any labels which */
@@ -2710,7 +2859,7 @@ void UDoLatex(objinstptr theinstance, short level, FILE *f,
genericptr *areagen;
objectptr theobject = theinstance->thisobject;
char *ltext;
- int lrjust, tbjust;
+ int lranchor, tbanchor;
UPushCTM();
if (level != 0)
@@ -2733,8 +2882,8 @@ void UDoLatex(objinstptr theinstance, short level, FILE *f,
case(LABEL):
thislabel = TOLABEL(areagen);
if (level == 0 || thislabel->pin == False ||
- (thislabel->justify & PINVISIBLE))
- if (thislabel->justify & LATEXLABEL) {
+ (thislabel->anchor & PINVISIBLE))
+ if (thislabel->anchor & LATEXLABEL) {
if (checkonly) {
*checkonly = TRUE;
return;
@@ -2756,8 +2905,8 @@ void UDoLatex(objinstptr theinstance, short level, FILE *f,
xfpos.x /= scale2;
xfpos.y /= scale2;
ltext = textprinttex(thislabel->string, theinstance);
- tbjust = thislabel->justify & (NOTBOTTOM | TOP);
- lrjust = thislabel->justify & (NOTLEFT | RIGHT);
+ tbanchor = thislabel->anchor & (NOTBOTTOM | TOP);
+ lranchor = thislabel->anchor & (NOTLEFT | RIGHT);
/* The 1.2 factor accounts for the difference between */
/* Xcircuit's label scale of "1" and LaTeX's "normalsize" */
@@ -2766,13 +2915,13 @@ void UDoLatex(objinstptr theinstance, short level, FILE *f,
xfpos.x, xfpos.y, 1.2 * thislabel->scale);
if (thislabel->rotation != 0)
fprintf(f, "\\rotatebox{-%d}{", thislabel->rotation);
- if (lrjust == (NOTLEFT | RIGHT)) fprintf(f, "\\rightbox{");
- else if (lrjust == NOTLEFT) fprintf(f, "\\centbox{");
- if (tbjust == (NOTBOTTOM | TOP)) fprintf(f, "\\topbox{");
- else if (tbjust == NOTBOTTOM) fprintf(f, "\\midbox{");
+ if (lranchor == (NOTLEFT | RIGHT)) fprintf(f, "\\rightbox{");
+ else if (lranchor == NOTLEFT) fprintf(f, "\\centbox{");
+ if (tbanchor == (NOTBOTTOM | TOP)) fprintf(f, "\\topbox{");
+ else if (tbanchor == NOTBOTTOM) fprintf(f, "\\midbox{");
fprintf(f, "%s", ltext);
- if (lrjust != NORMAL) fprintf(f, "}");
- if (tbjust != NORMAL) fprintf(f, "}");
+ if (lranchor != NORMAL) fprintf(f, "}");
+ if (tbanchor != NORMAL) fprintf(f, "}");
if (thislabel->rotation != 0) fprintf(f, "}");
fprintf(f, "}%%\n");
free(ltext);
diff --git a/graphic.c b/graphic.c
index 38c54a3..76f4c65 100644
--- a/graphic.c
+++ b/graphic.c
@@ -17,11 +17,6 @@
#include <X11/StringDefs.h>
#endif
-#ifdef OPENGL
-#include <GL/gl.h>
-#include <GL/glx.h>
-#endif /* OPENGL */
-
#ifdef TCL_WRAPPER
#include <tk.h>
#endif
@@ -110,12 +105,13 @@ short *collect_graphics(short *pagelist)
/* Otherwise, return TRUE. */
/*----------------------------------------------------------------------*/
+#ifndef HAVE_CAIRO
Boolean transform_graphic(graphicptr gp)
{
- int width, height, twidth, theight, rotation;
- float scale, tscale;
+ int width, height, twidth, theight;
+ float scale, tscale, rotation, crot;
double cosr, sinr;
- int x, y, c, s, hw, hh, thw, thh, xorig, yorig, crot, xc, yc;
+ int x, y, c, s, hw, hh, thw, thh, xor