wxedid-0.0.32/0000755000175000017500000000000014723073436010072 500000000000000wxedid-0.0.32/INSTALL0000644000175000017500000000355414722720160011042 00000000000000wxEDID - Extended Display Identification Data editor ********************* * Required Packages * ********************* Debian-based distros: To compile the program, the libwxgtkX.X-dev package is required. (where X.X is the wxWidgets version) The libwxgtkX.X-dev package has quite a lot of additional dependencies, which are normally installed automatically with the libwxgtkX.X After compilation the libwxgtkX.X-dev and related packages can be safely removed. *************** * Compilation * *************** To compile the program use the following commands: > cd > configure > make > make install Full list of additional options for compilation process can be shown by invoking: > configure --help NOTE#1: Since rcode v1.x the program sources have to be preprocessed using rcd_autogen script. The rcd_autogen requires bash v4.4+, what shouldn't be a problem *unless* You're using some very old distribution. In such situation, it's still possible to compile the program: > configure the source tree using distro with bash v4.4+ (f.e. in a VM) The rcd_autogen will generate additional source files needed for the compilation. Copy the configured (pre-processed) project directory to the target system and run: > configure --enable-rcdgen-mode=skip > make > make install The above procedure allows also to re-package the project and re-distribute it without rcd_autogen script (of course in such case the files generated by rcd_autogen have to be included) NOTE#2: > make clean this deletes all the files generated by rcd_autogen, so after issuing "make clean", trying to rebuild with make command will fail. You have to run 'configure' again or directly the rcd_autogen script with appropriate arguments -> this will regenerate necessary files. In case if You encounter any problems please contact me via e-mail: tomasz.pawlak@wp.eu wxedid-0.0.32/Makefile.in0000644000175000017500000006327214722720160012061 00000000000000# Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } 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@ pkglibexecdir = $(libexecdir)/@PACKAGE@ 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 = : bin_PROGRAMS = wxedid$(EXEEXT) subdir = . ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/build_switch.m4 \ $(top_srcdir)/m4/rcd_autoconf.m4 $(top_srcdir)/m4/wxwin.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \ $(am__configure_deps) $(am__DIST_COMMON) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno config.status.lineno mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/src/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(bindir)" PROGRAMS = $(bin_PROGRAMS) am__dirstamp = $(am__leading_dot)dirstamp am_wxedid_OBJECTS = src/wxEDID_App.$(OBJEXT) src/wxEDID.$(OBJEXT) \ src/EDID_main.$(OBJEXT) src/EDID_base.$(OBJEXT) \ src/EDID_dsc.$(OBJEXT) src/CEA.$(OBJEXT) src/CEA_ET.$(OBJEXT) \ src/grpar.$(OBJEXT) src/vid_fmt.$(OBJEXT) src/vmap.$(OBJEXT) \ src/guilog.$(OBJEXT) nodist_wxedid_OBJECTS = src/wxedid_rcd_scope.$(OBJEXT) wxedid_OBJECTS = $(am_wxedid_OBJECTS) $(nodist_wxedid_OBJECTS) wxedid_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 = depcomp = am__maybe_remake_depfiles = CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) AM_V_CXX = $(am__v_CXX_@AM_V@) am__v_CXX_ = $(am__v_CXX_@AM_DEFAULT_V@) am__v_CXX_0 = @echo " CXX " $@; am__v_CXX_1 = CXXLD = $(CXX) CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ -o $@ AM_V_CXXLD = $(am__v_CXXLD_@AM_V@) am__v_CXXLD_ = $(am__v_CXXLD_@AM_DEFAULT_V@) am__v_CXXLD_0 = @echo " CXXLD " $@; am__v_CXXLD_1 = 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 = $(wxedid_SOURCES) $(nodist_wxedid_SOURCES) DIST_SOURCES = $(wxedid_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac 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)` AM_RECURSIVE_TARGETS = cscope am__DIST_COMMON = $(srcdir)/Makefile.in \ $(top_srcdir)/build-aux/install-sh \ $(top_srcdir)/build-aux/missing $(top_srcdir)/src/config.h.in \ AUTHORS COPYING ChangeLog INSTALL README \ build-aux/config.guess build-aux/config.sub \ build-aux/install-sh build-aux/ltmain.sh build-aux/missing DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) am__remove_distdir = \ if test -d "$(distdir)"; then \ find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ && rm -rf "$(distdir)" \ || { sleep 5 && rm -rf "$(distdir)"; }; \ else :; fi am__post_remove_distdir = $(am__remove_distdir) DIST_ARCHIVES = $(distdir).tar.gz GZIP_ENV = --best DIST_TARGETS = dist-gzip # Exists only to be overridden by the user if desired. AM_DISTCHECK_DVI_TARGET = dvi distuninstallcheck_listfiles = find . -type f -print am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CPPFLAGS = @CPPFLAGS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CXX = @CXX@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ WX_CFLAGS = @WX_CFLAGS@ WX_CFLAGS_ONLY = @WX_CFLAGS_ONLY@ WX_CONFIG_PATH = @WX_CONFIG_PATH@ WX_CPPFLAGS = @WX_CPPFLAGS@ WX_CXXFLAGS = @WX_CXXFLAGS@ WX_CXXFLAGS_ONLY = @WX_CXXFLAGS_ONLY@ WX_LIBS = @WX_LIBS@ WX_LIBS_STATIC = @WX_LIBS_STATIC@ WX_RESCOMP = @WX_RESCOMP@ WX_VERSION = @WX_VERSION@ WX_VERSION_MAJOR = @WX_VERSION_MAJOR@ WX_VERSION_MICRO = @WX_VERSION_MICRO@ WX_VERSION_MINOR = @WX_VERSION_MINOR@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CXX = @ac_ct_CXX@ ac_have_bash = @ac_have_bash@ ac_lang_cflags = @ac_lang_cflags@ am__leading_dot = @am__leading_dot@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build_alias = @build_alias@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host_alias = @host_alias@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ ACLOCAL_AMFLAGS = -I m4 AM_CPPFLAGS = @ac_lang_cflags@ wxedid_LDADD = @LIBS@ wxedid_SOURCES = \ src/wxEDID_App.cpp \ src/wxEDID.cpp \ src/EDID_main.cpp \ src/EDID_base.cpp \ src/EDID_dsc.cpp \ src/CEA.cpp \ src/CEA_ET.cpp \ src/grpar.cpp \ src/vid_fmt.cpp \ src/vmap.cpp \ src/guilog.cpp \ src/wxEDID_App.h \ src/wxEDID.h \ src/EDID.h \ src/EDID_shared.h \ src/EDID_class.h \ src/CEA_class.h \ src/CEA_ET_class.h \ src/CEA.h \ src/CEA_ET.h \ src/grpar.h \ src/id_flags.h \ src/vmap.h \ src/guilog.h \ src/rcdunits.h \ src/def_types.h \ src/debug.h #files generated by rcd_autogen nodist_wxedid_SOURCES = \ src/wxedid_rcd_scope.cpp \ src/wxedid_rcd_scope.h EXTRA_DIST = build-aux m4 man src/rcode src/wxedid.rcdgen_cfg \ cb_project/wxEDID.cbp cb_project/wxsmith all: all-am .SUFFIXES: .SUFFIXES: .cpp .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 --ignore-deps'; \ $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign --ignore-deps \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign --ignore-deps Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign --ignore-deps 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__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles);; \ 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): src/config.h: src/stamp-h1 @test -f $@ || rm -f src/stamp-h1 @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) src/stamp-h1 src/stamp-h1: $(top_srcdir)/src/config.h.in $(top_builddir)/config.status @rm -f src/stamp-h1 cd $(top_builddir) && $(SHELL) ./config.status src/config.h $(top_srcdir)/src/config.h.in: $(am__configure_deps) ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) rm -f src/stamp-h1 touch $@ distclean-hdr: -rm -f src/config.h src/stamp-h1 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) src/$(am__dirstamp): @$(MKDIR_P) src @: > src/$(am__dirstamp) src/wxEDID_App.$(OBJEXT): src/$(am__dirstamp) src/wxEDID.$(OBJEXT): src/$(am__dirstamp) src/EDID_main.$(OBJEXT): src/$(am__dirstamp) src/EDID_base.$(OBJEXT): src/$(am__dirstamp) src/EDID_dsc.$(OBJEXT): src/$(am__dirstamp) src/CEA.$(OBJEXT): src/$(am__dirstamp) src/CEA_ET.$(OBJEXT): src/$(am__dirstamp) src/grpar.$(OBJEXT): src/$(am__dirstamp) src/vid_fmt.$(OBJEXT): src/$(am__dirstamp) src/vmap.$(OBJEXT): src/$(am__dirstamp) src/guilog.$(OBJEXT): src/$(am__dirstamp) src/wxedid_rcd_scope.$(OBJEXT): src/$(am__dirstamp) wxedid$(EXEEXT): $(wxedid_OBJECTS) $(wxedid_DEPENDENCIES) $(EXTRA_wxedid_DEPENDENCIES) @rm -f wxedid$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(wxedid_OBJECTS) $(wxedid_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) -rm -f src/*.$(OBJEXT) distclean-compile: -rm -f *.tab.c .cpp.o: $(AM_V_CXX)$(CXXCOMPILE) -c -o $@ $< .cpp.obj: $(AM_V_CXX)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(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-am 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-am 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 distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) $(am__remove_distdir) test -d "$(distdir)" || mkdir "$(distdir)" @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 -test -n "$(am__skip_mode_fix)" \ || find "$(distdir)" -type d ! -perm -755 \ -exec chmod u+rwx,go+rx {} \; -o \ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ || chmod -R a+r "$(distdir)" dist-gzip: distdir tardir=$(distdir) && $(am__tar) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).tar.gz $(am__post_remove_distdir) dist-bzip2: distdir tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 $(am__post_remove_distdir) dist-lzip: distdir tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz $(am__post_remove_distdir) dist-xz: distdir tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz $(am__post_remove_distdir) dist-zstd: distdir tardir=$(distdir) && $(am__tar) | zstd -c $${ZSTD_CLEVEL-$${ZSTD_OPT--19}} >$(distdir).tar.zst $(am__post_remove_distdir) dist-tarZ: distdir @echo WARNING: "Support for distribution archives compressed with" \ "legacy program 'compress' is deprecated." >&2 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__post_remove_distdir) dist-shar: distdir @echo WARNING: "Support for shar distribution archives is" \ "deprecated." >&2 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 shar $(distdir) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).shar.gz $(am__post_remove_distdir) dist-zip: distdir -rm -f $(distdir).zip zip -rq $(distdir).zip $(distdir) $(am__post_remove_distdir) dist dist-all: $(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:' $(am__post_remove_distdir) # This target untars the dist file and tries a VPATH configuration. Then # it guarantees that the distribution is self-contained by making another # tarfile. distcheck: dist case '$(DIST_ARCHIVES)' in \ *.tar.gz*) \ eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ *.tar.lz*) \ lzip -dc $(distdir).tar.lz | $(am__untar) ;;\ *.tar.xz*) \ xz -dc $(distdir).tar.xz | $(am__untar) ;;\ *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ *.tar.zst*) \ zstd -dc $(distdir).tar.zst | $(am__untar) ;;\ esac chmod -R a-w $(distdir) chmod u+w $(distdir) mkdir $(distdir)/_build $(distdir)/_build/sub $(distdir)/_inst chmod a-w $(distdir) test -d $(distdir)/_build || exit 0; \ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && am__cwd=`pwd` \ && $(am__cd) $(distdir)/_build/sub \ && ../../configure \ $(AM_DISTCHECK_CONFIGURE_FLAGS) \ $(DISTCHECK_CONFIGURE_FLAGS) \ --srcdir=../.. --prefix="$$dc_install_base" \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) $(AM_DISTCHECK_DVI_TARGET) \ && $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ && $(MAKE) $(AM_MAKEFLAGS) uninstall \ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ distuninstallcheck \ && chmod -R a-w "$$dc_install_base" \ && ({ \ (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ } || { rm -rf "$$dc_destdir"; exit 1; }) \ && rm -rf "$$dc_destdir" \ && $(MAKE) $(AM_MAKEFLAGS) dist \ && rm -rf $(DIST_ARCHIVES) \ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ && cd "$$am__cwd" \ || exit 1 $(am__post_remove_distdir) @(echo "$(distdir) archives ready for distribution: "; \ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' distuninstallcheck: @test -n '$(distuninstallcheck_dir)' || { \ echo 'ERROR: trying to run $@ with an empty' \ '$$(distuninstallcheck_dir)' >&2; \ exit 1; \ }; \ $(am__cd) '$(distuninstallcheck_dir)' || { \ echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \ exit 1; \ }; \ test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left after uninstall:" ; \ if test -n "$(DESTDIR)"; then \ echo " (check DESTDIR support)"; \ fi ; \ $(distuninstallcheck_listfiles) ; \ exit 1; } >&2 distcleancheck: distclean @if test '$(srcdir)' = . ; then \ echo "ERROR: distcleancheck can only run from a VPATH build" ; \ exit 1 ; \ fi @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left in build directory after distclean:" ; \ $(distcleancheck_listfiles) ; \ exit 1; } >&2 check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) installdirs: for dir in "$(DESTDIR)$(bindir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: 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) -rm -f src/$(am__dirstamp) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-binPROGRAMS clean-generic mostlyclean-am distclean-am: clean-am distclean-compile distclean-generic \ distclean-hdr distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-binPROGRAMS install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -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-am mostlyclean-am: mostlyclean-compile mostlyclean-generic pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am am--refresh check check-am clean \ clean-binPROGRAMS clean-cscope clean-generic cscope \ cscopelist-am ctags ctags-am dist dist-all dist-bzip2 \ dist-gzip dist-lzip dist-shar dist-tarZ dist-xz dist-zip \ dist-zstd distcheck distclean distclean-compile \ distclean-generic distclean-hdr distclean-tags distcleancheck \ distdir distuninstallcheck dvi dvi-am html html-am info \ info-am install install-am install-binPROGRAMS 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 maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic pdf pdf-am ps ps-am tags tags-am uninstall \ uninstall-am uninstall-binPROGRAMS .PRECIOUS: Makefile distclean: rm -f src/*_rcd_scope.* # 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: wxedid-0.0.32/src/0000755000175000017500000000000014723073436010661 500000000000000wxedid-0.0.32/src/CEA.cpp0000644000175000017500000017545314722720160011704 00000000000000/*************************************************************** * Name: CEA.cpp * Purpose: EDID CEA-861 extension * Author: Tomasz Pawlak (tomasz.pawlak@wp.eu) * Copyright: Tomasz Pawlak (C) 2014-2024 * License: GPLv3+ **************************************************************/ #include "debug.h" #include "rcdunits.h" #ifndef idCEA #error "CEA.cpp: missing unit ID" #endif #define RCD_UNIT idCEA #include "rcode/rcode.h" #include "wxedid_rcd_scope.h" RCD_AUTOGEN_DEFINE_UNIT #include #include "CEA.h" #include "CEA_class.h" #include "vmap.h" //VDB: Video Data Block : video modes extern sm_vmap SVD_vidfmt_map; //CHD: CEA Header const char cea_hdr_cl::CodN[] = "CHD"; const char cea_hdr_cl::Name[] = "CEA-861 header"; const char cea_hdr_cl::Desc[] = "CEA/CTA-861 header"; const edi_field_t cea_hdr_cl::fields[] = { {&EDID_cl::ByteVal, 0, offsetof(cea_hdr_t, ext_tag), 0, 1, F_BTE|F_HEX|F_RD, 0, 0xFF, "Extension tag", "Extension type: 0x02 for CEA-861" }, {&EDID_cl::ByteVal, 0, offsetof(cea_hdr_t, rev), 0, 1, F_BTE|F_INT|F_RD, 0, 0xFF, "Revision", "Extension revision" }, {&EDID_cl::ByteVal, 0, offsetof(cea_hdr_t, dtd_offs), 0, 1, F_BTE|F_HEX|F_RD, 0, 0xFF, "DTD offset", "Offset to first DTD:\n" "dtd_offs = 0 -> No DBC data and no DTD sections\n" "dtd_offs = 4 -> No DBC data, DTD sections available\n" "dtd_offs > 4 -> Both DBC data and DTD sections available\n" }, {&EDID_cl::BitF8Val, 0, offsetof(cea_hdr_t, info_blk), 0, 4, F_BFD|F_INT|F_RD, 0, 0x0F, "num_dtd", "Sum of *native* DTDs included in block 0 and in CEA extension.\n\n" "num_dtd==0 means that native format can't be expressed in 18-byte DTD and in such case " "first VDB.SVD should be considered as native/preferred video format\n\n" "NOTE#1: there can be additional non-native DTDs present at the end of the CTA-861 block.\n" "NOTE#2: CTA-861 rev.1 the 3rd byte in header is reserved (0x00), what implies that 1st DTD " "in block 0 describes preferred video format." }, {&EDID_cl::BitVal, 0, offsetof(cea_hdr_t, info_blk), 4, 1, F_BIT, 0, 1, "YCbCr 4:2:2", "1 = supported." }, {&EDID_cl::BitVal, 0, offsetof(cea_hdr_t, info_blk), 5, 1, F_BIT, 0, 1, "YCbCr 4:4:4", "1 = supported." }, {&EDID_cl::BitVal, 0, offsetof(cea_hdr_t, info_blk), 6, 1, F_BIT, 0, 1, "Basic Audio", "1 = supports basic audio." }, {&EDID_cl::BitVal, 0, offsetof(cea_hdr_t, info_blk), 7, 1, F_BIT, 0, 1, "Underscan", "1 = supports underscan." }, {&EDID_cl::ByteVal, 0, offsetof(cea_hdr_t, info_blk)+1, 0, 1, F_BTE|F_HEX|F_RD, 0, 0xFF, "checksum", "Block checksum:\n [sum_of_bytes(0-127) mod 256] + checkum_field_val must be equal to zero.\n\n" "NOTE: this byte is physically located at the end of the block (offset 127)"} }; #pragma GCC diagnostic ignored "-Wunused-parameter" rcode cea_hdr_cl::init(const u8_t* inst, u32_t orflags, edi_grp_cl* parent) { static const u32_t fcount = 9; rcode retU; u32_t ext_tag; u32_t rev; ext_tag = reinterpret_cast (inst)->ext_tag; rev = reinterpret_cast (inst)->rev; if (ext_tag != 0x02) { //CEA tag wxedid_RCD_RETURN_FAULT_VMSG(retU, "[E!] CEA/CTA-861: unknown header tag=0x%02X", ext_tag); } if ((rev > 3) || (rev < 1)) { //CEA revision wxedid_RCD_RETURN_FAULT_VMSG(retU, "[E!] CEA/CTA-861: unknown revision=%u", rev); } parent_grp = parent; type_id.t32 = ID_CHD | T_GRP_FIXED; CopyInstData(inst, sizeof(cea_hdr_t)); hdr_sz = dat_sz; inst_data[dat_sz++] = inst[127]; //chksum retU = init_fields(&fields[0], inst_data, fcount, false, Name, Desc, CodN); return retU; } #pragma GCC diagnostic warning "-Wunused-parameter" void cea_hdr_cl::SpawnInstance(u8_t *pinst) { u32_t dsz; dsz = dat_sz; dsz -= 1; //chksum memcpy(pinst, inst_data, dsz); pinst[127] = inst_data[dsz]; } //CEA bad block length msg extern const char ERR_GRP_LEN_MSG[]; const char ERR_GRP_LEN_MSG[] = "[E!] %s: invalid block length"; //CEA header field descriptions extern const char CEA_BlkHdr_dscF0[]; extern const char CEA_BlkHdr_dscF1[]; extern const char CEA_BlkHdr_dscF2[]; extern const edi_field_t CEA_BlkHdr_fields[]; extern const edi_field_t unknown_byte_fld; extern void insert_unk_byte(edi_field_t *p_fld, u32_t len, u32_t s_offs); const char CEA_BlkHdr_dscF0[] = "Total number of bytes in the block excluding 1st header byte.\n" "If Block Tag_Code = 7 then the header takes additional byte for Extended Tag Code value.\n" "The 2nd header ic counted as 1st payload byte."; const char CEA_BlkHdr_dscF1[] = "Block Type, Tag Code: \n" "0: reserved\n" "1: ADB: Audio Data Block\n" "2: VDB: Video Data Block\n" "3: VSD: Vendor Specific Data Block\n" "4: SAB: Speaker Allocation Data Block\n" "5: VDT: VESA Display Transfer Characteristic Data Block\n" "6: reserved\n" "7: EXT: Use Extended Tag\n"; const char CEA_BlkHdr_dscF2[] = "Extended Tag Codes:\n" "00: VCDB: Video Capability Data Block\n" "01: VSVD: Vendor-Specific Video Data Block\n" "02: VDDD: VESA Display Device Data Block\n" "03: ! Reserved for VESA Video Data Block\n" "04: ! Reserved for HDMI Video Data Block\n" "05: CLDB: Colorimetry Data Block\n" "06: HDRS: HDR Static Metadata Data Block\n" "07: HDRD: HDR Dynamic Metadata Data Block\n" "08..12 ! Reserved for video-related blocks\n" "13: VFPD: Video Format Preference Data Block\n" "14: Y42V: YCBCR 4:2:0 Video Data Block\n" "15: Y42C: YCBCR 4:2:0 Capability Map Data Block\n" "16: ! Reserved for CTA Miscellaneous Audio Fields\n" "17: VSAD: Vendor-Specific Audio Data Block\n" "18: HADB: HDMI Audio Data Block\n" "19: RMCD: Room Configuration Data Block\n" "20: SLDB: Speaker Location Data Block\n" "21..31 ! Reserved for audio-related blocks\n" "32: IFDB: InfoFrame Data Block\n" "33: ! Reserved\n" "34: T7VTB: DisplayID Type 7 Video Timing Data Block\n" "34: T8VTB: DisplayID Type 8 Video Timing Data Block\n" "36..41 ! Reserved\n" "42: T10VTB: DisplayID Type 10 Video Timing Data Block\n" "43..119 ! Reserved\n" "120: HEOVR: HDMI Forum EDID Extension Override Data Block\n" "121: HSCDB: HDMI Forum Sink Capability Data Block\n" "122..127 ! Reserved for HDMI\n" "128..255 ! Reserved\n"; //CEA-DBC Tag Code selector sm_vmap DBC_Tag_map = { //0: ! Reserved {1, {0, "ADB: Audio Data Block", NULL}}, {2, {0, "VDB: Video Data Block", NULL}}, {3, {0, "VSD: Vendor Specific Data Block" , NULL}}, {4, {0, "SAB: Speaker Allocation Data Block", NULL}}, {5, {0, "VDTC: VESA Display Transfer Characteristic Data Block", NULL}}, //6: ! Reserved {7, {0, "EXT: Extended Tag Code", NULL}}, }; //CEA-DBC Extended Tag Code selector sm_vmap DBC_ExtTag_map = { { 0, {0, "VCDB: Video Capability Data Block" , NULL}}, { 1, {0, "VSVD: Vendor-Specific Video Data Block", NULL}}, { 2, {0, "VDDD: VESA Display Device Data Block" , NULL}}, // 3 ! Reserved for VESA Video Data Block // 4 ! Reserved for HDMI Video Data Block { 5, {0, "CLDB: Colorimetry Data Block" , NULL}}, { 6, {0, "HDRS: HDR Static Metadata Data Block" , NULL}}, { 7, {0, "HDRD: HDR Dynamic Metadata Data Block", NULL}}, // 8..12 ! Reserved for video-related blocks { 13, {0, "VFPD: Video Format Preference Data Block" , NULL}}, { 14, {0, "Y42V: YCBCR 4:2:0 Video Data Block" , NULL}}, { 15, {0, "Y42C: YCBCR 4:2:0 Capability Map Data Block", NULL}}, // 16 ! Reserved for CTA Miscellaneous Audio Fields { 17, {0, "VSAD: Vendor-Specific Audio Data Block", NULL}}, { 18, {0, "HADB: HDMI Audio Data Block" , NULL}}, { 19, {0, "RMCD: Room Configuration Data Block" , NULL}}, { 20, {0, "SLDB: Speaker Location Data Block" , NULL}}, // 21..31 ! Reserved for audio-related blocks { 32, {0, "IFDB: InfoFrame Data Block", NULL}}, // 33 ! Reserved { 34, {0, "T7VTB: DisplayID Type 7 Video Timing Data Block" , NULL}}, { 35, {0, "T8VTB: DisplayID Type 8 Video Timing Data Block", NULL}}, // 36..41 ! Reserved { 42, {0, "T10VTB: DisplayID Type 10 Video Timing Data Block", NULL}}, // 43..119 ! Reserved {120, {0, "HEOVR: HDMI Forum EDID Extension Override Data Block", NULL}}, {121, {0, "HSCDB: HDMI Forum Sink Capability Data Block", NULL}}, // 122..127 ! Reserved for HDMI // 128..255 ! Reserved }; //CEA-DBC Header fields: const edi_field_t CEA_BlkHdr_fields[] = { {&EDID_cl::CEA_DBC_Len, 0, 0, 0, 5, F_BFD|F_INT|F_RD|F_FR, 0, 0x1F, "Blk length", CEA_BlkHdr_dscF0 }, {&EDID_cl::CEA_DBC_Tag, VS_CEA_TAG, 0, 5, 3, F_BFD|F_INT|F_RD|F_FR|F_VS, 0, 0x07, "Tag Code", CEA_BlkHdr_dscF1 }, //Extended Tag Code field is included conditionally, depending on Tag Code {&EDID_cl::CEA_DBC_ExTag, VS_CEA_ETAG, 1, 0, 1, F_BTE|F_INT|F_RD|F_FR|F_VS, 0, 0xFF, "Ext Tag Code", CEA_BlkHdr_dscF2 } }; //unknown/invalid byte: (offset has to be modified accordingly) const edi_field_t unknown_byte_fld = {&EDID_cl::ByteVal, 0, 0, 0, 1, F_BTE|F_HEX|F_RD, 0, 0xFF, "byte", "data byte" }; rcode EDID_cl::CEA_DBC_Tag(u32_t op, wxString& sval, u32_t& ival, edi_dynfld_t* p_field) { rcode retU; if (op == OP_READ) { retU = BitF8Val(op, sval, ival, p_field); } else { u32_t blkTag; bhdr_t *phdr; phdr = reinterpret_cast ( getValPtr(p_field) ); blkTag = phdr->tag.tag_code; retU = BitF8Val(op, sval, ival, p_field); if (RCD_IS_OK(retU)) { if (blkTag != (u32_t) phdr->tag.tag_code) RCD_RETURN_TRUE(retU); //True means block type changed -> the BlockTree needs to be updated. } } return retU; } rcode EDID_cl::CEA_DBC_ExTag(u32_t op, wxString& sval, u32_t& ival, edi_dynfld_t* p_field) { rcode retU; if (op == OP_READ) { retU = ByteVal(op, sval, ival, p_field); } else { u8_t blkExTag; u8_t *ptag; ptag = getValPtr(p_field); blkExTag = *ptag; retU = ByteVal(op, sval, ival, p_field); if (RCD_IS_OK(retU)) { if (blkExTag != *ptag) RCD_RETURN_TRUE(retU); } } return retU; } rcode EDID_cl::CEA_DBC_Len(u32_t op, wxString& sval, u32_t& ival, edi_dynfld_t* p_field) { rcode retU; bhdr_t *phdr; phdr = reinterpret_cast ( getValPtr(p_field) ); if (op == OP_READ) { retU = BitF8Val(op, sval, ival, p_field); } else { u32_t blklen; blklen = phdr->tag.blk_len; retU = BitF8Val(op, sval, ival, p_field); if (RCD_IS_OK(retU)) { if (blklen != (u32_t) phdr->tag.blk_len) RCD_RETURN_TRUE(retU); } } return retU; } //fallback: insert "unknown byte" field: display unknown data instead of error void insert_unk_byte(edi_field_t *p_fld, u32_t len, u32_t s_offs) { for (u32_t cnt=0; cntoffs = s_offs; s_offs ++ ; p_fld ++ ; } } //ADB: Audio Data Block //ADB: AFC : Audio Format Code : selector sm_vmap ADB_AFC_map = { // 0: ! Reserved { 1, {0, "LPCM" , NULL}}, { 2, {0, "AC-3" , NULL}}, { 3, {0, "MPEG1" , "(Layers 1 or 2)"}}, { 4, {0, "MP3" , NULL}}, { 5, {0, "MPEG2" , NULL}}, { 6, {0, "AAC LC" , NULL}}, { 7, {0, "DTS" , NULL}}, { 8, {0, "ATRAC" , NULL}}, { 9, {0, "1Bit Audio" , NULL}}, {10, {0, "AC3 Enhanced", NULL}}, {11, {0, "DTS-HD/UHD" , NULL}}, {12, {0, "MAT" , "DVD Forum MLP"}}, {13, {0, "DST Audio" , NULL}}, {14, {0, "WMA Pro" , "(Microsoft)"}}, {15, {0, "ACE" , "(Audio Coding Extension)"}} }; //ADB: ACE : Audio Coding Extension Type Code : selector sm_vmap ADB_ACE_TC_map = { // 0..3: ! Reserved { 4, {0, "MPEG-4 HE AAC" , NULL}}, { 5, {0, "MPEG-4 HE AAC v2" , NULL}}, { 6, {0, "MPEG-4 AAC LC" , NULL}}, //{ 7, {0, "DRA" , NULL}}, //no SAD structure defined: UNK { 8, {0, "MPEG-4 HE AAC Surround", NULL}}, // 9: ! Reserved {10, {0, "MPEG-4 AAC LC Surround", NULL}}, {11, {0, "MPEG-H 3D Audio" , NULL}}, {12, {0, "AC-4" , NULL}}, {13, {0, "L-PCM 3D Audio" , NULL}}, //14..31: ! Reserved }; const char cea_adb_cl::Desc[] = "Audio Data Block contains one or more 3-byte " "Short Audio Descriptors (SADs). Each SAD defines audio format, channel number, " "and bitrate/resolution capabilities of the display"; const dbc_root_dsc_t cea_adb_cl::ADB_grp = { .CodN = "ADB", .Name = "Audio Data Block", .Desc = Desc, .type_id = ID_ADB | ID_SAD, .flags = 0, .min_len = sizeof(sad_t), .max_len = 31, .hdr_fcnt = CEA_DBCHDR_FCNT, .hdr_sz = sizeof(bhdr_t), .ahf_sz = 0, .ahf_cnt = 0, .ah_flds = NULL, .grp_arsz = 1, .grp_ar = &cea_sad_cl::SAD_subg }; rcode cea_adb_cl::init(const u8_t* inst, u32_t orflags, edi_grp_cl* parent) { rcode retU; retU = base_DBC_Init_RootGrp(inst, &ADB_grp, orflags, parent); return retU; } //ADB: Audio Data Block -> //SAD: Short Audio Descriptor const char cea_sad_cl::Desc[] = "SAD describes audio format, channel number, " "and sample bitrate/resolution capabilities of the display"; static const char freqSuppDsc[] = "SAD byte 1, bit flag =1: sampling frequency is supported."; static const char sadAFC_Desc[] = "Audio Format Codes:\n" "00: reserved\n" "01: LPCM (Linear Pulse Code Modulation)\n" "02: AC-3\n" "03: MPEG1 (Layers 1 or 2)\n" "04: MP3\n" "05: MPEG2\n" "06: AAC LC\n" "07: DTS\n" "08: ATRAC\n" "09: 1 Bit Audio\n" "10: AC3 Enhanced\n" "11: DTS-HD/UHD\n" "12: MAT: DVD Forum MLP\n" "13: DST Audio\n" "14: Microsoft WMA Pro\n" "15: Audio Coding Extension Type Code is used (ACE)"; //const u32_t cea_sad_cl::fcount = 16; static const char sadACE_Desc[] = "00..03: ! Reserved\n" "04 MPEG-4 HE AAC\n" "05 MPEG-4 HE AAC v2\n" "06 MPEG-4 AAC LC\n" "07 DRA no SAD structure defined: UNK\n" "08 MPEG-4 HE AAC Surround\n" "09: Reserved\n" "10 MPEG-4 AAC LC Surround\n" "11 MPEG-H 3D Audio\n" "12 AC-4\n" "13 L-PCM 3D Audio\n" "14..31: Reserved"; /* SAD (Short Audio Descriptor) uses different data layouts, depending on Audio Format Code (AFC) and Audio Coding Extension Type Code (ACE). All the possible data layouts are defined here, and the final SAD is constructed by cea_sad_cl::gen_data_layout(), which is also setting the cea_sad_cl::fcount variable. */ const dbc_subg_dsc_t cea_sad_cl::SAD_subg = { .s_ctor = &cea_sad_cl::group_new, .CodN = "SAD", .Name = "Short Audio Descriptor", .Desc = Desc, .type_id = ID_SAD | T_SUB_GRP, .min_len = sizeof(sad_t), .fcount = 0, .inst_cnt = -1, .fields = {} }; //SAD byte 0: AFC = 1...14 const edi_field_t cea_sad_cl::byte0_afc1_14[] { {&EDID_cl::BitF8Val, 0, offsetof(sad_t, sad0), 0, 3, F_BFD|F_INT, 0, 8, "num_chn", "Bitfield of 3 bits: number of channels minus 1 -> f.e. 0 = 1 channel; 7 = 8 channels." }, {&EDID_cl::BitF8Val, VS_ADB_AFC, offsetof(sad_t, sad0), 3, 4, F_BFD|F_INT|F_VS|F_DN|F_FR, 0, 0x0F, "AFC", sadAFC_Desc }, {&EDID_cl::BitVal, 0, offsetof(sad_t, sad0), 7, 1, F_BIT|F_RD, 0, 1, "rsvd0_7", "reserved (0)" } }; //SAD byte 0: AFC = 15 && ACE = 11 (MPEG-H 3D Audio) const edi_field_t cea_sad_cl::byte0_afc15_ace11[] { {&EDID_cl::BitF8Val, 0, offsetof(sad_t, sad0), 0, 3, F_BFD|F_INT, 0, 8, "MPEGH_3DA", "MPEG-H 3D Audio Level:\n" " 0b000: (0) unspecified\n 0b001..0b101 (1..5) level 1..5\n 0b110, 0b111 (6,7) reserved" }, {&EDID_cl::BitF8Val, VS_ADB_AFC, offsetof(sad_t, sad0), 3, 4, F_BFD|F_INT|F_VS|F_DN|F_FR, 0, 0x0F, "AFC", sadAFC_Desc }, {&EDID_cl::BitVal, 0, offsetof(sad_t, sad0), 7, 1, F_BIT|F_RD, 0, 1, "rsvd0_7", "reserved (0)" } }; //SAD byte 0: AFC = 15 && ACE = 12 (AC-4) const edi_field_t cea_sad_cl::byte0_afc15_ace12[] { {&EDID_cl::BitF8Val, 0, offsetof(sad_t, sad0), 0, 3, F_BFD|F_INT, 0, 8, "rsvd0_02", "reserved (0)" }, {&EDID_cl::BitF8Val, VS_ADB_AFC, offsetof(sad_t, sad0), 3, 4, F_BFD|F_INT|F_VS|F_DN|F_FR, 0, 0x0F, "AFC", sadAFC_Desc }, {&EDID_cl::BitVal, 0, offsetof(sad_t, sad0), 7, 1, F_BIT|F_RD, 0, 1, "rsvd0_7", "reserved (0)" } }; //SAD byte 0: AFC = 15 && ACE = 13 (L-PCM 3D Audio) const edi_field_t cea_sad_cl::byte0_afc15_ace13[] { {&EDID_cl::SAD_LPCM_MC, 0, offsetof(sad_t, sad0), 0, 3, F_BFD|F_INT, 0, 32, "num_chn", "Set of 5 bits (scattered - not a bitfield), number of channels minus 1 - i.e. 0 -> 1 channel; " "7 -> 8 channels.\n" "Used only with L-PCM 3D Audio." }, {&EDID_cl::BitF8Val, VS_ADB_AFC, offsetof(sad_t, sad0), 3, 4, F_BFD|F_INT|F_VS|F_DN|F_FR, 0, 0x0F, "AFC", sadAFC_Desc }, }; //SAD byte 1: AFC = 1...14 || AFC = 15 && ACE = 11 (MPEG-H 3D Audio) const edi_field_t cea_sad_cl::byte1_afc1_14_ace11[] = { {&EDID_cl::BitVal, 0, offsetof(sad_t, sad1), 0, 1, F_BIT, 0, 1, "sf_32kHz", freqSuppDsc }, {&EDID_cl::BitVal, 0, offsetof(sad_t, sad1), 1, 1, F_BIT, 0, 1, "sf_44.1kHz", freqSuppDsc }, {&EDID_cl::BitVal, 0, offsetof(sad_t, sad1), 2, 1, F_BIT, 0, 1, "sf_48kHz", freqSuppDsc }, {&EDID_cl::BitVal, 0, offsetof(sad_t, sad1), 3, 1, F_BIT, 0, 1, "sf_88.2kHz", freqSuppDsc }, {&EDID_cl::BitVal, 0, offsetof(sad_t, sad1), 4, 1, F_BIT, 0, 1, "sf_96kHz", freqSuppDsc }, {&EDID_cl::BitVal, 0, offsetof(sad_t, sad1), 5, 1, F_BIT, 0, 1, "sf_176.4kHz", freqSuppDsc }, {&EDID_cl::BitVal, 0, offsetof(sad_t, sad1), 6, 1, F_BIT, 0, 1, "sf_192kHz", freqSuppDsc }, {&EDID_cl::BitVal, 0, offsetof(sad_t, sad1), 7, 1, F_BIT|F_RD, 0, 1, "rsvd1_7", "reserved (0)" } }; //SAD byte 1: AFC = 15 && ACE = 4,5,6,8,10 const edi_field_t cea_sad_cl::byte1_afc15_ace456810[] = { {&EDID_cl::BitVal, 0, offsetof(sad_t, sad1), 0, 1, F_BIT, 0, 1, "sf_32kHz", freqSuppDsc }, {&EDID_cl::BitVal, 0, offsetof(sad_t, sad1), 1, 1, F_BIT, 0, 1, "sf_44.1kHz", freqSuppDsc }, {&EDID_cl::BitVal, 0, offsetof(sad_t, sad1), 2, 1, F_BIT, 0, 1, "sf_48kHz", freqSuppDsc }, {&EDID_cl::BitVal, 0, offsetof(sad_t, sad1), 3, 1, F_BIT, 0, 1, "sf_88.2kHz", freqSuppDsc }, {&EDID_cl::BitVal, 0, offsetof(sad_t, sad1), 4, 1, F_BIT, 0, 1, "sf_96kHz", freqSuppDsc }, {&EDID_cl::BitF8Val, 0, offsetof(sad_t, sad1), 5, 3, F_BFD|F_RD, 0, 1, "rsvd1_57", "reserved (0)" }, }; //SAD byte 1: //AFC = 15 && ACE = 12 (AC-4) const edi_field_t cea_sad_cl::byte1_afc15_ace12_fsmp[] = { {&EDID_cl::BitVal, 0, offsetof(sad_t, sad1), 0, 1, F_BIT|F_RD, 0, 1, "rsvd1_0", "reserved (0)" }, {&EDID_cl::BitVal, 0, offsetof(sad_t, sad1), 1, 1, F_BIT, 0, 1, "sf_44.1kHz", freqSuppDsc }, {&EDID_cl::BitVal, 0, offsetof(sad_t, sad1), 2, 1, F_BIT, 0, 1, "sf_48kHz", freqSuppDsc }, {&EDID_cl::BitVal, 0, offsetof(sad_t, sad1), 3, 1, F_BIT|F_RD, 0, 1, "rsvd1_3", "reserved (0)" }, {&EDID_cl::BitVal, 0, offsetof(sad_t, sad1), 4, 1, F_BIT, 0, 1, "sf_96kHz", freqSuppDsc }, {&EDID_cl::BitVal, 0, offsetof(sad_t, sad1), 5, 1, F_BIT|F_RD, 0, 1, "rsvd1_5", "reserved (0)" }, {&EDID_cl::BitVal, 0, offsetof(sad_t, sad1), 6, 1, F_BIT, 0, 1, "sf_192kHz", freqSuppDsc }, {&EDID_cl::BitVal, 0, offsetof(sad_t, sad1), 7, 1, F_BIT|F_RD, 0, 1, "rsvd1_7", "reserved (0)" } }; //SAD byte 1: AFC = 15 && ACE = 13 (L-PCM 3D Audio) const edi_field_t cea_sad_cl::byte1_afc15_ace13[] = { {&EDID_cl::BitVal, 0, offsetof(sad_t, sad1), 0, 1, F_BIT, 0, 1, "sf_32kHz", freqSuppDsc }, {&EDID_cl::BitVal, 0, offsetof(sad_t, sad1), 1, 1, F_BIT, 0, 1, "sf_44.1kHz", freqSuppDsc }, {&EDID_cl::BitVal, 0, offsetof(sad_t, sad1), 2, 1, F_BIT, 0, 1, "sf_48kHz", freqSuppDsc }, {&EDID_cl::BitVal, 0, offsetof(sad_t, sad1), 3, 1, F_BIT, 0, 1, "sf_88.2kHz", freqSuppDsc }, {&EDID_cl::BitVal, 0, offsetof(sad_t, sad1), 4, 1, F_BIT, 0, 1, "sf_96kHz", freqSuppDsc }, {&EDID_cl::BitVal, 0, offsetof(sad_t, sad1), 5, 1, F_BIT, 0, 1, "sf_176.4kHz", freqSuppDsc }, {&EDID_cl::BitVal, 0, offsetof(sad_t, sad1), 6, 1, F_BIT, 0, 1, "sf_192kHz", freqSuppDsc }, {&EDID_cl::BitVal, 0, offsetof(sad_t, sad1), 7, 1, F_BIT|F_RD, 0, 1, "MC4", "This bit is part of 'num_chn' value for L-PCM 3D Audio, do not change it directly!." } }; //SAD byte 2: AFC = 1: LPCM const edi_field_t cea_sad_cl::byte2_afc1[] = { {&EDID_cl::BitVal, 0, offsetof(sad_t, sad2), 0, 1, F_BIT, 0, 1, "sample16b", "LPCM sample size in bits: 1=supported." }, {&EDID_cl::BitVal, 0, offsetof(sad_t, sad2), 1, 1, F_BIT, 0, 1, "sample20b", "LPCM sample size in bits: 1=supported." }, {&EDID_cl::BitVal, 0, offsetof(sad_t, sad2), 2, 1, F_BIT, 0, 1, "sample24b", "LPCM sample size in bits: 1=supported." }, {&EDID_cl::BitF8Val, 0, offsetof(sad_t, sad2), 3, 5, F_BFD|F_RD, 0, 0, "rsvd2_37", "reserved (0)" } }; //SAD byte 2: AFC = 2...8 : bitrate const edi_field_t cea_sad_cl::byte2_afc2_8[] = { {&EDID_cl::SAD_BitRate, 0, offsetof(sad_t, sad2), 0, 1, F_BTE|F_INT|F_KHZ, 0, (0xFF*8), "Max bitrate", "Maximum bitrate, stored value is the bitrate divided by 8kHz" } }; //SAD byte 2: AFC = 9...13: AFC dependent value const edi_field_t cea_sad_cl::byte2_afc9_13[] = { {&EDID_cl::ByteVal, 0, offsetof(sad_t, sad2), 0, 1, F_BTE|F_HEX, 0, 0xFF, "byte2", "AFC dependent value, not used with AFC 9..13" } }; //SAD byte 2: AFC = 14: WMA-Pro const edi_field_t cea_sad_cl::byte2_afc14[] = { {&EDID_cl::BitF8Val, 0, offsetof(sad_t, sad2), 0, 3, F_BFD|F_RD, 0, 0, "profile", "WMA-Pro profile." }, {&EDID_cl::BitF8Val, 0, offsetof(sad_t, sad2), 3, 5, F_BFD|F_RD, 0, 0, "rsvd2_37", "reserved (0)" } }; //SAD byte 2: AFC = 15, ACE = 4, 5, 6 const edi_field_t cea_sad_cl::byte2_afc15_ace456[] = { {&EDID_cl::BitVal, 0, offsetof(sad_t, sad2), 0, 1, F_BIT|F_RD, 0, 1, "SysH_22_2", "ITU-R BS.2051 [139] System H 22.2 multichannel sound\n1: supported\n\n" "NOTE: in CTE-861 revisions prior to H this bit is reserved." }, {&EDID_cl::BitVal, 0, offsetof(sad_t, sad2), 1, 1, F_BIT, 0, 1, "960_TL", "Total frame length 960 samples" }, {&EDID_cl::BitVal, 0, offsetof(sad_t, sad2), 2, 1, F_BIT, 0, 1, "1024_TL", "Total frame length 1024 samples" }, {&EDID_cl::BitF8Val, VS_ADB_ACE_TC, offsetof(sad_t, sad2), 3, 5, F_BFD|F_INT|F_DN|F_FR|F_VS, 1, 13, "ACE_TC", sadACE_Desc } }; //SAD byte 2: AFC = 15, ACE = 8 or 10 const edi_field_t cea_sad_cl::byte2_afc15_ace8_10[] = { {&EDID_cl::BitVal, 0, offsetof(sad_t, sad2), 0, 1, F_BIT, 0, 1, "MPS_L", "MPEG Surround" }, {&EDID_cl::BitVal, 0, offsetof(sad_t, sad2), 1, 1, F_BIT, 0, 1, "960_TL", "Total frame length 960 samples" }, {&EDID_cl::BitVal, 0, offsetof(sad_t, sad2), 2, 1, F_BIT, 0, 1, "1024_TL", "Total frame length 1024 samples" }, {&EDID_cl::BitF8Val, VS_ADB_ACE_TC, offsetof(sad_t, sad2), 3, 5, F_BFD|F_INT|F_DN|F_FR|F_VS, 1, 13, "ACE_TC", sadACE_Desc } }; //SAD byte 2: AFC = 15, ACE = 11 (MPEG-H 3D Audio) const edi_field_t cea_sad_cl::byte2_afc15_ace11[] = { {&EDID_cl::BitVal, 0, offsetof(sad_t, sad2), 0, 1, F_BIT, 0, 1, "LCP", "MPEG-H 3D Audio Low Complexity Profile\n1: supported" }, {&EDID_cl::BitVal, 0, offsetof(sad_t, sad2), 1, 1, F_BIT, 0, 1, "BP", "MPEG-H 3D Audio Baseline Profile\n1: supported" }, {&EDID_cl::BitVal, 0, offsetof(sad_t, sad2), 2, 1, F_BIT|F_RD, 0, 1, "rsvd2_2", "reserved (0)" }, {&EDID_cl::BitF8Val, VS_ADB_ACE_TC, offsetof(sad_t, sad2), 3, 5, F_BFD|F_INT|F_DN|F_FR|F_VS, 1, 13, "ACE_TC", sadACE_Desc } }; //SAD byte 2: AFC = 15, ACE = 12 (AC-4) const edi_field_t cea_sad_cl::byte2_afc15_ace12[] = { {&EDID_cl::BitF8Val, 0, offsetof(sad_t, sad2), 0, 3, F_BFD, 0, 0, "AFC_dep_val", "Audio Format Code dependent value" }, {&EDID_cl::BitF8Val, VS_ADB_ACE_TC, offsetof(sad_t, sad2), 3, 5, F_BFD|F_INT|F_DN|F_FR|F_VS, 1, 13, "ACE_TC", sadACE_Desc } }; //SAD byte 2: AFC = 15, ACE = 13 (L-PCM 3D Audio) const edi_field_t cea_sad_cl::byte2_afc15_ace13[] = { {&EDID_cl::BitVal, 0, offsetof(sad_t, sad2), 0, 1, F_BIT, 0, 1, "s16bit", "16bit sample" }, {&EDID_cl::BitVal, 0, offsetof(sad_t, sad2), 1, 1, F_BIT, 0, 1, "s20bit", "20bit sample" }, {&EDID_cl::BitVal, 0, offsetof(sad_t, sad2), 2, 1, F_BIT, 0, 1, "s24bit", "24bit sample" }, {&EDID_cl::BitF8Val, VS_ADB_ACE_TC, offsetof(sad_t, sad2), 3, 5, F_BFD|F_INT|F_DN|F_FR|F_VS, 1, 13, "ACE_TC", sadACE_Desc } }; #pragma GCC diagnostic ignored "-Wunused-parameter" rcode cea_sad_cl::init(const u8_t* inst, u32_t orflags, edi_grp_cl* parent) { rcode retU; rcode retU2; parent_grp = parent; type_id.t32 = ID_SAD | T_SUB_GRP; AFC = 0; //pre-alloc buffer for array of fields dyn_fldar = (edi_field_t*) malloc( 31 * EDI_FIELD_SZ ); if (NULL == dyn_fldar) RCD_RETURN_FAULT(retU); CopyInstData(inst, sizeof(sad_t)); retU = gen_data_layout(inst_data); retU2 = init_fields(dyn_fldar, inst_data, dyn_fcnt, false, SAD_subg.Name, SAD_subg.Desc, SAD_subg.CodN); if (! RCD_IS_OK(retU )) return retU; if (! RCD_IS_OK(retU2)) return retU2; if (AFC == 15) { //move ACE field to pos. 3 (right after AFC) u32_t idx; edi_dynfld_t **pfld; idx = FieldsAr.GetCount() -1; pfld = FieldsAr.Detach(idx); FieldsAr.Insert(pfld, 2); } RCD_RETURN_OK(retU); } #pragma GCC diagnostic warning "-Wunused-parameter" rcode cea_sad_cl::ForcedGrpRefresh() { rcode retU; rcode retU2; //clear fields memset( (void*) dyn_fldar, 0, ( 31 * EDI_FIELD_SZ ) ); AFC = 0; //on error, "unknown data" layout is generated, init_fields is always called. retU = gen_data_layout(inst_data); retU2 = init_fields(dyn_fldar, inst_data, dyn_fcnt); if (! RCD_IS_OK(retU )) return retU; if (! RCD_IS_OK(retU2)) return retU2; if (AFC == 15) { //move ACE field to pos. 3 (right after AFC) u32_t idx; edi_dynfld_t **pfld; idx = FieldsAr.GetCount() -1; pfld = FieldsAr.Detach(idx); FieldsAr.Insert(pfld, 2); } RCD_RETURN_OK(retU); } rcode cea_sad_cl::data_byte0() { rcode retU; if (AFC == 0 ) { RCD_RETURN_FAULT_MSG(retU, "[E!] SAD: invalid Audio Format Code (AFC)"); } if (AFC < 15) { //AFC = 1...14 memcpy( p_fld, byte0_afc1_14, (byte0_afc1_14_fcnt * EDI_FIELD_SZ) ); p_fld += byte0_afc1_14_fcnt; dyn_fcnt = byte0_afc1_14_fcnt; } else { //AFC = 15 && ACE = 4-6,8,10: same as for AFC = 1..14 if ((ACE >= 4 && 6 >= ACE) || (ACE == 8) || (ACE == 10)) { memcpy( p_fld, byte0_afc1_14, (byte0_afc1_14_fcnt * EDI_FIELD_SZ) ); p_fld += byte0_afc1_14_fcnt; dyn_fcnt = byte0_afc1_14_fcnt; } else //AFC = 15 && ACE = 11,12 (MPEG-H 3D Audio, AC-4) if (ACE == 11) { memcpy( p_fld, byte0_afc15_ace11, (byte0_afc15_ace11_fcnt * EDI_FIELD_SZ) ); p_fld += byte0_afc15_ace11_fcnt; dyn_fcnt = byte0_afc15_ace11_fcnt; } else if (ACE == 12) { memcpy( p_fld, byte0_afc15_ace12, (byte0_afc15_ace12_fcnt * EDI_FIELD_SZ) ); p_fld += byte0_afc15_ace12_fcnt; dyn_fcnt = byte0_afc15_ace12_fcnt; } else // AFC == 15, ACE = 13 (L-PCM 3D Audio) if (ACE == 13) { memcpy( p_fld, byte0_afc15_ace13, (byte0_afc15_ace13_fcnt * EDI_FIELD_SZ) ); p_fld += byte0_afc15_ace13_fcnt; dyn_fcnt = byte0_afc15_ace13_fcnt; } else { // AFC == 15, ACE > 13 || ACE = 9 || ACE = 7 || ACE < 4 : unknown RCD_RETURN_FAULT_MSG(retU, "[E!] SAD: invalid Audio Coding Extension Type Code (ACE)"); } } RCD_RETURN_OK(retU); } rcode cea_sad_cl::data_byte1() { rcode retU; //AFC = 1...14 || AFC = 15 && ACE = 11 (MPEG-H 3D Audio) if ( (AFC < 15) || ( AFC == 15 && ACE == 11 ) ) { memcpy( p_fld, byte1_afc1_14_ace11, (byte1_afc1_14_ace11_fcnt * EDI_FIELD_SZ) ); p_fld += byte1_afc1_14_ace11_fcnt; dyn_fcnt += byte1_afc1_14_ace11_fcnt; } else { //AFC == 15 if ( (ACE >= 4 && 6 >= ACE) || ACE==8 || ACE==10 ) { //ACE = 4,5,6,8,10 memcpy( p_fld, byte1_afc15_ace456810, (byte1_afc15_ace456810_fcnt * EDI_FIELD_SZ) ); p_fld += byte1_afc15_ace456810_fcnt; dyn_fcnt += byte1_afc15_ace456810_fcnt; } else if ( ACE==12 ) { //ACE = 12 (AC-4) memcpy( p_fld, byte1_afc15_ace12_fsmp, (byte1_afc15_ace12_fsmp_fcnt * EDI_FIELD_SZ) ); p_fld += byte1_afc15_ace12_fsmp_fcnt; dyn_fcnt += byte1_afc15_ace12_fsmp_fcnt; } else if ( ACE==13 ) { //ACE = 13 (L-PCM 3D Audio) memcpy( p_fld, byte1_afc15_ace13, (byte1_afc15_ace13_fcnt * EDI_FIELD_SZ) ); p_fld += byte1_afc15_ace13_fcnt; dyn_fcnt += byte1_afc15_ace13_fcnt; } else { // AFC == 15, ACE > 13 || ACE = 9 || ACE = 7 || ACE < 4 : RCD_RETURN_FAULT_MSG(retU, "[E!] SAD: invalid Audio Coding Extension Type Code (ACE)"); } } RCD_RETURN_OK(retU); } rcode cea_sad_cl::data_byte2() { rcode retU; if (AFC == 1 ) { //AFC = 1: LPCM memcpy( p_fld, byte2_afc1, (byte2_afc1_fcnt * EDI_FIELD_SZ) ); p_fld += byte2_afc1_fcnt; dyn_fcnt += byte2_afc1_fcnt; RCD_RETURN_OK(retU); } else if (AFC >= 2 && 8 >= AFC ) { //AFC = 2...8 : bitrate memcpy( p_fld, byte2_afc2_8, (byte2_afc2_8_fcnt * EDI_FIELD_SZ) ); p_fld += byte2_afc2_8_fcnt; dyn_fcnt += byte2_afc2_8_fcnt; RCD_RETURN_OK(retU); } else if (AFC >= 9 && 13 >= AFC ) { //AFC = 9...13: AFC dependent value memcpy( p_fld, byte2_afc9_13, (byte2_afc9_13_fcnt * EDI_FIELD_SZ) ); p_fld += byte2_afc9_13_fcnt; dyn_fcnt += byte2_afc9_13_fcnt; RCD_RETURN_OK(retU); } else if (AFC == 14) { //AFC = 14: WMA-Pro memcpy( p_fld, byte2_afc14, (byte2_afc14_fcnt * EDI_FIELD_SZ) ); p_fld += byte2_afc14_fcnt; dyn_fcnt += byte2_afc14_fcnt; RCD_RETURN_OK(retU); } else if (AFC == 15) { if ( ACE >= 4 && 6 >= ACE ) { //AFC = 15, ACE = 4, 5, 6 memcpy( p_fld, byte2_afc15_ace456, (byte2_afc15_ace456_fcnt * EDI_FIELD_SZ) ); p_fld += byte2_afc15_ace456_fcnt; dyn_fcnt += byte2_afc15_ace456_fcnt; RCD_RETURN_OK(retU); } else if ( ACE==8 || ACE==10 ) { //AFC = 15, ACE = 8 or 10 memcpy( p_fld, byte2_afc15_ace8_10, (byte2_afc15_ace8_10_fcnt * EDI_FIELD_SZ) ); p_fld += byte2_afc15_ace8_10_fcnt; dyn_fcnt += byte2_afc15_ace8_10_fcnt; RCD_RETURN_OK(retU); } else if ( ACE==11 ) { //AFC = 15, ACE = 11 (MPEG-H 3D Audio) memcpy( p_fld, byte2_afc15_ace11, (byte2_afc15_ace11_fcnt * EDI_FIELD_SZ) ); p_fld += byte2_afc15_ace11_fcnt; dyn_fcnt += byte2_afc15_ace11_fcnt; RCD_RETURN_OK(retU); } else if ( ACE==12 ) { //AFC = 15, ACE = 12 (AC-4) memcpy( p_fld, byte2_afc15_ace12, (byte2_afc15_ace12_fcnt * EDI_FIELD_SZ) ); p_fld += byte2_afc15_ace12_fcnt; dyn_fcnt += byte2_afc15_ace12_fcnt; RCD_RETURN_OK(retU); } else if ( ACE==13 ) { //AFC = 15, ACE = 13 (L-PCM 3D Audio) memcpy( p_fld, byte2_afc15_ace13, (byte2_afc15_ace13_fcnt * EDI_FIELD_SZ) ); p_fld += byte2_afc15_ace13_fcnt; dyn_fcnt += byte2_afc15_ace13_fcnt; RCD_RETURN_OK(retU); } // AFC == 15, ACE > 13 || ACE = 9 || ACE = 7 || ACE < 4 : unknown RCD_RETURN_FAULT_MSG(retU, "[E!] SAD: invalid Audio Coding Extension Type Code (ACE)"); } RCD_RETURN_OK(retU); } rcode cea_sad_cl::gen_data_layout(const u8_t* inst) { rcode retU; u32_t ulen; u32_t uoffs; p_fld = dyn_fldar; dyn_fcnt = 0; AFC = reinterpret_cast (inst )->afc1_14.audio_fmt; ACE = reinterpret_cast (inst+2)->afc15_ace.ace_456.ace_tc; //SAD byte 0 retU = data_byte0(); if (! RCD_IS_OK(retU)) { ulen = 3; uoffs = 0; goto _err; } //SAD byte 1 retU = data_byte1(); if (! RCD_IS_OK(retU)) { ulen = 2; uoffs = 1; goto _err; } //SAD byte 2 retU = data_byte2(); if (! RCD_IS_OK(retU)) { ulen = 1; uoffs = 2; goto _err; } return retU; _err: //invalid/unknown AFC or ACE insert_unk_byte(p_fld, ulen, uoffs); dyn_fcnt += ulen; return retU; } void cea_sad_cl::getGrpName(EDID_cl& EDID, wxString& gp_name) { const vmap_ent_t *m_ent; sad_t *psad; u32_t mAFC; u32_t mACE; if (! EDID.b_GrpNameDynamic) { gp_name = GroupName; return; } psad = reinterpret_cast (inst_data); mAFC = psad->sad0.afc1_14.audio_fmt; mACE = psad->sad2.afc15_ace.ace_456.ace_tc; if (mAFC != 15) { m_ent = vmap_GetVmapEntry(VS_ADB_AFC, VMAP_MID, mAFC); if (m_ent != NULL) { gp_name = m_ent->name; return; } gp_name = "AFC"; gp_name << mAFC; return; } m_ent = vmap_GetVmapEntry(VS_ADB_ACE_TC, VMAP_MID, mACE); if (m_ent != NULL) { gp_name = m_ent->name; return; } gp_name = "AFC15::ACE"; gp_name << mACE; } //ADB: Audio Data Block: handlers //ADB:SAD byte 1, AFC=2..8, Max bitrate rcode EDID_cl::SAD_BitRate(u32_t op, wxString& sval, u32_t& ival, edi_dynfld_t* p_field) { rcode retU; sad2_t *sad2; sad2 = reinterpret_cast ( getValPtr(p_field) ); if (op == OP_READ) { ival = sad2->afc2_8_bitrate8k; ival <<= 3; //*8kHz sval << ival; RCD_SET_OK(retU); } else { ulong utmp; RCD_SET_FAULT(retU); if (op == OP_WRSTR) { retU = getStrUint(sval, 10, p_field->field.minv, p_field->field.maxv, utmp); if (! RCD_IS_OK(retU)) return retU; } else if (op == OP_WRINT) { utmp = ival; RCD_SET_OK(retU); } else { RCD_RETURN_FAULT(retU); //wrong op code } { uint tmpv; tmpv = utmp; tmpv >>= 3; // div by 8kHz tmpv &= 0xFF; sad2->afc2_8_bitrate8k = tmpv; } } return retU; } //ADB:SAD byte0 & 1, AFC = 15 && ACE = 13 (L-PCM 3D Audio): number of channels, bits MC4..MC0 rcode EDID_cl::SAD_LPCM_MC(u32_t op, wxString& sval, u32_t& ival, edi_dynfld_t* p_field) { rcode retU; u8_t *inst; inst = getValPtr(p_field); if (op == OP_READ) { uint tmpv; tmpv = ((sad0_t*) inst )->afc15_ace13.MC3; ival = ((sad1_t*) (inst+1))->fsmp_afc15_ace13.MC4; ival <<= 1; ival |= tmpv; //bits MC4,MC3 tmpv = inst[0] & 0x07; //bits MC2 .. MC0 ival <<= 3; ival |= tmpv; //bits MC4 .. MC0 sval << ival; RCD_SET_OK(retU); } else { ulong utmp; RCD_SET_FAULT(retU); if (op == OP_WRSTR) { retU = getStrUint(sval, 10, p_field->field.minv, p_field->field.maxv, utmp); if (! RCD_IS_OK(retU)) return retU; } else if (op == OP_WRINT) { utmp = ival; RCD_SET_OK(retU); } else { RCD_RETURN_FAULT(retU); //wrong op code } { uint tmpv; utmp &= 0xFF; tmpv = utmp >> 3; //bit MC3 tmpv <<= 7; ival = inst[0]; //SAD byte 0 ival &= 0x78; //clr M3, MC2-0 ival |= tmpv; //bit MC3 tmpv = utmp & 0x07; //bits MC2 .. MC0 ival |= tmpv; inst[0] = ival; //write bits M3, MC2-0 tmpv = utmp >> 4; //bit MC4 ((sad1_t*) inst+1)->fsmp_afc15_ace13.MC4 = tmpv; } } return retU; } //VDB: Video Data Block const char cea_vdb_cl::Desc[] = "Video Data Block contains one or more 1-byte " "Short Video Descriptors (SVD). Each SVD contains index number from supported " "resolutions set defined in CEA/EIA standard, and an optional \"native\" resolution flag"; const dbc_root_dsc_t cea_vdb_cl::VDB_grp = { .CodN = "VDB", .Name = "Video Data Block", .Desc = Desc, .type_id = ID_VDB | ID_SVD, .flags = 0, .min_len = sizeof(svd_t), .max_len = 31, .hdr_fcnt = CEA_DBCHDR_FCNT, .hdr_sz = sizeof(bhdr_t), .ahf_sz = 0, .ahf_cnt = 0, .ah_flds = NULL, .grp_arsz = 1, .grp_ar = &cea_svd_cl::SVD_subg }; rcode cea_vdb_cl::init(const u8_t* inst, u32_t orflags, edi_grp_cl* parent) { rcode retU; retU = base_DBC_Init_RootGrp(inst, &VDB_grp, orflags, parent); return retU; } //VDB: Video Data Block -> //SVD: Short Video Descriptor const char cea_svd_cl::Desc[] = "Short Video Descriptor:\n" "contains index number of supported resolution defined in CEA/CTA-861 standard, " "and an optional \"native\" resolution flag"; const dbc_subg_dsc_t cea_svd_cl::SVD_subg = { .s_ctor = &cea_svd_cl::group_new, .CodN = "SVD", .Name = "Short Video Descriptor", .Desc = Desc, .type_id = ID_SVD | T_SUB_GRP, .min_len = sizeof(svd_t), .fcount = 2, .inst_cnt = -1, .fields = cea_svd_cl::fld_dsc }; const edi_field_t cea_svd_cl::fld_dsc[] = { {&EDID_cl::ByteVal, VS_SVD_VIDFMT, 0, 0, 1, F_BTE|F_INT|F_VS|F_FR|F_DN, 0, 0xFF, "VIC", "Video ID Code: an index referencing the Table 3 in CEA/CTA-861, containing standard screen resolutions. " "For CEA-861-F and above, VIC value can take 8bits, interpretation:\n" "0\t\t: reserved\n" "1-127\t\t: 7bit VIC,\n" "128\t\t: reserved\n" "129-192\t: 7bit VIC, modes 1-64 with \"native\" bit set to 1 (128+1..128+64)\n" "193-219\t: 8bit VIC, no \"native\" bit\n" "220-255\t: reserved" }, {&EDID_cl::BitVal, 0, 0, 7, 1, F_BIT|F_RD|F_FR|F_DN, 0, 0, "Native", "\"native\" mode flag\n\n" "See the VIC field description." } }; #pragma GCC diagnostic ignored "-Wunused-parameter" rcode cea_svd_cl::init(const u8_t* inst, u32_t orflags, edi_grp_cl* parent) { rcode retU; parent_grp = parent; type_id.t32 = SVD_subg.type_id; CopyInstData(inst, sizeof(svd_t)); retU = init_fields(&fld_dsc[0], inst_data, SVD_subg.fcount, false, SVD_subg.Name, SVD_subg.Desc, SVD_subg.CodN); return retU; } #pragma GCC diagnostic warning "-Wunused-parameter" void cea_svd_cl::getGrpName(EDID_cl& EDID, wxString& gp_name) { u32_t ival; u32_t natv; edi_dynfld_t *p_field; if (! EDID.b_GrpNameDynamic) { gp_name = GroupName; return; } p_field = FieldsAr.Item(0); ( EDID.*p_field->field.handlerfn )(OP_READ, gp_name, ival, p_field ); ival = EDID.CEA_VDB_SVD_decode(ival, natv); EDID.getValDesc(gp_name, p_field, ival, VD_DESC); if (natv) { gp_name << " [Native]"; //Native flag } } u32_t EDID_cl::CEA_VDB_SVD_decode(u32_t vic, u32_t &native) { u32_t natv = 0; u32_t mode = (vic & 0xFF); switch (vic) { case 0 ... 128: //0, 128 reserved, 1..127 -> VIC code break; case 129 ... 192: natv = 1; mode = (vic & 0x7F); break; default: //193 ... 255: svd_vidfmt.h: max VIC is 219, natv=0, 220..255 are reserved in G spec. break; } native = natv; return mode; } //VSD: Vendor Specific Data Block: handlers rcode EDID_cl::VSD_ltncy(u32_t op, wxString& sval, u32_t& ival, edi_dynfld_t* p_field) { rcode retU; u8_t *inst; inst = getValPtr(p_field); if (op == OP_READ) { ival = inst[0]; if (ival > 0) { ival -= 1; ival <<= 1; } else { //value not provided p_field->field.flags |= F_NU; } //ival = (inst[0] - 1) << 1; //(val-1)*2 sval << ival; RCD_SET_OK(retU); } else { ulong tmpv; RCD_SET_FAULT(retU); if (op == OP_WRSTR) { retU = getStrUint(sval, 10, p_field->field.minv, p_field->field.maxv, tmpv); if (! RCD_IS_OK(retU)) return retU; } else if (op == OP_WRINT) { tmpv = ival; RCD_SET_OK(retU); } else { RCD_RETURN_FAULT(retU); //wrong op code } tmpv >>= 1; //(val/2)+1 tmpv ++ ; inst[0] = (tmpv & 0xFF); p_field->field.flags &= ~F_NU; } return retU; } rcode EDID_cl::VSD_MaxTMDS(u32_t op, wxString& sval, u32_t& ival, edi_dynfld_t* p_field) { rcode retU; u8_t *inst; inst = getValPtr(p_field); if (op == OP_READ) { ival = (inst[0] * 5); sval << ival; RCD_SET_OK(retU); } else { ulong tmpv; RCD_SET_FAULT(retU); if (op == OP_WRSTR) { retU = getStrUint(sval, 10, p_field->field.minv, p_field->field.maxv, tmpv); if (! RCD_IS_OK(retU)) return retU; } else if (op == OP_WRINT) { tmpv = ival; RCD_SET_OK(retU); } else { RCD_RETURN_FAULT(retU); //wrong op code } tmpv = (tmpv / 5); inst[0] = (tmpv & 0xFF); } return retU; } //VSD: Vendor Specific Data Block const char cea_vsd_cl::Desc[] = "Vendor Specific Data Block is required to contain the following fields:\n" "1. Vendor's IEEE-OUI 24-bit LE registration number\n" "2. Source Physical Address (16bit LE). The source physical address provides the CEC physical address for upstream CEC devices.\n" "The rest of fields can be anything the vendor considers worthy of inclusion in the VSD.\n" "Known IEEE-OUI codes:\n" "- 00-0C-03 \"HDMI Licensing, LLC\" -> provides HDMI 1.4 payload\n" "- C4-5D-D8 \"HDMI Forum\" -> provides HDMI 2.0 payload\n" "- 00-D0-46 \"DOLBY LABORATORIES, INC.\" -> provides Dolby Vision payload\n" "- 90-84-8b \"HDR10+ Technologies, LLC\" -> provides HDR10+ payload as part of HDMI 2.1 Amendment A1 standard\n\n" "NOTE: Currently, wxEDID interprets the payload as for 00-0C-03 \"HDMI Licensing, LLC\".\n"; const edi_field_t cea_vsd_cl::hdr_fld_dsc[] = { {&EDID_cl::ByteStr, 0, offsetof(vsd_hdmi14_t, ieee_id)+1, 0, 3, F_STR|F_HEX|F_LE|F_RD|F_FR, 0, 0xFFFFFF, "IEEE-OUI", "IEEE Registration Id LE" }, {&EDID_cl::Word16, 0, offsetof(vsd_hdmi14_t, src_phy)+1, 0, 2, F_HEX|F_RD, 0, 0xFFFF, "src phy", "Source Physical Address (section 8.7 of HDMI 1.3a)." } }; const edi_field_t cea_vsd_cl::sink_feat_fld_dsc[] = { {&EDID_cl::BitVal, 0, offsetof(vsd_hdmi14_t, sink_feat)+1, 0, 1, F_BIT, 0, 1, "DVI_dual", "DVI Dual Link Operation support." }, {&EDID_cl::BitVal, 0, offsetof(vsd_hdmi14_t, sink_feat)+1, 1, 1, F_BIT, 0, 1, "reserved", "reserved (0)" }, {&EDID_cl::BitVal, 0, offsetof(vsd_hdmi14_t, sink_feat)+1, 2, 1, F_BIT, 0, 1, "reserved", "reserved (0)" }, {&EDID_cl::BitVal, 0, offsetof(vsd_hdmi14_t, sink_feat)+1, 3, 1, F_BIT, 0, 1, "DC_Y444", "4:4:4 support in deep color modes." }, {&EDID_cl::BitVal, 0, offsetof(vsd_hdmi14_t, sink_feat)+1, 4, 1, F_BIT, 0, 1, "DC_30bit", "10-bit-per-channel deep color support." }, {&EDID_cl::BitVal, 0, offsetof(vsd_hdmi14_t, sink_feat)+1, 5, 1, F_BIT, 0, 1, "DC_36bit", "12-bit-per-channel deep color support." }, {&EDID_cl::BitVal, 0, offsetof(vsd_hdmi14_t, sink_feat)+1, 6, 1, F_BIT, 0, 1, "DC_48bit", "16-bit-per-channel deep color support." }, {&EDID_cl::BitVal, 0, offsetof(vsd_hdmi14_t, sink_feat)+1, 7, 1, F_BIT, 0, 1, "Supports_AI", "Supports_AI (needs info from ACP or ISRC packets)." } }; const edi_field_t cea_vsd_cl::max_tmds_fld_dsc[] = { {&EDID_cl::VSD_MaxTMDS, 0, offsetof(vsd_hdmi14_t, max_tmds)+1, 0, 1, F_INT|F_MHZ, 0, 0xFF, "Max_TMDS", "Optional: If non-zero: Max_TMDS_Frequency / 5mhz." }, }; const edi_field_t cea_vsd_cl::latency_fld_dsc[] = { {&EDID_cl::BitF8Val, 0, offsetof(vsd_hdmi14_t, ltncy_hdr)+1, 0, 6, F_BFD, 0, 0, "reserved", "reserved (0)" }, {&EDID_cl::BitVal, 0, offsetof(vsd_hdmi14_t, ltncy_hdr)+1, 6, 1, F_BIT, 0, 0, "i_latency", "If set, 4 interlaced latency fields are present, must be 0 if latency_f (bit 7) is 0" }, {&EDID_cl::BitVal, 0, offsetof(vsd_hdmi14_t, ltncy_hdr)+1, 7, 1, F_BIT, 0, 0, "latency_f", "If set, latency fields are present" } }; const edi_field_t cea_vsd_cl::av_latency_fld_dsc[] = { {&EDID_cl::VSD_ltncy, 0, offsetof(vsd_hdmi14_t, vid_lat)+1, 0, 1, F_INT|F_MLS|F_FR, 0, 500, "Video Latency", "Optional: Video Latency value=1+ms/2 with a max of 251 meaning 500ms, 2ms granularity." }, {&EDID_cl::VSD_ltncy, 0, offsetof(vsd_hdmi14_t, aud_lat)+1, 0, 1, F_INT|F_MLS|F_FR, 0, 500, "Audio Latency", "Optional: Audio Latency value=1+ms/2 with a max of 251 meaning 500ms, 2ms granularity." }, {&EDID_cl::VSD_ltncy, 0, offsetof(vsd_hdmi14_t, vid_ilat)+1, 0, 1, F_INT|F_MLS|F_FR, 0, 500, "Video iLatency", "Optional: Interlaced Video Latency value=1+ms/2 with a max of 251 meaning 500ms, 2ms granularity." }, {&EDID_cl::VSD_ltncy, 0, offsetof(vsd_hdmi14_t, aud_ilat)+1, 0, 1, F_INT|F_MLS|F_FR, 0, 500, "Audio iLatency", "Optional: Interlaced Audio Latency value=1+ms/2 with a max of 251 meaning 500ms, 2ms granularity." } }; const gpfld_dsc_t cea_vsd_cl::sub_fld_grp[] = { { //vsd_hdr_idphy .flags = T_FLEX_LAYOUT, .dat_sz = 5, .inst_cnt = 1, .fcount = 2, .fields = cea_vsd_cl::hdr_fld_dsc }, { //vsd_sink_feat .flags = 0, .dat_sz = 1, .inst_cnt = 1, .fcount = 8, .fields = cea_vsd_cl::sink_feat_fld_dsc }, { //vsd_max_tmds .flags = 0, .dat_sz = 1, .inst_cnt = 1, .fcount = 1, .fields = cea_vsd_cl::max_tmds_fld_dsc }, { //vsd_latency .flags = 0, .dat_sz = 1, .inst_cnt = 1, .fcount = 3, .fields = cea_vsd_cl::latency_fld_dsc }, { //vsd_av_latency .flags = T_FLEX_LAYOUT|T_FLEX_LEN, .dat_sz = 4, .inst_cnt = 1, .fcount = 4, .fields = cea_vsd_cl::av_latency_fld_dsc } }; const dbc_flatgp_dsc_t cea_vsd_cl::VSD_grp = { .CodN = "VSD", .Name = "Vendor Specific Data Block", .Desc = Desc, .type_id = ID_VSD, .flags = T_FLEX_LAYOUT, .min_len = 3, .max_len = 31, .max_fld = (32 - sizeof(vsd_hdmi14_t) - sizeof(bhdr_t) + 18), .hdr_fcnt = CEA_DBCHDR_FCNT, .hdr_sz = sizeof(bhdr_t), .fld_arsz = 5, .fld_ar = cea_vsd_cl::sub_fld_grp }; rcode cea_vsd_cl::init(const u8_t* inst, u32_t orflags, edi_grp_cl* parent) { rcode retU; retU = base_DBC_Init_FlatGrp(inst, &VSD_grp, orflags, parent); return retU; } //SAB: Speaker Allocation Data Block //NOTE: the structure of SAB is basically an SPM: Speaker Presence Mask // The Desc and fields are shared with RMCD: Room Configuration Data Block: SPM extern const char SAB_SPM_CodN[]; extern const char SAB_SPM_Name[]; extern const char SAB_SPM_Desc[]; const char SAB_SPM_CodN[] = "SPM"; const char SAB_SPM_Name[] = "Speaker Presence Mask"; const char SAB_SPM_Desc[] = "Speaker Presence Mask (3 bytes).\n" "Contains information about which speakers are present in the display device.\n" "Byte0:\n" "FL_FR\t\t: Front Left/Right\n" "LFE1\t\t: LFE Low Frequency Effects 1 (subwoofer1)\n" "FC\t\t\t: Front Center\n" "BL_BR\t\t: Back Left/Right\n" "BC\t\t\t: Back Center\n" "FLC_FRC\t\t: Front Left/Right of Center\n" "bit6\t\t: reserved in CTA-861-H, was RLC/RRC: Rear Left/Right of Center\n" "FLW_FRW\t: Front Left/Right Wide\n" "Byte1:\n" "TpFL_TpFR\t: Top Front Left/Right\n" "TpC\t\t\t: Top Center\n" "TpFC\t\t: Top Front Center\n" "LS_RS\t\t: Left/Right Surround\n" "LFE2\t\t: LFE Low Frequency Effects 2 (subwoofer2)\n" "TpBC\t\t: Top Back Center\n" "SiL_SiR\t\t: Side Left/Right\n" "TpSiL_TpSiR\t: Top Side Left/Right\n" "Byte2:\n" "TpBL_TpBR\t: Top Back Left/Right\n" "BtFC\t\t: Bottom Front Center\n" "BtFL_BtFR\t: Bottom Front Left/Right\n" "bit3:\t\t reserved in CTA-861-H, was TpLS/TpRS: Top L/R Surround, HADB: LSd/RSd: L/R Surround direct\n" "bits4-7\t\t: reserved\n"; //NOTE: The SAB fields definitions are shared with // RMCD: Room Configuration Data Block: SPM and // HADB: HDMI Audio Data Block extern const gpfld_dsc_t SAB_SPM_fields; extern const edi_field_t SAB_SPM_fld_dsc[]; const gpfld_dsc_t SAB_SPM_fields = { .flags = 0, .dat_sz = sizeof(sab_t), .inst_cnt = 1, .fcount = 24, .fields = SAB_SPM_fld_dsc }; const edi_field_t SAB_SPM_fld_dsc[] = { //SAB byte 0 {&EDID_cl::BitVal, 0, offsetof(sab_t, spm0)+1, 0, 1, F_BIT, 0, 1, "FL_FR", "Front Left/Right " }, {&EDID_cl::BitVal, 0, offsetof(sab_t, spm0)+1, 1, 1, F_BIT, 0, 1, "LFE1", "LFE Low Frequency Effects 1 (subwoofer1)" }, {&EDID_cl::BitVal, 0, offsetof(sab_t, spm0)+1, 2, 1, F_BIT, 0, 1, "FC", "Front Center" }, {&EDID_cl::BitVal, 0, offsetof(sab_t, spm0)+1, 3, 1, F_BIT, 0, 1, "BL_BR", "Back Left/Right" }, {&EDID_cl::BitVal, 0, offsetof(sab_t, spm0)+1, 4, 1, F_BIT, 0, 1, "BC", "Back Center" }, {&EDID_cl::BitVal, 0, offsetof(sab_t, spm0)+1, 5, 1, F_BIT, 0, 1, "FLC_FRC", "Front Left/Right of Center" }, {&EDID_cl::BitVal, 0, offsetof(sab_t, spm0)+1, 6, 1, F_BIT, 0, 1, "rsvd0_6", "bit6: reserved in CTA-861-H, was RLC/RRC: Rear Left/Right of Center\n" }, {&EDID_cl::BitVal, 0, offsetof(sab_t, spm0)+1, 7, 1, F_BIT, 0, 1, "FLW_FRW", "Front Left/Right Wide" }, //SAB byte 1 {&EDID_cl::BitVal, 0, offsetof(sab_t, spm1)+1, 0, 1, F_BIT, 0, 1, "TpFL_TpFR", "Top Front Left/Right" }, {&EDID_cl::BitVal, 0, offsetof(sab_t, spm1)+1, 1, 1, F_BIT, 0, 1, "TpC", "Top Center" }, {&EDID_cl::BitVal, 0, offsetof(sab_t, spm1)+1, 2, 1, F_BIT, 0, 1, "TpFC", "Top Front Center" }, {&EDID_cl::BitVal, 0, offsetof(sab_t, spm1)+1, 3, 1, F_BIT, 0, 1, "LS_RS", "Left/Right Surround" }, {&EDID_cl::BitVal, 0, offsetof(sab_t, spm1)+1, 4, 1, F_BIT, 0, 1, "LFE2", "LFE Low Frequency Effects 2 (subwoofer2)" }, {&EDID_cl::BitVal, 0, offsetof(sab_t, spm1)+1, 5, 1, F_BIT, 0, 1, "TpBC", "Top Back Center" }, {&EDID_cl::BitVal, 0, offsetof(sab_t, spm1)+1, 6, 1, F_BIT, 0, 1, "SiL_SiR", "Side Left/Right" }, {&EDID_cl::BitVal, 0, offsetof(sab_t, spm1)+1, 7, 1, F_BIT, 0, 1, "TpSiL_TpSiR", "Top Side Left/Right" }, //SAB byte 2 {&EDID_cl::BitVal, 0, offsetof(sab_t, spm2)+1, 0, 1, F_BIT, 0, 1, "TpBL_TpBR", "Top Back Left/Right" }, {&EDID_cl::BitVal, 0, offsetof(sab_t, spm2)+1, 1, 1, F_BIT, 0, 1, "BtFC", "Bottom Front Center" }, {&EDID_cl::BitVal, 0, offsetof(sab_t, spm2)+1, 2, 1, F_BIT, 0, 1, "BtFL_BtFR", "Bottom Front Left/Right" }, {&EDID_cl::BitVal, 0, offsetof(sab_t, spm2)+1, 3, 1, F_BIT, 0, 1, "rsvd2_3", "byte2.bit3: reserved in CTA-861-H, was TpLS/TpRS: Top Left/Right Surround,\n" "HADB: (HDMI Audio Data Block): LSd/RSd: Left/Right Surround direct" }, {&EDID_cl::BitVal, 0, offsetof(sab_t, spm2)+1, 4, 1, F_BIT|F_RD, 0, 1, "rsvd2_4", "reserved (0)" }, {&EDID_cl::BitVal, 0, offsetof(sab_t, spm2)+1, 5, 1, F_BIT|F_RD, 0, 1, "rsvd2_5", "reserved (0)" }, {&EDID_cl::BitVal, 0, offsetof(sab_t, spm2)+1, 6, 1, F_BIT|F_RD, 0, 1, "rsvd2_6", "reserved (0)" }, {&EDID_cl::BitVal, 0, offsetof(sab_t, spm2)+1, 7, 1, F_BIT|F_RD, 0, 1, "rsvd2_7", "reserved (0)" }, // HADB: ACAT fields in byte 3: {&EDID_cl::BitF8Val, 0, offsetof(sab_t, spm2)+2, 0, 4, F_BFD, 0, 3, "res3_04", "reserved (0)" }, {&EDID_cl::BitF8Val, 0, offsetof(sab_t, spm2)+2, 4, 4, F_BFD|F_INT, 0, 3, "ACAT", "Audio Channel Allocation Type:\ndefines which speakers should be allocated\n\n" "0b0001: (1) ITU-R BS.2159-4, Type B 10.2 channels:\n" "FL/FR, LFE1, FC, BL/BR, TpFL/TpFR, LS/RS, LFE2, TpBC\n\n" "0b0010: (2) SMPTE 2036-2, 22.2 channels:\n" "all speakers except: FLW/FRW, LS/LR, TpLS/TpRS, LSd/RSd\n\n" "0b0011: (3) IEC 62574 v1.0, 30.2 channels\n" "all speakers should be allocated\n\n" "Other values are reserved\n" } }; const dbc_flatgp_dsc_t cea_sab_cl::SAB_grp = { .CodN = "SAB", .Name = "Speaker Allocation Block", .Desc = SAB_SPM_Desc, .type_id = ID_SAB, .flags = 0, .min_len = sizeof(sab_t), .max_len = sizeof(sab_t), .max_fld = (32 - sizeof(sab_t) - sizeof(bhdr_t) + 24), .hdr_fcnt = CEA_DBCHDR_FCNT, .hdr_sz = sizeof(bhdr_t), .fld_arsz = 1, .fld_ar = &SAB_SPM_fields }; rcode cea_sab_cl::init(const u8_t* inst, u32_t orflags, edi_grp_cl* parent) { rcode retU; retU = base_DBC_Init_FlatGrp(inst, &SAB_grp, orflags, parent); return retU; } //VDTC: VESA Display Transfer Characteristic Data Block (gamma) const char cea_vdtc_cl::Desc[] = "Gamma value for the display device.\n" "The format is exactly the same as in EDID block 0, byte 23"; const gpfld_dsc_t cea_vdtc_cl::fields[] = { { .flags = 0, .dat_sz = sizeof(vtc_t), .inst_cnt = 1, .fcount = 1, .fields = cea_vdtc_cl::fld_dsc } }; const edi_field_t cea_vdtc_cl::fld_dsc[] = { {&EDID_cl::Gamma, 0, offsetof(vtc_t, gamma)+1, 0, 1, F_FLT|F_NI, 0, 255, "gamma", "Byte value = (gamma*100)-100 (range 1.00–3.54)" } }; const dbc_flatgp_dsc_t cea_vdtc_cl::VDTC_grp = { .CodN = "VDTC", .Name = "VESA Display Transfer Characteristic", .Desc = Desc, .type_id = ID_VDTC, .flags = 0, .min_len = sizeof(vtc_t), .max_len = sizeof(vtc_t), .max_fld = (31 + CEA_DBCHDR_FCNT), .hdr_fcnt = CEA_DBCHDR_FCNT, .hdr_sz = sizeof(bhdr_t), .fld_arsz = 1, .fld_ar = cea_vdtc_cl::fields }; rcode cea_vdtc_cl::init(const u8_t* inst, u32_t orflags, edi_grp_cl* parent) { rcode retU; retU = base_DBC_Init_FlatGrp(inst, &VDTC_grp, orflags, parent); return retU; } //UNK-TC: Unknown Data Block (Tag Code) const dbc_flatgp_dsc_t cea_unktc_cl::UNK_TC_grp = { .CodN = "UNK-TC", .Name = "Unknown Data Block", .Desc = "Unknown Tag Code", .type_id = ID_CEA_UTC, .flags = 0, .min_len = 0, .max_len = 31, .max_fld = (31 + CEA_DBCHDR_FCNT), .hdr_fcnt = CEA_DBCHDR_FCNT, .hdr_sz = sizeof(bhdr_t), .fld_arsz = 0, .fld_ar = NULL }; rcode cea_unktc_cl::init(const u8_t* inst, u32_t orflags, edi_grp_cl* parent) { rcode retU; retU = base_DBC_Init_FlatGrp(inst, &UNK_TC_grp, orflags, parent); return retU; } //UNK-DAT Unknown data bytes, subgroup. const char cea_unkdat_cl::CodN[] = "UNK-DAT"; const char cea_unkdat_cl::Name[] = "Unknown data bytes"; const char cea_unkdat_cl::Desc[] = "Unknown data bytes"; #pragma GCC diagnostic ignored "-Wunused-parameter" rcode cea_unkdat_cl::init(const u8_t* inst, u32_t orflags, edi_grp_cl* parent) { rcode retU; u32_t dlen; //variable size: dat_sz must be set before init() !! dlen = dat_sz; parent_grp = parent; type_id.t32 = ID_CEA_UDAT | T_SUB_GRP | T_NO_MOVE; //unknown data sub-group + parent group ID CopyInstData(inst, dlen); //pre-alloc buffer for array of fields: hdr_fcnt + dlen dyn_fldar = (edi_field_t*) malloc( dlen * EDI_FIELD_SZ ); if (NULL == dyn_fldar) RCD_RETURN_FAULT(retU); dyn_fcnt = dlen; //payload data interpreted as unknown insert_unk_byte(dyn_fldar, dyn_fcnt, 0); retU = init_fields(&dyn_fldar[0], inst_data, dyn_fcnt, false, Name, Desc, CodN); return retU; } #pragma GCC diagnostic warning "-Wunused-parameter" //Universal Init function for DBC blocks with subgroups rcode edi_grp_cl::base_DBC_Init_RootGrp(const u8_t* inst, const dbc_root_dsc_t *pGDsc, u32_t orflags, edi_grp_cl* parent) { rcode retU, retU2; u32_t dlen; u32_t dlen2; u32_t ahf_count; u32_t offs; u32_t buflen; u32_t gr_idx; u32_t gr_inst; gtid_t sub_id; const u8_t *pgrp_inst; bool b_edit_mode; GroupAr_cl *subgrp_ar; //NOTE: All the fault messages are logged, but ignored -> edi_grp_cl::base_clone() RCD_SET_OK(retU); RCD_SET_OK(retU2); b_edit_mode = (T_MODE_EDIT & orflags); dlen = reinterpret_cast (inst)->tag.blk_len; dlen2 = dlen; if (dlen < pGDsc->min_len) { wxedid_RCD_SET_FAULT_VMSG(retU2, ERR_GRP_LEN_MSG, pGDsc->CodN); if (! b_edit_mode) return retU2; } subgrp_ar = getSubGrpAr(); parent_grp = parent; type_id.t32 = pGDsc->type_id; pgrp_inst = inst; hdr_sz = pGDsc->hdr_sz; ahf_sz = pGDsc->ahf_sz; ahf_count = pGDsc->ahf_cnt; dlen += sizeof(bhdr_t); //+1 DBC header buflen = (b_edit_mode) ? 32 : dlen; memcpy(inst_data, inst, buflen); dat_sz = dlen; offs = hdr_sz; if (dlen >= hdr_sz) { dlen -= hdr_sz; } else { dlen -= 1; } if (dlen < pGDsc->ahf_sz) { ahf_count = 0; pgrp_inst = &inst[offs]; //offs for UNK-DAT goto _blk_len_err; } dlen -= pGDsc->ahf_sz; offs += pGDsc->ahf_sz; pgrp_inst += offs; sub_id = type_id; //some sub-grps need to know parent's subg_id, e.g. T8VTDB, T10VTDB sub_id.t32 |= orflags; sub_id.t_md_edit = 0; sub_id.t_sub_gp = 1; for (gr_idx=0; gr_idxgrp_arsz; ++gr_idx) { const dbc_subg_dsc_t *pSubGDsc; edi_grp_cl *pgrp; u32_t dsz; u32_t min_sz; pSubGDsc = &pGDsc->grp_ar[gr_idx]; min_sz = pSubGDsc->min_len; //invalid grp desc >> infinite loop if (min_sz==0) && (inst_cnt==-1) if (0 == min_sz) RCD_RETURN_FAULT(retU); //num of sub-group instances to spawn, if inst_cnt==(-1) -> until data end for (gr_inst=0; gr_inst<(u32_t)pSubGDsc->inst_cnt; ++gr_inst) { if (dlen < pSubGDsc->min_len) { if (dlen > 0) { //no space left for next sub-group wxedid_RCD_SET_FAULT_VMSG(retU2, ERR_GRP_LEN_MSG, pGDsc->CodN); } goto payload; } subg_sz = dlen; //free space left for subgroup->init() pgrp = pSubGDsc->s_ctor(); if (NULL == pgrp) RCD_RETURN_FAULT(retU); retU2 = pgrp->init(pgrp_inst, sub_id.t32, this); if (! RCD_IS_OK(retU2)) { if (retU2.detail.rcode > RCD_FVMSG) { wxedid_RCD_SET_FAULT_VMSG(retU2, ERR_GRP_LEN_MSG, pGDsc->CodN); delete pgrp; goto payload; } //else VMSG from sub-group } pgrp->setRelOffs(offs); pgrp->setAbsOffs(offs + abs_offs); subgrp_ar->Append(pgrp); dsz = pgrp->getTotalSize(); offs += dsz; pgrp_inst += dsz; dlen -= dsz; } } payload: if (dlen2 > pGDsc->max_len) { wxedid_RCD_SET_FAULT_VMSG(retU2, ERR_GRP_LEN_MSG, pGDsc->CodN); } _blk_len_err: //unspecified payload: interpreted as unknown sub-group. if (dlen > 0) { orflags = type_id.t32 | T_NO_MOVE; retU = Append_UNK_DAT(pgrp_inst, dlen, orflags, (offs + abs_offs), offs, this); if ( (! RCD_IS_OK(retU)) && !b_edit_mode ) return retU; } subgrp_ar->CalcDataSZ(this); retU = init_fields(&CEA_BlkHdr_fields[0], inst_data, pGDsc->hdr_fcnt, false, pGDsc->Name, pGDsc->Desc, pGDsc->CodN); if (! RCD_IS_OK(retU)) return retU; if (ahf_count != 0) { bool append_md = true; //append and init additional fields in root group header retU = init_fields(pGDsc->ah_flds, inst_data, ahf_count, append_md); } if (RCD_IS_OK(retU)) return retU2; return retU; } //Universal Init function for DBC blocks (no sub-groups) rcode edi_grp_cl::base_DBC_Init_FlatGrp(const u8_t* inst, const dbc_flatgp_dsc_t *pGDsc, u32_t orflags, edi_grp_cl* parent) { rcode retU, retU2; u32_t dlen; u32_t dlen2; u32_t offs; u32_t fcnt; u32_t buflen; u32_t fldgr_idx; u32_t gr_inst; edi_field_t *p_fld; bool b_edit_mode; //NOTE: edi_grp_cl::base_clone(): All the fault messages are logged, but ignored. RCD_SET_OK(retU); RCD_SET_OK(retU2); b_edit_mode = (0 != (T_MODE_EDIT & orflags)); dlen = reinterpret_cast (inst)->tag.blk_len; dlen2 = dlen; if (dlen < pGDsc->min_len) { wxedid_RCD_SET_FAULT_VMSG(retU2, ERR_GRP_LEN_MSG, pGDsc->CodN); if (! b_edit_mode) return retU2; } parent_grp = parent; type_id.t32 = pGDsc->type_id; dlen += sizeof(bhdr_t); //+1 DBC header buflen = (b_edit_mode) ? 32 : dlen; memcpy(inst_data, inst, buflen); //Local data copy dat_sz = dlen; if (dlen >= pGDsc->hdr_sz) { dlen -= pGDsc->hdr_sz; } else { dlen -= 1; } //max fields: dyn_fldar = (edi_field_t*) malloc( pGDsc->max_fld * EDI_FIELD_SZ ); if (NULL == dyn_fldar) RCD_RETURN_FAULT(retU); dyn_fcnt = pGDsc->hdr_fcnt; p_fld = dyn_fldar; //insert DBC header: pGDsc->hdr_sz defines header type memcpy( p_fld, CEA_BlkHdr_fields, (pGDsc->hdr_fcnt * EDI_FIELD_SZ) ); p_fld += pGDsc->hdr_fcnt; offs = pGDsc->hdr_sz; for (fldgr_idx=0; fldgr_idxfld_arsz; ++fldgr_idx) { const gpfld_dsc_t *pgFld; u32_t dsz; pgFld = &pGDsc->fld_ar[fldgr_idx]; if ( (T_FLEX_LAYOUT & pgFld->flags) != 0) { retU2 = base_DBC_Init_GrpFields(pgFld, &p_fld, &dlen, &offs); if (! RCD_IS_OK(retU2)) { wxedid_RCD_SET_FAULT_VMSG(retU2, ERR_GRP_LEN_MSG, pGDsc->CodN); goto _payload; } if (RCD_IS_TRUE(retU2)) { continue; } } fcnt = pgFld->fcount; dsz = pgFld->dat_sz; //num of sub-group instances to spawn, if inst_cnt==(-1) -> until data end for (gr_inst=0; gr_inst<(u32_t)pgFld->inst_cnt; ++gr_inst) { bool b_flex; if (dlen < dsz) { b_flex = ((T_FLEX_LAYOUT & pGDsc->flags) != 0); b_flex |= ( pgFld->inst_cnt < 0); if (! b_flex) { wxedid_RCD_SET_FAULT_VMSG(retU2, ERR_GRP_LEN_MSG, pGDsc->CodN); } goto _payload; //fixed blk size mismatch -> unknown data } b_flex = ( (T_FLEX_OFFS & pgFld->flags) != 0); memcpy( p_fld, pgFld->fields, (fcnt * EDI_FIELD_SZ) ); if (b_flex) { //update field offsets: all fields have to be of size ==1 edi_field_t *p_dstf; p_dstf = p_fld; for (u32_t fidx=0; fidxoffs = (offs + fidx); p_dstf ++ ; } } p_fld += fcnt; dyn_fcnt += fcnt; dlen -= dsz; offs += dsz; } } _payload: if (dlen2 > pGDsc->max_len) { wxedid_RCD_SET_FAULT_VMSG(retU2, ERR_GRP_LEN_MSG, pGDsc->CodN); } //unspecified payload: interpreted as unknown bytes. if (dlen > 0) { fcnt = (dyn_fcnt + dlen); if (fcnt > pGDsc->max_fld) { edi_field_t* t_buf; //This can happen due to EDID error or in b_edit_mode, //if user enters invalid block length t_buf = (edi_field_t*) realloc(dyn_fldar, (fcnt * EDI_FIELD_SZ)); if (NULL == t_buf) RCD_RETURN_FAULT(retU); dyn_fldar = t_buf; p_fld = dyn_fldar; p_fld += dyn_fcnt; //append unk. bytes after last valid field } dyn_fcnt = fcnt; insert_unk_byte(p_fld, dlen, offs); } retU = init_fields(&dyn_fldar[0], inst_data, dyn_fcnt, false, pGDsc->Name, pGDsc->Desc, pGDsc->CodN); if (RCD_IS_OK(retU)) return retU2; return retU; } rcode edi_grp_cl::base_DBC_Init_GrpFields(const gpfld_dsc_t *pgFld, edi_field_t **pp_fld, u32_t *pdlen, u32_t *poffs) { rcode retU; u32_t dlen = *pdlen; u32_t offs = *poffs; u32_t nfld = 0; u32_t grlen = 0; bool b_offs = ( (T_FLEX_OFFS & pgFld->flags) != 0); edi_field_t *p_fld = *pp_fld; const edi_field_t *p_srcf = &pgFld->fields[0]; for (; nfldfcount; ++nfld) { u32_t fldlen; fldlen = p_srcf->fld_sz; if (dlen < fldlen) break; memcpy( p_fld, p_srcf, EDI_FIELD_SZ ); if (b_offs) { //update fields offsets: p_fld->offs = offs; } dlen -= fldlen; grlen += fldlen; offs += fldlen; p_srcf ++ ; p_fld ++ ; } RCD_SET_TRUE(retU); if (grlen != pgFld->dat_sz) { bool b_flex; b_flex = ((T_FLEX_LEN & pgFld->flags) != 0); if (! b_flex) { RCD_SET_FAULT(retU); //Bad length } } *pp_fld = p_fld; *poffs = offs; *pdlen = dlen; dyn_fcnt += nfld; return retU; } wxedid-0.0.32/src/grpar.h0000644000175000017500000001253014722720160012056 00000000000000/*************************************************************** * Name: grpar.h * Purpose: EDID group arrays * Author: Tomasz Pawlak (tomasz.pawlak@wp.eu) * Copyright: Tomasz Pawlak (C) 2021-2024 * License: GPLv3+ **************************************************************/ #ifndef GRP_AR_H #define GRP_AR_H 1 #include #include "def_types.h" #include "rcode/rcode.h" class edi_grp_cl; WX_DECLARE_OBJARRAY(edi_grp_cl*, wxArGroup_cl); class GroupAr_cl : public wxArGroup_cl { protected: GroupAr_cl *parent_ar; i32_t used_sz; //block/group used space i32_t free_sz; //block/group free space left void base_CalcDataSZ(i32_t blk_sz, i32_t hdr_sz = 0); bool base_CanMoveUp (u32_t idx); bool base_CanMoveDn (u32_t idx); bool base_CanInsert (edi_grp_cl* pgrp); edi_grp_cl* base_Cut (u32_t); void base_Paste (u32_t idx, edi_grp_cl* pgrp); void base_Delete (u32_t idx); void base_MoveUp (u32_t idx); void base_MoveDn (u32_t idx); void base_InsertUp (u32_t idx, edi_grp_cl* pgrp); void base_InsertDn (u32_t idx, edi_grp_cl* pgrp); public: void Append (edi_grp_cl* pgrp); void UpdateAbsOffs(u32_t idx, u32_t abs_offs, bool b_updt_soffs = true); void UpdateRelOffs(u32_t idx, u32_t abs_offs, u32_t rel_offs); virtual edi_grp_cl* Cut (u32_t ) {return NULL;}; virtual bool CanMoveUp (u32_t ) {return false;}; virtual bool CanMoveDn (u32_t ) {return false;}; virtual bool CanInsertUp(u32_t , edi_grp_cl* ) {return false;}; virtual bool CanInsertDn(u32_t , edi_grp_cl*) {return false;}; bool CanPaste (u32_t idx, edi_grp_cl* src_grp); bool CanCut (u32_t idx); bool CanDelete (u32_t idx); inline bool CanInsert (edi_grp_cl* pgrp) {return base_CanInsert(pgrp);}; bool CanInsInto (u32_t idx, edi_grp_cl* pgrp); virtual void Paste (u32_t , edi_grp_cl*) {return;}; virtual void Delete (u32_t ) {return;}; virtual void MoveUp (u32_t ) {return;}; virtual void MoveDn (u32_t ) {return;}; virtual void InsertUp (u32_t , edi_grp_cl*) {return;}; virtual void InsertDn (u32_t , edi_grp_cl*) {return;}; virtual void InsertInto (edi_grp_cl*, edi_grp_cl*) {return;}; inline void setParentArray(GroupAr_cl* parr) {parent_ar = parr;}; inline GroupAr_cl* getParentArray() {return parent_ar;}; inline i32_t getUsedSize () {return used_sz;}; inline i32_t getFreeSpace () {return free_sz;}; virtual void CalcDataSZ(edi_grp_cl*) {return;}; GroupAr_cl() : parent_ar(NULL), used_sz(0), free_sz(0) { Alloc(16);}; ~GroupAr_cl() { Empty(); }; }; //Base EDID block groups array class EDID_GrpAr_cl : public GroupAr_cl { private: bool TypeSizeChk(edi_grp_cl* pgrp); public: void CalcDataSZ (edi_grp_cl *pgrp = NULL); bool CanMoveUp (u32_t idx) {return base_CanMoveUp(idx);}; bool CanMoveDn (u32_t idx) {return base_CanMoveDn(idx);}; bool CanInsertUp(u32_t idx, edi_grp_cl* pgrp); bool CanInsertDn(u32_t idx, edi_grp_cl* pgrp); edi_grp_cl* Cut (u32_t idx) {return base_Cut(idx);}; void Paste (u32_t idx, edi_grp_cl* pgrp) { base_Paste (idx, pgrp);}; void Delete (u32_t idx) { base_Delete (idx);}; void MoveUp (u32_t idx) { base_MoveUp (idx);}; void MoveDn (u32_t idx) { base_MoveDn (idx);}; void InsertUp (u32_t idx, edi_grp_cl* pgrp) { base_InsertUp(idx, pgrp);}; void InsertDn (u32_t idx, edi_grp_cl* pgrp) { base_InsertDn(idx, pgrp);}; }; //CEA Extension block groups array class CEA_GrpAr_cl : public GroupAr_cl { public: void CalcDataSZ (edi_grp_cl *pgrp = NULL); bool CanMoveUp (u32_t idx); bool CanMoveDn (u32_t idx); bool CanInsertUp(u32_t idx, edi_grp_cl* pgrp); bool CanInsertDn(u32_t idx, edi_grp_cl* pgrp); edi_grp_cl* Cut (u32_t idx) {return base_Cut(idx);}; void Paste (u32_t idx, edi_grp_cl* pgrp) { base_Paste (idx, pgrp);}; void Delete (u32_t idx) { base_Delete (idx);}; void MoveUp (u32_t idx) { base_MoveUp (idx);}; void MoveDn (u32_t idx) { base_MoveDn (idx);}; void InsertUp (u32_t idx, edi_grp_cl* pgrp) { base_InsertUp(idx, pgrp);}; void InsertDn (u32_t idx, edi_grp_cl* pgrp) { base_InsertDn(idx, pgrp);}; }; //EDID_base / CEA-DBC sub-groups array class SubGrpAr_cl : public GroupAr_cl { private: void doInsert (u32_t idx, edi_grp_cl* pgrp, edi_grp_cl* parent); bool doTypeMatch(u32_t idx, edi_grp_cl* pgrp); public: void CalcDataSZ (edi_grp_cl *pgrp); bool CanMoveUp (u32_t idx); bool CanMoveDn (u32_t idx); bool CanInsertUp(u32_t idx, edi_grp_cl* pgrp); bool CanInsertDn(u32_t idx, edi_grp_cl* pgrp); edi_grp_cl* Cut (u32_t idx); void Paste (u32_t idx, edi_grp_cl* pgrp); void Delete (u32_t idx); void MoveUp (u32_t idx); void MoveDn (u32_t idx); void InsertUp (u32_t idx, edi_grp_cl* pgrp); void InsertDn (u32_t idx, edi_grp_cl* pgrp); void InsertInto (edi_grp_cl* pdstg, edi_grp_cl* pgrp); }; #endif /* GRP_AR_H */ wxedid-0.0.32/src/id_flags.h0000644000175000017500000001400114722720160012506 00000000000000/*************************************************************** * Name: id_flag.h * Purpose: Global block/groups IDs and field flags * Author: Tomasz Pawlak (tomasz.pawlak@wp.eu) * Copyright: Tomasz Pawlak (C) 2024 * License: GPLv3+ **************************************************************/ #ifndef ID_FLAGS_H #define ID_FLAGS_H 1 enum { //block and groups IDs & flags ID_INVALID = 0x00000000, //EDID base: ID_BED = 0x00000001, ID_VID = 0x00000002, ID_BDD = 0x00000003, ID_SPF = 0x00000004, ID_CXY = 0x00000005, ID_ETM = 0x00000006, ID_DMT2 = 0x00010000, ID_CVT3 = 0x00020000, //EDID base: descriptors ID_UNK = 0x00000007, ID_MRL = 0x00000008, ID_MSN = 0x00000009, ID_MND = 0x0000000A, ID_WPD = 0x0000000B, ID_AST = 0x0000000C, ID_UTX = 0x0000000D, ID_DCM = 0x0000000E, ID_CT3 = 0x0000000F, ID_ET3 = 0x00000010, ID_DTD = 0x00000011, //last ID: can be inserted into CEA ID_EDID_MASK = 0x0000001F, //base EDID type mask //CEA-DBC: ID_CHD = 0x00000020, ID_ADB = 0x00000040, ID_SAD = 0x00030000, ID_VDB = 0x00000060, ID_SVD = 0x00040000, ID_VSD = 0x00000080, ID_SAB = 0x000000A0, ID_VDTC = 0x000000C0, ID_CEA_UTC = 0x000000E0, //unknown Tag Code ID_CEA_MASK = 0x000000E0, //mask for Tag Code type ID //CEA-DBC-ET: ID_VCDB = 0x00000100, ID_VSVD = 0x00000200, ID_VSAD = 0x00000300, ID_HADB = 0x00000400, ID_SAB3D = 0x00050000, ID_VDDD = 0x00000500, ID_VDDD_IPF = 0x00060000, ID_VDDD_CPT = 0x00070000, ID_VDDD_AUD = 0x00080000, ID_VDDD_DPR = 0x00090000, ID_VDDD_CXY = 0x000A0000, ID_RSV4 = 0x00000600, ID_CLDB = 0x00000700, ID_HDRS = 0x00000800, ID_HDRD = 0x00000900, ID_HDRD_HMTD = 0x000B0000, ID_VFPD = 0x00000A00, ID_VFPD_SVR = 0x000C0000, ID_Y42V = 0x00000B00, ID_Y42C = 0x00000C00, ID_RMCD = 0x00000D00, ID_RMCD_SPM = 0x000D0000, ID_RMCD_SPKD = 0x000E0000, ID_RMCD_DSPC = 0x000F0000, ID_SLDB = 0x00000E00, ID_SLDB_SPKLD = 0x00100000, ID_IFDB = 0x00000F00, ID_IFDB_IFPD = 0x00110000, ID_IFDB_SIFD = 0x00120000, ID_IFDB_VSD = 0x00130000, ID_T7VTDB = 0x00001000, ID_T8VTDB = 0x00001100, ID_T8VTC_T0 = 0x00140000, //TSC=0, 1-byte VTC /* ID_T8VTC_T1 = 0x00010000, TSC=1: ID_DMT2 */ ID_T10VTDB = 0x00001200, ID_T10VTD_M0 = 0x00150000, //T10_M=0, 6-byte VTD ID_T10VTD_M1 = 0x00160000, //T10_M=1, (6+1)-byte VTD ID_CEA_UETC = 0x0000FF00, //unknown Extended Tag Code ID_CEA_UDAT = 0x007F0000, //unknown data sub-group ID_CEA_ET_MASK = 0x0000FF00, //mask for Extended Tag type ID ID_SUBGRP_MASK = 0x007F0000, //mask for subgroups ID_PARENT_MASK = (ID_EDID_MASK|ID_CEA_MASK|ID_CEA_ET_MASK), //mask for parent groups //Group init flags: T_FLEX_LAYOUT = 0x00800000, // use field data lengths T_FLEX_LEN = 0x01000000, // !T_FLEX_LEN -> fail if group length is too small T_FLEX_OFFS = 0x02000000, // update field's offsets T_FLAG_MASK = 0x03800000, //Group type: T_MODE_EDIT = 0x04000000, //alternative behaviour in init() T_NO_COPY = 0x08000000, //can't copy: sub-group needs data from parent group T_NO_MOVE = 0x10000000, //can't be moved T_P_HOLDER = 0x20000000, //place holder grp: can be moved/copied/pasted but not cut or deleted T_GRP_FIXED = 0x40000000, //fixed group: can't be moved, copied, pasted, cut or deleted. T_SUB_GRP = 0x80000000, //sub-group T_TYPE_MASK = 0xFC000000 }; typedef union __attribute__ ((__transparent_union__)) gtid_u { u32_t t32; struct __attribute__ ((packed)) { uint base_id :5; uint cea_id :3; uint cea_et_id :8; uint subg_id :7; uint t_flex_layout :1; uint t_flex_len :1; uint t_flex_offs :1; uint t_md_edit :1; uint t_no_copy :1; uint t_no_move :1; uint t_p_holder :1; uint t_gp_fixed :1; uint t_sub_gp :1; }; } gtid_t; enum { //EDID field flags //byte0: property flags F_PR_CNT = 8, F_PR_SFT = 0, F_PR_MSK = 0xFFF, F_RD = 0x00000001, //read-only F_NU = 0x00000002, //field not used i.e. it is marked as unused in the EDID F_GD = 0x00000004, //display group description for this field F_DN = 0x00000008, //dynamic block name: created from field value F_VS = 0x00000010, //value selector menu available F_FR = 0x00000020, //force group refresh after changing a field with this flag set F_INIT = 0x00000040, //group requires re-initialization on field change F_RS = 0x00000080, //field value can't be provided as int (for write) F_NI = 0x00000100, //field value can't be provided as int (for write) //byte1: field type F_TP_CNT = 8, F_TP_SFT = 12, F_TP_MSK = 0xFF, F_BIT = 0x00001000, //single bit F_BFD = 0x00002000, //bitfield F_BTE = 0x00004000, //byte F_INT = 0x00008000, //int F_FLT = 0x00010000, //float F_HEX = 0x00020000, //display as hex F_STR = 0x00040000, //text/byte string F_LE = 0x00080000, //Little Endian byte order : reverse the byte order in byte strings //byte2, byte3.bit0: val unit F_UN_CNT = 9, F_UN_SFT = 20, F_UN_MSK = 0x1FF, F_PIX = 0x00100000, //pixels F_MM = 0x00200000, // F_CM = 0x00400000, // F_DM = 0x00800000, //decimeters F_HZ = 0x01000000, // F_KHZ = 0x02000000, // F_MHZ = 0x04000000, // F_MLS = 0x08000000, //milliseconds F_PCT = 0x10000000, //percent //byte3.bit1..7: other flags F_VSVM = 0x20000000 //value selector: value stored in vmap_ent_t, not in item id }; #endif /* ID_FLAGS_H */ wxedid-0.0.32/src/debug.h0000644000175000017500000000510414722720160012030 00000000000000/* Declarations for debug.h Copyright (C) 2014-2024 Tomasz Pawlak, e-mail: tomasz.pawlak@wp.eu License: GNU General Public License version 3 (GPLv3+) debug.h v0.2 (2014-09-12) 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 3 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 file; If not, see . */ #ifndef DEBUG_H #define DEBUG_H 1 #include #if __WORDSIZE == 64 #define PR_SIZET "lu" #define PR_SSIZET "ld" #define PR_I64 "lu" #define PR_SI64 "ld" #else #define PR_SIZET "u" #define PR_SSIZET "d" #define PR_I64 "llu" #define PR_SI64 "lld" #endif #define __debug_log_fd stdout #define __debug_err_fd stderr #ifndef __debug_dbg0_fd #define __debug_dbg0_fd stderr #endif #ifndef __debug_dbg1_fd #define __debug_dbg1_fd stderr #endif #ifndef __debug_dbg2_fd #define __debug_dbg2_fd stderr #endif #ifdef DBG_LEVEL_ALL #pragma message "DBG_LEVEL_ALL on" #ifndef DBG_LEVEL_0 #define DBG_LEVEL_0 #endif #ifndef DBG_LEVEL_1 #define DBG_LEVEL_1 #endif #ifndef DBG_LEVEL_2 #define DBG_LEVEL_2 #endif #endif #ifdef DBG_LEVEL_0 #pragma message "DBG_LEVEL_0 on" #ifndef DBG_MODE #define DBG_MODE #endif #define DBG0_PRINT(...) \ fprintf(__debug_dbg0_fd, __VA_ARGS__) #else #define DBG0_PRINT(...) #endif #ifdef DBG_LEVEL_1 #pragma message "DBG_LEVEL_1 on" #ifndef DBG_MODE #define DBG_MODE #endif #define DBG1_PRINT(...) \ fprintf(__debug_dbg1_fd, __VA_ARGS__) #else #define DBG1_PRINT(...) #endif #ifdef DBG_LEVEL_2 #pragma message "DBG_LEVEL_2 on" #ifndef DBG_MODE #define DBG_MODE #endif #define DBG2_PRINT(...) \ fprintf(__debug_dbg2_fd, __VA_ARGS__) #else #define DBG2_PRINT(...) #endif //DBG_PRINT for all levels #ifdef DBG_MODE #pragma message "DBG_MODE on" #define DBG_PRINT(...) \ fprintf(__debug_dbg2_fd, __VA_ARGS__) #else #define DBG_PRINT(...) #endif #define ERR_PRINT(...) \ fprintf(__debug_err_fd, __VA_ARGS__) #define LOG_PRINT(...) \ fprintf(__debug_log_fd, __VA_ARGS__) #endif // DEBUG_H wxedid-0.0.32/src/grpar.cpp0000644000175000017500000004657514722720160012431 00000000000000/*************************************************************** * Name: grpar.cpp * Purpose: EDID group arrays * Author: Tomasz Pawlak (tomasz.pawlak@wp.eu) * Copyright: Tomasz Pawlak (C) 2021-2024 * License: GPLv3+ **************************************************************/ #include "debug.h" #include "rcdunits.h" #ifndef idGRP_AR #error "grpar.cpp: missing unit ID" #endif #define RCD_UNIT idGRP_AR #include "rcode/rcode.h" #include "wxedid_rcd_scope.h" RCD_AUTOGEN_DEFINE_UNIT #include "EDID_class.h" #include WX_DEFINE_OBJARRAY(wxArGroup_cl); //group array: base class void GroupAr_cl::Append(edi_grp_cl* pgrp) { pgrp->setArrayIdx(this, GetCount() ); Add(pgrp); } void GroupAr_cl::UpdateRelOffs(u32_t idx, u32_t abs_offs, u32_t rel_offs) { edi_grp_cl *pgrp; u32_t datsz; u32_t n_grp; n_grp = GetCount(); for (; idxsetAbsOffs(abs_offs); pgrp->setRelOffs(rel_offs); pgrp->setIndex (idx); datsz = pgrp->getDataSize(); rel_offs += datsz; abs_offs += datsz; } } //if b_updt_soffs == false, don't update subgroups' relative offsets, //if b_updt_soffs == true, update all subgroups' relative offsets, basing on abs_offs void GroupAr_cl::UpdateAbsOffs(u32_t idx, u32_t abs_offs, bool b_updt_soffs) { edi_grp_cl *pgrp; u32_t datsz; u32_t rel_offs; u32_t n_grp; n_grp = GetCount(); rel_offs = abs_offs; rel_offs %= sizeof(edid_t); for (; idxgetSubGrpCount() > 0); if (b_soffs) { edi_grp_cl *psubg; GroupAr_cl *sub_ar; u32_t sub_rel; u32_t sub_abs; sub_ar = pgrp ->getSubGrpAr(); psubg = sub_ar->Item(0); sub_rel = psubg ->getRelOffs(); sub_abs = abs_offs; sub_abs += sub_rel; sub_ar->UpdateRelOffs(0, sub_abs, sub_rel); } pgrp->setAbsOffs(abs_offs); pgrp->setRelOffs(rel_offs); pgrp->setIndex(idx); datsz = pgrp->getTotalSize(); abs_offs += datsz; rel_offs += datsz; } } edi_grp_cl* GroupAr_cl::base_Cut(u32_t idx) { u32_t abs_offs; edi_grp_cl *pgrp; edi_grp_cl **p_pgrp; p_pgrp = Detach(idx); pgrp = *p_pgrp; abs_offs = pgrp->getAbsOffs(); if (idx < GetCount()) { UpdateAbsOffs(idx, abs_offs); } CalcDataSZ(NULL); pgrp->setParentGrp(NULL); pgrp->setArrayIdx(NULL, -1); return pgrp; } void GroupAr_cl::base_Paste(u32_t idx, edi_grp_cl* pgrp) { u32_t abs_offs; gtid_t tid_src; gtid_t tid_dst; edi_grp_cl *dst_grp; GroupAr_cl *sub_ar; dst_grp = Item(idx); abs_offs = dst_grp->getAbsOffs(); pgrp->setArrayIdx(this, idx); sub_ar = pgrp->getSubGrpAr(); if (sub_ar != NULL) { sub_ar->setParentArray(this); } //base EDID: inherit T_P_HOLDER flag (currently only for ID_DMT2) tid_src = pgrp->getTypeID(); tid_dst = dst_grp->getTypeID(); tid_src.t_p_holder = tid_dst.t_p_holder; pgrp->setTypeID(tid_src); Detach(idx); delete dst_grp; Insert(pgrp, idx); UpdateAbsOffs(idx, abs_offs); CalcDataSZ(NULL); } void GroupAr_cl::base_Delete(u32_t idx) { u32_t abs_offs; edi_grp_cl *pgrp; pgrp = Item(idx); abs_offs = pgrp->getAbsOffs(); Detach(idx); delete pgrp; if (idx < GetCount()) { UpdateAbsOffs(idx, abs_offs); } CalcDataSZ(NULL); } void GroupAr_cl::base_MoveUp(u32_t idx) { //MoveUp(idx) == MoveDn(idx-1) idx -- ; base_MoveDn(idx); } void GroupAr_cl::base_MoveDn(u32_t idx) { u32_t abs_offs; edi_grp_cl *pgrp; edi_grp_cl **p_pgrp; p_pgrp = Detach(idx); pgrp = *p_pgrp; abs_offs = pgrp->getAbsOffs(); idx ++ ; Insert(pgrp, idx); idx -- ; //next group becomes prev. group UpdateAbsOffs(idx, abs_offs); } void GroupAr_cl::base_InsertUp(u32_t idx, edi_grp_cl* pgrp) { u32_t abs_offs; edi_grp_cl *dst_grp; dst_grp = Item(idx); abs_offs = dst_grp->getAbsOffs(); pgrp->setArrayIdx(this, idx); Insert(pgrp, idx); UpdateAbsOffs(idx, abs_offs); CalcDataSZ(NULL); } void GroupAr_cl::base_InsertDn(u32_t idx, edi_grp_cl* pgrp) { u32_t n_grp; //InsertDn(idx) == InsertUp(idx+1) idx ++ ; n_grp = GetCount(); if (idx < n_grp) { base_InsertUp(idx, pgrp); return; } //insert after last group idx = (n_grp -1); base_InsertUp(idx, pgrp); base_MoveDn(idx); } bool GroupAr_cl::base_CanMoveUp(u32_t idx) { edi_grp_cl *pgrp; bool p_holder; gtid_t tid; bool bret; u32_t maxidx = GetCount(); if ( (idx == 0) || (idx >= maxidx) ) return false; //group is not fixed pgrp = Item(idx); tid = pgrp->getTypeID(); bret = ! tid.t_gp_fixed; if (! bret) return false; p_holder = tid.t_p_holder; //previous group is not fixed idx -- ; pgrp = Item(idx); tid = pgrp->getTypeID(); bret = ( p_holder && tid.t_p_holder); //can move place holders bret |= (!p_holder && !tid.t_p_holder); //can move alt. desc return bret; } bool GroupAr_cl::base_CanMoveDn(u32_t idx) { bool p_holder; edi_grp_cl *pgrp; gtid_t tid; bool bret; u32_t maxidx = GetCount(); if (idx >= (maxidx -1) ) return false; //group is not fixed pgrp = Item(idx); tid = pgrp->getTypeID(); bret = ! tid.t_gp_fixed; if (! bret) return false; p_holder = tid.t_p_holder; //next group is not fixed idx ++ ; pgrp = Item(idx); tid = pgrp->getTypeID(); bret = ( p_holder && tid.t_p_holder); //can move place holders bret |= (!p_holder && !tid.t_gp_fixed); //can move alt. desc return bret; } bool GroupAr_cl::base_CanInsert(edi_grp_cl* pgrp) { i32_t bsz; bool bret; bsz = pgrp->getTotalSize(); bret = (bsz <= free_sz); //parent block free space if (parent_ar != NULL) { bret &= parent_ar->CanInsert(pgrp); } return bret; } bool GroupAr_cl::CanInsInto(u32_t idx, edi_grp_cl* pgrp) { bool bret; gtid_t tid_src; gtid_t tid_dst; GroupAr_cl *dst_ar; edi_grp_cl *grp_dst; grp_dst = Item(idx); dst_ar = grp_dst->getSubGrpAr(); if (NULL == dst_ar) return false; //check subgroup free space, then parent array (*this*) free space bret = dst_ar->CanInsert(pgrp); if (! bret) return bret; tid_dst = grp_dst->getTypeID(); tid_src = pgrp->getTypeID(); //subg_id must match, src must be a sub-group bret = (tid_src.subg_id == tid_dst.subg_id); bret &= tid_src.t_sub_gp; return bret; } bool GroupAr_cl::CanPaste(u32_t idx, edi_grp_cl* src_grp) { bool bret; edi_grp_cl *dst_grp; gtid_t tid_src; gtid_t tid_dst; i32_t src_bsz; i32_t dst_bsz; dst_grp = Item(idx); tid_dst = dst_grp->getTypeID(); tid_src = src_grp->getTypeID(); bret = (tid_dst.t32 == tid_src.t32); //type must match if (bret) goto _chk_size; //alternatively, if both src and dest are sub-groups, subg_id must match: //this allows to exchange matching sub-grps between different parent grps bret = tid_src.t_sub_gp; bret &= tid_dst.t_sub_gp; bret &= (tid_src.subg_id == tid_dst.subg_id); if (! bret) return bret; _chk_size: //DBC blocks of the same type can have different sizes src_bsz = src_grp->getTotalSize(); dst_bsz = dst_grp->getTotalSize(); if (src_bsz > dst_bsz) { src_bsz -= dst_bsz; bret &= (src_bsz <= free_sz); //parent block free space if (parent_ar != NULL) { dst_bsz = parent_ar->getFreeSpace(); bret &= (src_bsz <= dst_bsz); } } return bret; } bool GroupAr_cl::CanCut(u32_t idx) { bool bret; edi_grp_cl *pgrp; gtid_t tid; pgrp = Item(idx); tid = pgrp->getTypeID(); bret = ! (tid.t_gp_fixed | tid.t_p_holder); return bret; } bool GroupAr_cl::CanDelete(u32_t idx) { bool bret; edi_grp_cl *pgrp; gtid_t tid; pgrp = Item(idx); tid = pgrp->getTypeID(); bret = ! (tid.t_gp_fixed | tid.t_p_holder); return bret; } void GroupAr_cl::base_CalcDataSZ(i32_t blk_sz, i32_t hdr_sz) { u32_t n_grp; u32_t idx_grp; u32_t idx_subg; edi_grp_cl *pgrp; used_sz = hdr_sz; n_grp = GetCount(); for (idx_grp=0; idx_grpgetDataSize(); used_sz += dat_sz; for (idx_subg=0; idx_subggetSubGrpCount(); ++idx_subg) { p_subg = pgrp->getSubGroup(idx_subg); dat_sz = p_subg->getDataSize(); used_sz += dat_sz; } } free_sz = blk_sz; free_sz -= used_sz; } //EDID #pragma GCC diagnostic ignored "-Wunused-parameter" void EDID_GrpAr_cl::CalcDataSZ(edi_grp_cl *pgrp) { //blk size -1 chsum byte, -1 num_of_extensions byte base_CalcDataSZ( sizeof(edid_t) -2); } #pragma GCC diagnostic warning "-Wunused-parameter" bool EDID_GrpAr_cl::TypeSizeChk(edi_grp_cl* pgrp) { bool bret; gtid_t tid; bret = CanInsert(pgrp); if (! bret) return bret; //must be a DTD or alt. descriptor tid = pgrp->getTypeID(); bret = ((tid.t32 & ID_PARENT_MASK) >= ID_UNK); bret &= ((tid.t32 & ID_PARENT_MASK) <= ID_DTD); return bret; } bool EDID_GrpAr_cl::CanInsertUp(u32_t idx, edi_grp_cl* pgrp) { bool bret; gtid_t tid_dst; edi_grp_cl *dst_grp; bret = TypeSizeChk(pgrp); if (! bret) return bret; dst_grp = Item(idx); tid_dst = dst_grp->getTypeID(); bret = ! tid_dst.t_gp_fixed; //block @idx not fixed (ID_BED..ID_ETM) bret &= ! tid_dst.t_p_holder; //not ID_DMT2 return bret; } bool EDID_GrpAr_cl::CanInsertDn(u32_t idx, edi_grp_cl* pgrp) { bool bret; bret = TypeSizeChk(pgrp); bret &= (idx > 12); //last STI @idx=13 or a descriptor return bret; } //CEA groups array bool CEA_GrpAr_cl::CanMoveUp(u32_t idx) { edi_grp_cl *pgrp; bool b_DTD; gtid_t tid; bool bret; u32_t maxidx = GetCount(); if ( (idx == 0) || (idx >= maxidx) ) return false; pgrp = Item(idx); tid = pgrp->getTypeID(); bret = ! tid.t_gp_fixed; if (! bret) return false; b_DTD = (ID_DTD == tid.base_id); idx -- ; pgrp = Item(idx); tid = pgrp->getTypeID(); bret = ! tid.t_gp_fixed; //prev. grp not fixed (CEA header) if (! bret) return false; if (b_DTD) { //DTD and previous group is DTD bret = (ID_DTD == tid.base_id); return bret; } //DBC return true; } bool CEA_GrpAr_cl::CanMoveDn(u32_t idx) { bool bret; gtid_t tid; edi_grp_cl *pgrp; bret = base_CanMoveDn(idx); if (! bret) return bret; pgrp = Item(idx); tid = pgrp->getTypeID(); if (ID_DTD == tid.base_id) return true; //DBC and next group is not a DTD idx ++ ; pgrp = Item(idx); tid = pgrp->getTypeID(); bret = (ID_DTD != tid.base_id); return bret; } #pragma GCC diagnostic ignored "-Wunused-parameter" void CEA_GrpAr_cl::CalcDataSZ(edi_grp_cl *pgrp) { //blk size -1 chksum byte base_CalcDataSZ( sizeof(edid_t) -1); } #pragma GCC diagnostic warning "-Wunused-parameter" bool CEA_GrpAr_cl::CanInsertUp(u32_t idx, edi_grp_cl* pgrp) { bool bret; gtid_t tid; gtid_t tid_dst; edi_grp_cl *dst_grp; bret = CanInsert(pgrp); if (! bret) return bret; dst_grp = Item(idx); tid_dst = dst_grp->getTypeID(); tid = pgrp->getTypeID(); //types allowed for insertion bret = ! tid.t_sub_gp; //not a sub-group bret &= ! tid_dst.t_gp_fixed; //block @idx not fixed (CHD) bret &= (ID_DTD <= (tid.t32 & ID_PARENT_MASK)); if (! bret) return bret; if (ID_DTD != tid.base_id) { //not a DTD: //can insert only above existing DTD idx -- ; dst_grp = Item(idx); tid_dst = dst_grp->getTypeID(); bret = (ID_DTD != tid.base_id); return bret; } //Insert DTD: only above existing DTD bret = (ID_DTD == tid_dst.base_id); return bret; } bool CEA_GrpAr_cl::CanInsertDn(u32_t idx, edi_grp_cl* pgrp) { bool bret; gtid_t tid; gtid_t tid_dst; edi_grp_cl *dst_grp; bret = CanInsert(pgrp); if (! bret) return bret; dst_grp = Item(idx); tid_dst = dst_grp->getTypeID(); tid = pgrp->getTypeID(); //types allowed for insertion bret = ! tid.t_sub_gp; //not a sub-group bret &= (ID_DTD <= (tid.t32 & ID_PARENT_MASK)); if (! bret) return bret; if (ID_DTD == tid.base_id) { //DTD: //can insert after existing DTD if (ID_DTD == tid_dst.base_id) return true; bret = true; idx ++ ; if (idx < GetCount() ) { //can insert if next block is a DTD dst_grp = Item(idx); tid_dst = dst_grp->getTypeID(); bret = (ID_DTD == tid_dst.base_id); } return bret; } //not a DTD: //can insert only if block@idx is not a DTD bret = (ID_DTD != tid_dst.base_id); return bret; } //DBC sub-groups array void SubGrpAr_cl::CalcDataSZ(edi_grp_cl *pgrp) { i32_t ahf_sz; gtid_t tid; u32_t hdr_sz; ahf_sz = pgrp->getAHF_Size(); hdr_sz = 1; hdr_sz += ahf_sz; tid = pgrp->getTypeID(); if ((tid.t32 & ID_CEA_ET_MASK) != 0) hdr_sz ++ ; //+1 for ETag code base_CalcDataSZ(32, hdr_sz); } bool SubGrpAr_cl::doTypeMatch(u32_t idx, edi_grp_cl* pgrp) { bool bret; bool b_no_mv; gtid_t tid_src; gtid_t tid_dst; edi_grp_cl *dst_grp; edi_grp_cl *par_grp; bret = CanInsert(pgrp); if (! bret) return bret; dst_grp = Item(idx); tid_src = pgrp->getTypeID(); tid_dst = dst_grp->getTypeID(); b_no_mv = tid_dst.t_no_move; //group type must match: tid_dst.t32 &= (ID_SUBGRP_MASK | ID_PARENT_MASK); bret = (tid_dst.t32 == (tid_src.t32 & (ID_SUBGRP_MASK | ID_PARENT_MASK)) ); bret &= tid_src.t_sub_gp; //must be a sub-group //alternatively, parent->subg_id must match: //this allows to exchange matching sub-grps between different parent grps //currently only for base EDID::STI -> T8VTDB par_grp = dst_grp->getParentGrp(); if (par_grp != NULL) { tid_dst = par_grp->getTypeID(); bret |= (tid_src.subg_id == tid_dst.subg_id); bret &= (ID_INVALID != tid_dst.subg_id); //subg_id must be defined } bret &= ! b_no_mv; return bret; } bool SubGrpAr_cl::CanInsertUp(u32_t idx, edi_grp_cl* pgrp) { bool bret; bret = doTypeMatch(idx, pgrp); return bret; } bool SubGrpAr_cl::CanInsertDn(u32_t idx, edi_grp_cl* pgrp) { bool bret; bret = doTypeMatch(idx, pgrp); return bret; } bool SubGrpAr_cl::CanMoveUp(u32_t idx) { bool bret = false; u32_t maxidx = GetCount(); if ( (idx > 0) && (idx < maxidx) ) { edi_grp_cl *pgrp; gtid_t tid; //group is not fixed and moveable pgrp = Item(idx); tid = pgrp->getTypeID(); bret = ! tid.t_gp_fixed; bret &= ! tid.t_no_move; if (! bret) return false; //previous is not fixed and moveable idx -- ; pgrp = Item(idx); tid = pgrp->getTypeID(); bret = ! tid.t_gp_fixed; bret &= ! tid.t_no_move; } return bret; } bool SubGrpAr_cl::CanMoveDn(u32_t idx) { bool bret = false; u32_t maxidx = GetCount(); if (idx < (maxidx -1) ) { edi_grp_cl *pgrp; gtid_t tid; //group is not fixed and not place holder pgrp = Item(idx); tid = pgrp->getTypeID(); bret = ! tid.t_gp_fixed; bret &= ! tid.t_no_move; if (! bret) return false; //next group is not fixed and not place holder idx ++ ; pgrp = Item(idx); tid = pgrp->getTypeID(); bret = ! tid.t_gp_fixed; bret &= ! tid.t_no_move; } return bret; } edi_grp_cl* SubGrpAr_cl::Cut(u32_t idx) { u32_t rel_offs; u32_t abs_offs; u32_t parent_idx; edi_grp_cl *parent; edi_grp_cl *pgrp; edi_grp_cl **p_pgrp; p_pgrp = Detach(idx); pgrp = *p_pgrp; abs_offs = pgrp->getAbsOffs(); rel_offs = pgrp->getRelOffs(); parent = pgrp->getParentGrp(); if (idx < GetCount()) { UpdateRelOffs(idx, abs_offs, rel_offs); } CalcDataSZ(parent); parent->setDataSize(used_sz); abs_offs = parent->getAbsOffs(); parent_idx = parent->getParentArIdx(); parent_ar ->UpdateAbsOffs(parent_idx, abs_offs, false); parent_ar ->CalcDataSZ(NULL); pgrp->setParentGrp(NULL); pgrp->setArrayIdx(NULL, -1); return pgrp; } void SubGrpAr_cl::doInsert(u32_t idx, edi_grp_cl* pgrp, edi_grp_cl* parent) { u32_t abs_offs; u32_t rel_offs; u32_t parent_idx; gtid_t tid_src; gtid_t tid_dst; edi_grp_cl *dst_grp; if (NULL == parent) { dst_grp = Item(idx); parent = dst_grp->getParentGrp(); abs_offs = dst_grp->getAbsOffs(); rel_offs = dst_grp->getRelOffs(); } else { abs_offs = parent->getAbsOffs(); rel_offs = parent->getDataSize(); abs_offs += rel_offs; } tid_src = pgrp ->getTypeID(); tid_dst = parent ->getTypeID(); pgrp->setParentGrp(parent); pgrp->setArrayIdx(this, idx); Insert(pgrp, idx); CalcDataSZ(parent); UpdateRelOffs(idx, abs_offs, rel_offs); parent->setDataSize(used_sz); //DBC blocks of the same type can have different sizes abs_offs = parent->getAbsOffs(); parent_idx = parent->getParentArIdx(); parent_ar ->UpdateAbsOffs(parent_idx, abs_offs, false); parent_ar ->CalcDataSZ(NULL); } void SubGrpAr_cl::Paste(u32_t idx, edi_grp_cl* pgrp) { doInsert(idx, pgrp, NULL); idx ++ ; Delete(idx); } void SubGrpAr_cl::Delete(u32_t idx) { u32_t abs_offs; u32_t rel_offs; u32_t parent_idx; edi_grp_cl *pgrp; edi_grp_cl *parent; pgrp = Item(idx); abs_offs = pgrp->getAbsOffs(); rel_offs = pgrp->getRelOffs(); parent = pgrp->getParentGrp(); Detach(idx); delete pgrp; if (idx < GetCount()) { UpdateRelOffs(idx, abs_offs, rel_offs); } CalcDataSZ(parent); parent->setDataSize(used_sz); abs_offs = parent->getAbsOffs(); parent_idx = parent->getParentArIdx(); parent_ar ->UpdateAbsOffs(parent_idx, abs_offs, false); parent_ar ->CalcDataSZ(NULL); } void SubGrpAr_cl::MoveUp(u32_t idx) { //MoveUp(idx) == MoveDn(idx-1) idx -- ; MoveDn(idx); } void SubGrpAr_cl::MoveDn(u32_t idx) { u32_t abs_offs; u32_t rel_offs; edi_grp_cl *pgrp; edi_grp_cl **p_pgrp; p_pgrp = Detach(idx); pgrp = *p_pgrp; abs_offs = pgrp->getAbsOffs(); rel_offs = pgrp->getRelOffs(); idx ++ ; Insert (pgrp, idx); pgrp->setIndex(idx); idx -- ; //next group becomes prev. group UpdateRelOffs(idx, abs_offs, rel_offs); } void SubGrpAr_cl::InsertUp(u32_t idx, edi_grp_cl* pgrp) { doInsert(idx, pgrp, NULL); } void SubGrpAr_cl::InsertDn(u32_t idx, edi_grp_cl* pgrp) { u32_t n_grp; //InsertDn(idx) == InsertUp(idx+1) idx ++ ; n_grp = GetCount(); if (idx < n_grp) { doInsert(idx, pgrp, NULL); return; } //insert after last sub-group idx = (n_grp -1); doInsert(idx, pgrp, NULL); MoveDn (idx); } void SubGrpAr_cl::InsertInto(edi_grp_cl* parent, edi_grp_cl* pgrp) { doInsert(0, pgrp, parent); } wxedid-0.0.32/src/CEA_ET.cpp0000644000175000017500000026065314722720160012271 00000000000000/*************************************************************** * Name: CEA_ET_class.cpp * Purpose: CEA/CTA-861-G Extended Tag Codes * Author: Tomasz Pawlak (tomasz.pawlak@wp.eu) * Copyright: Tomasz Pawlak (C) 2019-2024 * License: GPLv3+ **************************************************************/ #include "debug.h" #include "rcdunits.h" #ifndef idCEA_ET #error "CEA_ET_class.cpp: missing unit ID" #endif #define RCD_UNIT idCEA_ET #include "rcode/rcode.h" #include "wxedid_rcd_scope.h" RCD_AUTOGEN_DEFINE_UNIT #include #include "vmap.h" #include "CEA.h" #include "CEA_class.h" #include "CEA_ET_class.h" #include "EDID_shared.h" //CEA bad block length msg (defined in CEA.cpp) extern const char ERR_GRP_LEN_MSG[]; //CEA header field descriptions (defined in CEA.cpp) extern const char CEA_BlkHdr_dscF0[]; extern const char CEA_BlkHdr_dscF1[]; extern const char CEA_BlkHdr_dscF2[]; extern const edi_field_t CEA_BlkHdr_fields[]; //CEA VDB video mode map (svd_vidfmt.h) extern sm_vmap SVD_vidfmt_map; //unknown/invalid byte field (defined in CEA.cpp) extern const edi_field_t unknown_byte_fld; extern void insert_unk_byte(edi_field_t *p_fld, u32_t len, u32_t s_offs); //SPM Speaker Presence Mask: shared description (defined in CEA.cpp) extern const char SAB_SPM_Desc[]; //SPM Speaker Presence Mask: shared field descriptors (SAB: defined in CEA.cpp) extern const gpfld_dsc_t SAB_SPM_fields; //------------------------------------------------------------------------------------------------- //CEA-DBC Extended Tag Codes //VCDB: Video Capability Data Block (DBC_ET_VCDB = 0) const char cea_vcdb_cl::Desc[] = "VCDB is used to declare display capability to overscan/underscan and the quantization range."; const gpfld_dsc_t cea_vcdb_cl::fields = { .flags = 0, .dat_sz = 1, .inst_cnt = 1, .fcount = 5, .fields = cea_vcdb_cl::fld_dsc }; const edi_field_t cea_vcdb_cl::fld_dsc[] = { //VCDB data {&EDID_cl::BitF8Val, 0, 2, 0, 2, F_BFD|F_INT, 0, 3, "S_CE01", "CE overscan/underscan:\n0= not supported\n1= always overscan\n" "2= always underscan\n3= both supported" }, {&EDID_cl::BitF8Val, 0, 2, 2, 2, F_BFD|F_INT, 0, 3, "S_IT01", "IT overscan/underscan:\n0= not supported\n1= always overscan\n" "2= always underscan\n3= both supported" }, {&EDID_cl::BitF8Val, 0, 2, 4, 2, F_BFD|F_INT, 0, 3, "S_PT01", "PT overscan/underscan:\n0= not supported\n1= always overscan\n" "2= always underscan\n3= both supported" }, {&EDID_cl::BitVal, 0, 2, 6, 1, F_BIT, 0, 3, "QS", "Quantization Range Selectable:\n1= selectable via AVI Q (RGB only), 0= no data" }, {&EDID_cl::BitVal, 0, 2, 7, 1, F_BIT, 0, 3, "QY", "Quantization Range:\n1= selectable via AVI YQ (YCC only), 0= no data" } }; const dbc_flatgp_dsc_t cea_vcdb_cl::VCDB_grp = { .CodN = "VCDB", .Name = "Video Capability Data Block", .Desc = Desc, .type_id = ID_VCDB, .flags = 0, .min_len = 2, .max_len = 2, .max_fld = (32 - sizeof(vcdb_t) - sizeof(ethdr_t) + 5), .hdr_fcnt = CEA_ETHDR_FCNT, .hdr_sz = sizeof(ethdr_t), .fld_arsz = 1, .fld_ar = &fields }; rcode cea_vcdb_cl::init(const u8_t* inst, u32_t orflags, edi_grp_cl* parent) { rcode retU; retU = base_DBC_Init_FlatGrp(inst, &VCDB_grp, orflags, parent); return retU; } //VSVD: Vendor-Specific Video Data Block (DBC_ET_VSVD = 1) const char cea_vsvd_cl::Desc[] = "Vendor-Specific Video Data Block: undefined data."; //fields shared with VSAD static const edi_field_t fld_dsc[] = { //VSVD data {&EDID_cl::ByteStr, 0, 2, 0, 3, F_STR|F_HEX|F_LE|F_RD, 0, 0xFFFFFF, "IEEE-OUI", "IEEE OUI (Organizationally Unique Identifier)" } }; static const gpfld_dsc_t VSVD_VSAD_fields = { .flags = 0, .dat_sz = 3, .inst_cnt = 1, .fcount = 1, .fields = fld_dsc }; const dbc_flatgp_dsc_t cea_vsvd_cl::VSVD_grp = { .CodN = "VSVD", .Name = "Vendor-Specific Video Data Block", .Desc = Desc, .type_id = ID_VSVD, .flags = 0, .min_len = (sizeof(vs_vadb_t) +1), .max_len = 31, .max_fld = (32 - sizeof(vs_vadb_t) - sizeof(ethdr_t) + 1), .hdr_fcnt = CEA_ETHDR_FCNT, .hdr_sz = sizeof(ethdr_t), .fld_arsz = 1, .fld_ar = &VSVD_VSAD_fields }; rcode cea_vsvd_cl::init(const u8_t* inst, u32_t orflags, edi_grp_cl* parent) { rcode retU; retU = base_DBC_Init_FlatGrp(inst, &VSVD_grp, orflags, parent); return retU; } //VDDD: VESA Display Device Data Block (DBC_ET_VDDD = 2) //VDDD: IFP: Interface properties const char vddd_iface_cl::CodN[] = "IFP"; const char vddd_iface_cl::Name[] = "Interface properties"; const char vddd_iface_cl::Desc[] = "Interface properties"; const edi_field_t vddd_iface_cl::fields[] = { //if_type {&EDID_cl::BitF8Val, 0, offsetof(vdddb_t, if_type), 4, 4, F_BFD|F_INT, 0, 0xC, "if_type", "Interface Type Code: (num of channels/sub-type)\n" "0x0= analog (sub-type in 'n_lanes' field)\n" "0x1= LVDS (any)\n" "0x2= RSDS (any)\n" "0x3= DVI-D (1 or 2)\n" "0x4= DVI-I, analog section (0)\n" "0x5= DVI-I, digital section (1 or 2)\n" "0x6= HDMI-A (1)\n" "0x7= HDMI-B (2)\n" "0x8= MDDI (1 or 2)\n" "0x9= DisplayPort (1,2 or 4)\n" "0xA= IEEE-1394 (0)\n" "0xB= M1, analog (0)\n" "0xC= M1, digital (1 or 2)\n" }, {&EDID_cl::BitF8Val, 0, offsetof(vdddb_t, if_type), 0, 4, F_BFD|F_INT, 0, 4, "n_lanes", "Number of lanes/channels provided by the interface.\n" "If interface type is 'analog' (0), then 'n_lanes' is interpreted as follows:\n" "0= 15HD/VGA (VESA EDDC std. pinout)\n" "1= VESA NAVI-V (15HD)\n" "2= VESA NAVI-D" }, //iface standard version and release {&EDID_cl::BitF8Val, 0, offsetof(vdddb_t, if_version), 4, 4, F_BFD|F_INT, 0, 0xF, "version", "Interface version number" }, {&EDID_cl::BitF8Val, 0, offsetof(vdddb_t, if_version), 0, 4, F_BFD|F_INT, 0, 0xF, "release", "Interface release number" }, //min/max clock frequency for each interface link/channel {&EDID_cl::BitF8Val, 0, offsetof(vdddb_t, clkfrng), 2, 6, F_BFD|F_INT|F_MHZ, 0, 63, "if_fmin", "Min clock frequency for each interface link/channel" }, {&EDID_cl::VDDD_IF_MaxF, 0, offsetof(vdddb_t, clkfrng), 0, 2, F_BFD|F_INT|F_MHZ, 0, 63, "if_fmax", "Max clock frequency for each interface link/channel" } }; rcode vddd_iface_cl::init(const u8_t* inst, u32_t orflags, edi_grp_cl* parent) { enum { fcount = 6 }; rcode retU; parent_grp = parent; type_id.t32 = ID_VDDD_IPF | orflags; retU = init_fields(&fields[0], inst, fcount, false, Name, Desc, CodN); return retU; } //VDDD: CPT: Content Protection const char vddd_cprot_cl::CodN[] = "CPT"; const char vddd_cprot_cl::Name[] = "Content Protection"; const char vddd_cprot_cl::Desc[] = "Content Protection"; const edi_field_t vddd_cprot_cl::fields[] = { //Content Protection support method {&EDID_cl::ByteVal, 0, offsetof(vdddb_t, cont_prot), 0, 1, F_BTE|F_INT, 0, 3, "ContProt", "Content Protection supported method:\n" "0= none supported\n" "1= HDCP\n" "2= DTCP\n" "3= DPCP (DisplayPort)" } }; rcode vddd_cprot_cl::init(const u8_t* inst, u32_t orflags, edi_grp_cl* parent) { enum { fcount = 1 }; rcode retU; parent_grp = parent; type_id.t32 = ID_VDDD_CPT | orflags; retU = init_fields(&fields[0], inst, fcount, false, Name, Desc, CodN); return retU; } //VDDD: AUPR: Audio properties const char vddd_audio_cl::CodN[] = "AUPR"; const char vddd_audio_cl::Name[] = "Audio properties"; const char vddd_audio_cl::Desc[] = "Audio properties"; const edi_field_t vddd_audio_cl::fields[] = { //Audio flags {&EDID_cl::BitF8Val, 0, offsetof(vdddb_t, audioflg), 0, 5, F_BFD|F_RD, 0, 0x7, "resvd04", "reserved (0)" }, {&EDID_cl::BitVal, 0, offsetof(vdddb_t, audioflg), 5, 1, F_BIT, 0, 1, "audio_ovr", "audio input override, 1= automatically override other audio inputs" }, {&EDID_cl::BitVal, 0, offsetof(vdddb_t, audioflg), 6, 1, F_BIT, 0, 1, "sep_achn", "separate audio channel inputs: not via video interface" }, {&EDID_cl::BitVal, 0, offsetof(vdddb_t, audioflg), 7, 1, F_BIT, 0, 1, "vid_achn", "1= audio support on video interface" }, //Audio delay {&EDID_cl::VDDD_AudioDelay, 0, offsetof(vdddb_t, audiodly), 0, 7, F_BFD|F_INT|F_MLS, 0, 254, "delay", "Audio delay in 2ms resolution.\n" "If dly> 254ms, the stored value is 254/2=127, i.e. 254ms is max,\n" "0= no delay compensation" }, {&EDID_cl::BitVal, 0, offsetof(vdddb_t, audiodly), 7, 1, F_BIT, 0, 1, "dly_sign", "Audio delay sign: 1= '+', 0= '-'" } }; rcode vddd_audio_cl::init(const u8_t* inst, u32_t orflags, edi_grp_cl* parent) { enum { fcount = 6 }; rcode retU; parent_grp = parent; type_id.t32 = ID_VDDD_AUD | orflags; retU = init_fields(&fields[0], inst, fcount, false, Name, Desc, CodN); return retU; } //VDDD: DPR: Display properties const char vddd_disp_cl::CodN[] = "DPR"; const char vddd_disp_cl::Name[] = "Display properties"; const char vddd_disp_cl::Desc[] = "Display properties"; const edi_field_t vddd_disp_cl::fields[] = { //H/V pixel count {&EDID_cl::VDDD_HVpix_cnt, 0, offsetof(vdddb_t, Hpix_cnt), 2, 6, F_INT|F_PIX, 1, 0x10000, "Hpix_cnt", "Count of pixels in horizontal direction: 1-65536" }, {&EDID_cl::VDDD_HVpix_cnt, 0, offsetof(vdddb_t, Vpix_cnt), 0, 2, F_INT|F_PIX, 1, 0x10000, "Vpix_cnt", "Count of pixels in vertical direction: 1-65536" }, //Aspect Ratio {&EDID_cl::VDDD_AspRatio, 0, offsetof(vdddb_t, aspect), 0, 1, F_FLT|F_NI, 0, 0xFF, "AspRatio", "Aspect ratio: stored value: 100*((long_axis/short_axis)-1)" }, //Scan Direction, Position of "zero" pixel, Display Rotation, Orientation {&EDID_cl::BitF8Val, 0, offsetof(vdddb_t, scanrot), 0, 2, F_BFD|F_INT, 0, 3, "scan_dir", "Scan Direction:\n" "0= undefined\n" "1= 'fast' along long axis, 'slow' along short axis\n" "2= 'fast' along short axis, 'slow' along long axis\n" "3= reserved" }, {&EDID_cl::BitF8Val, 0, offsetof(vdddb_t, scanrot), 2, 2, F_BFD|F_INT, 0, 3, "pix0_pos", "Position of 'zero' pixel:\n" "0= upper left corner\n" "1= upper right corner\n" "2= lower left corner\n" "3= lower right corner" }, {&EDID_cl::BitF8Val, 0, offsetof(vdddb_t, scanrot), 4, 2, F_BFD|F_INT, 0, 3, "rotation", "Possible display rotation:\n" "0= not possible\n" "1= 90 degrees clockwise\n" "2= 90 degrees counterclockwise\n" "3= both 1 & 2 possible" }, {&EDID_cl::BitF8Val, 0, offsetof(vdddb_t, scanrot), 6, 2, F_BFD|F_INT, 0, 3, "orientation", "Display Orientation:\n" "0= landscape\n" "1= portrait\n" "2= not fixed (can be rotated)\n" "3= undefined" }, //sub-pixel layout code {&EDID_cl::ByteVal, 0, offsetof(vdddb_t, cont_prot), 0, 1, F_BTE|F_INT, 0, 0xC, "subpixlc", "sub-pixel layout code:\n" "0x0= undefined\n" "0x1= RGB V-stripes\n" "0x2= RGB H-stripes\n" "0x3= RGB V-stripes, primary ordering matches chromaticity info in base EDID\n" "0x4= RGB H-stripes, primary ordering matches chromaticity info in base EDID\n" "0x5= 2x2 quad: red@top-left, blue@btm-right, remaining 2pix are green\n" "0x6= 2x2 quad: red@btm-left, blue@top-right, remaining 2pix are green\n" "0x7= delta (triad)\n" "0x8= mosaic\n" "0x9= 2x2 quad: 3 RGB + 1 extra color (*)\n" "0xA= 3 RGB + 2 extra colors below or above the RGB set (*)\n" "0xB= 3 RGB + 3 extra colors below or above the RGB set (*)\n" "0xC= Clairvoyante, Inc. PenTile Matrix(TM)\n\n" "(*) Additional sub-pixel's colors should be described in Additional Chromaticity Coordinates" "srtucture of this block (DDDB Std, section 2.16)" }, //horizontal/vertical pixel pitch {&EDID_cl::VDDD_HVpx_pitch, 0, offsetof(vdddb_t, Hpix_pitch), 0, 1, F_FLT|F_NI|F_MM, 0, 0xFF, "Hpix_pitch", "horizontal pixel pitch in 0.01mm (0.00 - 2.55)" }, {&EDID_cl::VDDD_HVpx_pitch, 0, offsetof(vdddb_t, Vpix_pitch), 0, 1, F_FLT|F_NI|F_MM, 0, 0xFF, "Vpix_pitch", "vertical pixel pitch in 0.01mm (0.00 - 2.55)" }, //miscellaneous display caps. {&EDID_cl::BitF8Val, 0, offsetof(vdddb_t, misccaps), 0, 3, F_BFD|F_RD, 0, 0x7, "resvd02", "reserved (0)" }, {&EDID_cl::BitVal, 0, offsetof(vdddb_t, misccaps), 3, 1, F_BIT, 0, 1, "deinterlacing", "deinterlacing, 1= possible" }, {&EDID_cl::BitVal, 0, offsetof(vdddb_t, misccaps), 4, 1, F_BIT, 0, 1, "ovrdrive", "overdrive not recommended, 1= src 'should' not overdrive the signal by default" }, {&EDID_cl::BitVal, 0, offsetof(vdddb_t, misccaps), 5, 1, F_BIT, 0, 1, "d_drive", "direct-drive, 0= no direct-drive" }, {&EDID_cl::BitF8Val, 0, offsetof(vdddb_t, misccaps), 6, 2, F_BFD, 0, 0x7, "dither", "dithering, 0=no, 1=spatial, 2=temporal, 3=both" }, //Frame rate and mode conversion {&EDID_cl::BitF8Val, 0, offsetof(vdddb_t, frm_rcnv), 0, 6, F_BFD|F_INT, 0, 0x3F, "frm_delta", "Frame rate delta range:\n" "max FPS deviation from default frame rate (+/- 63 FPS)" }, {&EDID_cl::BitF8Val, 0, offsetof(vdddb_t, frm_rcnv), 6, 2, F_BFD|F_INT, 0, 3, "conv_mode", "available conversion mode:\n" "0= none\n" "1= single buffer\n" "2= double buffer\n" "3= other, f.e. interframe interpolation" }, {&EDID_cl::ByteVal, 0, offsetof(vdddb_t, frm_rcnv), 1, 1, F_BTE|F_INT, 0, 0xFF, "frm_rate", "default frame rate (FPS)" }, //Color bit depth {&EDID_cl::BitF8Val, 0, offsetof(vdddb_t, colbitdpth), 0, 4, F_BFD|F_INT, 0, 0xF, "cbd_dev", "color bit depth: display device: value=cbd-1 (1-16)" }, {&EDID_cl::BitF8Val, 0, offsetof(vdddb_t, colbitdpth), 4, 4, F_BFD|F_INT, 0, 0xF, "cbd_iface", "color bit depth: interface: value=cbd-1 (1-16)" }, //Display response time {&EDID_cl::BitF8Val, 0, offsetof(vdddb_t, resp_time), 0, 7, F_BFD|F_INT|F_MLS, 0, 0x7F, "resp_time", "Display response time in milliseconds, max 126. 127 means greater than 126, but unspecified" }, {&EDID_cl::BitVal, 0, offsetof(vdddb_t, resp_time), 7, 1, F_BIT, 0, 1, "resp_type", "Display response time type:\n" "1=black-to-white\n" "0=white-to-black" }, //Overscan {&EDID_cl::BitF8Val, 0, offsetof(vdddb_t, overscan), 0, 4, F_BFD|F_INT|F_PCT, 0, 0xF, "V_overscan", "Vertical overscan, 0-15%, 0= no overscan (but doesn't mean 100% image match)" }, {&EDID_cl::BitF8Val, 0, offsetof(vdddb_t, overscan), 4, 4, F_BFD|F_INT|F_PCT, 0, 0xF, "H_overscan", "Horizontal overscan, 0-15%, 0= no overscan (but doesn't mean 100% image match)" } }; rcode vddd_disp_cl::init(const u8_t* inst, u32_t orflags, edi_grp_cl* parent) { enum { fcount = 24 }; rcode retU; parent_grp = parent; type_id.t32 = ID_VDDD_DPR | orflags; retU = init_fields(&fields[0], inst, fcount, false, Name, Desc, CodN); return retU; } //VDDD: CXY: Additional Chromaticity coords const char vddd_cxy_cl::CodN[] = "CXY"; const char vddd_cxy_cl::Name[] = "Additional Chromaticity coords"; const char vddd_cxy_cl::Desc[] = "Chromaticity coords for additional primary color sub-pixels"; const edi_field_t vddd_cxy_cl::fields[] = { //Additional Chromaticity Coordinates {&EDID_cl::BitF8Val, 0, offsetof(vdddb_t, addchrxy)+1, 0, 2, F_BFD|F_INT, 0, 0xF, "n_colors", "Number of additional chromaticity coordinates for primary colors 4-6\n" "Standard RGB primary colors are numbered 1-3 and described in base EDID structure" }, {&EDID_cl::BitF8Val, 0, offsetof(vdddb_t, addchrxy)+1, 2, 2, F_BFD|F_INT, 0, 0xF, "resvd32", "reserved (0)" }, {&EDID_cl::CHredX, 0, offsetof(vdddb_t, addchrxy), 0, 10, F_BFD|F_FLT|F_NI, 0, 1, "col4_x", "" }, {&EDID_cl::CHredY, 0, offsetof(vdddb_t, addchrxy), 0, 10, F_BFD|F_FLT|F_NI, 0, 1, "col4_y", "" }, {&EDID_cl::CHgrnX, 0, offsetof(vdddb_t, addchrxy), 0, 10, F_BFD|F_FLT|F_NI, 0, 1, "col5_x", "" }, {&EDID_cl::CHgrnY, 0, offsetof(vdddb_t, addchrxy), 0, 10, F_BFD|F_FLT|F_NI, 0, 1, "col5_y", "" }, {&EDID_cl::CHbluX, 0, offsetof(vdddb_t, addchrxy), 0, 10, F_BFD|F_FLT|F_NI, 0, 1, "col6_x", "" }, {&EDID_cl::CHbluY, 0, offsetof(vdddb_t, addchrxy), 0, 10, F_BFD|F_FLT|F_NI, 0, 1, "col6_y", "" } }; rcode vddd_cxy_cl::init(const u8_t* inst, u32_t orflags, edi_grp_cl* parent) { enum { fcount = 8 }; rcode retU; parent_grp = parent; type_id.t32 = ID_VDDD_CXY | orflags; retU = init_fields(&fields[0], inst, fcount, false, Name, Desc, CodN); return retU; } //VDDD: VESA Display Device Data Block: base class //NOTE: sub-groups data are not continuous within DBC. const char cea_vddd_cl::CodN[] = "VDDD"; const char cea_vddd_cl::Name[] = "VESA Display Device Data Block"; const char cea_vddd_cl::Desc[] = "Additional information about display device"; rcode cea_vddd_cl::init(const u8_t* inst, u32_t orflags, edi_grp_cl* parent) { rcode retU, retU2; u32_t dlen; edi_grp_cl* pgrp; bool b_edit_mode; RCD_SET_OK(retU2); parent_grp = parent; type_id.t32 = ID_VDDD; CopyInstData(inst, sizeof(vdddb_t)); //32 //create and init sub-groups: 5: IFP, CPT, AUD, DPR, CXY b_edit_mode = (0 != (T_MODE_EDIT & orflags)); dlen = reinterpret_cast (inst)->ehdr.hdr.tag.blk_len; if (dlen != 31) { wxedid_RCD_SET_FAULT_VMSG(retU2, ERR_GRP_LEN_MSG, CodN); if (! b_edit_mode) return retU2; goto _unk; } //NOTE: vdddb_t contains the block header, so the inst ptr is the same for all sub-groups // Local instance data are shared for all sub-groups. //IFP pgrp = new vddd_iface_cl; if (pgrp == NULL) RCD_RETURN_FAULT(retU); retU = pgrp->init(inst_data, (ID_VDDD | T_SUB_GRP | T_GRP_FIXED), this ); if (! RCD_IS_OK(retU)) return retU; pgrp->setAbsOffs(abs_offs); subgroups.Append(pgrp); //CPT pgrp = new vddd_cprot_cl; if (pgrp == NULL) RCD_RETURN_FAULT(retU); retU = pgrp->init(inst_data, (ID_VDDD | T_SUB_GRP | T_GRP_FIXED), this ); if (! RCD_IS_OK(retU)) return retU; pgrp->setAbsOffs(abs_offs); subgroups.Append(pgrp); //AUD pgrp = new vddd_audio_cl; if (pgrp == NULL) RCD_RETURN_FAULT(retU); retU = pgrp->init(inst_data, (ID_VDDD | T_SUB_GRP | T_GRP_FIXED), this ); if (! RCD_IS_OK(retU)) return retU; pgrp->setAbsOffs(abs_offs); subgroups.Append(pgrp); //DPR pgrp = new vddd_disp_cl; if (pgrp == NULL) RCD_RETURN_FAULT(retU); retU = pgrp->init(inst_data, (ID_VDDD | T_SUB_GRP | T_GRP_FIXED), this ); if (! RCD_IS_OK(retU)) return retU; pgrp->setAbsOffs(abs_offs); subgroups.Append(pgrp); //CXY pgrp = new vddd_cxy_cl; if (pgrp == NULL) RCD_RETURN_FAULT(retU); retU = pgrp->init(inst_data, (ID_VDDD | T_SUB_GRP | T_GRP_FIXED), this ); if (! RCD_IS_OK(retU)) return retU; pgrp->setAbsOffs(abs_offs); subgroups.Append(pgrp); _unk: retU = init_fields(&CEA_BlkHdr_fields[0], inst_data, CEA_ETHDR_FCNT, false, Name, Desc, CodN); if (! RCD_IS_OK(retU2)) { u8_t *p_inst = inst_data; if (dlen < sizeof(ethdr_t)) return retU2; p_inst += sizeof(ethdr_t); dlen -= sizeof(ethdr_t); retU = Append_UNK_DAT(p_inst, dlen, type_id.t32, abs_offs, 0, this); if ( (! RCD_IS_OK(retU)) && !b_edit_mode ) return retU; } subgroups.CalcDataSZ(this); if (! RCD_IS_OK(retU)) return retU2; return retU; } rcode EDID_cl::VDDD_IF_MaxF(u32_t op, wxString& sval, u32_t& ival, edi_dynfld_t* p_field) { rcode retU; u8_t *inst; inst = getValPtr(p_field); if (op == OP_READ) { u32_t tmpv; tmpv = reinterpret_cast (inst)->fmax_2msb; ival = reinterpret_cast (inst)->fmax_8lsb; tmpv <<= 8; ival |= tmpv; //2msb sval << ival; RCD_SET_OK(retU); } else { ulong utmp; RCD_SET_FAULT(retU); if (op == OP_WRSTR) { retU = getStrUint(sval, 10, p_field->field.minv, p_field->field.maxv, utmp); if (! RCD_IS_OK(retU)) return retU; } else if (op == OP_WRINT) { utmp = ival; RCD_SET_OK(retU); } else { RCD_RETURN_FAULT(retU); //wrong op code } { u32_t tmpv; utmp &= 0x3FF; tmpv = utmp >> 8; //2msb utmp &= 0xFF; //8lsb reinterpret_cast (inst)->fmax_2msb = tmpv; reinterpret_cast (inst)->fmax_8lsb = utmp; } } return retU; } rcode EDID_cl::VDDD_HVpix_cnt(u32_t op, wxString& sval, u32_t& ival, edi_dynfld_t* p_field) { rcode retU; u16_t *inst; inst = (u16_t*) getValPtr(p_field); if (op == OP_READ) { ival = *inst; ival += 1; //stored value is pix_count-1 sval << ival; RCD_SET_OK(retU); } else { ulong utmp; RCD_SET_FAULT(retU); if (op == OP_WRSTR) { retU = getStrUint(sval, 10, p_field->field.minv, p_field->field.maxv, utmp); if (! RCD_IS_OK(retU)) return retU; } else if (op == OP_WRINT) { utmp = ival; RCD_SET_OK(retU); } else { RCD_RETURN_FAULT(retU); //wrong op code } utmp -= 1; if (utmp > 0xFFFF) RCD_RETURN_FAULT(retU); //from ival *inst = utmp; } return retU; } rcode EDID_cl::VDDD_AspRatio(u32_t op, wxString& sval, u32_t& ival, edi_dynfld_t* p_field) { rcode retU; u8_t *inst; inst = getValPtr(p_field); if (op == OP_READ) { float dval; ival = *inst; dval = ival; dval /= 100.0; dval += 1.0; if (sval.Printf("%.03f", dval) < 0) { RCD_SET_FAULT(retU); } else { RCD_SET_OK(retU); } } else { u32_t utmp = 0; RCD_SET_FAULT(retU); if (op == OP_WRSTR) { float dval; retU = getStrFloat(sval, 1.0, 3.55, dval); if (! RCD_IS_OK(retU)) return retU; dval -= 1.0; dval *= 100.0; ival = dval; } else if (op == OP_WRINT) { ival &= 0xFF; utmp = ival; RCD_SET_OK(retU); } else { RCD_RETURN_FAULT(retU); //wrong op code } *inst = utmp; } return retU; } rcode EDID_cl::VDDD_HVpx_pitch(u32_t op, wxString& sval, u32_t& ival, edi_dynfld_t* p_field) { rcode retU; u8_t *inst; inst = getValPtr(p_field); if (op == OP_READ) { float dval; ival = *inst; dval = ival; dval /= 100.0; if (sval.Printf("%.03f", dval) < 0) { RCD_SET_FAULT(retU); } else { RCD_SET_OK(retU); } } else { u32_t utmp = 0; RCD_SET_FAULT(retU); if (op == OP_WRSTR) { float dval; retU = getStrFloat(sval, 0.0, 2.55, dval); if (! RCD_IS_OK(retU)) return retU; dval *= 100.0; ival = dval; } else if (op == OP_WRINT) { ival &= 0xFF; utmp = ival; RCD_SET_OK(retU); } else { RCD_RETURN_FAULT(retU); //wrong op code } *inst = utmp; } return retU; } rcode EDID_cl::VDDD_AudioDelay(u32_t op, wxString& sval, u32_t& ival, edi_dynfld_t* p_field) { rcode retU; u8_t *inst; inst = getValPtr(p_field); if (op == OP_READ) { ival = *inst; ival &= 0x7F; ival <<= 1; //2ms resolution sval << ival; RCD_SET_OK(retU); } else { ulong utmp; RCD_SET_FAULT(retU); if (op == OP_WRSTR) { retU = getStrUint(sval, 10, p_field->field.minv, p_field->field.maxv, utmp); if (! RCD_IS_OK(retU)) return retU; } else if (op == OP_WRINT) { utmp = ival; RCD_SET_OK(retU); } else { RCD_RETURN_FAULT(retU); //wrong op code } utmp >>= 1; utmp &= 0x7F; *inst = utmp; } return retU; } //CLDB: Colorimetry Data Block (DBC_ET_CLDB = 5) const char cea_cldb_cl::Desc[] = "The Colorimetry Data Block indicates support of specific extended colorimetry standards"; const gpfld_dsc_t cea_cldb_cl::fields = { .flags = 0, .dat_sz = sizeof(cldb_t), .inst_cnt = 1, .fcount = 11, .fields = cea_cldb_cl::fld_dsc }; const edi_field_t cea_cldb_cl::fld_dsc[] = { //byte2 {&EDID_cl::BitVal, 0, 2, 0, 1, F_BIT, 0, 1, "xvYCC601", "Standard Definition Colorimetry based on IEC 61966-2-4" }, {&EDID_cl::BitVal, 0, 2, 1, 1, F_BIT, 0, 1, "xvYCC709", "High Definition Colorimetry based on IEC 61966-2-4" }, {&EDID_cl::BitVal, 0, 2, 2, 1, F_BIT, 0, 1, "sYCC601", "Colorimetry based on IEC 61966-2-1/Amendment 1" }, {&EDID_cl::BitVal, 0, 2, 3, 1, F_BIT, 0, 1, "opYCC601", "Colorimetry based on IEC 61966-2-5, Annex A" }, {&EDID_cl::BitVal, 0, 2, 4, 1, F_BIT, 0, 1, "opRGB", "Colorimetry based on IEC 61966-2-5" }, {&EDID_cl::BitVal, 0, 2, 5, 1, F_BIT, 0, 1, "BT2020cYCC", "Colorimetry based on ITU-R BT.2020, Y’cC’BCC’RC" }, {&EDID_cl::BitVal, 0, 2, 6, 1, F_BIT, 0, 1, "BT2020YCC", "Colorimetry based on ITU-R BT.2020, Y’C’BC’R" }, {&EDID_cl::BitVal, 0, 2, 7, 1, F_BIT, 0, 1, "BT2020RGB", "Colorimetry based on ITU-R BT.2020, R’G’B’" }, //byte3 {&EDID_cl::BitF8Val, 0, 3, 0, 4, F_BFD|F_INT|F_RD, 0, 0x07, "MD03", "MD0-3: Designated for future gamut-related metadata. " "As yet undefined, this metadata is carried in an interface-specific way." }, {&EDID_cl::BitF8Val, 0, 3, 4, 3, F_BFD|F_INT|F_RD, 0, 0x07, "resvd46", "reserved (0)" }, {&EDID_cl::BitVal, 0, 3, 7, 1, F_BIT, 0, 1, "DCI-P3", "Colorimetry based on DCI-P3" } }; const dbc_flatgp_dsc_t cea_cldb_cl::CLDB_grp = { .CodN = "CLDB", .Name = "Colorimetry Data Block", .Desc = Desc, .type_id = ID_CLDB, .flags = 0, .min_len = (sizeof(cldb_t) +1), .max_len = (sizeof(cldb_t) +1), .max_fld = (32 - sizeof(cldb_t) - sizeof(ethdr_t) + 11), .hdr_fcnt = CEA_ETHDR_FCNT, .hdr_sz = sizeof(ethdr_t), .fld_arsz = 1, .fld_ar = &fields }; rcode cea_cldb_cl::init(const u8_t* inst, u32_t orflags, edi_grp_cl* parent) { rcode retU; retU = base_DBC_Init_FlatGrp(inst, &CLDB_grp, orflags, parent); return retU; } //HDRS: HDR Static Metadata Data Block (DBC_ET_HDRS = 6) const char cea_hdrs_cl::Desc[] = "Indicates the HDR capabilities of the Sink."; const edi_field_t cea_hdrs_cl::fld_byte_2_3_dsc[] = { //byte2 {&EDID_cl::BitVal, 0, 2, 0, 1, F_BIT, 0, 1, "SDR", "Traditional gamma - SDR Luminance Range" }, {&EDID_cl::BitVal, 0, 2, 1, 1, F_BIT, 0, 1, "HDR", "Traditional gamma - HDR Luminance Range" }, {&EDID_cl::BitVal, 0, 2, 2, 1, F_BIT, 0, 1, "SMPTE", "SMPTE ST 2084" }, {&EDID_cl::BitVal, 0, 2, 3, 1, F_BIT, 0, 1, "HLG", "Hybrid Log-Gamma (HLG) based on Recommendation ITU-R BT.2100-0" }, {&EDID_cl::BitVal, 0, 2, 4, 1, F_BIT|F_RD, 0, 1, "ET_4", "reserved (0)" }, {&EDID_cl::BitVal, 0, 2, 5, 1, F_BIT|F_RD, 0, 1, "ET_5", "reserved (0)" }, {&EDID_cl::BitF8Val, 0, 2, 6, 2, F_BFD|F_RD, 0, 1, "ET6-7", "reserved (0)" }, //byte3 {&EDID_cl::BitVal, 0, 3, 0, 1, F_BIT|F_RD, 0, 1, "SM_0", "Static Metadata Type 1" }, {&EDID_cl::BitF8Val, 0, 3, 1, 7, F_BFD|F_INT|F_RD, 0, 1, "SM1-7", "reserved (0)" } }; const edi_field_t cea_hdrs_cl::fld_opt_byte_4_5_6_dsc[] = { //byte 4,5,6 {&EDID_cl::ByteVal, 0, 4, 0, 1, F_BTE|F_INT|F_RD, 0, 0xFF, "max_lum", "(Optional) Desired Content Max Luminance data (8 bits)" }, {&EDID_cl::ByteVal, 0, 5, 0, 1, F_BTE|F_INT|F_RD, 0, 0xFF, "avg_lum", "(Optional) Desired Content Max Frame-average Luminance data (8 bits)" }, {&EDID_cl::ByteVal, 0, 6, 0, 1, F_BTE|F_INT|F_RD, 0, 0xFF, "min_lum", "(Optional) Desired Content Min Luminance data (8 bits)" } }; const dbc_flatgp_dsc_t cea_hdrs_cl::HDRS_grp = { .CodN = "HDRS", .Name = "HDR Static Metadata Data Block", .Desc = Desc, .type_id = ID_HDRS, .flags = 0, .min_len = 3, .max_len = (sizeof(hdrs_t) +1), .max_fld = (32 - sizeof(hdrs_t) - sizeof(ethdr_t) + 12), .hdr_fcnt = CEA_ETHDR_FCNT, .hdr_sz = sizeof(ethdr_t), .fld_arsz = 2, .fld_ar = cea_hdrs_cl::fields }; const gpfld_dsc_t cea_hdrs_cl::fields[] = { { //fld_byte_2_3 .flags = 0, .dat_sz = 2, .inst_cnt = 1, .fcount = 9, .fields = cea_hdrs_cl::fld_byte_2_3_dsc }, { //fld_opt_byte_4_5_6 .flags = T_FLEX_LAYOUT|T_FLEX_LEN, .dat_sz = 3, .inst_cnt = 1, .fcount = 3, .fields = cea_hdrs_cl::fld_opt_byte_4_5_6_dsc } }; rcode cea_hdrs_cl::init(const u8_t* inst, u32_t orflags, edi_grp_cl* parent) { rcode retU; retU = base_DBC_Init_FlatGrp(inst, &HDRS_grp, orflags, parent); return retU; } //HDRD: HDR Dynamic Metadata Data Block (DBC_ET_HDRD = 7) //HDRD: HDR Dynamic Metadata sub-group const char hdrd_mtd_cl::Desc[] = "HDR Dynamic Metadata"; const dbc_subg_dsc_t hdrd_mtd_cl::MTD_hdr = { .s_ctor = &hdrd_mtd_cl::group_new, .CodN = "HMTD", .Name = "HDR Dynamic Metadata", .Desc = Desc, .type_id = ID_HDRD_HMTD | T_SUB_GRP | T_P_HOLDER | T_NO_COPY, .min_len = sizeof(hdrd_mtd_t)-1, //min len for HDR_dmtd3 (no Support Flags byte) .fcount = 4, .inst_cnt = -1, .fields = hdrd_mtd_cl::fld_dsc }; const edi_field_t hdrd_mtd_cl::fld_dsc[] = { {&EDID_cl::ByteVal, 0, offsetof(hdrd_mtd_t, mtd_len), 0, 1, F_BTE|F_INT|F_RD|F_INIT, 0, (30-1), "length", "Length of the metadata block\n" }, {&EDID_cl::Word16, 0, offsetof(hdrd_mtd_t, mtd_type), 0, 2, F_HEX|F_RD|F_INIT, 0, 0xFFFF, "mtd_type", "Type of metadata:\n" "0x0000: Reserved\n" "0x0001: Metadata specified in Annex R\n" "0x0002: Supplemental Enhancement Information (SEI) messages, according to ETSI TS 103 433\n" "0x0003: Color Remapping Information SEI message according to ITU-T H.265\n" "0x0004: Metadata pecified in Annex S\n" "0x0005 .. 0xFFFF: Reserved" }, {&EDID_cl::BitF8Val, 0, offsetof(hdrd_mtd_t, supp_flg), 0, 4, F_BFD|F_INT|F_RD, 0, 0xF, "mtd_ver", "Support Flags: HDR metadata version for metadata types 1,2,4\n" "For metadata type = 0x0003 this field does not exist (and also the resvd47)" }, {&EDID_cl::BitF8Val, 0, offsetof(hdrd_mtd_t, supp_flg), 4, 4, F_BFD|F_INT|F_RD, 0, 0xF, "rsvd3_47", "reserved (0)" } }; #pragma GCC diagnostic ignored "-Wunused-parameter" rcode hdrd_mtd_cl::init(const u8_t* inst, u32_t orflags, edi_grp_cl* parent) { const hdrd_mtd_t *mtdata; rcode retU, retU2; u32_t dlen; u32_t blk_len; u32_t m_type; u32_t unk_offs; u32_t unk_byte; //payload bytes: not interpreted RCD_SET_OK(retU2); mtdata = reinterpret_cast (inst); blk_len = mtdata->mtd_len; m_type = mtdata->mtd_type; dyn_fcnt = MTD_hdr.fcount -2; //mtd_ver, resvd47 dlen = parent->getFreeSubgSZ(); parent_grp = parent; type_id.t32 = MTD_hdr.type_id; if (m_type != HDR_dmtd3) { if (blk_len < 4) { wxedid_RCD_SET_FAULT_VMSG(retU2, ERR_GRP_LEN_MSG, MTD_hdr.CodN); } } else { if (blk_len != 2) { wxedid_RCD_SET_FAULT_VMSG(retU2, ERR_GRP_LEN_MSG, MTD_hdr.CodN); } } if (blk_len < 2) { wxedid_RCD_SET_FAULT_VMSG(retU2, ERR_GRP_LEN_MSG, MTD_hdr.CodN); blk_len = 2; //use trash data from local buffer } blk_len += 1; // +metadata_length byte blk_len = (blk_len <= dlen ) ? blk_len : dlen; blk_len = (blk_len <= (30-1)) ? blk_len : (30-1); unk_byte = blk_len; unk_byte -= MTD_hdr.min_len; unk_offs = MTD_hdr.min_len; if (blk_len > MTD_hdr.min_len) { //only HDR_dmtd3 can be represented in full if (m_type != HDR_dmtd3) { dyn_fcnt += 2; //mtd_ver, resvd47 unk_offs += 1; unk_byte -= 1; } else { //DBC length ?> max length for HDR_dmtd3 wxedid_RCD_SET_FAULT_VMSG(retU2, ERR_GRP_LEN_MSG, MTD_hdr.CodN); } } CopyInstData(inst, blk_len); dyn_fldar = (edi_field_t*) malloc((dyn_fcnt + unk_byte) * EDI_FIELD_SZ); if (NULL == dyn_fldar) RCD_RETURN_FAULT(retU); { edi_field_t *p_fld; p_fld = dyn_fldar; memcpy( p_fld, &MTD_hdr.fields[0], (dyn_fcnt * EDI_FIELD_SZ) ); p_fld += dyn_fcnt; dyn_fcnt += unk_byte; insert_unk_byte(p_fld, unk_byte, unk_offs); retU = init_fields(dyn_fldar, inst_data, dyn_fcnt, false, MTD_hdr.Name, MTD_hdr.Desc, MTD_hdr.CodN); } if (RCD_IS_OK(retU)) return retU2; return retU; } #pragma GCC diagnostic warning "-Wunused-parameter" //HDRD: HDR Dynamic Metadata Data Block: base class const char cea_hdrd_cl::Desc[] = "HDR Dynamic Metadata Data Block"; const dbc_root_dsc_t cea_hdrd_cl::HDRD_grp = { .CodN = "HDRD", .Name = "HDR Dynamic Metadata Data Block", .Desc = Desc, .type_id = ID_HDRD | ID_HDRD_HMTD, .flags = 0, .min_len = sizeof(hdrd_mtd_t)+1, .max_len = 31, .hdr_fcnt = CEA_ETHDR_FCNT, .hdr_sz = sizeof(ethdr_t), .ahf_sz = 0, .ahf_cnt = 0, .ah_flds = NULL, .grp_arsz = 1, .grp_ar = &hdrd_mtd_cl::MTD_hdr }; rcode cea_hdrd_cl::init(const u8_t* inst, u32_t orflags, edi_grp_cl* parent) { rcode retU; retU = base_DBC_Init_RootGrp(inst, &HDRD_grp, orflags, parent); return retU; } //VFPD: Video Format Preference Data Block (DBC_ET_VFPD = 13) const char cea_vfpd_cl::Desc[] = "VFPD defines order of preference for selected video formats.\n\n" "Preferred formats can be referenced as an index of DTD or SVD already present in the EDID or directly, as a Video ID Code (VIC)." "The order defined here takes precedence over all other rules defined elsewhere in the standard." "Each byte in VFPD block contains Short Video Reference (SVR) code, first SVR is the most-preferred video format."; const dbc_root_dsc_t cea_vfpd_cl::VFPD_grp = { .CodN = "VFPD", .Name = "Video Format Preference Data", .Desc = Desc, .type_id = ID_VFPD | ID_VFPD_SVR, .flags = 0, .min_len = 2, .max_len = 31, .hdr_fcnt = CEA_ETHDR_FCNT, .hdr_sz = sizeof(ethdr_t), .ahf_sz = 0, .ahf_cnt = 0, .ah_flds = NULL, .grp_arsz = 1, .grp_ar = &cea_svr_cl::SVR_subg }; rcode cea_vfpd_cl::init(const u8_t* inst, u32_t orflags, edi_grp_cl* parent) { rcode retU; retU = base_DBC_Init_RootGrp(inst, &VFPD_grp, orflags, parent); return retU; } u32_t EDID_cl::CEA_VFPD_SVR_decode(u32_t svr, u32_t& ndtd) { u32_t dtd = 0; u32_t mode = (svr & 0xFF); switch (svr) { case 0 ... 128: //0, 128 reserved, 1..127 -> VIC code break; case 129 ... 144: //DTD 1..16 dtd = (mode - 128); break; case 145 ... 192: //reserved break; default: //193 ... 255: vid_fmt.cpp: max VIC is 219, natv=0, 220..255 are reserved in G spec. break; } ndtd = dtd; return mode; } //VFPD: Video Format Preference Data Block -> //SVR: Short Video Reference const char cea_svr_cl::Desc[] = "Short Video Reference: " "contains index number of preferred resolution defined in CEA/CTA-861 standard " "or a DTD index"; const dbc_subg_dsc_t cea_svr_cl::SVR_subg = { .s_ctor = &cea_svr_cl::group_new, .CodN = "SVR", .Name = "Short Video Reference", .Desc = Desc, .type_id = ID_VFPD_SVR | T_SUB_GRP, .min_len = 1, .fcount = 1, .inst_cnt = -1, .fields = cea_svr_cl::fld_dsc }; const edi_field_t cea_svr_cl::fld_dsc[] = { //NOTE: no F_VS flag: no value selector menu //SVD_vidfmt_map used only in MAIN::SaveRep_SubGrps() {&EDID_cl::ByteVal, VS_SVD_VIDFMT, 0, 0, 1, F_BTE|F_INT, 0, 0xFF, "SVR", "The SVR codes are interpreted as follows:\n" "0\t\t: reserved\n" "1-127\t: VIC\n" "128\t\t: reserved\n" "129-144\t: Nth DTD block, N=SVR-128 (1..16)\n" "145-192\t: reserved\n" "193-219\t: VIC\n" "220-255\t: reserved" } }; #pragma GCC diagnostic ignored "-Wunused-parameter" rcode cea_svr_cl::init(const u8_t* inst, u32_t orflags, edi_grp_cl* parent) { rcode retU; parent_grp = parent; type_id.t32 = SVR_subg.type_id; CopyInstData(inst, 1); retU = init_fields(&fld_dsc[0], inst_data, SVR_subg.fcount, false, SVR_subg.Name, SVR_subg.Desc, SVR_subg.CodN); return retU; } #pragma GCC diagnostic warning "-Wunused-parameter" //Y42V: YCBCR 4:2:0 Video Data Block (DBC_ET_Y42V = 14) const char cea_y42v_cl::Desc[] = "List of Short Video Descriptors (SVD), for which the ONLY supported sampling mode is YCBCR 4:2:0 " "(all other sampling modes are NOT supported: RGB, YCBCR 4:4:4, or YCBCR 4:2:2)\n" "NOTE:\nBy default, SVDs in this block shall be less preferred than all regular " "SVDs - this can be changed using Video Format Preference Data Block (VFPD)"; const dbc_root_dsc_t cea_y42v_cl::Y42V_grp = { .CodN = "Y42V", .Name = "YCBCR 4:2:0 Video Data Block", .Desc = Desc, .type_id = ID_Y42V | ID_SVD, .flags = 0, .min_len = sizeof(svd_t)+1, .max_len = 31, .hdr_fcnt = CEA_ETHDR_FCNT, .hdr_sz = sizeof(ethdr_t), .ahf_sz = 0, .ahf_cnt = 0, .ah_flds = NULL, .grp_arsz = 1, .grp_ar = &cea_svd_cl::SVD_subg }; rcode cea_y42v_cl::init(const u8_t* inst, u32_t orflags, edi_grp_cl* parent) { rcode retU; retU = base_DBC_Init_RootGrp(inst, &Y42V_grp, orflags, parent); return retU; } //Y42C: YCBCR 4:2:0 Capability Map Data Block (DBC_ET_Y42C = 15) const char cea_y42c_cl::CodN[] = "Y42C"; const char cea_y42c_cl::Name[] = "YCBCR 4:2:0 Capability Map Data Block"; const char cea_y42c_cl::Desc[] = "Bytes in this block are forming a bitmap, in which a single bit indicates whether a format defined in VDB::SVD " "supports YCBCR 4:2:0 sampling mode (in addition to other modes: RGB, YCBCR 4:4:4, or YCBCR 4:2:2)\n" "0= SVD does NOT support YCBCR 4:2:0\n" "1= SVD supports YCBCR 4:2:0 in addition to other modes\n\n" "Bit 0 in 1st byte refers to 1st SVD in VDB, bit 1 refers to 2nd SVD, and so on, " "and 9th SVD is referenced by bit 0 in 2nd byte."; const edi_field_t cea_y42c_cl::bitmap_fld = {&EDID_cl::BitVal, 0, 0, 0, 1, F_BIT|F_GD, 0, 1, NULL, "" }; rcode cea_y42c_cl::init(const u8_t* inst, u32_t orflags, edi_grp_cl* parent) { rcode retU, retU2; u32_t dlen; u32_t offs; u32_t svdn; edi_field_t *p_fld; y42c_svdn_t *p_svdn; bool b_edit_mode; RCD_SET_OK(retU2); b_edit_mode = (0 != (T_MODE_EDIT & orflags)); dlen = reinterpret_cast (inst)->ehdr.hdr.tag.blk_len; if (dlen < 2) { //min 1 bitmap byte wxedid_RCD_SET_FAULT_VMSG(retU2, ERR_GRP_LEN_MSG, CodN); if (! b_edit_mode) return retU2; } parent_grp = parent; type_id.t32 = ID_Y42C | orflags; offs = dlen; if (dlen < 2) offs = 2; offs ++ ; //hdr CopyInstData(inst, offs); if (dlen >= 2) { dlen -= 1; } else { dlen = 0; } //max 30 bytes * 8 bits = 240 //+ hdr + ext_tag -> max = 243 fields. //buffer for array of fields is allocated dynamically dyn_fcnt = (dlen << 3); //max 30 bytes * 8 bits dyn_fcnt += CEA_ETHDR_FCNT; //alloc fields array dyn_fldar = (edi_field_t*) malloc( dyn_fcnt * EDI_FIELD_SZ ); if (NULL == dyn_fldar) RCD_RETURN_FAULT(retU); p_fld = dyn_fldar; //CEA-DBC-EXT header fields memcpy( p_fld, CEA_BlkHdr_fields, (CEA_ETHDR_FCNT * EDI_FIELD_SZ) ); if (dlen == 0) { wxedid_RCD_SET_FAULT_VMSG(retU2, ERR_GRP_LEN_MSG, CodN); goto grp_empty; //manual editing of blk_len } //alloc array of y42c_svdn_t: dynamic field names svdn_ar = (y42c_svdn_t*) malloc( dyn_fcnt * sizeof(y42c_svdn_t) ); if (NULL == svdn_ar) RCD_RETURN_FAULT(retU); p_fld += CEA_ETHDR_FCNT; offs = sizeof(ethdr_t); //1st bitmap byte p_svdn = svdn_ar; svdn = 0; //SVD map data: 1 field per bit for (u32_t itb=0; itboffs = offs; p_fld->shift = bitn; //dynamic field name: snprintf(p_svdn->svd_num, sizeof(y42c_svdn_t), "SVD_%u", svdn); p_svdn->svd_num[7] = 0; p_fld->name = p_svdn->svd_num; p_fld += 1; p_svdn += 1; svdn += 1; } offs += 1; } grp_empty: retU = init_fields(&dyn_fldar[0], inst_data, dyn_fcnt, false, Name, Desc, CodN); if (RCD_IS_OK(retU)) return retU2; return retU; } //VSAD: Vendor-Specific Audio Data Block (DBC_ET_VSAD = 17) const char cea_vsad_cl::Desc[] = "Vendor-Specific Audio Data Block: undefined data."; const dbc_flatgp_dsc_t cea_vsad_cl::VSAD_grp = { .CodN = "VSAD", .Name = "Vendor-Specific Audio Data Block", .Desc = Desc, .type_id = ID_VSAD, .flags = 0, .min_len = (sizeof(vs_vadb_t) +1), .max_len = 31, .max_fld = (32 - sizeof(vs_vadb_t) - sizeof(ethdr_t) + 1), .hdr_fcnt = CEA_ETHDR_FCNT, .hdr_sz = sizeof(ethdr_t), .fld_arsz = 1, .fld_ar = &VSVD_VSAD_fields //fields shared with VSVD }; rcode cea_vsad_cl::init(const u8_t* inst, u32_t orflags, edi_grp_cl* parent) { rcode retU; retU = base_DBC_Init_FlatGrp(inst, &VSAD_grp, orflags, parent); return retU; } //HADB: HDMI Audio Data Block (DBC_ET_HADB = 18) //NOTE: HDMI_3D_AD structure is the same as SAD (cea_sad_cl) //NOTE: HDMI_3D_SAD structure is the same as SAB + ACAT field const char cea_hadb_cl::Desc[] = "HDMI Audio Data Block"; const dbc_root_dsc_t cea_hadb_cl::HADB_root = { .CodN = "HADB", .Name = "HDMI Audio Data Block", .Desc = Desc, .type_id = ID_HADB | ID_SAD, .flags = 0, .min_len = sizeof(hadb_hdr_t) +1, //ETag + HADB header .max_len = 31, .hdr_fcnt = CEA_ETHDR_FCNT, .hdr_sz = sizeof(ethdr_t), .ahf_sz = sizeof(hadb_hdr_t), //+2 for additioonal fields of HADB header .ahf_cnt = 5, .ah_flds = cea_hadb_cl::ah_flds, .grp_arsz = 2, .grp_ar = HADB_subg }; const dbc_subg_dsc_t cea_hadb_cl::HADB_subg[] = { { //cea_sad_cl::SAD_subg .s_ctor = &cea_sad_cl::group_new, .CodN = "SAD", .Name = "Short Audio Descriptor", .Desc = cea_sad_cl::Desc, .type_id = ID_SAD | T_SUB_GRP, .min_len = sizeof(sad_t), .fcount = 0, .inst_cnt = 0, //variable: hadb_hdr_t.num_a3dsc .fields = NULL }, { //hadb_sab3d_cl .s_ctor = &hadb_sab3d_cl::group_new, .CodN = hadb_sab3d_cl::CodN, .Name = hadb_sab3d_cl::Name, .Desc = hadb_sab3d_cl::Desc, .type_id = ID_SAB3D | T_SUB_GRP | T_NO_MOVE, .min_len = sizeof(hadb_sab_t), .fcount = 0, .inst_cnt = 1, .fields = NULL } }; const edi_field_t cea_hadb_cl::ah_flds[] = { {&EDID_cl::BitF8Val, 0, sizeof(ethdr_t), 0, 2, F_BFD|F_INT, 0, 3, "max_strm_cnt", "max number of audio streams in Multi-Stream Audio packets\n" " 0b00: (0) no MSA support,\n 0b01: (1) 2 streams\n" " 0b10: (2) 2 or 3 streams,\n 0b11: (3) 2,3 or 4 streams" }, {&EDID_cl::BitVal, 0, sizeof(ethdr_t), 2, 1, F_BIT|F_INT, 0, 1, "srt_mix", "Support for mixing of additional streams, 1: supported" }, {&EDID_cl::BitF8Val, 0, sizeof(ethdr_t), 3, 5, F_BFD, 0, 3, "res3_37", "reserved (0)" }, {&EDID_cl::BitF8Val, 0, sizeof(ethdr_t)+1, 0, 3, F_BFD|F_INT|F_INIT, 0, 3, "num_a3dsc", "Number of 3D audio descriptors, (0..7), max 6" }, {&EDID_cl::BitF8Val, 0, sizeof(ethdr_t)+1, 3, 5, F_BFD, 0, 3, "res4_37", "reserved (0)" }, }; rcode cea_hadb_cl::init(const u8_t* inst, u32_t orflags, edi_grp_cl* parent) { const hadb_hdr_t *hadb; dbc_subg_dsc_t *pSAD_grp; dbc_root_dsc_t HADB_tmp; dbc_subg_dsc_t subg_tmp[HADB_root.grp_arsz]; rcode retU; i32_t n_a3dsc; //can't use cea_sad_cl::SAD_subg directly: //SAD inst. count must match num_a3dsc, working on a copy: memcpy(&HADB_tmp, &HADB_root, sizeof(dbc_root_dsc_t)); memcpy(&subg_tmp, &HADB_subg, sizeof(dbc_subg_dsc_t) << 1); pSAD_grp = &subg_tmp[0]; hadb = reinterpret_cast (inst + sizeof(ethdr_t)); n_a3dsc = hadb->num_a3dsc; HADB_tmp.grp_ar = subg_tmp; pSAD_grp->inst_cnt = n_a3dsc; retU = base_DBC_Init_RootGrp(inst, &HADB_tmp, orflags, parent); return retU; } const char hadb_sab3d_cl::CodN[] = "SAB3D"; const char hadb_sab3d_cl::Name[] = "Speaker Allocation Descriptor"; const char hadb_sab3d_cl::Desc[] = "This is essentially a SAB structure extended with additional ACAT" "fields (Audio Channel Allocation Type)."; extern const edi_field_t SAB_SPM_fld_dsc[]; //CEA.cpp #pragma GCC diagnostic ignored "-Wunused-parameter" rcode hadb_sab3d_cl::init(const u8_t* inst, u32_t orflags, edi_grp_cl* parent) { enum { fcount = 26, //SAB_SPM_fld_dsc: +2 additional fields for ACAT offs = -1 //SAB_SPM_fld_dsc: adjust offsets for SAB3D instance }; rcode retU; //not using orflags: //base_DBC_Init_RootGrp() is passing sub-grp ID -> this would malform the ID type_id.t32 = ID_SAB3D | T_SUB_GRP | T_NO_MOVE | T_P_HOLDER; parent_grp = parent; CopyInstData(inst, sizeof(hadb_sab_t)); retU = init_fields(&SAB_SPM_fld_dsc[0], inst_data, fcount, false, Name, Desc, CodN, offs); { //move ACAT field to top of list u32_t idx; edi_dynfld_t **pfld; idx = FieldsAr.GetCount() -1; pfld = FieldsAr.Detach(idx); FieldsAr.Insert(pfld, 0); } return retU; } #pragma GCC diagnostic warning "-Wunused-parameter" extern const char SAB_SPM_CodN[]; extern const char SAB_SPM_Name[]; extern const char SAB_SPM_Desc[]; //RMCD: Room Configuration Data Block: base class const char cea_rmcd_cl::Desc[] = "Room Configuration Data Block (RMCD) describes playback environment, using room coordinate system."; //Handler for normalized values, rcode EDID_cl::RMCD_NormV(u32_t op, wxString& sval, u32_t& ival, edi_dynfld_t* p_field) { rcode retU; float fval; i32_t i32; i8_t *inst; inst = (i8_t*) getValPtr(p_field); if (op == OP_READ) { i32 = (i32_t) *inst; fval = i32; fval /= 64.0; sval.Printf("%.06f", fval); ival = (u32_t) i32; RCD_SET_OK(retU); } else { RCD_SET_FAULT(retU); if (op == OP_WRSTR) { retU = getStrFloat(sval, -2.00000001, 1.98437501, fval); i32 = (fval * 64.0); } else if (op == OP_WRINT) { i32 = (i32_t) ival; RCD_SET_OK(retU); } if (! RCD_IS_OK(retU)) return retU; *inst = (i8_t) i32; } return retU; } const dbc_root_dsc_t cea_rmcd_cl::RMCD_root = { .CodN = "RMCD", .Name = "Room Configuration Data Block", .Desc = Desc, .type_id = ID_RMCD, .flags = 0, .min_len = sizeof(rmcd_t)+1, .max_len = sizeof(rmcd_t)+1, .hdr_fcnt = CEA_ETHDR_FCNT, .hdr_sz = sizeof(ethdr_t), .ahf_sz = 1, .ahf_cnt = 4, .ah_flds = cea_rmcd_cl::ah_flds, .grp_arsz = 3, .grp_ar = RMCD_subg }; const dbc_subg_dsc_t cea_rmcd_cl::RMCD_subg[] = { { .s_ctor = &rmcd_spm_cl::group_new, .CodN = SAB_SPM_CodN, .Name = SAB_SPM_Name, .Desc = SAB_SPM_Desc, .type_id = ID_RMCD_SPM | T_SUB_GRP, .min_len = sizeof(spk_mask_t), .fcount = 0, .inst_cnt = 1, .fields = {} }, { .s_ctor = &rmcd_spkd_cl::group_new, .CodN = rmcd_spkd_cl::CodN, .Name = rmcd_spkd_cl::Name, .Desc = rmcd_spkd_cl::Desc, .type_id = ID_RMCD_SPKD | T_SUB_GRP, .min_len = sizeof(spk_plpd_t), .fcount = 3, .inst_cnt = 1, .fields = rmcd_spkd_cl::fld_dsc }, { .s_ctor = &rmcd_dspc_cl::group_new, .CodN = rmcd_dspc_cl::CodN, .Name = rmcd_dspc_cl::Name, .Desc = rmcd_dspc_cl::Desc, .type_id = ID_RMCD_DSPC | T_SUB_GRP, .min_len = sizeof(disp_xyz_t), .fcount = 3, .inst_cnt = 1, .fields = rmcd_dspc_cl::fld_dsc } }; const edi_field_t cea_rmcd_cl::ah_flds[] = { {&EDID_cl::BitVal, 0, sizeof(ethdr_t), 5, 1, F_BIT, 0, 1, "SLD", "SLD:\n 1: SPKLD Speaker Location Descriptors should be present for every speakr,\n" " 0: SLDB::SPKLD are not available, only SPM is used." }, {&EDID_cl::BitVal, 0, sizeof(ethdr_t), 6, 1, F_BIT, 0, 1, "Speaker", "Speaker:\n 1= spk_cnt is valid,\n 0= spk_cnt is unused (should be 0) " }, {&EDID_cl::BitVal, 0, sizeof(ethdr_t), 7, 1, F_BIT, 0, 1, "Display", "1= fields in DSPC (Display Coordinates) are valid (used)" }, {&EDID_cl::BitF8Val, 0, sizeof(ethdr_t), 0, 5, F_BFD|F_INT, 0, 0x7, "spk_cnt", "Speaker Count: number of LPCM_channels -1, required for SLD=1" } }; rcode cea_rmcd_cl::init(const u8_t* inst, u32_t orflags, edi_grp_cl* parent) { rcode retU; orflags |= T_GRP_FIXED; retU = base_DBC_Init_RootGrp(inst, &RMCD_root, orflags, parent); return retU; } //RMCD: SPM: Speaker Presence Mask //NOTE: Desc is shared with SAB: CEA.cpp rcode rmcd_spm_cl::init(const u8_t* inst, u32_t orflags, edi_grp_cl* parent) { enum { offs = -1 //SAB_SPM_fld_dsc: adjust offsets for SPM instance }; rcode retU; u32_t fcount; fcount = SAB_SPM_fields.fcount; parent_grp = parent; type_id.t32 = ID_RMCD_SPM | T_SUB_GRP | orflags; CopyInstData(inst, sizeof(spk_mask_t)); retU = init_fields(&SAB_SPM_fld_dsc[0], inst_data, fcount, false, SAB_SPM_Name, SAB_SPM_Desc, SAB_SPM_CodN, offs); return retU; } //RMCD: SPKD: Speaker Distance const char rmcd_spkd_cl::CodN[] = "SPKD"; const char rmcd_spkd_cl::Name[] = "Speaker Distance"; const char rmcd_spkd_cl::Desc[] = "Speaker distances in X,Y,Z axes from Primary Listening Position (PLP) in decimeters [dm]\n\n" "NOTE:\nCTA-861-H essentially agrees with G-spec, but (apparentl erroneously) defines default " "values for X/Y/Zmax, saying that f.e. 0x10 (16 dec) corresponds to 32 decimeters"; const edi_field_t rmcd_spkd_cl::fld_dsc[] = { {&EDID_cl::ByteVal, 0, 0, 0, 1, F_BTE|F_INT|F_DM, 0, 255, "Xmax", "X-axis max distance from PLP\n""If not used, it should be set to 0x10"}, {&EDID_cl::ByteVal, 0, 1, 0, 1, F_BTE|F_INT|F_DM, 0, 255, "Ymax", "Y-axis max distance from PLP\n""If not used, it should be set to 0x10"}, {&EDID_cl::ByteVal, 0, 2, 0, 1, F_BTE|F_INT|F_DM, 0, 255, "Zmax", "Z-axis max distance from PLP\n""If not used, it should be set to 0x08"} }; rcode rmcd_spkd_cl::init(const u8_t* inst, u32_t orflags, edi_grp_cl* parent) { enum { fcount = 3 }; rcode retU; parent_grp = parent; type_id.t32 = ID_RMCD_SPKD | T_SUB_GRP | orflags; CopyInstData(inst, sizeof(spk_plpd_t)); retU = init_fields(&fld_dsc[0], inst_data, fcount, false, Name, Desc, CodN); return retU; } //RMCD: DSPC: Display Coordinates const char rmcd_dspc_cl::CodN[] = "DSPC"; const char rmcd_dspc_cl::Name[] = "Display Coordinates"; const char rmcd_dspc_cl::Desc[] = "Display Coordinates normalized to X/Y/Zmax distances in SPKD (Speaker Distance)\n" "Normalized values are in range -2.0 .. 1.984375"; const edi_field_t rmcd_dspc_cl::fld_dsc[] = { {&EDID_cl::RMCD_NormV, 0, 0, 0, 1, F_BTE|F_FLT, 0, 255, "DisplayX", "X-coordinate value normalized to Xmax in SPKD\n" "If not used, it should be set to 0x00 (0.0)"}, {&EDID_cl::RMCD_NormV, 0, 1, 0, 1, F_BTE|F_FLT, 0, 255, "DisplayY", "Y-coordinate value normalized to Ymax in SPKD\n" "If not used, it should be set to 0x40 (1.0)"}, {&EDID_cl::RMCD_NormV, 0, 2, 0, 1, F_BTE|F_FLT, 0, 255, "DisplayZ", "Z-coordinate value normalized to Zmax in SPKD\n" "If not used, it should be set to 0x00 (0.0)"} }; rcode rmcd_dspc_cl::init(const u8_t* inst, u32_t orflags, edi_grp_cl* parent) { enum { fcount = 3 }; rcode retU; parent_grp = parent; type_id.t32 = ID_RMCD_DSPC | T_SUB_GRP | orflags; CopyInstData(inst, sizeof(disp_xyz_t)); retU = init_fields(&fld_dsc[0], inst_data, fcount, false, Name, Desc, CodN); return retU; } //SLDB: Speaker Location Data Block (DBC_ET_SLDB = 20) //SLDB: SPKLD: Speaker Location Descriptor sm_vmap SPKLD_IDX_map = { {0x00, {0, "FL" , "Front Left" }}, {0x01, {0, "FR" , "Front Right" }}, {0x02, {0, "FC" , "Front Center"}}, {0x03, {0, "LFE1" , "Low Frequency Effects 1 (subwoofer1)"}}, {0x04, {0, "BL" , "Back Left" }}, {0x05, {0, "BR" , "Back Right" }}, {0x06, {0, "FLC" , "Front Left of Center"}}, {0x07, {0, "FRC" , "Front Right of Center"}}, {0x08, {0, "BC" , "Back Center"}}, {0x09, {0, "LFE2" , "Low Frequency Effects 2 (subwoofer2)"}}, {0x0A, {0, "SiL" , "Side Left" }}, {0x0B, {0, "SiR" , "Side Right"}}, {0x0C, {0, "TpFL" , "Top Front Left" }}, {0x0D, {0, "TpFR" , "Top Front Right" }}, {0x0E, {0, "TpFC" , "Top Front Center"}}, {0x0F, {0, "TpC" , "Top Center" }}, {0x10, {0, "TpBL" , "Top Back Left" }}, {0x11, {0, "TpBR" , "Top Back Right" }}, {0x12, {0, "TpSiL", "Top Side Left" }}, {0x13, {0, "TpSiR", "Top Side Right" }}, {0x14, {0, "TpBC" , "Top Back Center" }}, {0x15, {0, "BtFC" , "Bottom Front Center"}}, {0x16, {0, "BtFL" , "Bottom Front Left" }}, {0x17, {0, "BtFR" , "Bottom Front Right" }}, {0x18, {0, "FLW" , "Front Left Wide" }}, {0x19, {0, "FRW" , "Front Right Wide"}}, {0x1A, {0, "LS" , "Left Surround" }}, {0x1B, {0, "RS" , "Right Surround" }} }; const char spkld_cl::Desc[] = "Speaker Location Descriptor"; static const char SLDB_SPK_index[] = "Speaker index 0..31, CTA-861-G: Table 34:\n" "0x00 FL\t: Front Left\n" "0x01 FR\t: Front Right\n" "0x02 FC\t: Front Center\n" "0x03 LFE1\t: Low Frequency Effects 1 (subwoofer1)\n" "0x04 BL\t: Back Left\n" "0x05 BR\t: Back Right\n" "0x06 FLC\t: Front Left of Center\n" "0x07 FRC\t: Front Right of Center\n" "0x08 BC\t: Back Center\n" "0x09 LFE2\t: Low Frequency Effects 2 (subwoofer2)\n" "0x0A SiL\t: Side Left\n" "0x0B SiR\t: Side Right\n" "0x0C TpFL\t: Top Front Left\n" "0x0D TpFR\t: Top Front Right\n" "0x0E TpFC\t: Top Front Center\n" "0x0F TpC\t: Top Center\n" "0x10 TpBL\t: Top Back Left\n" "0x11 TpBR\t: Top Back Right\n" "0x12 TpSiL\t: Top Side Left\n" "0x13 TpSiR\t: Top Side Right\n" "0x14 TpBC\t: Top Back Center\n" "0x15 BtFC\t: Bottom Front Center\n" "0x16 BtFL\t: Bottom Front Left\n" "0x17 BtFR\t: Bottom Front Right\n" "0x18 FLW\t: Front Left Wide\n" "0x19 FRW\t: Front Right Wide\n" "0x1A LS\t: Left Surround\n" "0x1B RS\t: Right Surround\n" "0x1C..0x1F reserved\n"; const dbc_subg_dsc_t spkld_cl::SPKLD_subg = { .s_ctor = &spkld_cl::group_new, .CodN = "SPKLD", .Name = "Speaker Location Descriptor", .Desc = Desc, .type_id = ID_SLDB_SPKLD | T_SUB_GRP | T_NO_COPY, .min_len = offsetof(spkld_t, CoordX), .fcount = 9, .inst_cnt = -1, .fields = spkld_cl::fld_dsc }; const edi_field_t spkld_cl::fld_dsc[] = { //channel index, byte0 {&EDID_cl::BitF8Val, 0, offsetof(spkld_t, channel), 0, 5, F_BFD|F_INT|F_DN, 0, 0x1F, "Cahnnel_IDX", "LPCM channel index 0..31" }, {&EDID_cl::BitVal, 0, offsetof(spkld_t, channel), 5, 1, F_BIT|F_DN, 0, 3, "Active", " 1= channel active,\n 0= channel unused" }, {&EDID_cl::BitVal, 0, offsetof(spkld_t, channel), 6, 1, F_BIT|F_INIT|F_DN, 0, 3, "COORD", " 1= CoordX/Y/Z fields are used,\n 0= CoordX/Y/Z fields are not present in SPKLD" }, {&EDID_cl::BitVal, 0, offsetof(spkld_t, channel), 7, 1, F_BIT, 0, 3, "resvd7", "reserved (0)" }, //speaker index, byte1 {&EDID_cl::BitF8Val, VS_SPKLD_IDX, offsetof(spkld_t, spk_id), 0, 5, F_BFD|F_HEX|F_VS|F_DN, 0, 0x1B, "Speaker_ID", SLDB_SPK_index }, {&EDID_cl::BitF8Val, 0, offsetof(spkld_t, spk_id), 5, 3, F_BFD, 0, 3, "resvd57", "reserved (0)" }, //speaker position, bytes 2-4 {&EDID_cl::RMCD_NormV, 0, offsetof(spkld_t, CoordX), 0, 1, F_BTE|F_FLT|F_DN, 0, 255, "CoordX", "X-axis position value normalized to Xmax in RMCD::SPKD: Speaker Distance\n" "Range: -2.0 .. 1.984375" }, {&EDID_cl::RMCD_NormV, 0, offsetof(spkld_t, CoordY), 1, 1, F_BTE|F_FLT|F_DN, 0, 255, "CoordY", "Y-axis position value normalized to Ymax in RMCD::SPKD: Speaker Distance\n" "Range: -2.0 .. 1.984375"}, {&EDID_cl::RMCD_NormV, 0, offsetof(spkld_t, CoordZ), 2, 1, F_BTE|F_FLT|F_DN, 0, 255, "CoordZ", "Z-axis position value normalized to Zmax in RMCD::SPKD: Speaker Distance\n" "Range: -2.0 .. 1.984375" } }; rcode spkld_cl::init(const u8_t* inst, u32_t orflags, edi_grp_cl* parent) { const spkld_t *slocd; rcode retU, retU2; u32_t dlen; u32_t fcount; u32_t unk_byte; RCD_SET_OK(retU2); slocd = reinterpret_cast (inst); fcount = SPKLD_subg.fcount; dlen = parent->getFreeSubgSZ(); unk_byte = 0; parent_grp = parent; type_id.t32 = SPKLD_subg.type_id | orflags; if (slocd->channel.coord != 0) { //speaker coordinates data present if (dlen < sizeof(spkld_t)) { wxedid_RCD_SET_FAULT_VMSG(retU2, ERR_GRP_LEN_MSG, SPKLD_subg.CodN); unk_byte = dlen; unk_byte -= SPKLD_subg.min_len; fcount -= 3; } else { dlen = sizeof(spkld_t); } } else { fcount -= 3; dlen = SPKLD_subg.min_len; } CopyInstData(inst, dlen); if (0 == unk_byte) { retU = init_fields(&SPKLD_subg.fields[0], inst_data, fcount, false, SPKLD_subg.Name, SPKLD_subg.Desc, SPKLD_subg.CodN); } else { edi_field_t *p_fld; dyn_fcnt = fcount; dyn_fldar = (edi_field_t*) malloc((dyn_fcnt + unk_byte) * EDI_FIELD_SZ); if (NULL == dyn_fldar) RCD_RETURN_FAULT(retU); p_fld = dyn_fldar; memcpy( p_fld, &SPKLD_subg.fields[0], (dyn_fcnt * EDI_FIELD_SZ) ); p_fld += dyn_fcnt; dyn_fcnt += unk_byte; insert_unk_byte(p_fld, unk_byte, offsetof(spkld_t, CoordX) ); retU = init_fields(dyn_fldar, inst_data, dyn_fcnt, false, SPKLD_subg.Name, SPKLD_subg.Desc, SPKLD_subg.CodN); } if (RCD_IS_OK(retU)) return retU2; return retU; } void spkld_cl::getGrpName(EDID_cl& EDID, wxString& gp_name) { u32_t ival; float fval; i8_t *CoordN; spkld_t *spkld; edi_dynfld_t *p_field; if (! EDID.b_GrpNameDynamic) { gp_name = GroupName; return; } spkld = reinterpret_cast (inst_data); p_field = FieldsAr.Item(4); //Speaker_ID ( EDID.*p_field->field.handlerfn )(OP_READ, gp_name, ival, p_field ); EDID.getValDesc(gp_name, p_field, ival, VD_NAME); if (spkld->channel.active) { gp_name << ", CH" << (int) spkld->channel.chn_idx; } if (! spkld->channel.coord) return; //NOTE: this can display trash data if parent grp length is invalid (too short) gp_name << ", "; ival = 0; CoordN = &spkld->CoordX; do { fval = (i32_t) CoordN[ival]; fval /= 64.0; EDID.gp_name.Printf("%.02f", fval); gp_name << EDID.gp_name; if (ival < 2) gp_name << "/"; ival ++ ; } while (ival < 3); } //SLDB: Speaker Location Data Block: base class const char cea_sldb_cl::Desc[] = "Speaker Location Data Block"; const dbc_root_dsc_t cea_sldb_cl::SLDB_grp = { .CodN = "SLDB", .Name = "Speaker Location Data Block", .Desc = Desc, .type_id = ID_SLDB | ID_SLDB_SPKLD, .flags = 0, .min_len = offsetof(spkld_t, CoordX)+1, .max_len = 31, .hdr_fcnt = CEA_ETHDR_FCNT, .hdr_sz = sizeof(ethdr_t), .ahf_sz = 0, .ahf_cnt = 0, .ah_flds = NULL, .grp_arsz = 1, .grp_ar = &spkld_cl::SPKLD_subg }; rcode cea_sldb_cl::init(const u8_t* inst, u32_t orflags, edi_grp_cl* parent) { rcode retU; retU = base_DBC_Init_RootGrp(inst, &SLDB_grp, orflags, parent); return retU; } //IFDB: InfoFrame Data Block (DBC_ET_IFDB = 32) //IFDB: IFPD: InfoFrame Processing Descriptor Header const char ifdb_ifpdh_cl::Desc[] = "InfoFrame Processing Descriptor"; const dbc_subg_dsc_t ifdb_ifpdh_cl::IFPD_subg = { .s_ctor = NULL, .CodN = "IFPD", .Name = "InfoFrame Processing Descriptor", .Desc = Desc, .type_id = ID_IFDB_IFPD, .min_len = sizeof(ifpdh_t), .fcount = 3, .inst_cnt = 1, .fields = ifdb_ifpdh_cl::fld_dsc }; const edi_field_t ifdb_ifpdh_cl::fld_dsc[] = { {&EDID_cl::BitF8Val, 0, 0, 0, 5, F_BFD|F_INT|F_RD, 0, 0x1F, "resvd04", "reserved (0)" }, {&EDID_cl::BitF8Val, 0, 0, 5, 3, F_BFD|F_INT|F_INIT, 0, 7, "Blk length", "Block length: num of bytes following the 'n_VSIFs' byte.\n" "For CTA-861-G the payload length should be zero." }, {&EDID_cl::ByteVal, 0, offsetof(ifpdh_t, n_VSIFs), 0, 1, F_BTE|F_INT, 0, 0xFF, "n_VSIFs", "num of additional Vendor-Specific InfoFrames (VSIFs) that can be received simultaneously." "The number is encoded as (n_VSIFs - 1), so 0 means 1." } }; rcode ifdb_ifpdh_cl::init(const u8_t* inst, u32_t orflags, edi_grp_cl* parent) { rcode retU; retU = IFDB_Init_SubGrp(inst, &IFPD_subg, orflags, parent); return retU; } //IFDB: SIFD: Short InfoFrame Descriptor, InfoFrame Type Code != 0x00, 0x01 const char ifdb_sifd_cl::Desc[] = "Short InfoFrame Descriptor"; const dbc_subg_dsc_t ifdb_sifd_cl::SIFD_subg = { .s_ctor = NULL, .CodN = "SIFD", .Name = "Short InfoFrame Descriptor", .Desc = Desc, .type_id = ID_IFDB_SIFD, .min_len = sizeof(sifdh_t), .fcount = 2, .inst_cnt = 1, .fields = ifdb_sifd_cl::fld_dsc }; const edi_field_t ifdb_sifd_cl::fld_dsc[] = { {&EDID_cl::BitF8Val, 0, 0, 0, 5, F_BFD|F_INT|F_INIT, 0, 0x1F, "IFT Code", "InfoFrame Type Code, values 0x00, 0x01 are reserved for other types of descriptors." }, {&EDID_cl::BitF8Val, 0, 0, 5, 3, F_BFD|F_INT|F_INIT, 0, 7, "Blk length", "Block length: num of bytes following the header byte." } }; rcode ifdb_sifd_cl::init(const u8_t* inst, u32_t orflags, edi_grp_cl* parent) { rcode retU; retU = IFDB_Init_SubGrp(inst, &SIFD_subg, orflags, parent); return retU; } //IFDB: VSIFD: Short Vendor-Specific InfoFrame Descriptor, InfoFrame Type Code = 0x01 const char ifdb_vsifd_cl::Desc[] = "Short Vendor-Specific InfoFrame Descriptor"; const dbc_subg_dsc_t ifdb_vsifd_cl::VSIFD_subg = { .s_ctor = NULL, .CodN = "VSIFD", .Name = "Short Vendor-Specific InfoFrame Descriptor", .Desc = Desc, .type_id = ID_IFDB_VSD, .min_len = sizeof(svsifd_t), .fcount = 3, .inst_cnt = 1, .fields = ifdb_vsifd_cl::fld_dsc }; const edi_field_t ifdb_vsifd_cl::fld_dsc[] = { {&EDID_cl::BitF8Val, 0, offsetof(svsifd_t, ifhdr), 0, 5, F_BFD|F_INT|F_INIT, 0, 0x1F, "IFT Code", "Vendor-Specific InfoFrame Type Code == 0x01." }, {&EDID_cl::BitF8Val, 0, offsetof(svsifd_t, ifhdr), 5, 3, F_BFD|F_INT|F_INIT, 0, 7, "Blk length", "Block length: num of bytes following the header byte." }, //IEEE OUI {&EDID_cl::ByteStr, 0, offsetof(svsifd_t, ieee_id), 0, 3, F_STR|F_HEX|F_LE|F_RD, 0, 0xFFFFFF, "IEEE-OUI", "IEEE OUI (Organizationally Unique Identifier)" } }; rcode ifdb_vsifd_cl::init(const u8_t* inst, u32_t orflags, edi_grp_cl* parent) { rcode retU; retU = IFDB_Init_SubGrp(inst, &VSIFD_subg, orflags, parent); return retU; } //IFDB: InfoFrame Data Block: base class const char cea_ifdb_cl::CodN[] = "IFDB"; const char cea_ifdb_cl::Name[] = "InfoFrame Data Block"; const char cea_ifdb_cl::Desc[] = "InfoFrame Data Block"; rcode cea_ifdb_cl::init(const u8_t* inst, u32_t orflags, edi_grp_cl* parent) { rcode retU, retU2; u32_t dlen; u32_t g_type; u32_t grp_sz; u32_t abs_ofs; u32_t rel_ofs; u8_t *g_inst; edi_grp_cl *pgrp; bool b_edit_mode; RCD_SET_OK(retU2); b_edit_mode = (0 != (T_MODE_EDIT & orflags)); parent_grp = parent; type_id.t32 = ID_IFDB; dlen = reinterpret_cast (inst)->ethdr.ehdr.hdr.tag.blk_len; dlen += sizeof(bhdr_t); //+1 hdr grp_sz = dlen; //sizeof(ethdr_t) + 2 bytes IFPDH if (dlen < 4) { if (! b_edit_mode) RCD_RETURN_FAULT(retU); wxedid_RCD_SET_FAULT_VMSG(retU2, ERR_GRP_LEN_MSG, CodN); grp_sz = 32; } CopyInstData(inst, grp_sz); hdr_sz = sizeof(ethdr_t); retU = init_fields(&CEA_BlkHdr_fields[0], inst_data, CEA_ETHDR_FCNT, false, Name, Desc, CodN); if (! RCD_IS_OK(retU)) return retU; subg_sz = dlen; if (subg_sz > hdr_sz) { subg_sz -= hdr_sz; } else { subg_sz = 0; } if (subg_sz == 0) goto grp_empty; g_inst = inst_data; abs_ofs = abs_offs; abs_ofs += hdr_sz; rel_ofs = hdr_sz; g_inst += hdr_sz; if (subg_sz < ifdb_ifpdh_cl::IFPD_subg.min_len) { wxedid_RCD_SET_FAULT_VMSG(retU2, ERR_GRP_LEN_MSG, CodN); goto unk; } //create and init sub-groups: 2: IFPDH + 1 short descriptor //IFPDH pgrp = new ifdb_ifpdh_cl; if (pgrp == NULL) RCD_RETURN_FAULT(retU); retU2 = pgrp->init(g_inst, (ID_IFDB | T_SUB_GRP | T_GRP_FIXED | orflags), this ); if (! RCD_IS_OK(retU2)) goto unk; pgrp->setAbsOffs(abs_ofs); pgrp->setRelOffs(rel_ofs); subgroups.Append(pgrp); grp_sz = pgrp->getTotalSize(); rel_ofs += grp_sz; while (rel_ofs < dlen) { g_inst += grp_sz; abs_ofs += grp_sz; subg_sz -= grp_sz; g_type = reinterpret_cast (g_inst)->ift_code; if (g_type == 0x01) { //Short Vendor-Specific InfoFrame Descriptor pgrp = new ifdb_vsifd_cl; if (pgrp == NULL) RCD_RETURN_FAULT(retU); retU2 = pgrp->init(g_inst, (ID_IFDB | T_SUB_GRP | orflags), this ); } else { //Check InfoFrame Type Code if (g_type == 0x00) { wxedid_RCD_SET_FAULT_VMSG(retU2, "[E!] %s: Bad InfoFrame Type Code", CodN); if (! b_edit_mode) return retU2; goto unk; } //Short InfoFrame Descriptor pgrp = new ifdb_sifd_cl; if (pgrp == NULL) RCD_RETURN_FAULT(retU); retU2 = pgrp->init(g_inst, (ID_IFDB | T_SUB_GRP | orflags), this ); } if (! RCD_IS_OK(retU2)) goto unk; pgrp->setAbsOffs(abs_ofs); pgrp->setRelOffs(rel_ofs); subgroups.Append(pgrp); grp_sz = pgrp->getTotalSize(); rel_ofs += grp_sz; } if (rel_ofs > dlen) wxedid_RCD_SET_FAULT_VMSG(retU2, ERR_GRP_LEN_MSG, CodN); unk: if (! RCD_IS_OK(retU2)) { //blk_len too small or bad InfoFrame Type Code retU = Append_UNK_DAT(g_inst, subg_sz, orflags, abs_ofs, rel_ofs, this); } grp_empty: subgroups.CalcDataSZ(this); if (RCD_IS_OK(retU)) return retU2; return retU; } //common init fn for IFDB sub-groups rcode edi_grp_cl::IFDB_Init_SubGrp(const u8_t* inst, const dbc_subg_dsc_t* pSGDsc, u32_t orflags, edi_grp_cl* parent) { rcode retU, retU2; u32_t gplen; u32_t blklen; u32_t fcount; edi_field_t *p_fld; bool b_edit_mode; RCD_SET_OK(retU2); b_edit_mode = (0 != (T_MODE_EDIT & orflags)); parent_grp = parent; type_id.t32 = pSGDsc->type_id | orflags; fcount = pSGDsc->fcount; //block length: //sifdh_t, svsifd_t, ifpdh_t have the block length encoded in the same way, //so it doesn't matter which of those will be used here. blklen = reinterpret_cast (inst)->blk_len; gplen = blklen; gplen += pSGDsc->min_len; if (gplen > parent->getFreeSubgSZ()) { if (! b_edit_mode) RCD_RETURN_FAULT(retU); wxedid_RCD_SET_FAULT_VMSG(retU2, ERR_GRP_LEN_MSG, pSGDsc->CodN); if (blklen > pSGDsc->min_len) return retU2; //insert UNK-DAT group gplen = parent->getFreeSubgSZ(); } CopyInstData(inst, gplen); if (gplen > pSGDsc->min_len) { gplen -= pSGDsc->min_len; //payload size } else { gplen = 0; } //pre-alloc buffer for array of fields: fcount + gplen dyn_fldar = (edi_field_t*) malloc( (gplen + fcount) * EDI_FIELD_SZ ); if (NULL == dyn_fldar) RCD_RETURN_FAULT(retU); p_fld = dyn_fldar; memcpy( p_fld, &pSGDsc->fields[0], (fcount * EDI_FIELD_SZ) ); p_fld += fcount; dyn_fcnt = fcount; dyn_fcnt += gplen; //payload data interpreted as unknown insert_unk_byte(p_fld, gplen, pSGDsc->min_len); retU = init_fields(&dyn_fldar[0], inst_data, dyn_fcnt, false, pSGDsc->Name, pSGDsc->Desc, pSGDsc->CodN); if (RCD_IS_OK(retU)) return retU2; return retU; } //T7VTDB: DisplayID Type VII Video Timing Data Block (DBC_ET_T7VTB = 34) //T7VTDB: Aspect Ratio selector sm_vmap T7_AspRatio_map = { {0, {0, "1:1" , NULL}}, {1, {0, "5:4" , NULL}}, {2, {0, "4:3" , NULL}}, {3, {0, "15:9" , NULL}}, {4, {0, "16:9" , NULL}}, {5, {0, "16:10" , NULL}}, {6, {0, "64:27" , NULL}}, {7, {0, "256:135" , NULL}}, {8, {0, "Hres:Vres", NULL}} }; //T7VTDB, T10VTDB: 3D suppport selector sm_vmap T7_3Dsupp_map = { {0, {0, "no 3D support" , NULL}}, {1, {0, "3D-only support" , NULL}}, {2, {0, "3D and Mono support", NULL}}, }; rcode EDID_cl::T7VTB_PixClk(u32_t op, wxString& sval, u32_t& ival, edi_dynfld_t* p_field) { rcode retU; float fval; u8_t *inst; inst = getValPtr(p_field); if (op == OP_READ) { ival = rdWord24_LE(inst); fval = ival; fval /= 1000.0; sval.Printf("%.03f", fval); RCD_SET_OK(retU); } else { RCD_SET_FAULT(retU); if (op == OP_WRSTR) { retU = getStrFloat(sval, 0.001, 16777.215, fval); ival = (fval * 1000.0); //kHz } else if (op == OP_WRINT) { RCD_SET_OK(retU); } if (! RCD_IS_OK(retU)) return retU; wrWord24_LE(inst, ival); } return retU; } const char cea_t7vtb_cl::Desc[] = "Type 7 Video Timing Data Block"; const gpfld_dsc_t cea_t7vtb_cl::fields = { .flags = 0, .dat_sz = (sizeof(t7vtdb_t) - sizeof(ethdr_t)), //for base_DBC_Init_FlatGrp() .inst_cnt = 1, .fcount = 19, .fields = cea_t7vtb_cl::fld_dsc }; const edi_field_t cea_t7vtb_cl::fld_dsc[] = { //t7hdr_t {&EDID_cl::BitF8Val, 0, offsetof(t7vtdb_t, t7_hdr), 0, 3, F_INT|F_BFD, 0, 7, "Blk_rev", "CTA-861-H: supported block revision is 0b010 (2)" }, {&EDID_cl::BitVal, 0, offsetof(t7vtdb_t, t7_hdr), 3, 1, F_INT|F_BIT, 0, 1, "DSC_PT", "Reserved for VESA DisplayID, for CTA-861 the bit must be 0" }, {&EDID_cl::BitF8Val, 0, offsetof(t7vtdb_t, t7_hdr), 4, 3, F_INT|F_BFD, 0, 7, "T7_M", "Number of additional bytes at the end of the descriptor." "Required 0b000 (0), other values are reserved." }, {&EDID_cl::BitVal, 0, offsetof(t7vtdb_t, t7_hdr), 7, 1, F_INT|F_BIT, 0, 1, "F37_rsvd", "Reserved 0" }, //t7flag_t {&EDID_cl::BitF8Val, VS_T7_ASP_RATIO, offsetof(t7vtdb_t, t7_prop), 0, 4, F_BFD|F_INT|F_VS, 0, 15, "asp_ratio", "Aspect ratio (0-8):\n" "0: 1/1 \n1: 5/4 \n2: 4/3 \n3: 15/9 \n4: 16/9\n" "5: 16/10 \n6: 64/27 \n7: 256/135 \n" "8: HApixels/VApisels\n" "other values are reserved." }, {&EDID_cl::BitVal, 0, offsetof(t7vtdb_t, t7_prop), 4, 1, F_INT|F_BIT, 0, 1, "T7_IL", "Interlace support: for CTA-861 it must be 0." }, {&EDID_cl::BitF8Val, VS_T710_3D_SUPP, offsetof(t7vtdb_t, t7_prop), 5, 2, F_BFD|F_INT|F_VS, 0, 3, "3D_support", "Support for 3D (stereo image):\n" "0b00: (0) not supported \n0b01: (1) only 3D supported\n" "0b10: (2) both mono and stereo modes supported \n0b11: (3) reserved\n\n." }, {&EDID_cl::BitVal, 0, offsetof(t7vtdb_t, t7_prop), 7, 1, F_INT|F_BIT, 0, 1, "T7_Y420", "YCBCR 4:2:0 sampling mode support, 1: supported, 0: only RGB" }, {&EDID_cl::T7VTB_PixClk, 0, offsetof(t7vtdb_t, pix_clk), 0, 3, F_FLT|F_MHZ|F_DN, 1, 0xFFFFFF, "Pixel clock", "Pixel clock in 1 kHz units (0.001–16777.215 MHz, LE).\n" "val=0 is reserved." }, {&EDID_cl::Word16, 0, offsetof(t7vtdb_t, HApix), 0, 2, F_INT|F_PIX|F_DN, 0, 0xFFFF, "H-Active pix", "Horizontal active pixels (0–65535), X-resolution." }, {&EDID_cl::Word16, 0, offsetof(t7vtdb_t, HBpix), 0, 2, F_INT|F_PIX|F_DN, 0, 0xFFFF, "H-Blank pix", "H-Blank pixels (0–65535).\n" "This field defines a H-Blank time as number of pixel clock pulses. H-Blank time is a time " "break between drawing 2 consecutive lines on the screen. During H-blank time H-sync pulse is sent " "to the monitor to ensure correct horizontal alignment of lines." }, {&EDID_cl::BitF16Val, 0, offsetof(t7vtdb_t, Hoffs), 0, 15, F_BFD|F_INT, 0, 32767, "H-Sync offs", "H-sync offset in pixel clock pulses (0–65535) from blanking start. This offset value is " "responsible for horizontal picture alignment. Higher values are shifting the picture to the " "left edge of the screen." }, {&EDID_cl::Word16, 0, offsetof(t7vtdb_t, HsyncW), 0, 2, F_INT, 0, 0xFFFF, "H-Sync width", "H-sync pulse width (time) in pixel clock pulses (0–65535)." }, //NOTE: actual offset is +1 for t7f16s1_t.H_7msb {&EDID_cl::BitVal, 0, offsetof(t7vtdb_t, Hoffs)+1, 7, 1, F_INT|F_BIT, 0, 1, "T7_HSP", "H-sync polarity 1: positive, 0: negative" }, {&EDID_cl::Word16, 0, offsetof(t7vtdb_t, VAlin), 0, 2, F_INT|F_PIX|F_DN, 0, 0xFFFF, "V-Active lin", "Vertical active lines (0–65535), V-resolution." }, {&EDID_cl::Word16, 0, offsetof(t7vtdb_t, VBpix), 0, 2, F_INT|F_PIX|F_DN, 0, 0xFFFF, "V-Blank lines", "V-blank lines (0–65535).\n" "This field defines a V-Blank time as number of H-lines. During V-Blank time V-sync pulse is sent " "to the monitor to ensure correct vertical alignment of the picture." }, {&EDID_cl::BitF16Val, 0, offsetof(t7vtdb_t, Voffs), 0, 15, F_BFD|F_INT, 0, 32767, "V-Sync offs", "V-sync offset as number of H-lines (0–32767). This offset value is responsible for vertical " "picture alignment. Higher values are shifting the picture to the top edge of the screen." }, {&EDID_cl::Word16, 0, offsetof(t7vtdb_t, VsyncW), 0, 2, F_INT, 0, 0xFFFF, "V-Sync width", "V-sync pulse width (time) as number of H-lines (0–65535)" }, //NOTE: actual offset is +1 for t7f16s1_t.H_7msb {&EDID_cl::BitVal, 0, offsetof(t7vtdb_t, Voffs)+1, 7, 1, F_INT|F_BIT, 0, 1, "T7_VSP", "V-sync polarity 1: positive, 0: negative" }, }; const dbc_flatgp_dsc_t cea_t7vtb_cl::T7VTB_grp = { .CodN = "T7VTB", .Name = "Type 7 Video Timing Data Block", .Desc = Desc, .type_id = ID_T7VTDB, .flags = 0, .min_len = (sizeof(t7vtdb_t) - sizeof(bhdr_t)), //for base_DBC_Init_FlatGrp() .max_len = (sizeof(t7vtdb_t) - sizeof(bhdr_t)), .max_fld = (19 + CEA_ETHDR_FCNT), .hdr_fcnt = CEA_ETHDR_FCNT, .hdr_sz = sizeof(ethdr_t), .fld_arsz = 1, .fld_ar = &cea_t7vtb_cl::fields }; rcode cea_t7vtb_cl::init(const u8_t* inst, u32_t orflags, edi_grp_cl* parent) { rcode retU; retU = base_DBC_Init_FlatGrp(inst, &T7VTB_grp, orflags, parent); return retU; } void cea_t7vtb_cl::getGrpName(EDID_cl& EDID, wxString& gp_name) { u32_t dlen; u32_t ival; u32_t xres; u32_t yres; edi_dynfld_t *p_field; if (! EDID.b_GrpNameDynamic) { goto _exit_def_name; } dlen = reinterpret_cast (inst_data)->tag.blk_len; if (dlen < T7VTB_grp.max_len) { //invalid blk length (too short) goto _exit_def_name; } //X-res p_field = FieldsAr.Item(T7F_IDX_HAPIX); EDID.gp_name.Empty(); ( EDID.*p_field->field.handlerfn )(OP_READ, EDID.gp_name, xres, p_field ); gp_name = EDID.gp_name; gp_name << "x"; //Y-res p_field = FieldsAr.Item(T7F_IDX_VALIN); EDID.gp_name.Empty(); ( EDID.*p_field->field.handlerfn )(OP_READ, EDID.gp_name, yres, p_field ); gp_name << EDID.gp_name; gp_name << " @ "; { //V-Refresh float lineW, pixclk, lineT, n_lines, frameT; p_field = FieldsAr.Item(T7F_IDX_PIXCLK); //H-freq (pix_clk) ( EDID.*p_field->field.handlerfn )(OP_READ, EDID.gp_name, ival, p_field ); pixclk = (float) (ival * 1000); //x1kHz p_field = FieldsAr.Item(T7F_IDX_HBPIX); //H-blank ( EDID.*p_field->field.handlerfn )(OP_READ, EDID.gp_name, ival, p_field ); lineW = (float) (ival + xres); lineT = (lineW / pixclk); p_field = FieldsAr.Item(T7F_IDX_VBLIN); //V-blank ( EDID.*p_field->field.handlerfn )(OP_READ, EDID.gp_name, ival, p_field ); n_lines = (float) (ival + yres); frameT = (n_lines * lineT); EDID.gp_name.Printf("%.02fHz", (1.0/frameT)); gp_name << EDID.gp_name; } return; _exit_def_name: gp_name = GroupName; } //T8VTDB: DisplayID Type VIII Video Timing Data Block (DBC_ET_T8VTB = 35) const char cea_t8vtb_cl::Desc[] = "Type 8 Video Timing Block is used to deeclare support for additional video modes.\n" "Unlike VDB, T8VTB can be used also with 2-byte video codes if " "Timing Code Size (TCS) bit is set to 1\n\n" "NOTE#1: T8VTB should be used with 2-byte VESA-DMT codes; " "1-byte VICs should be included in VDB or HDMI VSDB\n" "NOTE#2: VFPDB must reference first Video Mode in first T8VTB in the EDID"; const dbc_root_dsc_t cea_t8vtb_cl::T8VTB_root = { .CodN = "T8VTB", .Name = "Type 8 Video Timing Data Block", .Desc = Desc, .type_id = ID_T8VTDB | ID_T8VTC_T0, .flags = 0, .min_len = 2, //ETag + 1 byte for additioonal fields of root grp header .max_len = 31, .hdr_fcnt = CEA_ETHDR_FCNT, .hdr_sz = sizeof(ethdr_t), .ahf_sz = 1, //1 byte for additioonal fields of root grp header .ahf_cnt = 5, .ah_flds = cea_t8vtb_cl::ah_flds, .grp_arsz = 1, .grp_ar = &t8vtb_vtc_cl::VTC_T0_subg //dynmic: VTC_T0_subg/VTC_T1_subg }; const edi_field_t cea_t8vtb_cl::ah_flds[] = { {&EDID_cl::BitF8Val, 0, sizeof(ethdr_t), 0, 3, F_BFD, 0, 0x7, "blk_rev", "Block revision: 0b001, other values are reserved" }, {&EDID_cl::BitVal, 0, sizeof(ethdr_t), 3, 1, F_BIT|F_INIT, 0, 1, "TCS", "Timing Code Size:\n 0: VESA DMT 1-byte codes\n 1: VESA DMT 2-byte codes (STI)" }, {&EDID_cl::BitVal, 0, sizeof(ethdr_t), 4, 1, F_BIT, 0, 1, "F34_res", "reserved (0)" }, {&EDID_cl::BitVal, 0, sizeof(ethdr_t), 5, 1, F_BIT, 0, 1, "T8Y420", "Indicates support for YCBCR 4:2:0 sampling by all listed video modes.\n" "1: All modes support RGB and YCBCR 4:2:0 sampling\n" "0: only RGB is supported" }, {&EDID_cl::BitF8Val, 0, sizeof(ethdr_t), 6, 2, F_BFD, 0, 0x3, "code_type", "Code Type: 0b00 (1 or 2-byte DMT codes), other values are reserved" }, }; rcode cea_t8vtb_cl::init(const u8_t* inst, u32_t orflags, edi_grp_cl* parent) { const dbc_root_dsc_t *grp_desc; rcode retU; int TCS; //Timing Code Size dbc_root_dsc_t T8VTB_tmp; dbc_subg_dsc_t VTC_tmp; //The T8VTDB block header is @ 3rd byte, after ET hdr TCS = reinterpret_cast (&inst[2])->tcs; orflags &= T_MODE_EDIT; //the only acceptable flag (type_id depends on TCS) grp_desc = &T8VTB_root; if (TCS == 0) goto _1_byte_vtc; //The subgroup size depends on t8hdr_t.tcs bit state: //Create temporary copy of group descriptor on stack //with modified parameters memcpy(&T8VTB_tmp, &T8VTB_root, sizeof(dbc_root_dsc_t)); memset(&VTC_tmp , 0, sizeof(dbc_subg_dsc_t)); /* Dynamic type ID: Prevents moving ID_T8VTC_T0/T2 sub-groups between T8VTDB blocks with different TCS value */ T8VTB_tmp.type_id = ID_T8VTDB | ID_DMT2; T8VTB_tmp.min_len = sizeof(dmt_std2_t); T8VTB_tmp.grp_ar = &VTC_tmp; VTC_tmp.s_ctor = &dmt_std2_cl::group_new; VTC_tmp.min_len = sizeof(dmt_std2_t); VTC_tmp.inst_cnt = -1; //VTC_tmp.fcount = 0; //no fld init by base_DBC_Init_RootGrp() grp_desc = &T8VTB_tmp; _1_byte_vtc: retU = base_DBC_Init_RootGrp(inst, grp_desc, orflags, parent); return retU; } const char t8vtb_vtc_cl::Desc[] = "T8VTDB (TCS=0): VESA DMT-ID 1-byte Video Timing Code"; const dbc_subg_dsc_t t8vtb_vtc_cl::VTC_T0_subg = { .s_ctor = &t8vtb_vtc_cl::group_new, .CodN = "DMT-ID1", .Name = "Video Timing Code", .Desc = Desc, .type_id = ID_T8VTC_T0 | T_SUB_GRP, .min_len = sizeof(u8_t), //1-byte video codes .fcount = 1, .inst_cnt = -1, .fields = t8vtb_vtc_cl::vtc_1_byte }; const edi_field_t t8vtb_vtc_cl::vtc_1_byte[] = { {&EDID_cl::ByteVal, VS_DMT1_VIDFMT, 0, 0, 1, F_BTE|F_HEX|F_DN|F_VS|F_VSVM, 0, 0xFF, "DMT_1", "VESA DMT-ID 1-byte Timing Code" }, }; rcode t8vtb_vtc_cl::init(const u8_t* inst, u32_t orflags, edi_grp_cl* parent) { enum { dlen = 1, fcount = 1 }; rcode retU; type_id.t32 = ID_T8VTC_T0 | T_SUB_GRP | orflags; parent_grp = parent; CopyInstData(inst, dlen); retU = init_fields(&vtc_1_byte[0], inst_data, fcount, false, VTC_T0_subg.Name, VTC_T0_subg.Desc, VTC_T0_subg.CodN); return retU; } edi_grp_cl* t8vtb_vtc_cl::Clone(rcode& rcd, u32_t flags) { t8vtb_vtc_cl *m_vtc; //pass TCS layout type to init(parent==NULL) //type_id is ID_T8VTC_T0 or ID_T8VTC_T1 m_vtc = new t8vtb_vtc_cl(); m_vtc->type_id = type_id; return base_clone(rcd, m_vtc, flags); }; void t8vtb_vtc_cl::getGrpName(EDID_cl& EDID, wxString& gp_name) { if (! EDID.b_GrpNameDynamic) { gp_name = GroupName; return; } if (ID_T8VTC_T0 == (type_id.t32 & ID_SUBGRP_MASK)) { //DMT-ID 1-byte codes const vmap_ent_t *m_ent; u32_t dmt1; dmt1 = (u32_t) inst_data[0]; m_ent = vmap_GetVmapEntry(VS_DMT1_VIDFMT, VMAP_VAL, dmt1); if (NULL == m_ent) { gp_name = ""; return; } gp_name = m_ent->name; } else { //STD2 codes EDID.STI_DBN(EDID, gp_name, FieldsAr); } } //T10VTDB: DisplayID Type 10 Video Timing Data Block (DBC_ET_T10VTB = 42) const char cea_t10vtb_cl::Desc[] = "Type 10 Video Timing Block is used to deeclare support for additional IT timing formats. " "The timing formats declared in T10VTDB must conform to the VESA CVT"; const dbc_root_dsc_t cea_t10vtb_cl::T10VTB_root = { .CodN = "T10VTB", .Name = "Type 10 Video Timing Data Block", .Desc = Desc, .type_id = ID_T10VTDB | ID_T10VTD_M0, .flags = 0, .min_len = 2, //ETag + 1 byte for additioonal fields of root grp header .max_len = 31, .hdr_fcnt = CEA_ETHDR_FCNT, .hdr_sz = sizeof(ethdr_t), .ahf_sz = sizeof(t8hdr_t), //1 byte for additioonal header fields in root grp .ahf_cnt = 4, .ah_flds = cea_t10vtb_cl::ah_flds, .grp_arsz = 1, .grp_ar = &t10vtb_vtd_cl::VTD_M0_subg }; const edi_field_t cea_t10vtb_cl::ah_flds[] = { {&EDID_cl::BitF8Val, 0, sizeof(ethdr_t), 0, 3, F_BFD, 0, 0x7, "blk_rev", "CTA-861-H: Block revision: 0b000, other values are reserved" }, {&EDID_cl::BitVal, 0, sizeof(ethdr_t), 3, 1, F_BIT, 0, 1, "F33_res", "reserved (0)" }, {&EDID_cl::BitF8Val, 0, sizeof(ethdr_t), 4, 3, F_BFD|F_INT|F_INIT, 0, 0x7, "T10_M", "T10_M field defines the length of timing descriptors included in this block.\n" "Supported values are:\n0b000: (0) desc. length is 6 bytes\n" "0b001: (1) desc. length is 7 bytes (6 + T10_M value)\n" }, {&EDID_cl::BitVal, 0, sizeof(ethdr_t), 7, 1, F_BIT, 0, 1, "F37_res", "reserved (0)" }, }; rcode cea_t10vtb_cl::init(const u8_t* inst, u32_t orflags, edi_grp_cl* parent) { const dbc_root_dsc_t *grp_desc; rcode retU; u32_t T10M; //Timing Descriptor size modifier dbc_root_dsc_t T10VTB_tmp; //The T10VTDB block header is @ 3rd byte, after ET hdr T10M = reinterpret_cast (&inst[2])->t10_m; grp_desc = &T10VTB_root; if (T10M == 0) goto _6_byte_vtc; //The subgroup layout depends on t10hdr_t.t10_m bit state: //Create temporary copy of group descriptor on stack //with modified parameters memcpy(&T10VTB_tmp, &T10VTB_root, sizeof(dbc_root_dsc_t)); /* Dynamic type ID: Prevents moving T10VTD_M0/M1 sub-groups between T10VTB blocks with different T10M value */ T10VTB_tmp.type_id = ID_T10VTDB | ID_T10VTD_M1; T10VTB_tmp.grp_ar = &t10vtb_vtd_cl::VTD_M1_subg; grp_desc = &T10VTB_tmp; _6_byte_vtc: retU = base_DBC_Init_RootGrp(inst, grp_desc, orflags, parent); return retU; } const char t10vtb_vtd_cl::Desc[] = "T10VTD video timing descriptor.\n" "Data layout depends on 'T10_M' field value"; const dbc_subg_dsc_t t10vtb_vtd_cl::VTD_M0_subg = { .s_ctor = &t10vtb_vtd_cl::group_new, .CodN = "T10VTD_M0", .Name = "Video Timing Descriptor", .Desc = Desc, .type_id = ID_T10VTD_M0 | T_SUB_GRP, .min_len = sizeof(t10vtm0_t), .fcount = 7, .inst_cnt = -1, .fields = t10vtb_vtd_cl::vtd_m0_m1 }; const dbc_subg_dsc_t t10vtb_vtd_cl::VTD_M1_subg = { .s_ctor = &t10vtb_vtd_cl::group_new, .CodN = "T10VTD_M1", .Name = "Video Timing Descriptor", .Desc = Desc, .type_id = ID_T10VTD_M1 | T_SUB_GRP, .min_len = sizeof(t10vtm1_t), .fcount = 7, .inst_cnt = -1, .fields = t10vtb_vtd_cl::vtd_m0_m1 }; const edi_field_t t10vtb_vtd_cl::vtd_m0_m1[] = { //t10hdr_t {&EDID_cl::BitF8Val, 0, offsetof(t10vtm0_t, hdr), 0, 3, F_BFD|F_INT, 0, 0x7, "T_formula", "Timing formula for Reduced Blanking: RB2: 0b010, RB3: 0b011" }, {&EDID_cl::BitVal, 0, offsetof(t10vtm0_t, hdr), 3, 1, F_INT|F_BIT, 0, 1, "F43_res", "reserved (0)" }, {&EDID_cl::BitVal, 0, offsetof(t10vtm0_t, hdr), 4, 1, F_INT|F_BIT, 0, 1, "VR_HB", "reserved (0)" }, {&EDID_cl::BitF8Val, VS_T710_3D_SUPP, offsetof(t10vtm0_t, hdr), 5, 2, F_BFD|F_INT|F_VS, 0, 3, "3D_support", "Support for 3D (stereo image):\n" "0b00: (0) not supported \n0b01: (1) only 3D supported\n" "0b10: (2) both mono and stereo modes supported \n0b11: (3) reserved\n\n." }, {&EDID_cl::BitVal, 0, offsetof(t10vtm0_t, hdr), 7, 1, F_INT|F_BIT, 0, 1, "T10_Y420", "YCBCR 4:2:0 sampling mode support, 1: supported, 0: only RGB" }, {&EDID_cl::Word16, 0, offsetof(t10vtm0_t, HApix), 0, 2, F_INT|F_PIX|F_DN, 0, 65535, "H-Active pix", "Horizontal active pixels (0–65535), X-resolution." }, {&EDID_cl::Word16, 0, offsetof(t10vtm0_t, VAlin), 0, 2, F_INT|F_PIX|F_DN, 0, 65535, "V-Active lin", "Vertical active lines (0–65535), V-resolution." }, }; const edi_field_t t10vtb_vtd_cl::vtd_m0[] = { {&EDID_cl::ByteVal, 0, offsetof(t10vtm0_t, Vref8), 0, 1, F_INT|F_BTE|F_HZ|F_DN, 0, 255, "V-refresh", "Vertical refresh rate (0–255)" } }; const edi_field_t t10vtb_vtd_cl::vtd_m1[] = { {&EDID_cl::BitF16Val, 0, offsetof(t10vtm1_t, Vref10), 0, 10, F_BFD|F_INT|F_HZ|F_DN, 0, 1023, "V-refresh", "Vertical refresh rate (0–1023)" }, {&EDID_cl::BitF16Val, 0, offsetof(t10vtm1_t, Vref10), 10, 6, F_BFD|F_INT, 0, 0x3F, "res6", "reserved (0)" } }; rcode t10vtb_vtd_cl::init(const u8_t* inst, u32_t orflags, edi_grp_cl* parent) { rcode retU; u32_t dlen; u32_t mx_fcnt; int T10M; //Timing Descriptor size modifier bool append_md = true; const edi_field_t *mx_ar; parent_grp = parent; if (parent != NULL) { //The T10VTDB block header is @ 3rd byte, after ET hdr T10M = reinterpret_cast (&parent->getInstPtr()[2])->t10_m; } else { //Clone->Init: layout type encoded in type ID T10M = (ID_T10VTD_M1 == (type_id.t32 & ID_SUBGRP_MASK)); } if (T10M == 0) { VTD_subg = &VTD_M0_subg; mx_ar = vtd_m0; mx_fcnt = 1; } else { VTD_subg = &VTD_M1_subg; mx_ar = vtd_m1; mx_fcnt = 2; } type_id.t32 = VTD_subg->type_id | orflags; dlen = VTD_subg->min_len; dyn_fcnt = VTD_subg->fcount; CopyInstData(inst, dlen); retU = init_fields(&vtd_m0_m1[0], inst_data, VTD_subg->fcount, !append_md, VTD_subg->Name, VTD_subg->Desc, VTD_subg->CodN); //fields from vtd_m0_m1 are already initialized by base_DBC_Init_RootGrp() //remaining fields depend on T10M value retU = init_fields(mx_ar, inst_data, mx_fcnt, append_md, NULL, NULL, NULL); return retU; } edi_grp_cl* t10vtb_vtd_cl::Clone(rcode& rcd, u32_t flags) { t10vtb_vtd_cl *m_vtd; //pass T10_M layout type to init(parent==NULL) //type_id is ID_T10VTD_M0 or ID_T10VTD_M1 m_vtd = new t10vtb_vtd_cl(); m_vtd->type_id = type_id; return base_clone(rcd, m_vtd, flags); }; void t10vtb_vtd_cl::getGrpName(EDID_cl& EDID, wxString& gp_name) { enum { //both M1 and M0 layouts have the same field indexes IDX_XRES = 5, IDX_VRES, IDX_VREF, }; if (! EDID.b_GrpNameDynamic) { gp_name = GroupName; return; } edi_dynfld_t *p_field; u32_t xres; u32_t yres; u32_t vref; //X-res EDID.gp_name.Empty(); p_field = FieldsAr.Item(IDX_XRES); ( EDID.*p_field->field.handlerfn )(OP_READ, EDID.gp_name, xres, p_field ); //Y-res EDID.gp_name.Empty(); p_field = FieldsAr.Item(IDX_VRES); ( EDID.*p_field->field.handlerfn )(OP_READ, EDID.gp_name, yres, p_field ); //V-Refresh: this works for any value of T10_M field: dynamic data layout EDID.gp_name.Empty(); p_field = FieldsAr.Item(IDX_VREF); ( EDID.*p_field->field.handlerfn )(OP_READ, EDID.gp_name, vref, p_field ); gp_name << xres << "x" << yres << " @ " << vref << "Hz"; } //UNK-ET: Unknown Data Block (Extended Tag Code) const char cea_unket_cl::CodN[] = "UNK-ET"; const char cea_unket_cl::Name[] = "Unknown Data Block"; const char cea_unket_cl::Desc[] = "Unknown Extended Tag Code"; #pragma GCC diagnostic ignored "-Wunused-parameter" rcode cea_unket_cl::init(const u8_t* inst, u32_t orflags, edi_grp_cl* parent) { rcode retU; u32_t dlen; edi_field_t *p_fld; //block length dlen = reinterpret_cast (inst)->ehdr.hdr.tag.blk_len; parent_grp = parent; type_id.t32 = ID_CEA_UETC; //unknown Extended Tag Code dlen ++ ; //hdr CopyInstData(inst, dlen); dlen -= 2; // -hdr, -ext_tag dyn_fcnt = CEA_ETHDR_FCNT; //pre-alloc buffer for array of fields: hdr_fcnt + dlen dyn_fldar = (edi_field_t*) malloc( (dlen + dyn_fcnt) * EDI_FIELD_SZ ); if (NULL == dyn_fldar) RCD_RETURN_FAULT(retU); p_fld = dyn_fldar; //DBC-EXT header memcpy( p_fld, CEA_BlkHdr_fields, (dyn_fcnt * EDI_FIELD_SZ) ); p_fld += dyn_fcnt; dyn_fcnt += dlen; //payload data interpreted as unknown insert_unk_byte(p_fld, dlen, sizeof(ethdr_t) ); retU = init_fields(&dyn_fldar[0], inst_data, dyn_fcnt, false, Name, Desc, CodN); return retU; } #pragma GCC diagnostic warning "-Wunused-parameter" wxedid-0.0.32/src/CEA.h0000644000175000017500000003267014722720160011342 00000000000000/*************************************************************** * Name: CEA.h * Purpose: EDID Extension structures: CEA/CTA-861-G * Author: Tomasz Pawlak (tomasz.pawlak@wp.eu) * Copyright: Tomasz Pawlak (C) 2014-2024 * License: GPLv3+ **************************************************************/ #ifndef CEA_H #define CEA_H 1 #include "def_types.h" typedef unsigned int uint; enum Tag_Code { //Block Header : type tags DBC_T_RSVD0 = 0, //reserved DBC_T_ADB = 1, //Audio Data Block DBC_T_VDB = 2, //Video Data Block DBC_T_VSD = 3, //Vendor Specific Data Block DBC_T_SAB = 4, //Speaker Allocation Data Block DBC_T_VTC = 5, //VESA Display Transfer Characteristic Data Block (gamma) DBC_T_RSVD6 = 6, //reserved DBC_T_EXT = 7 //Use Extended Tag -> CEA_ET.h }; //Std Block Header typedef struct __attribute__ ((packed)) { //tag_s uint blk_len :5; //bit 4-0: Total number of bytes in the block excluding this byte uint tag_code :3; //bit 7-5: block type, TagCode: 0,6 -> reserved } tag_t; typedef union __attribute__ ((packed)) { //bhdr_s u8_t bval; tag_t tag; } bhdr_t; //Block Header with Extended Tag Code typedef union __attribute__ ((packed)) { //ethdr_s u16_t w16; struct __attribute__ ((packed)) { bhdr_t hdr; //std header u8_t extag; //Extended Tag Code } ehdr; } ethdr_t; //ADB: Audio Data Block -> //SAD: Short Audio Descriptor /* AFC: Audio format code 0 = reserved 1 = Linear Pulse Code Modulation (LPCM) 2 = AC-3 3 = MPEG1 (Layers 1 and 2) 4 = MP3 5 = MPEG2 6 = AAC 7 = DTS 8 = ATRAC 9 = One-bit audio aka SACD 10 = DD+ 11 = DTS-HD 12 = MLP/Dolby TrueHD 13 = DST Audio 14 = Microsoft WMA Pro 15 = SAD byte 2: Audio Coding Extension Type Code */ typedef union __attribute__ ((packed)) { //sad0_s // SAD byte 0: Audio Format Code and number of channels //AF-code = 1...14 //AF-code = 15 && ACE = 4-6,8,10 struct __attribute__ ((packed)) { uint num_ch :3; //bit 2-0: Num_of_channels -1 (7->8 channels, 1-> 2ch) uint audio_fmt :4; //bit 6-3: Audio Format Code, AFC uint resvd7 :1; //bit 7: reserved. } afc1_14; //AF-code = 15 && ACE = 11,12 (MPEG-H 3D Audio, AC-4) struct __attribute__ ((packed)) { uint resvd02 :3; //bit 2-0: reserved. uint audio_fmt :4; //bit 6-3: Audio Format Code, AFC uint resvd7 :1; //bit 7: reserved. } afc15_ace11_12; //AF-code = 15 && ACE = 13 (L-PCM 3D Audio) struct __attribute__ ((packed)) { uint MC0 :1; //bit 0: bit 0 of LPCM_MC (Max_Number_of_Channels -1) for L-PCM 3D Audio uint MC1 :1; //bit 1: bit 1 of LPCM_MC uint MC2 :1; //bit 2: bit 2 of LPCM_MC uint audio_fmt :4; //bit 6-3: Audio format code uint MC3 :1; //bit 7: bit 3 of LPCM_MC } afc15_ace13; } sad0_t; typedef union __attribute__ ((packed)) { //sad1_s //SAD byte 1: sampling frequencies supported //AF-code = 1...14 || AF-code = 15 && ACE = 11 (MPEG-H 3D Audio) struct __attribute__ ((packed)) { uint sf32k :1; //bit 0: smp. freq. 32kHz uint sf44k :1; //bit 1: smp. freq. 44.1kHz uint sf48k :1; //bit 2: smp. freq. 48kHz uint sf88k :1; //bit 3: smp. freq. 88.2kHz uint sf96k :1; //bit 4: smp. freq. 96kHz uint sf176k :1; //bit 5: smp. freq. 176.4kHz uint sf192k :1; //bit 6: smp. freq. 192kHz uint resvd7 :1; //bit 7: reserved } fsmp_afc1_14_ace11; //AF-code = 15 && ACE = 4,5,6,8,10 struct __attribute__ ((packed)) { uint sf32k :1; //bit 0: smp. freq. 32kHz uint sf44k :1; //bit 1: smp. freq. 44.1kHz uint sf48k :1; //bit 2: smp. freq. 48kHz uint sf88k :1; //bit 3: smp. freq. 88.2kHz uint sf96k :1; //bit 4: smp. freq. 96kHz uint resvd5 :1; //bit 5: reserved uint resvd6 :1; //bit 6: reserved uint resvd7 :1; //bit 7: reserved } fsmp_afc15_ace456810; //AF-code = 15 && ACE = 12 (AC-4) struct __attribute__ ((packed)) { uint resvd0 :1; //bit 0: reserved uint sf44k :1; //bit 1: smp. freq. 44.1kHz uint sf48k :1; //bit 2: smp. freq. 48kHz uint resvd3 :1; //bit 3: reserved uint sf96k :1; //bit 4: smp. freq. 96kHz uint resvd5 :1; //bit 5: reserved uint sf192k :1; //bit 6: smp. freq. 192kHz uint resvd7 :1; //bit 7: reserved } fsmp_afc15_ace12; //AF-code = 15 && ACE = 13 (L-PCM 3D Audio) struct __attribute__ ((packed)) { uint sf32k :1; //bit 0: smp. freq. 32kHz uint sf44k :1; //bit 1: smp. freq. 44.1kHz uint sf48k :1; //bit 2: smp. freq. 48kHz uint sf88k :1; //bit 3: smp. freq. 88.2kHz uint sf96k :1; //bit 4: smp. freq. 96kHz uint sf176k :1; //bit 5: smp. freq. 176.4kHz uint sf192k :1; //bit 6: smp. freq. 192kHz uint MC4 :1; //bit 7: bit4 of LPCM_MC (Max_Number_of_Channels -1) for L-PCM 3D Audio } fsmp_afc15_ace13; } sad1_t; //SAD byte 2: AF-code = 15: structure depends on Audio Coding Extension Type Code (ACE) typedef union __attribute__ ((packed)) { //ACE = 4, 5, 6 struct __attribute__ ((packed)) { uint resvd0 :1; //reserved uint frm960s :1; //960_TL: total frame length 960 samples uint frm1024s :1; //1024_TL: total frame length 1024 samples uint ace_tc :5; //ACE: Audio Coding Extension Type Code } ace_456; //ACE = 8 or 10 struct __attribute__ ((packed)) { uint mps_l :1; //MPS_L: MPEG Surround uint frm960s :1; //960_TL: total frame length 960 samples uint frm1024s :1; //1024_TL: total frame length 1024 samples uint ace_tc :5; //ACE: Audio Coding Extension Type Code } ace_8_10; //ACE = 11 (MPEG-H 3D Audio) or 12 (AC-4) struct __attribute__ ((packed)) { uint ace_afc :3; //Audio Format Code dependent value uint ace_tc :5; //ACE: Audio Coding Extension Type Code } ace_11_12; //ACE = 13 (L-PCM 3D Audio) struct __attribute__ ((packed)) { uint s16bit :1; //16bit sample uint s20bit :1; //20bit sample uint s24bit :1; //24bit sample uint ace_tc :5; //ACE: Audio Coding Extension Type Code } ace_13; } sad2_afc15_t; //SAD byte 2: typedef union __attribute__ ((packed)) { //sad2_s //AF-code = 1: LPCM: bits 7:3 are reserved, bits 2:0 define bit depth struct __attribute__ ((packed)) { uint sample16b :1; //LPCM: 16bit sample uint sample20b :1; //LPCM: 20bit sample uint sample24b :1; //LPCM: 24bit sample uint resvd :5; } afc1_lpcm; //AF-code = 2...8 : bitrate div by 8kbit/s u8_t afc2_8_bitrate8k; //AF-code = 9...13: AF-code dependent value u8_t afc9_13_dep_v ; //AF-code = 14: WMA-Pro: bits 7:3 are reserved, bits 2:0 define profile struct __attribute__ ((packed)) { uint profile :3; //profile uint resvd :5; //reserved } afc14_wmapro; //AF-code = 15: ACE: Audio Coding Extension Type Code sad2_afc15_t afc15_ace; } sad2_t; //SAD unknown byte: typedef struct __attribute__ ((packed)) { u8_t unknown; //unknown or invalid data } sad_unk_t; //SAD: base struct typedef struct __attribute__ ((packed)) { //sad_s sad0_t sad0; //1: SAD byte 0: format and number of channels sad1_t sad1; //2: SAD byte 1: sampling frequencies supported sad2_t sad2; //3: SAD byte 2: codec, bitrate, sample size } sad_t; //VDB: Video Data Block -> //SVD: Short Video Descriptor base struct typedef struct __attribute__ ((packed)) { //svd_s uint vidmd_idx :7; //1: bit 6-0: video mode idx: 0, 64-127 reserved uint native :1; //1: bit 7 : native mode @ idx } svd_t; //VSD: Vendor Specific Data Block //VSD: Sink supported features typedef struct __attribute__ ((packed)) { //vsd_feat_s uint dvi_dual :1; //bit0 : DVI Dual Link Operation uint resvd0 :1; //bit1 : reserved uint resvd1 :1; //bit2 : reserved uint dc_y444 :1; //bit3 : DC_Y444 (supports 4:4:4 in deep color modes) uint dc_30bit :1; //bit4 : DC_30bit (supports 10-bit-per-channel deep color) uint dc_36bit :1; //bit5 : DC_36bit (supports 10-bit-per-channel deep color) uint dc_48bit :1; //bit6 : DC_48bit (supports 10-bit-per-channel deep color) uint ai_supp :1; //bit7 : Supports_AI (needs info from ACP or ISRC packets) } vsd_feat_t; //VSD: Latency typedef struct __attribute__ ((packed)) { //vsd_ltncy_s uint resvd :6; //bit0-5 : reserved uint i_ltncy :1; /*bit6 : i_latency_fields (set if interlaced latency fields are present; if set four latency fields will be present, 0 if bit 7 is 0) */ uint ltncy_f :1; //bit7 : latency_fields (set if latency fields are present) } vsd_ltncy_t; //VSD: typedef struct __attribute__ ((packed)) { //vsd_s u8_t ieee_id[3]; //1-3: IEEE Registration Id LE, 00-0C-03 for HDMI Licensing, LLC u16_t src_phy; //4-5: Source Physical Address (section 8.7 of HDMI 1.3a) vsd_feat_t sink_feat; //6: sink supported features u8_t max_tmds; //7: (opt) If non-zero (Max_TMDS_Frequency / 5mhz) vsd_ltncy_t ltncy_hdr; //8: (opt) latency fields indicators u8_t vid_lat; //9: (opt) Video Latency value=1+ms/2 with a max of 251 meaning 500ms u8_t aud_lat; /*10: (opt) Audio Latency value=1+ms/2 with a max of 251 meaning 500ms (video delay for progressive sources */ u8_t vid_ilat; //11: (opt) Interlaced Video Latency value=1+ms/2 with a max of 251 meaning 500ms u8_t aud_ilat; /*12: (opt) Interlaced Audio Latency value=1+ms/2 with a max of 251 meaning 500ms (video delay for interlaced sources) */ //Additional bytes may be present, but the HDMI spec says they shall be zero. } vsd_hdmi14_t; //SAB: Speaker Allocation Block: bit val. 1 means "present" // Field naming convention used after CTA-861-G typedef struct __attribute__ ((packed)) { //spm0_s uint FL_FR :1; //bit0: Front Left/Right uint LFE1 :1; //bit1: LFE Low Frequency Effects 1 uint FC :1; //bit2: Front Center uint BL_BR :1; //bit3: Back Left/Right uint BC :1; //bit4: Back Center uint FLC_FRC :1; //bit5: Front Left/Right of Center uint RLC_RRC :1; //bit6: Rear Left/Right of Center, reserved in CTA-861-H and in HADB uint FLW_FRW :1; //bit7: Front Left/Right Wide } spm0_t; typedef struct __attribute__ ((packed)) { //spm1_s uint TpFL_TpFR :1; //bit0: Top Front Left/Right uint TpC :1; //bit1: Top Center uint TpFC :1; //bit2: Top Front Center uint LS_RS :1; //bit3: Left/Right Surround uint LFE2 :1; //bit4: LFE Low Frequency Effects 2 uint TpBC :1; //bit5: Top Back Center uint SiL_SiR :1; //bit6: Side Left/Right uint TpSiL_TpSiR:1; //bit7: Top Side Left/Right } spm1_t; typedef struct __attribute__ ((packed)) { //spm2_s uint TpBL_TpBR :1; //bit0: Top Back Left/Right uint BtFC :1; //bit1: Bottom Front Center uint BtFL_BtFR :1; //bit2: Bottom Front Left/Right uint TpLS_TpRS :1; //bit3: Top Left/Right ? Surround ? - a bug in CTA-861-G ? // CTA-861-H: reserved, HADB: LSd/RSd: Left/Right Surround direct uint resvd4 :1; //bit4: reserved (0) uint resvd5 :1; //bit5: reserved (0) uint resvd6 :1; //bit6: reserved (0) uint resvd7 :1; //bit7: reserved (0) } spm2_t; typedef struct __attribute__ ((packed)) { //sab_s spm0_t spm0; //1: Speaker Presence Mask, byte0 spm1_t spm1; //2: Speaker Presence Mask, byte1 spm2_t spm2; //3: Speaker Presence Mask, byte2 } sab_t; //VTC: VESA Display Transfer Characteristic Data Block. // This is the same as in EDID block 0, byte 23 (gamma) typedef struct __attribute__ ((packed)) { //tag_s u8_t gamma; //value = (gamma*100)-100 (range 1.00–3.54) } vtc_t; // CEA/CTA-861 header //extension block info typedef struct __attribute__ ((packed)) { //infoblk_s uint num_dtd :4; //bit 3-0: sum of *native* DTDs included in block 0 and in CEA block uint ycbcr422 :1; //bit4: 1 = supports YCbCr 4:2:2 uint ycbcr444 :1; //bit5: 1 = supports YCbCr 4:4:4 uint basic_audio :1; //bit6: 1 = supports basic audio uint underscan :1; //bit7: 1 = supports underscan } infoblk_t; //CEA header typedef struct __attribute__ ((packed)) { //cea_hdr_s u8_t ext_tag; //0 : extension id 0x02 for CEA Timing Extension (CEA-EDID) u8_t rev; //1 : extension block revision u8_t dtd_offs; //2 : offset to first DTD, if dtd_offs=4 -> No DBC groups infoblk_t info_blk; //3 : Extension block info: number of DTDs present, other Version 2+ information /* Content: (start at 4th byte) if dtd_offs == 0 no other data exists (no DBC and no DTD) if dtd_offs > 4 DBC starts here (Data Block Collection). if dtd_offs == 4 no DBC data exists, only DTDs. if infoblk_t.num_dtd > 0, then at least num_dtd DTD structures must be present. Besides num_dtd DTDs, additional non-mandatory DTDs can be included. The last DTD is discovered by checking that Next->DTD.pixel_clock value is zero. The remaining padding bytes after last DTD (excluding last byte which contains block checksum) should be zeroed. */ } cea_hdr_t; #endif /* CEA_H */ wxedid-0.0.32/src/guilog.cpp0000644000175000017500000000321614722720160012565 00000000000000 #include "rcdunits.h" #ifndef idGUI_LOG #error "guilog.cpp: missing unit ID" #endif #define RCD_UNIT idGUI_LOG #include "rcode/rcode.h" #include "wxedid_rcd_scope.h" #include "guilog.h" void guilog_cl::RcodeToString(rcode retU, wxString& str) { //assemble the message wxedid_RCD_GET_MSG(retU, rcd_msg_buff, msg_buf_sz); str = wxString::FromAscii(rcd_msg_buff, msg_buf_sz); } void guilog_cl::PrintRcode(rcode retU) { wxedid_RCD_GET_MSG(retU, rcd_msg_buff, msg_buf_sz); wxLogStatus(rcd_msg_buff); } void guilog_cl::DoLog() { wxLogStatus(slog.GetData()); slog.Empty(); }; void guilog_cl::DoLog(const wxString& msg) { wxLogStatus(msg.GetData()); }; rcode guilog_cl::Create(wxWindow *parent, int w, int h) { rcode retU; if ((status != 0) || (logwin != NULL)) { RCD_RETURN_FAULT(retU); } logwin = new wxLogWindow(parent, "LOG", false); if (logwin == NULL) { RCD_RETURN_FAULT(retU); } logwin->DisableTimestamp(); logwin->GetFrame()->SetSize(wxDefaultCoord, wxDefaultCoord, w, h); status++ ; RCD_RETURN_OK(retU); }; rcode guilog_cl::Destroy() { rcode retU; if ((status != 0) && (logwin != NULL)) { wxFrame * frm = logwin->GetFrame(); if (frm != NULL) frm->Destroy(); RCD_RETURN_OK(retU); } RCD_RETURN_FAULT(retU); }; void guilog_cl::Show() { if ((status != 0) || (logwin != NULL)) { logwin->Show(true); } }; void guilog_cl::ShowHide() { if ((status != 0) || (logwin != NULL)) { logwin->Show(! logwin->GetFrame()->IsShownOnScreen()); } //visible = logwin->GetFrame()->IsShownOnScreen(); }; guilog_cl::guilog_cl(): status(0), logwin(NULL) {}; wxedid-0.0.32/src/vid_fmt.cpp0000644000175000017500000003735214722720160012737 00000000000000/*************************************************************** * Name: svd_vidfmt.cpp * Purpose: video formats table * Author: Tomasz Pawlak (tomasz.pawlak @ wp.eu) * Copyright: Tomasz Pawlak (C) 2014-2024 * License: GPLv3+ **************************************************************/ #include "vmap.h" /* VDB: Video Data Block : VIC values Notes: Parentheses indicate instances where pixels are repeated to meet the minimum speed requirements of the interface. For example, in the 720x240p case, the pixels on each line are double-clocked. In the (2880)x480i case, the number of pixels on each line, and thus the number of times that they are repeated, is variable, and is sent to the DTV monitor by the source device. */ sm_vmap SVD_vidfmt_map = { // Code Name {1, {0, "DMT0659 4:3", "640x480p @ 59.94/60Hz" }}, {2, {0, "480p 4:3", "720x480p @ 59.94/60Hz" }}, {3, {0, "480pH 16:9", "720x480pH @ 59.94/60Hz" }}, {4, {0, "720p 16:9", "1280x720p @ 59.94/60Hz" }}, {5, {0, "1080i 16:9", "1920x1080i @ 59.94/60Hz" }}, {6, {0, "480i 4:3", "720(1440)x480i @ 59.94/60Hz" }}, {7, {0, "480iH 16:9", "720(1440)x480i @ 59.94/60Hz" }}, {8, {0, "240p 4:3", "720(1440)x240p @ 59.94/60Hz" }}, {9, {0, "240pH 16:9", "720(1440)x240pH @ 59.94/60Hz" }}, {10, {0, "480i4x 4:3", "(2880)x480i @ 59.94/60Hz" }}, {11, {0, "480i4xH 16:9", "(2880)x480i @ 59.94/60Hz" }}, {12, {0, "240p4x 4:3", "(2880)x240p @ 59.94/60Hz" }}, {13, {0, "240p4xH 16:9", "(2880)x240p @ 59.94/60Hz" }}, {14, {0, "480p2x 4:3", "1440x480p @ 59.94/60Hz" }}, {15, {0, "480p2xH 16:9", "1440x480p @ 59.94/60Hz" }}, {16, {0, "1080p 16:9", "1920x1080p @ 59.94/60Hz" }}, {17, {0, "576p 4:3", "720x576p @ 50Hz" }}, {18, {0, "576pH 16:9", "720x576pH @ 50Hz" }}, {19, {0, "720p50 16:9", "1280x720p @ 50Hz" }}, {20, {0, "1080i25 16:9", "1920x1080i(1125 Vtotal) @ 50Hz"}}, {21, {0, "576i 4:3", "720(1440)x576i @ 50Hz" }}, {22, {0, "576iH 16:9", "720(1440)x576iH @ 50Hz" }}, {23, {0, "288p 4:3", "720(1440)x288p @ 50Hz" }}, {24, {0, "288pH 16:9", "720(1440)x288pH @ 50Hz" }}, {25, {0, "576i4x 4:3", "(2880)x576i @ 50Hz" }}, {26, {0, "576i4xH 16:9", "(2880)x576i @ 50Hz" }}, {27, {0, "288p4x 4:3", "(2880)x288p @ 50Hz" }}, {28, {0, "288p4xH 16:9", "(2880)x288p @ 50Hz" }}, {29, {0, "576p2x 4:3", "1440x576p @ 50Hz" }}, {30, {0, "576p2xH 16:9", "1440x576p @ 50Hz" }}, {31, {0, "1080p50 16:9", "1920x1080p @ 50Hz" }}, {32, {0, "1080p24 16:9", "1920x1080p @ 23.98/24Hz" }}, {33, {0, "1080p25 16:9", "1920x1080p @ 25Hz" }}, {34, {0, "1080p30 16:9", "1920x1080p @ 29.97/30Hz" }}, {35, {0, "480p4x 4:3", "(2880)x480p @ 59.94/60Hz" }}, {36, {0, "480p4xH 16:9", "(2880)x480p @ 59.94/60Hz" }}, {37, {0, "576p4x 4:3", "(2880)x576p @ 50Hz" }}, {38, {0, "576p4xH 16:9", "(2880)x576p @ 50Hz" }}, {39, {0, "1080i25 16:9", "1920x1080i(1250 VTotal) @ 50Hz"}}, {40, {0, "1080i50 16:9", "1920x1080i @ 100Hz" }}, {41, {0, "720p100 16:9", "1280x720p @ 100Hz" }}, {42, {0, "576p100 4:3", "720x576p @ 100Hz" }}, {43, {0, "576p100H 16:9", "720x576p @ 100Hz" }}, {44, {0, "576i50 4:3", "720(1440)x576i @ 100Hz" }}, {45, {0, "576i50H 16:9", "720(1440)x576i @ 100Hz" }}, {46, {0, "1080i60 16:9", "1920x1080i @ 119.88/120Hz" }}, {47, {0, "720p120 16:9", "1280x720p @ 119.88/120Hz" }}, {48, {0, "480p119 4:3", "720x480p @ 119.88/120Hz" }}, {49, {0, "480p119H 16:9", "720x480p @ 119.88/120Hz" }}, {50, {0, "480i59 4:3", "720(1440)x480i @ 119.88/120Hz" }}, {51, {0, "480i59H 16:9", "720(1440)x480i @ 119.88/120Hz" }}, {52, {0, "576p200 4:3", "720x576p @ 200Hz" }}, {53, {0, "576p200H 16:9", "720x576p @ 200Hz" }}, {54, {0, "576i100 4:3", "720(1440)x576i @ 200Hz" }}, {55, {0, "576i100H 16:9", "720(1440)x576i @ 200Hz" }}, {56, {0, "480p239 4:3", "720x480p @ 239.76/240Hz" }}, {57, {0, "480p239H 16:9", "720x480p @ 239.76/240Hz" }}, {58, {0, "480i119 4:3", "720(1440)x480i @ 239.76/240Hz" }}, {59, {0, "480i119H 16:9", "720(1440)x480i @ 239.76/240Hz" }}, {60, {0, "720p24 16:9", "1280x720p @ 23.98/24Hz" }}, {61, {0, "720p25 16:9", "1280x720p @ 25Hz" }}, {62, {0, "720p30 16:9", "1280x720p @ 29.97/30Hz" }}, {63, {0, "1080p120 16:9", "1920x1080p @ 119.88/120Hz" }}, //Here Code Names are not official. {64, {0, "1080p100 16:9", "1920x1080p @ 100Hz" }}, //Video Codes 65..127 *must not* have the native flag set, //to be distinguishable from codes in range 193..255 (8-bit VIC) {65, {0, "720p24 64:27", "1280x720p @ 23.98/24Hz" }}, {66, {0, "720p25 64:27", "1280x720p @ 25Hz" }}, {67, {0, "720p30 64:27", "1280x720p @ 29.97/30Hz" }}, {68, {0, "720p50 64:27", "1280x720p @ 50Hz" }}, {69, {0, "720p60 64:27", "1280x720p @ 59.94/60Hz" }}, {70, {0, "720p100 64:27", "1280x720p @ 100Hz" }}, {71, {0, "720p120 64:27", "1280x720p @ 119.88/120Hz" }}, {72, {0, "1080p24 64:27", "1920x1080p @ 23.98/24Hz" }}, {73, {0, "1080p25 64:27", "1920x1080p @ 25Hz" }}, {74, {0, "1080p30 64:27", "1920x1080p @ 29.97/30Hz" }}, {75, {0, "1080p50 64:27", "1920x1080p @ 50Hz" }}, {76, {0, "1080p60 64:27", "1920x1080p @ 59.94/60Hz" }}, {77, {0, "1080p100 64:27", "1920x1080p @ 100Hz" }}, {78, {0, "1080p120 64:27", "1920x1080p @ 119.88/120Hz"}}, {79, {0, "720p24 64:27", "1680x720p @ 23.98/24Hz" }}, {80, {0, "720p25 64:27", "1680x720p @ 25Hz" }}, {81, {0, "720p30 64:27", "1680x720p @ 29.97/30Hz" }}, {82, {0, "720p50 64:27", "1680x720p @ 50Hz" }}, {83, {0, "720p60 64:27", "1680x720p @ 59.94/60Hz" }}, {84, {0, "720p100 64:27", "1680x720p @ 100Hz" }}, {85, {0, "720p120 64:27", "1680x720p @ 119.88/120Hz" }}, {86, {0, "1080p24 64:27", "2560x1080p @ 23.98/24Hz" }}, {87, {0, "1080p25 64:27", "2560x1080p @ 25Hz" }}, {88, {0, "1080p30 64:27", "2560x1080p @ 29.97/30Hz" }}, {89, {0, "1080p50 64:27", "2560x1080p @ 50Hz" }}, {90, {0, "1080p60 64:27", "2560x1080p @ 59.94/60Hz" }}, {91, {0, "1080p100 64:27", "2560x1080p @ 100Hz" }}, {92, {0, "1080p120 64:27", "2560x1080p @ 119.88/120Hz"}}, {93, {0, "2160p24 16:9" , "3840x2160p @ 23.98/24Hz" }}, {94, {0, "2160p25 16:9" , "3840x2160p @ 25Hz" }}, {95, {0, "2160p30 16:9" , "3840x2160p @ 29.97/30Hz" }}, {96, {0, "2160p50 16:9" , "3840x2160p @ 50Hz" }}, {97, {0, "2160p60 16:9" , "3840x2160p @ 59.94/60Hz" }}, {98, {0, "2160p24 256:135","4096x2160p @ 23.98/24Hz" }}, {99, {0, "2160p25 256:135","4096x2160p @ 25Hz" }}, {100, {0, "2160p30 256:135","4096x2160p @ 29.97/30Hz" }}, {101, {0, "2160p50 256:135","4096x2160p @ 50Hz" }}, {102, {0, "2160p60 256:135","4096x2160p @ 59.94/60Hz" }}, {103, {0, "2160p24 64:27", "3840x2160p @ 23.98/24Hz" }}, {104, {0, "2160p25 64:27", "3840x2160p @ 25Hz" }}, {105, {0, "2160p30 64:27", "3840x2160p @ 29.97/30Hz" }}, {106, {0, "2160p50 64:27", "3840x2160p @ 50Hz" }}, {107, {0, "2160p60 64:27", "3840x2160p @ 59.94/60Hz" }}, {108, {0, "720p48 16:9" , "1280x720p @ 47.95/48Hz" }}, {109, {0, "720p48 64:27", "1280x720p @ 47.95/48Hz" }}, {110, {0, "720p48 64:27", "1680x720p @ 47.95/48Hz" }}, {111, {0, "1080p48 16:9" , "1920x1080p @ 47.95/48Hz" }}, {112, {0, "1080p48 64:27", "1920x1080p @ 47.95/48Hz" }}, {113, {0, "1080p48 64:27", "2560x1080p @ 47.95/48Hz" }}, {114, {0, "2160p48 16:9" , "3840x2160p @ 47.95/48Hz" }}, {115, {0, "2160p48 256:135","4096x2160p @ 47.95/48Hz" }}, {116, {0, "2160p48 64:27", "3840x2160p @ 47.95/48Hz" }}, {117, {0, "2160p100 16:9" , "3840x2160p @ 100Hz" }}, {118, {0, "2160p120 16:9" , "3840x2160p @ 119.88/120Hz"}}, {119, {0, "2160p100 64:27", "3840x2160p @ 100Hz" }}, {120, {0, "2160p120 64:27", "3840x2160p @ 119.88/120Hz"}}, {121, {0, "2160p24 64:27", "5120x2160p @ 23.98/24Hz" }}, {122, {0, "2160p25 64:27", "5120x2160p @ 25Hz" }}, {123, {0, "2160p30 64:27", "5120x2160p @ 29.97/30Hz" }}, {124, {0, "2160p48 64:27", "5120x2160p @ 47.95/48Hz" }}, {125, {0, "2160p50 64:27", "5120x2160p @ 50Hz" }}, {126, {0, "2160p60 64:27", "5120x2160p @ 59.94/60Hz" }}, {127, {0, "2160p100 64:27", "5120x2160p @ 100Hz" }}, //Video code 128 is reserved //Video codes 129..192 mean that the Native flag is set, //effective VIC is obtained by masking the native flag, resulting range is 1..64 //Video codes 193..219: 8-bit VIC {193, {0, "2160p120 64:27", "5120x2160p @ 119.88/120Hz" }}, {194, {0, "4320p24 16:9" , "7680x4320p @ 23.98/24Hz" }}, {195, {0, "4320p25 16:9" , "7680x4320p @ 25Hz" }}, {196, {0, "4320p30 16:9" , "7680x4320p @ 29.97/30Hz" }}, {197, {0, "4320p48 16:9" , "7680x4320p @ 47.95/48Hz" }}, {198, {0, "4320p50 16:9" , "7680x4320p @ 50Hz" }}, {199, {0, "4320p60 16:9" , "7680x4320p @ 59.94/60Hz" }}, {200, {0, "4320p100 16:9" , "7680x4320p @ 100Hz" }}, {201, {0, "4320p120 16:9" , "7680x4320p @ 119.88/120Hz" }}, {202, {0, "4320p24 64:27", "7680x4320p @ 23.98/24Hz" }}, {203, {0, "4320p25 64:27", "7680x4320p @ 25Hz" }}, {204, {0, "4320p30 64:27", "7680x4320p @ 29.97/30Hz" }}, {205, {0, "4320p48 64:27", "7680x4320p @ 47.95/48Hz" }}, {206, {0, "4320p50 64:27", "7680x4320p @ 50Hz" }}, {207, {0, "4320p60 64:27", "7680x4320p @ 59.94/60Hz" }}, {208, {0, "4320p100 64:27", "7680x4320p @ 100Hz" }}, {209, {0, "4320p120 64:27", "7680x4320p @ 119.88/120Hz" }}, {210, {0, "4320p24 64:27", "10240x4320p @ 23.98/24Hz" }}, {211, {0, "4320p25 64:27", "10240x4320p @ 25Hz" }}, {212, {0, "4320p30 64:27", "10240x4320p @ 29.97/30Hz" }}, {213, {0, "4320p48 64:27", "10240x4320p @ 47.95/48Hz" }}, {214, {0, "4320p50 64:27", "10240x4320p @ 50Hz" }}, {215, {0, "4320p60 64:27", "10240x4320p @ 59.94/60Hz" }}, {216, {0, "4320p100 64:27", "10240x4320p @ 100Hz" }}, {217, {0, "4320p120 64:27", "10240x4320p @ 119.88/120Hz"}}, {218, {0, "2160p100 256:135","4096x2160p @ 100Hz" }}, {219, {0, "2160p120 256:135","4096x2160p @ 119.88/120Hz"}} //Video codes 220-255 are reserved for future use in G spec }; /* VESA DMT timings RB: Reduced Blanking IL: InterLaced NOTE: The order of byte values is the same as listed in the VESA document, but in the EDID structure values are written in reversed order. */ vfmt_t dmt_table[] = { /* DMT-ID STD2 CVT3 */ {0x00, 0x0101, 0, "" }, {0x01, 0, 0, "640x350 @ 85Hz" }, {0x02, 0x3119, 0, "640x400 @ 85Hz" }, {0x03, 0, 0, "720x400 @ 85Hz" }, {0x04, 0x3140, 0, "640x480 @ 60Hz" }, {0x05, 0x314C, 0, "640x480 @ 72Hz" }, {0x06, 0x314F, 0, "640x480 @ 75Hz" }, {0x07, 0x3159, 0, "640x480 @ 85Hz" }, {0x08, 0, 0, "800x600 @ 56Hz" }, {0x09, 0x4540, 0, "800x600 @ 60Hz" }, {0x0A, 0x454C, 0, "800x600 @ 72Hz" }, {0x0B, 0x454F, 0, "800x600 @ 75Hz" }, {0x0C, 0x4559, 0, "800x600 @ 85Hz" }, {0x0D, 0, 0, "800x600 @ 120Hz (RB)"}, {0x0E, 0, 0, "848x480 @ 60Hz" }, {0x0F, 0, 0, "1024x768 @ 43Hz (IL)"}, {0x10, 0x6140, 0, "1024x768 @ 60Hz"}, {0x11, 0x614A, 0, "1024x768 @ 70Hz"}, {0x12, 0x614F, 0, "1024x768 @ 75Hz"}, {0x13, 0x6159, 0, "1024x768 @ 85Hz"}, {0x14, 0, 0, "1024x768 @ 120Hz (RB)"}, {0x15, 0x714F, 0, "1152x864 @ 75Hz"}, {0x55, 0x81C0, 0, "1280x720 @ 60Hz"}, {0x16, 0, 0x7F1C21, "1280x768 @ 60Hz (RB)"}, {0x17, 0, 0x7F1C28, "1280x768 @ 60Hz"}, {0x18, 0, 0x7F1C44, "1280x768 @ 75Hz"}, {0x19, 0, 0x7F1C62, "1280x768 @ 85Hz"}, {0x1A, 0, 0, "1280x768 @ 120Hz (RB)"}, {0x1B, 0, 0x8F1821, "1280x800 @ 60Hz (RB)"}, {0x1C, 0x8100, 0x8F1828, "1280x800 @ 60Hz"}, {0x1D, 0x810F, 0x8F1844, "1280x800 @ 75Hz"}, {0x1E, 0x8119, 0x8F1862, "1280x800 @ 85Hz"}, {0x1F, 0, 0, "1280x800 @ 120Hz (RB)"}, {0x20, 0x8140, 0, "1280x960 @ 60Hz"}, {0x21, 0x8159, 0, "1280x960 @ 85Hz"}, {0x22, 0, 0, "1280x960 @ 120Hz (RB)"}, {0x23, 0x8180, 0, "1280x1024 @ 60Hz"}, {0x24, 0x818F, 0, "1280x1024 @ 75Hz"}, {0x25, 0x8199, 0, "1280x1024 @ 85Hz"}, {0x26, 0, 0, "1280x1024 @ 120Hz (RB)"}, {0x27, 0, 0, "1360x768 @ 60Hz" }, {0x28, 0, 0, "1360x768 @ 120Hz (RB)"}, {0x51, 0, 0, "1366x768 @ 60Hz" }, {0x56, 0, 0, "1366x768 @ 60Hz (RB)"}, {0x29, 0, 0x0C2021, "1400x1050 @ 60Hz (RB)"}, {0x2A, 0x9040, 0x0C2028, "1400x1050 @ 60Hz"}, {0x2B, 0x904F, 0x0C2044, "1400x1050 @ 75Hz"}, {0x2C, 0x9059, 0x0C2062, "1400x1050 @ 85Hz"}, {0x2D, 0, 0, "1400x1050 @ 120Hz (RB)"}, {0x2E, 0, 0xC11821, "1440x900 @ 60Hz (RB)"}, {0x2F, 0x9500, 0xC11828, "1440x900 @ 60Hz" }, {0x30, 0x950F, 0xC11844, "1440x900 @ 75Hz" }, {0x31, 0x9519, 0xC11868, "1440x900 @ 85Hz" }, {0x32, 0, 0, "1440x900 @ 120Hz (RB)"}, {0x53, 0xA9C0, 0, "1600x900 @ 60Hz (RB)"}, {0x33, 0xA940, 0, "1600x1200 @ 60Hz"}, {0x34, 0xA945, 0, "1600x1200 @ 65Hz"}, {0x35, 0xA94A, 0, "1600x1200 @ 70Hz"}, {0x36, 0xA94F, 0, "1600x1200 @ 75Hz"}, {0x37, 0xA959, 0, "1600x1200 @ 85Hz"}, {0x38, 0, 0, "1600x1200 @ 120Hz (RB)"}, {0x39, 0, 0x0C2821, "1680x1050 @ 60Hz (RB)"}, {0x3A, 0xB300, 0x0C2828, "1680x1050 @ 60Hz"}, {0x3B, 0xB30F, 0x0C2844, "1680x1050 @ 75Hz"}, {0x3C, 0xB319, 0x0C2868, "1680x1050 @ 85Hz"}, {0x3D, 0, 0, "1680x1050 @ 120Hz (RB)"}, {0x3E, 0xC140, 0, "1792x1344 @ 60Hz"}, {0x3F, 0xC14F, 0, "1792x1344 @ 75Hz"}, {0x40, 0, 0, "1792x1344 @ 120Hz (RB)"}, {0x41, 0xC940, 0, "1856x1392 @ 60Hz"}, {0x42, 0xC94F, 0, "1856x1392 @ 75Hz"}, {0x43, 0, 0, "1856x1392 @ 120Hz (RB)"}, {0x52, 0xD1C0, 0, "1920x1080 @ 60Hz"}, {0x44, 0, 0x572821, "1920x1200 @ 60Hz (RB)"}, {0x45, 0xD100, 0x572828, "1920x1200 @ 60Hz"}, {0x46, 0xD10F, 0x572844, "1920x1200 @ 75Hz"}, {0x47, 0xD119, 0x572862, "1920x1200 @ 85Hz"}, {0x48, 0, 0, "1920x1200 @ 120Hz (RB)"}, {0x49, 0xD140, 0, "1920x1440 @ 60Hz"}, {0x4A, 0xD14F, 0, "1920x1440 @ 75Hz"}, {0x4B, 0, 0, "1920x1440 @ 120Hz (RB)"}, {0x54, 0xE1C0, 0, "2048x1152 @ 60Hz"}, {0x4C, 0, 0x1F3821, "2560x1600 @ 60Hz (RB)"}, {0x4D, 0, 0x1F3828, "2560x1600 @ 60Hz"}, {0x4E, 0, 0x1F3844, "2560x1600 @ 75Hz"}, {0x4F, 0, 0x1F3862, "2560x1600 @ 85Hz"}, {0x50, 0, 0, "2560x1600 @ 120Hz (RB)"}, {0x57, 0, 0, "4096x2160 @ 60Hz (RB2)"}, {0x58, 0, 0, "4096x2160 @ 59.94Hz (RB2)"}, {0x00, 0, 0, NULL} }; //ET3: Estabilished Timings 3 Descriptor //Mode names (matching ET3 bit oreder) const char* ET3_mode[] = { //byte 6 "1152_864_75", //bit 0 "1024_768_85", "800_600_85", "848_480_60", "640_480_85", "720_400_85", "640_400_85", "640_350_85", //bit 7 //byte 7 "1280_1024_85", "1280_1024_60", "1280_960_85", "1280_960_60", "1280_768_85", "1280_768_75", "1280_768_60", "1280_768_60_RB", //Reduced Blanking //byte 8 "1400_1050_75", "1400_1050_60", "1400_1050_60_RB", "1440_900_85", "1440_900_75", "1440_900_60", "1440_900_60_RB", "1360_768_60", //byte 9 "1600_1200_70", "1600_1200_65", "1600_1200_60", "1680_1050_85", "1680_1050_75", "1680_1050_60", "1680_1050_60_RB", "1400_1050_85", //byte 10 "1920_1200_60", "1920_1200_60_RB", "1856_1392_75", "1856_1392_60", "1792_1344_75", "1792_1344_60", "1600_1200_85", "1600_1200_75", //byte 11 "1920_1440_75", //bit 4 "1920_1440_60", "1920_1200_85", "1920_1200_75", //bit 7 "res11_03", //bits 0..3 }; wxedid-0.0.32/src/rcode/0000755000175000017500000000000014722720160011745 500000000000000wxedid-0.0.32/src/rcode/README_rcd_autogen0000644000175000017500000001163714640400010015113 00000000000000 SHORT usage info: 1. configure.ac: required file: $project_dir/m4/rcd_autoconf.m4 invocation: AC_OPT_RCD_AUTOGEN([src/rcode/rcd_autogen]) #add configure option for rcd_autogen AC_RCD_AUTOGEN_TARGET([src/test_c.rcdgen_cfg]) #call autogen for given target config. 2. *.rcdgen_cfg just contains arguments for rcd_autogen script - they could be used directly as well, but *.rcdgen_cfg allows using shell comments, line continuation marks, etc - more convenient. 3. The --scan-target= option must be provided for rcd_autogen. The value is a string of comma separated dirs or cource files to be scanned by rcd_autogen. Alternatively, if --scan-target=.rcdgen_target is given, then the list of dirs and files to scan is read from a file. Target file (*.rcdgen_target) syntax: - single target source file per line, paths are relative to $root_dir argument - .SETDIR - sets the base path for the consecutive entries - .SCANDIR - scan all files in a given dir - #shell comments allowed - line continuation marks allowed rcd_autogen is proocessing only the source files which are referencing RCD_AUTOGEN_DEFINE_UNIT macro. In general, it should be sufficient to just review the configure.ac and the associated config files to get an idea of how all this works - it's really simple in fact. NOTES: 1. rcd_autogen generates additional source and header files with functions which are required to handle messagess associated with rcodes. The --run-mode=dummy disables generation of those funcions and rcd_scope structures. 2. Libraries don't have to implement RCD functions: only the client app needs to have them, so normally --run-mode=basic should be used for libs, *unless* the lib functions have to return volatile textual messages along with the rcode (VMSG). Normally in the "basic" mode, the library will provide only 2 little accessor functions, which returns the pointer to rcd_scope struct, and the min. buff. size for printing longest rcode message. If the --run-mode=dummy is used, then scope structs are *not* generated, and all the functions are reaplced with stubs (returning NULL/zero -> which is OK for app-level rcd functions). This is needed to keep the library interface unchanged for linking. 3. configure.ac: AC_RCODE_AUTOGEN_TARGET() creates headers which may be required for compiling other programs/libs in the project. Therefore, the order of calling AC_RCODE_AUTOGEN_TARGET() is significant, i.e. libraries targets have to be preprocessed before programs targets. 4. Running 'rcd_autogen' as pre-build script from an IDE (Code::Blocks example): Menu Project->Build_Options->Pre/Post_build_steps: "cd ; ./src/rcode/rcd_autogen src//.rcdgen_cfg" Notice the 'cd' command: this is needed if code::blocks project dir is different from the $(top_source_dir). It's just more convenient to use ".rcdgen_cfg", instead of issuing all the args on cmd line. Different IDE's may require additonal steps before running the pre-build scripts. KNOWN ISSUES: 1. Bash is the only supported shell interpreter for rcd_autogen: min version: Bash v4.4.0 (mainly namerefs support) 2. Using of rcode in general-purpose libs leads to unavoidable unit-id conflicts at the application level (in case of dedicated libs, which are part of a given project, each unit id can be uniqe). In all cases, the app has to call ($base_name)_rcdGetScopePtr() to get scope struct pointer, which should be then passed to ($base_name)_rcdGetMsg(). 3. List of files to scan: there is no reliable way of creating list of target files to scan from makefile. Option --scan-target= must be used to define list of files/dirs, optionally the .rcdgen_target file can be provided. 5. Functions for handling rcd_scope_t structs have different name prefixes for each project/target: $base_name$func_name() . This is required to avoid name conflicts with libs that also can use functions generated by rcd_autogen. Additionally, if num_of_files_to_scan>RCD_UNIT_MAX (65535), the project has to be splitted into sub-projects, and the scope structs have to be generated separately for each of the sub-projects. 6. Function names cannot be resolved by the preprocessor - there's no way generate static messages with function names at the preprocessing stage. This can be bypased by simply using static names of functions or by using VMSG (volatile) messages - but this requires --run-mode=full for rcd_autogen and produces bigger code. 7. rcd_autogen requires RCD_UNIT to be defined as plain decimal integer, i.e. hex values are not recognized, expression are not evaluated (but macros are expanded). 8. If a function returning rcode is referenced by function pointer, then it can be necessary to f.e. store scope struct pointer along with the fn pointer, to be able to get rcode messages. wxedid-0.0.32/src/rcode/rcd_fn.tmp.c0000644000175000017500000001146214640400010014053 00000000000000/* rcode template file: rcd_fn.tmp.c */ #include #include #include #include #include "%rcd_bname%_rcd_scope.h" __BEGIN_DECLS // rcd_autogen: full mode #define offsetof(type, member) __builtin_offsetof (type, member) static char* __rcd_cnv_s(char* buf, uint32_t val) { // internal fn: args are checked by the caller static const char cset[] = "0123456789"; char cbuf[16]; char *pcbuf = cbuf + sizeof(cbuf); do { uint32_t utmp = val; val /= 10; *--pcbuf = cset[utmp - (val * 10)]; } while (val != 0); /* copy buffer */ while (pcbuf < (cbuf + sizeof(cbuf)) ) { *buf++ = *pcbuf++; } return buf; } static const void* __rcd_bin_search(const char* arr, int32_t arsz, uint32_t itemsz, uint32_t voffs, uint32_t val) { const char *pitem; uint32_t mval; uint32_t jmp_sz; uint32_t s_cnt; int32_t idx; jmp_sz = arsz; jmp_sz >>= 1; idx = jmp_sz; s_cnt = 0; arr += voffs; //jumping directly between target fields loop: pitem = arr + (idx * itemsz); mval = *((uint16_t*) pitem); if (val == mval) { return (pitem - voffs); } if (jmp_sz >= 2) { jmp_sz >>=1; } else { //2 steps left if (s_cnt > 2) goto not_found; s_cnt ++ ; idx = (val > mval) ? (idx + 1) : (idx - 1); if ((idx < 0) || (idx >= arsz)) goto not_found; goto loop; } idx = (val > mval) ? (idx + jmp_sz) : (idx - jmp_sz); goto loop; not_found: return NULL; } static char* __rcd_assemble_msg(char* buf, int32_t bsz, rcode retU, const rcd_scope_t *const rscp, const rcd_unit_t *p_un, const char* msg, uint32_t mlen) { //min. buff size checked by the caller //format: "%s[%u]: %s%s.%u [%d] %s": +7 to min_buf size-> autogen::F_APPEND_SORT_UNITS() char *pend; uint32_t len; pend = buf; pend += bsz; len = rscp->hdr.bname_slen; memcpy(buf, rscp->hdr.base_name, (size_t) len); //base name buf += len; *buf = '['; buf ++ ; buf = __rcd_cnv_s(buf, RCD_GET_UNIT(retU)); //unit number *buf = ']'; buf ++ ; *buf = ':'; buf ++ ; *buf = ' '; buf ++ ; len = p_un->dir_slen; memcpy(buf, p_un->un_dir, (size_t) len); //unit dir buf += len; len = p_un->file_slen; memcpy(buf, p_un->un_file, (size_t) len); //file name buf += len; *buf = '.'; buf ++ ; buf = __rcd_cnv_s(buf, RCD_GET_LINE(retU)); *buf = ' '; buf ++ ; *buf = '['; buf ++ ; { //rcode int rcd; rcd = RCD_GET_RCODE(retU); // -2 .. +1 if (rcd < 0) { *buf = '-'; buf ++ ; rcd = -rcd; } rcd += '0'; *buf = rcd; buf ++ ; } *buf = ']'; buf ++ ; *buf = ' '; buf ++ ; if (NULL == msg) goto end; len = (pend - buf); if (mlen > len) mlen = len; memcpy(buf, msg, (size_t) mlen); //message buf += mlen; end: *buf = 0; return buf; } int %rcd_bname%_rcdGetMsg(struct rcd_scope* scp, rcode retU, char* buf, int bsz) { const rcd_unit_t *p_un; const char *msg; int32_t itmp; const rcd_scope_t *rscp; if (NULL == scp) { scp = (struct rcd_scope*) &__tls_scope; __tls_scope.scope = &%rcd_bname%_scope; } rscp = ((tls_rcd_scope_t*) scp)->scope; if (0 == RCD_GET_UNIT(retU)) goto fallback; //rcode.detail.unit == 0 -> special case, reserved value. if (bsz < rscp->hdr.min_bufsz) goto fallback; //at least rscp->min_bufsz, +RCD_VMSG_MAX_SZ for formatted msg. itmp = rscp->hdr.unit_cnt; p_un = (rcd_unit_t*) &rscp->unit_ar[0]; //search units p_un = (rcd_unit_t*) __rcd_bin_search((char*) p_un, itmp, sizeof(rcd_unit_t), offsetof(rcd_unit_t, un_id), RCD_GET_UNIT(retU) ); if ( NULL == p_un ) goto fallback; //unit not found //get message msg = NULL; if ( RCD_GET_RCODE(retU) != RCD_FVMSG ) { rcd_msg_t *pmsg; //search messages itmp = p_un->msg_cnt; pmsg = (rcd_msg_t*) &p_un->msg_ar[0]; if ( NULL == pmsg ) goto no_msg; //no msg in the unit pmsg = (rcd_msg_t*) __rcd_bin_search((char*) pmsg, itmp, sizeof(rcd_msg_t), offsetof(rcd_msg_t, lnum), RCD_GET_LINE(retU) ); if ( NULL == pmsg ) goto no_msg; //no msg for a given line, itmp=msg_len has no meaning in such case. msg = pmsg->msg; itmp = pmsg->msg_len; } else { //RCD_FVMSG const rcd_vmsg_t *vmsg; vmsg = &((tls_rcd_scope_t*) scp)->vmsg; //check if vmsg matches *this* rcode if (retU.value == vmsg->retU.value) { msg = vmsg->msg_buf; itmp = vmsg->msg_len; } } no_msg: { char *pend; pend = __rcd_assemble_msg( buf, bsz, retU, rscp, p_un, msg, itmp); itmp = (pend - buf); return itmp; } fallback: return RCD_PRINT_BUF(retU, buf, bsz); } void __%rcd_bname%_rcdSetVmsg(rcode rcd, const char* fmt, ... ) { rcd_vmsg_t *vmsg; int len; va_list argp; //*this* unit vmsg = &((tls_rcd_scope_t*) %rcd_bname%_rcdGetScopePtr())->vmsg; va_start(argp, fmt); len = vsnprintf(vmsg->msg_buf, RCD_VMSG_MAX_SZ, fmt, argp ); va_end(argp); vmsg->msg_len = len; vmsg->retU = rcd; } __END_DECLS wxedid-0.0.32/src/rcode/rcd_autogen0000755000175000017500000006604414640400010014103 00000000000000#!/bin/bash declare -r version='3.2' # The rcd_autogen script scans source files of the target project and generates # source files needed to implement extended rcode functionality in the target # project. # The files generated by rcd_autogen have to be linked with the target project, # and their content comes from template files distributed along with the rcode # project. # Therefore, all the files generated by rcd_autogen are licensed under the same # terms as the rcode project. # # This file is part of the rcode project. # # Copyright (C) 2019-2024 Tomasz Pawlak # e-mail: tomasz.pawlak@wp.eu # # License: GNU Lesser General Public License version 3 (LGPLv3+) # # The rcd_autogen script is free software; you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published by # the Free Software Foundation; either version 3 of the License, or (at your # option) any later version. # # The rcd_autogen script 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 Lesser General Public # License for more details. # # You should have received a copy of the GNU Lesser General Public License # along with the rcd_autogen script; see the file COPYING. If not, # see . #check bash version if (( ${BASH_VERSINFO[0]}*10+${BASH_VERSINFO[1]} < 44 ));then echo "[E!] rcd_autogen: required bash v4.4.0 or better"; exit 1 fi #------------------| CONFIG |---------------- shopt -s expand_aliases shopt -u checkwinsize #keywords from rcode.h: #PP keywords used to expand RCD macros in target files declare -r kwd_autogen='-D_USE_RCD_AUTOGEN -D_RCD_AUTOGEN' #rcode magic kwd used to recognize tokens in PP mode. declare -r kwd_magic='_RCD_MAGIC_' #rcode kwd for unit-id definitions declare -r kwd_unit='UNIT' #rcode kwd for messages with source line numbers declare -r kwd_msg='LN_N' #field separator declare -r kwd_ifs='%RCD%' #global vars declare tmps #temp var declare root_dir #base source dir, relative to project's top dir. declare root_dir_abs #root_dir absolute path, all other dirs are relative to root_dir_abs, except tmp dir. declare rcode_dir #rcode directory declare rcode_h_dir #relative dir for including rcode.h declare tmp_dir #dir for temp files declare out_dir #dir for output files declare arg_scan_tgt #arg: list of dirs/files to scan or a path/to/file.$arg_fext declare lang #language: C/CPP declare src_fext #src file extension: .c/.cpp declare pproc #lang PP (e.g. 'gcc') declare pp_args #PP args declare base_name #base name for output files declare out_scp_hdr #output scope header file declare out_scp_src #output scope source file declare rcdgen_md #full/basic/dummy declare -i rcdgen_md_n #numeric mode value: full/basic/dummy -> 2/1/0 declare -i max_jobs #num of parallel jobs declare -i verb_md #verbose mode declare -i dbg_md #debug mode #global arrays declare -a target_file_ar declare -a msg_struct_ar declare -a log_file_ar #constants declare -r autogen_hdr='File generated with rcd_autogen v'$version declare -r out_prefix='rcd_scope' declare -r arg_fext='.rcdgen_cfg' declare -r tmp_fext='.rcdgen_tmp' declare -r tgt_fext='.rcdgen_target' declare -r log_fext='.rcdgen_log' declare -r end_list='__end_list__' #template files declare -r tmpl_func_hdr='rcd_fn.tmp.h' declare -r tmpl_func='rcd_fn.tmp.c' declare -r tmpl_func_bm='rcd_fn_bm.tmp.c' declare -r tmpl_scp_hdr='rcd_scp.tmp.h' declare -r tmpl_scp_fn='rcd_scp.tmp.c' declare -r tmpl_scp_fn_dm='rcd_scp_dm.tmp.c' #units declare tmp_scp_file="scope_struct$tmp_fext" #---<| Helper Functions |>--- F_CALL_STACK() { local -i depth=0 local -i lvl=${#FUNCNAME[@]} echo -n "[Call stack]" while (( lvl > 1 )); do #lvl==0 -> this function! (( lvl-=1 )) echo -en "\n[$depth] ${BASH_LINENO[$lvl]} > ${FUNCNAME[$lvl]}()" (( depth++ )) done echo ".${BASH_LINENO[0]}" } fn_msg() { #trick: bash is not expanding variables in aliases echo -n "[$1] ${FUNCNAME[1]}(): " } # INFO / WARNING / ERR aliases alias INFO="echo -en "'[i] ' alias WARN="echo -en "'[W] ' alias ERR="echo -en "'[E!] ' alias ERR_CS="echo '[E!]';F_CALL_STACK; echo -en '::'" f_split_path() { #$1=full path: replaced with path without file name, $2=out file name local -n pth=$1 local -n fnm=$2 local -a path_ar local -i idxfn IFS='/' read -a path_ar <<< $pth; unset IFS idxfn=$(( ${#path_ar[@]} -1 )) fnm=${path_ar[idxfn]} pth=${pth/"$fnm"/} } f_gen_rcode_h_path() { # create #include path/to/rcode.h: relative to $out_dir local -i out_depth; local -a path_ar local path tmps=$out_dir if [ "$tmps" != "." ]; then if [ "${tmps:0:1}" != "/" ] ;then tmps="/"$tmps; fi else unset tmps; fi tmps="$root_dir_abs$tmps" IFS='/'; read -a path_ar <<< $tmps; out_depth=${#path_ar[@]} read -a path_ar <<< $root_dir_abs; unset IFS (( out_depth -= ${#path_ar[@]} )) for (( idx=0; idx 3 ));then ERR "Incorrect --debug-level='$argval'\n"; f_info_help 1 fi;; --version) echo "rcd_autogen v$version\n"; exit 0;; --help) f_info_help 0;; *) ERR "Unknown argument: "$arg"\n"; f_info_help 1 esac done } #---<| Startup |>--- if (( 0 == $# ));then ERR "No arguments provided\n"; f_info_help 1; fi #defaults rcode_dir=$(dirname $(realpath -s $0)); tmp_dir='rcd_temp' rcdgen_md='full' max_jobs=0 verb_md=0 dbg_md=0 #---<| environment variables |>--- INFO "Starting rcd_autogen v$version ...\n" #env. var: basic mode (configure script) if [ "$(printenv RCDGEN_BASIC)" = "1" ]; then rcdgen_md='basic' fi #env. var: dummy mode (configure script) if [ "$(printenv RCDGEN_DUMMY)" = "1" ]; then rcdgen_md='dummy' fi #NOTE: the above env. vars are overridden by cmdline/config file args. #---[ cmd line arguments ]--- #1st argument: read arguments from file? args=("$@"); #copy arg array tmps=${args[0]}; if [ "${tmps: -${#arg_fext}}" == $arg_fext ];then if [ ! -e "$tmps" ]; then ERR "'$tmps': File does not exist!\n"; exit 1; fi INFO "Reading arguments from file: '$tmps'\n" unset args while read arg_ln ; do if [ -z "$arg_ln" ]; then continue; fi args+=("$arg_ln") done < <(sed -n 's|#.*||g;P' $tmps) #filter shell comments fi F_CMD_LINE_ARGS args unset args #force debug level from env. var. tmps="$(printenv RCDGEN_DBG_LEVEL)" if [ "d$tmps" != "d" ]; then INFO "env: RCDGEN_DBG_LEVEL=$tmps\n" if ! [[ $tmps =~ ^[0-9]+$ ]]; then dbg_md=-1; fi if (( dbg_md < 0 || tmps > 3 ));then ERR "RCDGEN_DBG_LEVEL: bad value:'$tmps'\n"; exit 1; fi dbg_md=$tmps fi #numeric mode value if [ "$rcdgen_md" == "full" ];then rcdgen_md_n=2; fi if [ "$rcdgen_md" == "basic" ];then rcdgen_md_n=1; fi if [ "$rcdgen_md" == "dummy" ];then rcdgen_md_n=0; fi #---[ Check settings ]--- if [ "x$arg_scan_tgt" = "x" ];then ERR "Missing scan target\n";exit 1;fi if [ "x$lang" = "x" ];then ERR "Language not set\n";exit 1;fi if [ "x$root_dir" = "x" ];then ERR "Root directory not set\n";exit 1;fi if [ "x$base_name" = "x" ];then ERR "Base name not set\n";exit 1;fi if (( 0 == ${#out_dir} ));then out_dir="."; fi if (( 0 == ${#tmp_dir} ));then tmp_dir="."; fi #---[ debug and verbose mode ]--- if (( $dbg_md > 0 ));then alias DBG1="echo -en '[D1]' " alias DBG1_FN="fn_msg D1; echo -en" else alias DBG1=# alias DBG1_FN=# fi if (( dbg_md > 1 ));then alias DBG2="echo -en '[D2]' " alias DBG2_FN="fn_msg D2; echo -en" else alias DBG2=# alias DBG2_FN=# fi if (( dbg_md > 2 ));then alias DBG3="echo -en '[D3]' " alias DBG3_FN="fn_msg D3; echo -en" else alias DBG3=# alias DBG3_FN=# fi if (( verb_md != 0 || dbg_md > 0 ));then #verbose mode always on in dbg mode alias VRB="echo -en '[i]' " alias VRB_FN="fn_msg i; echo -en" else alias VRB=# alias VRB_FN=# fi #preprocessor setting: #configure script overrides preprocessor name from --preproc|-pp arg. tmps="$(printenv RCDGEN_CPP)" if [ "pp$tmps" != "pp" ]; then if [ "$lang" = "c" ]; then pproc=$tmps; fi fi tmps="$(printenv RCDGEN_CXXCPP)" if [ "pp$tmps" != "pp" ]; then if [ "$lang" = "cpp" ]; then pproc=$tmps; fi fi if [ "x$pproc" = "x" ];then ERR "PP not set\n";exit 1;fi #append additional (external) PP args: tmps="$(printenv RCDGEN_PP_ARGS)" if [ "pp$tmps" != "pp" ]; then pp_args+=" $tmps"; fi #prefix for output file names, functions and structures if $(f_chk_str_alpha $base_name); then ERR "--base-name='$base_name' invalid!\n"; exit 1; fi #root directory: get abs. path root_dir_abs=$(realpath $root_dir) cd $root_dir_abs; #relative path to rcode/rcode.h f_gen_rcode_h_path; #check for nproc: def. max_jobs=num_of_CPU if (( max_jobs == 0 )); then hash nproc 2>/dev/null if (( 0 == $? ));then (( max_jobs=$(nproc) )) VRB "Using 'nproc' for setting jobs limit=$max_jobs\n" else max_jobs=1 fi fi if (( max_jobs < 2 )) ;then WARN "Parallel processing NOT enabled.\n"; fi #output files out_scp_hdr="$out_dir/" out_scp_hdr+=$base_name'_'$out_prefix'.h' out_scp_src="$out_dir/" out_scp_src+=$base_name'_'$out_prefix$src_fext tmp_scp_file="$tmp_dir/$tmp_scp_file" #---[ Autogen functions ]--- F_GEN_MSG_FILE() { #$1=file, $2=prefix, $3=msg_ar local m_file=$1 local m_prefix=$2 local -n m_ar=$3 local -i midx local m_ln #begin message struct for the unit m_ln="static const rcd_msg_t msg_"$m_prefix"[] = {\n" for (( midx=0; midx<(${#m_ar[@]}-1); midx++ )); do m_ln+="\t${m_ar[$midx]},\n" done #last line + end message struct: m_ln+="\t${m_ar[$midx]}\n};\n\n" echo -en $m_ln >> $m_file } F_SCAN_FILE() { #$1=target index local tgt_idx=$1 local src_file #relative path local msg_file local log_file local -a rcd_line_ar local -a msg_ar local rcd_magic_ln local tmps local scp_dir local scp_unit local scp_prefix local scp_struct local scp_pmsg local num local -i str_len local -i rcd_unit_id=0 local -i cnt_msg=0 local -i max_mlen=0 local -r sedcmd='s|^.*'"$kwd_magic"'|'"$kwd_magic"'|g;s|'"$kwd_ifs"'|^|g;/'"$kwd_magic"'/p' #path is prepended here, to reduce size of array of msg/log files src_file="${target_file_ar[$tgt_idx]}" msg_file="$tmp_dir/${msg_struct_ar[$tgt_idx]}" log_file="$tmp_dir/${log_file_ar[$tgt_idx]}" VRB "Scanning file: [idx=$tgt_idx] $src_file\n" DBG1_FN "\n msg: '$msg_file'\n log: '$log_file'\n" DBG1_FN "PP invocation:\n ""'$pproc $pp_args $kwd_autogen $src_file 2>$log_file'\n" DBG2_FN "PID=$BASHPID\n" while read -r rcd_magic_ln ; do #the ^ field separator is generated from $kwd_ifs by sed IFS='^'; read -a rcd_line_ar <<< $rcd_magic_ln ; unset IFS; DBG3_FN "input line: '$rcd_magic_ln'\n" #pre-read fields tmps="${rcd_line_ar[1]}"; num="${rcd_line_ar[2]}" #--> msg definition if [ $kwd_msg == "$tmps" ];then tmps=${rcd_line_ar[3]} DBG3 "RCD_RETURN_FAULT_MSG: scope=$rcd_unit_id, ln=$num, msg=$tmps\n" str_len=${#tmps}; (( str_len -= 2 )) #exclude double-quotes if (( str_len <= 0 )); then ERR_CS "$src_file: ln=$num : zero-length message!\n"; exit 1;fi #check rcode.h::RCD_VMSG_MAX_SZ if (( str_len > 512 )); then ERR_CS "$src_file: ln=$num : message length=$str_len > max=512\n"; exit 1;fi #max msg len if (( str_len > max_mlen )); then max_mlen=$str_len; fi #check message line range: RCD_LINE_MAX=0x3FFF if (( $num > 0x3FFF ));then ERR_CS "$src_file: ln=$num is Out Of Range!\n"; exit 1 fi #append message struct msg_ar+=("{$tmps, $str_len, $num}") (( cnt_msg ++ )) continue fi #--> unit definition if [ $kwd_unit == "$tmps" ];then if (( 0 != $rcd_unit_id ));then ERR_CS "$src_file: Multiple RCD_UNIT defs detected! (have scp=$scp_unit)\n"; exit 1 fi if ! [[ "$num" =~ ^[0-9]+$ ]]; then ERR_CS "$src_file: RCD_UNIT: bad value:'$num'\n"; exit 1; fi rcd_unit_id=$num #unit number #check unit ID range: RCD_UNIT_MAX=0xFFFF if (( $rcd_unit_id > 0xFFFF || $rcd_unit_id < 1 ));then ERR_CS "$src_file: RCD_UNIT='$rcd_unit_id' is Out Of Range! (1..65535)\n"; exit 1 fi #scope prefix scp_dir="$root_dir/$src_file" scp_prefix=$scp_dir f_clear_str scp_prefix DBG2 "RCD_AUTOGEN_DEFINE_UNIT: scope=$rcd_unit_id, scp=$scp_unit, prefix=$scp_prefix\n" f_split_path scp_dir scp_unit #spit path & file name #predefined name of msg struct (pointer) scp_pmsg="msg_$scp_prefix" fi #unknown string from pproc here (ignored) done < <($pproc $pp_args $kwd_autogen $src_file 2>$log_file | sed -n "$sedcmd") if (( 0 == $rcd_unit_id ));then if (( 0 != cnt_msg ));then ERR_CS "$src_file: missing unit number definition\n"; exit 1 fi DBG1_FN "$src_file: RCD_UNIT undefined -> clear msg tmp file.\n" echo -n '' > $msg_file return 0; fi if (( 0 != cnt_msg ));then #if no msg were registered, insert NULL ptr to msg struct F_GEN_MSG_FILE $msg_file $scp_prefix msg_ar scp_struct="{$scp_pmsg" else DBG1_FN "'$src_file' No massages found -> NULL msg struct ptr\n" scp_struct="{NULL" echo -n '' > $msg_file fi scp_struct+=", \"$scp_dir\", \"$scp_unit\", ${#scp_dir}, ${#scp_unit}, $rcd_unit_id, $cnt_msg}" (( max_mlen= max_mlen + ${#scp_dir} + ${#scp_unit} )) #min buff for this scope #inject $rcd_unit_id as the first field: for sorting units by number #append min buff size, for calc. overall min buff size scp_struct="$rcd_unit_id\t$scp_struct$max_mlen\n"; DBG2_FN "scp_struct line: '$scp_struct'\n" echo -en $scp_struct >> "$tmp_scp_file" # *atomic write* } F_CHK_FILE() { #$1=file $2=error info $3!=0 -> ignore file name extension local Afile=$1 local e_info=$2 local -i ignore_ext=$3 DBG2_FN "$e_info '$Afile' ignore_ext='$ignore_ext'\n" #check if file exist if [ ! -e "$Afile" ];then ERR_CS "$e_info:'$Afile' does not exist.\n"; exit 1 fi if (( ignore_ext != 0 ));then return 0; fi #check extension if [ "${Afile: -${#src_fext}}" != $src_fext ];then ERR_CS "$e_info: '$Afile' wrong file name extension!\n"; exit 1 fi } F_SCAN_DIR() { #$1=dir local -n fdir=$1 local fname local -i fcnt=0 #filter-files by extension while read fname; do #check extension if [ "${fname: -${#src_fext}}" != $src_fext ];then continue; fi fname=$fdir/$fname fname=${fname/'./'}; fname=${fname%'/'} F_CHK_FILE $fname ${FUNCNAME[0]} 1 #no chk fext target_file_ar+=($fname); DBG2_FN "adding file: '$fname'\n" (( fcnt++ )) done < <(ls $fdir) DBG2_FN "'$fdir' : $fcnt files found.\n" if [ 0 == fcnt ];then VRB_FN "No matching files found in $fdir/ -> Skip\n" fi } F_READ_TGDEF_FILE() { #$1=list file local -n lstfile=$1 local line local rel_dir='.' if [ ! -e $lstfile ];then ERR_CS "'$lstfile' File does not exist.\n" exit 1 fi VRB "Reading list of targets to scan from file: '$lstfile'\n" while read line; do #skip empty lines if [ 0 == ${#line} ];then continue; fi DBG3_FN "Rd line: '$line'\n" #.SETDIR: set relative dir for following files if [ "${line: 0:7}" == '.SETDIR' ];then line=${line: 7}; line=${line#' '}; line=${line%'/'}; rel_dir=$line; DBG3_FN "SETDIR '$rel_dir'\n" continue fi #.SCANDIR: scan for files in a given dir, append them to global file array if [ "${line: 0:8}" == '.SCANDIR' ];then line=${line: 8}; line=${line#' '}; DBG3_FN "SCANDIR '$line'\n" F_SCAN_DIR line continue fi #line defines a file line=$rel_dir/$line; line=${line#' '}; line=${line/'./'}; DBG3_FN "file: '$line'\n" F_CHK_FILE $line $lstfile 0 #chk fext target_file_ar+=($line) done < <(sed -n 's|#.*||;s|\t| |g;s|[ ][ ]*| |g;P' $lstfile) #filter shell comments, single space only } F_ARG_TARGET_LIST() { #$1=array of args local -n arg_ar=$1 local arg for arg in ${arg_ar[@]}; do arg=${arg%'/'}; DBG2_FN "arg: '$arg'\n" #dir to scan if [ -d $arg ];then DBG3_FN "dir: '$arg'\n" F_SCAN_DIR arg else #check file extension if [ "${arg: -${#tgt_fext}}" == $tgt_fext ];then #read target list from a file F_READ_TGDEF_FILE arg continue fi #single file F_CHK_FILE $arg "--scan-target=" 0 #chk fext target_file_ar+=($arg); DBG3_FN "file: '$arg'\n" fi done } F_CHK_DUP_AR() { #$1=target array $2=message local -n file_ar=$1 local msg=$2 local -i Aidx local -i Bidx local -i ARsz=${#file_ar[@]} local -i err=0 local FA local FB for (( Aidx=0; Aidx<(ARsz-1); Aidx++ )); do FA=${file_ar[Aidx]}; DBG3_FN "\n" for (( Bidx=Aidx+1; Bidx msg_main_c.$tmp_fext for idxf in ${!target_file_ar[@]}; do base=${target_file_ar[idxf]} f_clear_str base printf -v fname "msg_%s$tmp_fext" $base msg_struct_ar[idxf]=$fname; DBG3_FN "tmp: [${#msg_struct_ar[@]}]: $fname\n" base+="$log_fext" log_file_ar[idxf]=$base; DBG3_FN "log: [${#log_file_ar[@]}]: $base\n" done DBG1_FN "done.\n" } F_CHECK_LOGS() { local fname local sz_str local -i fsize #check log files: size > 0 for fname in ${log_file_ar[@]}; do fname="$tmp_dir/$fname" if [ -e $fname ];then DBG2_FN "checking log: '$fname'\n" sz_str=$(wc -c "$fname") fsize=${sz_str/" $fname"/} if (( fsize > 0 ));then ERR "PP error! Log file: $fname\n"; cat $fname; exit 1 fi else ERR_CS "Missing log file: '$fname'\n"; exit 1 fi done VRB "Checking PP log files: OK\n" } F_PARALLEL() { local -r n_jobs=${#target_file_ar[@]} local -i cnt=0 local -i job_limit=$max_jobs DBG2_FN "PID=$BASHPID\n" while (( cnt < n_jobs )); do while (( cnt < job_limit )); do F_SCAN_FILE $cnt & (( cnt++ )) if (( cnt >= n_jobs ));then break; fi done DBG2_FN "WAIT: job count=$cnt of $n_jobs, max_jobs=$max_jobs\n" wait (( job_limit += max_jobs )) done DBG2_FN "DONE.\n" } F_SCAN_TARGET() { local -a arg_target_ar #--scan-target= get targets (colon-separated list) IFS=':' read -a arg_target_ar <<< $arg_scan_tgt unset IFS DBG1_FN "arg list (cnt=${#arg_target_ar[@]}):\n"${arg_target_ar[@]}"\n$end_list\n" F_CHK_DUP_AR arg_target_ar "--scan-target=: Checking for duplicate targets" #scan elements from arg F_ARG_TARGET_LIST arg_target_ar VRB "List of files to scan (count=${#target_file_ar[@]}):\n${target_file_ar[@]}\n$end_list\n" if (( 0 == ${#target_file_ar[@]} ));then ERR "No files to scan!\n"; exit 1 fi F_CHK_DUP_AR target_file_ar "Checking for duplicate target files" F_GEN_TMP_NAMES #Parallel scanning of target files F_PARALLEL F_CHECK_LOGS } F_APPEND_MSG_FILES() { local fname #append message structs from temp. files for fname in ${msg_struct_ar[@]}; do fname="$tmp_dir/$fname" if [ -e $fname ];then DBG3_FN "file: '$fname'\n" cat "$fname" >> $out_scp_src else ERR_CS "Missing temp file: '$fname'\n"; exit 1 fi done DBG1_FN "done.\n" } F_CHK_UNIT_ID() { #$1=sorted unit array local -n ar_scp=$1 local -i idxs local -i scpA local -i scpB local scp_ln scp_ln=${ar_scp[0]} scpA="${scp_ln%'{'*}"; for (( idxs=1; idxs<(${#ar_scp[@]}); idxs++ ));do scp_ln=${ar_scp[$idxs]} scpB="${scp_ln%'{'*}"; if (( scpA == scpB )); then ERR_CS "Found duplicate unit ID=$scpA\n"; exit 1; fi scpA=$scpB done VRB "Checking for duplicate unit IDs: OK\n" } F_APPEND_SORT_UNITS() { local -a unit_ar local scp_ln local fout local units local -i idxs local -i bufsz local -i min_buff_sz=0 readarray -t unit_ar < <(cat $tmp_scp_file | sort) if (( 0 == ${#unit_ar[@]} )); then ERR_CS "No defined units found!\n"; exit 1; fi F_CHK_UNIT_ID unit_ar DBG3_FN "SORTED unit def. array: [${#unit_ar[@]}]\n${unit_ar[@]}\n" for (( idxs=0; idxs<(${#unit_ar[@]}-1); idxs++ ));do scp_ln=${unit_ar[$idxs]}; DBG3_FN "unit line: $scp_ln\n" bufsz="${scp_ln/*'}'/}"; DBG3_FN "bufsz=$bufsz\n" #check min buff size appended by F_SCAN_FILE if (( bufsz > min_buff_sz ));then min_buff_sz=$bufsz; fi scp_ln="${scp_ln/'}'*/'}'}"; DBG2_FN "appending unit: $scp_ln\n" #cut injected bufsz units+="\t\t${scp_ln/*'{'/'{'},\n" #cut scp numbers injected by F_SCAN_FILE done #last unit line: no comma scp_ln=${unit_ar[$idxs]}; DBG3_FN "unit line: $scp_ln\n" bufsz="${scp_ln/*'}'/}"; DBG3_FN "bufsz=$bufsz\n" if (( bufsz > min_buff_sz ));then min_buff_sz=$bufsz; fi scp_ln="${scp_ln/'}'*/'}'}"; DBG2_FN "appending unit: $scp_ln\n" units+="\t\t${scp_ln/*'{'/'{'}" #24= ($base_name) +7(65535: ) +1(dot) + 5(ln_num) +1(space) +6(' [-2] ') + +1(NULL) +1 (( min_buff_sz += 24 )) (( min_buff_sz += ${#base_name} )) fout="typedef struct rcd_scope_s { //internal\n" fout+="\trcd_scphdr_t hdr;\n" fout+="\trcd_unit_t unit_ar[${#unit_ar[@]}];\n" fout+="} rcd_scope_t;\n\n" fout+="static rcd_scope_t "$base_name"_scope = {\n" fout+='\t'".hdr = {\n" fout+='\t\t'".base_name = __base_name,\n" fout+='\t\t'".bname_slen = ${#base_name},\n" fout+='\t\t'".unit_cnt = ${#unit_ar[@]},\n" fout+='\t\t'".min_bufsz = $min_buff_sz,\n" fout+='\t\t'".rcdgen_md = $rcdgen_md_n,\n" fout+='\t\t'".reserve = 0\n\t},\n" fout+='\t'".unit_ar = { //units\n$units\n\t}\n" fout+="};\n\n" echo -en $fout >> $out_scp_src DBG2_FN "min buff size: $min_buff_sz\n" } declare -r sed_fout_cmd='s|%rcd_bname%|'"$base_name"'|g;s|%path%|'"$rcode_h_dir"'|g;s|[ ]*\/\/|\n|g;/^[ ]*[\n]/d;/^[ ]*$/d;P' declare -r info_hdr="\n/* $autogen_hdr mode=$rcdgen_md_n ($rcdgen_md) */\n\n" F_GEN_SOURCE() { local ftmp VRB "Generating source file in '$root_dir' dir: '$out_scp_src'\n" #autogen info string echo -en $info_hdr > $out_scp_src #includes echo -en "#include \n" >> $out_scp_src echo -en "#include \""$rcode_h_dir"rcode_scp.h\"\n\n" >> $out_scp_src if [ "$rcdgen_md" == "dummy" ];then ftmp=$tmpl_scp_fn_dm #dummy mode else ftmp=$tmpl_scp_fn #static base name for units echo -en "static const char __base_name[]=\""$base_name"\";\n\n" >> $out_scp_src #append static messages discovered by F_SCAN_FILE() F_APPEND_MSG_FILES #append sorted struct of units F_APPEND_SORT_UNITS fi #append scope accessors code sed -n "$sed_fout_cmd" $rcode_dir/$ftmp >> $out_scp_src if [ "$rcdgen_md" == "full" ];then ftmp=$tmpl_func else ftmp=$tmpl_func_bm #basic mode fi sed -n "$sed_fout_cmd" $rcode_dir/$ftmp >> $out_scp_src } F_GEN_HEADER() { #header: inject $base_name prefixes and include path. VRB "Generating header file in '$root_dir' dir: '$out_scp_hdr'\n" echo -en $info_hdr > $out_scp_hdr sed -n "$sed_fout_cmd" $rcode_dir/$tmpl_scp_hdr >> $out_scp_hdr } F_RM_TMP_FILES() { #$1!=0 -> rmdir local -i rmdir=$1 DBG1_FN "list of files:\n"$(ls $tmp_dir | sed -n "/[$tmp_fext$|$log_fext$]/p")"\n$end_list\n" if (( rmdir != 0 ));then if (( dbg_md == 3 ));then return; fi rm -rf "$tmp_dir"; return; fi rm -f $tmp_dir/*$tmp_fext rm -f $tmp_dir/*$log_fext } F_RM_OUT_FILES() { #delete old/orphaned output files. if [ -e "$out_scp_src" ];then VRB_FN "'$out_scp_src'\n" rm -f "$out_scp_src" fi if [ -e "$out_scp_hdr" ];then VRB_FN "'$out_scp_hdr'\n" rm -f "$out_scp_hdr" fi } #---[ Begin Autogen ]--- #env. var: clean mode (configure script): overrides all other settings. if [ "$(printenv RCDGEN_CLEAN)" = "1" ]; then F_RM_OUT_FILES F_RM_TMP_FILES 1 INFO "rcd_autogen: CLEAN mode, finished.\n" exit 0; fi if [ ! -d $tmp_dir ];then VRB "Creating temp. directory: '$tmp_dir'\n" mkdir "$tmp_dir" if (( 0 != $? ));then ERR "Failed creating temp. directory: '$tmp_dir'\n"; exit 1; fi fi #print settings in verbose mode if (( verb_md != 0 ));then f_print_settings; fi #delete old/orphaned output files. F_RM_OUT_FILES #remove orphaned temp. files F_RM_TMP_FILES #generate header file: (required for PP stage) F_GEN_HEADER #check for dummy mode if [ "$rcdgen_md" != "dummy" ];then #create list of target files to scan, perform the scan, generate temp. files F_SCAN_TARGET fi #generate source file F_GEN_SOURCE #remove temp. dir F_RM_TMP_FILES 1 INFO "rcd_autogen finished.\n" wxedid-0.0.32/src/rcode/rcd_autoconf.m40000644000175000017500000000602014640400010014557 00000000000000dnl serial 6 dnl dnl extension for autoconf: integration with rcd_autogen dnl dnl rcd_autoconf.m4 dnl version: 3.0 dnl dnl Copyright (C) 2019-2024 Tomasz Pawlak dnl e-mail: tomasz.pawlak@wp.eu dnl dnl Usage: dnl AC_OPT_RCD_AUTOGEN([ path/to/rcd_autogen ]) dnl AC_DEFUN_ONCE([AC_OPT_RCD_AUTOGEN],[ AC_ARG_ENABLE([rcdgen-mode], AS_HELP_STRING([--enable-rcdgen-mode=@<:@full/basic/dummy/skip/clean@:>@], [ full: generate struct of rcode messages and releated accessor functions code; basic: struct of rcode messages only (+ tiny accessors); dummy: mainly for libs: dummy fuctions only, to keep the interface for linking; skip: do not run the rcd_autogen; clean: remove all rcd_autogen output files. [default=full] ]), [rcd_mode=$enableval], [rcd_mode=full]) AC_CHECK_PROG(ac_have_bash, bash, yes, no) AS_IF([test "$ac_have_bash" = "yes"], [], [AC_MSG_ERROR((E) Bash is required to run rcd_autogen, 1)]) AS_UNSET(ac_have_bash) AS_MESSAGE([(i) rcd_autogen mode: $rcd_mode]) AS_MESSAGE([(i) rcd_autogen CPP ='$CPP' ]) AS_MESSAGE([(i) rcd_autogen CXXCPP='$CXXCPP' ]) AS_VAR_SET([ac_rcd_autogen_path], ["$1"]) export ac_rcd_autogen_path dnl NOTE: It's possible to export RCDGEN_PP_ARGS= dnl before invoking configure script AS_VAR_APPEND([RCDGEN_PP_ARGS], [[" $CPPFLAGS"]]) AS_VAR_APPEND([CPPFLAGS], [[" -D_USE_RCD_AUTOGEN"]])dnl see rcode.h dnl NOTE: preprocessor command defined by configure overrides dnl the --preproc|-pp setting in rcd_autogen, but dnl the --pp-args|-pa are always appended to PP arg list. AS_IF([test "pp$CC" != "pp"], [ export RCDGEN_CPP=$CPP ],[]) AS_IF([test "pp$CXXCPP" != "pp"], [ export RCDGEN_CXXCPP=$CXXCPP ],[]) dnl NOTE: Modes: full/basic/dummy can be overridden by rcd_autogen dnl option: --run-mode|-md, if it's set. dnl This allows to have per-target modes defined (in multi-target projects) dnl Modes: skip/clean are never overridden. dnl There's no 'RCDGEN_FULL', because 'full' is the default mode. AS_IF([test "$rcd_mode" = "basic"], [ export RCDGEN_BASIC=1 ],[]) AS_IF([test "$rcd_mode" = "dummy"], [ export RCDGEN_DUMMY=1 ],[]) AS_IF([test "$rcd_mode" = "skip"], [ AS_UNSET(ac_rcd_autogen_path); ],[]) AS_IF([test "$rcd_mode" = "clean"], [ export RCDGEN_CLEAN=1 ],[]) ])dnl AC_OPT_RCD_AUTOGEN dnl run the rcd_autogen against given target dnl dnl Usage: dnl 1. Pass the arguments directly to rcd_autogen: dnl AC_RCODE_AUTOGEN_TARGET([ -l=C -pa='-Wfatal-errors' -rd=. -st=/src ]) dnl 2. Use a file with arguments for rcd_autogen: (.rcdgen_cfg extension is mandatory) dnl AC_RCODE_AUTOGEN_TARGET([ src/target_name.rcdgen_cfg ]) AC_DEFUN([AC_RCD_AUTOGEN_TARGET],[ AS_IF([test "x$ac_rcd_autogen_path" != "x"], dnl mode=skip [ AS_IF([bash -c "$ac_rcd_autogen_path $1"], [], [AC_MSG_ERROR((E) rcd_autogen failed, 1)]) ] []) ])dnl AC_RCD_AUTOGEN_TARGET wxedid-0.0.32/src/rcode/rcode_scp.h0000644000175000017500000000422314640400010013764 00000000000000/* Declarations for rcode_scp.h Copyright (C) 2020-2024 Tomasz Pawlak, e-mail: tomasz.pawlak@wp.eu rcode_scp.h v3.0 License: GNU Lesser General Public License version 3 (LGPLv3+) The rcode project is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. The rcode project 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the rcode project; see the file COPYING. If not, see: http://www.gnu.org/licenses */ #ifndef RCODE_SCOPE_H #define RCODE_SCOPE_H 1 #include "rcode.h" /* included in files generated by rcd_autogen */ #define RCD_VMSG_MAX_SZ 512 #include __BEGIN_DECLS /* "volatile"/variable message: valid only right after the rcode is returned This structure is hold in TLS, see rcd_scp.tmp.c */ typedef struct __attribute__ ((packed)) rcd_vmsg_s { rcode retU; uint32_t msg_len; char msg_buf[RCD_VMSG_MAX_SZ]; } rcd_vmsg_t; /* message assigned to a given line in the source file */ typedef struct __attribute__ ((packed)) rcd_msg_s { const char *msg; const uint16_t msg_len; const uint16_t lnum; } rcd_msg_t; /* scope descriptor */ typedef struct __attribute__ ((packed)) rcd_unit_s { const rcd_msg_t *msg_ar; const char *un_dir; const char *un_file; const uint16_t dir_slen; const uint16_t file_slen; const uint16_t un_id; const uint16_t msg_cnt; } rcd_unit_t; /* scope header */ typedef struct __attribute__ ((packed)) rcd_scphdr_s { const char *base_name; const uint16_t bname_slen; const uint16_t unit_cnt; /* unit count */ const uint16_t min_bufsz; const uint8_t rcdgen_md; /* rcd_autogen run mode */ const uint8_t reserve; /* alignment */ } rcd_scphdr_t; __END_DECLS #endif /* RCODE_SCOPE_H */ wxedid-0.0.32/src/rcode/rcd_scp.tmp.c0000644000175000017500000000176614640400010014243 00000000000000/* rcode template file: rcd_scp.tmp.c */ #include "%rcd_bname%_rcd_scope.h" __BEGIN_DECLS // rcd_autogen: full/basic mode typedef struct __tls_rcd_scope_s { const rcd_scope_t *scope; // "volatile"/variable message: // valid only right after the rcode is returned rcd_vmsg_t vmsg; } tls_rcd_scope_t; static __thread tls_rcd_scope_t __tls_scope; struct rcd_scope* %rcd_bname%_rcdGetScopePtr() { __tls_scope.scope = &%rcd_bname%_scope; return (struct rcd_scope*) &__tls_scope; } //full mode (2) -> VMSG defines min buffer size, otherwise //it's the max length of static message //the rcd_autogen_md variable is injected by rcd_autogen //RCD_MODE_BASIC comes from rcode.h int %rcd_bname%_rcdGetMinMsgBufSz(struct rcd_scope *scp) { tls_rcd_scope_t *p_scp = (tls_rcd_scope_t*) scp; __tls_scope.scope = &%rcd_bname%_scope; if (NULL == p_scp) {p_scp = &__tls_scope; } return (int) ( p_scp->scope->hdr.rcdgen_md > RCD_MODE_BASIC) ? RCD_VMSG_MAX_SZ : p_scp->scope->hdr.min_bufsz; } __END_DECLS wxedid-0.0.32/src/rcode/rcd_scp_dm.tmp.c0000644000175000017500000000060314640400010014710 00000000000000/* rcode template file: rcd_scp_dm.tmp.c */ // rcd_autogen: dummy mode __BEGIN_DECLS struct rcd_scope* %rcd_bname%_rcdGetScopePtr() { return NULL; } //rcd_autogen_md in dummy mode returns zero #pragma GCC diagnostic ignored "-Wunused-parameter" int %rcd_bname%_rcdGetMinMsgBufSz(struct rcd_scope* scp) { return 0; } #pragma GCC diagnostic warning "-Wunused-parameter" __END_DECLS wxedid-0.0.32/src/rcode/rcd_fn_bm.tmp.c0000644000175000017500000000063414640400010014530 00000000000000/* rcode template file: rcd_fn_bm.tmp.c */ // rcd_autogen: basic/dummy mode __BEGIN_DECLS #pragma GCC diagnostic ignored "-Wunused-parameter" int %rcd_bname%_rcdGetMsg(struct rcd_scope *scp, rcode rcd, char *buf, int bsz) { return RCD_PRINT_BUF(rcd, buf, bsz); } void __%rcd_bname%_rcdSetVmsg(rcode rcd, const char *fmt, ... ) { return; } #pragma GCC diagnostic warning "-Wunused-parameter" __END_DECLS wxedid-0.0.32/src/rcode/rcd_scp.tmp.h0000644000175000017500000000541114640400010014237 00000000000000/* template file: rcd_scp.tmp.h This file is part of the rcode project. Copyright (C) 2019-2024 Tomasz Pawlak, e-mail: tomasz.pawlak@wp.eu rcd_scp.tmp.h v3.0 License: GNU Lesser General Public License version 3 (LGPLv3+) The rcd_scp.tmp.h is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. The rcd_scp.tmp.h 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the rcode project; see the file COPYING. If not, see: www.gnu.org/licenses */ #ifndef %rcd_bname%_RCD_SCP_H #define %rcd_bname%_RCD_SCP_H 1 #include "%path%rcode.h" #include __BEGIN_DECLS /* Besides returning the scope pointer, each call to this function updates the rcd_scope_t.vmsg pointer. The vmsg struct is stored in TLS, so it's pointer can't be initialized statically. The alternative would be to store all the scope data in TLS, but this becomes problematic if the rcd_msg_t message array is large. */ struct rcd_scope* %rcd_bname%_rcdGetScopePtr() __attribute__((pure)); /* if scp == NULL, returns *this* scope ptr. */ int %rcd_bname%_rcdGetMinMsgBufSz(struct rcd_scope* scp); /* Assembles null-terminated rcode description in the *buff, returns length of the string, incl. null byte, -1 for error. Resolved to RCD_PRINT_BUF() in basic and dummy modes if scp == NULL, use *this* scope ptr. */ int %rcd_bname%_rcdGetMsg(struct rcd_scope* scp, rcode retU, char* buf, int bsz) __nonnull((3)); /* for convenience only: */ #define %rcd_bname%_RCD_GET_MSG(_rcd, _buf, _bsz) \ %rcd_bname%_rcdGetMsg(%rcd_bname%_rcdGetScopePtr(), (_rcd), (_buf), (_bsz)) /* internal fn, use: ($base_name)_RCD_RETURN_FAULT_VMSG() or ($base_name)_RCD_SET_FAULT_VMSG() defined below */ void __%rcd_bname%_rcdSetVmsg(rcode, const char* fmt, ... ) __attribute__(( format(printf, 2, 3) )); #define %rcd_bname%_RCD_RETURN_FAULT_VMSG( _rcd, _fmt, ... ) \ { \ _rcd = RCD_SET_VAL( RCD_UNIT, __LINE__, RCD_FVMSG ); \ __%rcd_bname%_rcdSetVmsg(_rcd, _fmt, ##__VA_ARGS__); \ return (_rcd); \ } /* same as ($base_name)_RCD_RETURN_FAULT_VMSG() - but it doesn't return immediately. NOTE: changing the rcode before returning invalidates the message. */ #define %rcd_bname%_RCD_SET_FAULT_VMSG( _rcd, _fmt, ... ) \ { \ _rcd = RCD_SET_VAL( RCD_UNIT, __LINE__, RCD_FVMSG ); \ __%rcd_bname%_rcdSetVmsg(_rcd, _fmt, ##__VA_ARGS__); \ } __END_DECLS #endif /* %rcd_bname%_RCD_SCP_H */ wxedid-0.0.32/src/rcode/rcode.h0000644000175000017500000002117014640400010013117 00000000000000/* Declarations for rcode.h Copyright (C) 2013-2024 Tomasz Pawlak, e-mail: tomasz.pawlak@wp.eu rcode.h v3.1 License: GNU Lesser General Public License version 3 (LGPLv3+) The rcode project is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. The rcode project 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the rcode project; see the file COPYING. If not, see . */ /* Short description: Compacted return type: By default it provides exit status, source file ID (aka unit) and the source line number. The structure can also be used to return true/false booleans or just any user-defined value, as a normal int32 type. The 'rcd_autogen' extension allows to handle relative paths, file names and textual messages tied to particular rcode values. */ #ifndef RCODE_H #define RCODE_H 1 #ifdef __cplusplus #ifndef __STDC_LIMIT_MACROS #define __STDC_LIMIT_MACROS #endif #endif #include #include #include __BEGIN_DECLS typedef unsigned int uint; typedef union __attribute__ ((__transparent_union__)) rcode_u { int32_t value; struct __attribute__ ((packed)) detail_s { int rcode :2 ; /* -2 .. 1 */ uint line :14; /* line number */ uint16_t unit; /* translation unit ID */ } detail; } rcode; #ifndef RCD_UNIT #define RCD_UNIT 0 #endif /* return codes: */ #define RCD_TRUE ((int) 1) /* OK/TRUE: RCD_RETURN_TRUE(), RCD_RETURN_TRUE_MSG() */ #define RCD_OK ((int) 0) /* OK/FALSE: RCD_RETURN_OK(), RCD_RETURN_OK_MSG(), RCD_RETURN_FALSE(), RCD_RETURN_FALSE_MSG() */ #define RCD_F ((int) -1) /* FAULT/FALSE: RCD_RETURN_FAULT(), RCD_RETURN_FAULT_MSG() */ #define RCD_FVMSG ((int) -2) /* FAULT/FALSE: VMSG: "volatile" message, used with rcd_autogen */ /* pseudo bools: */ /* RCD_TRUE */ #define RCD_FALSE RCD_OK /* NOTE: rcode.detail.unit == 0 is a reserved value: it means that the rcode is not assigned to any particular unit. In the result, the allowed unit number range is: 1..65535. */ #define RCD_UNIT_NONE ((uint) 0 ) /* reserved unit number */ #define RCD_UNIT_MAX ((uint) 0xFFFF) /* max 65535-1=65534 units */ #define RCD_LINE_MAX ((uint) 0x3FFF) /* 16383 */ /* RCD_UNIT: It's an identifier for particular unit file. Together with the line number in the .data field it defines exact location of an event in a whole project or in a sub-module of a project. Therefore, the unit number must be unique within a project or within a module. The easiest way to assure this, is to create a shared header file with a list of units: rcdunits.h: #define idMain 1 #define idDataBase 2 then in main.c: #include "rcdunits.h" #define RCD_UNIT idMain #include "rcode/rcode.h" database.c: #include "rcdunits.h" #define RCD_UNIT idDataBase #include "rcode/rcode.h" To assure that the RCD_UNIT value is the same for the whole unit code, the rcode.h must be included before any other header which is referencing rcode.h. */ /* check pseudo-bools: (true) */ __always_inline int RCD_IS_TRUE(rcode rcd) { return ( rcd.detail.rcode == RCD_TRUE ); } /* check pseudo-bools: (false) */ __always_inline int RCD_IS_FALSE(rcode rcd) { return ( rcd.detail.rcode < RCD_TRUE ); } /* get rcode from rcode */ __always_inline int RCD_GET_RCODE(rcode rcd) { return ( rcd.detail.rcode ); } /* get unit code from rcode */ __always_inline uint RCD_GET_UNIT(rcode rcd) { return ( rcd.detail.unit ); } /* get data from rcode */ __always_inline uint16_t RCD_GET_LINE(rcode rcd) { return ( rcd.detail.line ); } /* return rcode status: error={RCD_F,RCD_FVMSG}, ok={RCD_OK,RCD_FALSE,RCD_TRUE} */ __always_inline int RCD_IS_OK(rcode rcd) { return ( rcd.detail.rcode >= RCD_OK ); } /* create custom return code */ __always_inline rcode RCD_SET_VAL(uint unit, uint16_t line, int _rcd) { rcode rcd; rcd.detail.rcode = (_rcd & 0x3); rcd.detail.unit = unit; rcd.detail.line = line; return rcd; } /* set status: OK/FAULT/TRUE/FALSE */ #define RCD_SET_OK( _rcd ) _rcd = RCD_SET_VAL( RCD_UNIT, __LINE__ , RCD_OK ) #define RCD_SET_FAULT( _rcd ) _rcd = RCD_SET_VAL( RCD_UNIT, __LINE__ , RCD_F ) #define RCD_SET_TRUE( _rcd ) _rcd = RCD_SET_VAL( RCD_UNIT, __LINE__ , RCD_TRUE ) #define RCD_SET_FALSE( _rcd ) _rcd = RCD_SET_VAL( RCD_UNIT, __LINE__ , RCD_FALSE) /* return with status: OK/FAULT/TRUE/FALSE */ #define RCD_RETURN_OK( _rcd ) { \ RCD_SET_OK( _rcd ); \ return (_rcd); } #define RCD_RETURN_FAULT( _rcd ) { \ RCD_SET_FAULT( _rcd ); \ return ( _rcd ); } #define RCD_RETURN_TRUE( _rcd ) { \ RCD_SET_TRUE( _rcd ); \ return ( _rcd ); } #define RCD_RETURN_FALSE( _rcd ) { \ RCD_SET_FALSE( _rcd ); \ return ( _rcd ); } /* RCD_PRINT: print the rcode structure, max str. len=44bytes */ __always_inline void RCD_PRINT(rcode rcd, FILE* strm) { fprintf(strm, "RCODE=%d, unit=%u, line=%u\n", rcd.detail.rcode, rcd.detail.unit , rcd.detail.line ); } __always_inline void RCD_PRINT_FD(rcode rcd, int fds) { dprintf(fds, "RCODE=%d, unit=%u, line=%u\n", rcd.detail.rcode, rcd.detail.unit , rcd.detail.line ); } #define RCD_PRINT_MIN_BUF_SZ 44 /* print to buffer */ __always_inline int RCD_PRINT_BUF(rcode rcd, char* buff, int bsz) { return snprintf(buff, bsz, "RCODE=%d, unit=%u, line=%u", rcd.detail.rcode, rcd.detail.unit , rcd.detail.line ); } /* RCD_PRINT for all debug levels */ #ifdef DBG_MODE #define RCD_PRINT_DBG( _rcd, __fd ) \ RCD_PRINT( _rcd, __fd ) #else #define RCD_PRINT_DBG(...) #endif //---------------------| RCODE AUTOGEN |--------------------- /* RCD_AUTOGEN_DEFINE_UNIT has to be invoked before any other MSG macros, otherwise the rcd_autogen will fail due to undefined unit number */ #ifdef _RCD_AUTOGEN #define RCD_AUTOGEN_DEFINE_UNIT \ _RCD_MAGIC_%RCD%UNIT%RCD%RCD_UNIT%RCD% #else #define RCD_AUTOGEN_DEFINE_UNIT #endif #define RCD_MODE_DUMMY 0 #define RCD_MODE_BASIC 1 #define RCD_MODE_FULL 2 /* RCD_xxxx_MSG(_rcd, _msg): Those macros are used by rcd_autogen to generate a source file with rcd_msg_t, rcd_unit_t and rcd_scope_t structures with unit names, _msg strings and corresponding line numbers. This information can be later used f.e. by calling <$base_name>_rcdGetMsg(rcode) or <$base_name>_rcdPrintMsg(rcode). LIMITATION: The message string has to be placed on the same line on which the macro is invoked, otherwise things will break. Multi-line messages or line continuation marks are not directly supported. WORKAROUND: #define M_MULTILINE_STR \ "some string, line1"\ "some string, line2" RCD_SET_FAULT_MSG(ret, M_MULTILINE_STR) */ #ifdef _RCD_AUTOGEN #define RCD_RETURN_FAULT_MSG( _rcd, _msg ) \ _RCD_MAGIC_%RCD%LN_N%RCD%__LINE__%RCD%_msg%RCD% #else #define RCD_RETURN_FAULT_MSG( _rcd, _msg ) \ RCD_RETURN_FAULT( _rcd ) #endif #ifdef _RCD_AUTOGEN #define RCD_SET_FAULT_MSG( _rcd, _msg ) \ _RCD_MAGIC_%RCD%LN_N%RCD%__LINE__%RCD%_msg%RCD% #else #define RCD_SET_FAULT_MSG( _rcd, _msg ) \ RCD_SET_FAULT( _rcd ) #endif #ifdef _RCD_AUTOGEN #define RCD_RETURN_OK_MSG( _rcd, _msg ) \ _RCD_MAGIC_%RCD%LN_N%RCD%__LINE__%RCD%_msg%RCD% #else #define RCD_RETURN_OK_MSG( _rcd, _msg ) \ RCD_RETURN_OK( _rcd ) #endif #ifdef _RCD_AUTOGEN #define RCD_SET_OK_MSG( _rcd, _msg ) \ _RCD_MAGIC_%RCD%LN_N%RCD%__LINE__%RCD%_msg%RCD% #else #define RCD_SET_OK_MSG( _rcd, _msg ) \ RCD_SET_OK( _rcd ) #endif #ifdef _RCD_AUTOGEN #define RCD_RETURN_FALSE_MSG( _rcd, _msg ) \ _RCD_MAGIC_%RCD%LN_N%RCD%__LINE__%RCD%_msg%RCD% #else #define RCD_RETURN_FALSE_MSG( _rcd, _msg ) \ RCD_RETURN_FALSE( _rcd ) #endif #ifdef _RCD_AUTOGEN #define RCD_RETURN_TRUE_MSG( _rcd, _msg ) \ _RCD_MAGIC_%RCD%LN_N%RCD%__LINE__%RCD%_msg%RCD% #else #define RCD_RETURN_TRUE_MSG( _rcd, _msg ) \ RCD_RETURN_TRUE( _rcd ) #endif /* included in files generated by rcd_autogen */ #ifdef _USE_RCD_AUTOGEN /* Dummy type declaration, used only for checking of type-correctness of pointers. Internal representation is not exposed to client app. */ struct rcd_scope; #endif __END_DECLS #endif /* RCODE_H */ wxedid-0.0.32/src/wxEDID.h0000644000175000017500000004723414722720160012040 00000000000000/*************************************************************** * Name: wxEDID.h * Purpose: Defines Application Frame * Author: Tomasz Pawlak (tomasz.pawlak@wp.eu) * Copyright: Tomasz Pawlak (C) 2014-2024 * License: GPLv3+ **************************************************************/ #ifndef wxEDIDMAIN_H #define wxEDIDMAIN_H 1 #ifndef _RCD_AUTOGEN #include "config.h" #else #define VERSION "1" #endif // REMARK: code sections: //(* ... //*) are generated by wxSmith. // Do not change the code. //(*Headers(wxEDID_Frame) #include #include #include #include #include #include #include #include #include #include #include //*) #include "rcode/rcode.h" #include "EDID_class.h" #include "CEA_ET_class.h" #include "guilog.h" #include #include #include #include #include //config typedef struct { bool b_dtd_keep_aspect; bool b_blk_name_dynamic; bool b_dta_grid_details; bool b_have_last_fpath; bool b_cmd_bin_file; bool b_cmd_txt_file; bool b_cmd_ignore_err; bool b_cmd_ignore_rd; bool b_have_layout; wxString cmd_open_file_path; wxString last_used_fpath; wxString last_used_fname; wxString aui_layout; wxPoint win_pos; wxSize win_size; } config_t; class blktree_cl; class fgrid_cl; class dtd_sct_cl; class dtd_screen_cl; enum { //cell column idx'es for BlkDataGrid DATGR_COL_NAME = 0, DATGR_COL_TYPE = 1, DATGR_COL_VAL = 2, DATGR_COL_UNIT = 3, DATGR_COL_FLG = 4, DATGR_COL_OFFS = 5, DATGR_COL_SHIFT = 6, DATGR_COL_FSZ = 7, DATGR_NCOL_1 = 5, DATGR_NCOL_2 = 8, DATGR_NCOL_DIFF = 3 }; enum { //status bar field idx SBAR_LOG = 0, SBAR_GRPOFFS = 1 }; enum { //evt client data for blktree_cl::evt_Lmouse_down() BLKTR_RESEL_EVT = 0xF0 }; typedef union main_flags_u { u32_t u32; struct { uint ctrl_enabled : 1; uint data_loaded : 1; uint grid_blk_ok : 1; uint grp_refresh : 1; uint res :28; } bits; } mflags_t; typedef union op_flags_u { u32_t u32; struct { uint CanCopy : 1; uint CanPaste : 1; uint CanCut : 1; uint CanDelete : 1; uint CanInsertUp : 1; uint CanInsInto : 1; uint CanInsertDn : 1; uint CanMoveUp : 1; uint CanMoveDn : 1; uint CanReparse : 1; uint res :22; } bits; } op_flags_t; class wxEDID_Frame: public wxFrame { friend class dtd_screen_cl; public: rcode OpenEDID(); rcode SaveEDID(); rcode SaveRep_SubGrps(edi_grp_cl *pgrp, wxString& reps); rcode SaveReport(); rcode ExportEDID_hex(); rcode ImportEDID_hex(); rcode AssembleEDID_main(); rcode CreateBlockTree(); rcode UpdateDataGrid(edi_grp_cl* edigrp); void DataGrid_ChangeView(); rcode UpdateDataGridRow(int nrow, edi_dynfld_t *field); void DTD_Ctor_Layout(); rcode DTD_Ctor_Recalc(); rcode DTD_Ctor_read_field(dtd_sct_cl* sct, const edi_grp_cl* group, u32_t idx_field); rcode DTD_Ctor_set_DTD(); rcode DTD_Ctor_ModeLine(); rcode DTD_Ctor_WriteInt(dtd_sct_cl& sct); rcode SetFieldDesc(int row); rcode WriteField(); rcode VerifyChksum(uint block); rcode CalcVerifyChksum(uint block); rcode Reparse(); void AppLayout(); void ClearAll(bool b_clrBlocks = true); void EnableControl(bool enb); void SetOpFlags(); void AutoSelectBED(); void DataGridSetColors(); void GetFullGroupName(edi_grp_cl* pgrp, wxString& grp_name); void LogGroupOP(edi_grp_cl* pgrp, const wxString& opName); void InitBlkTreeMenu(); wxTreeItemId BlkTreeInsGrp(wxTreeItemId trItemID, edi_grp_cl* pgrp, u32_t idx); void BlkTreeDelGrp(edi_grp_cl* pgrp, bool del_subg); void BlkTreeUpdateGrp(); void BlkTreeUpdateGrpName(); void BlkTreeSwitchDynamicNames(); rcode BlkTreeChangeGrpType(bool dbc_type); wxEDID_Frame(wxWindow* parent, wxWindowID id = -1); ~wxEDID_Frame(); guilog_cl GLog; bool b_cmdln_have_file; private: //grid colors for marking data types: wxColour grid_color_bit; wxColour grid_color_float; wxColour grid_color_hex; wxColour grid_bg_color; wxColour grid_fg_color; wxBitmap bmpUp; wxBitmap bmpIn; wxBitmap bmpDn; wxBitmap bmpNOK; wxMenu *mnu_BlkTree; wxMenu *mnu_SubInfo; wxMenuItem *miInfoOK; wxMenuItem *miInfoNOK; wxMenuItem *miRemoved; wxMenuItem *miSubInfo; wxAcceleratorEntry *accDelete; wxAcceleratorEntry *accMoveUp; wxAcceleratorEntry *accMoveDn; mflags_t flags; EDID_cl EDID; wxString tmps; wxString sval; wxString edid_file_name; wxTreeItemId BT_Root; wxTreeItemId BT_Item_sel; wxTreeItemId BT_Iparent; edi_grp_cl* CopyGroup(edi_grp_cl* pgrp); edi_grp_cl *edigrp_sel; edi_grp_cl *edigrp_src; //EDID group to be cloned on paste/insert int subg_idx; //index of selected subgroup: restore selection after reparse/re-init op_flags_t opFlags; int row_sel; int row_op; bool b_dta_grid_details; bool b_dtd_keep_aspect; int dtd_Htotal; //for DTD aspect ratio calculations, updated by evt_dtdctor_sct() int dtd_Vtotal; int dtd_pclk_factor; //DTD: 10K or T7VTDB: 1KHz /* empty wxSmith section: no handlers defined in wxSmith project */ //(*Handlers(wxEDID_Frame) //*) void evt_sys_color_chg (wxSysColourChangedEvent &evt); void evt_ntbook_page (wxAuiNotebookEvent &evt); void evt_open_edid_bin (wxCommandEvent &evt); void evt_save_edid_bin (wxCommandEvent &evt); void evt_save_report (wxCommandEvent &evt); void evt_export_hex (wxCommandEvent &evt); void evt_import_hex (wxCommandEvent &evt); void evt_Deferred (wxCommandEvent &evt); void evt_Quit (wxCommandEvent &evt); void evt_About (wxCommandEvent &evt); void evt_Flags (wxCommandEvent &evt); void evt_frame_size (wxSizeEvent &evt); void evt_ignore_rd (wxCommandEvent &evt); void evt_ignore_err (wxCommandEvent &evt); void evt_reparse (wxCommandEvent &evt); void evt_assemble_edid (wxCommandEvent &evt); void evt_log_win (wxCommandEvent &evt); void evt_dtd_asp (wxCommandEvent &evt); void evt_blk_fdetails (wxCommandEvent &evt); void evt_dyn_blk_names (wxCommandEvent &evt); void evt_dgrid_select (wxGridEvent &evt); void evt_dgrid_vsel (wxGridEvent &evt); //show value selector menu void evt_dgrid_edit_hide(wxGridEvent &evt); void evt_dgrid_write (wxGridEvent &evt); void evt_dtdctor_sct (wxSpinEvent &evt); void evt_blktr_sel (wxTreeEvent &evt); void evt_blktr_rmb (wxTreeEvent &evt); void evt_blktr_key (wxTreeEvent &evt); void evt_blktr_focus (wxFocusEvent &evt) {evt.Skip(false);}; void evt_blktr_reparse (wxCommandEvent &evt); void evt_blktr_copy (wxCommandEvent &evt); void evt_blktr_paste (wxCommandEvent &evt); void evt_blktr_cut (wxCommandEvent &evt); void evt_blktr_delete (wxCommandEvent &evt); void evt_blktr_insert (wxCommandEvent &evt); void evt_blktr_move (wxCommandEvent &evt); /* code generated by wxSmith */ //(*Identifiers(wxEDID_Frame) static const wxWindowID id_block_tree; static const wxWindowID id_grid_blkdat; static const wxWindowID id_txc_edid_info; static const wxWindowID id_panel_edid; static const wxWindowID ID_STATICTEXT5; static const wxWindowID ID_STATICTEXT6; static const wxWindowID id_sct_pixclk; static const wxWindowID id_sct_pclk_factor; static const wxWindowID id_txc_vrefresh; static const wxWindowID ID_STATICTEXT2; static const wxWindowID id_sct_desc_type; static const wxWindowID id_dtd_screen; static const wxWindowID ID_STATICTEXT12; static const wxWindowID id_sct_xres; static const wxWindowID ID_STATICTEXT11; static const wxWindowID id_txres; static const wxWindowID ID_STATICTEXT33; static const wxWindowID id_txt_hborder; static const wxWindowID id_sct_hborder; static const wxWindowID id_txt_hbpix; static const wxWindowID ID_STATICTEXT7; static const wxWindowID id_sct_hblank; static const wxWindowID ID_STATICTEXT3; static const wxWindowID id_txc_thblank; static const wxWindowID ID_STATICTEXT29; static const wxWindowID ID_STATICTEXT8; static const wxWindowID id_sct_hsoffs; static const wxWindowID ID_STATICTEXT4; static const wxWindowID id_txc_thsoffs; static const wxWindowID ID_STATICTEXT30; static const wxWindowID ID_STATICTEXT9; static const wxWindowID id_sct_hswidth; static const wxWindowID ID_STATICTEXT10; static const wxWindowID id_thswidth; static const wxWindowID ID_STATICTEXT31; static const wxWindowID ID_STATICTEXT27; static const wxWindowID id_txc_htotal; static const wxWindowID ID_STATICTEXT32; static const wxWindowID id_txc_thtotal; static const wxWindowID ID_STATICTEXT28; static const wxWindowID ID_STATICTEXT25; static const wxWindowID id_txc_hfreq; static const wxWindowID ID_STATICTEXT26; static const wxWindowID ID_STATICTEXT15; static const wxWindowID id_sct_vres; static const wxWindowID ID_STATICTEXT16; static const wxWindowID id_txc_tvres; static const wxWindowID ID_STATICTEXT34; static const wxWindowID id_txt_vborder; static const wxWindowID id_sct_vborder; static const wxWindowID id_txt_vb_lines; static const wxWindowID ID_STATICTEXT19; static const wxWindowID id_sct_vblank; static const wxWindowID ID_STATICTEXT20; static const wxWindowID id_txc_tvblank; static const wxWindowID ID_STATICTEXT35; static const wxWindowID ID_STATICTEXT21; static const wxWindowID id_sct_vsoffs; static const wxWindowID ID_STATICTEXT22; static const wxWindowID id_txc_tvsoffs; static const wxWindowID ID_STATICTEXT36; static const wxWindowID ID_STATICTEXT23; static const wxWindowID id_sct_vswidth; static const wxWindowID ID_STATICTEXT24; static const wxWindowID id_txc_vswidth; static const wxWindowID ID_STATICTEXT37; static const wxWindowID ID_STATICTEXT38; static const wxWindowID id_txc_vtotal; static const wxWindowID ID_STATICTEXT39; static const wxWindowID id_txc_tvtotal; static const wxWindowID ID_STATICTEXT40; static const wxWindowID ID_STATICTEXT41; static const wxWindowID id_txc_modeline; static const wxWindowID id_panel_dtd; static const wxWindowID id_ntbook; static const wxWindowID id_mnu_imphex; static const wxWindowID id_mnu_exphex; static const wxWindowID id_mnu_parse; static const wxWindowID id_mnu_asmchg; static const wxWindowID id_mnu_ignerr; static const wxWindowID id_mnu_allwr; static const wxWindowID id_mnu_dtd_asp; static const wxWindowID id_mnu_fdetails; static const wxWindowID id_mnu_dbn; static const wxWindowID id_mnu_logw; static const wxWindowID id_mnu_flags; static const wxWindowID id_win_stat_bar; //*) static const long id_app_layout; static const long id_mnu_info; static const long id_mnu_ins_up; static const long id_mnu_ins_dn; static const long id_mnu_ins_in; /* code generated by wxSmith */ //(*Declarations(wxEDID_Frame) blktree_cl* BlockTree; dtd_screen_cl* dtd_screen; dtd_sct_cl* sct_hblank; dtd_sct_cl* sct_hborder; dtd_sct_cl* sct_hsoffs; dtd_sct_cl* sct_hswidth; dtd_sct_cl* sct_pixclk; dtd_sct_cl* sct_vblank; dtd_sct_cl* sct_vborder; dtd_sct_cl* sct_vres; dtd_sct_cl* sct_vsoffs; dtd_sct_cl* sct_vswidth; dtd_sct_cl* sct_xres; fgrid_cl* BlkDataGrid; wxAuiManager* AuiMgrEDID; wxAuiManager* AuiMgrMain; wxAuiNotebook* ntbook; wxBoxSizer* bs_dtd_main; wxFlexGridSizer* fgs_dtd; wxFlexGridSizer* fgs_dtd_bottom; wxFlexGridSizer* fgs_dtd_right; wxFlexGridSizer* fgs_dtd_top; wxMenu* Menu3; wxMenuItem* MenuItem1; wxMenuItem* mnu_allwritable; wxMenuItem* mnu_assemble; wxMenuItem* mnu_dbn; wxMenuItem* mnu_dtd_aspect; wxMenuItem* mnu_exphex; wxMenuItem* mnu_fdetails; wxMenuItem* mnu_ignore_err; wxMenuItem* mnu_imphex; wxMenuItem* mnu_logw; wxMenuItem* mnu_open_edi; wxMenuItem* mnu_reparse; wxMenuItem* mnu_save_edi; wxMenuItem* mnu_save_text; wxPanel* dtd_panel; wxPanel* edid_panel; wxStaticText* StaticText10; wxStaticText* StaticText11; wxStaticText* StaticText12; wxStaticText* StaticText15; wxStaticText* StaticText16; wxStaticText* StaticText19; wxStaticText* StaticText20; wxStaticText* StaticText21; wxStaticText* StaticText22; wxStaticText* StaticText23; wxStaticText* StaticText24; wxStaticText* StaticText25; wxStaticText* StaticText26; wxStaticText* StaticText27; wxStaticText* StaticText28; wxStaticText* StaticText29; wxStaticText* StaticText2; wxStaticText* StaticText30; wxStaticText* StaticText31; wxStaticText* StaticText32; wxStaticText* StaticText33; wxStaticText* StaticText34; wxStaticText* StaticText35; wxStaticText* StaticText36; wxStaticText* StaticText37; wxStaticText* StaticText38; wxStaticText* StaticText39; wxStaticText* StaticText3; wxStaticText* StaticText40; wxStaticText* StaticText41; wxStaticText* StaticText4; wxStaticText* StaticText5; wxStaticText* StaticText6; wxStaticText* StaticText7; wxStaticText* StaticText8; wxStaticText* StaticText9; wxStaticText* sct_desc_type; wxStaticText* sct_pclk_factor; wxStaticText* txt_hborder; wxStaticText* txt_hbpix; wxStaticText* txt_vb_lines; wxStaticText* txt_vborder; wxStatusBar* win_stat_bar; wxTextCtrl* txc_edid_info; wxTextCtrl* txc_hfreq; wxTextCtrl* txc_htotal; wxTextCtrl* txc_modeline; wxTextCtrl* txc_thblank; wxTextCtrl* txc_thsoffs; wxTextCtrl* txc_thswidth; wxTextCtrl* txc_thtotal; wxTextCtrl* txc_tvblank; wxTextCtrl* txc_tvres; wxTextCtrl* txc_tvsoffs; wxTextCtrl* txc_tvswidth; wxTextCtrl* txc_tvtotal; wxTextCtrl* txc_txres; wxTextCtrl* txc_vrefresh; wxTextCtrl* txc_vtotal; //*) wxDECLARE_EVENT_TABLE(); }; class blktree_cl : public wxTreeCtrl { private: wxDECLARE_EVENT_TABLE(); int keycode; void evt_key (wxKeyEvent &evt); void evt_Lmouse_down(wxMouseEvent &evt); void evt_Lmouse_dclick(wxMouseEvent &evt); public: bool b_key_block; blktree_cl(wxWindow *parent, wxWindowID id=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxTR_DEFAULT_STYLE, const wxValidator &validator=wxDefaultValidator, const wxString &name=wxTreeCtrlNameStr) : wxTreeCtrl(parent, id, pos, size, style, validator, name), keycode(0), b_key_block(false) {}; }; class fgrid_cl : public wxGrid { private: wxDECLARE_EVENT_TABLE(); const edi_field_t* evt_field; wxString tmps; wxEDID_Frame *pwin; public: inline void SetParentFrame (wxEDID_Frame *pW) {pwin = pW;}; inline void SetMenuEvtField(edi_field_t* p_field) {evt_field = p_field;}; void evt_dgrid_vmnu(wxCommandEvent& event); fgrid_cl(wxWindow* parentW, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxWANTS_CHARS, const wxString& name = wxPanelNameStr) : wxGrid(parentW, id, pos, size, style, name) {evt_field = NULL;}; }; class dtd_screen_cl : public wxPanel { private: wxDECLARE_EVENT_TABLE(); wxColour cScrArea, cHsync, cVsync, cSandC, cResStr; wxRect rcHsync, rcVsync, rcScreen; wxSize szHborder, szVborder; wxString tmps; wxEDID_Frame *pwin; void scr_aspect_ratio(wxSize& dcsize, wxPaintDC& dc); rcode calc_coords (wxSize& dcsize); void scr_area_str (wxPaintDC& dc); void evt_paint (wxPaintEvent& event); public: inline void SetParentFrame (wxEDID_Frame *pW) {pwin = pW;}; dtd_screen_cl(wxWindow* parentW, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxTAB_TRAVERSAL, const wxString& name = "dtd") : wxPanel(parentW, id, pos, size, style, name) { pwin = dynamic_cast (parentW); cScrArea = wxColour(0x88, 0x88, 0xFF); cHsync = wxColour(0x77, 0x77, 0x99); cVsync = wxColour(0xCC, 0xDD, 0x20); cSandC = wxColour(0xFF, 0xFF, 0xFF); cResStr = wxColour(0xFF, 0xFF, 0xFF); rcHsync = wxRect(0,0,0,0); rcVsync = rcHsync; rcScreen = rcHsync; }; }; class dtd_sct_cl : public wxSpinCtrl { public: edi_dynfld_t *field; int data; dtd_sct_cl(wxWindow* parent, wxWindowID id = -1, const wxString& value = wxEmptyString, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxSP_ARROW_KEYS, int min = 0, int max = 1000, int initial = 0, const wxString& name = "wxSpinCtrl") : wxSpinCtrl(parent, id, value, pos, size, style, min, max, initial, name), field(NULL), data(0) {}; }; class dlg : public wxDialog { private: //the events are currently useless //wxDECLARE_EVENT_TABLE(); //void evt_close(wxCloseEvent &evt); //void evt_ok (wxCommandEvent &evt); dlg (wxWindow* parent, const wxArtID& id_icon, const wxString& caption, const wxString& msg); public: static int MessageBox(wxWindow* parent, const wxString& msg, const wxString& caption, const wxArtID& id_icon); }; #endif // wxEDIDMAIN_H wxedid-0.0.32/src/wxEDID.cpp0000644000175000017500000040333514722720160012371 00000000000000/*************************************************************** * Name: wxEDID.cpp * Purpose: Code for Application Frame * Author: Tomasz Pawlak (tomasz.pawlak@wp.eu) * Copyright: Tomasz Pawlak (C) 2014-2024 * License: GPLv3+ **************************************************************/ #include "debug.h" #include "rcdunits.h" #ifndef idMAIN #error "wxEDID.cpp: missing unit ID" #endif #define RCD_UNIT idMAIN #include "rcode/rcode.h" #include "wxedid_rcd_scope.h" RCD_AUTOGEN_DEFINE_UNIT #include #include "wxEDID.h" #include "vmap.h" #include #include #include #include #include #include #include #include #include //(*InternalHeaders(wxEDID_Frame) #include #include //*) //helper functions enum wxbuildinfoformat { short_f, long_f }; wxString wxbuildinfo(wxbuildinfoformat format) { wxString wxbuild(wxVERSION_STRING); if (format == long_f ) { #if defined(__WXMSW__) wxbuild << _T("-Windows"); #elif defined(__UNIX__) wxbuild << _T("-Linux"); #endif #if wxUSE_UNICODE wxbuild << _T("-Unicode build"); #else wxbuild << _T("-ANSI build"); #endif // wxUSE_UNICODE } return wxbuild; } //config vars config_t config; //common messages / strings static const wxString ver = VERSION; static const char wxEDID_About[] = "wxEDID v" VERSION "\n\n" "Extended Display Identification Data (EDID)\n" "structure editor and parser.\n\n" "Supported structures:\n" "EDID v1.3+\n" "CEA/CTA-861-H\n\n" "Author: Tomasz Pawlak\n" "e-mail: tomasz.pawlak@wp.eu\n" "License: GPLv3+\n\n"; static const char Hlp_Flg_Type[] = "Types:\n" "Bit: single bit value\n" "BitF: bit field\n" "Byte: byte\n" "Int: integer\n" "Float: real/floating point value\n" "Hex: value expressed in hexadecimal format\n" "String: string of bytes\n" "LE: little endian\n\n" "Flags:\n" "RD: read-only\n" "NU: field not used\n" "FR: forced refresh of block data\n" "VS: value selector menu available\n" "GD: group descriptor: no dedicated description\n" "BN: value used in block name\n"; #define wxLF '\n' #define wxTAB '\t' #define wxIDNT " " #define wxSP ' ' static const wxString txt_WARNING = "WARNING"; static const wxString txt_REMARK = "Remark"; static const wxString msgF_LOAD = "Failed to load EDID: incorrect/damaged data structure.\n\n" "You may use Options->\"Ignore EDID Errors\" and then \"Reparse EDID buffer\" to view the data anyway."; static const char AUI_DefLayout[] = "layout2|" "name=TreeDataCtl;caption=Block Tree;state=5892;dir=4;layer=0;row=0;pos=0;" "prop=100000;bestw=150;besth=80;minw=150;minh=-1;maxw=-1;maxh=-1;" "floatx=-1;floaty=-1;floatw=-1;floath=-1|" "name=GridDataCtl;caption=Block Data;state=5896;dir=5;layer=0;row=0;pos=0;" "prop=137878;bestw=82;besth=16;minw=-1;minh=-1;maxw=-1;maxh=-1;" "floatx=-1;floaty=-1;floatw=-1;floath=-1|" "name=InfoCtl;caption=Info;state=5892;dir=5;layer=0;row=0;pos=1;" "prop=62122;bestw=80;besth=100;minw=-1;minh=100;maxw=-1;maxh=-1;" "floatx=-1;floaty=-1;floatw=-1;floath=-1|" "dock_size(4,0,0)=215|dock_size(5,0,0)=10|"; // REMARK: code sections: //(* ... //*) are generated by wxSmith. // Do not change the code. //(*IdInit(wxEDID_Frame) const wxWindowID wxEDID_Frame::id_block_tree = wxNewId(); const wxWindowID wxEDID_Frame::id_grid_blkdat = wxNewId(); const wxWindowID wxEDID_Frame::id_txc_edid_info = wxNewId(); const wxWindowID wxEDID_Frame::id_panel_edid = wxNewId(); const wxWindowID wxEDID_Frame::ID_STATICTEXT5 = wxNewId(); const wxWindowID wxEDID_Frame::ID_STATICTEXT6 = wxNewId(); const wxWindowID wxEDID_Frame::id_sct_pixclk = wxNewId(); const wxWindowID wxEDID_Frame::id_sct_pclk_factor = wxNewId(); const wxWindowID wxEDID_Frame::id_txc_vrefresh = wxNewId(); const wxWindowID wxEDID_Frame::ID_STATICTEXT2 = wxNewId(); const wxWindowID wxEDID_Frame::id_sct_desc_type = wxNewId(); const wxWindowID wxEDID_Frame::id_dtd_screen = wxNewId(); const wxWindowID wxEDID_Frame::ID_STATICTEXT12 = wxNewId(); const wxWindowID wxEDID_Frame::id_sct_xres = wxNewId(); const wxWindowID wxEDID_Frame::ID_STATICTEXT11 = wxNewId(); const wxWindowID wxEDID_Frame::id_txres = wxNewId(); const wxWindowID wxEDID_Frame::ID_STATICTEXT33 = wxNewId(); const wxWindowID wxEDID_Frame::id_txt_hborder = wxNewId(); const wxWindowID wxEDID_Frame::id_sct_hborder = wxNewId(); const wxWindowID wxEDID_Frame::id_txt_hbpix = wxNewId(); const wxWindowID wxEDID_Frame::ID_STATICTEXT7 = wxNewId(); const wxWindowID wxEDID_Frame::id_sct_hblank = wxNewId(); const wxWindowID wxEDID_Frame::ID_STATICTEXT3 = wxNewId(); const wxWindowID wxEDID_Frame::id_txc_thblank = wxNewId(); const wxWindowID wxEDID_Frame::ID_STATICTEXT29 = wxNewId(); const wxWindowID wxEDID_Frame::ID_STATICTEXT8 = wxNewId(); const wxWindowID wxEDID_Frame::id_sct_hsoffs = wxNewId(); const wxWindowID wxEDID_Frame::ID_STATICTEXT4 = wxNewId(); const wxWindowID wxEDID_Frame::id_txc_thsoffs = wxNewId(); const wxWindowID wxEDID_Frame::ID_STATICTEXT30 = wxNewId(); const wxWindowID wxEDID_Frame::ID_STATICTEXT9 = wxNewId(); const wxWindowID wxEDID_Frame::id_sct_hswidth = wxNewId(); const wxWindowID wxEDID_Frame::ID_STATICTEXT10 = wxNewId(); const wxWindowID wxEDID_Frame::id_thswidth = wxNewId(); const wxWindowID wxEDID_Frame::ID_STATICTEXT31 = wxNewId(); const wxWindowID wxEDID_Frame::ID_STATICTEXT27 = wxNewId(); const wxWindowID wxEDID_Frame::id_txc_htotal = wxNewId(); const wxWindowID wxEDID_Frame::ID_STATICTEXT32 = wxNewId(); const wxWindowID wxEDID_Frame::id_txc_thtotal = wxNewId(); const wxWindowID wxEDID_Frame::ID_STATICTEXT28 = wxNewId(); const wxWindowID wxEDID_Frame::ID_STATICTEXT25 = wxNewId(); const wxWindowID wxEDID_Frame::id_txc_hfreq = wxNewId(); const wxWindowID wxEDID_Frame::ID_STATICTEXT26 = wxNewId(); const wxWindowID wxEDID_Frame::ID_STATICTEXT15 = wxNewId(); const wxWindowID wxEDID_Frame::id_sct_vres = wxNewId(); const wxWindowID wxEDID_Frame::ID_STATICTEXT16 = wxNewId(); const wxWindowID wxEDID_Frame::id_txc_tvres = wxNewId(); const wxWindowID wxEDID_Frame::ID_STATICTEXT34 = wxNewId(); const wxWindowID wxEDID_Frame::id_txt_vborder = wxNewId(); const wxWindowID wxEDID_Frame::id_sct_vborder = wxNewId(); const wxWindowID wxEDID_Frame::id_txt_vb_lines = wxNewId(); const wxWindowID wxEDID_Frame::ID_STATICTEXT19 = wxNewId(); const wxWindowID wxEDID_Frame::id_sct_vblank = wxNewId(); const wxWindowID wxEDID_Frame::ID_STATICTEXT20 = wxNewId(); const wxWindowID wxEDID_Frame::id_txc_tvblank = wxNewId(); const wxWindowID wxEDID_Frame::ID_STATICTEXT35 = wxNewId(); const wxWindowID wxEDID_Frame::ID_STATICTEXT21 = wxNewId(); const wxWindowID wxEDID_Frame::id_sct_vsoffs = wxNewId(); const wxWindowID wxEDID_Frame::ID_STATICTEXT22 = wxNewId(); const wxWindowID wxEDID_Frame::id_txc_tvsoffs = wxNewId(); const wxWindowID wxEDID_Frame::ID_STATICTEXT36 = wxNewId(); const wxWindowID wxEDID_Frame::ID_STATICTEXT23 = wxNewId(); const wxWindowID wxEDID_Frame::id_sct_vswidth = wxNewId(); const wxWindowID wxEDID_Frame::ID_STATICTEXT24 = wxNewId(); const wxWindowID wxEDID_Frame::id_txc_vswidth = wxNewId(); const wxWindowID wxEDID_Frame::ID_STATICTEXT37 = wxNewId(); const wxWindowID wxEDID_Frame::ID_STATICTEXT38 = wxNewId(); const wxWindowID wxEDID_Frame::id_txc_vtotal = wxNewId(); const wxWindowID wxEDID_Frame::ID_STATICTEXT39 = wxNewId(); const wxWindowID wxEDID_Frame::id_txc_tvtotal = wxNewId(); const wxWindowID wxEDID_Frame::ID_STATICTEXT40 = wxNewId(); const wxWindowID wxEDID_Frame::ID_STATICTEXT41 = wxNewId(); const wxWindowID wxEDID_Frame::id_txc_modeline = wxNewId(); const wxWindowID wxEDID_Frame::id_panel_dtd = wxNewId(); const wxWindowID wxEDID_Frame::id_ntbook = wxNewId(); const wxWindowID wxEDID_Frame::id_mnu_imphex = wxNewId(); const wxWindowID wxEDID_Frame::id_mnu_exphex = wxNewId(); const wxWindowID wxEDID_Frame::id_mnu_parse = wxNewId(); const wxWindowID wxEDID_Frame::id_mnu_asmchg = wxNewId(); const wxWindowID wxEDID_Frame::id_mnu_ignerr = wxNewId(); const wxWindowID wxEDID_Frame::id_mnu_allwr = wxNewId(); const wxWindowID wxEDID_Frame::id_mnu_dtd_asp = wxNewId(); const wxWindowID wxEDID_Frame::id_mnu_fdetails = wxNewId(); const wxWindowID wxEDID_Frame::id_mnu_dbn = wxNewId(); const wxWindowID wxEDID_Frame::id_mnu_logw = wxNewId(); const wxWindowID wxEDID_Frame::id_mnu_flags = wxNewId(); const wxWindowID wxEDID_Frame::id_win_stat_bar = wxNewId(); //*) const long wxEDID_Frame::id_app_layout = wxNewId(); const long wxEDID_Frame::id_mnu_info = wxNewId(); const long wxEDID_Frame::id_mnu_ins_up = wxNewId(); const long wxEDID_Frame::id_mnu_ins_dn = wxNewId(); const long wxEDID_Frame::id_mnu_ins_in = wxNewId(); wxDECLARE_EVENT(wxEVT_DEFERRED, wxCommandEvent); wxDEFINE_EVENT (wxEVT_DEFERRED, wxCommandEvent); wxBEGIN_EVENT_TABLE(wxEDID_Frame, wxFrame) //(*EventTable(wxEDID_Frame) //*) EVT_SIZE ( wxEDID_Frame::evt_frame_size ) EVT_SYS_COLOUR_CHANGED ( wxEDID_Frame::evt_sys_color_chg ) EVT_GRID_SELECT_CELL ( wxEDID_Frame::evt_dgrid_select ) EVT_GRID_CELL_CHANGED ( wxEDID_Frame::evt_dgrid_write ) EVT_GRID_CMD_EDITOR_SHOWN (id_grid_blkdat , wxEDID_Frame::evt_dgrid_vsel ) EVT_GRID_CMD_EDITOR_HIDDEN (id_grid_blkdat , wxEDID_Frame::evt_dgrid_edit_hide) EVT_TREE_SEL_CHANGED (id_block_tree , wxEDID_Frame::evt_blktr_sel ) EVT_TREE_ITEM_RIGHT_CLICK (id_block_tree , wxEDID_Frame::evt_blktr_rmb ) EVT_TREE_KEY_DOWN (id_block_tree , wxEDID_Frame::evt_blktr_key ) EVT_COMMAND (wxID_ANY , wxEVT_DEFERRED, wxEDID_Frame::evt_Deferred) EVT_AUINOTEBOOK_PAGE_CHANGING(id_ntbook , wxEDID_Frame::evt_ntbook_page ) EVT_MENU (wxID_OPEN , wxEDID_Frame::evt_open_edid_bin) EVT_MENU (id_mnu_imphex , wxEDID_Frame::evt_import_hex ) EVT_MENU (wxID_SAVE , wxEDID_Frame::evt_save_edid_bin) EVT_MENU (wxID_SAVEAS , wxEDID_Frame::evt_save_report ) EVT_MENU (id_mnu_exphex , wxEDID_Frame::evt_export_hex ) EVT_MENU (wxID_EXIT , wxEDID_Frame::evt_Quit ) EVT_MENU (wxID_ABOUT , wxEDID_Frame::evt_About ) EVT_MENU (id_mnu_flags , wxEDID_Frame::evt_Flags ) EVT_MENU (id_mnu_logw , wxEDID_Frame::evt_log_win ) EVT_MENU (id_mnu_allwr , wxEDID_Frame::evt_ignore_rd ) EVT_MENU (id_mnu_ignerr , wxEDID_Frame::evt_ignore_err ) EVT_MENU (id_mnu_parse , wxEDID_Frame::evt_reparse ) EVT_MENU (id_mnu_asmchg , wxEDID_Frame::evt_assemble_edid) EVT_MENU (id_mnu_dtd_asp , wxEDID_Frame::evt_dtd_asp ) EVT_MENU (id_mnu_fdetails, wxEDID_Frame::evt_blk_fdetails ) EVT_MENU (id_mnu_dbn , wxEDID_Frame::evt_dyn_blk_names) //RMB menu actions for BlockTree EVT_MENU (wxID_EXECUTE , wxEDID_Frame::evt_blktr_reparse) EVT_MENU (wxID_COPY , wxEDID_Frame::evt_blktr_copy ) EVT_MENU (wxID_PASTE , wxEDID_Frame::evt_blktr_paste ) EVT_MENU (wxID_DELETE , wxEDID_Frame::evt_blktr_delete ) EVT_MENU (wxID_CUT , wxEDID_Frame::evt_blktr_cut ) EVT_MENU (id_mnu_ins_up , wxEDID_Frame::evt_blktr_insert ) EVT_MENU (id_mnu_ins_in , wxEDID_Frame::evt_blktr_insert ) EVT_MENU (id_mnu_ins_dn , wxEDID_Frame::evt_blktr_insert ) EVT_MENU (wxID_UP , wxEDID_Frame::evt_blktr_move ) EVT_MENU (wxID_DOWN , wxEDID_Frame::evt_blktr_move ) wxEND_EVENT_TABLE() wxEDID_Frame::wxEDID_Frame(wxWindow* parent,wxWindowID id) : flags ( {0} ), edigrp_sel ( NULL ), edigrp_src ( NULL ), subg_idx ( -1 ), row_sel ( -1 ), b_dta_grid_details(config.b_dta_grid_details), b_dtd_keep_aspect (config.b_dtd_keep_aspect ) { /* code generated by wxSmith */ //(*Initialize(wxEDID_Frame) wxBoxSizer* BoxSizer5; wxMenu* Menu1; wxMenu* Menu2; wxMenuBar* MenuBar1; wxMenuItem* mnu_about; wxMenuItem* mnu_quit; Create(parent, wxID_ANY, _("wxEDID"), wxDefaultPosition, wxDefaultSize, wxDEFAULT_FRAME_STYLE, _T("wxID_ANY")); SetMinSize(wxSize(640,440)); AuiMgrMain = new wxAuiManager(this, 0); ntbook = new wxAuiNotebook(this, id_ntbook, wxDefaultPosition, wxDefaultSize, 0); edid_panel = new wxPanel(ntbook, id_panel_edid, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL, _T("id_panel_edid")); AuiMgrEDID = new wxAuiManager(edid_panel, wxAUI_MGR_RECTANGLE_HINT); BlockTree = new blktree_cl(edid_panel, id_block_tree, wxDefaultPosition, wxDefaultSize, wxTR_HAS_BUTTONS|wxTR_SINGLE|wxTAB_TRAVERSAL, wxDefaultValidator, _T("id_block_tree")); BlockTree->SetMinSize(wxSize(150,-1)); AuiMgrEDID->AddPane(BlockTree, wxAuiPaneInfo().Name(_T("TreeDataCtl")).DefaultPane().Caption(_("Block Tree")).CloseButton(false).Left().TopDockable(false).BottomDockable(false).RightDockable(false).Floatable(false).MinSize(wxSize(150,-1)).Movable(false).DestroyOnClose()); BlkDataGrid = new fgrid_cl(edid_panel, id_grid_blkdat, wxDefaultPosition, wxDefaultSize, 0, _T("id_grid_blkdat")); BlkDataGrid->CreateGrid(8,5); BlkDataGrid->Disable(); BlkDataGrid->EnableEditing(true); BlkDataGrid->EnableGridLines(true); BlkDataGrid->SetColLabelValue(0, _("Name")); BlkDataGrid->SetColLabelValue(1, _("Type")); BlkDataGrid->SetColLabelValue(2, _("Value")); BlkDataGrid->SetColLabelValue(3, _("Unit")); BlkDataGrid->SetColLabelValue(4, _("Flags")); BlkDataGrid->SetDefaultCellFont( BlkDataGrid->GetFont() ); BlkDataGrid->SetDefaultCellTextColour( BlkDataGrid->GetForegroundColour() ); AuiMgrEDID->AddPane(BlkDataGrid, wxAuiPaneInfo().Name(_T("GridDataCtl")).DefaultPane().Caption(_("Block Data")).CloseButton(false).Center().TopDockable(false).BottomDockable(false).LeftDockable(false).Floatable(false).Movable(false).DestroyOnClose()); txc_edid_info = new wxTextCtrl(edid_panel, id_txc_edid_info, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE|wxTE_READONLY|wxTE_WORDWRAP|wxVSCROLL, wxDefaultValidator, _T("id_txc_edid_info")); txc_edid_info->SetMinSize(wxSize(-1,100)); AuiMgrEDID->AddPane(txc_edid_info, wxAuiPaneInfo().Name(_T("InfoCtl")).DefaultPane().Caption(_("Info")).CloseButton(false).Position(1).Center().TopDockable(false).BottomDockable(false).RightDockable(false).Floatable(false).MinSize(wxSize(-1,100)).Movable(false).DestroyOnClose()); AuiMgrEDID->Update(); dtd_panel = new wxPanel(ntbook, id_panel_dtd, wxDefaultPosition, wxSize(638,506), wxTAB_TRAVERSAL, _T("id_panel_dtd")); bs_dtd_main = new wxBoxSizer(wxVERTICAL); fgs_dtd = new wxFlexGridSizer(3, 2, 0, 0); fgs_dtd_top = new wxFlexGridSizer(4, 4, 0, 0); StaticText5 = new wxStaticText(dtd_panel, ID_STATICTEXT5, _("Pixel Clock"), wxDefaultPosition, wxDefaultSize, 0, _T("ID_STATICTEXT5")); fgs_dtd_top->Add(StaticText5, 1, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5); fgs_dtd_top->Add(-1,-1,1, wxLEFT|wxRIGHT|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 8); StaticText6 = new wxStaticText(dtd_panel, ID_STATICTEXT6, _("V-Refresh"), wxDefaultPosition, wxDefaultSize, 0, _T("ID_STATICTEXT6")); fgs_dtd_top->Add(StaticText6, 1, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5); fgs_dtd_top->Add(-1,-1,1, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5); sct_pixclk = new dtd_sct_cl(dtd_panel, id_sct_pixclk, _T("0"), wxDefaultPosition, wxDefaultSize, 0, 1, 65535, 0, _T("id_sct_pixclk")); sct_pixclk->SetValue(_T("0")); sct_pixclk->SetMinSize(wxSize(160,-1)); fgs_dtd_top->Add(sct_pixclk, 1, wxRIGHT|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 3); sct_pclk_factor = new wxStaticText(dtd_panel, id_sct_pclk_factor, _("x10kHz"), wxDefaultPosition, wxDefaultSize, 0, _T("id_sct_pclk_factor")); fgs_dtd_top->Add(sct_pclk_factor, 2, wxRIGHT|wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 8); txc_vrefresh = new wxTextCtrl(dtd_panel, id_txc_vrefresh, _T("0"), wxDefaultPosition, wxDefaultSize, wxTE_READONLY, wxDefaultValidator, _T("id_txc_vrefresh")); txc_vrefresh->SetMinSize(wxSize(70,-1)); fgs_dtd_top->Add(txc_vrefresh, 1, wxRIGHT|wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 3); StaticText2 = new wxStaticText(dtd_panel, ID_STATICTEXT2, _("Hz"), wxDefaultPosition, wxDefaultSize, 0, _T("ID_STATICTEXT2")); fgs_dtd_top->Add(StaticText2, 2, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5); fgs_dtd->Add(fgs_dtd_top, 1, wxTOP|wxBOTTOM|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 6); sct_desc_type = new wxStaticText(dtd_panel, id_sct_desc_type, _("DTD"), wxDefaultPosition, wxDefaultSize, 0, _T("id_sct_desc_type")); fgs_dtd->Add(sct_desc_type, 1, wxTOP|wxRIGHT|wxALIGN_RIGHT|wxALIGN_TOP, 6); dtd_screen = new dtd_screen_cl(dtd_panel, id_dtd_screen, wxDefaultPosition, wxDefaultSize, wxFULL_REPAINT_ON_RESIZE, _T("id_dtd_screen")); fgs_dtd->Add(dtd_screen, 1, wxEXPAND, 4); fgs_dtd_right = new wxFlexGridSizer(7, 5, 1, 5); StaticText12 = new wxStaticText(dtd_panel, ID_STATICTEXT12, _("X-res"), wxDefaultPosition, wxDefaultSize, 0, _T("ID_STATICTEXT12")); fgs_dtd_right->Add(StaticText12, 1, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5); sct_xres = new dtd_sct_cl(dtd_panel, id_sct_xres, _T("0"), wxDefaultPosition, wxDefaultSize, 0, 1, 4095, 0, _T("id_sct_xres")); sct_xres->SetValue(_T("0")); fgs_dtd_right->Add(sct_xres, 1, wxEXPAND, 5); StaticText11 = new wxStaticText(dtd_panel, ID_STATICTEXT11, _("pix"), wxDefaultPosition, wxDefaultSize, 0, _T("ID_STATICTEXT11")); fgs_dtd_right->Add(StaticText11, 1, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5); txc_txres = new wxTextCtrl(dtd_panel, id_txres, _T("0"), wxDefaultPosition, wxDefaultSize, wxTE_READONLY, wxDefaultValidator, _T("id_txres")); txc_txres->SetMinSize(wxSize(70,-1)); txc_txres->SetMaxSize(wxSize(-1,-1)); fgs_dtd_right->Add(txc_txres, 1, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5); StaticText33 = new wxStaticText(dtd_panel, ID_STATICTEXT33, _("us"), wxDefaultPosition, wxDefaultSize, 0, _T("ID_STATICTEXT33")); fgs_dtd_right->Add(StaticText33, 1, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5); txt_hborder = new wxStaticText(dtd_panel, id_txt_hborder, _("H-Border"), wxDefaultPosition, wxDefaultSize, 0, _T("id_txt_hborder")); fgs_dtd_right->Add(txt_hborder, 1, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5); sct_hborder = new dtd_sct_cl(dtd_panel, id_sct_hborder, _T("0"), wxDefaultPosition, wxDefaultSize, 0, 0, 255, 0, _T("id_sct_hborder")); sct_hborder->SetValue(_T("0")); fgs_dtd_right->Add(sct_hborder, 1, wxEXPAND, 5); txt_hbpix = new wxStaticText(dtd_panel, id_txt_hbpix, _("pix"), wxDefaultPosition, wxDefaultSize, 0, _T("id_txt_hbpix")); fgs_dtd_right->Add(txt_hbpix, 1, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5); fgs_dtd_right->Add(-1,-1,1, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5); fgs_dtd_right->Add(-1,-1,1, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5); StaticText7 = new wxStaticText(dtd_panel, ID_STATICTEXT7, _("H-Blank"), wxDefaultPosition, wxDefaultSize, 0, _T("ID_STATICTEXT7")); fgs_dtd_right->Add(StaticText7, 1, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5); sct_hblank = new dtd_sct_cl(dtd_panel, id_sct_hblank, _T("0"), wxDefaultPosition, wxDefaultSize, 0, 1, 4095, 0, _T("id_sct_hblank")); sct_hblank->SetValue(_T("0")); fgs_dtd_right->Add(sct_hblank, 1, wxEXPAND, 5); StaticText3 = new wxStaticText(dtd_panel, ID_STATICTEXT3, _("pix"), wxDefaultPosition, wxDefaultSize, 0, _T("ID_STATICTEXT3")); fgs_dtd_right->Add(StaticText3, 1, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5); txc_thblank = new wxTextCtrl(dtd_panel, id_txc_thblank, _T("0"), wxDefaultPosition, wxSize(50,22), wxTE_READONLY, wxDefaultValidator, _T("id_txc_thblank")); txc_thblank->SetMinSize(wxSize(70,-1)); fgs_dtd_right->Add(txc_thblank, 1, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5); StaticText29 = new wxStaticText(dtd_panel, ID_STATICTEXT29, _("us"), wxDefaultPosition, wxDefaultSize, 0, _T("ID_STATICTEXT29")); fgs_dtd_right->Add(StaticText29, 1, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5); StaticText8 = new wxStaticText(dtd_panel, ID_STATICTEXT8, _("H-Sync offs."), wxDefaultPosition, wxDefaultSize, 0, _T("ID_STATICTEXT8")); fgs_dtd_right->Add(StaticText8, 1, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5); sct_hsoffs = new dtd_sct_cl(dtd_panel, id_sct_hsoffs, _T("0"), wxDefaultPosition, wxDefaultSize, 0, 0, 1023, 0, _T("id_sct_hsoffs")); sct_hsoffs->SetValue(_T("0")); fgs_dtd_right->Add(sct_hsoffs, 1, wxEXPAND, 5); StaticText4 = new wxStaticText(dtd_panel, ID_STATICTEXT4, _("pix"), wxDefaultPosition, wxDefaultSize, 0, _T("ID_STATICTEXT4")); fgs_dtd_right->Add(StaticText4, 1, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5); txc_thsoffs = new wxTextCtrl(dtd_panel, id_txc_thsoffs, _T("0"), wxDefaultPosition, wxSize(50,22), wxTE_READONLY, wxDefaultValidator, _T("id_txc_thsoffs")); txc_thsoffs->SetMinSize(wxSize(70,-1)); fgs_dtd_right->Add(txc_thsoffs, 1, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5); StaticText30 = new wxStaticText(dtd_panel, ID_STATICTEXT30, _("us"), wxDefaultPosition, wxDefaultSize, 0, _T("ID_STATICTEXT30")); fgs_dtd_right->Add(StaticText30, 1, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5); StaticText9 = new wxStaticText(dtd_panel, ID_STATICTEXT9, _("H-Sync width"), wxDefaultPosition, wxDefaultSize, 0, _T("ID_STATICTEXT9")); fgs_dtd_right->Add(StaticText9, 1, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5); sct_hswidth = new dtd_sct_cl(dtd_panel, id_sct_hswidth, _T("0"), wxDefaultPosition, wxDefaultSize, 0, 1, 1023, 0, _T("id_sct_hswidth")); sct_hswidth->SetValue(_T("0")); fgs_dtd_right->Add(sct_hswidth, 1, wxEXPAND, 5); StaticText10 = new wxStaticText(dtd_panel, ID_STATICTEXT10, _("pix"), wxDefaultPosition, wxDefaultSize, 0, _T("ID_STATICTEXT10")); fgs_dtd_right->Add(StaticText10, 1, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5); txc_thswidth = new wxTextCtrl(dtd_panel, id_thswidth, _T("0"), wxDefaultPosition, wxDefaultSize, wxTE_READONLY, wxDefaultValidator, _T("id_thswidth")); txc_thswidth->SetMinSize(wxSize(70,-1)); fgs_dtd_right->Add(txc_thswidth, 1, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5); StaticText31 = new wxStaticText(dtd_panel, ID_STATICTEXT31, _("us"), wxDefaultPosition, wxDefaultSize, 0, _T("ID_STATICTEXT31")); fgs_dtd_right->Add(StaticText31, 1, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5); StaticText27 = new wxStaticText(dtd_panel, ID_STATICTEXT27, _("H total"), wxDefaultPosition, wxDefaultSize, 0, _T("ID_STATICTEXT27")); fgs_dtd_right->Add(StaticText27, 1, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5); txc_htotal = new wxTextCtrl(dtd_panel, id_txc_htotal, _T("0"), wxDefaultPosition, wxSize(60,22), wxTE_READONLY, wxDefaultValidator, _T("id_txc_htotal")); txc_htotal->SetMinSize(wxSize(80,-1)); fgs_dtd_right->Add(txc_htotal, 1, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL, 5); StaticText32 = new wxStaticText(dtd_panel, ID_STATICTEXT32, _("pix"), wxDefaultPosition, wxDefaultSize, 0, _T("ID_STATICTEXT32")); fgs_dtd_right->Add(StaticText32, 1, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5); txc_thtotal = new wxTextCtrl(dtd_panel, id_txc_thtotal, _T("0"), wxDefaultPosition, wxDefaultSize, wxTE_READONLY, wxDefaultValidator, _T("id_txc_thtotal")); txc_thtotal->SetMinSize(wxSize(70,-1)); fgs_dtd_right->Add(txc_thtotal, 1, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5); StaticText28 = new wxStaticText(dtd_panel, ID_STATICTEXT28, _("us"), wxDefaultPosition, wxDefaultSize, 0, _T("ID_STATICTEXT28")); fgs_dtd_right->Add(StaticText28, 1, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5); StaticText25 = new wxStaticText(dtd_panel, ID_STATICTEXT25, _("H-Freq"), wxDefaultPosition, wxDefaultSize, 0, _T("ID_STATICTEXT25")); fgs_dtd_right->Add(StaticText25, 1, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5); txc_hfreq = new wxTextCtrl(dtd_panel, id_txc_hfreq, _T("0"), wxDefaultPosition, wxDefaultSize, wxTE_READONLY, wxDefaultValidator, _T("id_txc_hfreq")); txc_hfreq->SetMinSize(wxSize(80,-1)); fgs_dtd_right->Add(txc_hfreq, 1, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL, 5); StaticText26 = new wxStaticText(dtd_panel, ID_STATICTEXT26, _("kHz"), wxDefaultPosition, wxDefaultSize, 0, _T("ID_STATICTEXT26")); fgs_dtd_right->Add(StaticText26, 1, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5); fgs_dtd_right->Add(-1,-1,1, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5); fgs_dtd_right->Add(-1,-1,1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5); fgs_dtd->Add(fgs_dtd_right, 1, wxLEFT|wxRIGHT|wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 4); fgs_dtd_bottom = new wxFlexGridSizer(6, 5, 1, 5); StaticText15 = new wxStaticText(dtd_panel, ID_STATICTEXT15, _("V-res"), wxDefaultPosition, wxDefaultSize, 0, _T("ID_STATICTEXT15")); fgs_dtd_bottom->Add(StaticText15, 1, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5); sct_vres = new dtd_sct_cl(dtd_panel, id_sct_vres, _T("0"), wxDefaultPosition, wxDefaultSize, 0, 1, 4095, 0, _T("id_sct_vres")); sct_vres->SetValue(_T("0")); fgs_dtd_bottom->Add(sct_vres, 1, wxEXPAND, 5); StaticText16 = new wxStaticText(dtd_panel, ID_STATICTEXT16, _("lines"), wxDefaultPosition, wxDefaultSize, 0, _T("ID_STATICTEXT16")); fgs_dtd_bottom->Add(StaticText16, 1, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5); txc_tvres = new wxTextCtrl(dtd_panel, id_txc_tvres, _T("0"), wxDefaultPosition, wxDefaultSize, wxTE_READONLY, wxDefaultValidator, _T("id_txc_tvres")); txc_tvres->SetMinSize(wxSize(70,-1)); fgs_dtd_bottom->Add(txc_tvres, 1, wxLEFT|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5); StaticText34 = new wxStaticText(dtd_panel, ID_STATICTEXT34, _("ms"), wxDefaultPosition, wxDefaultSize, 0, _T("ID_STATICTEXT34")); fgs_dtd_bottom->Add(StaticText34, 1, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5); txt_vborder = new wxStaticText(dtd_panel, id_txt_vborder, _("V-Border"), wxDefaultPosition, wxDefaultSize, 0, _T("id_txt_vborder")); fgs_dtd_bottom->Add(txt_vborder, 1, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5); sct_vborder = new dtd_sct_cl(dtd_panel, id_sct_vborder, _T("0"), wxDefaultPosition, wxDefaultSize, 0, 0, 255, 0, _T("id_sct_vborder")); sct_vborder->SetValue(_T("0")); fgs_dtd_bottom->Add(sct_vborder, 1, wxEXPAND, 5); txt_vb_lines = new wxStaticText(dtd_panel, id_txt_vb_lines, _("lines"), wxDefaultPosition, wxDefaultSize, 0, _T("id_txt_vb_lines")); fgs_dtd_bottom->Add(txt_vb_lines, 1, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5); fgs_dtd_bottom->Add(-1,-1,1, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5); fgs_dtd_bottom->Add(-1,-1,1, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5); StaticText19 = new wxStaticText(dtd_panel, ID_STATICTEXT19, _("V-Blank"), wxDefaultPosition, wxDefaultSize, 0, _T("ID_STATICTEXT19")); fgs_dtd_bottom->Add(StaticText19, 1, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5); sct_vblank = new dtd_sct_cl(dtd_panel, id_sct_vblank, _T("0"), wxDefaultPosition, wxDefaultSize, 0, 1, 4095, 0, _T("id_sct_vblank")); sct_vblank->SetValue(_T("0")); fgs_dtd_bottom->Add(sct_vblank, 1, wxEXPAND, 5); StaticText20 = new wxStaticText(dtd_panel, ID_STATICTEXT20, _("lines"), wxDefaultPosition, wxDefaultSize, 0, _T("ID_STATICTEXT20")); fgs_dtd_bottom->Add(StaticText20, 1, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5); txc_tvblank = new wxTextCtrl(dtd_panel, id_txc_tvblank, _T("0"), wxDefaultPosition, wxDefaultSize, wxTE_READONLY, wxDefaultValidator, _T("id_txc_tvblank")); txc_tvblank->SetMinSize(wxSize(70,-1)); fgs_dtd_bottom->Add(txc_tvblank, 1, wxLEFT|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5); StaticText35 = new wxStaticText(dtd_panel, ID_STATICTEXT35, _("ms"), wxDefaultPosition, wxDefaultSize, 0, _T("ID_STATICTEXT35")); fgs_dtd_bottom->Add(StaticText35, 1, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5); StaticText21 = new wxStaticText(dtd_panel, ID_STATICTEXT21, _("V-Sync offs."), wxDefaultPosition, wxDefaultSize, 0, _T("ID_STATICTEXT21")); fgs_dtd_bottom->Add(StaticText21, 1, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5); sct_vsoffs = new dtd_sct_cl(dtd_panel, id_sct_vsoffs, _T("0"), wxDefaultPosition, wxDefaultSize, 0, 0, 63, 0, _T("id_sct_vsoffs")); sct_vsoffs->SetValue(_T("0")); fgs_dtd_bottom->Add(sct_vsoffs, 1, wxEXPAND, 5); StaticText22 = new wxStaticText(dtd_panel, ID_STATICTEXT22, _("lines"), wxDefaultPosition, wxDefaultSize, 0, _T("ID_STATICTEXT22")); fgs_dtd_bottom->Add(StaticText22, 1, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5); txc_tvsoffs = new wxTextCtrl(dtd_panel, id_txc_tvsoffs, _T("0"), wxDefaultPosition, wxDefaultSize, wxTE_READONLY, wxDefaultValidator, _T("id_txc_tvsoffs")); txc_tvsoffs->SetMinSize(wxSize(70,-1)); fgs_dtd_bottom->Add(txc_tvsoffs, 1, wxLEFT|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5); StaticText36 = new wxStaticText(dtd_panel, ID_STATICTEXT36, _("ms"), wxDefaultPosition, wxDefaultSize, 0, _T("ID_STATICTEXT36")); fgs_dtd_bottom->Add(StaticText36, 1, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5); StaticText23 = new wxStaticText(dtd_panel, ID_STATICTEXT23, _("V-Sync width"), wxDefaultPosition, wxDefaultSize, 0, _T("ID_STATICTEXT23")); fgs_dtd_bottom->Add(StaticText23, 1, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5); sct_vswidth = new dtd_sct_cl(dtd_panel, id_sct_vswidth, _T("0"), wxDefaultPosition, wxDefaultSize, 0, 1, 63, 0, _T("id_sct_vswidth")); sct_vswidth->SetValue(_T("0")); fgs_dtd_bottom->Add(sct_vswidth, 1, wxEXPAND, 5); StaticText24 = new wxStaticText(dtd_panel, ID_STATICTEXT24, _("lines"), wxDefaultPosition, wxDefaultSize, 0, _T("ID_STATICTEXT24")); fgs_dtd_bottom->Add(StaticText24, 1, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5); txc_tvswidth = new wxTextCtrl(dtd_panel, id_txc_vswidth, _T("0"), wxDefaultPosition, wxDefaultSize, wxTE_READONLY, wxDefaultValidator, _T("id_txc_vswidth")); txc_tvswidth->SetMinSize(wxSize(70,-1)); fgs_dtd_bottom->Add(txc_tvswidth, 1, wxLEFT|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5); StaticText37 = new wxStaticText(dtd_panel, ID_STATICTEXT37, _("ms"), wxDefaultPosition, wxDefaultSize, 0, _T("ID_STATICTEXT37")); fgs_dtd_bottom->Add(StaticText37, 1, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5); StaticText38 = new wxStaticText(dtd_panel, ID_STATICTEXT38, _("V total"), wxDefaultPosition, wxDefaultSize, 0, _T("ID_STATICTEXT38")); fgs_dtd_bottom->Add(StaticText38, 1, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5); txc_vtotal = new wxTextCtrl(dtd_panel, id_txc_vtotal, _T("0"), wxDefaultPosition, wxDefaultSize, wxTE_READONLY, wxDefaultValidator, _T("id_txc_vtotal")); txc_vtotal->SetMinSize(wxSize(70,-1)); fgs_dtd_bottom->Add(txc_vtotal, 1, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL, 5); StaticText39 = new wxStaticText(dtd_panel, ID_STATICTEXT39, _("lines"), wxDefaultPosition, wxDefaultSize, 0, _T("ID_STATICTEXT39")); fgs_dtd_bottom->Add(StaticText39, 1, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5); txc_tvtotal = new wxTextCtrl(dtd_panel, id_txc_tvtotal, _T("0"), wxDefaultPosition, wxDefaultSize, wxTE_READONLY, wxDefaultValidator, _T("id_txc_tvtotal")); txc_tvtotal->SetMinSize(wxSize(70,-1)); fgs_dtd_bottom->Add(txc_tvtotal, 1, wxLEFT|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5); StaticText40 = new wxStaticText(dtd_panel, ID_STATICTEXT40, _("ms"), wxDefaultPosition, wxDefaultSize, 0, _T("ID_STATICTEXT40")); fgs_dtd_bottom->Add(StaticText40, 1, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5); fgs_dtd->Add(fgs_dtd_bottom, 1, wxTOP|wxALIGN_TOP|wxALIGN_CENTER_HORIZONTAL, 4); bs_dtd_main->Add(fgs_dtd, 1, wxLEFT|wxEXPAND, 16); bs_dtd_main->Add(-1,-1,0, wxTOP|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 8); BoxSizer5 = new wxBoxSizer(wxHORIZONTAL); StaticText41 = new wxStaticText(dtd_panel, ID_STATICTEXT41, _("X11 ModeLine"), wxDefaultPosition, wxDefaultSize, 0, _T("ID_STATICTEXT41")); BoxSizer5->Add(StaticText41, 0, wxLEFT|wxALIGN_CENTER_VERTICAL, 13); txc_modeline = new wxTextCtrl(dtd_panel, id_txc_modeline, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_READONLY, wxDefaultValidator, _T("id_txc_modeline")); BoxSizer5->Add(txc_modeline, 1, wxLEFT|wxRIGHT|wxEXPAND, 4); bs_dtd_main->Add(BoxSizer5, 0, wxTOP|wxBOTTOM|wxLEFT|wxEXPAND, 3); bs_dtd_main->Add(-1,-1,0, wxTOP|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 4); dtd_panel->SetSizer(bs_dtd_main); ntbook->AddPage(edid_panel, _("EDID")); ntbook->AddPage(dtd_panel, _("DTD Constructor")); AuiMgrMain->AddPane(ntbook, wxAuiPaneInfo().Name(_T("AUInbook")).DefaultPane().Caption(_("Nbook")).CaptionVisible(false).CloseButton(false).Center().Floatable(false).Movable(false).PaneBorder(false)); AuiMgrMain->Update(); MenuBar1 = new wxMenuBar(); Menu1 = new wxMenu(); mnu_open_edi = new wxMenuItem(Menu1, wxID_OPEN, _("Open EDID binary\tctrl-O"), wxEmptyString, wxITEM_NORMAL); Menu1->Append(mnu_open_edi); mnu_save_edi = new wxMenuItem(Menu1, wxID_SAVE, _("Save EDID binary\tctrl-S"), wxEmptyString, wxITEM_NORMAL); Menu1->Append(mnu_save_edi); mnu_save_edi->Enable(false); mnu_save_text = new wxMenuItem(Menu1, wxID_SAVEAS, _("Save as text"), _("Saves EDID as human readable text file"), wxITEM_NORMAL); Menu1->Append(mnu_save_text); mnu_save_text->Enable(false); mnu_imphex = new wxMenuItem(Menu1, id_mnu_imphex, _("Import EDID from HEX (ASCII)"), wxEmptyString, wxITEM_NORMAL); Menu1->Append(mnu_imphex); mnu_exphex = new wxMenuItem(Menu1, id_mnu_exphex, _("Export EDID as HEX (ASCII)"), wxEmptyString, wxITEM_NORMAL); Menu1->Append(mnu_exphex); mnu_exphex->Enable(false); mnu_quit = new wxMenuItem(Menu1, wxID_EXIT, _("Quit\tAlt-F4"), _("Quit the application"), wxITEM_NORMAL); Menu1->Append(mnu_quit); MenuBar1->Append(Menu1, _("&File")); Menu3 = new wxMenu(); mnu_reparse = new wxMenuItem(Menu3, id_mnu_parse, _("&Reparse EDID buffer"), _("Reinterpret EDID data"), wxITEM_NORMAL); Menu3->Append(mnu_reparse); mnu_reparse->Enable(false); mnu_assemble = new wxMenuItem(Menu3, id_mnu_asmchg, _("&Assemble EDID"), _("Apply changes, update checksums"), wxITEM_NORMAL); Menu3->Append(mnu_assemble); mnu_assemble->Enable(false); mnu_ignore_err = new wxMenuItem(Menu3, id_mnu_ignerr, _("Ignore EDID Errors"), wxEmptyString, wxITEM_CHECK); Menu3->Append(mnu_ignore_err); mnu_allwritable = new wxMenuItem(Menu3, id_mnu_allwr, _("Ignore Read-Only flags"), wxEmptyString, wxITEM_CHECK); Menu3->Append(mnu_allwritable); mnu_dtd_aspect = new wxMenuItem(Menu3, id_mnu_dtd_asp, _("DTD preview: keep aspect ratio"), wxEmptyString, wxITEM_CHECK); Menu3->Append(mnu_dtd_aspect); mnu_dtd_aspect->Check(true); mnu_fdetails = new wxMenuItem(Menu3, id_mnu_fdetails, _("Block Data: show field details"), wxEmptyString, wxITEM_CHECK); Menu3->Append(mnu_fdetails); mnu_dbn = new wxMenuItem(Menu3, id_mnu_dbn, _("Dynamic block names"), wxEmptyString, wxITEM_CHECK); Menu3->Append(mnu_dbn); mnu_dbn->Check(true); mnu_logw = new wxMenuItem(Menu3, id_mnu_logw, _("Log Window\tctrl-L"), wxEmptyString, wxITEM_NORMAL); Menu3->Append(mnu_logw); MenuBar1->Append(Menu3, _("&Options")); Menu2 = new wxMenu(); mnu_about = new wxMenuItem(Menu2, wxID_ABOUT, _("About\tF1"), _("Show info about this application"), wxITEM_NORMAL); Menu2->Append(mnu_about); MenuItem1 = new wxMenuItem(Menu2, id_mnu_flags, _("Flags & Types\tF3"), wxEmptyString, wxITEM_NORMAL); Menu2->Append(MenuItem1); MenuBar1->Append(Menu2, _("&Help")); SetMenuBar(MenuBar1); win_stat_bar = new wxStatusBar(this, id_win_stat_bar, wxST_SIZEGRIP, _T("id_win_stat_bar")); int __wxStatusBarWidths_1[2] = { -300, 400 }; int __wxStatusBarStyles_1[2] = { wxSB_NORMAL, wxSB_NORMAL }; win_stat_bar->SetFieldsCount(2,__wxStatusBarWidths_1); win_stat_bar->SetStatusStyles(2,__wxStatusBarStyles_1); SetStatusBar(win_stat_bar); Center(); //*) InitBlkTreeMenu(); vmap_InitDMT_Vmaps(); //std::maps for DMT timing codes GLog.Create(this); EDID.SetGuiLogPtr(&GLog); dtd_panel ->Enable(false); dtd_screen->Enable(false); dtd_screen->SetParentFrame(this); //needed to have a pointer to a DTD values BlkDataGrid->SetParentFrame(this); //GLog access mnu_dtd_aspect->Check(b_dtd_keep_aspect ); mnu_fdetails ->Check(b_dta_grid_details); mnu_dbn ->Check(config.b_blk_name_dynamic); DataGrid_ChangeView(); flags.u32 = 0; edid_file_name = "EDID"; DeletePendingEvents(); { //calc win size based on DTD panel. wxSize minsz, actsz, winsz, delta; winsz = GetSize(); actsz = dtd_panel->GetSize(); minsz = bs_dtd_main->ComputeFittingWindowSize(this); delta.x = actsz.x - minsz.x; delta.x = (delta.x > 0) ? 0 : -delta.x; delta.x += 8; //magic: compensation for dtd_screen border delta.y = actsz.y - minsz.y; delta.y = (delta.y > 0) ? 0 : -delta.y; winsz += delta; SetMinSize(winsz); } //detect dark/light mode DataGridSetColors(); //config::flags mnu_ignore_err->Check(config.b_cmd_ignore_err); EDID.b_ERR_Ignore = config.b_cmd_ignore_err; mnu_allwritable->Check(config.b_cmd_ignore_rd); EDID.b_RD_Ignore = config.b_cmd_ignore_rd; EDID.b_GrpNameDynamic = config.b_blk_name_dynamic; if (config.b_have_layout) { wxCommandEvent evt(wxEVT_DEFERRED, id_app_layout); AddPendingEvent(evt); } else { //EDID panel, default layout tmps = wxString::FromAscii(AUI_DefLayout); AuiMgrEDID->LoadPerspective(tmps); } { //set AUI font: wxAuiDefaultDockArt *dart; dart = dynamic_cast (AuiMgrEDID->GetArtProvider()); dart->SetFont(wxAUI_DOCKART_CAPTION_FONT, GetFont()); } //load/import file from cmd line arg? if (config.b_cmd_bin_file) { wxCommandEvent evt(wxEVT_DEFERRED, wxID_OPEN); AddPendingEvent(evt); return; } if (config.b_cmd_txt_file) { wxCommandEvent evt(wxEVT_DEFERRED, id_mnu_imphex); AddPendingEvent(evt); } } wxEDID_Frame::~wxEDID_Frame() { config.aui_layout = AuiMgrEDID->SavePerspective(); config.win_pos = GetPosition(); config.win_size = GetSize(); if (edigrp_src != NULL) delete edigrp_src; delete mnu_BlkTree; delete miRemoved; delete accDelete; delete accMoveUp; delete accMoveDn; AuiMgrEDID->UnInit(); AuiMgrMain->UnInit(); delete AuiMgrEDID; delete AuiMgrMain; vmap_DestroySelectors(); vmap_DeleteDMT_Vmaps(); } void wxEDID_Frame::evt_sys_color_chg(wxSysColourChangedEvent & evt) { DataGridSetColors(); if (BlkDataGrid->IsEnabled()) { rcode retU; retU = UpdateDataGrid(edigrp_sel); if (!RCD_IS_OK(retU)) { GLog.PrintRcode(retU); GLog.Show(); } } evt.Skip(); } void wxEDID_Frame::evt_frame_size(wxSizeEvent& evt) { DTD_Ctor_Layout(); evt.Skip(true); } void wxEDID_Frame::evt_dgrid_select(wxGridEvent& evt) { rcode retU; row_sel = evt.GetRow(); BlkDataGrid->SelectRow(row_sel); retU = SetFieldDesc(row_sel); evt.Skip(true); } #pragma GCC diagnostic ignored "-Wunused-parameter" void wxEDID_Frame::evt_dgrid_vsel(wxGridEvent& evt) { //EVT_GRID_CMD_EDITOR_SHOWN: show value selector menu for fields with F_VS flag set rcode retU; u32_t flags; edi_dynfld_t *p_dfld; if (edigrp_sel == NULL) { RCD_SET_FAULT(retU); GLog.PrintRcode(retU); GLog.Show(); return; } p_dfld = edigrp_sel->FieldsAr.Item(row_sel); if (p_dfld == NULL) { RCD_SET_FAULT(retU); GLog.PrintRcode(retU); GLog.Show(); return; } flags = p_dfld->field.flags; if ((F_VS & flags) != 0) { wxMenu *mnu_sel; mnu_sel = vmap_GetSelector(p_dfld->field.vmap_idx, flags, retU); if(mnu_sel != NULL) { BlkDataGrid->SetMenuEvtField(&p_dfld->field); BlkDataGrid->PopupMenu(mnu_sel); } else { RCD_SET_FAULT(retU); GLog.PrintRcode(retU); GLog.Show(); } } } void wxEDID_Frame::evt_dgrid_edit_hide(wxGridEvent& evt) { //keep row selected after CellEditControl is removed BlkDataGrid->SelectRow(row_sel); } #if wxCHECK_GCC_VERSION(8, 0) #pragma GCC diagnostic ignored "-Wcast-function-type" #endif void wxEDID_Frame::evt_blktr_sel(wxTreeEvent& evt) { rcode retU; edi_grp_cl *pgrp; BT_Item_sel = evt.GetItem(); BT_Iparent = BlockTree->GetItemParent(BT_Item_sel); pgrp = reinterpret_cast (BlockTree->GetItemData(BT_Item_sel)); //on block sel. change always hide cell editor and clear grid selection: BlkDataGrid->HideCellEditControl(); BlkDataGrid->ClearSelection(); if ( (!BT_Item_sel.IsOk()) || (pgrp == NULL)) { txc_edid_info->Clear(); BlkDataGrid->Enable(false); tmps.Empty(); win_stat_bar->SetStatusText(tmps, SBAR_GRPOFFS); edigrp_sel = NULL; return; } if (BLKTR_RESEL_EVT == (intptr_t) evt.GetClientData()) { //same group selected again: display group info only, skip other steps txc_edid_info->SetValue(pgrp->GroupDesc); return; } BlkDataGrid->Enable(flags.bits.ctrl_enabled); edigrp_sel = pgrp; SetOpFlags(); { u32_t abs_offs; u32_t rel_offs; u32_t grp_sz; abs_offs = pgrp->getAbsOffs(); rel_offs = pgrp->getRelOffs(); grp_sz = pgrp->getTotalSize(); tmps.Printf("Offset: Abs:%d (0x%04X), Rel: %d (0x%02X), Size: %uB", abs_offs, abs_offs, rel_offs, rel_offs, grp_sz); win_stat_bar->SetStatusText(tmps, SBAR_GRPOFFS); } retU = UpdateDataGrid(pgrp); if (!RCD_IS_OK(retU)) { GLog.PrintRcode(retU); GLog.Show(); } //display group info: after UpdateDataGrid() txc_edid_info->SetValue(pgrp->GroupDesc); { gtid_t tid; bool enb; tid = pgrp->getTypeID(); enb = (ID_DTD == (tid.t32 & ID_EDID_MASK )); enb |= (ID_T7VTDB == (tid.t32 & ID_CEA_ET_MASK)); if (enb) { Connect(wxID_ANY, wxEVT_COMMAND_SPINCTRL_UPDATED, (wxObjectEventFunction) &wxEDID_Frame::evt_dtdctor_sct); } else { Disconnect(wxID_ANY, wxEVT_COMMAND_SPINCTRL_UPDATED, (wxObjectEventFunction) &wxEDID_Frame::evt_dtdctor_sct); } dtd_panel ->Enable(enb); dtd_screen->Enable(enb); } } #if wxCHECK_GCC_VERSION(8, 0) #pragma GCC diagnostic warning "-Wcast-function-type" #endif void wxEDID_Frame::BlkTreeUpdateGrp() { rcode retU; wxTreeItemId trItemID; edi_grp_cl *grp_copy; GroupAr_cl *grp_ar; u32_t grp_idx; bool b_expand; bool del_subg = true; RCD_SET_FAULT(retU); //BlockTree is refreshed even when sub-groups are not present //reparse/layout change -> re-init(). grp_copy = edigrp_sel->Clone(retU, T_MODE_EDIT); if ((NULL == grp_copy) || !RCD_IS_OK(retU)) { GLog.PrintRcode(retU); if (! EDID.b_ERR_Ignore) { GLog.Show(); } if (NULL == grp_copy) return; } grp_idx = edigrp_sel->getParentArIdx(); grp_ar = edigrp_sel->getParentAr(); trItemID = edigrp_sel->GetId(); b_expand = BlockTree->IsExpanded(trItemID); BlkTreeDelGrp (edigrp_sel, del_subg); grp_ar->Delete (grp_idx); grp_ar->InsertDn((grp_idx-1), grp_copy); trItemID = BlkTreeInsGrp (BT_Iparent, grp_copy, grp_idx); if (subg_idx >= 0) { //restore sub-group selection if (subg_idx > (int) grp_copy->getSubGrpCount()) { subg_idx = grp_copy->getSubGrpCount() -1; } grp_ar = grp_copy->getSubGrpAr(); edigrp_sel = grp_copy->getSubGroup(subg_idx); trItemID = edigrp_sel->GetId(); BlockTree ->SelectItem (trItemID); subg_idx = -1; } else { BlockTree->SelectItem (trItemID); if (b_expand) BlockTree->Expand(trItemID); } } rcode wxEDID_Frame::BlkTreeChangeGrpType(bool dbc_type) { rcode retU; wxTreeItemId trItemID; edi_grp_cl *grp_new; u8_t *grp_inst; GroupAr_cl *grp_ar; u32_t grp_idx; u32_t gp_abs_offs; u32_t gp_rel_offs; bool b_expand; bool del_subg = true; grp_inst = edigrp_sel->getInstPtr(); grp_idx = edigrp_sel->getParentArIdx(); gp_abs_offs = edigrp_sel->getAbsOffs(); gp_rel_offs = edigrp_sel->getRelOffs(); grp_ar = edigrp_sel->getParentAr(); trItemID = edigrp_sel->GetId(); b_expand = BlockTree->IsExpanded(trItemID); //spawn new group after tag code change if (dbc_type) { retU = EDID.ParseDBC_TAG(grp_inst, &grp_new); } else { retU = EDID.ParseAltDtor(grp_inst, &grp_new, (i32_t) gp_abs_offs); } if (! RCD_IS_OK(retU)) { GLog.PrintRcode(retU); if (! EDID.b_ERR_Ignore ) GLog.Show(); } if (NULL == grp_new) { RCD_SET_FAULT(retU); goto error; } grp_new->setAbsOffs(gp_abs_offs); grp_new->setRelOffs(gp_rel_offs); grp_new->setParentAr(grp_ar); retU = grp_new->init(grp_inst, T_MODE_EDIT, NULL); if (! RCD_IS_OK(retU)) { //the fault message is logged, but ignored if ( (retU.detail.rcode > RCD_FVMSG) || !EDID.b_ERR_Ignore ) { delete grp_new; goto error; } else { GLog.PrintRcode(retU); if (! EDID.b_ERR_Ignore ) GLog.Show(); } } BlkTreeDelGrp (edigrp_sel, del_subg); grp_ar->Delete (grp_idx); grp_ar->InsertDn((grp_idx-1), grp_new); trItemID = BlkTreeInsGrp (BT_Iparent, grp_new, grp_idx); BlockTree->SelectItem (trItemID); if (b_expand) BlockTree->Expand(trItemID); RCD_RETURN_OK(retU); error: GLog.PrintRcode(retU); GLog.Show(); return retU; } void wxEDID_Frame::evt_dgrid_write(wxGridEvent& evt) { rcode retU; row_op = evt.GetRow(); retU = WriteField(); if (!RCD_IS_OK(retU)) { GLog.DoLog("[E!] WriteField() FAILED."); GLog.PrintRcode(retU); GLog.Show(); } //check Group Refresh flag: if (flags.bits.grp_refresh != 0) { flags.bits.grp_refresh = 0; GLog.DoLog("Group Refresh forced."); retU = UpdateDataGrid(edigrp_sel); if (!RCD_IS_OK(retU)) { GLog.DoLog("[E!] UpdateDataGrid() FAILED."); GLog.PrintRcode(retU); GLog.Show(); } } } void wxEDID_Frame::BlkTreeSwitchDynamicNames() { wxTreeItemId trItemID; edi_grp_cl *group; if (EDID.EDI_BaseGrpAr.GetCount() < 1) return; for (u32_t itg=0; itgGetId(); GetFullGroupName(group, tmps); BlockTree->SetItemText(trItemID, tmps); } if (EDID.EDI_Ext0GrpAr.GetCount() < 1) return; for (u32_t itg=0; itgGetId(); GetFullGroupName(group, tmps); BlockTree->SetItemText(trItemID, tmps); //sub groups if (group->getSubGrpCount() > 0) { for (u32_t idx=0; idxgetSubGrpCount(); idx++ ) { wxTreeItemId subitem; edi_grp_cl *subgrp; subgrp = group->getSubGroup(idx); subitem = subgrp->GetId(); GetFullGroupName(subgrp, tmps); BlockTree->SetItemText(subitem, tmps); } } } } void wxEDID_Frame::BlkTreeUpdateGrpName() { wxTreeItemId trItemID; if (! EDID.b_GrpNameDynamic) return; trItemID = edigrp_sel->GetId(); GetFullGroupName(edigrp_sel, tmps); BlockTree->SetItemText(trItemID, tmps); } void wxEDID_Frame::AutoSelectBED() { wxTreeItemId itemID; edi_grp_cl *group; group = EDID.EDI_BaseGrpAr.Item(0); itemID = group->GetId(); BlockTree->SelectItem (itemID); } void wxEDID_Frame::SetOpFlags() { GroupAr_cl *grp_ar; u32_t grp_idx; gtid_t type_id; bool b_Reparse; bool b_Copy; bool b_Cut; opFlags.u32 = 0; type_id = edigrp_sel->getTypeID(); grp_ar = edigrp_sel->getParentAr(); grp_idx = edigrp_sel->getParentArIdx(); if (edigrp_src != NULL) { opFlags.bits.CanInsertUp = grp_ar->CanInsertUp(grp_idx, edigrp_src); opFlags.bits.CanInsInto = grp_ar->CanInsInto (grp_idx, edigrp_src); opFlags.bits.CanInsertDn = grp_ar->CanInsertDn(grp_idx, edigrp_src); opFlags.bits.CanPaste = grp_ar->CanPaste (grp_idx, edigrp_src); } b_Reparse = (0 != (type_id.t32 & (ID_CEA_MASK | ID_CEA_ET_MASK) )); b_Reparse &= (0 == (type_id.t32 & (T_GRP_FIXED | T_SUB_GRP ) )); b_Copy = ! type_id.t_gp_fixed; b_Copy &= ! type_id.t_no_copy; b_Copy &= ! (ID_CEA_UDAT == (type_id.t32 & ID_CEA_UDAT)); b_Cut = b_Copy; b_Cut &= grp_ar->CanCut(grp_idx); opFlags.bits.CanReparse = b_Reparse; opFlags.bits.CanCopy = b_Copy; opFlags.bits.CanCut = b_Cut; opFlags.bits.CanDelete = grp_ar->CanDelete(grp_idx); opFlags.bits.CanMoveUp = grp_ar->CanMoveUp(grp_idx); opFlags.bits.CanMoveDn = grp_ar->CanMoveDn(grp_idx); } edi_grp_cl* wxEDID_Frame::CopyGroup(edi_grp_cl* pgrp) { rcode retU; edi_grp_cl *grp_copy; grp_copy = pgrp->Clone(retU, T_MODE_EDIT); //T_MODE_EDIT: copy full buffer if ((NULL == grp_copy) || !RCD_IS_OK(retU)) { GLog.PrintRcode(retU); if (! EDID.b_ERR_Ignore) { GLog.Show(); } if (NULL == grp_copy) return NULL; } return grp_copy; } void wxEDID_Frame::evt_blktr_copy(wxCommandEvent& evt) { LogGroupOP(edigrp_sel, "Copy"); if (edigrp_src != NULL) { edigrp_src->delete_subg(); delete edigrp_src; } edigrp_src = CopyGroup(edigrp_sel); //immediately check conditions for selected group, even if edigrp_src was NULL //removes warning flag from id_mnu_info //otherwise the flags are updated only on selection change SetOpFlags(); } void wxEDID_Frame::evt_blktr_paste(wxCommandEvent& evt) { rcode retU; wxTreeItemId trItemID; edi_grp_cl *grp_copy; GroupAr_cl *grp_ar; u32_t grp_idx; bool b_expand; bool del_subg = true; if (NULL == edigrp_src) return; //should never happen grp_copy = CopyGroup(edigrp_src); if (NULL == grp_copy) return; LogGroupOP(grp_copy, "Paste"); grp_ar = edigrp_sel->getParentAr(); grp_idx = edigrp_sel->getParentArIdx(); trItemID = edigrp_sel->GetId(); b_expand = BlockTree->IsExpanded(trItemID); BlkTreeDelGrp(edigrp_sel, del_subg); grp_ar->Paste(grp_idx, grp_copy); edigrp_sel = grp_copy; retU = UpdateDataGrid(grp_copy); if (!RCD_IS_OK(retU)) { GLog.DoLog("Paste() FAILED."); GLog.PrintRcode(retU); GLog.Show(); } //OPTION: keep expanded state trItemID = BlkTreeInsGrp(BT_Iparent, grp_copy, grp_idx); BlockTree->SelectItem(trItemID); if (b_expand) BlockTree->Expand(trItemID); } void wxEDID_Frame::evt_blktr_delete(wxCommandEvent& evt) { wxTreeItemId trItemID; GroupAr_cl *grp_ar; u32_t grp_idx; bool del_subg = true; LogGroupOP(edigrp_sel, "Delete"); grp_ar = edigrp_sel->getParentAr(); grp_idx = edigrp_sel->getParentArIdx(); trItemID = edigrp_sel->GetId(); BlkTreeDelGrp (edigrp_sel, del_subg); grp_ar->Delete(grp_idx ); { //select next group u32_t grp_cnt = grp_ar->GetCount(); if (grp_cnt > 0) { grp_idx = (grp_idx < grp_cnt) ? grp_idx : (grp_cnt-1); edigrp_sel = grp_ar->Item(grp_idx); trItemID = edigrp_sel->GetId(); goto update; } } //empty group: select parent trItemID = BT_Iparent; update: BlockTree->SelectItem(trItemID); //triggers evt_blktr_sel() } void wxEDID_Frame::evt_blktr_cut(wxCommandEvent& evt) { wxTreeItemId trItemID; GroupAr_cl *grp_ar; u32_t grp_idx; bool no_del_subg = false; LogGroupOP(edigrp_sel, "Cut"); grp_ar = edigrp_sel->getParentAr(); grp_idx = edigrp_sel->getParentArIdx(); edigrp_src = grp_ar->Cut(grp_idx); BlkTreeDelGrp(edigrp_sel, no_del_subg); { //select next group u32_t grp_cnt; grp_cnt = grp_ar->GetCount(); if (grp_cnt > 0) { grp_idx = (grp_idx < grp_cnt) ? grp_idx : (grp_cnt-1); edigrp_sel = grp_ar->Item(grp_idx); trItemID = edigrp_sel->GetId(); goto update; } } //empty group: select parent trItemID = BT_Iparent; update: BlockTree->SelectItem(trItemID); //triggers evt_blktr_sel() } void wxEDID_Frame::evt_blktr_insert(wxCommandEvent& evt) { wxTreeItemId trItemID; edi_grp_cl *grp_copy; GroupAr_cl *grp_ar; u32_t grp_idx; int evtid; if (NULL == edigrp_src) return; //should never happen grp_copy = CopyGroup(edigrp_src); if (NULL == grp_copy) return; evtid = evt.GetId(); grp_ar = edigrp_sel->getParentAr(); grp_idx = edigrp_sel->getParentArIdx(); if (id_mnu_ins_up == evtid) { LogGroupOP(edigrp_sel, "Insert Above"); grp_ar ->InsertUp(grp_idx, grp_copy); trItemID = BlkTreeInsGrp(BT_Iparent, grp_copy, grp_idx); goto select_item; } if (id_mnu_ins_in == evtid) { LogGroupOP(edigrp_sel, "Insert Into"); grp_ar = edigrp_sel->getSubGrpAr(); grp_ar ->InsertInto(edigrp_sel, grp_copy); //always insert @idx=0 BT_Iparent = edigrp_sel->GetId(); trItemID = BlkTreeInsGrp(BT_Iparent, grp_copy, 0); goto select_item; } // id_mnu_ins_dn LogGroupOP(edigrp_sel, "Insert Below"); grp_ar ->InsertDn(grp_idx, grp_copy); grp_idx ++ ; trItemID = BlkTreeInsGrp(BT_Iparent, grp_copy, grp_idx); select_item: BlockTree->SelectItem(trItemID); } void wxEDID_Frame::evt_blktr_move(wxCommandEvent& evt) { wxTreeItemId trItemID; GroupAr_cl *grp_ar; u32_t grp_idx; int evtid; bool b_Expanded; bool no_del_subg = false; evtid = evt.GetId(); grp_ar = edigrp_sel->getParentAr(); grp_idx = edigrp_sel->getParentArIdx(); trItemID = edigrp_sel->GetId(); b_Expanded = BlockTree->IsExpanded(trItemID); //don't delete edi_grp_cl::wxTreeItemData BlkTreeDelGrp(edigrp_sel, no_del_subg); if (evtid == wxID_UP) { LogGroupOP(edigrp_sel, "Move Up"); grp_ar->MoveUp(grp_idx); grp_idx -- ; trItemID = BlkTreeInsGrp(BT_Iparent, edigrp_sel, grp_idx); goto update; } // wxID_DOWN: move down LogGroupOP(edigrp_sel, "Move Down"); grp_ar->MoveDn(grp_idx); grp_idx ++ ; trItemID = BlkTreeInsGrp(BT_Iparent, edigrp_sel, grp_idx); update: BlockTree->SelectItem(trItemID); if (b_Expanded) BlockTree->Expand(trItemID); } void wxEDID_Frame::evt_blktr_reparse(wxCommandEvent& evt) { rcode retU; retU = edigrp_sel->AssembleGroup(); if (!RCD_IS_OK(retU)) { GLog.PrintRcode(retU); if (! EDID.b_ERR_Ignore) GLog.Show(); } BlkTreeUpdateGrp(); } void wxEDID_Frame::evt_blktr_key(wxTreeEvent& evt) { int keycode; wxCommandEvent op_evt(wxEVT_MENU); wxKeyEvent kevt = evt.GetKeyEvent(); if (BlockTree->b_key_block) goto skip_evt; if (edigrp_sel == NULL ) goto skip_evt; keycode = evt.GetKeyCode(); if ((keycode == WXK_RETURN ) || (keycode == WXK_NUMPAD_ENTER)) { bool enb; gtid_t tid; tid = edigrp_sel->getTypeID(); enb = (ID_DTD == (tid.t32 & ID_EDID_MASK )); enb |= (ID_T7VTDB == (tid.t32 & ID_CEA_ET_MASK)); if (enb) ntbook->SetSelection(1); //DTD constructor return; } if ((keycode == WXK_DELETE) || (keycode == WXK_BACK)) { if (! opFlags.bits.CanDelete) return; evt_blktr_delete(evt); //wxID_DELETE ignored return; } if (! kevt.ControlDown()) goto skip_evt; switch (keycode) { case WXK_UP: case WXK_NUMPAD_UP: if (! opFlags.bits.CanMoveUp) return; op_evt.SetId(wxID_UP); evt_blktr_move(op_evt); return; case WXK_DOWN: case WXK_NUMPAD_DOWN: if (! opFlags.bits.CanMoveDn) return; op_evt.SetId(wxID_DOWN); evt_blktr_move(op_evt); return; default: break; } if (keycode == 'C') { if (! opFlags.bits.CanCopy) return; evt_blktr_copy(op_evt); //wxID_COPY ignored return; } if (keycode == 'V') { if (! opFlags.bits.CanPaste) return; evt_blktr_paste(op_evt); //wxID_PASTE ignored return; } if (keycode == 'X') { if (! opFlags.bits.CanCut) return; evt_blktr_cut(op_evt); //wxID_CUT ignored return; } skip_evt: evt.Skip(true); return; } void wxEDID_Frame::evt_blktr_rmb(wxTreeEvent& evt) { GroupAr_cl *grp_ar; u32_t blk_free; u32_t grp_free; if (edigrp_sel == NULL) return; grp_ar = edigrp_sel->getParentAr(); if (grp_ar->getParentArray() != NULL) { blk_free = grp_ar->getParentArray()->getFreeSpace(); grp_free = grp_ar->getFreeSpace(); } else { blk_free = grp_ar->getFreeSpace(); gtid_t tid; //if DBC group, read length from header //for T_GRP_FIXED zero free space is reported. f.e. ID_CHD tid = edigrp_sel->getTypeID(); tid.t32 &= ~(ID_CEA_MASK|ID_CEA_ET_MASK); if (tid.t32 == 0) { u32_t dlen; dlen = edigrp_sel->getTotalSize(); grp_free = (32 - dlen); } else { grp_free = 0; } } if (edigrp_src != NULL) { //miInfoOK if types are matching && there's enough free space left if (opFlags.bits.CanPaste | opFlags.bits.CanInsInto) { if (miInfoOK != mnu_BlkTree->FindItemByPosition(0)) { miRemoved = mnu_BlkTree->Remove(id_mnu_info); miInfoOK ->SetSubMenu(mnu_SubInfo); miInfoNOK ->SetSubMenu(NULL); mnu_BlkTree->Insert(0, miInfoOK); } } else { if (miInfoNOK != mnu_BlkTree->FindItemByPosition(0)) { miRemoved = mnu_BlkTree->Remove(id_mnu_info); miInfoOK ->SetSubMenu(NULL); miInfoNOK ->SetSubMenu(mnu_SubInfo); mnu_BlkTree->Insert(0, miInfoNOK); } } tmps.Printf("Src: %s\nSel: %s", edigrp_src->CodeName, edigrp_sel->CodeName ); mnu_BlkTree->SetLabel(id_mnu_info, tmps); tmps.Printf("Src: %s, size %dB\n" "Sel: %s, offs %d (rel %d), size %dB\n" "Free space:\n" "group: %dB\n" "block: %dB", edigrp_src->CodeName, edigrp_src->getTotalSize(), edigrp_sel->CodeName, edigrp_sel->getAbsOffs(), edigrp_sel->getRelOffs(), edigrp_sel->getTotalSize(), grp_free, blk_free ); #ifdef DBG_MODE { gtid_t tsrc = edigrp_src->getTypeID(); gtid_t tdst = edigrp_sel->getTypeID(); sval.Printf( "\nDEBUG: type_id: src : dest\n" "base_id : %u : %u\n" "cea_id : %u : %u\n" "cea_et_id : %u : %u\n" "subg_id : %u : %u\n" "t_md_edit : %u : %u\n" "t_no_copy : %u : %u\n" "t_no_move : %u : %u\n" "t_p_holder: %u : %u\n" "t_gp_fixed: %u : %u\n" "t_sub_gp : %u : %u\n", tsrc.base_id , tdst.base_id, tsrc.cea_id , tdst.cea_id, tsrc.cea_et_id , tdst.cea_et_id, tsrc.subg_id , tdst.subg_id, tsrc.t_md_edit , tdst.t_md_edit, tsrc.t_no_copy , tdst.t_no_copy, tsrc.t_no_move , tdst.t_no_move, tsrc.t_p_holder, tdst.t_p_holder, tsrc.t_gp_fixed, tdst.t_gp_fixed, tsrc.t_sub_gp , tdst.t_sub_gp ); tmps << sval; } #endif } else { tmps.Printf("Src: \nSel: %s", edigrp_sel->CodeName ); mnu_BlkTree->SetLabel(id_mnu_info, tmps); tmps.Printf("Sel: %s, offs %d (rel %d), size %dB\n" "Free space:\n" "group: %dB\n" "block: %dB", edigrp_sel->CodeName, edigrp_sel->getAbsOffs(), edigrp_sel->getRelOffs(), edigrp_sel->getTotalSize(), grp_free, blk_free ); } miSubInfo->SetItemLabel(tmps); mnu_BlkTree->Enable(wxID_EXECUTE , opFlags.bits.CanReparse ); mnu_BlkTree->Enable(wxID_PASTE , opFlags.bits.CanPaste ); mnu_BlkTree->Enable(wxID_CUT , opFlags.bits.CanCut ); mnu_BlkTree->Enable(wxID_COPY , opFlags.bits.CanCopy ); mnu_BlkTree->Enable(wxID_DELETE , opFlags.bits.CanDelete ); mnu_BlkTree->Enable(id_mnu_ins_up, opFlags.bits.CanInsertUp); mnu_BlkTree->Enable(id_mnu_ins_in, opFlags.bits.CanInsInto ); mnu_BlkTree->Enable(id_mnu_ins_dn, opFlags.bits.CanInsertDn); mnu_BlkTree->Enable(wxID_UP , opFlags.bits.CanMoveUp ); mnu_BlkTree->Enable(wxID_DOWN , opFlags.bits.CanMoveDn ); PopupMenu(mnu_BlkTree); } void wxEDID_Frame::evt_open_edid_bin(wxCommandEvent& evt) { rcode retU; retU = OpenEDID(); if (!RCD_IS_OK(retU)) { GLog.PrintRcode(retU); if (! EDID.b_ERR_Ignore) { dlg::MessageBox(this, msgF_LOAD, txt_WARNING, wxART_WARNING); } else { GLog.Show(); } } mnu_reparse ->Enable(flags.bits.data_loaded); mnu_assemble->Enable(flags.bits.data_loaded); } void wxEDID_Frame::evt_save_edid_bin(wxCommandEvent& evt) { rcode retU; retU = SaveEDID(); if (!RCD_IS_OK(retU)) { GLog.DoLog("SaveEDID() FAILED."); GLog.PrintRcode(retU); GLog.Show(); } evt.Skip(true); } void wxEDID_Frame::evt_save_report(wxCommandEvent& evt) { rcode retU; retU = SaveReport(); if (!RCD_IS_OK(retU)) { GLog.DoLog("SaveReport() FAILED."); GLog.PrintRcode(retU); GLog.Show(); } } void wxEDID_Frame::evt_export_hex(wxCommandEvent& evt) { rcode retU; retU = ExportEDID_hex(); if (!RCD_IS_OK(retU)) { GLog.DoLog("ExportEDID_hex() FAILED."); GLog.PrintRcode(retU); GLog.Show(); } } void wxEDID_Frame::evt_import_hex(wxCommandEvent& evt) { rcode retU; retU = ImportEDID_hex(); if (! RCD_IS_OK(retU)) { GLog.PrintRcode(retU); if (! EDID.b_ERR_Ignore) { tmps = msgF_LOAD; dlg::MessageBox(this, msgF_LOAD, txt_WARNING, wxART_WARNING); } else { GLog.Show(); } } mnu_reparse->Enable(flags.bits.data_loaded); mnu_assemble ->Enable(flags.bits.data_loaded); } void wxEDID_Frame::evt_ignore_rd(wxCommandEvent& evt) { EDID.b_RD_Ignore = mnu_allwritable->IsChecked(); if (EDID.b_RD_Ignore) { tmps = "Write protection for ALL fields is disabled."; dlg::MessageBox(this, tmps, txt_WARNING, wxART_WARNING); } else { tmps = "Write protection is enabled for fields with RD flag set."; dlg::MessageBox(this, tmps, txt_REMARK, wxART_INFORMATION); } UpdateDataGrid(edigrp_sel); } void wxEDID_Frame::evt_ignore_err(wxCommandEvent& evt) { EDID.b_ERR_Ignore = mnu_ignore_err->IsChecked(); if (EDID.b_ERR_Ignore) { tmps = "EDID errors will be IGNORED.\n\n" "This allows to bypass minor bugs in loaded files, " "but it won't help if the file contains garbage."; dlg::MessageBox(this, tmps, txt_WARNING, wxART_WARNING); GLog.DoLog("Ignoring of EDID errors ENABLED."); } else { tmps = "Critical EDID error will disable the editor."; dlg::MessageBox(this, tmps, txt_REMARK, wxART_INFORMATION); GLog.DoLog("Ignoring of EDID errors DISABLED."); } } void wxEDID_Frame::evt_dtdctor_sct(wxSpinEvent& evt) { float pixclk; int limit, val; bool brecalc = true; bool updt_htotal = false; bool updt_vtotal = false; int evtid = evt.GetId(); //invalidate grid data -> refresh if (evtid != wxID_ANY) flags.bits.grid_blk_ok = 0; if (evtid == id_sct_pixclk) { sct_pixclk->data = sct_pixclk->GetValue(); if (!RCD_IS_OK(DTD_Ctor_WriteInt(*sct_pixclk))) return; evtid = wxID_ANY; //DTD_Ctor_Recalc(); //return; } pixclk = (sct_pixclk->data * dtd_pclk_factor); if ((evtid == wxID_ANY) || (evtid == id_sct_xres)) { sct_xres->data = sct_xres->GetValue(); if (evtid != wxID_ANY) { if (!RCD_IS_OK(DTD_Ctor_WriteInt(*sct_xres))) return; } tmps.Printf("%.03f", ((sct_xres->data * 1000000.0) / pixclk)); txc_txres->SetValue(tmps); updt_htotal = updt_vtotal = true; evtid = wxID_ANY; } if ((evtid == wxID_ANY) || (evtid == id_sct_hblank)) { limit = (sct_hsoffs->data + sct_hswidth->data); val = sct_hblank->GetValue(); if (val < limit) { val = limit; sct_hblank->SetValue(val); } sct_hblank->data = val; if (evtid != wxID_ANY) { if (!RCD_IS_OK(DTD_Ctor_WriteInt(*sct_hblank))) return; } tmps.Printf("%.04f", ((val * 1000000.0) / pixclk)); txc_thblank->SetValue(tmps); updt_htotal = updt_vtotal = true; } if ((evtid == wxID_ANY) || (evtid == id_sct_hsoffs)) { limit = (sct_hblank->data - sct_hswidth->data); val = sct_hsoffs->GetValue(); if (val > limit) { val = limit; sct_hsoffs->SetValue(val); } sct_hsoffs->data = val; if (evtid != wxID_ANY) { if (!RCD_IS_OK(DTD_Ctor_WriteInt(*sct_hsoffs))) return; } tmps.Printf("%.04f", ((val * 1000000.0) / pixclk)); txc_thsoffs->SetValue(tmps); brecalc = false; } if ((evtid == wxID_ANY) || (evtid == id_sct_hswidth)) { limit = (sct_hblank->data - sct_hsoffs->data); val = sct_hswidth->GetValue(); if (val > limit) { val = limit; sct_hswidth->SetValue(val); } sct_hswidth->data = val; if (evtid != wxID_ANY) { if (!RCD_IS_OK(DTD_Ctor_WriteInt(*sct_hswidth))) return; } tmps.Printf("%.04f", ((val * 1000000.0) / pixclk)); txc_thswidth->SetValue(tmps); brecalc = false; } if (evtid == id_sct_hborder) { sct_hborder->data = sct_hborder->GetValue(); if (!RCD_IS_OK(DTD_Ctor_WriteInt(*sct_hborder))) return; brecalc = false; } dtd_Htotal = (sct_hblank->data + sct_xres->data); if ((evtid == wxID_ANY) || (evtid == id_sct_vres)) { sct_vres->data = sct_vres->GetValue(); if (evtid != wxID_ANY) { if (!RCD_IS_OK(DTD_Ctor_WriteInt(*sct_vres))) return; } tmps.Printf("%.03f", ((sct_vres->data * dtd_Htotal * 1000.0) / pixclk)); txc_tvres->SetValue(tmps); updt_vtotal = true; } if ((evtid == wxID_ANY) || (evtid == id_sct_vblank)) { limit = (sct_vsoffs->data + sct_vswidth->data); val = sct_vblank->GetValue(); if (val < limit) { val = limit; sct_vblank->SetValue(val); } sct_vblank->data = val; if (evtid != wxID_ANY) { if (!RCD_IS_OK(DTD_Ctor_WriteInt(*sct_vblank))) return; } tmps.Printf("%.04f", ((val * dtd_Htotal * 1000.0) / pixclk)); txc_tvblank->SetValue(tmps); updt_vtotal = true; } if ((evtid == wxID_ANY) || (evtid == id_sct_vsoffs)) { limit = (sct_vblank->data - sct_vswidth->data); val = sct_vsoffs->GetValue(); if (val > limit) { val = limit; sct_vsoffs->SetValue(val); } sct_vsoffs->data = val; if (evtid != wxID_ANY) { if (!RCD_IS_OK(DTD_Ctor_WriteInt(*sct_vsoffs))) return; } tmps.Printf("%.04f", ((val * dtd_Htotal * 1000.0) / pixclk)); txc_tvsoffs->SetValue(tmps); brecalc = false; } if ((evtid == wxID_ANY) || (evtid == id_sct_vswidth)) { limit = (sct_vblank->data - sct_vsoffs->data); val = sct_vswidth->GetValue(); if (val > limit) { val = limit; sct_vswidth->SetValue(val); } sct_vswidth->data = val; if (evtid != wxID_ANY) { if (!RCD_IS_OK(DTD_Ctor_WriteInt(*sct_vswidth))) return; } tmps.Printf("%.04f", ((val * dtd_Htotal * 1000.0) / pixclk)); txc_tvswidth->SetValue(tmps); brecalc = false; } if (evtid == id_sct_vborder) { sct_vborder->data = sct_vborder->GetValue(); if (!RCD_IS_OK(DTD_Ctor_WriteInt(*sct_vborder))) return; brecalc = false; } if (updt_htotal) { tmps.Printf("%d", dtd_Htotal); txc_htotal->SetValue(tmps); tmps.Printf("%.03f", ((dtd_Htotal * 1000000.0) / pixclk)); txc_thtotal->SetValue(tmps); } if (updt_vtotal) { dtd_Vtotal = (sct_vres->data + sct_vblank->data); tmps.Printf("%d", dtd_Vtotal); txc_vtotal->SetValue(tmps); tmps.Printf("%.03f", ((dtd_Htotal * 1000.0 * dtd_Vtotal) / pixclk)); txc_tvtotal->SetValue(tmps); } if (brecalc || (evtid == wxID_ANY)) DTD_Ctor_Recalc(); DTD_Ctor_ModeLine(); dtd_screen->Refresh(); } void wxEDID_Frame::evt_ntbook_page(wxAuiNotebookEvent& evt) { rcode retU; int page = evt.GetSelection(); if (page == 0) { //update edi block data grid after switching from DTD Ctor panel if ( !flags.bits.grid_blk_ok && (edigrp_sel != NULL)) { retU = UpdateDataGrid(edigrp_sel); if (!RCD_IS_OK(retU)) { GLog.DoLog("UpdateDataGrid() FAILED."); GLog.PrintRcode(retU); GLog.Show(); } //update dynamic block name if enabled if (dtd_panel->IsEnabled()) { BlkTreeUpdateGrpName(); } } edid_panel->SetFocus(); //prevent tree item from stealing focus //re-enable refreshing only when the panel is visible AuiMgrEDID->SetEvtHandlerEnabled(true); AuiMgrEDID->Update(); return; } //wxWidgets3.x, wxAUI, GTK3: BUG: the AUI managed panel gets refreshed //even if it's invisible, what causes flickering during window resizing. AuiMgrEDID->SetEvtHandlerEnabled(false); if (! dtd_panel->IsEnabled()) return; retU = DTD_Ctor_set_DTD(); if (!RCD_IS_OK(retU)) { GLog.DoLog("DTD_Ctor_set_DTD() FAILED."); GLog.PrintRcode(retU); GLog.Show(); } //push evt to refresh all the spin controls and generate X11 ModeLine value wxSpinEvent evtsp(wxEVT_COMMAND_SPINCTRL_UPDATED, wxID_ANY); ProcessEvent(evtsp); evt.Skip(true); } void wxEDID_Frame::evt_reparse(wxCommandEvent& evt) { rcode retU; retU = Reparse(); if (!RCD_IS_OK(retU)) { GLog.DoLog("Reparse() FAILED."); GLog.PrintRcode(retU); GLog.Show(); } } void wxEDID_Frame::evt_assemble_edid(wxCommandEvent& evt) { AssembleEDID_main(); } void wxEDID_Frame::evt_log_win(wxCommandEvent& evt) { GLog.ShowHide(); this->Raise(); this->SetFocus(); } void wxEDID_Frame::evt_blk_fdetails(wxCommandEvent& evt) { b_dta_grid_details = mnu_fdetails->IsChecked(); config.b_dta_grid_details = b_dta_grid_details; DataGrid_ChangeView(); } void wxEDID_Frame::evt_dyn_blk_names(wxCommandEvent& evt) { EDID.b_GrpNameDynamic = mnu_dbn->IsChecked(); config.b_blk_name_dynamic = EDID.b_GrpNameDynamic; BlkTreeSwitchDynamicNames(); } void wxEDID_Frame::evt_dtd_asp(wxCommandEvent& evt) { b_dtd_keep_aspect = mnu_dtd_aspect->IsChecked(); config.b_dtd_keep_aspect = b_dtd_keep_aspect; // mnu_dtd_aspect->Check(b_dtd_keep_aspect); if (dtd_panel->IsShown() && dtd_panel->IsEnabled()) { //don't post refresh evt if the dtd panel is not active dtd_panel->Refresh(); } } void wxEDID_Frame::evt_Quit(wxCommandEvent& evt) { Close(); } void wxEDID_Frame::evt_About(wxCommandEvent& evt) { tmps = wxString::FromAscii(wxEDID_About); tmps << wxbuildinfo(long_f); dlg::MessageBox(this, tmps, "wxEDID::About", wxART_WX_LOGO); } void wxEDID_Frame::evt_Flags(wxCommandEvent& evt) { tmps = wxString::FromAscii(Hlp_Flg_Type); dlg::MessageBox(this, tmps, "Help::Flags & Types", wxART_HELP_PAGE); } #pragma GCC diagnostic warning "-Wunused-parameter" void wxEDID_Frame::evt_Deferred(wxCommandEvent& evt) { if (evt.GetId() == wxID_OPEN) { evt_open_edid_bin(evt); return; } if (evt.GetId() == id_mnu_imphex) { evt_import_hex(evt); return; } if (evt.GetId() == id_app_layout) { AppLayout(); } } rcode wxEDID_Frame::OpenEDID() { rcode retU; wxFile file; ssize_t len; u32_t idx; u32_t idxmax; ediblk_t *pblk; GLog.DoLog("OpenEDID()"); if (! config.b_cmd_bin_file) { //menu event: open EDID binary wxFileDialog dlg_open(this, "Open EDID binary file", "", "", "Binary (*.bin)|*.bin|All (*.*)|*", wxFD_OPEN|wxFD_FILE_MUST_EXIST); //set last used path if (config.b_have_last_fpath) { wxFileName fpath(config.last_used_fpath); fpath.SetExt("bin"); tmps = fpath.GetFullPath(); dlg_open.SetPath(tmps); } if (dlg_open.ShowModal() != wxID_OK) { GLog.DoLog("OpenEDID() canceled by user."); RCD_RETURN_OK(retU); } edid_file_name = dlg_open.GetFilename(); tmps = dlg_open.GetPath(); } else { //open EDID binary file provided as cmd line arg edid_file_name = config.last_used_fname; tmps = config.cmd_open_file_path; config.b_cmd_bin_file = false; //single shot } if (! file.Open(tmps, wxFile::read) ) RCD_RETURN_FAULT(retU); //remember last used file path config.last_used_fpath = tmps; config.b_have_last_fpath = true; GLog.slog = "File opened:\n "; GLog.slog << tmps; GLog.DoLog(); RCD_SET_OK(retU); ClearAll(); EDID.Clear(); idx = EDI_BASE_IDX; idxmax = 0; pblk = EDID.getEDID()->blk; do { len = file.Read(&pblk[idx], EDI_BLK_SIZE); if (len != EDI_BLK_SIZE) { RCD_SET_FAULT(retU); GLog.slog.Printf("Failed to load EDID block[%d]: invalid size: %zd bytes", idx, len); GLog.DoLog(); } else if (! EDID.VerifyChksum(idx)) { RCD_SET_FAULT(retU); } if (idx == 0) { //only 1 extension block is currently supported (CEA) idxmax = EDID.getEDID()->edi.base.num_extblk; if (idxmax > EDI_EXT1_IDX) idxmax = EDI_EXT1_IDX; } idx++ ; } while (idx <= idxmax); flags.bits.data_loaded = 1; file.Close(); if (!RCD_IS_OK(retU)) { GLog.DoLog("OpenEDID() FAILED."); if (! EDID.b_ERR_Ignore) { return retU; } else { GLog.DoLog("Error ignored: trying to Reparse()."); } } GLog.slog.Printf("Loaded %u EDID block(s)\n", idx); GLog.DoLog(); retU = Reparse(); if (!RCD_IS_OK(retU)) { GLog.DoLog("OpenEDID()->Reparse() FAILED."); return retU; } //Auto-select BED block AutoSelectBED(); RCD_RETURN_OK(retU); } rcode wxEDID_Frame::SaveEDID() { rcode retU; u32_t dtalen; RCD_SET_OK(retU); GLog.DoLog("SaveEDID()"); retU = AssembleEDID_main(); if (!RCD_IS_OK(retU)) return retU; dtalen = (EDID.getNumValidBlocks() * EDI_BLK_SIZE); if ((dtalen == 0) || (dtalen > sizeof(edi_buf_t)) ) { RCD_RETURN_FAULT(retU); } wxFileDialog dlg_open(this, "Save EDID binary file", "", "", "Binary (*.bin)|*.bin|All (*.*)|*.*", wxFD_SAVE|wxFD_OVERWRITE_PROMPT); //set last used path if (config.b_have_last_fpath) { wxFileName fpath(config.last_used_fpath); fpath.SetExt("bin"); tmps = fpath.GetFullPath(); dlg_open.SetPath(tmps); } if (dlg_open.ShowModal() != wxID_OK) { GLog.DoLog("SaveEDID() cancelled by user."); RCD_RETURN_OK(retU); } wxFile file; tmps = dlg_open.GetPath(); if (! file.Open(tmps, wxFile::write) ) { RCD_RETURN_FAULT(retU); } //save edid_t + extensions if ( dtalen != file.Write(EDID.getEDID()->buff, dtalen) ) { RCD_SET_FAULT(retU); } file.Close(); if (! RCD_IS_OK(retU)) goto _err; GLog.slog.Printf("File saved:\n %s\n size: %u bytes", tmps, dtalen); GLog.DoLog(); //update current EDID file name edid_file_name = dlg_open.GetFilename(); config.last_used_fname = edid_file_name; config.last_used_fpath = tmps; config.b_have_last_fpath = true; BlockTree->SetItemText(BT_Root, edid_file_name); RCD_SET_OK(retU); _err: return retU; } rcode wxEDID_Frame::SaveRep_SubGrps(edi_grp_cl *pgrp, wxString& reps) { static int rcdepth = -1; rcode retU; wxString grpINDENT; u32_t tmpi; u32_t ival; u32_t typeID; edi_dynfld_t *p_field; RCD_SET_OK(retU); rcdepth++ ; if (rcdepth > 1) { //hardcoded nesting depth limit rcdepth-- ; RCD_RETURN_FAULT(retU); } //indentation based on nesting depth for (int nsub=0; nsubgetAbsOffs(), pgrp->getAbsOffs()); reps << wxLF << grpINDENT << sval << pgrp->GroupName << wxLF; //special case for: //CEA:VDB:SVD: SVD //CEA-ET :VFPD: SVR typeID = pgrp->getTypeID().t32 & (ID_CEA_MASK | ID_CEA_ET_MASK); if ( (ID_VDB == typeID) || (ID_VFPD == typeID) ) { for (u32_t sgp=0; sgpgetSubGrpCount(); sgp++ ) { u32_t mval; edi_grp_cl *subgrp; subgrp = pgrp->getSubGroup(sgp); //SVD or SVR p_field = subgrp->FieldsAr.Item(0); //VIC field or SVR sval.Printf("offs=%u (0x%04X): ", subgrp->getAbsOffs(), subgrp->getAbsOffs()); reps << wxLF << wxIDNT << sval << subgrp->GroupName << wxLF; reps << wxIDNT << wxIDNT << wxString::FromAscii(p_field->field.name); //align values: tmpi = (16 - strlen(p_field->field.name)); if (tmpi > 16) tmpi = 1; sval.Empty(); sval.Pad(tmpi, wxSP); reps << sval; //p_field value retU = (EDID.*p_field->field.handlerfn)(OP_READ, sval, ival, p_field); if (!RCD_IS_OK(retU)) break; if (ID_VDB == typeID) { ival = EDID.CEA_VDB_SVD_decode(ival, mval); } else { ival = EDID.CEA_VFPD_SVR_decode(ival, mval); //mval != 0 for DTD } sval.Empty(); sval << ival; reps << sval; //align units / vmap strings tmpi = (9 - sval.Len()); if (tmpi > 9) tmpi = 1; sval.Empty(); sval.Pad(tmpi, wxSP); reps << sval; //VIC value interpretation: if (ID_VDB == typeID) { EDID.getValDesc(sval, p_field, ival); } else { if (mval != 0) { sval.Printf("DTD number %u", mval); } else { EDID.getValDesc(sval, p_field, ival); } reps << sval << wxLF; continue; } reps << sval << wxLF; p_field = subgrp->FieldsAr.Item(1); //SVD Native flag field reps << wxIDNT << wxIDNT << wxString::FromAscii(p_field->field.name); //align values: tmpi = (16 - strlen(p_field->field.name)); if (tmpi > 16) tmpi = 1; sval.Empty(); sval.Pad(tmpi, wxSP); reps << sval; //p_field value reps << mval << wxLF; } RCD_SET_OK(retU); goto exit; } for (u32_t itf=0; itf<(pgrp->FieldsAr.GetCount()); itf++) { p_field = pgrp->FieldsAr.Item(itf); if (p_field == NULL) { RCD_SET_FAULT(retU); break; } reps << wxIDNT << grpINDENT << wxString::FromAscii(p_field->field.name); //align values: tmpi = (16 - strlen(p_field->field.name)); if (tmpi > 16) tmpi = 1; sval.Empty(); sval.Pad(tmpi, wxSP); reps << sval; //p_field value sval.Empty(); retU = (EDID.*p_field->field.handlerfn)(OP_READ, sval, ival, p_field); if (! RCD_IS_OK(retU)) break; reps << sval; //align units / vmap strings tmpi = (9 - sval.Len()); if (tmpi > 9) tmpi = 1; sval.Empty(); sval.Pad(tmpi, wxSP); reps << sval; //value interpretation (mapped) if ((p_field->field.flags & F_VS) != 0) { EDID.getValDesc(sval, p_field, ival); reps << sval; } //value unit EDID.getValUnitName(sval, p_field->field.flags); reps << sval; if ((p_field->field.flags & F_NU) != 0) reps << wxTAB << ""; reps << wxLF; } if (! RCD_IS_OK(retU)) { /* this can happen if edid field definition contains bad combination of flags and handler type */ reps << "\n< internal error! >\n"; rcdepth-- ; return retU; } //subgroups/subfields for (u32_t sgp=0; sgpgetSubGrpCount(); sgp++ ) { edi_grp_cl *subgrp; subgrp = pgrp->getSubGroup(sgp); retU = SaveRep_SubGrps(subgrp, reps); if (!RCD_IS_OK(retU)) break; } exit: rcdepth-- ; return retU; } rcode wxEDID_Frame::SaveReport() { rcode retU; wxString reps; edi_grp_cl *pgrp; RCD_SET_OK(retU); GLog.DoLog("SaveReport()"); retU = AssembleEDID_main(); if (!RCD_IS_OK(retU)) return retU; reps.Alloc(16*1024); reps = "wxEDID v"; reps << ver << "\nEDID structure and data:\nSource file: \""; reps << edid_file_name << "\""; if (EDID.getNumValidBlocks() == 0) { RCD_RETURN_FAULT(retU); } for (u32_t blk=0; blkGetCount(); for (u32_t itg=0; itgItem(itg); if (pgrp == NULL) { RCD_SET_FAULT(retU); break; } //group fields / subgroups / subfields retU = SaveRep_SubGrps(pgrp, reps); if (!RCD_IS_OK(retU)) break; } if (!RCD_IS_OK(retU)) break; } if (!RCD_IS_OK(retU)) return retU; reps << "\n----| END |----\n"; wxFileDialog dlg_open(this, "Save EDID report", "", "", "Text (*.txt)|*.txt|All (*.*)|*.*", wxFD_SAVE|wxFD_OVERWRITE_PROMPT); //set last used path if (config.b_have_last_fpath) { wxFileName fpath(config.last_used_fpath); fpath.SetExt("txt"); tmps = fpath.GetFullPath(); dlg_open.SetPath(tmps); } if (dlg_open.ShowModal() != wxID_OK) { GLog.DoLog("SaveReport() canceled by user."); RCD_RETURN_OK(retU); } wxFile file; tmps = dlg_open.GetPath(); if (! file.Open(tmps, wxFile::write) ) { RCD_RETURN_FAULT(retU); } //save EDID - no extensions if ( reps.Len() != file.Write(reps.ToAscii(), reps.Len()) ) { RCD_SET_FAULT(retU); } else { GLog.slog = "File saved:\n "; GLog.slog << tmps; GLog.DoLog(); } file.Close(); return retU; } rcode wxEDID_Frame::ExportEDID_hex() { rcode retU; wxString shex; RCD_SET_OK(retU); GLog.DoLog("ExportEDID_hex()"); uint dtalen = (EDID.getNumValidBlocks() * EDI_BLK_SIZE); if ((dtalen == 0) || (dtalen > sizeof(edi_buf_t)) ) { RCD_RETURN_FAULT(retU); } retU = AssembleEDID_main(); if (!RCD_IS_OK(retU)) return retU; wxFileDialog dlg_open(this, "Export EDID as text (hex)", "", "", "Hex ASCII (*.hex)|*.hex|All (*.*)|*.*", wxFD_SAVE|wxFD_OVERWRITE_PROMPT); //set last used path if (config.b_have_last_fpath) { wxFileName fpath(config.last_used_fpath); fpath.SetExt("hex"); tmps = fpath.GetFullPath(); dlg_open.SetPath(tmps); } if (dlg_open.ShowModal() != wxID_OK) { GLog.DoLog("ExportEDID_hex() cancelled by user."); RCD_RETURN_OK(retU); } //gen hex string shex.Alloc(1024); tmps.Empty(); u8_t *edi = reinterpret_cast (EDID.getEDID()); for (u32_t itb=0; itb (1024*4)) ) { /* reject files which are too small but also prevent importing essays :) */ GLog.DoLog("[E!] Invalid file size. Acceptable size is 256..4096 bytes."); file.Close(); RCD_RETURN_FAULT(retU); } buff8 = new char[len+1]; if (buff8 == NULL) { file.Close(); RCD_RETURN_FAULT(retU); } //read text if ( len != file.Read(buff8, len) ) { RCD_SET_FAULT(retU); } flags.bits.data_loaded = 1; //allows parsing partially loaded data file.Close(); if (!RCD_IS_OK(retU)) { delete [] buff8; return retU; } GLog.slog = "File imported:\n "; GLog.slog << tmps; GLog.DoLog(); ClearAll(); EDID.Clear(); //hex to bin itb = 0; u8_t *edi = EDID.getEDID()->buff; for (itc=0; itc '9') && (chr < 'A')) || \ ((chr > 'F') && (chr < 'a')) || (chr > 'f') ) continue; //Not UTF8, just take 2 chars in one call; tmps = wxString::FromUTF8(&buff8[itc], 2); itc++; conv_ok = tmps.ToULong(&chr, 16); if (! conv_ok) { static const char msg[] = "[E!] ImportEDID_hex() parsing file content failed @offs=%d"; wxedid_RCD_SET_FAULT_VMSG(retU, msg, (int) itc); if (! EDID.b_ERR_Ignore) { delete [] buff8; return retU; } else { GLog.PrintRcode(retU); GLog.DoLog("Error ignored: trying to Reparse()."); goto err_reparse; } } edi[itb] = static_cast (chr); if (itb == offsetof(edid_t, num_extblk)) { /*don't read extensions if they are not claimed, otherwise read until end of the buffer or file */ if (chr == 0) len = (itc+1); } if (itb > sizeof(edi_buf_t)) break; itb++ ; } err_reparse: delete [] buff8; retU = Reparse(); if (!RCD_IS_OK(retU)) { return retU; } //Auto-select BED block AutoSelectBED(); RCD_RETURN_OK(retU); } rcode wxEDID_Frame::AssembleEDID_main() { rcode retU; u32_t n_ext; u32_t n_extEDID; u32_t cksum; edi_grp_cl *p_grp; edi_dynfld_t *p_fld; GLog.DoLog("Assemble EDID:"); p_grp = EDID.EDI_BaseGrpAr.Item(0); //BED //check num of extensions p_fld = p_grp->FieldsAr.Item(8); //BED.num_extblk retU = (EDID.*p_fld->field.handlerfn)(OP_READ, tmps, n_ext, p_fld); if (!RCD_IS_OK(retU)) goto err; n_extEDID = EDID.getEDID()->edi.base.num_extblk; if (n_ext > EDI_EXT2_IDX) { RCD_SET_FAULT_MSG(retU, "Max number of supported extensions is 1"); goto err; } EDID.ForceNumValidBlocks(1+ n_ext); retU = EDID.AssembleEDID(); if (!RCD_IS_OK(retU)) goto err; retU = CalcVerifyChksum(EDI_BASE_IDX); if (!RCD_IS_OK(retU)) goto err; //Update checksum field in EDID.BASE.BED group instance cksum = EDID.getEDID()->edi.base.chksum; p_fld = p_grp->FieldsAr.Item(9); //BED.checksum field retU = (EDID.*p_fld->field.handlerfn)(OP_WRINT, tmps, cksum, p_fld); if (!RCD_IS_OK(retU)) goto err; //if EDID.BASE.BED is currently selected, refresh the BlockData grid if (p_grp == edigrp_sel) { retU = UpdateDataGrid(p_grp); if (!RCD_IS_OK(retU)) { GLog.PrintRcode(retU); GLog.Show(); } } //extensions checksums for (u32_t itb=1; itb<=n_ext; ++itb) { retU = CalcVerifyChksum(itb); if (!RCD_IS_OK(retU)) goto err; } //Log warning if num of extesions has changed: after AssembleEDID() and checksums if (n_ext != n_extEDID) { GLog.slog.Printf("WARNING: number of extensions has been changed:\n" "current value: %u, value in EDID buffer: %u", n_ext, n_extEDID); GLog.DoLog(); GLog.Show(); } if (n_ext >= EDI_EXT0_IDX) { u8_t *EDID_ext; u32_t dtd_offs; p_grp = EDID.EDI_Ext0GrpAr.Item(0); if (p_grp->getTypeID().t32 != (ID_CHD | T_GRP_FIXED)) RCD_RETURN_OK(retU); //Not a CEA extension EDID_ext = EDID.getEDID()->edi.ext0; //Update checksum in EDID.CEA.CHD group instance cksum = EDID_ext[EDI_BLK_SIZE-1]; p_fld = p_grp->FieldsAr.Item(8); //CHD.checksum field retU = (EDID.*p_fld->field.handlerfn)(OP_WRINT, tmps, cksum, p_fld); if (!RCD_IS_OK(retU)) goto err; //Update DTD_offs in EDID.CEA.CHD group instance dtd_offs = reinterpret_cast (EDID_ext)->dtd_offs; p_fld = p_grp->FieldsAr.Item(2); //CHD.DTD_offs field retU = (EDID.*p_fld->field.handlerfn)(OP_WRINT, tmps, dtd_offs, p_fld); if (!RCD_IS_OK(retU)) goto err; //if EDID.CEA.CHD is currently selected, refresh the BlockData grid if (p_grp == edigrp_sel) { retU = UpdateDataGrid(p_grp); if (!RCD_IS_OK(retU)) { GLog.PrintRcode(retU); GLog.Show(); } } } return retU; err: GLog.DoLog("[E!] Assemble EDID FAILED."); GLog.PrintRcode(retU); GLog.Show(); return retU; } rcode wxEDID_Frame::CreateBlockTree() { rcode retU; u32_t n_grp; u32_t n_subgp; wxTreeItemId trBlock; edi_grp_cl *pgrp; BlockTree->DeleteAllItems(); if (EDID.EDI_BaseGrpAr.GetCount() < 1) RCD_RETURN_FAULT(retU); BT_Root = BlockTree->AddRoot(edid_file_name); trBlock = BlockTree->AppendItem(BT_Root, "EDID: Main", -1, -1, NULL); BlockTree->Expand(BT_Root); n_grp = EDID.EDI_BaseGrpAr.GetCount(); for (u32_t itg=0; itgAppendItem(trBlock, tmps, -1, -1, pgrp); //sub groups n_subgp = pgrp->getSubGrpCount(); if (n_subgp > 0) { for (u32_t idx=0; idxgetSubGroup(idx); GetFullGroupName(subgrp, tmps); subitem = BlockTree->AppendItem(item, tmps, -1, -1, subgrp); } } } BlockTree->Expand(trBlock); n_grp = EDID.EDI_Ext0GrpAr.GetCount(); if (n_grp < 1) { RCD_RETURN_OK(retU); } trBlock = BlockTree->AppendItem(BT_Root, "EDID: CEA-861", -1, -1, NULL); for (u32_t itg=0; itgAppendItem(trBlock, tmps, -1, -1, pgrp); //sub groups n_subgp = pgrp->getSubGrpCount(); if (n_subgp > 0) { for (u32_t idx=0; idxgetSubGroup(idx); GetFullGroupName(subgrp, tmps); subitem = BlockTree->AppendItem(item, tmps, -1, -1, subgrp); } } } BlockTree->Expand(trBlock); RCD_RETURN_OK(retU); } wxTreeItemId wxEDID_Frame::BlkTreeInsGrp(wxTreeItemId trItemID, edi_grp_cl* pgrp, u32_t idx) { u32_t n_subg; GetFullGroupName(pgrp, tmps); trItemID = BlockTree->InsertItem(trItemID, idx, tmps, -1, -1, pgrp); n_subg = pgrp->getSubGrpCount(); if (n_subg == 0) return trItemID; { //insert subgroups GroupAr_cl *subg_ar; edi_grp_cl *psubg; subg_ar = pgrp->getSubGrpAr(); for (u32_t idx=0; idxItem(idx); GetFullGroupName(psubg, tmps); BlockTree->AppendItem(trItemID, tmps, -1, -1, psubg); } } return trItemID; } void wxEDID_Frame::BlkTreeDelGrp(edi_grp_cl* pgrp, bool del_subg) { //detach edi_grp_cl::wxTreeItemData before group deletion wxTreeItemId trItem; u32_t n_subg; trItem = pgrp->GetId(); n_subg = pgrp->getSubGrpCount(); if (n_subg == 0) goto del_node; { //detach subgroups GroupAr_cl *subg_ar; edi_grp_cl *psubg; wxTreeItemId subItem; subg_ar = pgrp->getSubGrpAr(); for (u32_t idx=0; idxItem(idx); subItem = psubg->GetId(); BlockTree->SetItemData(subItem, NULL); BlockTree->Delete(subItem); } } //no deletion for evt_blktr_move() and evt_blktr_cut() if (del_subg) { pgrp->delete_subg(); } del_node: BlockTree->SetItemData(trItem, NULL); BlockTree->Delete (trItem); } void wxEDID_Frame::DataGridSetColors() { static const int Rwh = 110; static const int Gwh = 150; static const int Bwh = 40; int Red; int Grn; int Blu; int avgRBG; grid_bg_color = txc_edid_info->GetBackgroundColour(); Red = grid_bg_color.Red (); Grn = grid_bg_color.Green(); Blu = grid_bg_color.Blue (); Red *= Rwh; Grn *= Gwh; Blu *= Bwh; avgRBG = Red; avgRBG += Grn; avgRBG += Blu; avgRBG /= 300; if (avgRBG > 128) { //Light Mode grid_color_bit = wxColour(0xFF, 0xFF, 0xCC); grid_color_float = wxColour(0xFF, 0xDD, 0xFF); grid_color_hex = wxColour(0xDD, 0xDD, 0xFF); grid_fg_color = wxColour(0x00, 0x00, 0x00); } else { //Dark Mode grid_color_bit = wxColour(0x51, 0x51, 0x10); grid_color_float = wxColour(0x51, 0x10, 0x51); grid_color_hex = wxColour(0x10, 0x10, 0x51); grid_fg_color = wxColour(0xFF, 0xFF, 0xFF); } } rcode wxEDID_Frame::UpdateDataGridRow(int nrow, edi_dynfld_t *p_field) { rcode retU; u32_t tmpi; static const wxString fmsg = "[E!] UpdateDataGridRow(): field '%s': failed to read value."; //p_field name tmps = wxString::FromAscii(p_field->field.name); BlkDataGrid->SetCellValue(nrow, DATGR_COL_NAME, tmps); BlkDataGrid->SetReadOnly (nrow, DATGR_COL_NAME, true); //p_field value tmps.Empty(); retU = (EDID.*p_field->field.handlerfn)(OP_READ, tmps, tmpi, p_field); if (!RCD_IS_OK(retU)) { GLog.slog.Printf(fmsg, p_field->field.name); GLog.DoLog(); GLog.PrintRcode(retU); tmps = ""; //display error in grid cell } BlkDataGrid->SetCellValue(nrow, DATGR_COL_VAL, tmps); //is read-only if (EDID.b_RD_Ignore) { BlkDataGrid->SetReadOnly(nrow, DATGR_COL_VAL, false); } else { BlkDataGrid->SetReadOnly(nrow, DATGR_COL_VAL, (p_field->field.flags & F_RD)); } //get types EDID.getValTypeName(tmps, p_field->field.flags); BlkDataGrid->SetCellValue(nrow, DATGR_COL_TYPE, tmps); BlkDataGrid->SetReadOnly (nrow, DATGR_COL_TYPE, true); //get units EDID.getValUnitName(tmps, p_field->field.flags); if (tmps.IsEmpty()) tmps = "--"; BlkDataGrid->SetCellValue(nrow, DATGR_COL_UNIT, tmps); BlkDataGrid->SetReadOnly (nrow, DATGR_COL_UNIT, true); //get flags EDID.getValFlagsAsString(tmps, p_field->field.flags); BlkDataGrid->SetCellValue(nrow, DATGR_COL_FLG, tmps); BlkDataGrid->SetReadOnly (nrow, DATGR_COL_FLG, true); //show field details if (b_dta_grid_details) { u32_t fval; //base offset fval = p_field->field.offs; tmps.Empty(); tmps << fval; BlkDataGrid->SetCellValue(nrow, DATGR_COL_OFFS, tmps); BlkDataGrid->SetReadOnly (nrow, DATGR_COL_OFFS, true); //field offset in bits/bytes fval = p_field->field.shift; tmps.Empty(); tmps << fval; BlkDataGrid->SetCellValue(nrow, DATGR_COL_SHIFT, tmps); BlkDataGrid->SetReadOnly (nrow, DATGR_COL_SHIFT, true); //field size in bits/bytes fval = p_field->field.fld_sz; tmps.Empty(); tmps << fval; BlkDataGrid->SetCellValue(nrow, DATGR_COL_FSZ, tmps); BlkDataGrid->SetReadOnly (nrow, DATGR_COL_FSZ, true); } //set row color for type RCD_SET_OK(retU); wxGridCellAttr *RowAttr = BlkDataGrid->GetOrCreateCellAttr(nrow, DATGR_COL_NAME); RowAttr->SetTextColour(*wxBLACK); { __label__ set_bgcol; u32_t fflags; wxColour *rowColour; fflags = p_field->field.flags; if (fflags & F_FLT) { rowColour = &grid_color_float; goto set_bgcol; } if (fflags & F_HEX) { rowColour = &grid_color_hex; goto set_bgcol; } if (fflags & F_BIT) { rowColour = &grid_color_bit; goto set_bgcol; } goto def_color; set_bgcol: RowAttr->SetBackgroundColour(*rowColour); goto exit; } def_color: RowAttr->SetBackgroundColour(grid_bg_color); exit: RowAttr->SetTextColour (grid_fg_color); BlkDataGrid->SetRowAttr(nrow, RowAttr); return retU; } rcode wxEDID_Frame::UpdateDataGrid(edi_grp_cl* pgrp) { rcode retU; int NumR; int nGrpF; int itf; if (pgrp == NULL) RCD_RETURN_FAULT(retU); NumR = BlkDataGrid->GetNumberRows(); nGrpF = pgrp->FieldsAr.GetCount(); if (NumR < nGrpF) { BlkDataGrid->AppendRows(nGrpF-NumR); } else if (NumR > nGrpF) { NumR -= nGrpF; BlkDataGrid->DeleteRows((nGrpF-1), NumR); } for (itf=0; itfFieldsAr.Item(itf); if (field == NULL) RCD_RETURN_FAULT(retU); retU = UpdateDataGridRow(itf, field); } BlkDataGrid->AutoSizeColumns(false); BlkDataGrid->AutoSizeRows(false); BlkDataGrid->SetRowLabelSize(wxGRID_AUTOSIZE); BlkDataGrid->FitInside(); flags.bits.grid_blk_ok = 1; RCD_RETURN_OK(retU); } void wxEDID_Frame::DataGrid_ChangeView() { rcode retU; u32_t ncol; ncol = BlkDataGrid->GetNumberCols(); if (b_dta_grid_details) { if (ncol == DATGR_NCOL_2) return; BlkDataGrid->AppendCols(DATGR_NCOL_DIFF); BlkDataGrid->SetColLabelValue(DATGR_COL_OFFS , "offs" ); BlkDataGrid->SetColLabelValue(DATGR_COL_SHIFT, "shift"); BlkDataGrid->SetColLabelValue(DATGR_COL_FSZ , "size" ); if (! BlkDataGrid->IsEnabled()) return; retU = UpdateDataGrid(edigrp_sel); if (!RCD_IS_OK(retU)) { GLog.PrintRcode(retU); GLog.Show(); } } else { if (ncol == DATGR_NCOL_1) return; BlkDataGrid->DeleteCols(DATGR_NCOL_1, DATGR_NCOL_DIFF); } } rcode wxEDID_Frame::SetFieldDesc(int row) { rcode retU; const char *fdesc; RCD_SET_OK(retU); //show field description if (edigrp_sel != NULL) { edi_dynfld_t *p_field = edigrp_sel->FieldsAr.Item(row); if (p_field == NULL) { RCD_SET_FAULT_MSG(retU, "[E!] SetFieldDesc()"); GLog.PrintRcode(retU); return retU; } if (p_field->field.flags & F_GD) { txc_edid_info->SetValue(edigrp_sel->GroupDesc); } else { fdesc = p_field->field.desc; if (fdesc != NULL) { sval = wxString::FromUTF8(fdesc); } else { sval = wxString::FromUTF8(p_field->field.name); } txc_edid_info->SetValue(sval); } } return retU; } void wxEDID_Frame::DTD_Ctor_Layout() { wxSize dtd_sz; wxSize wsz; bs_dtd_main->Layout(); wsz = fgs_dtd->GetSize(); dtd_sz.y = wsz.y; dtd_sz.y -= fgs_dtd_top->ComputeFittingClientSize(dtd_screen).y; dtd_sz.y -= fgs_dtd_bottom->ComputeFittingClientSize(dtd_screen).y; dtd_sz.x = wsz.x; dtd_sz.x -= fgs_dtd_right->ComputeFittingClientSize(dtd_screen).x; dtd_sz.DecBy(10, 16); //borders dtd_screen->SetMinSize(dtd_sz); bs_dtd_main->Layout(); } rcode wxEDID_Frame::DTD_Ctor_ModeLine() { rcode retU; float PixClk; int tmpi; //pix clk tmp PixClk = sct_pixclk->data; PixClk *= dtd_pclk_factor; PixClk /= 1000000.0; sval.Printf("%.02f", PixClk); tmpi = sct_xres->data; tmps.Printf("\"%dx%dx", tmpi, sct_vres->data); tmps << txc_vrefresh->GetValue() << "\" "; tmps << sval; //xres tmps << wxSP << tmpi << wxSP; //hsoffs - front porch tmpi += sct_hsoffs->data; tmps << tmpi << wxSP; //hsync width tmpi += sct_hswidth->data; tmps << tmpi << wxSP; //hsync end - back porch tmps << txc_htotal->GetValue() << wxSP; //vres tmpi = sct_vres->data; tmps << tmpi << wxSP; //vsync - front porch tmpi += sct_vsoffs->data; tmps << tmpi << wxSP; //vsync width tmpi += sct_vswidth->data; tmps << tmpi << wxSP; //vsync - back porch tmps << txc_vtotal->GetValue(); txc_modeline->SetValue(tmps); RCD_RETURN_OK(retU); } rcode wxEDID_Frame::DTD_Ctor_WriteInt(dtd_sct_cl& sct) { static const wxString fmsg = "FAULT: DTD_Ctor_WriteInt()"; static wxString s_oldv; rcode retU, retU2; uint val; wxString sval; edi_dynfld_t *p_field = sct.field; if (p_field == NULL) { RCD_SET_FAULT(retU); GLog.DoLog(fmsg); GLog.PrintRcode(retU); return retU; } //read old value s_oldv.Empty(); retU = (EDID.*p_field->field.handlerfn)(OP_READ, s_oldv, val, p_field); if (! RCD_IS_OK(retU)) { GLog.PrintRcode(retU); GLog.Show(); return retU; } val = sct.data; GetFullGroupName(edigrp_sel, tmps); tmps << ", " << win_stat_bar->GetStatusText(SBAR_GRPOFFS) << wxLF; tmps << "field changed: " << wxString::FromAscii(p_field->field.name); tmps << ", old value: " << s_oldv; sval.Empty(); retU = (EDID.*p_field->field.handlerfn)(OP_WRINT, sval, val, p_field); if (!RCD_IS_OK(retU)) { GLog.DoLog(fmsg); GLog.PrintRcode(retU); } tmps << "\nnew value: " << val; //re-read p_field -> immediately check the value/revert to last correct value sval.Empty(); retU2 = (EDID.*p_field->field.handlerfn)(OP_READ, sval, val, p_field); if (!RCD_IS_OK(retU2)) { GLog.DoLog(fmsg); GLog.PrintRcode(retU2); } sct.SetValue(val); tmps << ", verified value: " << val << wxLF; GLog.DoLog(tmps); if (!RCD_IS_OK(retU)) { GLog.DoLog(fmsg); GLog.PrintRcode(retU); } return retU; } rcode wxEDID_Frame::DTD_Ctor_Recalc() { rcode retU; float line_w, pixclk, lineT, n_lines, frameT; line_w = (sct_hblank->data + sct_xres->data); pixclk = (sct_pixclk->data * dtd_pclk_factor); lineT = (line_w / pixclk); n_lines = (sct_vblank->data + sct_vres->data); frameT = (n_lines * lineT); tmps.Printf("%.02f", (1.0/frameT)); //Hz txc_vrefresh->SetValue(tmps); tmps.Printf("%.02f", ((1.0/lineT)/1000.0)); //kHz txc_hfreq->SetValue(tmps); RCD_RETURN_OK(retU); } rcode wxEDID_Frame::DTD_Ctor_read_field(dtd_sct_cl* sct, const edi_grp_cl* group, u32_t idx_field) { rcode retU; uint val; edi_dynfld_t *p_field; tmps.Empty(); p_field = group->FieldsAr.Item(idx_field); if (p_field == NULL) RCD_RETURN_FAULT(retU); retU = (EDID.*p_field->field.handlerfn)(OP_READ, tmps, val, p_field); if (! RCD_IS_OK(retU)) { GLog.DoLog("DTD_Ctor_read_field() FAILED."); GLog.PrintRcode(retU); } sct->SetRange(p_field->field.minv, p_field->field.maxv); sct->SetValue(val); sct->field = p_field; sct->data = val; return retU; } rcode wxEDID_Frame::DTD_Ctor_set_DTD() { rcode retU; gtid_t tid; edi_grp_cl* grp; bool enb_border; enb_border = false; grp = edigrp_sel; if (edigrp_sel == NULL) RCD_RETURN_FAULT(retU); //Show descriptor type sct_desc_type->SetLabel(grp->GroupName); tid = grp->getTypeID(); if (ID_DTD == (tid.t32 & ID_EDID_MASK)) { enb_border = true; dtd_pclk_factor = 10000; sct_pclk_factor->SetLabel("x10kHz"); if (! RCD_IS_OK( DTD_Ctor_read_field(sct_pixclk , grp, DTD_IDX_PIXCLK ) ) ) RCD_RETURN_FAULT(retU); if (! RCD_IS_OK( DTD_Ctor_read_field(sct_xres , grp, DTD_IDX_HAPIX ) ) ) RCD_RETURN_FAULT(retU); if (! RCD_IS_OK( DTD_Ctor_read_field(sct_hblank , grp, DTD_IDX_HBPIX ) ) ) RCD_RETURN_FAULT(retU); if (! RCD_IS_OK( DTD_Ctor_read_field(sct_vres , grp, DTD_IDX_VALIN ) ) ) RCD_RETURN_FAULT(retU); if (! RCD_IS_OK( DTD_Ctor_read_field(sct_vblank , grp, DTD_IDX_VBLIN ) ) ) RCD_RETURN_FAULT(retU); if (! RCD_IS_OK( DTD_Ctor_read_field(sct_hsoffs , grp, DTD_IDX_HSOFFS ) ) ) RCD_RETURN_FAULT(retU); if (! RCD_IS_OK( DTD_Ctor_read_field(sct_hswidth, grp, DTD_IDX_HSWIDTH) ) ) RCD_RETURN_FAULT(retU); if (! RCD_IS_OK( DTD_Ctor_read_field(sct_vsoffs , grp, DTD_IDX_VSOFFS ) ) ) RCD_RETURN_FAULT(retU); if (! RCD_IS_OK( DTD_Ctor_read_field(sct_vswidth, grp, DTD_IDX_VSWIDTH) ) ) RCD_RETURN_FAULT(retU); if (! RCD_IS_OK( DTD_Ctor_read_field(sct_hborder, grp, DTD_IDX_HBORD ) ) ) RCD_RETURN_FAULT(retU); if (! RCD_IS_OK( DTD_Ctor_read_field(sct_vborder, grp, DTD_IDX_VBORD ) ) ) RCD_RETURN_FAULT(retU); //Set min. pix_clk value to 1: pix_clk==0 changes descriptor type sct_pixclk->SetRange(1, 0xFFFF); } else if (ID_T7VTDB == (tid.t32 & ID_CEA_ET_MASK)) { dtd_pclk_factor = 1000; sct_pclk_factor->SetLabel("x1kHz"); //T7VTDB has no border lines sct_hborder->Enable (false); sct_hborder->SetValue(0); sct_vborder->Enable (false); sct_vborder->SetValue(0); if (! RCD_IS_OK( DTD_Ctor_read_field(sct_pixclk , grp, T7F_IDX_PIXCLK ) ) ) RCD_RETURN_FAULT(retU); if (! RCD_IS_OK( DTD_Ctor_read_field(sct_xres , grp, T7F_IDX_HAPIX ) ) ) RCD_RETURN_FAULT(retU); if (! RCD_IS_OK( DTD_Ctor_read_field(sct_hblank , grp, T7F_IDX_HBPIX ) ) ) RCD_RETURN_FAULT(retU); if (! RCD_IS_OK( DTD_Ctor_read_field(sct_vres , grp, T7F_IDX_VALIN ) ) ) RCD_RETURN_FAULT(retU); if (! RCD_IS_OK( DTD_Ctor_read_field(sct_vblank , grp, T7F_IDX_VBLIN ) ) ) RCD_RETURN_FAULT(retU); if (! RCD_IS_OK( DTD_Ctor_read_field(sct_hsoffs , grp, T7F_IDX_HSOFFS ) ) ) RCD_RETURN_FAULT(retU); if (! RCD_IS_OK( DTD_Ctor_read_field(sct_hswidth, grp, T7F_IDX_HSWIDTH) ) ) RCD_RETURN_FAULT(retU); if (! RCD_IS_OK( DTD_Ctor_read_field(sct_vsoffs , grp, T7F_IDX_VSOFFS ) ) ) RCD_RETURN_FAULT(retU); if (! RCD_IS_OK( DTD_Ctor_read_field(sct_vswidth, grp, T7F_IDX_VSWIDTH) ) ) RCD_RETURN_FAULT(retU); sct_pixclk->SetRange(1, 0xFFFFFF); //force min clk to 1kHz in constructor } else RCD_RETURN_FAULT(retU); txt_hborder ->Enable(enb_border); txt_hbpix ->Enable(enb_border); sct_hborder ->Enable(enb_border); txt_vborder ->Enable(enb_border); txt_vb_lines->Enable(enb_border); sct_vborder ->Enable(enb_border); DTD_Ctor_Layout(); retU = DTD_Ctor_Recalc(); return retU; } rcode wxEDID_Frame::Reparse() { rcode retU; rcode retU2; bool err_ignore; u32_t n_extblk; GLog.DoLog("Reparse()"); RCD_SET_OK(retU2); ntbook->SetSelection(0); //go to tree view if (edigrp_src != NULL) delete edigrp_src; edigrp_src = NULL; edigrp_sel = NULL; err_ignore = EDID.b_ERR_Ignore; dtd_panel->Enable(false); BlkDataGrid->Enable(false); ClearAll(false); //do not clear BlockTree & BlkGrid retU = VerifyChksum(EDI_BASE_IDX); if (!RCD_IS_OK(retU)) { if (! err_ignore) return retU; retU2 = retU; } retU = EDID.ParseEDID_Base(n_extblk); if (!RCD_IS_OK(retU)) { if (! err_ignore) return retU; retU2 = retU; } if (n_extblk > 0) { retU = VerifyChksum(EDI_EXT0_IDX); if (!RCD_IS_OK(retU)) { if (! err_ignore) return retU; retU2 = retU; } retU = EDID.ParseEDID_CEA(); if (!RCD_IS_OK(retU)) { if (err_ignore) { EDID.ForceNumValidBlocks(2); retU2 = retU; } else return retU; } } retU = CreateBlockTree(); if (!RCD_IS_OK(retU)) return retU; EnableControl(true); if (!RCD_IS_OK(retU2)) return retU2; //Auto-select BED block AutoSelectBED(); RCD_RETURN_OK(retU); } void wxEDID_Frame::ClearAll(bool b_clrBlocks) { EDID.EDI_BaseGrpAr.Empty(); EDID.EDI_Ext0GrpAr.Empty(); EDID.EDI_Ext1GrpAr.Empty(); EDID.EDI_Ext2GrpAr.Empty(); if (edigrp_src != NULL) delete edigrp_src; edigrp_src = NULL; if (miInfoNOK != mnu_BlkTree->FindItemByPosition(0)) { miRemoved = mnu_BlkTree->Remove(id_mnu_info); mnu_BlkTree->Insert(0, miInfoNOK); mnu_BlkTree->SetLabel(id_mnu_info, ""); } if (b_clrBlocks) { BlkDataGrid->ClearGrid(); BlockTree->DeleteAllItems(); } BlkDataGrid->Enable(false); EnableControl (false); txc_edid_info->Clear(); tmps.Empty(); win_stat_bar->SetStatusText(tmps, SBAR_GRPOFFS); } void wxEDID_Frame::EnableControl(bool enb) { mnu_save_edi ->Enable(enb); mnu_exphex ->Enable(enb); mnu_save_text->Enable(enb); flags.bits.ctrl_enabled = enb; } rcode wxEDID_Frame::VerifyChksum(uint block) { rcode retU; wxString schksum; schksum.Printf("0x%02X", EDID.getEDID()->blk[block][offsetof(edid_t, chksum)]); tmps.Printf("EDID block %u checksum= ", block); tmps << schksum; if (EDID.VerifyChksum(block)) { tmps << " OK"; RCD_SET_OK(retU); } else { tmps << " BAD!"; RCD_SET_FAULT(retU); } GLog.DoLog(tmps); return retU; } rcode wxEDID_Frame::CalcVerifyChksum(uint block) { rcode retU; tmps.Printf("EDID block %u checksum= 0x%02X ", block, EDID.genChksum(block)); if (EDID.VerifyChksum(block)) { tmps << "OK"; RCD_SET_OK(retU); } else { tmps << "BAD!"; RCD_SET_FAULT(retU); } GLog.DoLog(tmps); return retU; } rcode wxEDID_Frame::WriteField() { //Call field handler(write), then re-read the value to verify it wxString s_oldv; edi_dynfld_t *p_field; rcode retU, retU2; u32_t tmpi; u32_t u_oldv; bool b_len_chg = false; bool b_tag_chg = false; if ( (row_op >= (int) edigrp_sel->FieldsAr.GetCount()) || (row_op < 0) ) { RCD_RETURN_FAULT(retU); } p_field = edigrp_sel->FieldsAr.Item(row_op); if (p_field == NULL) { RCD_RETURN_FAULT(retU); } //read old value s_oldv.Empty(); retU = (EDID.*p_field->field.handlerfn)(OP_READ, s_oldv, u_oldv, p_field); if (! RCD_IS_OK(retU)) { GLog.PrintRcode(retU); GLog.Show(); return retU; } //write new value sval = edigrp_sel->CodeName; sval << ", " << win_stat_bar->GetStatusText(SBAR_GRPOFFS) << wxLF; sval << "field changed: " << wxString::FromAscii(p_field->field.name); sval << ", old value: " << s_oldv; tmps = BlkDataGrid->GetCellValue(row_op, DATGR_COL_VAL); sval << "\nnew value: " << tmps; retU2 = (EDID.*p_field->field.handlerfn)(OP_WRSTR, tmps, tmpi, p_field); if (! RCD_IS_OK(retU2)) { //print error code, but continue: re-reading will revert the field value GLog.PrintRcode(retU2); } //re-read field -> immediately check the value/revert to last correct value tmps.Empty(); retU = (EDID.*p_field->field.handlerfn)(OP_READ, tmps, tmpi, p_field); if (! RCD_IS_OK(retU)) { GLog.PrintRcode(retU); } BlkDataGrid->SetCellValue(row_op, DATGR_COL_VAL, tmps); sval << ", verified value: " << tmps; GLog.DoLog(sval); //F_DN flag: update dynamic block name if ((p_field->field.flags & F_DN) != 0) { BlkTreeUpdateGrpName(); } //special case: DBC block Tag Code change: if (p_field->field.handlerfn == &EDID_cl::CEA_DBC_Tag) { b_tag_chg = true; } else //special case: DBC block Extended Tag Code change: if (p_field->field.handlerfn == &EDID_cl::CEA_DBC_ExTag) { b_tag_chg = true; } else //special case: DBC block length change: if (p_field->field.handlerfn == &EDID_cl::CEA_DBC_Len) { GroupAr_cl *grp_ar; i32_t blk_free; long new_len; grp_ar = edigrp_sel->getParentAr(); blk_free = grp_ar->getFreeSpace(); tmps.ToLong(&new_len); new_len -= u_oldv; if (new_len > blk_free) { tmps.Empty(); tmps << tmpi; BlkDataGrid->SetCellValue(row_op, DATGR_COL_VAL, s_oldv); //restore last value retU = (EDID.*p_field->field.handlerfn)(OP_WRINT, s_oldv, u_oldv, p_field); if (!RCD_IS_OK(retU)) { GLog.PrintRcode(retU); } GLog.slog.Printf("[E!] DBC block length change: +%d, free: %d\n", (int) new_len, blk_free); GLog.DoLog(); GLog.Show(); RCD_RETURN_OK(retU); } b_len_chg = true; } //re-init the group if (RCD_IS_TRUE(retU2)) { if (b_tag_chg) { bool dbc_type = true; retU = BlkTreeChangeGrpType(dbc_type); //spawn new group after tag code change if (!RCD_IS_OK(retU)) { //restore last value BlkDataGrid->SetCellValue(row_op, DATGR_COL_VAL, s_oldv); retU = (EDID.*p_field->field.handlerfn)(OP_WRINT, s_oldv, u_oldv, p_field); } return retU; } if (b_len_chg) { BlkTreeUpdateGrp(); //update after DBC block length change RCD_RETURN_OK(retU); } else { u32_t gp_type; gp_type = edigrp_sel->getTypeID().t32; gp_type &= ID_EDID_MASK; //Change Alt. Descriptor type if ((gp_type >= ID_UNK) && (gp_type <= ID_DTD)) { bool dbc_type = false; retU = BlkTreeChangeGrpType(dbc_type); return retU; } RCD_RETURN_OK(retU); } } //changing field value can lead to change in data structure, //check the F_FR flag (forced refresh). if ((F_FR & p_field->field.flags) != 0) { flags.bits.grp_refresh = 1; //re-parse group data, possibly changing the layout retU = edigrp_sel->ForcedGrpRefresh(); } else //F_INIT: forced re-initialization of the group if ((F_INIT & p_field->field.flags) != 0) { gtid_t type_id; type_id = edigrp_sel->getTypeID(); if (type_id.t_sub_gp) { if (edigrp_sel->getParentGrp() != NULL) { //remember sub-group selection subg_idx = edigrp_sel->getParentArIdx(); //select parent group edigrp_sel = edigrp_sel->getParentGrp(); BT_Iparent = BlockTree->GetItemParent(edigrp_sel->GetId()); } BlkTreeUpdateGrp(); } else //DBC-ET top level: re-init whole group if (type_id.t32 & ID_CEA_ET_MASK) { BlkTreeUpdateGrp(); RCD_SET_OK(retU); } } return retU; } void wxEDID_Frame::GetFullGroupName(edi_grp_cl* pgrp, wxString& grp_name) { sval.Empty(); pgrp->getGrpName(EDID, sval); //dynamic group names grp_name = pgrp->CodeName; grp_name << ": "; grp_name << sval; }; void wxEDID_Frame::LogGroupOP(edi_grp_cl* pgrp, const wxString& opName) { GLog.slog.Printf("%s: %s, Offs: Abs=%u, Rel=%u", opName, pgrp->CodeName, pgrp->getAbsOffs(), pgrp->getRelOffs() ); GLog.DoLog(); }; void wxEDID_Frame::InitBlkTreeMenu() { bmpUp = wxArtProvider::GetBitmap(wxART_GO_UP , wxART_MENU); bmpDn = wxArtProvider::GetBitmap(wxART_GO_DOWN , wxART_MENU); bmpIn = wxArtProvider::GetBitmap(wxART_GO_FORWARD, wxART_MENU); bmpNOK = wxArtProvider::GetBitmap(wxART_WARNING , wxART_MENU); mnu_BlkTree = new wxMenu(); mnu_SubInfo = new wxMenu(); { wxMenuItem *miDelete; wxMenuItem *miInsUp; wxMenuItem *miInsIn; wxMenuItem *miInsDn; wxMenuItem *miMovUp; wxMenuItem *miMovDn; accDelete = new wxAcceleratorEntry(wxACCEL_NORMAL, WXK_DELETE); accMoveUp = new wxAcceleratorEntry(wxACCEL_CTRL , WXK_UP ); accMoveDn = new wxAcceleratorEntry(wxACCEL_CTRL , WXK_DOWN ); miInfoNOK = new wxMenuItem(NULL, id_mnu_info , " " , wxEmptyString, wxITEM_NORMAL); miInfoOK = new wxMenuItem(NULL, id_mnu_info , " " , wxEmptyString, wxITEM_NORMAL); miSubInfo = new wxMenuItem(NULL, id_mnu_info , "sub info" , wxEmptyString, wxITEM_NORMAL); miRemoved = miInfoOK; miInsUp = new wxMenuItem(NULL, id_mnu_ins_up, "Insert above", wxEmptyString, wxITEM_NORMAL); miInsIn = new wxMenuItem(NULL, id_mnu_ins_in, "Insert into" , wxEmptyString, wxITEM_NORMAL); miInsDn = new wxMenuItem(NULL, id_mnu_ins_dn, "Insert below", wxEmptyString, wxITEM_NORMAL); miMovUp = new wxMenuItem(NULL, wxID_UP , "Move Up" , wxEmptyString, wxITEM_NORMAL); miMovDn = new wxMenuItem(NULL, wxID_DOWN , "Move Down" , wxEmptyString, wxITEM_NORMAL); miDelete = new wxMenuItem(NULL, wxID_DELETE , "Delete" , wxEmptyString, wxITEM_NORMAL); miInfoNOK->SetBitmap(bmpNOK); miInsUp ->SetBitmap(bmpUp ); miInsIn ->SetBitmap(bmpIn ); miInsDn ->SetBitmap(bmpDn ); miDelete->SetAccel(accDelete); miMovUp ->SetAccel(accMoveUp); miMovDn ->SetAccel(accMoveDn); mnu_SubInfo->Append(miSubInfo); miInfoNOK ->SetSubMenu(mnu_SubInfo); mnu_BlkTree->Append (miInfoNOK); //evt_blktr_rmb: group info mnu_BlkTree->InsertSeparator(1); mnu_BlkTree->Append (wxID_EXECUTE, "Reparse Group"); mnu_BlkTree->Append (wxID_COPY , "Copy" ); mnu_BlkTree->Append (wxID_PASTE , "Paste" ); mnu_BlkTree->Append (miDelete); mnu_BlkTree->Append (wxID_CUT , "Cut" ); mnu_BlkTree->Append (miInsUp); mnu_BlkTree->Append (miInsIn); mnu_BlkTree->Append (miInsDn); mnu_BlkTree->InsertSeparator(10); mnu_BlkTree->Append (miMovUp); mnu_BlkTree->Append (miMovDn); } } void wxEDID_Frame::AppLayout() { wxPoint wpos; wxSize wsz; wxRect dspsz; bool b_AUI_ok; wpos = config.win_pos; wsz = config.win_size; dspsz = wxDisplay(wxDisplay::GetFromWindow(this)).GetClientArea(); { wxSize wmin = GetMinSize(); if (wsz.x < wmin.x) wsz.x = wmin.x; if (wsz.y < wmin.y) wsz.y = wmin.y; } if (wsz.x > dspsz.width ) wsz.x = dspsz.width; if (wsz.y > dspsz.height) wsz.y = dspsz.height; if ((wpos.x >= 0) && (wpos.y >= 0)) { if ((wpos.x + wsz.x) > dspsz.width ) wpos.x = dspsz.width - wsz.x; if ((wpos.y + wsz.y) > dspsz.height) wpos.y = dspsz.height - wsz.y; SetPosition(wpos); } SetSize(wsz); BlkDataGrid->AutoSizeColumns(false); BlkDataGrid->AutoSizeRows(false); BlkDataGrid->SetRowLabelSize(wxGRID_AUTOSIZE); //The wxAuiManager::LoadPerspective() can return true even if //the layout data is invalid/malformed, generating broken UI. //Manual editing of the cfg file is a bad idea, because only //critical errors can be catch here. b_AUI_ok = AuiMgrEDID->LoadPerspective(config.aui_layout); if (! b_AUI_ok) { tmps = wxString::FromAscii(AUI_DefLayout); AuiMgrEDID->LoadPerspective(tmps); } } wxBEGIN_EVENT_TABLE(blktree_cl, wxTreeCtrl) EVT_KEY_UP (blktree_cl::evt_key ) EVT_KEY_DOWN (blktree_cl::evt_key ) EVT_LEFT_DOWN (blktree_cl::evt_Lmouse_down) EVT_LEFT_DCLICK(blktree_cl::evt_Lmouse_dclick) wxEND_EVENT_TABLE() void blktree_cl::evt_key(wxKeyEvent& evt) { wxEventType evtype = evt.GetEventType(); if (wxEVT_KEY_UP == evtype) { b_key_block = false; keycode = 0; return; } { // block key-down evt repetition, except arrows bool b_arrow; int newkcode = evt.GetKeyCode(); b_arrow = (newkcode == WXK_UP ); b_arrow |= (newkcode == WXK_NUMPAD_UP); b_arrow |= (newkcode == WXK_DOWN); b_arrow |= (newkcode == WXK_NUMPAD_DOWN); b_arrow &= !evt.ControlDown(); b_key_block = !b_arrow; b_key_block &= (newkcode == keycode ); keycode = newkcode; if (b_key_block) return; } evt.Skip(true); } void blktree_cl::evt_Lmouse_down(wxMouseEvent &evt) { const wxPoint hit_pos = evt.GetPosition(); int mode = wxTREE_HITTEST_ONITEMLABEL; wxTreeItemId ItemID = HitTest(hit_pos, mode); if (ItemID.IsOk()) { //send only for selected items: display group decription again if (! IsSelected(ItemID)) { evt.Skip(true); return; } wxTreeEvent tevt(wxEVT_TREE_SEL_CHANGED); tevt.SetItem(ItemID ); tevt.SetId (GetId()); tevt.SetClientData((void*) (intptr_t) BLKTR_RESEL_EVT); GetParent()->GetEventHandler()->AddPendingEvent(tevt); } evt.Skip(true); } void blktree_cl::evt_Lmouse_dclick(wxMouseEvent &evt) { const wxPoint hit_pos = evt.GetPosition(); int mode = wxTREE_HITTEST_ONITEMLABEL; wxTreeItemId ItemID = HitTest(hit_pos, mode); if (! ItemID.IsOk()) return; //sending only KEY_DOWN events -> reset keycode, prevent b_key_block keycode = 0; wxKeyEvent kevt(wxEVT_KEY_DOWN); kevt.m_keyCode = WXK_RETURN; kevt.SetId(GetId()); AddPendingEvent(kevt); evt.Skip(); //pass dclick for expanding/collapsing items } wxBEGIN_EVENT_TABLE(fgrid_cl, wxGrid) EVT_MENU (wxID_ANY, fgrid_cl::evt_dgrid_vmnu) wxEND_EVENT_TABLE() void fgrid_cl::evt_dgrid_vmnu(wxCommandEvent& evt) { rcode retU; u32_t flags; u32_t vmap_idx; int row; if (NULL == evt_field) return; //should never happen, ignore evt HideCellEditControl(); row = GetGridCursorRow(); flags = evt_field->flags; vmap_idx = evt_field->vmap_idx; evt_field = NULL; retU = vmap_GetValueAsString(vmap_idx, VMAP_MID, evt.GetId(), flags, tmps); if (! RCD_IS_TRUE(retU)) { pwin->GLog.PrintRcode(retU); pwin->GLog.Show(); return; } SetCellValue(row, DATGR_COL_VAL, tmps); wxGridEvent evtgr(wxID_ANY, wxEVT_GRID_CELL_CHANGED, NULL, row, DATGR_COL_VAL); AddPendingEvent(evtgr); } wxBEGIN_EVENT_TABLE( dtd_screen_cl, wxPanel ) EVT_PAINT ( dtd_screen_cl::evt_paint ) wxEND_EVENT_TABLE() void dtd_screen_cl::scr_aspect_ratio(wxSize& dcsize, wxPaintDC& dc) { float faspHV; bool b_scaling_to_dc_Y; { wxSize HVtotal; float faspDC; HVtotal.x = pwin->dtd_Htotal; HVtotal.y = pwin->dtd_Vtotal; //check DC aspect ratio faspDC = dcsize.x; faspDC /= dcsize.y; faspHV = HVtotal.x; faspHV /= HVtotal.y; b_scaling_to_dc_Y = (faspDC > faspHV); } { //DC clipping & scaling wxSize szClip; wxPoint dcXY(0, 0); if (b_scaling_to_dc_Y) { szClip.y = dcsize.y; szClip.x = dcsize.y; szClip.x *= faspHV; dcXY.x = dcsize.x; dcXY.x -= szClip.x; dcXY.x >>= 1; } else { //scaling to dc X-axis szClip.x = dcsize.x; szClip.y = dcsize.x; szClip.y /= faspHV; dcXY.y = dcsize.y; dcXY.y -= szClip.y; dcXY.y >>= 1; } dcsize = szClip; dc.SetDeviceOrigin(dcXY.x, dcXY.y); } } rcode dtd_screen_cl::calc_coords(wxSize& dcsize) { rcode retU; float ftmpA, ftmpB, fltDCsize, scale_base; if (pwin == NULL) RCD_RETURN_FAULT(retU); //V-sync pulse bar (top edge) rcVsync.x = 0; rcVsync.y = 0; rcVsync.width = dcsize.x; fltDCsize = dcsize.y; scale_base = (pwin->sct_vblank->data + pwin->sct_vres->data); if (scale_base == 0) RCD_RETURN_FAULT(retU); ftmpA = pwin->sct_vswidth->data; ftmpB = (ftmpA*fltDCsize)/scale_base; rcVsync.height = ftmpB; if (rcVsync.height == 0) rcVsync.height = 1; //Screen Area Y-coords rcScreen // Y ftmpA = (pwin->sct_vblank->data - pwin->sct_vsoffs->data); ftmpB = (ftmpA*fltDCsize)/scale_base; rcScreen.y = ftmpB; // Height ftmpA = pwin->sct_vres->data; ftmpB = (ftmpA*fltDCsize)/scale_base; rcScreen.height = ftmpB; //borders szVborder.y = 0; if (pwin->sct_vborder->data != 0) { ftmpA = pwin->sct_vborder->data; ftmpB = (ftmpA*fltDCsize)/scale_base; szVborder.y = ftmpB; if (szVborder.y == 0) szVborder.y = 1; } szHborder.y = rcScreen.height; //H-sync pulse bar (vertical, left edge) rcHsync.x = 0; rcHsync.y = rcVsync.height; rcHsync.height = (dcsize.y-rcVsync.height); fltDCsize = dcsize.x; scale_base = (pwin->sct_hblank->data + pwin->sct_xres->data); if (scale_base == 0) RCD_RETURN_FAULT(retU); ftmpA = pwin->sct_hswidth->data; ftmpB = (ftmpA*fltDCsize)/scale_base; rcHsync.width = ftmpB; if (rcHsync.width == 0) rcHsync.width = 1; //Screen Area X-coords rcScreen // X ftmpA = (pwin->sct_hblank->data - pwin->sct_hsoffs->data); ftmpB = (ftmpA*fltDCsize)/scale_base; rcScreen.x = ftmpB; // Width ftmpA = pwin->sct_xres->data; ftmpB = (ftmpA*fltDCsize)/scale_base; rcScreen.width = ftmpB; //borders szHborder.x = 0; if (pwin->sct_hborder->data != 0) { ftmpA = pwin->sct_hborder->data; ftmpB = (ftmpA*fltDCsize)/scale_base; szHborder.x = ftmpB; if (szHborder.x == 0) szHborder.x = 1; } szVborder.x = rcScreen.width; RCD_RETURN_OK(retU); } void dtd_screen_cl::scr_area_str(wxPaintDC& dc) { { //active area size to string int Xres, Yres, tmpi; tmpi = pwin->sct_hborder->data; tmpi <<= 1; //exclude borders on both screen edges Xres = pwin->sct_xres->data; Xres -= tmpi; tmpi = pwin->sct_vborder->data; tmpi <<= 1; Yres = pwin->sct_vres->data; Yres -= tmpi; tmps.Printf("%u x %u", Xres, Yres); } { //set the DC font wxFont font; font = dc.GetFont(); font.MakeBold(); dc.SetFont(font); } { //draw the string wxPoint str_pos; wxSize str_sz; str_sz = dc.GetTextExtent(tmps); //skip if active area is too small if ((str_sz.x >= rcScreen.width ) || (str_sz.y >= rcScreen.height) ) return; str_sz.x >>= 1; str_sz.y >>= 1; str_pos.x = rcScreen.width; str_pos.x >>= 1; str_pos.x += rcScreen.x; str_pos.x -= str_sz.x; str_pos.y = rcScreen.height; str_pos.y >>= 1; str_pos.y += rcScreen.y; str_pos.y -= str_sz.y; dc.SetTextForeground(cResStr); dc.DrawText(tmps, str_pos); } } #pragma GCC diagnostic ignored "-Wunused-parameter" void dtd_screen_cl::evt_paint(wxPaintEvent& evt){ rcode retU; wxPaintDC dc(this); wxSize dcsize = dc.GetSize(); wxBrush bgbrush(*wxMEDIUM_GREY_BRUSH); if (!IsEnabled()) { dc.SetBrush(bgbrush); dc.DrawRectangle(0, 0, dcsize.x, dcsize.y); return; } if (pwin->b_dtd_keep_aspect) { scr_aspect_ratio(dcsize, dc); } retU = calc_coords(dcsize); if (! RCD_IS_OK(retU)) { pwin->GLog.DoLog("dtd_screen:evt_paint():calc_coords() FAILED."); pwin->GLog.PrintRcode(retU); return; } //background dc.SetBrush(*wxBLACK); dc.DrawRectangle(0, 0, dcsize.x, dcsize.y); dc.SetPen(*wxTRANSPARENT_PEN); //vsync bar bgbrush.SetColour(cVsync); dc.SetBrush(bgbrush); dc.DrawRectangle(rcVsync); //hsync bar bgbrush.SetColour(cHsync); dc.SetBrush(bgbrush); dc.DrawRectangle(rcHsync); //sandcastle area (hsync + vsync) bgbrush.SetColour(cSandC); dc.SetBrush(bgbrush); dc.DrawRectangle(0, 0, rcHsync.width, rcVsync.height); //screen area bgbrush.SetColour(cScrArea); dc.SetBrush(bgbrush); dc.DrawRectangle(rcScreen); //print effective resolution on the active screen area. scr_area_str(dc); //h-border if (szHborder.x != 0) { bgbrush.SetColour(cSandC); dc.SetBrush(bgbrush); dc.DrawRectangle(rcScreen.x, rcScreen.y, szHborder.x, szHborder.y); dc.DrawRectangle((rcScreen.x + rcScreen.width) - szHborder.x, rcScreen.y, szHborder.x, szHborder.y); } //v-border if (szVborder.y != 0) { bgbrush.SetColour(cSandC); dc.SetBrush(bgbrush); dc.DrawRectangle(rcScreen.x, rcScreen.y, szVborder.x, szVborder.y); dc.DrawRectangle(rcScreen.x, (rcScreen.y + rcScreen.height) - szVborder.y, szVborder.x, szVborder.y); } } #pragma GCC diagnostic warning "-Wunused-parameter" //the events are currently useless //wxBEGIN_EVENT_TABLE(dlg, wxDialog) // EVT_CLOSE ( dlg::evt_close) // EVT_BUTTON(wxID_OK, dlg::evt_ok ) //wxEND_EVENT_TABLE() //#pragma GCC diagnostic ignored "-Wunused-parameter" //void dlg::evt_close(wxCloseEvent &evt) { // EndModal(0); // evt.Skip(); //} // //void dlg::evt_ok(wxCommandEvent &evt) { // EndModal(1); // evt.Skip(); //} //#pragma GCC diagnostic warning "-Wunused-parameter" dlg::dlg(wxWindow* parent, const wxArtID& id_icon, const wxString& caption, const wxString& msg) { wxSize win_sz; wxBoxSizer *bszV_top; wxBoxSizer *bszH_imsg; wxStaticText *txc_msg; wxStaticBitmap *stbmap; wxButton *btOK; Create(parent, wxNewId(), caption); bszV_top = new wxBoxSizer(wxVERTICAL ); bszH_imsg = new wxBoxSizer(wxHORIZONTAL); stbmap = new wxStaticBitmap(this, wxNewId(), wxArtProvider::GetBitmap(id_icon, wxART_CMN_DIALOG)); txc_msg = new wxStaticText (this, wxNewId(), msg); btOK = new wxButton (this, wxID_OK); bszV_top ->Add(bszH_imsg, 1, wxALL, 4); bszH_imsg->Add(stbmap , 0, wxALL, 10); bszH_imsg->Add(txc_msg , 1, wxALL|wxEXPAND, 16); bszV_top ->Add(btOK , 0, wxALL|wxCENTER, 4); SetSizer(bszV_top); win_sz = bszV_top->ComputeFittingWindowSize(this); SetSize(win_sz); Layout(); Centre(); } int dlg::MessageBox(wxWindow* parent, const wxString& msg, const wxString& caption, const wxArtID& id_icon) { int retv; dlg *pdlg; pdlg = new dlg(parent, id_icon, caption, msg); retv = pdlg->ShowModal(); pdlg->Destroy(); return retv; } wxedid-0.0.32/src/CEA_class.h0000644000175000017500000001503114722720160012517 00000000000000/*************************************************************** * Name: CEA.h * Purpose: EDID::CEA-DBC descriptor classes * Author: Tomasz Pawlak (tomasz.pawlak@wp.eu) * Copyright: Tomasz Pawlak (C) 2021-2024 * License: GPLv3+ **************************************************************/ #ifndef CEA_CLASS_H #define CEA_CLASS_H 1 #include "EDID_shared.h" //----------------- CEA/CTA-861 extension //CHD: CEA Header class cea_hdr_cl : public edi_grp_cl { private: static const edi_field_t fields[]; static const char CodN[]; static const char Name[]; static const char Desc[]; public: rcode init(const u8_t* inst, u32_t orflags, edi_grp_cl* parent); void SpawnInstance(u8_t *pinst); }; //ADB: Audio Data Block (DBC_T_ADB = 1) class cea_adb_cl : public dbc_grp_cl { private: static const char Desc[]; static const dbc_root_dsc_t ADB_grp; public: rcode init(const u8_t* inst, u32_t orflags, edi_grp_cl* parent); edi_grp_cl* Clone(rcode& rcd, u32_t flags) {return base_clone(rcd, new cea_adb_cl(), flags); }; }; //ADB: Audio Data Block -> //SAD: Short Audio Descriptor class cea_sad_cl : public edi_grp_cl { private: enum { //SAD byte 0: AFC = 1...14 byte0_afc1_14_fcnt = 3, byte0_afc15_ace11_fcnt = 3, byte0_afc15_ace12_fcnt = 3, byte0_afc15_ace13_fcnt = 2, //SAD byte 1: AFC = 1...14 || AFC = 15 && ACE = 11 (MPEG-H 3D Audio) byte1_afc1_14_ace11_fcnt = 8, byte1_afc15_ace456810_fcnt = 6, byte1_afc15_ace12_fsmp_fcnt = 8, byte1_afc15_ace13_fcnt = 8, //SAD byte 2: AFC = 1: LPCM byte2_afc1_fcnt = 4, byte2_afc2_8_fcnt = 1, byte2_afc9_13_fcnt = 1, byte2_afc14_fcnt = 2, byte2_afc15_ace456_fcnt = 4, byte2_afc15_ace8_10_fcnt = 4, byte2_afc15_ace11_fcnt = 4, byte2_afc15_ace12_fcnt = 2, byte2_afc15_ace13_fcnt = 4 }; //block data layouts static const edi_field_t byte0_afc1_14[]; static const edi_field_t byte0_afc15_ace11[]; static const edi_field_t byte0_afc15_ace12[]; static const edi_field_t byte0_afc15_ace13[]; static const edi_field_t byte1_afc1_14_ace11[]; static const edi_field_t byte1_afc15_ace456810[]; static const edi_field_t byte1_afc15_ace12_fsmp[]; static const edi_field_t byte1_afc15_ace13[]; static const edi_field_t byte2_afc1[]; static const edi_field_t byte2_afc2_8[]; static const edi_field_t byte2_afc9_13[]; static const edi_field_t byte2_afc14[]; static const edi_field_t byte2_afc15_ace456[]; static const edi_field_t byte2_afc15_ace8_10[]; static const edi_field_t byte2_afc15_ace11[]; static const edi_field_t byte2_afc15_ace12[]; static const edi_field_t byte2_afc15_ace13[]; edi_field_t *p_fld; int AFC; int ACE; //SAD needs custom constructor for field array rcode data_byte0 (); rcode data_byte1 (); rcode data_byte2 (); rcode gen_data_layout(const u8_t* inst); public: static const char Desc[]; static const dbc_subg_dsc_t SAD_subg; rcode init(const u8_t* inst, u32_t orflags, edi_grp_cl* parent); rcode ForcedGrpRefresh(); edi_grp_cl* Clone(rcode& rcd, u32_t flags) {return base_clone(rcd, new cea_sad_cl(), flags); }; void getGrpName(EDID_cl& EDID, wxString& gp_name); static edi_grp_cl* group_new() {return new cea_sad_cl();}; }; //VDB: Video Data Block (DBC_T_VDB = 2) class cea_vdb_cl : public dbc_grp_cl { private: static const dbc_root_dsc_t VDB_grp; static const char CodN[]; static const char Name[]; static const char Desc[]; public: rcode init(const u8_t* inst, u32_t orflags, edi_grp_cl* parent); edi_grp_cl* Clone(rcode& rcd, u32_t flags) {return base_clone(rcd, new cea_vdb_cl(), flags); }; }; //VDB: Video Data Block -> //SVD: Short Video Descriptor class cea_svd_cl : public edi_grp_cl { private: static const char Desc []; static const edi_field_t fld_dsc[]; public: static const dbc_subg_dsc_t SVD_subg; rcode init(const u8_t* inst, u32_t orflags, edi_grp_cl* parent); edi_grp_cl* Clone(rcode& rcd, u32_t flags) {return base_clone(rcd, new cea_svd_cl(), flags); }; void getGrpName(EDID_cl& EDID, wxString& gp_name); static edi_grp_cl* group_new() {return new cea_svd_cl();}; }; //VSD: Vendor Specific Data Block (DBC_T_VSD = 3) class cea_vsd_cl : public edi_grp_cl { private: static const char Desc []; static const edi_field_t hdr_fld_dsc []; static const edi_field_t sink_feat_fld_dsc []; static const edi_field_t max_tmds_fld_dsc []; static const edi_field_t latency_fld_dsc []; static const edi_field_t av_latency_fld_dsc[]; static const gpfld_dsc_t sub_fld_grp []; static const dbc_flatgp_dsc_t VSD_grp; public: rcode init(const u8_t* inst, u32_t orflags, edi_grp_cl* parent); edi_grp_cl* Clone(rcode& rcd, u32_t flags) {return base_clone(rcd, new cea_vsd_cl(), flags); }; }; //SAB: Speaker Allocation Data Block (DBC_T_SAB = 4) class cea_sab_cl : public edi_grp_cl { private: static const dbc_flatgp_dsc_t SAB_grp; public: rcode init(const u8_t* inst, u32_t orflags, edi_grp_cl* parent); edi_grp_cl* Clone(rcode& rcd, u32_t flags) {return base_clone(rcd, new cea_sab_cl(), flags); }; }; //VDTC: VESA Display Transfer Characteristic Data Block (gamma) (DBC_T_VTC = 5) class cea_vdtc_cl : public edi_grp_cl { private: static const gpfld_dsc_t fields[]; static const char Desc[]; static const edi_field_t fld_dsc[]; static const dbc_flatgp_dsc_t VDTC_grp; public: rcode init(const u8_t* inst, u32_t orflags, edi_grp_cl* parent); edi_grp_cl* Clone(rcode& rcd, u32_t flags) {return base_clone(rcd, new cea_vdtc_cl(), flags); }; }; //UNK-TC: Unknown Data Block (Tag Code) class cea_unktc_cl : public edi_grp_cl { private: static const dbc_flatgp_dsc_t UNK_TC_grp; public: rcode init(const u8_t* inst, u32_t orflags, edi_grp_cl* parent); edi_grp_cl* Clone(rcode& rcd, u32_t flags) {return base_clone(rcd, new cea_unktc_cl(), flags); }; }; #endif /* CEA_CLASS_H */ wxedid-0.0.32/src/config.h.in0000644000175000017500000000116514722720160012617 00000000000000/* src/config.h.in. Generated from configure.ac by autoheader. */ /* Name of package */ #undef PACKAGE /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT /* Define to the full name of this package. */ #undef PACKAGE_NAME /* Define to the full name and version of this package. */ #undef PACKAGE_STRING /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME /* Define to the home page for this package. */ #undef PACKAGE_URL /* Define to the version of this package. */ #undef PACKAGE_VERSION /* Version number of package */ #undef VERSION wxedid-0.0.32/src/vmap.h0000644000175000017500000000403314722720160011705 00000000000000/*************************************************************** * Name: vmap.h * Purpose: value->description maps and value selector menus * Author: Tomasz Pawlak (tomasz.pawlak@wp.eu) * Copyright: Tomasz Pawlak (C) 2024 * License: GPLv3+ **************************************************************/ #ifndef VMAP_H #define VMAP_H 1 #include #include #include #include "rcode/rcode.h" #include "def_types.h" typedef struct { //vfmt_s u32_t DMT_ID; u32_t STD2; u32_t CVT3; const char *name; } vfmt_t; //value map : single entry typedef struct { // vname_map_t u32_t val ; //item value != item id, field has F_VSVM flag set const char *name; //value name const char *desc; //additional description or NULL } vmap_ent_t; //vmap type typedef std::map sm_vmap; typedef struct { union { sm_vmap *map_ar[2]; struct { sm_vmap *mid_map; //menu id map sm_vmap *val_map; //value map }; }; wxMenu *selector; } vmap_selector_t; typedef enum { VMAP_MID, //value == menu item id VMAP_VAL } vmap_type; enum vmap_selector_idx { VS_NO_SELECTOR, VS_START, VS_VID_INPUT = VS_START, VS_MRL_EXT, VS_ALT_DSC_TYPE, VS_STD2_ASP_RATIO, VS_CVT3_ASP_RATIO, VS_CVT3_PREF_VREF, VS_DMT1_VIDFMT, VS_STD2_VIDFMT, VS_CVT3_VIDFMT, VS_SVD_VIDFMT, VS_CEA_TAG, VS_CEA_ETAG, VS_ADB_AFC, VS_ADB_ACE_TC, VS_SPKLD_IDX, VS_T7_ASP_RATIO, VS_T710_3D_SUPP, VS_NUM_OF }; sm_vmap* vmap_GetVmap (u32_t idx, vmap_type vm_type); const vmap_ent_t* vmap_GetVmapEntry(u32_t vmap_idx, vmap_type vm_type, u32_t key_val); rcode vmap_GetValueAsString(u32_t vs_idx, vmap_type vm_type, u32_t key_val, u32_t flags, wxString& sval); wxMenu* vmap_GetSelector (u32_t idx, u32_t flags, rcode& retU); void vmap_DestroySelectors(); rcode vmap_InitDMT_Vmaps(); void vmap_DeleteDMT_Vmaps(); #endif /* VMAP_H */ wxedid-0.0.32/src/wxEDID_App.cpp0000644000175000017500000001627014722720160013167 00000000000000/*************************************************************** * Name: wxEDID_App.cpp * Purpose: Code for Application Class * Author: Tomasz Pawlak (tomasz.pawlak@wp.eu) * Copyright: Tomasz Pawlak (C) 2014-2024 * License: GPLv3+ **************************************************************/ #include "wxEDID_App.h" #include "wxEDID.h" //(*AppHeaders #include //*) #ifndef _RCD_AUTOGEN #include "config.h" #else #define VERSION "1" #endif #include #include #include #include extern config_t config; IMPLEMENT_APP(wxEDID_App); static const wxString strFOpenErr = "[E!] Can't open file: '%s'\n"; bool wxEDID_App::OnInit() { bool wxsOK; wxsOK = CmdLineArgs(); if (! wxsOK) return wxsOK; LoadConfig(); //(* AppInitialize //wxInitAllImageHandlers(); if ( wxsOK ) { wxEDID_Frame* Frame = new wxEDID_Frame(0); Frame->Show(); SetTopWindow(Frame); } //*) return wxsOK; } int wxEDID_App::OnExit() { SaveConfig(); return true; } void wxEDID_App::SaveConfig() { static const wxString strCfgStruct = "dtd_keep_aspect: '%d'\n" "blk_dynamic_names: '%d'\n" "dta_grid_details: '%d'\n" "last_used_fpath: '%s'\n" "aui_layout: '%s'\n" "win_pos_x: '%d'\n" "win_pos_y: '%d'\n" "win_width: '%d'\n" "win_height: '%d'\n" "# File generated by wxEDID v" VERSION; wxString cfg_str; wxFile cfg_file; wxFileName cfg_fname; cfg_fname.SetPath( wxGetHomeDir() ); cfg_fname.SetName( ".wxEDID_cfg" ); cfg_str = cfg_fname.GetFullPath(); if (! cfg_file.Open(cfg_str, wxFile::write) ) { wxLogStderr ErrLog; wxString tmps; tmps.Printf(strFOpenErr, cfg_fname.GetFullPath()); ErrLog.LogText(tmps); } cfg_str.Printf(strCfgStruct, config.b_dtd_keep_aspect, config.b_blk_name_dynamic, config.b_dta_grid_details, config.last_used_fpath, config.aui_layout, config.win_pos.x, config.win_pos.y, config.win_size.x, config.win_size.y ); cfg_file.Write(cfg_str); } void wxEDID_App::LoadConfig() { static const wxString strFTooBig = "[E!] file too big: '%s'\n"; wxString cfg_str; wxFileName cfg_fname; config.b_have_layout = false; config.b_have_last_fpath = false; config.b_dtd_keep_aspect = true; config.b_dta_grid_details = false; config.b_blk_name_dynamic = true; cfg_fname.SetPath( wxGetHomeDir() ); cfg_fname.SetName( ".wxEDID_cfg" ); cfg_str = cfg_fname.GetFullPath(); if (! wxFileExists(cfg_str)) return; { wxFile cfg_file; wxString tmps; wxLogStderr ErrLog; if (! cfg_file.Open(cfg_str, wxFile::read) ) { tmps.Printf(strFOpenErr, cfg_fname.GetFullPath()); ErrLog.LogText(tmps); return; } if (cfg_file.Length() > 4096) { tmps.Printf(strFTooBig, cfg_fname.GetFullPath()); ErrLog.LogText(tmps); return; } cfg_file.ReadAll(&cfg_str); } { long tmpl; i32_t tkidx = -1; u32_t layout_chk = 0; wxString token; wxStringTokenizer tokenz(cfg_str, "'"); while ( tokenz.HasMoreTokens() ) { token = tokenz.GetNextToken(); tkidx ++ ; if (0 == (tkidx & 1)) continue; if (18 <= tkidx) return; //tokens @ odd idx hold the values switch (tkidx) { case 1: //dtd aspect ratio mode { if (! token.ToLong(&tmpl)) return; config.b_dtd_keep_aspect = (tmpl != 0); break; } case 3: //use dynamic block names in block tree { if (! token.ToLong(&tmpl)) return; config.b_blk_name_dynamic = (tmpl != 0); break; } case 5: //show field details in block data grid { if (! token.ToLong(&tmpl)) return; config.b_dta_grid_details = (tmpl != 0); break; } case 7: //last path { bool dexist; wxFileName last_dir(token); cfg_str = last_dir.GetPath(); dexist = wxDirExists( cfg_str ); if (dexist) { config.last_used_fpath = token; config.b_have_last_fpath = true; } } break; case 9: //AUI layout config.aui_layout = token; layout_chk ++ ; break; case 11: //win pos X if (! token.ToLong(&tmpl)) return; config.win_pos.x = (int) tmpl; layout_chk ++ ; break; case 13: //win pos Y if (! token.ToLong(&tmpl)) return; config.win_pos.y = (int) tmpl; layout_chk ++ ; break; case 15: //win width if (! token.ToLong(&tmpl)) return; config.win_size.x = (int) tmpl; layout_chk ++ ; break; case 17: //win height if (! token.ToLong(&tmpl)) return; config.win_size.y = (int) tmpl; layout_chk ++ ; } } config.b_have_layout = (layout_chk == 5); } return; } bool wxEDID_App::CmdLineArgs() { static const wxCmdLineEntryDesc sCmdLineArgs[] = { { wxCMD_LINE_SWITCH, "e" , "ignore-errors", NULL , wxCMD_LINE_VAL_NONE , 0}, { wxCMD_LINE_SWITCH, "w" , "all-writeable", NULL , wxCMD_LINE_VAL_NONE , 0}, { wxCMD_LINE_OPTION, "t" , "text" , NULL , wxCMD_LINE_VAL_STRING, wxCMD_LINE_NEEDS_SEPARATOR}, { wxCMD_LINE_PARAM , NULL, NULL , NULL , wxCMD_LINE_VAL_STRING, wxCMD_LINE_PARAM_OPTIONAL }, wxCMD_LINE_DESC_END }; wxCmdLineParser cmd_parser(sCmdLineArgs, wxApp::argc, wxApp::argv); cmd_parser.Parse(); config.b_cmd_bin_file = false; config.b_cmd_ignore_err = cmd_parser.Found("e"); config.b_cmd_ignore_rd = cmd_parser.Found("w"); config.b_cmd_txt_file = cmd_parser.Found("t", &config.cmd_open_file_path); if (! config.b_cmd_txt_file) { int par_cnt = cmd_parser.GetParamCount(); if (par_cnt > 0) { config.cmd_open_file_path = cmd_parser.GetParam(0); } else { return true; } } if (! wxFileExists(config.cmd_open_file_path)) { wxLogStderr ErrLog; wxString tmps; tmps.Printf(strFOpenErr, config.cmd_open_file_path); ErrLog.LogText(tmps); return false; } config.b_cmd_bin_file = !config.b_cmd_txt_file; { wxFileName fname(config.cmd_open_file_path); if (! wxIsAbsolutePath(config.cmd_open_file_path) ) { fname.Normalize(wxPATH_NORM_DOTS|wxPATH_NORM_TILDE|wxPATH_NORM_ABSOLUTE, wxGetCwd()); } config.cmd_open_file_path = fname.GetFullPath(); config.last_used_fname = fname.GetFullName(); } return true; } wxedid-0.0.32/src/CEA_ET_class.h0000644000175000017500000003775014722720160013123 00000000000000/*************************************************************** * Name: CEA_ET_class.h * Purpose: EDID::CEA-DBC-EXT descriptor classes * Author: Tomasz Pawlak (tomasz.pawlak@wp.eu) * Copyright: Tomasz Pawlak (C) 2021-2024 * License: GPLv3+ **************************************************************/ #ifndef CEA_ET_CLASS_H #define CEA_ET_CLASS_H 1 #include "EDID_shared.h" //----------------- DBC Extended Tag Codes //VCDB: Video Capability Data Block (DBC_ET_VCDB = 0) class cea_vcdb_cl : public edi_grp_cl { private: static const char Desc[]; static const edi_field_t fld_dsc[]; static const gpfld_dsc_t fields; static const dbc_flatgp_dsc_t VCDB_grp; public: rcode init(const u8_t* inst, u32_t orflags, edi_grp_cl* parent); edi_grp_cl* Clone(rcode& rcd, u32_t flags) {return base_clone(rcd, new cea_vcdb_cl(), flags); }; }; //VSVD: Vendor-Specific Video Data Block (DBC_ET_VSVD = 1) class cea_vsvd_cl : public edi_grp_cl { private: static const char Desc[]; //fields shared with VSAD static const dbc_flatgp_dsc_t VSVD_grp; public: rcode init(const u8_t* inst, u32_t orflags, edi_grp_cl* parent); edi_grp_cl* Clone(rcode& rcd, u32_t flags) {return base_clone(rcd, new cea_vsvd_cl(), flags); }; }; //VDDD: VESA Display Device Data Block (DBC_ET_VDDD = 2) class cea_vddd_cl : public dbc_grp_cl { private: //subgroups; static const char CodN[]; static const char Name[]; static const char Desc[]; public: rcode init(const u8_t* inst, u32_t orflags, edi_grp_cl* parent); edi_grp_cl* Clone(rcode& rcd, u32_t flags) {return base_clone(rcd, new cea_vddd_cl(), flags); }; }; //VDDD: IFP: Interface class vddd_iface_cl : public edi_grp_cl { private: static const edi_field_t fields[]; protected: static const char CodN[]; static const char Name[]; static const char Desc[]; public: rcode init(const u8_t* inst, u32_t orflags, edi_grp_cl* parent); }; //VDDD: CPT: Content Protection class vddd_cprot_cl : public edi_grp_cl { private: static const edi_field_t fields[]; protected: static const char CodN[]; static const char Name[]; static const char Desc[]; public: rcode init(const u8_t* inst, u32_t orflags, edi_grp_cl* parent); }; //VDDD: AUPR: Audio properties class vddd_audio_cl : public edi_grp_cl { private: static const edi_field_t fields[]; protected: static const char CodN[]; static const char Name[]; static const char Desc[]; public: rcode init(const u8_t* inst, u32_t orflags, edi_grp_cl* parent); }; //VDDD: DPR: Display properties class vddd_disp_cl : public edi_grp_cl { private: static const edi_field_t fields[]; protected: static const char CodN[]; static const char Name[]; static const char Desc[]; public: rcode init(const u8_t* inst, u32_t orflags, edi_grp_cl* parent); }; //VDDD: CXY: Additional Chromaticity Coordinates class vddd_cxy_cl : public edi_grp_cl { private: static const edi_field_t fields[]; protected: static const char CodN[]; static const char Name[]; static const char Desc[]; public: rcode init(const u8_t* inst, u32_t orflags, edi_grp_cl* parent); }; //CLDB: Colorimetry Data Block (DBC_ET_CLDB = 5) class cea_cldb_cl : public edi_grp_cl { private: static const char Desc[]; static const edi_field_t fld_dsc[]; static const gpfld_dsc_t fields; static const dbc_flatgp_dsc_t CLDB_grp; public: rcode init(const u8_t* inst, u32_t orflags, edi_grp_cl* parent); edi_grp_cl* Clone(rcode& rcd, u32_t flags) {return base_clone(rcd, new cea_cldb_cl(), flags); }; }; //HDRS: HDR Static Metadata Data Block (DBC_ET_HDRS = 6) class cea_hdrs_cl : public edi_grp_cl { private: static const char Desc[]; static const edi_field_t fld_byte_2_3_dsc[]; static const edi_field_t fld_opt_byte_4_5_6_dsc[]; static const gpfld_dsc_t fields[]; static const dbc_flatgp_dsc_t HDRS_grp; public: rcode init(const u8_t* inst, u32_t orflags, edi_grp_cl* parent); edi_grp_cl* Clone(rcode& rcd, u32_t flags) {return base_clone(rcd, new cea_hdrs_cl(), flags); }; }; //HDRD: HDR Dynamic Metadata Data Block (DBC_ET_HDRD = 7) class cea_hdrd_cl : public dbc_grp_cl { private: static const char Desc[]; static const dbc_root_dsc_t HDRD_grp; public: rcode init(const u8_t* inst, u32_t orflags, edi_grp_cl* parent); edi_grp_cl* Clone(rcode& rcd, u32_t flags) {return base_clone(rcd, new cea_hdrd_cl(), flags); }; }; //HDRD: HMTD: HDR Dynamic Metadata sub-group class hdrd_mtd_cl : public edi_grp_cl { private: static const char Desc []; static const edi_field_t fld_dsc[]; public: static const dbc_subg_dsc_t MTD_hdr; rcode init(const u8_t* inst, u32_t orflags, edi_grp_cl* parent); //NOTE: no Clone(): init requires parent->getFreeSubgSZ(), parent is NULL in the copy of group static edi_grp_cl* group_new() {return new hdrd_mtd_cl();}; }; //VFPD: Video Format Preference Data Block (DBC_ET_VFPD = 13) class cea_vfpd_cl : public dbc_grp_cl { private: static const dbc_root_dsc_t VFPD_grp; static const char CodN[]; static const char Name[]; static const char Desc[]; public: rcode init(const u8_t* inst, u32_t orflags, edi_grp_cl* parent); edi_grp_cl* Clone(rcode& rcd, u32_t flags) {return base_clone(rcd, new cea_vfpd_cl(), flags); }; }; //VFPD: Video Format Preference Data Block -> //SVR: Short Video Reference class cea_svr_cl : public edi_grp_cl { private: static const char Desc []; static const edi_field_t fld_dsc[]; public: static const dbc_subg_dsc_t SVR_subg; rcode init(const u8_t* inst, u32_t orflags, edi_grp_cl* parent); edi_grp_cl* Clone(rcode& rcd, u32_t flags) {return base_clone(rcd, new cea_svr_cl(), flags); }; static edi_grp_cl* group_new() {return new cea_svr_cl();}; }; //Y42V: YCBCR 4:2:0 Video Data Block (DBC_ET_Y42V = 14) class cea_y42v_cl : public dbc_grp_cl { private: static const char Desc[]; static const dbc_root_dsc_t Y42V_grp; public: rcode init(const u8_t* inst, u32_t orflags, edi_grp_cl* parent); edi_grp_cl* Clone(rcode& rcd, u32_t flags) {return base_clone(rcd, new cea_y42v_cl(), flags); }; }; //Y42C: YCBCR 4:2:0 Capability Map Data Block (DBC_ET_Y42C = 15) class cea_y42c_cl : public edi_grp_cl { private: static const edi_field_t bitmap_fld; static const char CodN[]; static const char Name[]; static const char Desc[]; //array of strings with SVD nr y42c_svdn_t *svdn_ar; public: rcode init(const u8_t* inst, u32_t orflags, edi_grp_cl* parent); edi_grp_cl* Clone(rcode& rcd, u32_t flags) {return base_clone(rcd, new cea_y42c_cl(), flags); }; cea_y42c_cl() : svdn_ar(NULL) {}; ~cea_y42c_cl() { if (svdn_ar != NULL) free(svdn_ar); }; }; //VSAD: Vendor-Specific Audio Data Block (DBC_ET_VSAD = 17) class cea_vsad_cl : public edi_grp_cl { private: protected: static const char Desc[]; //fields shared with VSVD static const dbc_flatgp_dsc_t VSAD_grp; public: rcode init(const u8_t* inst, u32_t orflags, edi_grp_cl* parent); edi_grp_cl* Clone(rcode& rcd, u32_t flags) {return base_clone(rcd, new cea_vsad_cl(), flags); }; }; //HADB: HDMI Audio Data Block (DBC_ET_HADB = 18) class cea_hadb_cl : public dbc_grp_cl { private: static const char Desc []; static const edi_field_t ah_flds[]; static const dbc_root_dsc_t HADB_root; static const dbc_subg_dsc_t HADB_subg[]; public: rcode init(const u8_t* inst, u32_t orflags, edi_grp_cl* parent); edi_grp_cl* Clone(rcode& rcd, u32_t flags) {return base_clone(rcd, new cea_hadb_cl(), flags); }; }; //HADB: HDMI Audio Data Block -> //SAB3D: HDMI 3D Speaker Allocation Descriptor, based on SAB class hadb_sab3d_cl : public edi_grp_cl { public: static const char CodN[]; static const char Name[]; static const char Desc[]; rcode init(const u8_t* inst, u32_t orflags, edi_grp_cl* parent); edi_grp_cl* Clone(rcode& rcd, u32_t flags) {return base_clone(rcd, new hadb_sab3d_cl(), flags); }; static edi_grp_cl* group_new() {return new hadb_sab3d_cl();}; }; //RMCD: Room Configuration Data Block (DBC_ET_RMCD = 19) class cea_rmcd_cl : public dbc_grp_cl { private: static const char Desc []; static const edi_field_t ah_flds[]; static const dbc_root_dsc_t RMCD_root; static const dbc_subg_dsc_t RMCD_subg[]; public: rcode init(const u8_t* inst, u32_t orflags, edi_grp_cl* parent); edi_grp_cl* Clone(rcode& rcd, u32_t flags) {return base_clone(rcd, new cea_rmcd_cl(), flags); }; }; //RMCD: SPM: Speaker Mask class rmcd_spm_cl : public edi_grp_cl { private: //field descriptors and group description are shared with SAB public: rcode init(const u8_t* inst, u32_t orflags, edi_grp_cl* parent); static edi_grp_cl* group_new() {return new rmcd_spm_cl();}; }; //RMCD: SPKD: Speaker Distance class rmcd_spkd_cl : public edi_grp_cl { public: static const char CodN[]; static const char Name[]; static const char Desc[]; static const edi_field_t fld_dsc[]; rcode init(const u8_t* inst, u32_t orflags, edi_grp_cl* parent); static edi_grp_cl* group_new() {return new rmcd_spkd_cl();}; }; //RMCD: DSPC: Display Coordinates class rmcd_dspc_cl : public edi_grp_cl { public: static const char CodN[]; static const char Name[]; static const char Desc[]; static const edi_field_t fld_dsc[]; rcode init(const u8_t* inst, u32_t orflags, edi_grp_cl* parent); static edi_grp_cl* group_new() {return new rmcd_dspc_cl();}; }; //SLDB: Speaker Location Data Block (DBC_ET_SLDB = 20) class cea_sldb_cl : public dbc_grp_cl { private: static const char Desc[]; static const dbc_root_dsc_t SLDB_grp; public: rcode init(const u8_t* inst, u32_t orflags, edi_grp_cl* parent); edi_grp_cl* Clone(rcode& rcd, u32_t flags) {return base_clone(rcd, new cea_sldb_cl(), flags); }; }; //SLDB: SPKLD: Speaker Location Descriptor class spkld_cl : public edi_grp_cl { private: public: static const char Desc []; static const edi_field_t fld_dsc[]; static const dbc_subg_dsc_t SPKLD_subg; rcode init(const u8_t* inst, u32_t orflags, edi_grp_cl* parent); //NOTE: no Clone(): init requires parent->getFreeSubgSZ(), parent is NULL in the copy of group void getGrpName(EDID_cl& EDID, wxString& gp_name); static edi_grp_cl* group_new() {return new spkld_cl();}; }; //IFDB: InfoFrame Data Block (DBC_ET_IFDB = 32) class cea_ifdb_cl : public dbc_grp_cl { private: static const char CodN[]; static const char Name[]; static const char Desc[]; public: rcode init(const u8_t* inst, u32_t orflags, edi_grp_cl* parent); edi_grp_cl* Clone(rcode& rcd, u32_t flags) {return base_clone(rcd, new cea_ifdb_cl(), flags); }; }; //IFDB: IFPD: InfoFrame Processing Descriptor class ifdb_ifpdh_cl : public edi_grp_cl { private: static const char Desc []; static const edi_field_t fld_dsc[]; public: static const dbc_subg_dsc_t IFPD_subg; rcode init(const u8_t* inst, u32_t orflags, edi_grp_cl* parent); }; //IFDB: SIFD: Short InfoFrame Descriptor, InfoFrame Type Code != 0x00, 0x01 class ifdb_sifd_cl : public edi_grp_cl { private: static const char Desc[]; static const edi_field_t fld_dsc[]; static const dbc_subg_dsc_t SIFD_subg; public: rcode init(const u8_t* inst, u32_t orflags, edi_grp_cl* parent); }; //IFDB: VSIFD: Short Vendor-Specific InfoFrame Descriptor, InfoFrame Type Code = 0x01 class ifdb_vsifd_cl : public edi_grp_cl { private: static const char Desc[]; static const edi_field_t fld_dsc[]; static const dbc_subg_dsc_t VSIFD_subg; public: rcode init(const u8_t* inst, u32_t orflags, edi_grp_cl* parent); }; //T7VTDB: DisplayID Type 7 Video Timing Data Block (DBC_ET_T7VTB = 34) //T7VTDB fields indexes in array enum { T7F_IDX_BLK_REV = 3, //ET hdr offset T7F_IDX_DSC_PT, T7F_IDX_T7_M, T7F_IDX_F37_RES, T7F_IDX_ASP_RATIO, T7F_IDX_T7_IL, T7F_IDX_3D_SUPP, T7F_IDX_T7_Y420, T7F_IDX_PIXCLK, T7F_IDX_HAPIX, T7F_IDX_HBPIX, T7F_IDX_HSOFFS, T7F_IDX_HSWIDTH, T7F_IDX_T7_HSP, T7F_IDX_VALIN, T7F_IDX_VBLIN, T7F_IDX_VSOFFS, T7F_IDX_VSWIDTH, T7F_IDX_T7_VSP }; class cea_t7vtb_cl : public dbc_grp_cl { private: static const char Desc []; static const edi_field_t fld_dsc[]; static const gpfld_dsc_t fields; static const dbc_flatgp_dsc_t T7VTB_grp; public: rcode init(const u8_t* inst, u32_t orflags, edi_grp_cl* parent); edi_grp_cl* Clone(rcode& rcd, u32_t flags) {return base_clone(rcd, new cea_t7vtb_cl(), flags); }; void getGrpName(EDID_cl& EDID, wxString& gp_name); }; //T8VTDB: DisplayID Type 8 Video Timing Data Block (DBC_ET_T8VTB = 35) class cea_t8vtb_cl : public dbc_grp_cl { private: static const char Desc []; static const edi_field_t ah_flds[]; static const dbc_root_dsc_t T8VTB_root; public: rcode init(const u8_t* inst, u32_t orflags, edi_grp_cl* parent); edi_grp_cl* Clone(rcode& rcd, u32_t flags) {return base_clone(rcd, new cea_t8vtb_cl(), flags); }; }; //T8VTDB: -> //T8VTC: video timing code class t8vtb_vtc_cl : public edi_grp_cl { protected: static const char Desc []; //block data layouts static const edi_field_t vtc_1_byte[]; //for DMT STD 2-byte codes, dmt_std2_cl sub-grp is used const dbc_subg_dsc_t *VTC_subg; public: static const dbc_subg_dsc_t VTC_T0_subg; static const dbc_subg_dsc_t VTC_T1_subg; rcode init(const u8_t* inst, u32_t orflags, edi_grp_cl* parent); edi_grp_cl* Clone(rcode& rcd, u32_t flags); void getGrpName(EDID_cl& EDID, wxString& gp_name); static edi_grp_cl* group_new() {return new t8vtb_vtc_cl();}; }; //T10VTDB: DisplayID Type 10 Video Timing Data Block (DBC_ET_T10VTB = 42) class cea_t10vtb_cl : public dbc_grp_cl { private: static const char Desc []; static const edi_field_t ah_flds[]; static const dbc_root_dsc_t T10VTB_root; public: rcode init(const u8_t* inst, u32_t orflags, edi_grp_cl* parent); edi_grp_cl* Clone(rcode& rcd, u32_t flags) {return base_clone(rcd, new cea_t10vtb_cl(), flags); }; }; //T10VTDB: -> //T10VTC: video timing code class t10vtb_vtd_cl : public edi_grp_cl { friend class cea_t10vtb_cl; //access to vtc_m1 pointer protected: static const char Desc[]; //block data layouts static const edi_field_t vtd_m0_m1[]; static const edi_field_t vtd_m0 []; static const edi_field_t vtd_m1 []; const dbc_subg_dsc_t *VTD_subg; public: static const dbc_subg_dsc_t VTD_M0_subg; static const dbc_subg_dsc_t VTD_M1_subg; rcode init(const u8_t* inst, u32_t orflags, edi_grp_cl* parent); edi_grp_cl* Clone(rcode& rcd, u32_t flags); void getGrpName(EDID_cl& EDID, wxString& gp_name); static edi_grp_cl* group_new() {return new t10vtb_vtd_cl();}; }; //UNK-ET: Unknown Data Block (Extended Tag Code) class cea_unket_cl : public edi_grp_cl { private: static const char CodN[]; static const char Name[]; static const char Desc[]; public: rcode init(const u8_t* inst, u32_t orflags, edi_grp_cl* parent); edi_grp_cl* Clone(rcode& rcd, u32_t flags) {return base_clone(rcd, new cea_unket_cl(), flags); }; }; #endif /* CEA_ET_CLASS_H */ wxedid-0.0.32/src/EDID.h0000644000175000017500000005430514722720160011456 00000000000000/*************************************************************** * Name: EDID.h * Purpose: EDID base structure definitions * Author: Tomasz Pawlak (tomasz.pawlak@wp.eu) * Copyright: Tomasz Pawlak (C) 2014-2024 * License: GPLv3+ **************************************************************/ #ifndef EDID_H #define EDID_H 1 #include "def_types.h" /* NOTE: EDID uses little-endian byte order* for multi-byte fields. The structures below are for use with little-endian architectures (f.e. x86, x86_64, LE-mode ARM). For big-endian arch, many of these structures may not work correctly. (!) (*) with one exception: mfc_id field (!) : Big-endian PNP ID by MSFT */ //0-7 : std header typedef union __attribute__ ((packed)) { //hdr_s u8_t hdr_bytes[8]; u32_t hdr_w32 [2]; } hdr_t; //8-9 : Manufacturer ID //LE mfcid: requires byte swapping BE->LE typedef struct __attribute__ ((packed)) { //mfc_id_s uint ltr3 :5; uint ltr2 :5; uint ltr1 :5; uint resvd :1; } mfc_id_t; typedef union __attribute__ ((packed)) { //mfc_id_u u8_t ar8[2]; u16_t u16; mfc_id_t mfc; } mfc_id_u; //20–24 : Basic display parameters. //20: Video Input typedef union { //vid_in_u struct __attribute__ ((packed)) digital_s { //Bit 7=1 : in_type /* uint vesa_compat :1; bit 0 : EDID v1.3: compatibility with VESA DFP 1.x TMDS CRGB, 1 pixel per clock, up to 8 bits per color, MSB aligned */ // uint reserved :6; bits 1-6 : mandatory zeros in EDID v1.3 // EDID v1.4: uint if_type :4; //bits 0-3 : digital interface type uint color_depth :3; //bits 4-6 : color bit depth uint input_type :1; //bit 7 : 1=digital } digital; struct __attribute__ ((packed)) analog_s { uint vsync :1; //bit 0 : VSync pulse must be serrated when composite/sync-on-green is used. uint sync_green :1; //bit 1 : Sync on green supported uint comp_sync :1; //bit 2 : Composite sync (on HSync) supported uint sep_sync :1; //bit 3 : Separate sync supported uint blank_black :1; //bit 4 : Blank-to-black setup (pedestal) expected uint sync_wh_lvl :2; //bit 6-5 : Video white and sync levels, relative to blank uint input_type :1; //bit 7 : 0=analog } analog; } vid_in_t; //BDD: basic display descriptor typedef struct __attribute__ ((packed)) { //bdd_s u8_t max_hsize; //21 : Maximum horizontal image size, in centimetres, 0=undefined u8_t max_vsize; //22 : Maximum vertical image size, in centimetres, 0=undefined u8_t gamma; //23 : Display Transfer Characteristics (GAMMA) value = (gamma*100)-100 (range 1.00–3.54) } bdd_t; //24 : Supported features: display/signal type/format typedef struct __attribute__ ((packed)) { //disp_feat_s uint gtf_support :1; //bit 0 : GTF supported with default parameter values. uint db1_fnative :1; //bit 1 : descriptor block 1: use native pixel format and refresh rate. uint std_srbg :1; //bit 2 : Standard sRGB colour space. Bytes 25–34 must contain sRGB standard values. uint vsig_format :2; /* bit 4-3 : Display type (analog): 00 = Monochrome or Grayscale; 01 = RGB color; 10 = Non-RGB color; 11 = Undefined Display type (digital): 00 = RGB 4:4:4; 01 = RGB 4:4:4 + YCrCb 4:4:4; 10 = RGB 4:4:4 + YCrCb 4:2:2; 11 = RGB 4:4:4 + YCrCb 4:4:4 + YCrCb 4:2:2 */ uint dpms_off :1; //bit 5 : DPMS active-off supported uint dpms_susp :1; //bit 6 : DPMS suspend supported uint dpms_stby :1; //bit 7 : DPMS standby supported } dsp_feat_t; //25-34 : Chromaticity coordinates. 10-bit CIE xy coords for R,G,B and white. [0–1023/1024]. //25 : Red and green least-significant bits typedef struct __attribute__ ((packed)) { //rgxy_lsb_s uint green_y :2; //bit 1-0 : Green y value least-significant 2 bits uint green_x :2; //bit 3-2 uint red_y :2; //bit 5-4 uint red_x :2; //bit 7-6 } rgxy_lsb_t; //26 : Blue and white least-significant bits typedef struct __attribute__ ((packed)) { //bwxy_lsb_s uint white_y :2; //bit 1-0 : White y value least-significant 2 bits uint white_x :2; //bit 3-2 uint blue_y :2; //bit 5-4 uint blue_x :2; //bit 7-6 } bwxy_lsb_t; //Chromaticity coordinates : base struct typedef struct __attribute__ ((packed)) { //chromxy_s rgxy_lsb_t rgxy_lsbits; //25 : Red and green xy lsbits (chromacity coords) bwxy_lsb_t bwxy_lsbits; //26 : Blue and white ls 2 bits u8_t red8h_x; //27 : Red x, 8ms+2ls bits. 0–255 -> 0–0.996 (255/256); 0–0.999 -> (1023/1024) with lsbits u8_t red8h_y; //28 : Red y u8_t green8h_x; //29 : Green x u8_t green8h_y; //30 : Green y u8_t blue8h_x; //31 : Blue x u8_t blue8h_y; //32 : Blue y u8_t white8h_x; //33 : Default white point x value most significant 8 bits u8_t white8h_y; //34 : Default white point y } chromxy_t; //35-37 : Established timing bitmap. Supported bitmap for (formerly) very common timing modes. typedef struct __attribute__ ((packed)) { //est_map_s //byte 35: uint m800x600x60 :1; //bit 0 uint m800x600x56 :1; uint m640x480x75 :1; uint m640x480x72 :1; uint m640x480x67 :1; uint m640x480x60 :1; uint m720x400x88 :1; uint m720x400x70 :1; //byte 36: uint m1280x1024x75 :1; //bit 0 uint m1024x768x75 :1; uint m1024x768x72 :1; uint m1024x768x60 :1; uint m1024x768x87i :1; //interlaced uint m832x624x75 :1; uint m800x600x75 :1; uint m800x600x72 :1; //byte 37: uint m_mfc_spec :7; //bit 6-0 : manufacturer-specific display modes uint m1152x870x75 :1; //bit 7 } est_map_t; //38–53 : DMT STD 2-byte Standard Timing Information. // Up to 8 2-byte fields describing standard display modes. // Unused fields are filled with 01 01 //38-39, ... typedef struct __attribute__ ((packed)) { //std_timg_s u8_t HApix; //byte0: Xres= (HApix / 8)–31 (256–2288 pixels, value 00 is reserved. uint v_ref :6; //byte1: (V-freq-60): 60..123Hz uint asp_ratio :2; /* X:Y aspect ratio: 00=16:10; 01=4:3; 10=5:4; 11=16:9. (Versions prior to 1.3 defined 00 as 1:1.) */ } dmt_std2_t; //54-125 : 4x18bytes : EDID Detailed Timing Descriptor(s) //54+17 : DTD Features flags: typedef struct __attribute__ ((packed)) { //dtd_feat_s uint il2w_stereo :1; //bit0 : 2-way line-interleaved stereo, if bits 6–5 are not 00. uint Hsync_type :1; /*bit1 : analog sync: 1: Sync on all 3 RGB lines /0: sync_on_green digital: HSync polarity (1=positive) */ uint Vsync_type :1; /*bit2 : separated digital sync: Vsync polarity (1=positive), Other types: composite VSync (HSync during VSync) */ uint sync_type :2; /*bit4-3 : Sync type: 00=Analog composite; 01=Bipolar analog composite; 10=Digital composite (on HSync); 11=Digital separate */ uint stereo_mode :2; /*bit6-5 : Stereo mode: 00=No stereo; other values depend on bit 0: Bit 0=0: 01=Field sequential, sync=1 during right; 10=similar, sync=1 during left; 11=4-way interleaved stereo Bit 0=1 2-way interleaved stereo: 01=Right image on even lines; 10=Left image on even lines; 11=side-by-side */ uint interlaced :1; //bit7 } dtd_feat_t; //54-71, ... // Detailed Timing Descriptor : DTD typedef struct __attribute__ ((packed)) { //dtd_s u16_t pix_clk; /*0-1 : Pixel clock in 10 kHz units (0.01–655.35 MHz, LE). pix_clk=0 -> not a DTD */ u8_t HApix_8lsb; //2 : Horizontal active pixels 8 lsbits (0–4095) u8_t HBpix_8lsb; //3 : H-blank pixels 8 lsbits (0–4095) End of active to start of next active. uint HBpix_4msb :4; //4.3-0 : H-blank pixels 4 msbits uint HApix_4msb :4; //4.7-4 : Horizontal active pixels 4 msbits u8_t VAlin_8lsb; //5 : Vertical active lines 8 lsbits (0–4095) u8_t VBlin_8lsb; //6 : V-blank lines 8 lsbits (0–4095) uint VBlin_4msb :4; //7.3-0 : V-blank lines 4 msbits uint VAlin_4msb :4; //7.7-4 : Vertical active lines 4 msbits u8_t HOsync_8lsb; //8 : H-sync offset in pix 8 lsbits (0–1023) From blanking start u8_t HsyncW_8lsb; //9 : H-sync pulse width in pix 8 lsbits (0–1023) uint VsyncW_4lsb :4; //10.3-0 : V-sync pulse width in lines 4 lsbits (0–63) uint VOsync_4lsb :4; //10.7-4 : V-sync offset in lines 4 lsbits (0–63) uint VsyncW_2msb :2; //11.1-0 : V-sync pulse width in lines 2 msbits uint VOsync_2msb :2; //11.3-2 : V-sync offset in lines 2 msbits uint HsyncW_2msb :2; //11.5-4 : H-sync pulse width in pix 2 msbits uint HOsync_2msb :2; //11.7-6 : H-sync offset in pix 2 msbits u8_t Hsize_8lsb; //12 : Horizontal display size, mm, 8 lsbits (0–4095) u8_t Vsize_8lsb; //13 : Vertical display size, mm, 8 lsbits (0–4095) uint Vsize_4msb :4; //14.3-0 Vertical display size, mm, 4 lsbits uint Hsize_4msb :4; //14.7-4 Horizontal display size, mm, 4 msbits u8_t Hborder_pix; //15 : Horizontal border pixels (each side; total is twice this) u8_t Vborder_lin; //16 : Vertical border lines (each side; total is twice this) dtd_feat_t features; //17 : Features flags (interlace, sync type, audio format) } dtd_t; //Alternative Descriptors /* Defined descriptor types: 0xFF: MSN: Monitor serial number (text, ASCII) 0xFE: UTX: Unspecified text (text, ASCII). 0xFD: MRL: Monitor range limits. 6- or 13-byte descriptor. 0xFC: MND: Monitor name (text, ASCII), padded with 0A 20 20 (LF, SP). 0xFB: WPD: Additional white point data. 2× 5-byte descriptors, padded with 0A 20 20. 0xFA: AST: Additional standard timings identifiers. 6× 2-byte descriptors, padded with 0A. 0xF9: CMD: Color Management Data 0xF8: CT3: VESA-CVT 3-byte Video Timing Codes 0xF7: ET3: Estabilished Timings 3 Descriptor 0x10: (VOID) Dummy descriptor for marking unused space 0x00 .. 0x0F reserved for vendors */ //Alt. DEsc. header typedef struct __attribute__ ((packed)) { //dshd_s u8_t zero_hdr[3]; //0-2 : *magic* pix_clk=0, HApix_8lsb=0 -> not a DTD u8_t dsc_type; //3 : 0xF7-0xFF defined, 0x10 emty desc., 0x00-0x0F for vendors. u8_t rsvd4; //4 : mandatory zero } dshd_t; //MRL: Monitor Range Limits Descriptor (type 0xFD) - data //MRL: GTF Secondary Curve typedef struct __attribute__ ((packed)) { //mrl_gtf_s u8_t resvd; //11 : Reserved, mandatory zero. u8_t sfreq_sec; //12 : Start frequency for secondary curve, divided by 2 kHz (0–510 kHz) u8_t gtf_c; //13 : GTF C value, multiplied by 2 (0–127.5) u16_t gtf_m; //14-15 : GTF M value (0–65535, LE) u8_t gtf_k; //16 : GTF K value (0–255) u8_t gtf_j; //17 : GTF J value, multiplied by 2 (0–127.5) } mrl_gtf_t; //MRL: VESA-CVT support information typedef struct __attribute__ ((packed)) { //mrl_cvt_s u8_t cvt_ver; //11 : CVT spec. version, 4msb: major, 4lsb: minor ver. number uint maxHApix_2msb :2; //12.01 Max active pixels, 2 msb, uint maxPixClk_6lsb :6; /*12.37 Max PixClk: additional precision bits MRL.max_pixclk Max. Pix Clk = [(Byte 9) × 10] – [(Byte 12: bits 7 → 2) × 0.25MHz] Byte 9 is rounded up to the nearest multiple of 10 MHz */ u8_t maxHApix_8lsb; /*13 Max horizontal active pixels, 8 lsb, 10bit range: 0..1023, 0x00: no limit */ uint rsvd14_02 :3; //14.02 reserved 0 uint aspr_4_3 :1; //14.3 aspect ratio 4:3 (1: supported ) uint aspr_16_9 :1; //14.4 aspect ratio 16:9 uint aspr_16_10 :1; //14.5 aspect ratio 16:10 uint aspr_5_4 :1; //14.6 aspect ratio 5:4 uint aspr_15_9 :1; //14.7 aspect ratio 15:9 uint rsvd15_02 :3; //15.02 reserved 0 uint blank_std :1; //15.3 std CVT blanking, 1: supported uint blank_rb :1; //15.4 CVT Reduced Blanking, 1: supported uint pref_ar :3; /*15.57 preferred aspect ratio: 0b000: 4:3, 0b001: 16:9, 0b010: 16:10 0b011: 5:4, 0b100: 15:9 */ uint rsvd16_03 :4; //16.03 reserved 0 uint H_shrink :1; //16.4 Horizontal shrink, 1: supported uint H_stretch :1; //16.5 Horizontal stretch, 1: supported uint V_shrink :1; //16.6 Vertival shrink, 1: supported uint V_stretch :1; //16.7 Vertival stretch, 1: supported u8_t pref_vref; //17 preferred V-Refresh rate, 1..255Hz, 0: reserved } mrl_cvt_t; typedef union mrl_ext_s { mrl_gtf_t gtf_s; //GTF support (secondary) mrl_cvt_t cvt_s; //CVT support u8_t bytes[7]; //unused data } mrl_ext_u; typedef struct __attribute__ ((packed)) { //mrl_s dshd_t hdr; //0-4 : alternative descriptor header u8_t min_Vfreq; //5 : 1-255Hz u8_t max_Vfreq; //6 : 1-255Hz u8_t min_Hfreq; //7 : 1-255kHz u8_t max_Hfreq; //8 : 1-255kHz u8_t max_pixclk; //9 : Max pixel clock rate, in 10 MHz units (10–2550 MHz) u8_t mrl_ext; /*10: extended MRL information: 0x00: Default GTF supported if enabled in SPF (no secondary GTF) 0x01: Range Limits only, in both cases bytes 12-17 should be set to 0x0A 20 20 20 20 20 20. 0x02: GTF parameters in bytes 12-17 0x04: VESA CVT support info in bytes 12-17 */ mrl_ext_u ex_dat; //11-17: extension data: depends on byte10, mrl_ext } mrl_t; //WPD: additional White Point Descriptor (type 0xFB) - data typedef struct __attribute__ ((packed)) { //wpd_s dshd_t hdr; //0-4 : alternative descriptor header u8_t wp1_idx; //5 : White point index number (1–255), 0 -> descriptor not used. uint wp1y_2lsb :2; //6.1-0 White point y value, 2 lsbits uint wp1x_2lsb :2; //6.3-2 White point x value, 2 lsbits uint wp1xy_nu :4; //6.7-4 unused, mandatory zero. u8_t wp1x_8msb; //7 u8_t wp1y_8msb; //8 u8_t wp1_gamma; //9 : (gamma*100)-100 (1.0 ... 3.54) u8_t wp2_idx; //10 : White point index number (1–255), 0 -> descriptor not used. uint wp2y_2lsb :2; //11.1-0 White point y value, 2 lsbits uint wp2x_2lsb :2; //11.3-2 White point x value, 2 lsbits uint wp2xy_nu :4; //11.7-4 unused, mandatory zero. u8_t wp2x_8msb; //12 u8_t wp2y_8msb; //13 u8_t wp2_gamma; //14 : (gamma*100)-100 (1.0 ... 3.54) u8_t pad[3]; //15-17 : padded with 0A 20 20. (LF, SP) } wpd_t; //MND: Monitor Name Descriptor (type 0xFC) - data typedef struct __attribute__ ((packed)) { //mnd_s dshd_t hdr; //0-4 : alternative descriptor header u8_t text[13]; //5-17 : Monitor Name padded with 0A 20 20. (LF, SP, SP) } utx_t; //AST: Additional Standard Timings identifiers (type 0xFA) - data typedef struct __attribute__ ((packed)) { //ast_s dshd_t hdr; //0-4 : alternative descriptor header //STI: DMT STD 2-byte Standard Timing Information dmt_std2_t sti0; //5,6 dmt_std2_t sti1; //7,8 dmt_std2_t sti2; //9,10 dmt_std2_t sti3; //11,12 dmt_std2_t sti4; //13,14 dmt_std2_t sti5; //15,16 u8_t pad; //17: pad: const 0x0A } ast_t; //DCM: Display Color Management Data (type 0xF9) typedef struct __attribute__ ((packed)) { //dcm_t dshd_t hdr; //0-4 : alternative descriptor header // u8_t ver; //5 : version == 0x03, other values reserved //polynomial coefficients: value = coef_val*100, rounded to i16_t, LE u16_t red_a3; //6,7 u16_t red_a2; //8,9 u16_t grn_a3; //10,11 u16_t grn_a2; //12,13 u16_t blu_a3; //14,15 u16_t blu_a2; //16,17 } dcm_t; //CT3: VESA-CVT 3-byte Video Timing Codes (type 0xF8) //CVT3 VESA-CVT 3-byte Timing Code typedef struct __attribute__ ((packed)) { //dmt_cvt3_s //byte 0 u8_t VAlin_8lsb; //0 : Vertical active lines 8 lsbits (0–4095) 0x00 - reserved // value stored: [(VAlin/2)–1] //byte 1 uint res0_01 :2; //0,1 : reserved 0 uint asp_ratio :2; //2,3 : 0b00: 4:3, 0b01: 16:9, 0b10: 16:10, 0b11: 15:9 uint VAlin_4msb :4; //4-7 : Vertical active lines 4 msbits //byte 2: uint vref60rb :1; //0 : 60Hz, Reduced Blanking uint vref85 :1; //1 : std blanking (CRT) uint vref75 :1; //2 : uint vref60 :1; //3 : uint vref50 :1; //4 : uint pref_vref :2; //5,6 : preferred Vref: 0b00: 50Hz, 0b01: 60Hz, 0b10: 75Hz, 0b11: 85Hz uint res2_7 :1; //7 : reserved 0 } dmt_cvt3_t; typedef struct __attribute__ ((packed)) { //ctm_s dshd_t hdr; //0-4 : alternative descriptor header // u8_t ver; //5 : version == 0x01, other values reserved // dmt_cvt3_t cvt3_0; //6-8: 1st CVT3 desc, highest priority dmt_cvt3_t cvt3_1; //9-11: dmt_cvt3_t cvt3_2; //12-14: dmt_cvt3_t cvt3_3; //15-17: 4th CVT3 desc, lowest priority, 0x000000 -> unused } ctm_t; //ET3: Estabilished Timings 3 Descriptor (type 0xF7) typedef struct __attribute__ ((packed)) { //et3_dsc_s dshd_t hdr; //0-4 : alternative descriptor header // u8_t ver; //5 : version == 0x0A, other values reserved //byte 6 uint m1152x864v75 :1; //bit 0 uint m1024x768v85 :1; uint m800x600v85 :1; uint m848x480v60 :1; uint m640x480v85 :1; uint m720x400v85 :1; uint m640x400v85 :1; uint m640x350v85 :1; //bit 7 //byte 7 uint m1280x1024v85 :1; uint m1280x1024v60 :1; uint m1280x960v85 :1; uint m1280x960v60 :1; uint m1280x768v85 :1; uint m1280x768v75 :1; uint m1280x768v60 :1; uint m1280x768v60rb :1; //Reduced Blanking v1 //byte 8 uint m1400x1050v75 :1; uint m1400x1050v60 :1; uint m1400x1050v60rb :1; uint m1440x900v85 :1; uint m1440x900v75 :1; uint m1440x900v60 :1; uint m1440x900v60rb :1; uint m1360x768v60 :1; //byte 9 uint m1600x1200v70 :1; uint m1600x1200v65 :1; uint m1600x1200v60 :1; uint m1680x1050v85 :1; uint m1680x1050v75 :1; uint m1680x1050v60 :1; uint m1680x1050v60rb :1; uint m1400x1050v85 :1; //byte 10 uint m1920x1200v60 :1; uint m1920x1200v60rb :1; uint m1856x1392v75 :1; uint m1856x1392v60 :1; uint m1792x1344v75 :1; uint m1792x1344v60 :1; uint m1600x1200v85 :1; uint m1600x1200v75 :1; //byte 11 uint res03 :4; uint m1920x1440v75 :1; uint m1920x1440v60 :1; uint m1920x1200v85 :1; uint m1920x1200v75 :1; //byte 12..17: reserved, 0 u8_t res_12_17 [6]; } et3_t; //UNK: Unknown Descriptor (type != 0xFA-0xFF) typedef struct __attribute__ ((packed)) { //unk_s dshd_t hdr; //0-4 : alternative descriptor header u8_t unkb[13]; //5-17 : unknown byte values } unk_t; //final descriptor type / union typedef union dsctor_s { u8_t bytes[18]; // dtd_t dtd; // utx_t msn; // 0xFF: MSN: Monitor Serial Number Descriptor utx_t utx; // 0xFE: UTX: Unspecified Text mrl_t mrl; // 0xFD: MRL: Monitor Range Limits Descriptor utx_t mnd; // 0xFC: MND: Monitor Name Descriptor wpd_t wpd; // 0xFB: WPD: White Point Descriptor ast_t ast; // 0xFA: AST: Additional Standard Timing identifiers dcm_t dcm; // 0xF9: DCM: Display Color Management Data ctm_t ctm; // 0xF8: CTM: VESA-CVT 3-byte Timing Codes et3_t et3; // 0xF7: ET3: Estabilished Timings 3 Descriptor unk_t unk; // UNK: Unknown Descriptor (type undefined) // 0x10: (VOID) Dummy descriptor == UNK } dsctor_u; //------------------------------------------------------------------------------------------------- //EDID block0: base structure (128 bytes) typedef struct __attribute__ ((packed)) { //edid_s //header - generic info hdr_t hdr; //0–7 : Fixed header pattern: 0x00_FF_FF_FF_FF_FF_FF_00 mfc_id_u mfc_id; //8-9 u16_t prod_id; //10–11 : product code u32_t serial; //12–15 u8_t prodweek; //16 u8_t year; //17 (1990–2245). If week=255, it is the model year instead. //version info u8_t edid_ver; //18 u8_t edid_rev; //19 //video input vid_in_t vinput_dsc; //20 //basic display descriptor bdd_t bdd; //21-23 dsp_feat_t features; //24 : Supported features //chromacity coords chromxy_t chromxy; //25-34 : Chromaticity coordinates. 10-bit CIE xy coords for R,G,B and white. //resolution map est_map_t res_map; //35-37 : Supported resolutions flags //std timing descriptors dmt_std2_t std_timg0; //38-39 : 38-53 Standard (old) timing info blocks, 0x0101 if unused dmt_std2_t std_timg1; //40-41 dmt_std2_t std_timg2; //42-43 dmt_std2_t std_timg3; //44-45 dmt_std2_t std_timg4; //46-47 dmt_std2_t std_timg5; //48-49 dmt_std2_t std_timg6; //50-51 dmt_std2_t std_timg7; //52-53 //detailed descriptors dsctor_u descriptor0; //54-71 : DTD, MRL, WPD, ... dsctor_u descriptor1; //72-89 dsctor_u descriptor2; //90-107 dsctor_u descriptor3; //108-125 u8_t num_extblk; //126 : number of extension data blocks u8_t chksum; //127 : Sum of all 128 bytes should equal 0 (mod 256). } edid_t; /* Descriptor blocks 0-3: Detailed timing descriptors, in decreasing preference order. After all detailed timing descriptors, additional descriptors are permitted: Monitor range limits (required) ASCII text (monitor name (required), monitor serial number or unstructured text) 6 Additional standard timing information blocks Color point data */ #endif /* EDID_H */ wxedid-0.0.32/src/def_types.h0000644000175000017500000000162514722720160012730 00000000000000 #ifndef DEF_TYPES_H #define DEF_TYPES_H 1 #include #include #ifndef __HAVE_U8_T #define __HAVE_U8_T typedef uint8_t u8_t; #endif #ifndef __HAVE_U16_T #define __HAVE_U16_T typedef uint16_t u16_t; #endif #ifndef __HAVE_U32_T #define __HAVE_U32_T typedef uint32_t u32_t; #endif #ifndef __HAVE_U64_T #define __HAVE_U64_T typedef uint64_t u64_t; #endif #ifndef __HAVE_I8_T #define __HAVE_I8_T typedef int8_t i8_t; #endif #ifndef __HAVE_I16_T #define __HAVE_I16_T typedef int16_t i16_t; #endif #ifndef __HAVE_I32_T #define __HAVE_I32_T typedef int32_t i32_t; #endif #ifndef __HAVE_I64_T #define __HAVE_I64_T typedef int64_t i64_t; #endif #ifndef __HAVE_UINT_T #define __HAVE_UINT_T typedef unsigned int uint; #endif #ifndef __HAVE_ULONG_T #define __HAVE_ULONG_T typedef unsigned long ulong; #endif #endif /* DEF_TYPES_H */ wxedid-0.0.32/src/wxedid.rcdgen_cfg0000644000175000017500000000052314722720160014060 00000000000000#rcd_autogen: arguments for target: "wxedid" #base name for output files, prefix for function names and variables --base-name=wxedid #language & preprocessor --lang=CPP --preproc=g++ --pp-args='-E -Wfatal-errors' #dirs --root-dir=src --out-dir=. --temp-dir=tmp #scan target --scan-target=. #verbose & debug --verbose --debug-level=0 wxedid-0.0.32/src/EDID_base.cpp0000644000175000017500000013115514722720160013002 00000000000000/*************************************************************** * Name: EDID_base.cpp * Purpose: EDID base data groups * Author: Tomasz Pawlak (tomasz.pawlak@wp.eu) * Copyright: Tomasz Pawlak (C) 2014-2024 * License: GPLv3+ **************************************************************/ #include "debug.h" #include "rcdunits.h" #ifndef idEDID_BASE #error "EDID_base.cpp: missing unit ID" #endif #define RCD_UNIT idEDID_BASE #include "rcode/rcode.h" #include "wxedid_rcd_scope.h" RCD_AUTOGEN_DEFINE_UNIT #include #include "vmap.h" #include "EDID_class.h" #include "CEA_class.h" #include "CEA_ET_class.h" #include WX_DEFINE_OBJARRAY(wxArGrpField); //bad block length msg (defined in CEA.cpp) extern const char ERR_GRP_LEN_MSG[]; //shared for CEA_ET_class.cpp: STI/DMT descriptions extern const char stiXres8dsc []; extern const char stiVsyncDsc []; extern const char stiAspRatioDsc[]; extern const char stiDMT2B_Dsc []; //unknown/invalid byte field (defined in CEA.cpp) extern const edi_field_t unknown_byte_fld; extern void insert_unk_byte(edi_field_t *p_fld, u32_t len, u32_t s_offs); //BED: Base EDID data //BED: Base EDID data : handlers rcode EDID_cl::MfcId(u32_t op, wxString& sval, u32_t& ival, edi_dynfld_t* p_field) { rcode retU; u8_t *inst; mfc_id_u mfc_swap; char cbuff[4]; inst = getValPtr(p_field); if (op == OP_READ) { //MfcId: ASCII letters A-Z less 0x40 //swap bytes in PNP_ID - BE->LE byte order: mfc_swap.u16 = rdWord16_LE(inst); _LE_SWAP16(mfc_swap.u16); ival = mfc_swap.u16; cbuff[0] = (0x40+mfc_swap.mfc.ltr1); cbuff[1] = (0x40+mfc_swap.mfc.ltr2); cbuff[2] = (0x40+mfc_swap.mfc.ltr3); cbuff[3] = 0; sval = wxString::FromAscii(cbuff); } else { if (op == OP_WRINT) RCD_RETURN_FAULT(retU); if (sval.Len() != 3) RCD_RETURN_FAULT(retU); memcpy(cbuff, sval.ToAscii(), 3); mfc_swap.mfc.ltr1 = (cbuff[0]-0x40); //& 0x1F; mfc_swap.mfc.ltr2 = (cbuff[1]-0x40); mfc_swap.mfc.ltr3 = (cbuff[2]-0x40); mfc_swap.mfc.resvd = 0; _LE_SWAP16(mfc_swap.u16); wrWord16_LE(inst, mfc_swap.u16); } RCD_RETURN_OK(retU); } rcode EDID_cl::ProdSN(u32_t op, wxString& sval, u32_t& ival, edi_dynfld_t* p_field) { rcode retU; u32_t *inst; inst = reinterpret_cast (getValPtr(p_field)); //EDID_buff.edi.base.serial; if (op == OP_READ) { ival = *inst; _BE_SWAP32(ival); sval << ival; RCD_SET_OK(retU); } else { ulong tmpv; RCD_SET_FAULT(retU); if (op == OP_WRSTR) { if (! sval.ToULong(&tmpv, 10)) RCD_RETURN_FAULT(retU); ival = tmpv; RCD_SET_OK(retU); } else if (op == OP_WRINT) { RCD_SET_OK(retU); } if (! RCD_IS_OK(retU)) return retU; _BE_SWAP32(ival); *inst = ival; } return retU; } rcode EDID_cl::ProdWk(u32_t op, wxString& sval, u32_t& ival, edi_dynfld_t* p_field) { rcode retU; u8_t *inst; inst = getValPtr(p_field); //EDID_buff.edi.base.prodweek if (op == OP_READ) { sval << (int) *inst; ival = *inst; RCD_SET_OK(retU); } else { RCD_SET_FAULT(retU); if (op == OP_WRSTR) { ulong tmpv; retU = getStrUint(sval, 10, 0, 255, tmpv); if (! RCD_IS_OK(retU)) return retU; ival = tmpv; } if (op == OP_WRINT) { RCD_SET_OK(retU); } if (RCD_IS_OK(retU)) { if ((ival == 0) || ((ival > 52) && (ival != 255)) ) { RCD_RETURN_FAULT(retU); } *inst = ival; } } return retU; } rcode EDID_cl::ProdYr(u32_t op, wxString& sval, u32_t& ival, edi_dynfld_t* p_field) { rcode retU; u8_t *inst; inst = getValPtr(p_field); //EDID_buff.edi.base.year if (op == OP_READ) { ival = *inst; ival += 1990; sval << ival; RCD_SET_OK(retU); } else { ulong tmpv = 0; RCD_SET_FAULT(retU); if (op == OP_WRSTR) { retU = getStrUint(sval, 10, 1990, 2245, tmpv); if (! RCD_IS_OK(retU)) return retU; } else if (op == OP_WRINT) { tmpv = ival; RCD_SET_OK(retU); } tmpv -= 1990; *inst = tmpv; } return retU; } //EDID: STI dynamic block name void EDID_cl::STI_DBN(EDID_cl& EDID, wxString& dyngp_name, wxArGrpField& FieldsAr) { enum { STI_IDX_DMT2 = 3, }; typedef struct { u32_t numrtr; u32_t denomr; } ratio_t; typedef union { u16_t dmt2; dmt_std2_t std2T; } stdT_u; //NOTE: not checking for EDID version < 1.3, 1st aspect ratio is fixed, 16:10 ratio_t asp_ratio[4] = { {16, 10}, { 4, 3}, { 5, 4}, {16, 9} }; edi_dynfld_t *p_field; const vmap_ent_t *m_ent; u32_t xres; u32_t yres; u32_t aspr; u32_t vref; stdT_u STD2; //DMT STD2 code p_field = FieldsAr.Item(STI_IDX_DMT2); STD2.dmt2 = rdWord16_LE(p_field->base); if (0x0101 == STD2.dmt2) { dyngp_name = "not used"; return; } //STD2 code bytes are stored in reversed order: STD2.dmt2 = __bswap_16(STD2.dmt2); //check if the STD2 code is stanardised: m_ent = vmap_GetVmapEntry(VS_STD2_VIDFMT, VMAP_VAL, STD2.dmt2); if (m_ent != NULL) { //found std name, which can contain RB mark dyngp_name = wxString::FromAscii(m_ent->name); return; } STD2.dmt2 = __bswap_16(STD2.dmt2); //X-res xres = STD2.std2T.HApix; xres += 31; xres <<= 3; //aspect ratio aspr = STD2.std2T.asp_ratio; //V-Refresh vref = STD2.std2T.v_ref; vref += 60; yres = xres; yres *= asp_ratio[aspr].denomr; yres /= asp_ratio[aspr].numrtr; dyngp_name.Empty(); dyngp_name << xres << "x" << yres << " @ " << vref << "Hz"; dyngp_name << " (!std)"; } //BED: Base EDID data const char edibase_cl::CodN[] = "BED"; const char edibase_cl::Name[] = "Basic EDID data"; const char edibase_cl::Desc[] = "Basic EDID data"; const edi_field_t edibase_cl::fields[] = { {&EDID_cl::ByteStr, 0, offsetof(edid_t, hdr), 0, 8, F_STR|F_HEX|F_RD|F_NI, 0, 0, "header", "*magic* byte sequence for EDID structure identification:\n 00 FF FF FF FF FF FF 00" }, {&EDID_cl::MfcId, 0, offsetof(edid_t, mfc_id), 0, 2, F_STR|F_RD|F_NI|F_DN, 0, 0, "mfc_id", "Short manufacturer id: 3 capital letters.\n2 bytes in Big Endian byte order, " "5 bits per letter, 1 bit (msb) left reserved = 0." }, {&EDID_cl::Word16, 0, offsetof(edid_t, prod_id), 0, 2, F_HEX|F_RD|F_DN, 0, 0xFFFF, "prod_id", "Product identifier number" }, {&EDID_cl::ProdSN, 0, offsetof(edid_t, serial), 0, 4, F_INT|F_RD, 0, 0xFFFFFFFF, "serial", "Product serial number, 32bit" }, {&EDID_cl::ProdWk, 0, offsetof(edid_t, prodweek), 0, 1, F_INT|F_RD, 0, 255, "prod_week", "Week of the year in which the product was manufactured.\n" "If week=0, then the field is not used.\n" "If week=255 (0xFF), then the Year field means the model release year." }, {&EDID_cl::ProdYr, 0, offsetof(edid_t, year), 0, 1, F_INT|F_RD, 0, 255, "prod_year", "Year of manufacuring or model release,\n" "If week=255, then the value is a model release year.\n" "Values 0-255 are mapped to years 1990–2245" }, {&EDID_cl::ByteVal, 0, offsetof(edid_t, edid_ver), 0, 1, F_BTE|F_INT|F_RD, 1, 1, "edid_ver", "EDID version" }, {&EDID_cl::ByteVal, 0, offsetof(edid_t, edid_rev), 0, 1, F_BTE|F_INT|F_RD, 0, 4, "edid_rev", "EDID revision" }, {&EDID_cl::ByteVal, 0, offsetof(edid_t, edid_rev)+1, 0, 1, F_BTE|F_INT|F_RD, 0, 3, "num_extblk", "Number of extension blocks.\n\n" "If num_extblk==0, extension block is not saved, regardles of whether it was loaded or not.\n" "If num_extblk==1, and the extension block is not present, Saving/Exporting functions will fail." "\n\nNOTE: wxEDID supports only 1 extension of type CTA-861" }, {&EDID_cl::ByteVal, 0, offsetof(edid_t, edid_rev)+2, 0, 1, F_BTE|F_HEX|F_RD, 0, 255, "checksum", "Block checksum:\n [sum_of_bytes(0-127) mod 256] + checkum_field_val must be equal to zero.\n\n" "NOTE: this byte is physically located at the end of the block (offset 127)" } }; #pragma GCC diagnostic ignored "-Wunused-parameter" rcode edibase_cl::init(const u8_t* inst, u32_t orflags, edi_grp_cl* parent) { static const u32_t fcount = 10; rcode retU; const edid_t *pedid; pedid = reinterpret_cast (inst); parent_grp = parent; type_id.t32 = ID_BED | T_GRP_FIXED; abs_offs = offsetof(edid_t, hdr); //0 rel_offs = abs_offs; //num_extblk & chksum are copied to local buffer, //so the corresponding field offsets are changed CopyInstData(inst, offsetof(edid_t, vinput_dsc)); //20: last byte is edid_t.edid_rev (19). hdr_sz = dat_sz; inst_data[dat_sz++] = pedid->num_extblk; inst_data[dat_sz++] = pedid->chksum; retU = init_fields(&fields[0], inst_data, fcount, false, Name, Desc, CodN); return retU; } #pragma GCC diagnostic warning "-Wunused-parameter" void edibase_cl::SpawnInstance(u8_t *pinst) { u32_t dsz; edid_t *pedid; pedid = reinterpret_cast (pinst); dsz = dat_sz; dsz -= 2; //num_extblk & chksum memcpy(pinst, inst_data, dsz); pedid->num_extblk = inst_data[dsz++]; pedid->chksum = inst_data[dsz ]; } void edibase_cl::getGrpName(EDID_cl& EDID, wxString& gp_name) { edi_dynfld_t *p_field; u32_t ival; if (! EDID.b_GrpNameDynamic) { gp_name = GroupName; return; } //MFC ID p_field = FieldsAr.Item(1); EDID.gp_name.Empty(); ( EDID.*p_field->field.handlerfn )(OP_READ, EDID.gp_name, ival, p_field ); gp_name = EDID.gp_name; //Prod ID p_field = FieldsAr.Item(2); EDID.gp_name.Empty(); ( EDID.*p_field->field.handlerfn )(OP_READ, EDID.gp_name, ival, p_field ); gp_name << ", prod_ID " << EDID.gp_name; } //VID: Video Input Descriptor //VID: input type selector. sm_vmap VID_input_map = { {0, {0, "Analog" , NULL}}, {1, {0, "Digital", NULL}} }; //VID: Video Input Descriptor : handlers const char vindsc_cl::CodN[] = "VID"; const char vindsc_cl::Name[] = "Video Input Descriptor"; const char vindsc_cl::Desc[] = "Video Input Descriptor.\n" "Some fields have different meaning depending on input type. This results in " "that some fields are overlapped and changing one value will change the other.\n\n" "NOTE: Bits 1-6: Digital input: Mandatory zero for EDID version < v1.4.\n"; //VID: bit7=0, analog input const edi_field_t vindsc_cl::in_analog[] = { {&EDID_cl::BitVal, VS_VID_INPUT, 0, 7, 1, F_BIT|F_VS|F_FR|F_DN, 0, 1, "Input Type", "Bit7: Input signal type: 1=digital, 0=analog" }, {&EDID_cl::BitVal, 0, 0, 0, 1, F_BIT|F_FR, 0, 1, "vsync", "Bit0: Analog input: 1= if composite sync/sync-on-green is used, VSync pulse is \"serrated\". " "This is more commonly known as \"SandCastle Pulse\" - created from overlapped H-sync " "and V-sync pulses during V-Blank time." }, {&EDID_cl::BitVal, 0, 0, 1, 1, F_BIT, 0, 1, "sync_green", "Bit1: Analog input: Sync_on_green supported (SOG)." }, {&EDID_cl::BitVal, 0, 0, 2, 1, F_BIT, 0, 1, "comp_sync", "Bit2: Analog input: Composite sync (on HSync line) supported" }, {&EDID_cl::BitVal, 0, 0, 3, 1, F_BIT, 0, 1, "sep_sync", "Bit3: Analog input: Separate sync supported" }, {&EDID_cl::BitVal, 0, 0, 4, 1, F_BIT, 0, 1, "blank_black", "Bit4: Analog input: Blank-to-black setup or pedestal per appropriate Signal Level Standard expected" }, {&EDID_cl::BitF8Val, 0, 0, 5, 2, F_BFD, 0, 3, "sync_wh_lvl", "Bits 5,6: Analog input: Video white and sync levels, relative to blank:\n" "00: +0.7/−0.3 V;\n" "01: +0.714/−0.286 V;\n" "10: +1.0/−0.4 V;\n" "11: +0.7/0 V" } }; //VID: bit7=1, digital input const edi_field_t vindsc_cl::in_digital[] = { {&EDID_cl::BitVal, VS_VID_INPUT, 0, 7, 1, F_BIT|F_VS|F_FR|F_DN, 0, 1, "Input Type", "Bit7: Input signal type: 1=digital, 0=analog" }, {&EDID_cl::BitVal, 0, 0, 0, 1, F_BIT, 0, 1, "VESA compat", "Bit0: Digital input: EDID v1.3: compatibility with VESA DFP v1.x TMDS CRGB, 1 pix per clock, " "up to 8 bits per color, MSB aligned, DE active high.\n\n" "NOTE#1: In EDID v1.4 this bit has changed meaning: LSB of \"Digital Interface Type\"\n" "NOTE#2: This field overlap fields defined for Analog input." }, {&EDID_cl::BitF8Val, 0, 0, 0, 4, F_BFD, 0, 0xF, "IF Type", "Bits 0-3: EDID v1.4: Digital input: Digital Interface Type:\n" "0000 = undefined / mandatory zero for EDID v1.3\n" "0001 = DVI / EDIDv1.3: VESA DFP v1.x compatibility flag\n" "0010 = HDMI-a\n" "0011 = HDMI-b\n" "0100 = MDDI\n" "0101 = DisplayPort\n" ">0101 = reserved\n\n" "NOTE: This field overlap fields defined for Analog input." }, {&EDID_cl::BitF8Val, 0, 0, 4, 3, F_BFD, 0, 0x7, "Color Depth", "Bits 4-6: Digital input: Color Bit Depth (bits per primary color):\n" "000 = undefined / mandatory zero for EDID v1.3\n" "001 = 6\n" "010 = 8\n" "011 = 10\n" "100 = 12\n" "101 = 14\n" "110 = 16\n" "111 = reserved\n\n" "NOTE: This field overlap fields defined for Analog input." }, }; #pragma GCC diagnostic ignored "-Wunused-parameter" rcode vindsc_cl::init(const u8_t* inst, u32_t orflags, edi_grp_cl* parent) { rcode retU; parent_grp = parent; type_id.t32 = ID_VID | T_GRP_FIXED; abs_offs = offsetof(edid_t, vinput_dsc); rel_offs = abs_offs; CopyInstData(inst, sizeof(vid_in_t)); //pre-alloc buffer for array of fields dyn_fldar = (edi_field_t*) malloc( max_fcnt * sizeof(edi_field_t) ); if (NULL == dyn_fldar) RCD_RETURN_FAULT(retU); //no error possible, init_fields is always called. retU = gen_data_layout(inst_data); retU = init_fields(&dyn_fldar[0], inst_data, dyn_fcnt, false, Name, Desc, CodN); return retU; } #pragma GCC diagnostic warning "-Wunused-parameter" rcode vindsc_cl::ForcedGrpRefresh() { rcode retU; //clear fields memset( (void*) dyn_fldar, 0, ( max_fcnt * EDI_FIELD_SZ ) ); //no error possible, init_fields is always called. retU = gen_data_layout(inst_data); retU = init_fields(dyn_fldar, inst_data, dyn_fcnt); return retU; } rcode vindsc_cl::gen_data_layout(const u8_t* inst) { rcode retU; int md_digital; //note: EDID block 0: static descriptors use block0 ptr as instance ptr. md_digital = reinterpret_cast (inst)->digital.input_type; if (1 == md_digital) { memcpy( dyn_fldar, in_digital, (in_digital_fcnt * EDI_FIELD_SZ) ); dyn_fcnt = in_digital_fcnt; } else { memcpy( dyn_fldar, in_analog, (in_analog_fcnt * EDI_FIELD_SZ) ); dyn_fcnt = in_analog_fcnt; } RCD_RETURN_OK(retU); } void vindsc_cl::getGrpName(EDID_cl& EDID, wxString& gp_name) { edi_dynfld_t *p_field; u32_t ival; if (! EDID.b_GrpNameDynamic) { gp_name = GroupName; return; } //input type p_field = FieldsAr.Item(0); EDID.gp_name.Empty(); ( EDID.*p_field->field.handlerfn )(OP_READ, EDID.gp_name, ival, p_field ); if (0 == ival) { EDID.gp_name = "Analog"; } else { EDID.gp_name = "Digital"; } gp_name = "Video input: "; gp_name << EDID.gp_name; } //BDD: basic display descriptor : handlers //BDD: basic display descriptor const char bddcs_cl::CodN[] = "BDD"; const char bddcs_cl::Name[] = "Basic Display Descriptor"; const char bddcs_cl::Desc[] = "Basic Display Descriptor"; const edi_field_t bddcs_cl::fields[] = { {&EDID_cl::ByteVal, 0, offsetof(bdd_t, max_hsize), 0, 1, F_BTE|F_INT|F_CM|F_DN, 0, 255, "max_hsize", "Max horizontal image size, in cm, 0=undefined" }, {&EDID_cl::ByteVal, 0, offsetof(bdd_t, max_vsize), 0, 1, F_BTE|F_INT|F_CM|F_DN, 0, 255, "max_vsize", "Max vertical image size, in cm, 0=undefined" }, {&EDID_cl::Gamma, 0, offsetof(bdd_t, gamma), 0, 1, F_FLT|F_NI, 0, 255, "gamma", "Byte value = (gamma*100)-100 (range 1.00–3.54)" } }; #pragma GCC diagnostic ignored "-Wunused-parameter" rcode bddcs_cl::init(const u8_t* inst, u32_t orflags, edi_grp_cl* parent) { static const u32_t fcount = 3; rcode retU; parent_grp = parent; type_id.t32 = ID_BDD | T_GRP_FIXED; abs_offs = offsetof(edid_t, bdd); rel_offs = abs_offs; CopyInstData(inst, sizeof(bdd_t)); retU = init_fields(&fields[0], inst_data, fcount, false, Name, Desc, CodN); return retU; } #pragma GCC diagnostic warning "-Wunused-parameter" void bddcs_cl::getGrpName(EDID_cl& EDID, wxString& gp_name) { edi_dynfld_t *p_field; u32_t ival; if (! EDID.b_GrpNameDynamic) { gp_name = GroupName; return; } //X size p_field = FieldsAr.Item(0); EDID.gp_name.Empty(); ( EDID.*p_field->field.handlerfn )(OP_READ, EDID.gp_name, ival, p_field ); gp_name = "size: "; gp_name << EDID.gp_name; //Y size p_field = FieldsAr.Item(1); EDID.gp_name.Empty(); ( EDID.*p_field->field.handlerfn )(OP_READ, EDID.gp_name, ival, p_field ); gp_name << "x" << EDID.gp_name << "cm"; } //SPF: Supported features : handlers //SPF: Supported features const char spft_cl::CodN[] = "SPF"; const char spft_cl::Name[] = "Supported features"; const char spft_cl::Desc[] = "Supported features."; const edi_field_t spft_cl::fields[] = { {&EDID_cl::BitVal, 0, 0, 0, 1, F_BIT, 0, 1, "gtf_cfreq", "EDID v1.3: GTF (General Timing Formula) supported with default parameter values\n" "If 'gtf_cfreq'=0, the MRL descriptor can include CVT support information " "EDID v1.4: 'Continuous Frequency Supported': if 1, then MRL descriptor presence is mandatory." }, {&EDID_cl::BitVal, 0, 0, 1, 1, F_BIT, 0, 1, "dtd0_native", "If set to 1, DTD0 (offs=54) contains \"preferred timing mode\" - i.e. the native and " "thus recommended timings (pixel-correct).\nFor EDID v1.3+ DTD0 is always treated as \"preferred\", " "and this bit should be set to 1." }, {&EDID_cl::BitVal, 0, 0, 2, 1, F_BIT, 0, 1, "std_srbg", "Standard sRGB colour space. Chromacity coords (bytes 25–34) must contain sRGB standard values." }, {&EDID_cl::BitF8Val, 0, 0, 3, 2, F_BFD, 0, 3, "vsig_format", "Video signal format:\nDisplay type analog:\n" " 00 = Monochrome or Grayscale;\n 01 = RGB color;\n" " 10 = Non-RGB multi-color;\n 11 = Undefined\n" "Display type digital:\n 00 = RGB 4:4:4;\n 01 = RGB 4:4:4 + YCrCb 4:4:4;\n" " 10 = RGB 4:4:4 + YCrCb 4:2:2;\n 11 = RGB 4:4:4 + YCrCb 4:4:4 + YCrCb 4:2:2" }, {&EDID_cl::BitVal, 0, 0, 5, 1, F_BIT, 0, 1, "dpms_off", "DPMS active-off supported" }, {&EDID_cl::BitVal, 0, 0, 6, 1, F_BIT, 0, 1, "dpms_susp", "DPMS suspend supported" }, {&EDID_cl::BitVal, 0, 0, 7, 1, F_BIT, 0, 1, "dpms_stby", "DPMS standby supported" } }; #pragma GCC diagnostic ignored "-Wunused-parameter" rcode spft_cl::init(const u8_t* inst, u32_t orflags, edi_grp_cl* parent) { const u32_t fcount = 7; rcode retU; parent_grp = parent; type_id.t32 = ID_SPF | T_GRP_FIXED; abs_offs = offsetof(edid_t, features); rel_offs = abs_offs; CopyInstData(inst, sizeof(dsp_feat_t)); //1 retU = init_fields(&fields[0], inst_data, fcount, false, Name, Desc, CodN); return retU; } #pragma GCC diagnostic warning "-Wunused-parameter" //CXY: Chromacity coords : handlers rcode EDID_cl::ChrXY_getWriteVal(u32_t op, wxString& sval, u32_t& ival) { rcode retU; RCD_SET_FAULT(retU); if (op == OP_WRSTR) { float dval; retU = getStrFloat(sval, 0.0, 0.999, dval); if (! RCD_IS_OK(retU)) return retU; ival = (dval*1024.0); } else if (op == OP_WRINT) { ival = (ival & 0x3F); RCD_SET_OK(retU); } return retU; } rcode EDID_cl::CHredX(u32_t op, wxString& sval, u32_t& ival, edi_dynfld_t* field) { rcode retU; ulong tmpv; chromxy_t *chrxy; chrxy = reinterpret_cast (getInstancePtr(field)); if (field == NULL) RCD_RETURN_FAULT(retU); if (op == OP_READ) { float dval; tmpv = (chrxy->red8h_x << 2); tmpv |= chrxy->rgxy_lsbits.red_x; ival = tmpv; dval = tmpv; if (sval.Printf("%.03f", (dval/1024.0)) < 0) { RCD_SET_FAULT(retU); } else { RCD_SET_OK(retU); } } else { retU = ChrXY_getWriteVal(op, sval, ival); if (!RCD_IS_OK(retU)) return retU; tmpv = ival; chrxy->rgxy_lsbits.red_x = (tmpv & 0x03); chrxy->red8h_x = (tmpv >> 2 ); } return retU; } rcode EDID_cl::CHredY(u32_t op, wxString& sval, u32_t& ival, edi_dynfld_t* field) { rcode retU; ulong tmpv; chromxy_t *chrxy; chrxy = reinterpret_cast (getInstancePtr(field)); if (field == NULL) RCD_RETURN_FAULT(retU); if (op == OP_READ) { float dval; tmpv = (chrxy->red8h_y << 2); tmpv |= chrxy->rgxy_lsbits.red_y; ival = tmpv; dval = tmpv; if (sval.Printf("%.03f", (dval/1024.0)) < 0) { RCD_SET_FAULT(retU); } else { RCD_SET_OK(retU); } } else { retU = ChrXY_getWriteVal(op, sval, ival); if (!RCD_IS_OK(retU)) return retU; tmpv = ival; chrxy->rgxy_lsbits.red_y = (tmpv & 0x03); chrxy->red8h_y = (tmpv >> 2 ); } return retU; } rcode EDID_cl::CHgrnX(u32_t op, wxString& sval, u32_t& ival, edi_dynfld_t* field) { rcode retU; ulong tmpv; chromxy_t *chrxy; chrxy = reinterpret_cast (getInstancePtr(field)); if (field == NULL) RCD_RETURN_FAULT(retU); if (op == OP_READ) { float dval; tmpv = (chrxy->green8h_x << 2); tmpv |= chrxy->rgxy_lsbits.green_x; ival = tmpv; dval = tmpv; if (sval.Printf("%.03f", (dval/1024.0)) < 0) { RCD_SET_FAULT(retU); } else { RCD_SET_OK(retU); } } else { retU = ChrXY_getWriteVal(op, sval, ival); if (!RCD_IS_OK(retU)) return retU; tmpv = ival; chrxy->rgxy_lsbits.green_x = (tmpv & 0x03); chrxy->green8h_x = (tmpv >> 2 ); } return retU; } rcode EDID_cl::CHgrnY(u32_t op, wxString& sval, u32_t& ival, edi_dynfld_t* field) { rcode retU; ulong tmpv; chromxy_t *chrxy; chrxy = reinterpret_cast (getInstancePtr(field)); if (field == NULL) RCD_RETURN_FAULT(retU); if (op == OP_READ) { float dval; tmpv = (chrxy->green8h_y << 2); tmpv |= chrxy->rgxy_lsbits.green_y; ival = tmpv; dval = tmpv; if (sval.Printf("%.03f", (dval/1024.0)) < 0) { RCD_SET_FAULT(retU); } else { RCD_SET_OK(retU); } } else { retU = ChrXY_getWriteVal(op, sval, ival); if (!RCD_IS_OK(retU)) return retU; tmpv = ival; chrxy->rgxy_lsbits.green_y = (tmpv & 0x03); chrxy->green8h_y = (tmpv >> 2 ); } return retU; } rcode EDID_cl::CHbluX(u32_t op, wxString& sval, u32_t& ival, edi_dynfld_t* field) { rcode retU; ulong tmpv; chromxy_t *chrxy; chrxy = reinterpret_cast (getInstancePtr(field)); if (field == NULL) RCD_RETURN_FAULT(retU); if (op == OP_READ) { float dval; tmpv = (chrxy->blue8h_x << 2); tmpv |= chrxy->bwxy_lsbits.blue_x; ival = tmpv; dval = tmpv; if (sval.Printf("%.03f", (dval/1024.0)) < 0) { RCD_SET_FAULT(retU); } else { RCD_SET_OK(retU); } } else { retU = ChrXY_getWriteVal(op, sval, ival); if (!RCD_IS_OK(retU)) return retU; tmpv = ival; chrxy->bwxy_lsbits.blue_x = (tmpv & 0x03); chrxy->blue8h_x = (tmpv >> 2 ); } return retU; } rcode EDID_cl::CHbluY(u32_t op, wxString& sval, u32_t& ival, edi_dynfld_t* field) { rcode retU; ulong tmpv; chromxy_t *chrxy; chrxy = reinterpret_cast (getInstancePtr(field)); if (field == NULL) RCD_RETURN_FAULT(retU); if (op == OP_READ) { float dval; tmpv = (chrxy->blue8h_y << 2); tmpv |= chrxy->bwxy_lsbits.blue_y; ival = tmpv; dval = tmpv; if (sval.Printf("%.03f", (dval/1024.0)) < 0) { RCD_SET_FAULT(retU); } else { RCD_SET_OK(retU); } } else { retU = ChrXY_getWriteVal(op, sval, ival); if (!RCD_IS_OK(retU)) return retU; tmpv = ival; chrxy->bwxy_lsbits.blue_y = (tmpv & 0x03); chrxy->blue8h_y = (tmpv >> 2 ); } return retU; } rcode EDID_cl::CHwhtX(u32_t op, wxString& sval, u32_t& ival, edi_dynfld_t* field) { rcode retU; ulong tmpv; chromxy_t *chrxy; chrxy = reinterpret_cast (getInstancePtr(field)); if (field == NULL) RCD_RETURN_FAULT(retU); if (op == OP_READ) { float dval; tmpv = (chrxy->white8h_x << 2); tmpv |= chrxy->bwxy_lsbits.white_x; ival = tmpv; dval = tmpv; if (sval.Printf("%.03f", (dval/1024.0)) < 0) { RCD_SET_FAULT(retU); } else { RCD_SET_OK(retU); } } else { retU = ChrXY_getWriteVal(op, sval, ival); if (!RCD_IS_OK(retU)) return retU; tmpv = ival; chrxy->bwxy_lsbits.white_x = (tmpv & 0x03); chrxy->white8h_x = (tmpv >> 2 ); } return retU; } rcode EDID_cl::CHwhtY(u32_t op, wxString& sval, u32_t& ival, edi_dynfld_t* field) { rcode retU; ulong tmpv; chromxy_t *chrxy; chrxy = reinterpret_cast (getInstancePtr(field)); if (field == NULL) RCD_RETURN_FAULT(retU); if (op == OP_READ) { float dval; tmpv = (chrxy->white8h_y << 2); tmpv |= chrxy->bwxy_lsbits.white_y; ival = tmpv; dval = tmpv; if (sval.Printf("%.03f", (dval/1024.0)) < 0) { RCD_SET_FAULT(retU); } else { RCD_SET_OK(retU); } } else { retU = ChrXY_getWriteVal(op, sval, ival); if (!RCD_IS_OK(retU)) return retU; tmpv = ival; chrxy->bwxy_lsbits.white_y = (tmpv & 0x03); chrxy->white8h_y = (tmpv >> 2 ); } return retU; } //CXY: Chromacity coords const char chromxy_cl::CodN[] = "CXY"; const char chromxy_cl::Name[] = "Chromacity Coords"; const char chromxy_cl::Desc[] = "CIE Chromacity Coordinates.\n" "The values are 10bit bitfields, value range of 0 - 1023 is converted to a fixed point fractional " "in range 0.0 - 0.999.\nFor monochrome displays only White Point coordinates should be defined, " "and the coordinaes of Red, Green and Blue should be set to 0.0\n\n" "https://en.wikipedia.org/wiki/CIE_1931_color_space"; const edi_field_t chromxy_cl::fields[] = { {&EDID_cl::CHredX, 0, 0, 0, 10, F_BFD|F_FLT|F_GD|F_NI, 0, 1, "red_x", "" }, {&EDID_cl::CHredY, 0, 0, 0, 10, F_BFD|F_FLT|F_GD|F_NI, 0, 1, "red_y", "" }, {&EDID_cl::CHgrnX, 0, 0, 0, 10, F_BFD|F_FLT|F_GD|F_NI, 0, 1, "green_x", "" }, {&EDID_cl::CHgrnY, 0, 0, 0, 10, F_BFD|F_FLT|F_GD|F_NI, 0, 1, "green_y", "" }, {&EDID_cl::CHbluX, 0, 0, 0, 10, F_BFD|F_FLT|F_GD|F_NI, 0, 1, "blue_x", "" }, {&EDID_cl::CHbluY, 0, 0, 0, 10, F_BFD|F_FLT|F_GD|F_NI, 0, 1, "blue_y", "" }, {&EDID_cl::CHwhtX, 0, 0, 0, 10, F_BFD|F_FLT|F_GD|F_NI, 0, 1, "white_x", "" }, {&EDID_cl::CHwhtY, 0, 0, 0, 10, F_BFD|F_FLT|F_GD|F_NI, 0, 1, "white_y", "" } }; #pragma GCC diagnostic ignored "-Wunused-parameter" rcode chromxy_cl::init(const u8_t* inst, u32_t orflags, edi_grp_cl* parent) { static const u32_t fcount = 8; rcode retU; parent_grp = parent; type_id.t32 = ID_CXY | T_GRP_FIXED; abs_offs = offsetof(edid_t, chromxy); rel_offs = abs_offs; CopyInstData(inst, sizeof(chromxy_t)); retU = init_fields(&fields[0], inst_data, fcount, false, Name, Desc, CodN); return retU; } #pragma GCC diagnostic warning "-Wunused-parameter" //ETM: Established Timings : no dedicated handlers //ETM: Established Timings const char resmap_cl::CodN[] = "ETM"; const char resmap_cl::Name[] = "Established Timings Map"; const char resmap_cl::Desc[] = "Standard display modes (VESA): each field is a flag telling whether particular display " "mode is supported.\nField name describes the resolution and verical refresh rate:\n" "Hres x Vres x Vrefresh, i = interlaced.\nreservedX are modes reserved for manufacturers."; const edi_field_t resmap_cl::fields[] = { //byte 35 {&EDID_cl::BitVal, 0, 0, 0, 1, F_BIT|F_GD, 0, 1, "800x600x60", "" }, {&EDID_cl::BitVal, 0, 0, 1, 1, F_BIT|F_GD, 0, 1, "800x600x56", "" }, {&EDID_cl::BitVal, 0, 0, 2, 1, F_BIT|F_GD, 0, 1, "640x480x75", "" }, {&EDID_cl::BitVal, 0, 0, 3, 1, F_BIT|F_GD, 0, 1, "640x480x72", "" }, {&EDID_cl::BitVal, 0, 0, 4, 1, F_BIT|F_GD, 0, 1, "640x480x67", "" }, {&EDID_cl::BitVal, 0, 0, 5, 1, F_BIT|F_GD, 0, 1, "640x480x60", "" }, {&EDID_cl::BitVal, 0, 0, 6, 1, F_BIT|F_GD, 0, 1, "720x400x88", "" }, {&EDID_cl::BitVal, 0, 0, 7, 1, F_BIT|F_GD, 0, 1, "720x400x70", "" }, //byte 36: {&EDID_cl::BitVal, 0, 1, 0, 1, F_BIT|F_GD, 0, 1, "1280x1024x75", "" }, {&EDID_cl::BitVal, 0, 1, 1, 1, F_BIT|F_GD, 0, 1, "1024x768x75" , "" }, {&EDID_cl::BitVal, 0, 1, 2, 1, F_BIT|F_GD, 0, 1, "1024x768x72" , "" }, {&EDID_cl::BitVal, 0, 1, 3, 1, F_BIT|F_GD, 0, 1, "1024x768x60" , "" }, {&EDID_cl::BitVal, 0, 1, 4, 1, F_BIT|F_GD, 0, 1, "1024x768x87i", "" }, {&EDID_cl::BitVal, 0, 1, 5, 1, F_BIT|F_GD, 0, 1, "832x624x75" , "" }, {&EDID_cl::BitVal, 0, 1, 6, 1, F_BIT|F_GD, 0, 1, "800x600x75" , "" }, {&EDID_cl::BitVal, 0, 1, 7, 1, F_BIT|F_GD, 0, 1, "800x600x72" , "" }, //byte 37: {&EDID_cl::BitVal, 0, 2, 0, 1, F_BIT|F_GD, 0, 1, "reserved0", "" }, {&EDID_cl::BitVal, 0, 2, 1, 1, F_BIT|F_GD, 0, 1, "reserved1", "" }, {&EDID_cl::BitVal, 0, 2, 2, 1, F_BIT|F_GD, 0, 1, "reserved2", "" }, {&EDID_cl::BitVal, 0, 2, 3, 1, F_BIT|F_GD, 0, 1, "reserved3", "" }, {&EDID_cl::BitVal, 0, 2, 4, 1, F_BIT|F_GD, 0, 1, "reserved4", "" }, {&EDID_cl::BitVal, 0, 2, 5, 1, F_BIT|F_GD, 0, 1, "reserved5", "" }, {&EDID_cl::BitVal, 0, 2, 6, 1, F_BIT|F_GD, 0, 1, "reserved6", "" }, {&EDID_cl::BitVal, 0, 2, 7, 1, F_BIT|F_GD, 0, 1, "1152x870x75", "" } }; #pragma GCC diagnostic ignored "-Wunused-parameter" rcode resmap_cl::init(const u8_t* inst, u32_t orflags, edi_grp_cl* parent) { static const u32_t fcount = 24; rcode retU; parent_grp = parent; type_id.t32 = ID_ETM | T_GRP_FIXED; abs_offs = offsetof(edid_t, res_map); rel_offs = abs_offs; CopyInstData(inst, sizeof(est_map_t)); retU = init_fields(&fields[0], inst_data, fcount, false, Name, Desc, CodN); return retU; } #pragma GCC diagnostic warning "-Wunused-parameter" //STI: std timing descriptors : handlers rcode EDID_cl::STI_Xres(u32_t op, wxString& sval, u32_t& ival, edi_dynfld_t* p_field) { rcode retU; dmt_std2_t* inst; inst = reinterpret_cast (getInstancePtr(p_field)); if (op == OP_READ) { ival = inst->HApix; if (ival == 0x01) p_field->field.flags |= F_NU; //unused field ival += 31; ival <<= 3; sval << ival; RCD_SET_OK(retU); } else { ulong tmpv = 0; RCD_SET_FAULT(retU); if (op == OP_WRSTR) { retU = getStrUint(sval, 10, p_field->field.minv, p_field->field.maxv, tmpv); } else if (op == OP_WRINT) { tmpv = ival; RCD_SET_OK(retU); } if (! RCD_IS_OK(retU)) return retU; tmpv = (tmpv >> 3)-31; if (tmpv != 0x01) p_field->field.flags &= ~F_NU; inst->HApix = tmpv; } return retU; } rcode EDID_cl::STI_Vref(u32_t op, wxString& sval, u32_t& ival, edi_dynfld_t* p_field) { rcode retU; dmt_std2_t *inst = NULL; inst = reinterpret_cast (getInstancePtr(p_field)); ival = (reinterpret_cast (inst))[1]; if (ival == 0x01) { p_field->field.flags |= F_NU; } else { p_field->field.flags &= ~F_NU; } if (op == OP_READ) { ival = inst->v_ref; ival += 60; sval << ival; RCD_SET_OK(retU); } else { ulong tmpv = 0; RCD_SET_FAULT(retU); if (op == OP_WRSTR) { retU = getStrUint(sval, 10, 60, 123, tmpv); if (! RCD_IS_OK(retU)) return retU; } else if (op == OP_WRINT) { tmpv = ival; RCD_SET_OK(retU); } inst->v_ref = (tmpv - 60); } return retU; } //STI: Std Timing Descriptor //STI: Aspect ratio selector sm_vmap STI_asp_ratio = { {0, {0, "16:10", NULL}}, {1, {0, "4:3" , NULL}}, {2, {0, "5:4" , NULL}}, {3, {0, "16:9" , NULL}}, }; const char dmt_std2_cl::CodN[] = "STI"; const char dmt_std2_cl::Name[] = "Standard Timing Information"; const char dmt_std2_cl::Desc[] = "Standard Timing Information: VESA-DMT STD 2-byte Video Timing code\n" "If the group is unused, both bytes are set to 0x01, NU flag is set.\n" "In such case the interpreted values are:\n X-res = 256;\n V-freq = 61;\n" " asp_ratio = 0b00\n DMT_2 = 0x0101"; const char stiXres8dsc[] = "Byte value: ((X-res / 8) - 31) : 256–2288 pixels, value 00 is " "reserved.\n" "Vertical resolution is calculated from X-res value, using pixel ratio"; const char stiVsyncDsc[] = "V-freq: (60–123 Hz).\n" "Bitfield (6bits) value is stored as Vfreq-60 (0-63)"; const char stiAspRatioDsc[] = "Image aspect ratio:\n " "0b00 (0) =16:10;\n 0b01 (1) =4:3;\n 0b10 (2) =5:4;\n 0b11 (3) =16:9.\n" "EDID versions prior to 1.3 defined 0b00 as ratio 1:1."; const char stiDMT2B_Dsc[] = "VESA-DMT STD 2-byte Video Timing Code\n\n" "This field overlaps the fields 'X-res', 'V-freq' and 'asp_ratio' - it allows to select " "standardised video code directly from value selector menu\n"; const edi_field_t dmt_std2_cl::fields[] = { {&EDID_cl::STI_Xres, 0, 0, 0, 1, F_INT|F_PIX|F_DN|F_FR, 256, 2288, "X-res", stiXres8dsc }, {&EDID_cl::STI_Vref, 0, 1, 0, 6, F_INT|F_BFD|F_HZ|F_DN|F_FR, 0, 63, "V-freq", stiVsyncDsc }, {&EDID_cl::BitF8Val, VS_STD2_ASP_RATIO, 1, 6, 2, F_BFD|F_INT|F_DN|F_VS|F_FR, 0, 3, "asp_ratio", stiAspRatioDsc }, {&EDID_cl::Word16, VS_STD2_VIDFMT, 0, 0, 2, F_LE|F_HEX|F_DN|F_VS|F_VSVM|F_FR, 0, 0xFFFF, "DMT_2", stiDMT2B_Dsc} }; #pragma GCC diagnostic ignored "-Wunused-parameter" rcode dmt_std2_cl::init(const u8_t* inst, u32_t orflags, edi_grp_cl* parent) { enum { fcount = 4 }; rcode retU; parent_grp = parent; type_id.t32 = ID_DMT2 | T_SUB_GRP | orflags; CopyInstData(inst, sizeof(dmt_std2_t)); retU = init_fields(&fields[0], inst_data, fcount, false, Name, Desc, CodN); return retU; } #pragma GCC diagnostic warning "-Wunused-parameter" void dmt_std2_cl::getGrpName(EDID_cl& EDID, wxString& gp_name) { if (! EDID.b_GrpNameDynamic) { gp_name = GroupName; return; } EDID.STI_DBN(EDID, gp_name, FieldsAr); } //CVT3: VESA-CVT 3-byte Timing Code //CVT3: VESA-CVT 3-byte Timing Code : handlers rcode EDID_cl::CVT3_Yres (u32_t op, wxString& sval, u32_t& ival, edi_dynfld_t* p_field) { rcode retU; dmt_cvt3_t* inst = NULL; inst = reinterpret_cast (getInstancePtr(p_field)); if (op == OP_READ) { //Yres field encoded as [(VAlin/2)–1] ival = inst->VAlin_4msb; ival <<= 8; ival |= inst->VAlin_8lsb; ival += 1; ival <<= 1; if (ival == 0) p_field->field.flags |= F_NU; //unused field sval << ival; RCD_SET_OK(retU); } else { ulong tmpv = 0; RCD_SET_FAULT(retU); if (op == OP_WRSTR) { retU = getStrUint(sval, 10, p_field->field.minv, p_field->field.maxv, tmpv); ival = tmpv; } else if (op == OP_WRINT) { RCD_SET_OK(retU); } if (! RCD_IS_OK(retU)) return retU; if (ival != 0) p_field->field.flags &= ~F_NU; ival >>= 1; ival -= 1; inst->VAlin_8lsb = ival; ival >>= 8; inst->VAlin_4msb = ival; } return retU; } //CVT3: Aspect ratio selector sm_vmap CVT3_asp_ratio = { {0, {0, "4:3" , NULL}}, {1, {0, "16:9" , NULL}}, {2, {0, "16:10", NULL}}, {3, {0, "15:9" , NULL}}, }; //CVT3: Preferred V-refresh selector sm_vmap CVT3_pref_vref = { {0, {0, "50Hz" , NULL}}, {1, {0, "60Hz" , NULL}}, {2, {0, "75Hz" , NULL}}, {3, {0, "85Hz" , NULL}}, }; const char dmt_cvt3_cl::CodN[] = "CVT3"; const char dmt_cvt3_cl::Name[] = "VESA-CVT 3-byte Timing Code"; const char dmt_cvt3_cl::Desc[] = "VESA-CVT 3-byte Timing Code"; const char CVT3_DMT3B_Dsc[] = "VESA-CVT 3-byte Timing Code\n\n" "This field overlaps all other the fields in this group - it allows to select " "standardised CVT-3 video code directly from value selector menu\n"; const char CVT3_Yres_Dsc[] = "Y-Res: Vertical addresable lines,\n" "range 2..8192 encoded in 12bits as ((VAlin/2)–1)\n\n" "min = ((0+1)*2) = 2\n" "max = ((4095+1)*2) = 8192\n"; //NOTE: fields res0_01 & res2_7 have F_DN flag set: // the dmt_cvt3_cl::getGrpName() indicates invalid CVT3 codes // if reserved fields are not zeroed. const edi_field_t dmt_cvt3_cl::fields[] = { {&EDID_cl::CVT3_Yres, 0, 0, 0, 1, F_INT|F_FR|F_PIX|F_DN, 2, 8192, "Y-res", CVT3_Yres_Dsc }, {&EDID_cl::BitF8Val, 0, 1, 0, 2, F_BFD|F_DN|F_RD, 0, 3, "res0_01", "reserved (0)" }, {&EDID_cl::BitF8Val, VS_CVT3_ASP_RATIO, 1, 2, 2, F_BFD|F_INT|F_FR|F_DN|F_VS, 0, 3, "asp_ratio", " 0b00 (0): 4:3\n 0b01 (1): 16:9\n 0b10 (2): 16:10\n 0b11 (3): 15:9\n" }, {&EDID_cl::BitVal, 0, 2, 0, 1, F_BIT, 0, 1, "vref_60_rb", "V-refresh 60Hz Reduced Blanking, 1: supported" }, {&EDID_cl::BitVal, 0, 2, 1, 1, F_BIT, 0, 1, "vref_85", "V-refresh 85Hz CRT mode, 1: supported" }, {&EDID_cl::BitVal, 0, 2, 2, 1, F_BIT, 0, 1, "vref_75", "V-refresh 75Hz CRT mode, 1: supported" }, {&EDID_cl::BitVal, 0, 2, 3, 1, F_BIT, 0, 1, "vref_60", "V-refresh 60Hz CRT mode, 1: supported" }, {&EDID_cl::BitVal, 0, 2, 4, 1, F_BIT, 0, 1, "vref_50", "V-refresh 50Hz CRT mode, 1: supported" }, {&EDID_cl::BitF8Val, VS_CVT3_PREF_VREF, 2, 5, 2, F_BFD|F_INT|F_VS, 0, 3, "pref_vref", "Preferred Vertical Refresh rate:\n" " 0b00 (0): 50Hz\n 0b01 (1): 60Hz\n 0b10 (2): 75Hz\n 0b11 (3): 85Hz\n" }, {&EDID_cl::BitVal, 0, 2, 7, 1, F_BIT|F_DN|F_RD, 0, 1, "res2_7", "reserved (0)" }, {&EDID_cl::Word24, VS_CVT3_VIDFMT, 0, 0, 3, F_LE|F_HEX|F_FR|F_DN|F_VS|F_VSVM, 0, 0xFFFFFF, "CVT_3", CVT3_DMT3B_Dsc} }; #pragma GCC diagnostic ignored "-Wunused-parameter" rcode dmt_cvt3_cl::init(const u8_t* inst, u32_t orflags, edi_grp_cl* parent) { enum { fcount = 11 }; rcode retU; parent_grp = parent; type_id.t32 = ID_CVT3 | T_SUB_GRP | orflags; CopyInstData(inst, sizeof(dmt_cvt3_t)); retU = init_fields(&fields[0], inst_data, fcount, false, Name, Desc, CodN); return retU; } #pragma GCC diagnostic warning "-Wunused-parameter" void dmt_cvt3_cl::getGrpName(EDID_cl& EDID, wxString& gp_name) { enum { CVT3_IDX_CVT3 = 10, //fld index CVT3_VREF_60HZ = 1, }; typedef struct { u32_t numrtr; u32_t denomr; } ratio_t; typedef union { u32_t cvt3; dmt_cvt3_t cvtT; } cvtT_u; const ratio_t asp_ratio[4] = { { 4, 3}, {16, 9}, {16, 10}, {15, 9} }; const int vref_hz[4] = {50, 60, 75, 85}; rcode retU; edi_dynfld_t *p_field; u32_t xres; u32_t yres; u32_t aspr; u32_t vref; cvtT_u s_cvt; bool b_invalid; bool b_std; if (! EDID.b_GrpNameDynamic) { gp_name = GroupName; return; } //CVT3 code p_field = FieldsAr.Item(CVT3_IDX_CVT3); gp_name.Empty(); ( EDID.*p_field->field.handlerfn )(OP_READ, gp_name, s_cvt.cvt3, p_field ); if (0 == s_cvt.cvt3) { gp_name = "not used"; return; } //check if the cvt3 code is stanardised: retU = vmap_GetValueAsString(VS_CVT3_VIDFMT, VMAP_VAL, s_cvt.cvt3, F_VSVM, gp_name); b_std = RCD_IS_TRUE(retU); //CVT3 code bytes are stored in reversed order: s_cvt.cvt3 = __bswap_32(s_cvt.cvt3); s_cvt.cvt3 >>= 8; //Y-res field encoded as [(VAlin/2)–1] yres = s_cvt.cvtT.VAlin_4msb; yres <<= 8; yres |= s_cvt.cvtT.VAlin_8lsb; yres += 1; yres <<= 1; //aspect ratio aspr = s_cvt.cvtT.asp_ratio; //V-Refresh vref = s_cvt.cvtT.pref_vref; //Y-res xres = yres; xres *= asp_ratio[aspr].numrtr; xres /= asp_ratio[aspr].denomr; gp_name.Empty(); gp_name << xres << "x" << yres << " @ " << vref_hz[vref] << "Hz"; b_invalid = (0 == yres); b_invalid |= (0 != s_cvt.cvtT.res0_01); b_invalid |= (0 != s_cvt.cvtT.res2_7 ); if (b_invalid) { gp_name << " "; return; } if ((CVT3_VREF_60HZ == s_cvt.cvtT.pref_vref) && s_cvt.cvtT.vref60rb ) { gp_name << " (RB)"; //Reduced Blanking } if (! b_std) { gp_name << " (!std)"; } } //----- MISC/helpers //copy local data back to EDID buffer: //hdr_sz != 0 : sub-groups keep their own instance data copy //hdr_sz == 0 : no sub-groups, data in root group void edi_grp_cl::SpawnInstance(u8_t *pinst) { u32_t bsz; bsz = getDataSize(); memcpy(pinst, inst_data, bsz); } //copy sub-group data to parent' group local data buffer rcode edi_grp_cl::AssembleGroup() { rcode retU; u32_t dlen; u32_t dofs; u32_t dsz; u32_t gpidx; u8_t *pbuf; edi_grp_cl *psubg; GroupAr_cl *sub_ar; sub_ar = getSubGrpAr(); if (sub_ar == NULL) { RCD_RETURN_OK(retU); } dofs = (hdr_sz + ahf_sz); dlen = (31 - dofs); pbuf = &inst_data[dofs]; for (gpidx=0; gpidxGetCount(); ++gpidx) { psubg = sub_ar->Item(gpidx); dsz = psubg ->getTotalSize(); if (dlen < dsz) RCD_RETURN_FAULT(retU); memcpy(pbuf, psubg->getInstPtr(), dsz); pbuf += dsz; dlen -= dsz; } RCD_RETURN_OK(retU); } //called from derived class::Clone() edi_grp_cl* edi_grp_cl::base_clone(rcode& rcd, edi_grp_cl* pgrp, u32_t orflags) { rcode retU; GroupAr_cl *sub_ar; //Root grps: assemble sub-grps before copying: otherwise changes made in //subgroups won't be visible in copy. retU = AssembleGroup(); if (!RCD_IS_OK(retU)) { rcd = retU; if (retU.detail.rcode > RCD_FVMSG) { delete pgrp; return NULL; } } rcd = retU; //NOTE: with orflags & T_MODE_EDIT init() is copying entire local buffer retU = pgrp->init(inst_data, orflags, NULL); if (!RCD_IS_OK(retU)) { rcd = retU; //the fault message is logged, but ignored if (retU.detail.rcode > RCD_FVMSG) { delete pgrp; return NULL; } } rcd = retU; //messages passed with RCD_TRUE pgrp->abs_offs = abs_offs; pgrp->rel_offs = rel_offs; //special case: cea_unkdat_cl has variable size if (ID_CEA_UDAT == (type_id.t32 & ID_SUBGRP_MASK)) { pgrp->dat_sz = dat_sz; } pgrp->grp_ar = grp_ar; pgrp->grp_idx = grp_idx; pgrp->parent_grp = parent_grp; pgrp->type_id.t_md_edit = 0; //restore parent array pointer sub_ar = getSubGrpAr(); if (sub_ar != NULL) { sub_ar = pgrp->getSubGrpAr(); sub_ar->setParentArray(grp_ar); } return pgrp; } rcode edi_grp_cl::init_fields(const edi_field_t* field_ar, const u8_t* inst, u32_t fcount, bool b_append, const char *pname, const char *pdesc, const char *pcodn, i32_t offs) { rcode retU; RCD_SET_OK(retU); if (fcount == 0) RCD_RETURN_FAULT_MSG(retU, "field_count == 0"); if (pname != NULL) GroupName = wxString::FromAscii(pname); if (pdesc != NULL) GroupDesc = wxString::FromAscii(pdesc); if (pcodn != NULL) CodeName = wxString::FromAscii(pcodn); //append fields (default: false) if (! b_append) FieldsAr.Empty(); for (u32_t itf=0; itffield, &field_ar[itf], EDI_FIELD_SZ); pfld->field.offs = ((i32_t) pfld->field.offs + offs); //optional offset correction pfld->base = const_cast (inst); if ((pfld->field.flags & F_VS) != 0) { //A field with F_VS flag set must have defined valid VS index. if (VS_NO_SELECTOR == pfld->field.vmap_idx) RCD_RETURN_FAULT(retU); } FieldsAr.Add(pfld); } return retU; } void edi_grp_cl::clear_fields() { for (u32_t itf=0; itfsetDataSize(dlen); retU = pgrp->init(inst, orflags, parent_grp); if (! RCD_IS_OK(retU)) return retU; pgrp->setAbsOffs(abs_offs); pgrp->setRelOffs(rel_offs); subgroups.Append(pgrp); RCD_RETURN_OK(retU); } //Total group size, including subgroups u32_t dbc_grp_cl::getTotalSize() { u32_t dsize; dsize = reinterpret_cast (inst_data)->tag.blk_len; dsize += sizeof(bhdr_t); return dsize; } wxedid-0.0.32/src/rcdunits.h0000644000175000017500000000043514722720160012577 00000000000000//unit numbering #ifndef RCD_UNITS_H #define RCD_UNITS_H 1 #define idMAIN 1 #define idEDID_UTIL 2 #define idEDID_BASE 3 #define idEDID_DESC 4 #define idCEA 5 #define idCEA_ET 6 #define idGRP_AR 7 #define idVMAP 8 #define idGUI_LOG 10 #endif /* RCD_UNITS_H */ wxedid-0.0.32/src/wxEDID_App.h0000644000175000017500000000114114722720160012623 00000000000000/*************************************************************** * Name: wxEDID_App.h * Purpose: Defines Application Class * Author: Tomasz Pawlak (tomasz.pawlak@wp.eu) * Copyright: Tomasz Pawlak (C) 2014-2024 * License: GPLv3+ **************************************************************/ #ifndef wxEDIDAPP_H #define wxEDIDAPP_H 1 #include #include class wxEDID_App : public wxApp { public: virtual bool OnInit(); virtual int OnExit(); bool CmdLineArgs(); void SaveConfig(); void LoadConfig(); }; #endif // wxEDIDAPP_H wxedid-0.0.32/src/CEA_ET.h0000644000175000017500000006347114722720160011735 00000000000000/*************************************************************** * Name: CEA_ET.h * Purpose: CEA/CTA-861-G Extended Tag Codes * Author: Tomasz Pawlak (tomasz.pawlak@wp.eu) * Copyright: Tomasz Pawlak (C) 2019-2024 * License: GPLv3+ **************************************************************/ #ifndef CEA_ET_H #define CEA_ET_H 1 #include "CEA.h" #include "EDID.h" #include "def_types.h" typedef unsigned int uint; enum Extended_Tag_Codes { DBC_ET_VCDB = 0, //Video Capability Data Block DBC_ET_VSVD = 1, //Vendor-Specific Video Data Block DBC_ET_VDDD = 2, //VESA Display Device Data Block DBC_ET_RSV3 = 3, //Reserved for VESA Video Data Block (fixed in H-spec) DBC_ET_RSV4 = 4, //Reserved for HDMI Video Data Block DBC_ET_CLDB = 5, //Colorimetry Data Block DBC_ET_HDRS = 6, //HDR Static Metadata Data Block DBC_ET_HDRD = 7, //HDR Dynamic Metadata Data Block // 8..12 //! Reserved for video-related blocks DBC_ET_VFPD = 13, //Video Format Preference Data Block DBC_ET_Y42V = 14, //YCBCR 4:2:0 Video Data Block DBC_ET_Y42C = 15, //YCBCR 4:2:0 Capability Map Data Block DBC_ET_RS16 = 16, //Reserved for CTA Miscellaneous Audio Fields DBC_ET_VSAD = 17, //Vendor-Specific Audio Data Block DBC_ET_HADB = 18, //HDMI Audio Data Block DBC_ET_RMCD = 19, //Room Configuration Data Block DBC_ET_SLDB = 20, //Speaker Location Data Block // 21..31 //! Reserved for audio-related blocks DBC_ET_IFDB = 32, //InfoFrame Data Block (includes one or more Short InfoFrame Descriptors) // 33 //! Reserved DBC_ET_T7VTB = 34, //DisplayID Type VII Video Timing Data Block DBC_ET_T8VTB = 35, //DisplayID Type VIII Video Timing Data Block // 36..41 //! Reserved DBC_ET_T10VTB = 42, //DisplayID Type X Video Timing Data Block // 43..119 //! Reserved DBC_ET_HEOVR = 120, //HDMI Forum EDID Extension Override Data Block DBC_ET_HSCDB = 121, //HDMI Forum Sink Capability Data Block // 122..127 //! Reserved for HDMI // 128..255 //! Reserved }; //------------------------------------------------------------------------------------------------- //CEA-DBC Extended Tag Codes //VCDB: Video Capability Data Block (DBC_ET_VCDB = 0) typedef struct __attribute__ ((packed)) { //infoblk_s uint S_CE01 :2; //bit0,1: CE overscan/underscan: 0- not supp. 1- always oversc, 2- always undersc, 3- both. uint S_IT01 :2; //bit2,3: IT overscan/underscan: 0- not supp. 1- always oversc, 2- always undersc, 3- both. uint S_PT01 :2; //bit4,5: PT overscan/underscan: 0- not supp. 1- always oversc, 2- always undersc, 3- both. uint QS :1; //bit6 : Quantization Range Selectable: 1 = selectable via AVI Q (RGB only), 0= no data uint QY :1; //bit7 : Quantization Range: 1= selectable via AVI YQ (YCC only), 0= no data } vdbc0_t; typedef struct __attribute__ ((packed)) { //vdbc_s vdbc0_t vdbc0; //2: payload } vcdb_t; //VSVD: Vendor-Specific Video Data Block (DBC_ET_VSVD = 1) //VSAD: Vendor-Specific Audio Data Block (DBC_ET_VSAD = 17) typedef struct __attribute__ ((packed)) { //vsd_s u8_t ieee_id[3]; //2-4: IEEE OUI (Organizationally Unique Identifier) //payload (ethdr.ehdr.hdr.tag.blk_len - 4) bytes, max 27 } vs_vadb_t; //VDDD: VESA Display Device Data Block (DBC_ET_VDDD = 2) typedef struct __attribute__ ((packed)) { //byte 2 uint n_lanes :4; //number of lanes/channels uint type :4; //interface type } if_type_t; typedef struct __attribute__ ((packed)) { //byte 3: Interface Standard Version and Release Number uint release :4; //release uint version :4; //version } if_ver_t; typedef struct __attribute__ ((packed)) { //min/max clock frequency for each iface link/channel uint fmax_2msb :2; //byte5: bit0,1: 2 msb bits of max freq uint fmin :6; //byte5: bit2-7: 6 bits: min. freq in MHz (0-63) u8_t fmax_8lsb ; //byte6: 8 lsb bits of max freq in MHz (0-1023) } clkfrng_t; typedef struct __attribute__ ((packed)) { uint scan_dir :2; //bit0,1: scan direction uint pix0_pos :2; //bit2,3: zero pixel location (scan start) uint rotation :2; //bit4,5: rotation capability uint orientat :2; //bit6,7: default display orientation } scanrot_t; typedef struct __attribute__ ((packed)) { //Miscellaneous Display capabilities uint resvd02 :3; //bit0-2: reserved uint de_ilace :1; //bit3 : deinterlacing, 1= possible uint ovrdrive :1; //bit4 : overdrive not recommended, 1= src "should" not overdrive the signal by default uint d_drive :1; //bit5 : direct-drive, 0= no direct-drive uint dither :2; //bit6,7: dithering, 0=no, 1=spatial, 2=temporal, 3=both. } misccaps_t; typedef struct __attribute__ ((packed)) { //Audio flags uint resvd04 :5; //bit0-4: reserved uint audio_ovr:1; //bit5 : audio input override, 1= automatically override other audio inputs uint sep_achn :1; //bit6 : separate audio channel inputs: not via video interface uint vid_achn :1; //bit7 : 1= audio support on video interface } audioflg_t; typedef struct __attribute__ ((packed)) { //Audio delay uint delay :7; //bit0-6: delay in 2ms resolution. if dly> 254, the value is set to 127, 0= no delay compensation. uint dly_sign :1; //bit7 : audio delay sign: 1= '+', 0= '-' } audiodly_t; typedef struct __attribute__ ((packed)) { //Frame rate or mode conversion uint frm_delta:6; //byte19, bit0-5: Frame rate delta range: max FPS deviation from default frame rate (+/- 63 FPS) uint conv_md :2; //byte19, bit6-7: available conversion mode: 0=none, 1=single frm buff, 2=double buff, 3=interframe interpolation u8_t frm_rate ; //byte20 : default frame rate (FPS) } frm_rcnv_t; typedef struct __attribute__ ((packed)) { //color bit depth (for each color) uint cbd_dev :4; //bit0-3: color bit depth: display device: value=cbd-1 (1-16) uint cbd_if :4; //bit4-7: color bit depth: interface: value=cbd-1 (1-16) } color_bd_t; //22-29 : Aadditional Chromaticity Coordinates. 10-bit CIE xy coords [0–1023/1024]. // Used also to identify sub-pixels defined in byte 13 (sub-pixel layout code) //22 : color 5 and 4 least-significant bits typedef struct __attribute__ ((packed)) { //rgxy_lsb_s uint col5_y :2; //bit 1-0 : primary color5 Y-coord, 2 lsb uint col5_x :2; //bit 3-2 : primary color5 X-coord, 2 lsb uint col4_y :2; //bit 5-4 : primary color4 Y-coord, 2 lsb uint col4_x :2; //bit 7-6 : primary color4 X-coord, 2 lsb } c54xy_lsb_t; //23 : Blue and white least-significant bits typedef struct __attribute__ ((packed)) { //bwxy_lsb_s uint n_colors:2; //bit 1-0 : num of additional chromaticity coordinates uint resvd32 :2; //bit 3-2 : reserved 0 uint col6_y :2; //bit 5-4 : primary color6 Y-coord, 2 lsb uint col6_x :2; //bit 7-6 : primary color6 X-coord, 2 lsb } c6xy_lsb_t; //Additional Chromaticity coordinates : base struct typedef struct __attribute__ ((packed)) { //chromxy_s c54xy_lsb_t rgxy_lsbits; //22 : primarycolor 5 and 4 least-significant bits c6xy_lsb_t bwxy_lsbits; //23 : primary color6 ls 2 bits, n colors. u8_t col4_8h_x; //24 : primary color4 X-coord, 8 msb. 0–255 -> 0–0.996 (255/256); 0–0.999 -> (1023/1024) with lsbits u8_t col4_8h_y; //25 : primary color4 Y-coord, 8 msb u8_t col5_8h_x; //26 : primary color5 X-coord, 8 msb u8_t col5_8h_y; //27 : primary color5 Y-coord, 8 msb u8_t col6_8h_x; //28 : primary color6 X-coord, 8 msb u8_t col6_8h_y; //29 : primary color6 Y-coord, 8 msb } addchrxy_t; typedef struct __attribute__ ((packed)) { //30: Display response time [ms] uint time :7; //bit0-6: response time in milliseconds, max 126. 127 means greater than 126, but unspecified uint type :1; //bit7 : 1=black-to-white, 0=white-to-black } resp_tim_t; typedef struct __attribute__ ((packed)) { //31: Overscan information [%], 0=no overscan (but doesn't mean 100% match), max 15% uint V_ovscan :4; //bit0-3: vertical uint H_ovscan :4; //bit4-7: horizontal } overscan_t; //VESA Display Device Data Block: Base struct typedef struct __attribute__ ((packed)) { //vdddb_s ethdr_t ethdr; //0,1 : header + extended tag code if_type_t if_type; //2 : interface type if_ver_t if_version;//3 : interface version u8_t cont_prot; //4 : Content Protection support method clkfrng_t clkfrng; //5,6 : min/max clock frequency u16_t Hpix_cnt; //7,8 : count of pixels in horizontal direction -1 (1-65536) u16_t Vpix_cnt; //9,10 : count of pixels in vertical direction -1 (1-65536) u8_t aspect; //11 : aspect ratio: 100*((long_axis/short_axis)-1) scanrot_t scanrot; //12 : scan direction, zero pixel pos, rotation, orientation u8_t subpixlc; //13 : sub-pixel layout code u8_t Hpix_pitch;//14 : horizontal pixel pitch in 0.01mm (0.00 - 2.55) u8_t Vpix_pitch;//15 : vertical pixel pitch in 0.01mm (0.00 - 2.55) misccaps_t misccaps; //16 : miscellaneous display caps. audioflg_t audioflg; //17 : Audio flags audiodly_t audiodly; //18 : Audio delay frm_rcnv_t frm_rcnv; //19,20: Frame rate and mode conversion color_bd_t colbitdpth;//21 : Color bit depth addchrxy_t addchrxy; //22-29: Additional Chromaticity Coordinates resp_tim_t resp_time; //30 : Display response time [ms] overscan_t overscan; //31 : Overscan information [%] } vdddb_t; //VVTB: VESA Video Timing Block Extension (DBC_ET_RSV3 = 3) //NOTE: The structure size is 128 bytes, while the DBC Extended Tag header allows only // blocks of size <= 30 bytes! // Extended Tag Code=3 will be reported as error. //vtbe structure layout //w_nDTB*18 + y_nCVT*3 + z_nSTB*2 <= 122 (max VVTBE block size) typedef struct __attribute__ ((packed)) { u8_t w_nDTB; //num of Detailed Timing Blocks (18 bytes), n<=6. u8_t y_nCVT; //num of Coordinated Video Timing blocks (3 bytes), n<=40 (0x28). u8_t z_nSTB; //num of Standard Timing descriptor blocks (2 bytes), n<=61 (0x3D). } vtblayout_t; //from EDID.h: dtd_t: DTD: Detailed Timing Descriptor, class dtd_cl //CVTD: Coordinated Video Timing Descriptor typedef struct __attribute__ ((packed)) { u8_t VSize_8l ; //byte0: Vsize 8lsb, val=(VActivePix/2)-1 uint resvd01 :2; //byte1: bit0,1 : reserved 0 uint asp_ratio :2; //byte1: bit2,3 : aspect ratio: 0= 4:3, 1=16:9, 2=16:10, 3= reserved uint VSize_4h :4; //byte1: bit4-7 : Vsize 4msb uint rblank60 :1; //byte2: bit0 : 60Hz Reduced Blanking 1= supported. uint vref85 :1; //byte2: bit1 : 85Hz refresh rate, std. blanking, 1= supported. uint vref75 :1; //byte2: bit2 : 75Hz refresh rate, std. blanking, 1= supported. uint vref60 :1; //byte2: bit3 : 60Hz refresh rate, std. blanking, 1= supported. uint vref50 :1; //byte2: bit4 : 50Hz refresh rate, std. blanking, 1= supported. uint pref_vr :2; //byte2: bit5,6 : preferred refresh rate: 0= 50Hz, 1= 60Hz, 2= 75Hz, 3= 85Hz uint resvd7 :1; //byte2: bit7 : reserved 0 } cvtd_t; //from EDID.h: dmt_std2_t: STD: Standard Timing Descriptor, class dmt_std2_cl //VVTB: VESA Video Timing Block Extension: Base struct //max block size: 122 bytes typedef struct __attribute__ ((packed)) { //vvtbe_s ethdr_t ethdr; //0,1 : header + extended tag code u8_t vesa_tag; //2 : 0 : Fixed 0x10, Tag label by VESA u8_t vesa_ver; //3 : 1 : Fixed 0x01, version number vtblayout_t layout; //4-6 : 2-4 : vtbe structure layout //DTD, CVTD, STD blocks } vvtbe_t; //CLDB: Colorimetry Data Block (DBC_ET_CLDB = 5) typedef struct __attribute__ ((packed)) { uint xvYCC601 :1; //2 : 0 : Standard Definition Colorimetry based on IEC 61966-2-4 uint xvYCC709 :1; //2 : 1 : High Definition Colorimetry based on IEC 61966-2-4 uint sYCC601 :1; //2 : 2 : Colorimetry based on IEC 61966-2-1/Amendment 1 uint opYCC601 :1; //2 : 3 : Colorimetry based on IEC 61966-2-5, Annex A uint opRGB :1; //2 : 4 : Colorimetry based on IEC 61966-2-5 uint BT2020cYCC :1; //2 : 5 : Colorimetry based on ITU-R BT.2020, Y’cC’BCC’RC uint BT2020YCC :1; //2 : 6 : Colorimetry based on ITU-R BT.2020, Y’C’BC’R uint BT2020RGB :1; //2 : 7 : Colorimetry based on ITU-R BT.2020, R’G’B’ } cldb2_t; typedef struct __attribute__ ((packed)) { uint MD03 :4; //3 : 0-3 : designated for future gamut-related metadata. As yet undefined, this metadata is carried in an interface-specific way. uint resvd46 :3; //3 : 4-6 : reserved uint DCI_P3 :1; //3 : 7 : Colorimetry based on DCI-P3 } cldb3_t; //CLDB: Colorimetry Data Block: base struct typedef struct __attribute__ ((packed)) { //cldb_s cldb2_t cldb2 ; //2 cldb3_t cldb3 ; //3 } cldb_t; //HDRS: HDR Static Metadata Data Block (DBC_ET_HDRS = 6) typedef struct __attribute__ ((packed)) { uint ET_0 :1; //2 : 0 : Traditional gamma - SDR Luminance Range uint ET_1 :1; //2 : 1 : Traditional gamma - HDR Luminance Range uint ET_2 :1; //2 : 2 : SMPTE ST 2084 uint ET_3 :1; //2 : 3 : Hybrid Log-Gamma (HLG) based on Recommendation ITU-R BT.2100-0 uint ET_4 :1; //2 : 4 : reserved uint ET_5 :1; //2 : 5 : reserved uint resvd67 :2; //2 : 6,7 : reserved } hdrs2_t; typedef struct __attribute__ ((packed)) { uint SM_0 :1; //3 : 0 : Static Metadata Type 1 uint SM_17 :7; //3 : 1-7 : reserved } hdrs3_t; //HDRS: HDR Static Metadata Data Block: base struct typedef struct __attribute__ ((packed)) { //hdrs_s hdrs2_t hdrs2 ; //2 hdrs3_t hdrs3 ; //3 u8_t max_lum ; //4 Desired Content Max Luminance data (8 bits) u8_t avg_lum ; //5 Desired Content Max Frame-average Luminance data (8 bits) u8_t min_lum ; //6 Desired Content Min Luminance data (8 bits) } hdrs_t; //HDRD: HDR Dynamic Metadata Data Block (DBC_ET_HDRD = 7) //dynamic data layout: generated by cea_hdrd_cl::init typedef struct __attribute__ ((packed)) { uint version :4; // 0-3 : metadata version for metadata types 1,2,4 uint resvd47 :4; // 4-7 : reserved } hdrs_flg_t; typedef struct __attribute__ ((packed)) { //vvtbe_s u8_t mtd_len ; //0 metadata length (excluding this byte) u16_t mtd_type; //1,2 metadata type: 0x0001..4 hdrs_flg_t supp_flg; //3 Support Flags for metadata type != 0x0003 } hdrd_mtd_t; //Extended InfoFrame Type, HDR metadata format, used also for HDRD: enum { // 0x0000 reserved HDR_dmtd1 = 0x0001, //HDR Dynamic Metadata according to the syntax, specified in Annex R HDR_dmtd2 = 0x0002, //HDR Dynamic Metadata carried in Supplemental Enhancement Information (SEI) messages, according to ETSI TS 103 433 HDR_dmtd3 = 0x0003, //HDR Dynamic Metadata carried in Color Remapping Information SEI message according to ITU-T H.265 HDR_dmtd4 = 0x0004 //HDR Dynamic Metadata carried according to the syntax specified in Annex S // 0x.... reserved }; //VFPD: Video Format Preference Data Block (DBC_ET_VFPD = 13) //dynamic data layout: generated by cea_vfpd_cl::init //Y42V: YCBCR 4:2:0 Video Data Block (DBC_ET_Y42V = 14) //dynamic data layout: generated by cea_y42v_cl::init //Y42C: YCBCR 4:2:0 Capability Map Data Block (DBC_ET_Y42C = 15) //dynamic data layout: generated by cea_y42c_cl::init //string: dynamic field names for bitmap bits: SVD numbers typedef union __attribute__ ((packed)) { char svd_num[8]; typedef struct __attribute__ ((packed)) { u32_t svd ; // 0-3 : string: 'SVD_' u32_t num ; // 4-7 : string: svd number, max 243 } part; } y42c_svdn_t; //HADB: HDMI Audio Data Block (DBC_ET_HADB = 18) typedef struct __attribute__ ((packed)) { //hadb_hdr_s //DBC-ET: byte3 uint max_strm_cnt :2; //0,1 : max number of audio streams in Multi-Stream Audio packets // 0b00: no MSA support, 0b01: 2 streams // 0b10: 2 or 3 streams, 0b11: 2,3 or 4 streams uint ms_not_mix :1; //2 : 1: supports mixing of additional streams uint res3_37 :5; //3-7 : reserved 0 //DBC-ET: byte4 uint num_a3dsc :3; //1-2 : number of 3D audio descriptors, (0..7), max 6 uint res4_37 :5; //3-7 : reserved 0 } hadb_hdr_t; //HADB HDMI_3D_AD == CTA::SAD (short audio desc): //ACAT: Audio Channel Allocation Type typedef struct __attribute__ ((packed)) { //hadb_acat_s uint f03_res :4; //0-3 : reserved 0 uint acat :3; //4-7 : ACAT: 0..7, valid 1,2,3 } hadb_acat_t; //SAB3D: HDMI_3D_SAD (Speaker Allocation Data Block) typedef struct __attribute__ ((packed)) { //hadb_sab_s sab_t sab; //0-3 hadb_acat_t acat; //4 } hadb_sab_t; //RMCD: Room Configuration Data Block (DBC_ET_RMCD = 19) typedef struct __attribute__ ((packed)) { uint spk_cnt :5; // 0-4 : Speaker Count: number of LPCM_channels -1, required for SLD=1 uint SLD :1; // 5 : SLD: Speaker Location Descriptor, 1= fields Xmax, Ymax and Zmax are valid uint Speaker :1; // 6 : Speaker: 1= spk_cnt is valid, 0= spk_cnt is undefined uint Display :1; // 7 : Display: 1= DisplayX,Y,Z fields are valid } rmcd_hdr_t; typedef struct __attribute__ ((packed)) { spm0_t spm0; //3 : Speaker Presence Mask, byte0 spm1_t spm1; //4 : Speaker Presence Mask, byte1 spm2_t spm2; //5 : Speaker Presence Mask, byte2 } spk_mask_t; typedef struct __attribute__ ((packed)) { u8_t Xmax; //6 X-axis distance from Primary Listening Position (PLP) in decimeters [dm] u8_t Ymax; //7 Y-axis distance from PLP in decimeters [dm] u8_t Zmax; //8 Z-axis distance from PLP in decimeters [dm] } spk_plpd_t; typedef struct __attribute__ ((packed)) { u8_t DisplayX; //9 coordinate value normalized to Xmax in spk_plpd_t ?? CTA-861-G: unspecified normalization procedure u8_t DisplayY; //10 normalized to Ymax u8_t DisplayZ; //11 normalized to Zmax } disp_xyz_t; typedef struct __attribute__ ((packed)) { //sab_s rmcd_hdr_t rmcd_hdr; //2 : RMCD data header spk_mask_t spk_mask; //3-5 : SPM: Speaker Presence Mask spk_plpd_t spk_plpd; //6-8 : max speaker distance from PLP in X/Y/Z axes disp_xyz_t disp_xyz; //9-11: display coordinates in X/Y/Z axes, normalized to corresponding spk_xyz values. } rmcd_t; //SLDB: Speaker Location Data Block (DBC_ET_SLDB = 20) typedef struct __attribute__ ((packed)) { uint chn_idx :5; // 0-4 : Channel index 0..31 uint active :1; // 5 : 1= channel active, 0= unused uint coord :1; // 6 : 1= CoordX/Y/Z fields are used, 0= CoordX/Y/Z fields are not present in SLDB uint resvd7 :1; // 7 : reserved } sldb_chn_t; typedef struct __attribute__ ((packed)) { uint spk_id :5; // 0-4 : Speaker index 0..31, CTA-861-G: Table 34 uint resvd5 :1; // 5 : reserved uint resvd6 :1; // 6 : reserved uint resvd7 :1; // 7 : reserved } sldb_id_t; typedef struct __attribute__ ((packed)) { //Speaker Location Descriptor sldb_chn_t channel; //0 Channel index 0..31, flags: active, coord. sldb_id_t spk_id; //1 Speaker index 0..31 i8_t CoordX; //2 speaker position value normalized to Xmax in RMCD: SPKD: Speaker Distance (?) i8_t CoordY; //3 normalized to Ymax i8_t CoordZ; //4 normalized to Zmax } spkld_t; typedef struct __attribute__ ((packed)) { //Speaker Location Data Block ethdr_t ethdr ; //0,1 : header + extended tag code spkld_t slocd[] ; //2-6 : array of Speaker Location Descriptors } sldb_t; //IFDB: InfoFrame Data Block (DBC_ET_IFDB = 32) typedef struct __attribute__ ((packed)) { //Short InfoFrame Descriptor Header uint ift_code :5; // 0-4 : InfoFrame Type Code, values 0x00, 0x01 reserved uint blk_len :3; // 5-7 : payload length in bytes; for svsifd_t it's the number of bytes after the ieee_id. } sifdh_t; typedef struct __attribute__ ((packed)) { //Short Vendor-Specific InfoFrame Descriptor Header sifdh_t ifhdr; //0 : Short InfoFrame Descriptor Header u8_t ieee_id[3]; //1-3: IEEE OUI (Organizationally Unique Identifier) //payload (ethdr.ehdr.hdr.tag.blk_len - 4) bytes, max 27 } svsifd_t; typedef struct __attribute__ ((packed)) { //InfoFrame Processing Descriptor Header uint resvd04 :5; // 0-4 : reserved uint blk_len :3; // 5-7 : num of bytes following the next byte u8_t n_VSIFs ; // num of additional Vendor-Specific InfoFrames (VSIFs) that can be received simultaneously, -1. } ifpdh_t; typedef struct __attribute__ ((packed)) { //InfoFrame Data Block ethdr_t ethdr ; //0,1 : header + extended tag code ifpdh_t ifpdh ; //2,3 : reserved } ifdb_t; //T7VTDB: DisplayID Type 7 Video Timing Data Block (DBC_ET_T7VTB = 34) typedef struct __attribute__ ((packed)) { uint t7rev :3; //0-2 : block revision, 0b010 - other values are reserved in H spec. uint dsc_pt :1; // 3 : reserved for VESA DisplayID, for CTA must be ZERO uint t7_m :3; //4-6 : reserved 0b000: number of extra bytes and the ond of // the descriptor. ?? then what is the DBC length value for ?? uint f37_res :1; // 7 : reserved 0 } t7hdr_t; typedef struct __attribute__ ((packed)) { uint t7aspect :4; //0-3 : Aspect ratio: (0-8): // 0: 1/1 , 1: 5/4 , 2: 4/3 , 3: 15/9, 4: 16/9, // 5: 16/10, 6: 64/27, 7: 256/135, // 8: HApixels/VApisels, other values are reserved. uint t7ilace :1; // 4 : Interlace support, not supported in CTA, must be ZERO uint t7_3d :2; //5-6 : 3D support: // 0b00 not supported, 0b01 only 3D supported (stereo) // 0b10 both mono and stereo modes supported, 0b11 reserrved uint t7y420 :1; // 7 : YCBCR 4:2:0 sampling mode support, 1: supported. } t7prop_t; typedef struct __attribute__ ((packed)) { u8_t pclk0; //Pixel clock bytes 0..2 u8_t pclk1; u8_t pclk2; } t7_pclk_t; typedef union { u16_t w16; struct __attribute__ ((packed)) { u8_t Lbyte; u8_t Hbyte; }; } t710_f16_t; typedef union { u16_t w16; struct __attribute__ ((packed)) { u8_t Lbyte ; uint H_7msb:7; // offset, Front Porch: 15 bits (0–32767) uint sync :1; // H/V sync polarity: 1: positive, 0: negative }; } t7f16s1_t; typedef struct __attribute__ ((packed)) { //t7vtdb_s ethdr_t ethdr ; //0,1 : header + extended tag code t7hdr_t t7_hdr ; //2 : t7 header t7_pclk_t pix_clk ; //3-5 : Pixel clock [kHz] (0-16777215) t7prop_t t7_prop ; //6 : properties t710_f16_t HApix ; //7,8 : H-active pixels (0–65535) t710_f16_t HBpix ; //9,10 : H-blank pixels (0–65535) t7f16s1_t Hoffs ; //11,12: H-offset, Front Porch: 15 bits (0–32767) + t7hsp: sync polarity bit t710_f16_t HsyncW ; //13,14: H-sync width (0–65535) t710_f16_t VAlin ; //15,16: V-active lines (0–65535) t710_f16_t VBpix ; //17,18: V-blank lines (0–65535) t7f16s1_t Voffs ; //19,20: V-offset, Front Porch: 15 bits (0–32767) + t7vsp: sync polarity bit t710_f16_t VsyncW ; //21,22: V-sync width (0–65535) } t7vtdb_t; //T8VTDB: DisplayID Type 8 Video Timing Data Block (DBC_ET_T8VTB = 35) //additional header fields: typedef struct __attribute__ ((packed)) { //t8hdr_s uint blk_rev :3; //0-2 : Block revision, 0b001 uint tcs :1; // 3 : Timing Code Size: 0: 1-byte codes, 1: 2-byte codes uint f34_res :1; // 4 : reserved 0 uint t8y420 :1; // 5 : T8Y420: 1: both RGB and YCBCR 4:2:0 supported, 0: only RGB uint code_type :2; //6-7 : 0b00: DMT Timing Code, 1-byte or 2-byte. Other values are reserved. } t8hdr_t; //2 kind of timng descriptors can be used: //TCS=0: DMT-ID 1-byte Video Timing Codes //TCS=1: DMT-STD 2-byte codes (STI) //T10VTDB: DisplayID Type 10 Video Timing Data Block (DBC_ET_T10VTB = 42) //additional header fields: typedef struct __attribute__ ((packed)) { //t10d_hdr_s uint blk_rev :3; //0-2 : Block revision, 0b000 uint f33_res :1; // 3 : reserved 0 uint t10_m :3; //4-6 : additional descriptor length, beyond default 6 bytes: 0b000 or 0b001 uint f37_res :1; // 7 : reserved 0 } t10hdr_t; //timing descriptor header: typedef struct __attribute__ ((packed)) { //t8d_hdr_s uint t_form :3; //0-2 : timing formula: RB2: 0b010, RB3: 0b011 uint f43_res :1; // 3 : reserved 0 uint vr_hb :1; // 4 : Video Refresh Rate Option or Horizontal Blank Option, // depends on timing formula, table 111 in H spec uint t10_3d :2; //5-6 : 3D support: same as for T7VTDB uint t10y420 :1; // 7 : T10Y420: 1: both RGB and YCBCR 4:2:0 supported, 0: only RGB } t10d_hdr_t; //timing descriptor T10_M=0 typedef struct __attribute__ ((packed)) { //t10vtm0_s t10d_hdr_t hdr; //0 t710_f16_t HApix; //1,2 : H-active pixels (0–65535) t710_f16_t VAlin; //3,4 : V-active lines (0–65535) u8_t Vref8; //5 : V-refresh rate (0..255) ??? } t10vtm0_t; //timing descriptor T10_M=1 typedef union { //t10f16m1_s u16_t w16; struct __attribute__ ((packed)) { //t10f16m1_s uint Vref :10; // 0-9 : 10 bit refresh rate with T10_M=1 (0..1023) uint res6 : 6; //10-15 : reserved 0 }; } t10f16m1_t; typedef struct __attribute__ ((packed)) { //t10vtm1_s t10d_hdr_t hdr; //0 t710_f16_t HApix; //1,2 : H-active pixels (0–65535) t710_f16_t VAlin; //3,4 : V-active lines (0–65535) t10f16m1_t Vref10; //5 : V-refresh rate, 10bit, upper 6 bits are reserved (0..1023) ??? } t10vtm1_t; #endif /* CEA_ET_H */ wxedid-0.0.32/src/vmap.cpp0000644000175000017500000002017714722720160012247 00000000000000/*************************************************************** * Name: vmap.cpp * Purpose: value->description maps and value selector menus * Author: Tomasz Pawlak (tomasz.pawlak@wp.eu) * Copyright: Tomasz Pawlak (C) 2024 * License: GPLv3+ **************************************************************/ #include "debug.h" #include "rcdunits.h" #ifndef idVMAP #error "vmap.cpp: missing unit ID" #endif #define RCD_UNIT idVMAP #include "rcode/rcode.h" #include "wxedid_rcd_scope.h" RCD_AUTOGEN_DEFINE_UNIT #include "vmap.h" #include "id_flags.h" #include extern const vfmt_t dmt_table[]; //vid_fmt.cpp extern sm_vmap AltDescType_map; //EDID_dsc.cpp extern sm_vmap MRL_ext_map; //EDID_dsc.cpp extern sm_vmap VID_input_map; //EDID_base.cpp extern sm_vmap STI_asp_ratio; //EDID_base.cpp extern sm_vmap CVT3_asp_ratio; //EDID_base.cpp extern sm_vmap CVT3_pref_vref; //EDID_base.cpp extern sm_vmap STD2_vidfmt_map; //vid_fmt.cpp extern sm_vmap SVD_vidfmt_map; //vid_fmt.cpp extern sm_vmap DBC_Tag_map; //CEA.cpp extern sm_vmap DBC_ExtTag_map; //CEA.cpp extern sm_vmap ADB_AFC_map; //CEA.cpp extern sm_vmap ADB_ACE_TC_map; //CEA.cpp extern sm_vmap SPKLD_IDX_map; //CEA_ET_class.cpp extern sm_vmap T7_AspRatio_map; //CEA_ET_class.cpp extern sm_vmap T7_3Dsupp_map; //CEA_ET_class.cpp //selector @idx zero is empty - idx==0 means VS_NO_SELECTOR vmap_selector_t vmap_sel[] = { { NULL, NULL, NULL}, {&VID_input_map , &VID_input_map , NULL}, {&MRL_ext_map , &MRL_ext_map , NULL}, {&AltDescType_map , &AltDescType_map , NULL}, {&STI_asp_ratio , &STI_asp_ratio , NULL}, {&CVT3_asp_ratio , &CVT3_asp_ratio , NULL}, {&CVT3_pref_vref , &CVT3_pref_vref , NULL}, { NULL, NULL, NULL}, //DMT-ID 1-byte codes, created from dmt_table[] { NULL, NULL, NULL}, //DMT-STD2 2-byte codes, ... { NULL, NULL, NULL}, //DMT-CVT 3-byte codes, ... {&SVD_vidfmt_map , &SVD_vidfmt_map , NULL}, {&DBC_Tag_map , &DBC_Tag_map , NULL}, {&DBC_ExtTag_map , &DBC_ExtTag_map , NULL}, {&ADB_AFC_map , &ADB_AFC_map , NULL}, {&ADB_ACE_TC_map , &ADB_ACE_TC_map , NULL}, {&SPKLD_IDX_map , &SPKLD_IDX_map , NULL}, {&T7_AspRatio_map , &T7_AspRatio_map , NULL}, {&T7_3Dsupp_map , &T7_3Dsupp_map , NULL} }; //value formats for menus and for vmap_GetValueAsString() static const char fmt_dec [] = "%u"; static const char fmt_hex1[] = "0x%02X"; static const char fmt_hex2[] = "0x%04X"; static const char fmt_hex3[] = "0x%06X"; static const char* get_value_fmt(u32_t idx) { const char* fmt; //specialized value formats switch (idx) { case VS_ALT_DSC_TYPE: case VS_MRL_EXT: case VS_DMT1_VIDFMT: case VS_SPKLD_IDX: fmt = fmt_hex1; break; case VS_STD2_VIDFMT: fmt = fmt_hex2; break; case VS_CVT3_VIDFMT: fmt = fmt_hex3; break; default: fmt = fmt_dec; } return fmt; } static rcode init_selector(vmap_selector_t *psel, u32_t idx, u32_t flags) { rcode retU; int itm_id; const char* fmt; wxString tmps; wxString w_fmt; sm_vmap *vmap; sm_vmap::iterator itv; psel->selector = new wxMenu(); if (psel->selector == NULL) { RCD_RETURN_FAULT(retU); } vmap = psel->mid_map; fmt = get_value_fmt(idx); w_fmt.Printf("[%s] ", fmt); for(itv = vmap->begin(); itv != vmap->end(); ++itv) { int tmpv; const char* p_str; itm_id = itv->first; vmap_ent_t& m_ent = itv->second; if (F_VSVM & flags) { tmpv = m_ent.val; //item val stored in vmap } else { tmpv = itm_id; //item val stored in item_id } tmps.Printf(w_fmt, tmpv); p_str = m_ent.name; tmps << wxString::FromAscii(p_str); p_str = m_ent.desc; if (p_str != NULL) { tmps << " "; tmps << wxString::FromAscii(p_str); } psel->selector->Append( itm_id, tmps); } RCD_RETURN_OK(retU); } sm_vmap* vmap_GetVmap(u32_t idx, vmap_type vm_type) { bool valid; vmap_selector_t *psel; sm_vmap *vmap; valid = (idx >= VS_START ); valid &= (idx < VS_NUM_OF); if (! valid) { return NULL; //not an error } psel = &vmap_sel[idx]; //NULL for uninitialized vmaps vmap = psel->map_ar[vm_type]; return vmap; } const vmap_ent_t* vmap_GetVmapEntry(u32_t vmap_idx, vmap_type vm_type, u32_t key_val) { sm_vmap *vmap; sm_vmap::iterator itv; vmap_ent_t *m_ent; vmap = vmap_GetVmap(vmap_idx, vm_type); if (NULL == vmap) { return NULL; } itv = vmap->find(key_val); if (itv == vmap->end()) { return NULL; } m_ent = &vmap->at(key_val); return m_ent; } rcode vmap_GetValueAsString(u32_t vs_idx, vmap_type vm_type, u32_t key_val, u32_t flags, wxString& sval) { rcode retU; sm_vmap *vmap; sm_vmap::iterator itv; int tmpv; const char *fmt; vmap = vmap_GetVmap(vs_idx, vm_type); if (NULL == vmap) { RCD_RETURN_FAULT(retU); } itv = vmap->find(key_val); if (itv == vmap->end()) { sval.Empty(); RCD_RETURN_FALSE(retU); } vmap_ent_t& m_ent = vmap->at(key_val); fmt = get_value_fmt(vs_idx); if (F_VSVM & flags) { tmpv = m_ent.val; //item val stored in vmap } else { tmpv = itv->first; //item val stored in item_id } sval.Printf(fmt, tmpv); RCD_RETURN_TRUE(retU); } wxMenu* vmap_GetSelector(u32_t idx, u32_t flags, rcode& retU) { bool valid; vmap_selector_t *psel; RCD_SET_OK(retU); valid = (idx >= VS_START ); valid &= (idx < VS_NUM_OF); if (! valid) { return NULL; //not an error } psel = &vmap_sel[idx]; if (psel->selector != NULL) return psel->selector; //deferred init of selector menus (on access) retU = init_selector(psel, idx, flags); if (! RCD_IS_OK(retU)) return NULL; return psel->selector; } void vmap_DestroySelectors() { u32_t its; vmap_selector_t *psel; for (its=VS_START; itsselector != NULL) delete psel->selector; } } static rcode init_DMT_vmap(u32_t idx, u32_t voffs) { rcode retU; sm_vmap *mid_map; sm_vmap *val_map; vmap_ent_t m_ent; const vfmt_t *v_ent; u32_t idxv; u32_t *pval; m_ent.desc = NULL; mid_map = new sm_vmap; vmap_sel[idx].mid_map = mid_map; if (NULL == mid_map) RCD_RETURN_FAULT(retU); val_map = new sm_vmap; vmap_sel[idx].val_map = val_map; if (NULL == val_map) RCD_RETURN_FAULT(retU); idxv = 0; v_ent = &dmt_table[0]; while (v_ent->name != NULL) { pval = (u32_t*) &((u8_t*) v_ent)[voffs]; m_ent.val = *pval; m_ent.name = v_ent->name; v_ent ++ ; if (0 == m_ent.val) continue; mid_map->emplace(idxv , m_ent); val_map->emplace(m_ent.val, m_ent); idxv ++ ; } RCD_RETURN_OK(retU); } rcode vmap_InitDMT_Vmaps() { rcode retU; //DMT-ID 1-byte codes retU = init_DMT_vmap(VS_DMT1_VIDFMT, offsetof(vfmt_t, DMT_ID)); if (! RCD_IS_OK(retU)) RCD_RETURN_FAULT(retU); //DMT-STD2 2-byte codes retU = init_DMT_vmap(VS_STD2_VIDFMT, offsetof(vfmt_t, STD2 )); if (! RCD_IS_OK(retU)) RCD_RETURN_FAULT(retU); //DMT-CVT 3-byte codes retU = init_DMT_vmap(VS_CVT3_VIDFMT, offsetof(vfmt_t, CVT3 )); if (! RCD_IS_OK(retU)) RCD_RETURN_FAULT(retU); RCD_RETURN_OK(retU); } void vmap_DeleteDMT_Vmaps() { sm_vmap *vmap; vmap = vmap_sel[VS_DMT1_VIDFMT].mid_map; if (vmap != NULL) delete vmap; vmap = vmap_sel[VS_DMT1_VIDFMT].val_map; if (vmap != NULL) delete vmap; vmap = vmap_sel[VS_STD2_VIDFMT].mid_map; if (vmap != NULL) delete vmap; vmap = vmap_sel[VS_STD2_VIDFMT].val_map; if (vmap != NULL) delete vmap; vmap = vmap_sel[VS_CVT3_VIDFMT].mid_map; if (vmap != NULL) delete vmap; vmap = vmap_sel[VS_CVT3_VIDFMT].val_map; if (vmap != NULL) delete vmap; } wxedid-0.0.32/src/EDID_main.cpp0000644000175000017500000012320514722720160013011 00000000000000/*************************************************************** * Name: EDID_main.cpp * Purpose: EDID main functions and common field handlers * Author: Tomasz Pawlak (tomasz.pawlak@wp.eu) * Copyright: Tomasz Pawlak (C) 2014-2024 * License: GPLv3+ **************************************************************/ #include "debug.h" #include "rcdunits.h" #ifndef idEDID_UTIL #error "EDID_base.cpp: missing unit ID" #endif #define RCD_UNIT idEDID_UTIL #include "rcode/rcode.h" #include "wxedid_rcd_scope.h" RCD_AUTOGEN_DEFINE_UNIT #include #include "vmap.h" #include "EDID_class.h" #include "CEA_class.h" #include "CEA_ET_class.h" const wxString EDID_cl::prop_flag_name[] = { "RD", //F_RD "NU", //F_NU "GD", //F_GD "BN", //F_DN "VS", //F_VS "FR", //F_FR "FR", //F_INIT, same as Forced Refresh // "RS", //F_RS: internal checks: reserved field // "NI", //F_NI: internal checks: not an integer, not displayed }; const wxString EDID_cl::val_type_name[] = { "Bit", //F_BIT "BitF", //F_BFD "Byte", //F_BTE "Int", //F_INT "Float", //F_FLT "Hex", //F_HEX "String", //F_STR "LE" //F_LE }; const wxString EDID_cl::val_unit_name[] = { "pix", //F_PIX "mm", //F_MM "cm", //F_CM "dm", //F_DM "Hz", //F_HZ "kHz", //F_KHZ "MHz", //F_MHZ "ms", //F_MLS "%" //F_PCT }; void EDID_cl::getValUnitName(wxString& sval, const u32_t flags) { u32_t flg; flg = (flags >> F_UN_SFT) & F_UN_MSK; if (flg == 0) { sval.Empty(); //sval = "--"; -> leave it to caller return; } for (u32_t it=0; it>= 1; } return; } void EDID_cl::getValTypeName(wxString& sval, const u32_t flags) { u32_t flg; flg = (flags >> F_TP_SFT) & F_TP_MSK; if (flg == 0) { sval = "--"; return; } sval.Empty(); for (u32_t it=0; it 0) sval << "|"; sval << val_type_name[it]; } flg >>= 1; } return; } void EDID_cl::getValFlagsAsString(wxString& sval, const u32_t flags) { u32_t flg; u32_t itf; flg = (flags >> F_PR_SFT) & F_PR_MSK; if (flg == 0) { sval = "--"; return; } sval.Empty(); itf = 0; for (; itf 0) sval << "|"; sval << prop_flag_name[itf]; } flg >>= 1; } return; } void EDID_cl::getValDesc(wxString &sval, edi_dynfld_t* p_field, u32_t val, vd_mode mode) { const char *cstr; const vmap_ent_t *m_ent; vmap_type vtype; if (0 == p_field->field.vmap_idx) { sval.Empty(); //no value description return; } vtype = (F_VSVM & p_field->field.flags) ? VMAP_VAL : VMAP_MID; m_ent = vmap_GetVmapEntry(p_field->field.vmap_idx, vtype, val); if (NULL == m_ent) { sval = ""; return; } if (VD_DESC == mode) { cstr = m_ent->desc; sval = wxString::FromAscii(cstr); return; } cstr = m_ent->name; sval = wxString::FromAscii(cstr); if (mode != VD_FULL) return; //include description cstr = m_ent->desc; sval << " "; sval << wxString::FromAscii(cstr); } rcode EDID_cl::ParseDBC_TAG(u8_t *pinst, edi_grp_cl** pp_grp) { rcode retU; ethdr_t ethdr; int tagcode; edi_grp_cl *pgrp = NULL; RCD_SET_OK(retU); ethdr.w16 = reinterpret_cast (pinst)[0]; tagcode = ethdr.ehdr.hdr.tag.tag_code; switch (tagcode) { case DBC_T_ADB: //1: Audio Data Block pgrp = new cea_adb_cl; break; case DBC_T_VDB: //2: Video Data Block pgrp = new cea_vdb_cl; break; case DBC_T_VSD: //3: Vendor Specific Data Block pgrp = new cea_vsd_cl; break; case DBC_T_SAB: //4: Speaker Allocation Data Block pgrp = new cea_sab_cl; break; case DBC_T_VTC: //5: VESA Display Transfer Characteristic Data Block (gamma) pgrp = new cea_vdtc_cl; break; case DBC_T_EXT: //7: Extended Tag Codes { u32_t etag; etag = ethdr.ehdr.extag; switch (etag) { case DBC_ET_VCDB: //0: Video Capability Data Block pgrp = new cea_vcdb_cl; break; case DBC_ET_VSVD: //1: Vendor-Specific Video Data Block pgrp = new cea_vsvd_cl; break; case DBC_ET_VDDD: //2: VESA Display Device Data Block pgrp = new cea_vddd_cl; break; // case DBC_ET_RSV3: //3: Reserved for VESA Video Data Block // pgrp = NULL; // break; // case DBC_ET_RSV4: //4: Reserved for HDMI Video Data Block // pgrp = NULL; // break; case DBC_ET_CLDB: //5: Colorimetry Data Block pgrp = new cea_cldb_cl; break; case DBC_ET_HDRS: //6: HDR Static Metadata Data Block pgrp = new cea_hdrs_cl; break; case DBC_ET_HDRD: //7: HDR Dynamic Metadata Data Block pgrp = new cea_hdrd_cl; break; case DBC_ET_VFPD: //13: Video Format Preference Data Block pgrp = new cea_vfpd_cl; break; case DBC_ET_Y42V: //14: YCBCR 4:2:0 Video Data Block pgrp = new cea_y42v_cl; break; case DBC_ET_Y42C: //15: YCBCR 4:2:0 Capability Map Data Block pgrp = new cea_y42c_cl; break; // case DBC_ET_RS16: //16: Reserved for CTA Miscellaneous Audio Fields // pgrp = NULL; // break; case DBC_ET_VSAD: //17: Vendor-Specific Audio Data Block pgrp = new cea_vsad_cl; break; case DBC_ET_HADB: //18: HDMI Audio Data Block pgrp = new cea_hadb_cl; break; case DBC_ET_RMCD: //19: Room Configuration Data Block pgrp = new cea_rmcd_cl; break; case DBC_ET_SLDB: //20: Speaker Location Data Block pgrp = new cea_sldb_cl; break; case DBC_ET_IFDB: //32 InfoFrame Data Block pgrp = new cea_ifdb_cl; break; case DBC_ET_T7VTB: //34 DisplayID Type 7 Video Timing Data Block pgrp = new cea_t7vtb_cl; break; case DBC_ET_T8VTB: //35 DisplayID Type 8 Video Timing Data Block pgrp = new cea_t8vtb_cl; break; case DBC_ET_T10VTB: //42 DisplayID Type 10 Video Timing Data Block pgrp = new cea_t10vtb_cl; break; // case DBC_ET_HEOVR: //120 HDMI Forum EDID Extension Override Data Block // pgrp = NULL; // break; // case DBC_ET_HSCDB: //121 HDMI Forum Sink Capability Data Block // pgrp = NULL; // break; default: //CTA-861-H: reserved Extended Tag Codes: //3, 4, 8-12, 18, 21-31, 33, 36..41, 43..119, 122..255 //UNK-ET: Unknown Data Block (Extended Tag Code) pgrp = new cea_unket_cl; wxedid_RCD_SET_FAULT_VMSG(retU, "[E!] CTA-861 DBC: invalid Extended Tag Code=%u", etag); } } break; default: //CTA-861-G: reserved Tag Codes: 0,6 //UNK-TC: Unknown Data Block (Tag Code) pgrp = new cea_unktc_cl; wxedid_RCD_SET_FAULT_VMSG(retU, "[E!] CTA-861 DBC: invalid Tag Code=%u", tagcode); } *pp_grp = pgrp; return retU; } rcode EDID_cl::ParseCEA_DBC(u8_t *pinst) { rcode retU; rcode retU2; u32_t orflags; u32_t grp_sz; edi_grp_cl *pgrp = NULL; RCD_SET_OK(retU2); retU2 = ParseDBC_TAG(pinst, &pgrp); if (pgrp == NULL) {RCD_RETURN_FAULT(retU); } pgrp->setAbsOffs(calcGroupOffs(pinst)); pgrp->setRelOffs(pgrp->getAbsOffs() % sizeof(edid_t)); orflags = 0; if (b_ERR_Ignore) { orflags = T_MODE_EDIT; } retU = pgrp->init(pinst, orflags, NULL); if (!RCD_IS_OK(retU)) { //the fault message is logged, but ignored if (retU.detail.rcode > RCD_FVMSG) { delete pgrp; return retU; } } grp_sz = pgrp->getTotalSize(); pGLog->slog.Printf("[%zu] offs %u: \"%s\", size %u", EDI_Ext0GrpAr.GetCount(), pgrp->getRelOffs(), pgrp->CodeName, grp_sz ); pGLog->DoLog(); pgrp->setParentAr(&EDI_Ext0GrpAr); EDI_Ext0GrpAr.Append(pgrp); if (! RCD_IS_OK(retU2)) {return retU2;} if (! RCD_IS_OK(retU )) {return retU ;} RCD_RETURN_OK(retU); } rcode EDID_cl::ParseEDID_CEA() { rcode retU; edi_grp_cl *pgrp; u8_t *p8_dtd; u8_t *pend; u8_t *pinst; cea_hdr_t *cea_hdr; u32_t dtd_offs; i32_t num_dtd; i32_t blk0_dtd; EDI_Ext0GrpAr.Empty(); u8_t *pext = EDID_buff.edi.ext0; pGLog->DoLog("CEA-861:"); // CEA/CTA-861 header pgrp = new cea_hdr_cl; if (pgrp == NULL) RCD_RETURN_FAULT(retU); retU = pgrp->init(pext, 0, NULL); if (!RCD_IS_OK(retU)) return retU; pgrp->setAbsOffs(calcGroupOffs(pext)); EDI_Ext0GrpAr.Append(pgrp); cea_hdr = reinterpret_cast (pext); dtd_offs = cea_hdr->dtd_offs; num_dtd = cea_hdr->info_blk.num_dtd; blk0_dtd = EDID_Get_num_DTD(); if (num_dtd > blk0_dtd) { num_dtd -= blk0_dtd; //native DTDs present in CEA } else { num_dtd = 0; //no native DTDs present in CEA (but non-native can be included) } pGLog->DoLog("[0] offs 0: \"CHD\", size 4"); //No DTD, no DBC if (dtd_offs == 0) {num_valid_blocks++ ; RCD_RETURN_OK(retU);} if ((dtd_offs >= 1) && (3 >= dtd_offs)) { wxedid_RCD_SET_FAULT_VMSG(retU, "[E!] CTA-861 Header: invalid DTD offset=%u", dtd_offs); return retU; //can't be ignored } //(dtd_offs > (EDI_BLK_SIZE - sizeof(dsctor_u) -3)) p8_dtd = (pext + dtd_offs); pend = (pext + EDI_BLK_SIZE); pinst = pext + sizeof(cea_hdr_t); //DBC if (dtd_offs > 0x04) { ethdr_t ethdr; u32_t blklen; do { //Parse Data Block Collection (DBC) ethdr.w16 = reinterpret_cast (pinst)[0]; blklen = ethdr.ehdr.hdr.tag.blk_len; blklen += sizeof(bhdr_t); if (p8_dtd < (pinst + blklen)) { wxedid_RCD_SET_FAULT_VMSG(retU, "[E!] CTA-861: Collision: DTD offset=%u and DBC@offset=%u, len=%u", dtd_offs, (u32_t) (calcGroupOffs(pinst) % sizeof(edid_t)), blklen); if (! b_ERR_Ignore) return retU; pGLog->PrintRcode(retU); RCD_SET_OK(retU); } retU = ParseCEA_DBC(pinst); if (! RCD_IS_OK(retU)) { if (! b_ERR_Ignore) return retU; RCD_SET_OK(retU); } pinst += blklen; if (pinst >= p8_dtd) break; } while (pinst < pend); if (pinst != p8_dtd) { wxedid_RCD_SET_FAULT_VMSG(retU, "[E!] CTA-861: DTD offset=%u != DBC_end=%u", dtd_offs, (u32_t) (calcGroupOffs(pinst) % sizeof(edid_t)) ); if (! b_ERR_Ignore) return retU; pGLog->PrintRcode(retU); RCD_SET_OK(retU); } } { //DTD dtd_t *pdtd; edi_grp_cl *pgrp; i32_t space_left; i32_t max_dtd; u32_t offs; //search DTDs after DBC end, not at declared DTD offset pdtd = reinterpret_cast (pinst); space_left = (pend - pinst); space_left -- ; //last byte contains checksum max_dtd = space_left / sizeof(dtd_t); //18 //mandatory DTDs for *native* mode if (num_dtd > 0) { if (max_dtd < num_dtd) { wxedid_RCD_SET_FAULT_VMSG(retU, "[E!] CTA-861: insufficient space for declared number of native DTDs: %u, max: %u", num_dtd, max_dtd); if (! b_ERR_Ignore) return retU; pGLog->PrintRcode(retU); num_dtd = max_dtd; RCD_SET_OK(retU); } for (i32_t itd=0; itdpix_clk == 0) { wxedid_RCD_SET_FAULT_VMSG(retU, "[E!] CTA-861: missing mandatory DTD @ offset %u", (u32_t) (reinterpret_cast (pdtd) - EDID_buff.buff) ); if (! b_ERR_Ignore) return retU; pGLog->PrintRcode(retU); RCD_SET_OK(retU); break; } pgrp = new dtd_cl; if (pgrp == NULL) { RCD_SET_FAULT(retU); pGLog->PrintRcode(retU); return retU; } pgrp->init(reinterpret_cast (pdtd), 0, NULL); offs = (reinterpret_cast (pdtd) - EDID_buff.buff); //append the group pgrp->setAbsOffs(offs); //offset in buffer pgrp->setRelOffs(offs % sizeof(edid_t)); //offset in extension block pGLog->slog.Printf("[%zu] offs %u: \"DTD\", size 18", EDI_Ext0GrpAr.GetCount(), pgrp->getRelOffs() ); pGLog->DoLog(); EDI_Ext0GrpAr.Append(pgrp); pdtd ++ ; max_dtd -- ; space_left -= sizeof(dtd_t); } } //Check for additional DTDs (non-mandatory) for (i32_t itd=0; itdpix_clk == 0) break; //not a DTD pgrp = new dtd_cl; if (pgrp == NULL) { RCD_SET_FAULT(retU); pGLog->PrintRcode(retU); return retU; } pgrp->init(reinterpret_cast (pdtd), 0, NULL); offs = (reinterpret_cast (pdtd) - EDID_buff.buff); //append the group pgrp->setAbsOffs(offs); pgrp->setRelOffs(offs % sizeof(edid_t)); pGLog->slog.Printf("[%zu] offs %u: \"DTD\", size 18", EDI_Ext0GrpAr.GetCount(), pgrp->getRelOffs() ); pGLog->DoLog(); EDI_Ext0GrpAr.Append(pgrp); pdtd ++ ; space_left -= sizeof(dtd_t); } //Check padding bytes p8_dtd = reinterpret_cast (pdtd); pGLog->slog.Printf("[%zu] offs %zu: [free space]: %u bytes", EDI_Ext0GrpAr.GetCount(), (p8_dtd - pext), space_left ); pGLog->DoLog(); for (i32_t itb=0; itbPrintRcode(retU); RCD_SET_OK(retU); } p8_dtd ++ ; } } num_valid_blocks++ ; //free/used used bytes in the block EDI_Ext0GrpAr.CalcDataSZ(); RCD_RETURN_OK(retU); } rcode EDID_cl::ParseEDID_Base(u32_t& n_extblk) { rcode retU; edi_grp_cl *pgrp; dsctor_u *pdsc; u32_t hdr0, hdr1; EDI_BaseGrpAr.Empty(); num_valid_blocks = 0; //check header hdr0 = EDID_buff.edi.base.hdr.hdr_w32[0]; hdr1 = EDID_buff.edi.base.hdr.hdr_w32[1]; _BE_SWAP32(hdr0); _BE_SWAP32(hdr1); if ((hdr0 != 0xFFFFFF00) || (hdr1 != 0x00FFFFFF)) { wxedid_RCD_SET_FAULT_VMSG(retU, "[E!] EDID block0: invalid header=0x%08X_%08X", hdr0, hdr1); if (! b_ERR_Ignore) return retU; pGLog->PrintRcode(retU); } //BED: Base EDID data pgrp = new edibase_cl; if (pgrp == NULL) RCD_RETURN_FAULT(retU); retU = pgrp->init(reinterpret_cast (&EDID_buff.edi.base.hdr), 0, NULL); if (!RCD_IS_OK(retU)) return retU; EDI_BaseGrpAr.Append(pgrp); //VID: Video Input Descriptor pgrp = new vindsc_cl; if (pgrp == NULL) RCD_RETURN_FAULT(retU); retU = pgrp->init(reinterpret_cast (&EDID_buff.edi.base.vinput_dsc), 0, NULL); if (!RCD_IS_OK(retU)) return retU; EDI_BaseGrpAr.Append(pgrp); //BDD: basic display descriptior pgrp = new bddcs_cl; if (pgrp == NULL) RCD_RETURN_FAULT(retU); retU = pgrp->init( reinterpret_cast (&EDID_buff.edi.base.bdd), 0, NULL); if (!RCD_IS_OK(retU)) return retU; EDI_BaseGrpAr.Append(pgrp); //SPF: Supported features class pgrp = new spft_cl; if (pgrp == NULL) RCD_RETURN_FAULT(retU); retU = pgrp->init(reinterpret_cast (&EDID_buff.edi.base.features), 0, NULL); if (!RCD_IS_OK(retU)) return retU; EDI_BaseGrpAr.Append(pgrp); //CXY: CIE Chromacity coords class pgrp = new chromxy_cl; if (pgrp == NULL) RCD_RETURN_FAULT(retU); retU = pgrp->init(reinterpret_cast (&EDID_buff.edi.base.chromxy), 0, NULL); if (!RCD_IS_OK(retU)) return retU; EDI_BaseGrpAr.Append(pgrp); //Resolution map class pgrp = new resmap_cl; if (pgrp == NULL) RCD_RETURN_FAULT(retU); retU = pgrp->init(reinterpret_cast (&EDID_buff.edi.base.res_map), 0, NULL); if (!RCD_IS_OK(retU)) return retU; EDI_BaseGrpAr.Append(pgrp); //STI: Std Timing Information descriptors { dmt_std2_t *pstdt = &EDID_buff.edi.base.std_timg0; for (u32_t itd=0; itd<8; itd++) { u32_t abs_offs; pgrp = new dmt_std2_cl; if (pgrp == NULL) RCD_RETURN_FAULT(retU); abs_offs = calcGroupOffs(pstdt); pgrp->setAbsOffs(abs_offs); pgrp->setRelOffs(abs_offs); pgrp->init(reinterpret_cast (pstdt), T_P_HOLDER, NULL); pgrp->setParentAr(&EDI_BaseGrpAr); //needed for Paste() >> UpdateAbsOffs() EDI_BaseGrpAr.Append(pgrp); pstdt += 1; } } //DTD/MRL/WPT... pGLog->DoLog("BASE EDID: descriptors:"); pdsc = &EDID_buff.edi.base.descriptor0; for (u32_t itd=0; itd<4; itd++) { u32_t offs; retU = ParseAltDtor(reinterpret_cast (pdsc), &pgrp); if (pgrp == NULL) return retU; //offset in buffer offs = calcGroupOffs(pdsc); pgrp->setAbsOffs(offs); pgrp->setRelOffs(offs); retU = pgrp->init(reinterpret_cast (pdsc), 0, NULL); if (! RCD_IS_OK(retU)) { delete pgrp; return retU; } pgrp->setParentAr(&EDI_BaseGrpAr); EDI_BaseGrpAr.Append(pgrp); pdsc += 1; pGLog->slog.Printf("[%u] offs %u: \"%s\", size %u", itd, offs, pgrp->CodeName, pgrp->getDataSize()); pGLog->DoLog(); } num_valid_blocks = 1; n_extblk = EDID_buff.edi.base.num_extblk; //free/used bytes in the block EDI_BaseGrpAr.CalcDataSZ(); RCD_RETURN_OK(retU); } rcode EDID_cl::ParseAltDtor(u8_t *pinst, edi_grp_cl** pp_grp, i32_t offs) { rcode retU; u32_t dsctype; edi_grp_cl *pgrp; dsctor_u *pdsc; pdsc = reinterpret_cast (pinst); //DTD if (pdsc->dtd.pix_clk != 0) { RCD_SET_OK(retU); pgrp = new dtd_cl; if (pgrp == NULL) {RCD_SET_FAULT(retU); goto _err; } goto _exit; } dsctype = pdsc->unk.hdr.dsc_type; //not a DTD: types 0xFA...0xFF switch (dsctype) { case 0xF7: //ET3: Estabilished Timings 3 Descriptor pgrp = new et3_cl; if (pgrp == NULL) {RCD_SET_FAULT(retU); goto _err; } break; case 0xF8: //CT3: VESA-CVT 3-byte Video Timing Codes pgrp = new ct3_cl; if (pgrp == NULL) {RCD_SET_FAULT(retU); goto _err; } break; case 0xF9: //DCM: Display Color Management Data pgrp = new dcm_cl; if (pgrp == NULL) {RCD_SET_FAULT(retU); goto _err; } break; case 0xFA: //AST: Additional Standard Timings identifiers pgrp = new ast_cl; if (pgrp == NULL) {RCD_SET_FAULT(retU); goto _err; } break; case 0xFB: //WPD: White Point Descriptor pgrp = new wpt_cl; if (pgrp == NULL) {RCD_SET_FAULT(retU); goto _err; } break; case 0xFD: //MRL: Monitor Range Limits pgrp = new mrl_cl; if (pgrp == NULL) {RCD_SET_FAULT(retU); goto _err; } break; case 0xFE: //UTX: Unspecified Text case 0xFC: //MND: Monitor Name Descriptor case 0xFF: //MSN: Monitor Serial Number Descriptor pgrp = new txtd_cl; if (pgrp == NULL) {RCD_SET_FAULT(retU); goto _err; } break; default: //UNK: Unknown Descriptor (fallback) pgrp = new unk_cl; if (pgrp == NULL) {RCD_SET_FAULT(retU); goto _err; } //offs > 0: called by BlkTreeChangeGrpType(): pinst is a local data buffer if (offs < 0) offs = calcGroupOffs(pdsc); wxedid_RCD_SET_FAULT_VMSG(retU, "[E!] Unknown alt. descriptor type=0x%02X, abs. offset=%u", dsctype, offs); break; } _err: _exit: *pp_grp = pgrp; return retU; } bool EDID_cl::VerifyChksum(u32_t block) { if (block > EDI_EXT2_IDX) return false; u32_t csum = 0; u8_t *pblk = EDID_buff.blk[block]; for (u32_t itb=0; itb EDI_EXT2_IDX) return 0; u32_t csum = 0; u8_t *pblk = EDID_buff.blk[block]; for (u32_t itb=0; itb<(EDI_BLK_SIZE-1); itb++) { csum += pblk[itb]; } csum = (0x100 - (csum & 0xFF)); pblk[EDI_BLK_SIZE-1] = csum; return csum; } void EDID_cl::Clear() { memset(EDID_buff.buff, 0, sizeof(edi_buf_t) ); } u32_t EDID_cl::EDID_Get_num_DTD() { edi_grp_cl *pgrp; u32_t idx; u32_t grp_cnt; u32_t num_dtd = 0; grp_cnt = EDI_BaseGrpAr.GetCount(); idx = 14; //first alt. descriptor for (; idxgetTypeID(); if (ID_DTD == tid.base_id) { num_dtd ++ ; } } return num_dtd; } void EDID_cl::CEA_Set_DTD_Offset(u8_t *pbuf, GroupAr_cl *p_grp_ar) { edi_grp_cl *pgrp; cea_hdr_t *cea_hdr; u32_t num_dtd; u32_t idx; u32_t grp_cnt; u32_t dtd_offs = 0; cea_hdr = reinterpret_cast (pbuf); grp_cnt = p_grp_ar->GetCount(); num_dtd = 0; idx = 1; //skip CEA header for (; idxItem(idx); tid = pgrp->getTypeID(); if (ID_DTD == (tid.t32 & ID_EDID_MASK)) { if (num_dtd == 0) { dtd_offs = pgrp->getRelOffs(); } num_dtd ++ ; } } if (num_dtd > 0) goto done; if (grp_cnt < 1) dtd_offs = 0; //No DBC and no DTD done: cea_hdr->dtd_offs = dtd_offs; { u32_t num_dbc; num_dbc = grp_cnt; num_dbc -= num_dtd; num_dbc -= 1; //hdr pGLog->slog.Printf("CEA_Set_DTD_Offset(): num_dbc=%u, num_dtd=%u, dtd_offs=%u", num_dbc, num_dtd, dtd_offs); pGLog->DoLog(); } } rcode EDID_cl::AssembleEDID() { edi_grp_cl *pgrp; GroupAr_cl *p_grp_ar; u8_t *pbuf; u32_t block; i32_t blk_sz; u32_t offs; u32_t idx_grp; u32_t sg_idx; u32_t n_grp; rcode retU; for (block=0; blockGetCount(); if (0 == p_grp_ar->GetCount()) { RCD_RETURN_FAULT_MSG(retU, "[E!] Invalid number of extension blocks"); } pGLog->slog.Printf("AssembleEDID(): block %u/%u, groups %u", block, num_valid_blocks, n_grp); pGLog->DoLog(); for (idx_grp=0; idx_grpItem(idx_grp); dat_sz = pgrp->getDataSize(); n_subg = pgrp->getSubGrpCount(); pGLog->slog.Printf("[%u] offs %u: \"%s\", size %u", idx_grp, offs, pgrp->CodeName, pgrp->getTotalSize()); if (n_subg != 0) { pGLog->slog << ", sub-groups: " << n_subg; } pGLog->DoLog(); if (block == EDI_EXT0_IDX) { gtid = pgrp->getTypeID(); if (gtid.base_id != 0) { if (ID_DTD != gtid.base_id) { pGLog->slog.Printf("[E!] Invalid group for CTA-861 block: '%s: %s', " "offs: %u", pgrp->CodeName, pgrp->GroupName, pgrp->getRelOffs()); pGLog->DoLog(); RCD_RETURN_FAULT(retU); } } } pgrp->SpawnInstance(&pbuf[offs]); offs += dat_sz; blk_sz -= dat_sz; for (sg_idx=0; sg_idxgetSubGroup(sg_idx); dat_sz = p_subg->getDataSize(); pGLog->slog.Printf(" [%u] offs %u: \"%s\", size %u", sg_idx, offs, p_subg->CodeName, dat_sz); pGLog->DoLog(); p_subg->SpawnInstance(&pbuf[offs]); offs += dat_sz; blk_sz -= dat_sz; } } //base EDID: consistency check if ((block == 0) && (blk_sz > 0)) { unk_t *unk; //check if sizeis multiple of desc. size if ((blk_sz % sizeof(unk_t)) != 0) { RCD_RETURN_FAULT_MSG(retU, "[E!] Assebling FAILED, internal error"); } else if (! b_ERR_Ignore) { wxedid_RCD_RETURN_FAULT_VMSG(retU, "[E!] Base EDID block: missing descriptor(s) @offset=%u", offs); } //clear remaing buf. space, then inject VOID descriptor(s), type 0x10 memset(&pbuf[offs], 0, blk_sz); unk = reinterpret_cast (&pbuf[offs]); do { pGLog->slog.Printf("[i] Descriptor type 0x10 (VOID) inserted, offs %u", offs); pGLog->DoLog(); unk->hdr.dsc_type = 0x10; offs += sizeof(unk_t); blk_sz -= sizeof(unk_t); unk = reinterpret_cast (&pbuf[offs]); } while (blk_sz > 0); } //CEA: clear unused bytes if (block == 1) { pGLog->slog.Printf("[%u] offs: %u [free space]: %u bytes", idx_grp, offs, blk_sz ); pGLog->DoLog(); while (blk_sz > 0) { pbuf[offs] = 0; offs ++ ; blk_sz -- ; } //Update DTD offset CEA_Set_DTD_Offset(pbuf, p_grp_ar); } } RCD_RETURN_OK(retU); err: wxedid_RCD_SET_FAULT_VMSG(retU, "[E!] AssembleEDID(): Block[%u] size limit reached: [idx=%u] \'%s\', sub-group idx=%u", block, idx_grp, (const char*) pgrp->GroupName.c_str(), sg_idx); return retU; } //Common handlers rcode EDID_cl::BitVal(u32_t op, wxString& sval, u32_t& ival, edi_dynfld_t* p_field) { rcode retU; u8_t *inst; u8_t bmask; inst = getValPtr(p_field); if ((p_field->field.flags & F_BIT) == 0) RCD_RETURN_FAULT(retU); bmask = (1 << p_field->field.shift); if (op == OP_READ) { ival = ((inst[0] & bmask) >> p_field->field.shift); sval << ival; RCD_SET_OK(retU); } else { //write ulong val = 0; RCD_SET_FAULT(retU); if (op == OP_WRSTR) { //fixed min and max are used -> this is a bit value retU = getStrUint(sval, 10, 0, 1, val); if (! RCD_IS_OK(retU)) return retU; } else if (op == OP_WRINT) { if ((p_field->field.flags & F_NI) != 0) RCD_RETURN_FAULT(retU); val = ival; RCD_SET_OK(retU); } else { RCD_RETURN_FAULT(retU); //wrong op code } val = (val << p_field->field.shift); inst[0] &= ~bmask; inst[0] |= (val & bmask); } return retU; } rcode EDID_cl::BitF8Val(u32_t op, wxString& sval, u32_t& ival, edi_dynfld_t* p_field) { rcode retU; ulong bmask; u8_t *inst; inst = getValPtr(p_field); if ((p_field->field.flags & F_BFD) == 0) RCD_RETURN_FAULT(retU); if ((p_field->field.fld_sz + p_field->field.shift) > 8) RCD_RETURN_FAULT(retU); if (op == OP_READ) { bmask = (0xFF >> (8 - p_field->field.fld_sz)); ival = ((inst[0] >> p_field->field.shift) & bmask); if (p_field->field.flags & F_INT) { sval.Empty(); sval << ival; RCD_SET_OK(retU); } else if (p_field->field.flags & F_HEX) { sval.Printf("0x%02X", ival); RCD_SET_OK(retU); } else { ulong tmpv = ival; uint itb; char chbit[12]; chbit[11] = 0; //read by bit for (itb=0; itbfield.fld_sz; itb++) { chbit[10-itb] = 0x30+(tmpv & 0x01); //to ASCII tmpv >>= 1; } tmps = wxString::FromAscii(&chbit[(11-itb)]); sval = "0b"; sval << tmps; RCD_SET_OK(retU); } } else { ulong tmpv = 0; int base; RCD_SET_FAULT(retU); bmask = ((0xFF >> (8 - p_field->field.fld_sz)) << p_field->field.shift); if (op == OP_WRSTR) { if (p_field->field.flags & F_INT) { base = 10; } else if (p_field->field.flags & F_HEX) { base = 16; } else { base = 2; } retU = getStrUint(sval, base, p_field->field.minv, p_field->field.maxv, tmpv); if (! RCD_IS_OK(retU)) return retU; } else if (op == OP_WRINT) { if ((p_field->field.flags & F_NI) != 0) RCD_RETURN_FAULT(retU); tmpv = ival; RCD_SET_OK(retU); } else { RCD_RETURN_FAULT(retU); //wrong op code } tmpv = ((tmpv << p_field->field.shift) & bmask); inst[0] &= ~bmask; inst[0] |= tmpv; } return retU; } rcode EDID_cl::BitF16Val(u32_t op, wxString& sval, u32_t& ival, edi_dynfld_t* p_field) { rcode retU; ulong bmask; u8_t *inst; u16_t w16; inst = getValPtr(p_field); if ((p_field->field.flags & F_BFD) == 0) RCD_RETURN_FAULT(retU); if ((p_field->field.fld_sz + p_field->field.shift) > 16) RCD_RETURN_FAULT(retU); if (op == OP_READ) { w16 = rdWord16_LE(inst); bmask = (0xFFFF >> (16 - p_field->field.fld_sz)); ival = ((w16 >> p_field->field.shift) & bmask); if (p_field->field.flags & F_INT) { sval.Empty(); sval << ival; RCD_SET_OK(retU); } else if (p_field->field.flags & F_HEX) { sval.Printf("0x%04X", ival); RCD_SET_OK(retU); } else { ulong tmpv = ival; uint itb; char chbit[20]; chbit[19] = 0; //read by bit for (itb=0; itbfield.fld_sz; itb++) { chbit[10-itb] = 0x30+(tmpv & 0x01); //to ASCII tmpv >>= 1; } tmps = wxString::FromAscii(&chbit[(19-itb)]); sval = "0b"; sval << tmps; RCD_SET_OK(retU); } } else { ulong tmpv = 0; int base; RCD_SET_FAULT(retU); ulong bmask = ((0xFFFF >> (16 - p_field->field.fld_sz)) << p_field->field.shift); if (op == OP_WRSTR) { if (p_field->field.flags & F_INT) { base = 10; } else if (p_field->field.flags & F_HEX) { base = 16; } else { base = 2; } retU = getStrUint(sval, base, p_field->field.minv, p_field->field.maxv, tmpv); if (! RCD_IS_OK(retU)) return retU; ival = tmpv; } else if (op == OP_WRINT) { if ((p_field->field.flags & F_NI) != 0) RCD_RETURN_FAULT(retU); RCD_SET_OK(retU); } if (! RCD_IS_OK(retU)) return retU; ival = ((ival << p_field->field.shift) & bmask); w16 = rdWord16_LE(inst); _BE_SWAP16(w16); w16 &= ~bmask; w16 |= ival; wrWord16_LE(inst, w16); } return retU; } rcode EDID_cl::ByteVal(u32_t op, wxString& sval, u32_t& ival, edi_dynfld_t* p_field) { rcode retU; u8_t *inst; inst = getValPtr(p_field); if ((p_field->field.flags & (F_BIT|F_STR)) != 0) RCD_RETURN_FAULT(retU); if (op == OP_READ) { //read ival = inst[0]; if (p_field->field.flags & F_INT) { sval.Empty(); sval << ival; RCD_SET_OK(retU); } else if (p_field->field.flags & F_HEX) { sval.Printf("0x%02X", ival); RCD_SET_OK(retU); } else { RCD_SET_FAULT(retU); } } else { //write ulong val = 0; RCD_SET_FAULT(retU); if (op == OP_WRSTR) { if (p_field->field.flags & F_INT) { retU = getStrUint(sval, 10, p_field->field.minv, p_field->field.maxv, val); } if (p_field->field.flags & F_HEX) { if (sval.SubString(0, 1) != "0x") RCD_RETURN_FAULT(retU); retU = getStrUint(sval, 16, p_field->field.minv, p_field->field.maxv, val); } if (! RCD_IS_OK(retU)) return retU; } else if (op == OP_WRINT) { if ((p_field->field.flags & F_NI) != 0) RCD_RETURN_FAULT(retU); val = ival; RCD_SET_OK(retU); } else { RCD_RETURN_FAULT(retU); //wrong op code } inst[0] = val; } return retU; } rcode EDID_cl::FldPadStr(u32_t op, wxString& sval, u32_t& ival, edi_dynfld_t* p_field) { rcode retU; u32_t itb; u8_t *inst; inst = getValPtr(p_field); u32_t maxl = p_field->field.fld_sz; if (maxl > 31) RCD_RETURN_FAULT(retU); char cbuff[32]; if (op == OP_READ) { //max maxl chars allowed for (itb=0; itb maxl) RCD_RETURN_FAULT(retU); memcpy(cbuff, sval.To8BitData(), sval.Len()); for (itb=0; itb maxv) { RCD_SET_FAULT(retU); } if (tmpv < minv) { RCD_SET_FAULT(retU); } val = tmpv; return retU; } rcode EDID_cl::getStrFloat(wxString& sval, float minv, float maxv, float& val) { rcode retU; double dval; RCD_SET_OK(retU); if (! sval.ToDouble(&dval)) { RCD_SET_FAULT(retU); } val = (float) dval; if (val > maxv) { RCD_SET_FAULT(retU); } if (val < minv) { RCD_SET_FAULT(retU); } return retU; } rcode EDID_cl::Gamma(u32_t op, wxString& sval, u32_t& ival, edi_dynfld_t* p_field) { rcode retU; uint tmpv; float fval; void* inst = NULL; inst = getValPtr(p_field); if (op == OP_READ) { tmpv = ( (reinterpret_cast (inst))[0] + 100); ival = tmpv; fval = tmpv; sval.Printf("%.02f", (fval/100.0)); } else { if (op == OP_WRINT) RCD_RETURN_FAULT(retU); retU = getStrFloat(sval, 1.0, 3.54, fval); if (! RCD_IS_OK(retU)) return retU; tmpv = (fval*100.0); *(reinterpret_cast (inst)) = (tmpv - 100); } RCD_RETURN_OK(retU); } rcode EDID_cl::rdByteStr(wxString& sval, u8_t* pstrb, u32_t slen) { rcode retU; if (pstrb == NULL) RCD_RETURN_FAULT(retU); sval = "0x"; for (u32_t itb=0; itb=0; itb--) { tmps.Printf("%02X", pstrb[itb]); sval << tmps; } RCD_RETURN_OK(retU); } rcode EDID_cl::wrByteStr(wxString& sval, u8_t* pstrb, u32_t slen) { rcode retU; if (pstrb == NULL) RCD_RETURN_FAULT(retU); //required prefix if (sval.SubString(0, 1).Cmp("0x") != 0) RCD_RETURN_FAULT(retU); u32_t clen = sval.Len(); if ((clen & 0x1) != 0 ) RCD_RETURN_FAULT(retU); if (((clen-2)/2) > slen) RCD_RETURN_FAULT(retU); clen --; u32_t itc = 2; ulong tmpv = 0; for (u32_t itb=0; itb= clen) break; if (! sval.SubString(itc, itc+1).ToULong(&tmpv, 16)) { RCD_RETURN_FAULT(retU); } pstrb[itb] = static_cast (tmpv); itc+=2; } RCD_RETURN_OK(retU); } rcode EDID_cl::wrByteStrLE(wxString& sval, u8_t* pstrb, u32_t slen) { rcode retU; if (pstrb == NULL) RCD_RETURN_FAULT(retU); //required prefix if (sval.SubString(0, 1).Cmp("0x") != 0) { RCD_RETURN_FAULT(retU); } u32_t itc = sval.Len(); if (itc < 4) { //1 byte minimum: 0xBB RCD_RETURN_FAULT(retU);} if ((itc & 0x1) != 0) { //incomplete byte RCD_RETURN_FAULT(retU);} itc = (itc-2)/2; if (itc > slen) { //too long RCD_RETURN_FAULT(retU);} i32_t itb = (slen-1); ulong tmpv = 0; if (itc < slen) { do { pstrb[itb--] = 0; slen-- ; } while (itc < slen); } itc = 2; for (; itb>=0; itb--) { if (! sval.SubString(itc, itc+1).ToULong(&tmpv, 16)) { RCD_RETURN_FAULT(retU); } pstrb[itb] = static_cast (tmpv); itc += 2; } RCD_RETURN_OK(retU); } rcode EDID_cl::ByteStr(u32_t op, wxString& sval, u32_t& ival, edi_dynfld_t* p_field) { rcode retU; u8_t *inst; RCD_SET_OK(retU); inst = getValPtr(p_field); if ((p_field->field.flags & F_STR) == 0) RCD_RETURN_FAULT(retU); if (op == OP_READ) { if ((p_field->field.flags & F_LE) == 0) { retU = rdByteStr(sval, inst, p_field->field.fld_sz); } else { retU = rdByteStrLE(sval, inst, p_field->field.fld_sz); } } else { if (op == OP_WRINT) RCD_RETURN_FAULT(retU); if ((p_field->field.flags & F_LE) == 0) { retU = wrByteStr(sval, inst, p_field->field.fld_sz); } else { retU = wrByteStrLE(sval, inst, p_field->field.fld_sz); } } ival = 0; return retU; } rcode EDID_cl::Word16(u32_t op, wxString& sval, u32_t& ival, edi_dynfld_t* p_field) { static const char fmt_dec[] = "%u"; static const char fmt_hex[] = "0x%04X"; rcode retU; u32_t flags; const char *fmt; u8_t *p_w16; u16_t w16; RCD_SET_FAULT(retU); p_w16 = getValPtr(p_field); flags = p_field->field.flags; if (op == OP_READ) { w16 = rdWord16_LE(p_w16); //swap forced if (F_LE & flags) w16 = __bswap_16(w16); ival = w16; fmt = (F_HEX & flags) ? fmt_hex : fmt_dec; sval.Printf(fmt, ival); RCD_SET_OK(retU); } else { if (op == OP_WRSTR) { ulong tmpv = 0; int base; base = (F_HEX & flags) ? 16 : 10; retU = getStrUint(sval, base, p_field->field.minv, p_field->field.maxv, tmpv); w16 = (u16_t) tmpv; } else if (op == OP_WRINT) { w16 = (u16_t) ival; RCD_SET_OK(retU); } if (! RCD_IS_OK(retU)) return retU; if (F_LE & flags) w16 = __bswap_16(w16); wrWord16_LE(p_w16, w16); } return retU; } rcode EDID_cl::Word24(u32_t op, wxString& sval, u32_t& ival, edi_dynfld_t* p_field) { static const char fmt_dec[] = "%u"; static const char fmt_hex[] = "0x%06X"; rcode retU; u32_t flags; const char *fmt; u8_t *p_w32; u32_t w32; RCD_SET_FAULT(retU); p_w32 = getValPtr(p_field); flags = p_field->field.flags; if (op == OP_READ) { w32 = rdWord24_LE(p_w32); //byte swap forced if (F_LE & flags) { w32 = __bswap_32(w32); w32 >>= 8; } ival = w32; fmt = (F_HEX & flags) ? fmt_hex : fmt_dec; sval.Printf(fmt, ival); RCD_SET_OK(retU); } else { if (op == OP_WRSTR) { ulong tmpv = 0; int base; base = (F_HEX & flags) ? 16 : 10; retU = getStrUint(sval, base, p_field->field.minv, p_field->field.maxv, tmpv); w32 = (u32_t) tmpv; } else if (op == OP_WRINT) { w32 = ival; RCD_SET_OK(retU); } if (! RCD_IS_OK(retU)) return retU; if (F_LE & flags) { w32 = __bswap_32(w32); w32 >>= 8; } wrWord24_LE(p_w32, w32); } return retU; } wxedid-0.0.32/src/EDID_dsc.cpp0000644000175000017500000014204014722720160012634 00000000000000/*************************************************************** * Name: EDID_dsc.cpp * Purpose: EDID DTD and alternative descriptors * Author: Tomasz Pawlak (tomasz.pawlak@wp.eu) * Copyright: Tomasz Pawlak (C) 2014-2024 * License: GPLv3+ **************************************************************/ #include "debug.h" #include "rcdunits.h" #ifndef idEDID_DESC #error "EDID_desc.cpp: missing unit ID" #endif #define RCD_UNIT idEDID_DESC #include "rcode/rcode.h" #include "wxedid_rcd_scope.h" RCD_AUTOGEN_DEFINE_UNIT #include #include #include #include "vmap.h" #include "EDID_class.h" //bad block length msg (defined in CEA.cpp) extern const char ERR_GRP_LEN_MSG[]; //EDID_base.cpp: shared STI/DMT descriptions extern const char stiXres8dsc []; extern const char stiVsyncDsc []; extern const char stiAspRatioDsc[]; extern const char stiDMT2B_Dsc []; //unknown/invalid byte field (defined in CEA.cpp) extern const edi_field_t unknown_byte_fld; extern void insert_unk_byte(edi_field_t *p_fld, u32_t len, u32_t s_offs); //DTD : detailed timing descriptor : handlers #pragma GCC diagnostic ignored "-Waddress-of-packed-member" rcode EDID_cl::DTD_PixClk(u32_t op, wxString& sval, u32_t& ival, edi_dynfld_t* p_field) { rcode retU; float fval; u16_t w16; dtd_t *inst; inst = reinterpret_cast (getInstancePtr(p_field)); if (op == OP_READ) { w16 = rdWord16_LE((u8_t*) &inst->pix_clk); _BE_SWAP16(w16); ival = w16; fval = ival; fval /= 100.0; sval.Printf("%.02f", fval); RCD_SET_OK(retU); } else { RCD_SET_FAULT(retU); if (op == OP_WRSTR) { retU = getStrFloat(sval, 0.0, 655.35, fval); ival = (fval * 100.0); } else if (op == OP_WRINT) { RCD_SET_OK(retU); } if (! RCD_IS_OK(retU)) return retU; w16 = ival; _BE_SWAP16(w16); wrWord16_LE((u8_t*) &inst->pix_clk, w16); //pix_clk==0: change desc. type to Alternative Descriptor if (0 == ival) RCD_SET_TRUE(retU); } return retU; } #pragma GCC diagnostic warning "-Waddress-of-packed-member" rcode EDID_cl::DTD_HApix(u32_t op, wxString& sval, u32_t& ival, edi_dynfld_t* p_field) { rcode retU; dtd_t *inst; inst = reinterpret_cast (getInstancePtr(p_field)); if (op == OP_READ) { ival = inst->HApix_8lsb; ival |= (inst->HApix_4msb << 8); sval << ival; RCD_SET_OK(retU); } else { ulong tmpv; RCD_SET_FAULT(retU); if (op == OP_WRSTR) { retU = getStrUint(sval, 10, p_field->field.minv, p_field->field.maxv, tmpv); } else if (op == OP_WRINT) { tmpv = ival; RCD_SET_OK(retU); } if (! RCD_IS_OK(retU)) return retU; inst->HApix_8lsb = (tmpv & 0xFF); inst->HApix_4msb = ((tmpv >> 8) & 0x0F); } return retU; } rcode EDID_cl::DTD_HBpix(u32_t op, wxString& sval, u32_t& ival, edi_dynfld_t* p_field) { rcode retU; dtd_t *inst; inst = reinterpret_cast (getInstancePtr(p_field)); if (op == OP_READ) { ival = inst->HBpix_8lsb; ival |= (inst->HBpix_4msb << 8); sval << ival; RCD_SET_OK(retU); } else { ulong tmpv; RCD_SET_FAULT(retU); if (op == OP_WRSTR) { retU = getStrUint(sval, 10, p_field->field.minv, p_field->field.maxv, tmpv); } else if (op == OP_WRINT) { tmpv = ival; RCD_SET_OK(retU); } if (! RCD_IS_OK(retU)) return retU; inst->HBpix_8lsb = (tmpv & 0xFF); inst->HBpix_4msb = ((tmpv >> 8) & 0x0F); } return retU; } rcode EDID_cl::DTD_VAlin(u32_t op, wxString& sval, u32_t& ival, edi_dynfld_t* p_field) { rcode retU; dtd_t *inst; inst = reinterpret_cast (getInstancePtr(p_field)); if (op == OP_READ) { ival = inst->VAlin_8lsb; ival |= (inst->VAlin_4msb << 8); sval << ival; RCD_SET_OK(retU); } else { ulong tmpv; RCD_SET_FAULT(retU); if (op == OP_WRSTR) { retU = getStrUint(sval, 10, p_field->field.minv, p_field->field.maxv, tmpv); } else if (op == OP_WRINT) { tmpv = ival; RCD_SET_OK(retU); } if (! RCD_IS_OK(retU)) return retU; inst->VAlin_8lsb = (tmpv & 0xFF); inst->VAlin_4msb = ((tmpv >> 8) & 0x0F); } return retU; } rcode EDID_cl::DTD_VBlin(u32_t op, wxString& sval, u32_t& ival, edi_dynfld_t* p_field) { rcode retU; dtd_t *inst; inst = reinterpret_cast (getInstancePtr(p_field)); if (op == OP_READ) { ival = inst->VBlin_8lsb; ival |= (inst->VBlin_4msb << 8); sval << ival; RCD_SET_OK(retU); } else { ulong tmpv; RCD_SET_FAULT(retU); if (op == OP_WRSTR) { retU = getStrUint(sval, 10, p_field->field.minv, p_field->field.maxv, tmpv); } else if (op == OP_WRINT) { tmpv = ival; RCD_SET_OK(retU); } if (! RCD_IS_OK(retU)) return retU; inst->VBlin_8lsb = (tmpv & 0xFF); inst->VBlin_4msb = ((tmpv >> 8) & 0x0F); } RCD_SET_OK(retU); return retU; } rcode EDID_cl::DTD_HOsync(u32_t op, wxString& sval, u32_t& ival, edi_dynfld_t* p_field) { rcode retU; dtd_t *inst; inst = reinterpret_cast (getInstancePtr(p_field)); if (op == OP_READ) { ival = inst->HOsync_8lsb; ival |= (inst->HOsync_2msb << 8); sval << ival; RCD_SET_OK(retU); } else { ulong tmpv; RCD_SET_FAULT(retU); if (op == OP_WRSTR) { retU = getStrUint(sval, 10, p_field->field.minv, p_field->field.maxv, tmpv); } else if (op == OP_WRINT) { tmpv = ival; RCD_SET_OK(retU); } if (! RCD_IS_OK(retU)) return retU; inst->HOsync_8lsb = (tmpv & 0xFF); inst->HOsync_2msb = ((tmpv >> 8) & 0x03); } return retU; } rcode EDID_cl::DTD_HsyncW(u32_t op, wxString& sval, u32_t& ival, edi_dynfld_t* p_field) { rcode retU; dtd_t *inst; inst = reinterpret_cast (getInstancePtr(p_field)); if (op == OP_READ) { ival = inst->HsyncW_8lsb; ival |= (inst->HsyncW_2msb << 8); sval << ival; RCD_SET_OK(retU); } else { ulong tmpv; RCD_SET_FAULT(retU); if (op == OP_WRSTR) { retU = getStrUint(sval, 10, p_field->field.minv, p_field->field.maxv, tmpv); } else if (op == OP_WRINT) { tmpv = ival; RCD_SET_OK(retU); } if (! RCD_IS_OK(retU)) return retU; inst->HsyncW_8lsb = (tmpv & 0xFF); inst->HsyncW_2msb = ((tmpv >> 8) & 0x03); } return retU; } rcode EDID_cl::DTD_VOsync(u32_t op, wxString& sval, u32_t& ival, edi_dynfld_t* p_field) { rcode retU; dtd_t *inst; inst = reinterpret_cast (getInstancePtr(p_field)); if (op == OP_READ) { ival = inst->VOsync_4lsb; ival |= (inst->VOsync_2msb << 4); sval << ival; RCD_SET_OK(retU); } else { ulong tmpv; RCD_SET_FAULT(retU); if (op == OP_WRSTR) { retU = getStrUint(sval, 10, p_field->field.minv, p_field->field.maxv, tmpv); } else if (op == OP_WRINT) { tmpv = ival; RCD_SET_OK(retU); } if (! RCD_IS_OK(retU)) return retU; inst->VOsync_4lsb = (tmpv & 0x0F); inst->VOsync_2msb = ((tmpv >> 4) & 0x03); } return retU; } rcode EDID_cl::DTD_VsyncW(u32_t op, wxString& sval, u32_t& ival, edi_dynfld_t* p_field) { rcode retU; dtd_t *inst; inst = reinterpret_cast (getInstancePtr(p_field)); if (op == OP_READ) { ival = inst->VsyncW_4lsb; ival |= (inst->VsyncW_2msb << 4); sval << ival; RCD_SET_OK(retU); } else { ulong tmpv; RCD_SET_FAULT(retU); if (op == OP_WRSTR) { retU = getStrUint(sval, 10, p_field->field.minv, p_field->field.maxv, tmpv); } else if (op == OP_WRINT) { tmpv = ival; RCD_SET_OK(retU); } if (! RCD_IS_OK(retU)) return retU; inst->VsyncW_4lsb = (tmpv & 0x0F); inst->VsyncW_2msb = ((tmpv >> 4) & 0x03); } return retU; } rcode EDID_cl::DTD_Hsize(u32_t op, wxString& sval, u32_t& ival, edi_dynfld_t* p_field) { rcode retU; dtd_t *inst; inst = reinterpret_cast (getInstancePtr(p_field)); if (op == OP_READ) { ival = inst->Hsize_8lsb; ival |= (inst->Hsize_4msb << 8); sval << ival; RCD_SET_OK(retU); } else { ulong tmpv; RCD_SET_FAULT(retU); if (op == OP_WRSTR) { retU = getStrUint(sval, 10, p_field->field.minv, p_field->field.maxv, tmpv); } else if (op == OP_WRINT) { tmpv = ival; RCD_SET_OK(retU); } if (! RCD_IS_OK(retU)) return retU; inst->Hsize_8lsb = (tmpv & 0xFF); inst->Hsize_4msb = ((tmpv >> 8) & 0x0F); } return retU; } rcode EDID_cl::DTD_Vsize(u32_t op, wxString& sval, u32_t& ival, edi_dynfld_t* p_field) { rcode retU; dtd_t *inst; inst = reinterpret_cast (getInstancePtr(p_field)); if (op == OP_READ) { ival = inst->Vsize_8lsb; ival |= (inst->Vsize_4msb << 8); sval << ival; RCD_SET_OK(retU); } else { ulong tmpv; RCD_SET_FAULT(retU); if (op == OP_WRSTR) { retU = getStrUint(sval, 10, p_field->field.minv, p_field->field.maxv, tmpv); } else if (op == OP_WRINT) { tmpv = ival; RCD_SET_OK(retU); } if (! RCD_IS_OK(retU)) return retU; inst->Vsize_8lsb = (tmpv & 0xFF); inst->Vsize_4msb = ((tmpv >> 8) & 0x0F); } return retU; } //DTD : detailed timing descriptor const char dtd_cl::CodN[] = "DTD"; const char dtd_cl::Name[] = "Detailed Timing Descriptor"; const char dtd_cl::Desc[] = "Detailed Timing Descriptor\n\n" "To change DTD into alternative descriptor type, set the Pixel Clock to 0.\n\n"; const edi_field_t dtd_cl::fields[] = { {&EDID_cl::DTD_PixClk, 0, offsetof(dtd_t, pix_clk), 0, 2, F_FLT|F_FR|F_MHZ|F_DN, 0, 65535, "Pixel clock", "Pixel clock in 10 kHz units (0.01–655.35 MHz, LE).\n" "val=0 is reserved -> indicates alternate descriptor format MSN, MRL, WPD, ...\n\n" "To change DTD into alternative descriptor type, set the Pixel Clock to 0.\n\n" "NOTE:\nMost of gfx/video cards require pixel clock value divisible by 0.25MHz\n" }, {&EDID_cl::DTD_HApix, 0, offsetof(dtd_t, HApix_8lsb), 0, 12, F_INT|F_BFD|F_PIX|F_DN, 0, 4095, "H-Active pix", "Horizontal active pixels (0–4095), X-resolution." }, {&EDID_cl::DTD_HBpix, 0, offsetof(dtd_t, HBpix_8lsb), 0, 12, F_INT|F_BFD|F_PIX|F_DN, 0, 4095, "H-Blank pix", "H-blank pixels (0–4095).\n" "This field defines a H-Blank time as number of pixel clock pulses. H-Blank time is a time " "break between drawing 2 consecutive lines on the screen. During H-blank time H-sync pulse is sent " "to the monitor to ensure correct horizontal alignment of lines." }, {&EDID_cl::DTD_VAlin, 0, offsetof(dtd_t, VAlin_8lsb), 0, 12, F_INT|F_BFD|F_PIX|F_DN, 0, 4095, "V-Active lines", "Vertical active lines (0–4095), V-resolution." }, {&EDID_cl::DTD_VBlin, 0, offsetof(dtd_t, VBlin_8lsb), 0, 12, F_INT|F_BFD|F_PIX|F_DN, 0, 4095, "V-Blank lines", "V-blank lines (0–4095).\n" "This field defines a V-Blank time as number of H-lines. During V-Blank time V-sync pulse is sent " "to the monitor to ensure correct vertical alignment of the picture." }, {&EDID_cl::DTD_HOsync, 0, offsetof(dtd_t, HOsync_8lsb), 0, 10, F_INT|F_BFD|F_PIX, 0, 1023, "H-Sync offs", "H-sync offset in pixel clock pulses (0–1023) from blanking start. This offset value is " "responsible for horizontal picture alignment. Higher values are shifting the picture to the " "left edge of the screen." }, {&EDID_cl::DTD_HsyncW, 0, offsetof(dtd_t, HsyncW_8lsb), 0, 10, F_INT|F_BFD|F_PIX, 0, 1023, "H-Sync width", "H-sync pulse width (time) in pixel clock pulses (0–1023)." }, {&EDID_cl::DTD_VOsync, 0, offsetof(dtd_t, Vsize_8lsb)+1, 0, 6, F_INT|F_BFD|F_PIX, 0, 63, "V-Sync offs", "V-sync offset as number of H-lines (0–63). This offset value is responsible for vertical " "picture alignment. Higher values are shifting the picture to the top edge of the screen." }, {&EDID_cl::DTD_VsyncW, 0, offsetof(dtd_t, Vsize_8lsb)+1, 0, 6, F_INT|F_BFD|F_PIX, 0, 63, "V-Sync width", "V-sync pulse width (time) as number of H-lines (0–63)" }, {&EDID_cl::DTD_Hsize, 0, offsetof(dtd_t, Hsize_8lsb), 0, 12, F_INT|F_BFD|F_MM, 0, 4095, "H-Size", "Horizontal display size, mm (0–4095)" }, {&EDID_cl::DTD_Vsize, 0, offsetof(dtd_t, Vsize_8lsb), 0, 12, F_INT|F_BFD|F_MM, 0, 4095, "V-Size", "Vertical display size, mm (0–4095)" }, {&EDID_cl::ByteVal, 0, offsetof(dtd_t, Hborder_pix), 0, 1, F_BTE|F_INT|F_PIX, 0, 255, "H-Border pix", "Horizontal border pixels: overscan compensation (each side; total is twice this)" }, {&EDID_cl::ByteVal, 0, offsetof(dtd_t, Vborder_lin), 0, 1, F_BTE|F_INT|F_PIX, 0, 255, "V-Border lines", "Vertical border pixels: overscan compensation (each side; total is twice this)" }, //Features flags {&EDID_cl::BitF8Val, 0, offsetof(dtd_t, features), 3, 2, F_BFD, 0, 3, "sync_type", "Sync type:\n 00=Analog composite\n 01=Bipolar analog composite\n" " 10=Digital composite (on HSync)\n 11=Digital separate" }, {&EDID_cl::BitVal, 0, offsetof(dtd_t, features), 1, 1, F_BIT, 0, 1, "Hsync_type", "Analog sync: 1: Sync on all 3 RGB lines, 0: sync_on_green\n" "Digital: HSync polarity: 1=positive" }, {&EDID_cl::BitVal, 0, offsetof(dtd_t, features), 2, 1, F_BIT, 0, 1, "Vsync_type", "Separated digital sync: Vsync polarity: 1=positive\n" "Other types: composite VSync (HSync during VSync)" }, {&EDID_cl::BitVal, 0, offsetof(dtd_t, features), 0, 1, F_BIT, 0, 1, "il2w_stereo", "2-way line-interleaved stereo, if \"stereo_mode\" is not 0b00" }, {&EDID_cl::BitF8Val, 0, offsetof(dtd_t, features), 5, 2, F_BFD, 0, 3, "stereo_mode", "Stereo mode:\n00=No stereo\nother values depend on \"il2w_stereo\" (bit 0):\n" "il2w_stereo=0:\n" "01= Field sequential stereo, stereo sync=1 during right image\n" "10= Field sequential stereo, stereo sync=1 during left image\n" "11= 4-way interleaved stereo\n" "il2w_stereo=1:\n" "01= 2-way interleaved stereo, right image on even lines\n" "10= 2-way interleaved stereo, left image on even lines\n" "11= Side-by-side interleaved stereo\n\n" }, {&EDID_cl::BitVal, 0, offsetof(dtd_t, features), 7, 1, F_BIT, 0, 1, "interlace", "interlaced" } }; #pragma GCC diagnostic ignored "-Wunused-parameter" rcode dtd_cl::init(const u8_t* inst, u32_t orflags, edi_grp_cl* parent) { static const u32_t fcount = 19; rcode retU; parent_grp = parent; type_id.t32 = ID_DTD; CopyInstData(inst, sizeof(dtd_t)); retU = init_fields(&fields[0], inst_data, fcount, false, Name, Desc, CodN); return retU; } #pragma GCC diagnostic warning "-Wunused-parameter" void dtd_cl::getGrpName(EDID_cl& EDID, wxString& gp_name) { u32_t ival; u32_t xres; u32_t yres; edi_dynfld_t *p_field; if (! EDID.b_GrpNameDynamic) { gp_name = GroupName; return; } //X-res p_field = FieldsAr.Item(DTD_IDX_HAPIX); EDID.gp_name.Empty(); ( EDID.*p_field->field.handlerfn )(OP_READ, EDID.gp_name, xres, p_field ); gp_name = EDID.gp_name; gp_name << "x"; //Y-res p_field = FieldsAr.Item(DTD_IDX_VALIN); EDID.gp_name.Empty(); ( EDID.*p_field->field.handlerfn )(OP_READ, EDID.gp_name, yres, p_field ); gp_name << EDID.gp_name; gp_name << " @ "; { //V-Refresh float lineW, pixclk, lineT, n_lines, frameT; p_field = FieldsAr.Item(DTD_IDX_PIXCLK); //H-freq (pix_clk) ( EDID.*p_field->field.handlerfn )(OP_READ, EDID.gp_name, ival, p_field ); pixclk = (float) (ival * 10000); //x10kHz p_field = FieldsAr.Item(DTD_IDX_HBPIX); //H-blank ( EDID.*p_field->field.handlerfn )(OP_READ, EDID.gp_name, ival, p_field ); lineW = (float) (ival + xres); lineT = (lineW / pixclk); p_field = FieldsAr.Item(DTD_IDX_VBLIN); //V-blank ( EDID.*p_field->field.handlerfn )(OP_READ, EDID.gp_name, ival, p_field ); n_lines = (float) (ival + yres); frameT = (n_lines * lineT); EDID.gp_name.Printf("%.02fHz", (1.0/frameT)); gp_name << EDID.gp_name; } } //----> Alternative Descriptors //Alt. Descriptor type handler rcode EDID_cl::ALT_DType (u32_t op, wxString& sval, u32_t& ival, edi_dynfld_t* p_field) { rcode retU; u32_t dtype; unk_t *pdsc; pdsc = reinterpret_cast (getInstancePtr(p_field)); dtype = pdsc->hdr.dsc_type; retU = ByteVal(op, sval, ival, p_field); if (! RCD_IS_OK(retU)) return retU; if (dtype != pdsc->hdr.dsc_type) { RCD_SET_TRUE(retU); //Desc. type changed } return retU; } //Alt. Descriptor type selector. sm_vmap AltDescType_map = { {0xFF, {0, "MSN" , "Monitor Serial Number"}}, {0xFE, {0, "UTX" , "Unspecified Text" }}, {0xFD, {0, "MRL" , "Monitor Range Limits" }}, {0xFC, {0, "MND" , "Monitor Name" }}, {0xFB, {0, "WPD" , "White Point Data" }}, {0xFA, {0, "AST" , "Additional Standard Timings" }}, {0xF9, {0, "DCM" , "Display Color Management" }}, {0xF8, {0, "CT3" , "VESA-CVT 3-byte Video Timing Codes"}}, {0xF7, {0, "ET3" , "Estabilished Timings 3" }}, {0x10, {0, "VOID", "dummy place holder descriptor" }} }; static const char altHdrDsc[] = "Zero hdr (3 bytes) -> DTD:pix_clk=0, HApix_8lsb=0 -> " "alternative descriptor type (means not a DTD)"; static const char altZeroDsc[] = "Mandatory zero for a non-DTD (alternative) descriptor."; static const char AltDesc[] = "Defined descriptor types:\n" " 0xFF: MSN: Monitor serial number (text, ASCII)\n" " 0xFE: UTX: Unspecified text (text, ASCII)\n" " 0xFD: MRL: Monitor range limits: (Mandatory) 6- or 13-byte binary descriptor.\n" " 0xFC: MND: Monitor name (text, ASCII), padded with 0x0A, 0x20 (..) (LF, SP)\n" " 0xFB: WPD: Additional white point data. 2x 5-byte descriptors, padded with 0A 20 20.\n" " 0xFA: AST: Additional Standard Timing Identifiers. 6x 2-byte descriptors, padded with 0A.\n" " 0xF9: DCM: Display Color Management Data\n" " 0xF8: CT3: VESA-CVT 3-byte Video Timing Codes\n" " 0xF7: ET3: Estabilished Timings 3 Descriptor\n" " 0x10: VOID: Dummy descriptor for marking unused space, all bytes should be 0x00\n" " 0x00-0x0F reserved for vendors, interpreted as UNK (unknown structures).\n"; //Alt. Descriptor header: shared. edi_field_t AltDescHdr[] = { //header {&EDID_cl::Word24, 0, offsetof(dshd_t, zero_hdr), 0, 3, F_STR|F_HEX|F_RD, 0, 0xFFFFFF, "zero_hdr", altHdrDsc }, {&EDID_cl::ALT_DType, VS_ALT_DSC_TYPE, offsetof(dshd_t, dsc_type), 0, 1, F_BTE|F_HEX|F_VS|F_RD, 0, 255, "desc_type", AltDesc }, {&EDID_cl::ByteVal, 0, offsetof(dshd_t, rsvd4), 0, 1, F_BTE|F_HEX|F_RD, 0, 0, "rsvd4", altZeroDsc }, }; //version field, used by CT3 and ET3 static const edi_field_t dsc_ver_fld[] = { {&EDID_cl::ByteVal, 0, offsetof(dcm_t, ver), 0, 1, F_BTE|F_HEX|F_RD, 0, 255, "ver", NULL } }; //MRL: Monitor Range Limits Descriptor (type 0xFD) //MRL: extension selector: handlers rcode EDID_cl::MRL_02_GTFM(u32_t op, wxString& sval, u32_t& ival, edi_dynfld_t* p_field) { rcode retU; mrl_gtf_t *inst; inst = reinterpret_cast (getInstancePtr(p_field)); if (op == OP_READ) { ival = inst->gtf_m; sval << ival; RCD_SET_OK(retU); } else { ulong tmpv; RCD_SET_FAULT(retU); if (op == OP_WRSTR) { retU = getStrUint(sval, 10, p_field->field.minv, p_field->field.maxv, tmpv); } else if (op == OP_WRINT) { tmpv = ival; RCD_SET_OK(retU); } if (! RCD_IS_OK(retU)) return retU; inst->gtf_m = tmpv; } return retU; } rcode EDID_cl::MRL_MaxPixClk(u32_t op, wxString& sval, u32_t& ival, edi_dynfld_t* p_field) { rcode retU; u32_t dtype; mrl_t *inst; i32_t ckr10; float fract; float tmpv = 0.0; inst = reinterpret_cast (getInstancePtr(p_field)); dtype = inst->mrl_ext; if (op == OP_READ) { ival = (inst->max_pixclk * 10); tmpv = (double) ival; if (0x04 == dtype) { ival = inst->ex_dat.cvt_s.maxPixClk_6lsb; fract = (float) ival; fract *= 0.25; tmpv -= fract; } sval.Printf("%.02f", tmpv); RCD_SET_OK(retU); } else { RCD_SET_FAULT(retU); if (op == OP_WRSTR) { retU = getStrFloat(sval, 10.0, 2550.0, tmpv); ckr10 = (i32_t) tmpv; } else if (op == OP_WRINT) { ckr10 = ival; tmpv = (float) ival; RCD_SET_OK(retU); } if (! RCD_IS_OK(retU)) return retU; if (0x04 == dtype) { //value rounded-up to multiple of 10MHz ckr10 = (ckr10 / 10) +1; ckr10 *= 10; //num of 0.25MHz units fract = ((float) ckr10) - tmpv; fract /= 0.25; ival = (u32_t) fract; if (ival >= 40) { //auto-adjust max_pixclk ival -= 40; ckr10 -= 10; if (ckr10 <= 0) RCD_RETURN_FAULT(retU); } inst->ex_dat.cvt_s.maxPixClk_6lsb = ival; } ival = ckr10; ival /= 10; inst->max_pixclk = ival; } return retU; } rcode EDID_cl::MRL_04_PixClk(u32_t op, wxString& sval, u32_t& ival, edi_dynfld_t* p_field) { rcode retU; mrl_t *inst; i32_t ckr10; float tmpv; inst = reinterpret_cast (getInstancePtr(p_field)); if (op == OP_READ) { ival = inst->ex_dat.cvt_s.maxPixClk_6lsb; tmpv = (float) ival; tmpv *= 0.25; sval.Printf("%.02f", tmpv); RCD_SET_OK(retU); } else { RCD_SET_FAULT(retU); if (op == OP_WRSTR) { retU = getStrFloat(sval, 0.0, 15.75, tmpv); tmpv /= 0.25; ival = (u32_t) tmpv; } else if (op == OP_WRINT) { RCD_SET_OK(retU); } if (! RCD_IS_OK(retU)) return retU; if (ival >= 40) { //auto-adjust max_pixclk ival -= 40; ckr10 = inst->max_pixclk; ckr10 -= 1; if (ckr10 <= 0) RCD_RETURN_FAULT(retU); inst->max_pixclk = ckr10; } inst->ex_dat.cvt_s.maxPixClk_6lsb = ival; } return retU; } rcode EDID_cl::MRL_04_HAlin(u32_t op, wxString& sval, u32_t& ival, edi_dynfld_t* p_field) { rcode retU; mrl_t *inst; inst = reinterpret_cast (getInstancePtr(p_field)); if (op == OP_READ) { ival = inst->ex_dat.cvt_s.maxHApix_2msb; ival <<= 8; ival |= inst->ex_dat.cvt_s.maxHApix_8lsb; sval << ival; RCD_SET_OK(retU); } else { ulong tmpv; RCD_SET_FAULT(retU); if (op == OP_WRSTR) { retU = getStrUint(sval, 10, 0, 1023, tmpv); ival = (u32_t) tmpv; } else if (op == OP_WRINT) { RCD_SET_OK(retU); } if (! RCD_IS_OK(retU)) return retU; inst->ex_dat.cvt_s.maxHApix_8lsb = ival; ival >>= 8; inst->ex_dat.cvt_s.maxHApix_2msb = ival; } return retU; } //MRL: extension selector sm_vmap MRL_ext_map = { {0x00, {0, "Default GTF support", NULL}}, {0x01, {0, "Range Limits only" , NULL}}, {0x02, {0, "Secondary GTF" , NULL}}, {0x04, {0, "CVT support info" , NULL}}, }; const char mrl_cl::CodN[] = "MRL"; const char mrl_cl::Name[] = "Monitor Range Limits"; const char mrl_cl::Desc[] = "MRL describes supported H/V-frequency range and maximum Pixel Clock.\n" "Optionally, a Secondary GTF curve parameters or CVT support information " "can be included - this depends on the value of 'mrl_ext' field"; const edi_field_t mrl_cl::fields[] = { //data: bytes 5-17 {&EDID_cl::ByteVal, 0, offsetof(mrl_t, min_Vfreq), 0, 1, F_BTE|F_INT|F_HZ, 0, 255, "min_Vfreq", "minimal V-frequency: 1..255Hz" }, {&EDID_cl::ByteVal, 0, offsetof(mrl_t, max_Vfreq), 0, 1, F_BTE|F_INT|F_HZ, 0, 255, "max_Vfreq", "maximum V-frequency: 1..255Hz" }, {&EDID_cl::ByteVal, 0, offsetof(mrl_t, min_Hfreq), 0, 1, F_BTE|F_INT|F_KHZ, 0, 255, "min_Hfreq", "minimal H-frequency: 1..255kHz" }, {&EDID_cl::ByteVal, 0, offsetof(mrl_t, max_Hfreq), 0, 1, F_BTE|F_INT|F_KHZ, 0, 255, "max_Hfreq", "maximum H-frequency: 1..255kHz" }, {&EDID_cl::MRL_MaxPixClk, 0, offsetof(mrl_t, max_pixclk), 0, 1, F_BTE|F_FLT|F_FR|F_MHZ, 10, 2550, "max_PixClk", "Max pixel clock rate.\n" "Stored value: (pix_clk/10 MHz), range: 10..2550MHz\n\n" "If 'mrl_ext' == 0x04, that is, CVT support information is available, " "then additional pixel clock bits from the extension are taken into accout (maxPixClk_apb)\n\n" "The field handler reads from and writes to both those fields.\n" "With additional precision bits, the accuracy is increased to 0,25MHz\n\n" "Additionally, the field handler ensures that maxPixClk_apb never exceeds 10MHz, " "by adjusting max_PixClk to multiple of 10MHz units." }, {&EDID_cl::ByteVal, VS_MRL_EXT, offsetof(mrl_t, mrl_ext), 0, 1, F_BTE|F_HEX|F_FR|F_VS, 0, 0x04, "mrl_ext", "Extended timing info: defines interpretation of bytes 12-17\n\n" "0x00: Default GTF supported if enabled in SPF (no secondary GTF)\n" "0x01: Range Limits only,\n" " in both cases bytes 12-17 should be set to 0x0A 20 20 20 20 20 20\n" "0x02: GTF parameters in bytes 12-17\n" "0x04: VESA CVT support information in bytes 12-17\n\n" "other values are reserved"}, }; #define mrl_offs(_ofs) \ (offsetof(mrl_t, ex_dat) + offsetof(mrl_gtf_t, _ofs)) const edi_field_t mrl_cl::fields_GTF[] = { {&EDID_cl::ByteVal, 0, mrl_offs(resvd), 0, 1, F_BTE|F_HEX|F_RD, 0, 0, "resvd", "Mandatory zero if ext_timg is 0x02 otherwise it should be 0x0A (LF)" }, {&EDID_cl::ByteVal, 0, mrl_offs(sfreq_sec), 0, 1, F_BTE|F_INT, 0, 255, "sfreq_sec", "Start frequency for secondary curve, 2 kHz units (0–510 kHz)" }, {&EDID_cl::ByteVal, 0, mrl_offs(gtf_c), 0, 1, F_BTE|F_INT, 0, 255, "gtf_c", "GTF C value, multiplied by 2: 0...127.5 -> 0...255" }, {&EDID_cl::MRL_02_GTFM, 0, mrl_offs(gtf_m), 0, 2, F_INT, 0, 65535, "gtf_m", "GTF M value (0–65535, LE)" }, {&EDID_cl::ByteVal, 0, mrl_offs(gtf_k), 0, 1, F_BTE|F_INT, 0, 255, "gtf_k", "GTF K value (0–255)" }, {&EDID_cl::ByteVal, 0, mrl_offs(gtf_j), 0, 1, F_BTE|F_INT, 0, 255, "gtf_j", "GTF J value, multiplied by 2: 0...127.5 -> 0...255" } }; #undef mrl_offs #define mrl_offs(_ofs) \ (offsetof(mrl_t, ex_dat) + offsetof(mrl_cvt_t, _ofs)) const edi_field_t mrl_cl::fields_CVT[] = { {&EDID_cl::BitF8Val, 0, mrl_offs(cvt_ver), 4, 4, F_BFD|F_INT, 0, 15, "CVT_majorV", "CVT standard major version number, 4msb, range 1..15" }, {&EDID_cl::BitF8Val, 0, mrl_offs(cvt_ver), 0, 4, F_BFD|F_INT, 0, 15, "CVT_minorV", "CVT standard minor version number, 4lsb, range 0..15" }, {&EDID_cl::MRL_04_PixClk, 0, 12, 2, 6, F_BFD|F_FLT|F_MHZ|F_FR, 0, 63, "maxPixClk_apb", "Additional Precision Bits for use with byte9 'max_PixClk'\n" "The aditional bits allow to increase accuracy of max_PixClk to 0.25MHz\n\n" "Final max_PixClk=(max_PixClk-(maxPixClk_apb*0.25MHz))\n\n" "NOTE:\n" "The max field value is 63*0.25=15.75MHz, but the hadler automatically adjusts max_PixClk value," "so that maxPixClk_apb never exceed 10MHz, (bitfield value: 40*0.25MHz)." }, {&EDID_cl::ByteVal, 0, mrl_offs(maxHApix_8lsb), 0, 1, F_BTE|F_INT, 0, 1023, "max_HApix", "Max horizontal active pixels,\n10bit range: 0..1023, 0x00: no limit" }, {&EDID_cl::BitF8Val, 0, 14, 0, 3, F_BFD|F_RD, 0, 0x3, "rsvd14_02", "reserved (0)" }, {&EDID_cl::BitVal, 0, 14, 3, 1, F_BIT, 0, 1, "aspr_4_3", "aspect ratio 4:3 (1: supported )" }, {&EDID_cl::BitVal, 0, 14, 4, 1, F_BIT, 0, 1, "aspr_16_9", "aspect ratio 16:9 (1: supported )" }, {&EDID_cl::BitVal, 0, 14, 5, 1, F_BIT, 0, 1, "aspr_16_10", "aspect ratio 16:10 (1: supported )" }, {&EDID_cl::BitVal, 0, 14, 6, 1, F_BIT, 0, 1, "aspr_5_4", "aspect ratio 5:4 (1: supported )" }, {&EDID_cl::BitVal, 0, 14, 7, 1, F_BIT, 0, 1, "aspr_15_9", "aspect ratio 15:9 (1: supported )" }, {&EDID_cl::BitF8Val, 0, 15, 0, 3, F_BFD|F_RD, 0, 0x3, "rsvd15_02", "reserved (0)" }, {&EDID_cl::BitVal, 0, 15, 3, 1, F_BIT, 0, 1, "blank_std", "std CVT blanking, 1: supported" }, {&EDID_cl::BitVal, 0, 15, 4, 1, F_BIT, 0, 1, "blank_rb", "CVT Reduced Blanking, 1: supported" }, {&EDID_cl::BitF8Val, 0, 15, 5, 3, F_BFD, 0, 0x7, "pref_ar", "preferred aspect ratio:\n" "0b000: 4:3, \n0b001: 16:9, \n0b010: 16:10 \n0b011: 5:4, \n0b100: 15:9" }, {&EDID_cl::BitF8Val, 0, 16, 0, 4, F_BFD|F_RD, 0, 0x3, "rsvd16_03", "reserved (0)" }, {&EDID_cl::BitVal, 0, 16, 4, 1, F_BIT, 0, 1, "H_shrink", "Horizontal shrink, 1: supported" }, {&EDID_cl::BitVal, 0, 16, 5, 1, F_BIT, 0, 1, "H_stretch", "Horizontal stretch, 1: supported" }, {&EDID_cl::BitVal, 0, 16, 6, 1, F_BIT, 0, 1, "V_shrink", "Vertival shrink, 1: supported" }, {&EDID_cl::BitVal, 0, 16, 7, 1, F_BIT, 0, 1, "V_stretch", "Vertival stretch, 1: supported" }, {&EDID_cl::ByteVal, 0, mrl_offs(pref_vref), 0, 1, F_BTE|F_INT|F_HZ, 0, 255, "pref_vref", "Preferred V-Refresh rate, 1..255Hz, 0: reserved" }, }; #undef mrl_offs #pragma GCC diagnostic ignored "-Wunused-parameter" rcode mrl_cl::init(const u8_t* inst, u32_t orflags, edi_grp_cl* parent) { rcode retU; type_id.t32 = ID_MRL; CopyInstData(inst, sizeof(mrl_t)); retU = gen_data_layout(inst_data); return retU; } #pragma GCC diagnostic warning "-Wunused-parameter" rcode mrl_cl::ForcedGrpRefresh() { rcode retU; retU = gen_data_layout(inst_data); return retU; } rcode mrl_cl::gen_data_layout(const u8_t* inst) { enum { fcount = 6, fcnt_gtf = 6, unk_fcnt = fcnt_gtf +1, //gtf_m -> 2 bytes fcnt_cvt = 20 }; const edi_field_t *fld_ar; edi_field_t *fld_buf; rcode retU; u32_t dtype; u32_t e_fcnt; bool append_md = true; dtype = reinterpret_cast (inst)->mrl_ext; retU = init_fields(&AltDescHdr[0], inst_data, 3, !append_md, Name, Desc, CodN); if (! RCD_IS_OK(retU)) return retU; retU = init_fields(&fields[0], inst_data, fcount, append_md); if (! RCD_IS_OK(retU)) return retU; switch (dtype) { case 0x04: //CVT support mode fld_ar = fields_CVT; e_fcnt = fcnt_cvt; break; case 0x02: //GTF mode fld_ar = fields_GTF; e_fcnt = fcnt_gtf; break; case 0x00: case 0x01: default: //unused descriptor data: e_fcnt = unk_fcnt; fld_buf = (edi_field_t*) realloc(dyn_fldar, unk_fcnt * EDI_FIELD_SZ ); if (NULL == fld_buf) RCD_RETURN_FAULT(retU); dyn_fldar = fld_buf; insert_unk_byte(dyn_fldar, unk_fcnt, offsetof(mrl_t, ex_dat)); fld_ar = dyn_fldar; } retU = init_fields(fld_ar, inst_data , e_fcnt, append_md); if (! RCD_IS_OK(retU)) return retU; return retU; } //WPD: White Point Descriptor rcode EDID_cl::WPD_pad(u32_t op, wxString& sval, u32_t& ival, edi_dynfld_t* p_field) { rcode retU; wpd_t *inst = NULL; inst = reinterpret_cast (getInstancePtr(p_field)); if (op == OP_READ) { ival = inst->pad[0]; ival |= (inst->pad[1] << 8); ival |= (inst->pad[2] << 16); sval.Printf("%06X", ival); RCD_SET_OK(retU); } else { ulong tmpv = 0; RCD_SET_FAULT(retU); if (op == OP_WRSTR) { retU = getStrUint(sval, 16, p_field->field.minv, p_field->field.maxv, tmpv); if (! RCD_IS_OK(retU)) return retU; } else if (op == OP_WRINT) { tmpv = ival; RCD_SET_OK(retU); } inst->pad[0] = (tmpv & 0xFF); tmpv = tmpv >> 8; inst->pad[1] = (tmpv & 0xFF); tmpv = tmpv >> 8; inst->pad[2] = (tmpv & 0xFF); } return retU; } //WPD: White Point Descriptor (type 0xFB) const char wpt_cl::CodN[] = "WPD"; const char wpt_cl::Name[] = "White Point Descriptor"; const char wpt_cl::Desc[] = "2 additional sets of chromacity coordinates with Gamma value"; const edi_field_t wpt_cl::fields[] = { //data: bytes 5-17 //white point desc. 1 {&EDID_cl::ByteVal, 0, offsetof(wpd_t, wp1_idx), 0, 1, F_BTE, 0, 255, "wp1_idx", "White point1 index number (1–255), 0 -> descriptor not used." }, {&EDID_cl::ByteVal, 0, offsetof(wpd_t, wp1x_8msb), 0, 1, F_BTE, 0, 255, "wp1_x", "White point1 x value." }, {&EDID_cl::ByteVal, 0, offsetof(wpd_t, wp1y_8msb), 0, 1, F_BTE, 0, 255, "wp1_y", "White point1 y value." }, {&EDID_cl::Gamma, 0, offsetof(wpd_t, wp1_gamma), 0, 1, 0, 0, 255, "wp1_gamma", "(gamma*100)-100 (1.0 ... 3.54)" }, //white point desc. 2 {&EDID_cl::ByteVal, 0, offsetof(wpd_t, wp2_idx), 0, 1, F_BTE, 0, 255, "wp2_idx", "White point1 index number (1–255), 0 -> descriptor not used." }, {&EDID_cl::ByteVal, 0, offsetof(wpd_t, wp2x_8msb), 0, 1, F_BTE, 0, 255, "wp2_x", "White point2 x value." }, {&EDID_cl::ByteVal, 0, offsetof(wpd_t, wp2y_8msb), 0, 1, F_BTE, 0, 255, "wp2_y", "White point2 y value." }, {&EDID_cl::Gamma, 0, offsetof(wpd_t, wp2_gamma), 0, 1, 0, 0, 255, "wp2_gamma", "(gamma*100)-100 (1.0 ... 3.54)" }, //pad {&EDID_cl::WPD_pad, 0, offsetof(wpd_t, pad), 0, 3, F_STR|F_HEX|F_RD, 0, 0x0A2020, "pad", "unused, should be 0A 20 20. (LF,SP,SP)" } }; #pragma GCC diagnostic ignored "-Wunused-parameter" rcode wpt_cl::init(const u8_t* inst, u32_t orflags, edi_grp_cl* parent) { enum { fcount = 9 }; rcode retU; bool append_md = true; type_id.t32 = ID_WPD; CopyInstData(inst, sizeof(wpd_t)); retU = init_fields(&AltDescHdr[0], inst_data, 3, !append_md, Name, Desc, CodN); if (! RCD_IS_OK(retU)) return retU; retU = init_fields(&fields[0], inst_data, fcount, append_md); return retU; } #pragma GCC diagnostic warning "-Wunused-parameter" //Common class for text descriptors //MND: Monitor Name Descriptor (type 0xFC) //UTX: UnSpecified Text (type 0xFE) //MSN: Monitor Serial Number Descriptor (type 0xFF) const char txtd_cl::CodN_MND[] = "MND"; const char txtd_cl::Name_MND[] = "Monitor Name Descriptor"; const char txtd_cl::CodN_UTX[] = "UTX"; const char txtd_cl::Name_UTX[] = "Unspecified Text"; const char txtd_cl::CodN_MSN[] = "MSN"; const char txtd_cl::Name_MSN[] = "Monitor Serial Number"; const char *txtd_cl::Desc = AltDesc; const char txtd_cl::fname_mnd[] = "Monitor name"; const char txtd_cl::fname_utx[] = "Text"; const char txtd_cl::fname_msn[] = "Monitor SN"; const char txtd_cl::dsc_mnd[] = "Monitor name: text string,\n" "padded with 0x0A,0x20,0x20, ... (LF,SP,SP, ...), max 13 chars."; const char txtd_cl::dsc_utx[] = "Unspecified (general purpose) text string,\n" "padded with 0x0A,0x20,0x20, ... (LF,SP,SP, ...), max 13 chars."; const char txtd_cl::dsc_msn[] = "Monitor serial number: text string,\n" "padded with 0x0A,0x20,0x20, ... (LF,SP,SP, ...), max 13 chars."; const edi_field_t txtd_cl::fields[] = { {&EDID_cl::FldPadStr, 0, offsetof(utx_t, text), 0, 13, F_STR|F_FR|F_RD|F_GD|F_NI|F_DN, 0, 0, NULL, NULL }, {&EDID_cl::ByteStr, 0, offsetof(utx_t, text), 0, 13, F_STR|F_HEX|F_FR|F_RD|F_NI|F_DN, 0, 0, "hex_text", "Hexadecimal representation of the text string.\n" "This fields overlaps the text field.\n" } }; #pragma GCC diagnostic ignored "-Wunused-parameter" rcode txtd_cl::init(const u8_t* inst, u32_t orflags, edi_grp_cl* parent) { const char *CodN; const char *Name; const char *fname; const char *fdsc; rcode retU; u8_t dtype; u32_t fidx; edi_dynfld_t *ftxt; bool append_md = true; dtype = reinterpret_cast (inst)->dsc_type; switch (dtype) { case 0xFC: //MND type_id.t32 = ID_MND; CodN = CodN_MND; Name = Name_MND; fname = fname_mnd; fdsc = dsc_mnd; break; case 0xFE: //UTX type_id.t32 = ID_UTX; CodN = CodN_UTX; Name = Name_UTX; fname = fname_utx; fdsc = dsc_utx; break; case 0xFF: //MSN type_id.t32 = ID_MSN; CodN = CodN_MSN; Name = Name_MSN; fname = fname_msn; fdsc = dsc_msn; break; default: RCD_RETURN_FAULT(retU); } CopyInstData(inst, sizeof(utx_t)); retU = init_fields(&AltDescHdr[0], inst_data, 3, false, Name, fdsc, CodN); if (! RCD_IS_OK(retU)) return retU; //append text and hex_text fields, then set the description fidx = FieldsAr.GetCount(); //3 retU = init_fields(&fields[0], inst_data, 2, append_md); if (! RCD_IS_OK(retU)) return retU; ftxt = FieldsAr.Item(fidx); ftxt->field.name = fname; RCD_RETURN_OK(retU); } #pragma GCC diagnostic warning "-Wunused-parameter" rcode txtd_cl::StrValid() { rcode retU; const u8_t *cbuf; u8_t cval; u32_t itc; cbuf = reinterpret_cast (inst_data)->text; for (itc=0; itc<13; ++itc) { cval = cbuf[itc]; if ((cval < 0x20) || (cval > 0x7E)) { if (cval != 0x0A) RCD_RETURN_FALSE(retU); } } RCD_RETURN_TRUE(retU); } void txtd_cl::getGrpName(EDID_cl& EDID, wxString& gp_name) { rcode retU; u32_t ival; edi_dynfld_t *p_field; if (! EDID.b_GrpNameDynamic) { gp_name = GroupName; return; } retU = StrValid(); if (! RCD_IS_TRUE(retU)) { gp_name = ""; return; } //descriptor text p_field = FieldsAr.Item(3); ( EDID.*p_field->field.handlerfn )(OP_READ, gp_name, ival, p_field ); } //Additional Standard Timings //AST: Additional Standard Timings identifiers (type 0xFA) const char ast_cl::Desc[] = "Up to 6 DMT 2-byte Video Timing Codes.\n" "Unused bytes bytes should be set to 0x01, except the last byte in AST, which should be set to 0x0A (LF)"; const edi_rootgp_dsc_t ast_cl::AST_dsc = { .CodN = "AST", .Name = "Additional Standard Timings", .Desc = ast_cl::Desc, .PadDsc = "Single padding byte, required 0x0A (LF)", .type_id = ID_AST | ID_DMT2, .grp_arsz = 1, .grp_ar = ast_cl::STI_grp }; const edi_subg_dsc_t ast_cl::STI_grp[] = { { .s_ctor = &dmt_std2_cl::group_new, .inst_cnt = 6 } }; #pragma GCC diagnostic ignored "-Wunused-parameter" rcode ast_cl::init(const u8_t* inst, u32_t orflags, edi_grp_cl* parent) { rcode retU; orflags |= (T_P_HOLDER|T_SUB_GRP); retU = base_AltDesc_Init_RootGrp(inst, &AST_dsc, orflags, parent); return retU; } #pragma GCC diagnostic warning "-Wunused-parameter" //DCM: Display Color Management Data (type 0xF9) rcode EDID_cl::DCM_coef16(u32_t op, wxString& sval, u32_t& ival, edi_dynfld_t* p_field) { rcode retU; u8_t *p_w16; i32_t c32; i16_t c16; float f32; RCD_SET_FAULT(retU); p_w16 = getValPtr(p_field); if (op == OP_READ) { c32 = (i32_t) (i16_t) rdWord16_LE(p_w16); f32 = (float) c32; f32 /= 100.0; //display coeff. values, not encoding ival = c32; //not used sval.Printf("%.03f", f32); RCD_SET_OK(retU); } else { RCD_SET_FAULT(retU); if (op == OP_WRSTR) { float tmpv = 0.0; retU = getStrFloat(sval, -32768.0, 32767.0, tmpv); tmpv *= 100.0; c16 = (i16_t) tmpv; } else if (op == OP_WRINT) { RCD_SET_FAULT(retU); } if (! RCD_IS_OK(retU)) return retU; wrWord16_LE(p_w16, c16); } return retU; } const char dcm_cl::CodN[] = "DCM"; const char dcm_cl::Name[] = "Display Color Management"; const char dcm_cl::Desc[] = "Polynomial coefficients:\n" "stored value = coef_val*100, rounded to int16_t, LE"; const char dcm_cl::VerDsc[] = "DCM version = 0x03, other values reserved"; const edi_field_t dcm_cl::fields[] = { //data: bytes 6-17 {&EDID_cl::DCM_coef16, 0, offsetof(dcm_t, red_a3), 0, 2, F_FLT, 0, 0xFFFF, "red_a3", NULL }, {&EDID_cl::DCM_coef16, 0, offsetof(dcm_t, red_a2), 0, 2, F_FLT, 0, 0xFFFF, "red_a2", NULL }, {&EDID_cl::DCM_coef16, 0, offsetof(dcm_t, grn_a3), 0, 2, F_FLT, 0, 0xFFFF, "green_a3", NULL }, {&EDID_cl::DCM_coef16, 0, offsetof(dcm_t, grn_a2), 0, 2, F_FLT, 0, 0xFFFF, "green_a2", NULL }, {&EDID_cl::DCM_coef16, 0, offsetof(dcm_t, blu_a3), 0, 2, F_FLT, 0, 0xFFFF, "blue_a3", NULL }, {&EDID_cl::DCM_coef16, 0, offsetof(dcm_t, blu_a2), 0, 2, F_FLT, 0, 0xFFFF, "blue_a2", NULL } }; #pragma GCC diagnostic ignored "-Wunused-parameter" rcode dcm_cl::init(const u8_t* inst, u32_t orflags, edi_grp_cl* parent) { enum { fcount = 6 }; rcode retU; u32_t fidx; edi_dynfld_t *fver; bool append_md = true; type_id.t32 = ID_DCM; CopyInstData(inst, sizeof(utx_t)); retU = init_fields(&AltDescHdr[0], inst_data, 3, !append_md, Name, Desc, CodN); if (! RCD_IS_OK(retU)) return retU; //append version field, then set its description fidx = FieldsAr.GetCount(); //4 retU = init_fields(&dsc_ver_fld[0], inst_data, 1, append_md); fver = FieldsAr.Item(fidx); fver->field.desc = VerDsc; //append DCM fields retU = init_fields(&fields[0], inst_data, fcount, append_md); return retU; } #pragma GCC diagnostic warning "-Wunused-parameter" //CT3: VESA-CVT 3-byte Video Timing Codes (type 0xF8) const char ct3_cl::Desc[] = "Up to 4 CVT-3 Video Timing Codes.\n" "Unused bytes bytes should be set to 0x00"; const char ct3_cl::VerDsc[] = "CT3 version = 0x01, other values reserved"; const edi_rootgp_dsc_t ct3_cl::CT3_dsc = { .CodN = "CT3", .Name = "CVT-3 Video Timing Codes", .Desc = ct3_cl::Desc, .PadDsc = NULL, .type_id = ID_CT3, .grp_offs = 1, //version field .grp_arsz = 1, .grp_ar = ct3_cl::CVT3_grp }; const edi_subg_dsc_t ct3_cl::CVT3_grp[] = { { .s_ctor = &dmt_cvt3_cl::group_new, .inst_cnt = 4 } }; #pragma GCC diagnostic ignored "-Wunused-parameter" rcode ct3_cl::init(const u8_t* inst, u32_t orflags, edi_grp_cl* parent) { rcode retU; u32_t fidx; edi_dynfld_t *fver; bool append_md = true; orflags |= (T_P_HOLDER|T_SUB_GRP); retU = base_AltDesc_Init_RootGrp(inst, &CT3_dsc, orflags, parent); if (! RCD_IS_OK(retU)) return retU; //append version field, then set its description fidx = FieldsAr.GetCount(); //4 retU = init_fields(&dsc_ver_fld[0], inst_data, 1, append_md); if (! RCD_IS_OK(retU)) return retU; fver = FieldsAr.Item(fidx); fver->field.desc = VerDsc; return retU; } #pragma GCC diagnostic warning "-Wunused-parameter" //ET3: ET3: Estabilished Timings 3 Descriptor (type 0xF7) extern const char* ET3_mode[]; //vid_fmt.cpp const char et3_cl::CodN[] = "ET3"; const char et3_cl::Name[] = "Estabilished Timings 3"; const char et3_cl::Desc[] = "Addtional estabilished timings:\n" "Each bit indicates whether the corresponding timing is supported."; const char et3_cl::VerDsc[] = "ET3 version = 0x0A, other values reserved"; const char et3_cl::flddsc[] = "Field name format: Xres_Yres_Vref<_RB>, (Reduced Blanking)"; const char et3_cl::resvd [] = "reserved (0)"; #pragma GCC diagnostic ignored "-Wunused-parameter" rcode et3_cl::init(const u8_t* inst, u32_t orflags, edi_grp_cl* parent) { enum { //3byte hdr + 1byte ver + 5bytes * 8bits + 4bits in byte 11 + res11_03 //+6 unused bytes f_alloc = 55 }; rcode retU; u32_t fidx; edi_dynfld_t *fver; bool append_md = true; type_id.t32 = ID_ET3; CopyInstData(inst, sizeof(et3_t)); FieldsAr.Alloc(f_alloc); retU = init_fields(&AltDescHdr[0], inst_data, 3, !append_md, Name, Desc, CodN); if (! RCD_IS_OK(retU)) return retU; //append version field, then set its description fidx = FieldsAr.GetCount(); //4 retU = init_fields(&dsc_ver_fld[0], inst_data, 1, append_md); fver = FieldsAr.Item(fidx); fver->field.desc = VerDsc; retU = gen_data_fields(); return retU; } rcode et3_cl::gen_data_fields() { enum { //5bytes * 8bits + 4bits in byte 11 fcount = 44, n_unused = 6 //unused bytes 12..17 }; edi_field_t fld; const char *vidfmt; rcode retU; u32_t itf; u32_t offs; u32_t shift; bool append_md = true; memset(&fld, 0, sizeof(edi_field_t)); fld.handlerfn = &EDID_cl::BitVal; fld.fld_sz = 1; fld.flags = F_BIT; fld.maxv = 1; fld.desc = flddsc; offs = offsetof(et3_t, ver) +1; shift = 0; for (itf=0; itf 7) { offs ++ ; shift &= 0x7; if (offs == 11) { shift = 4; //last 4 bits in byte 11 } } } //append "res11_03" for byte 11 offs = 11; vidfmt = ET3_mode[itf]; fld.handlerfn = &EDID_cl::BitF8Val; fld.offs = offs; fld.shift = 0; fld.fld_sz = 4; fld.flags = F_BFD|F_RD; fld.name = vidfmt; fld.maxv = 0xF; fld.desc = resvd; retU = init_fields(&fld, inst_data, 1, append_md); if (! RCD_IS_OK(retU)) return retU; //append unused bytes @ offset 12..17 dyn_fcnt = n_unused; dyn_fldar = (edi_field_t*) malloc( n_unused * EDI_FIELD_SZ ); if (NULL == dyn_fldar) RCD_RETURN_FAULT(retU); insert_unk_byte(dyn_fldar, n_unused, 12); retU = init_fields(&dyn_fldar[0], &inst_data[12], n_unused, append_md); if (! RCD_IS_OK(retU)) return retU; RCD_RETURN_OK(retU); } //UNK : Unknown Descriptor (type != 0xFA..0xFF) //VOID: Placeholder Descriptor (type 0x10) const char unk_cl::CodN_UNK [] = "UNK"; const char unk_cl::Name_UNK [] = "Unknown Descriptor"; const char unk_cl::CodN_VOID[] = "VOID"; const char unk_cl::Name_VOID[] = "Unused Data"; const char *unk_cl::Desc = AltDesc; #pragma GCC diagnostic ignored "-Wunused-parameter" rcode unk_cl::init(const u8_t* inst, u32_t orflags, edi_grp_cl* parent) { enum { unk_fcnt = 13 }; const char *CodN; const char *Name; rcode retU; u8_t dtype; bool append_md = true; dtype = reinterpret_cast (inst)->dsc_type; if (0x10 != dtype) { CodN = CodN_UNK; Name = Name_UNK; } else { CodN = CodN_VOID; Name = Name_VOID; } type_id.t32 = ID_UNK; CopyInstData(inst, sizeof(unk_t)); retU = init_fields(&AltDescHdr[0], inst_data, 3, false, Name, Desc, CodN); if (! RCD_IS_OK(retU)) return retU; //pre-alloc buffer for array of fields: dyn_fcnt = unk_fcnt; dyn_fldar = (edi_field_t*) malloc( unk_fcnt * EDI_FIELD_SZ ); if (NULL == dyn_fldar) RCD_RETURN_FAULT(retU); //descriptor data interpreted as unknown insert_unk_byte(dyn_fldar, unk_fcnt, offsetof(unk_t, unkb)); retU = init_fields(&dyn_fldar[0], inst_data, unk_fcnt, append_md); return retU; } #pragma GCC diagnostic warning "-Wunused-parameter" rcode edi_adsc_cl::base_AltDesc_Init_RootGrp(const u8_t* inst, const edi_rootgp_dsc_t *pGDsc, u32_t orflags, edi_grp_cl* parent) { rcode retU, retU2; u32_t dlen; u32_t offs; u32_t gr_idx; u32_t gr_inst; gtid_t sub_id; edi_grp_cl *pgrp; const u8_t *pgrp_inst; RCD_SET_OK(retU); RCD_SET_OK(retU2); dat_sz = sizeof(unk_t ); //18 bytes for all descriptors CopyInstData(inst, dat_sz); hdr_sz = sizeof(dshd_t); //Alt. Desc header hdr_sz += pGDsc->grp_offs; //offset for addtional hdr fields dlen = dat_sz; dlen -= hdr_sz; parent_grp = parent; type_id.t32 = pGDsc->type_id; pgrp_inst = inst; offs = hdr_sz; pgrp_inst += offs; sub_id = type_id; sub_id.t32 |= orflags; sub_id.t_md_edit = 0; for (gr_idx=0; gr_idxgrp_arsz; ++gr_idx) { const edi_subg_dsc_t *pSubGDsc; u32_t dsz; pSubGDsc = &pGDsc->grp_ar[gr_idx]; for (gr_inst=0; gr_instinst_cnt; ++gr_inst) { subg_sz = dlen; //free space left for subgroup->init() pgrp = pSubGDsc->s_ctor(); if (NULL == pgrp) RCD_RETURN_FAULT(retU); retU2 = pgrp->init(pgrp_inst, sub_id.t32, this); if (! RCD_IS_OK(retU2)) { if (retU2.detail.rcode > RCD_FVMSG) { wxedid_RCD_SET_FAULT_VMSG(retU2, ERR_GRP_LEN_MSG, pGDsc->CodN); delete pgrp; goto payload; } //else VMSG from sub-group } pgrp->setRelOffs(offs); pgrp->setAbsOffs(offs + abs_offs); subgroups.Append(pgrp); dsz = pgrp->getTotalSize(); offs += dsz; pgrp_inst += dsz; dlen -= dsz; } } payload: //insert padding bytes: if (dlen > 0) { retU = Append_UNK_DAT(pgrp_inst, dlen, type_id.t32, (offs + abs_offs), offs, this); if (! RCD_IS_OK(retU)) return retU; if (RCD_IS_OK(retU2)) { //UNK-DAT group: change description and type ID gtid_t tid; gr_idx = subgroups.GetCount(); gr_idx -= 1; tid.t32 = T_GRP_FIXED; pgrp = subgroups.Item(gr_idx); pgrp->setTypeID(tid); pgrp->CodeName = "PAD"; pgrp->GroupName = "Padding bytes"; pgrp->GroupDesc = pGDsc->PadDsc; } } //Alt. Descriptor header fields retU = init_fields(&AltDescHdr[0], inst_data, 3, false, pGDsc->Name, pGDsc->Desc, pGDsc->CodN); if (! RCD_IS_OK(retU)) return retU; if (! RCD_IS_OK(retU2)) return retU2; return retU; } wxedid-0.0.32/src/EDID_class.h0000644000175000017500000002047714722720160012646 00000000000000/*************************************************************** * Name: EDID_class.h * Purpose: EDID classes and field handlers * Author: Tomasz Pawlak (tomasz.pawlak@wp.eu) * Copyright: Tomasz Pawlak (C) 2014-2024 * License: GPLv3+ **************************************************************/ #ifndef EDID_CLASS_H #define EDID_CLASS_H 1 #include #if __BYTE_ORDER == __BIG_ENDIAN #define _BE_SWAP16(w16) {(w16) = __bswap_16(w16);} #define _BE_SWAP32(w32) {(w32) = __bswap_32(w32);} #define _LE_SWAP16(w16) #else #define _BE_SWAP16(w16) #define _BE_SWAP32(w32) #define _LE_SWAP16(w16) {(w16) = __bswap_16(w16);} #endif #include "EDID_shared.h" //----------------- EDID base block //BED: Base EDID data class edibase_cl : public edi_grp_cl { private: static const edi_field_t fields[]; static const char CodN[]; static const char Name[]; static const char Desc[]; public: rcode init(const u8_t* inst, u32_t orflags, edi_grp_cl* parent); void SpawnInstance(u8_t *pinst); void getGrpName(EDID_cl& EDID, wxString& gp_name); }; //VID: Video Input Descriptor class vindsc_cl : public edi_grp_cl { private: enum { in_analog_fcnt = 7, in_digital_fcnt = 4, max_fcnt = in_analog_fcnt //for pre-allocating array of fields }; //block data layouts static const edi_field_t in_analog[]; static const edi_field_t in_digital[]; static const char CodN[]; static const char Name[]; static const char Desc[]; rcode gen_data_layout(const u8_t* inst); public: rcode init(const u8_t* inst, u32_t orflags, edi_grp_cl* parent); rcode ForcedGrpRefresh(); void getGrpName(EDID_cl& EDID, wxString& gp_name); }; //BDD: basic display descriptior class bddcs_cl : public edi_grp_cl { private: static const edi_field_t fields[]; static const char CodN[]; static const char Name[]; static const char Desc[]; public: rcode init(const u8_t* inst, u32_t orflags, edi_grp_cl* parent); void getGrpName(EDID_cl& EDID, wxString& gp_name); }; //SPF: Supported features class spft_cl : public edi_grp_cl { private: static const edi_field_t fields[]; static const char CodN[]; static const char Name[]; static const char Desc[]; public: rcode init(const u8_t* inst, u32_t orflags, edi_grp_cl* parent); }; //Chromacity coords class chromxy_cl : public edi_grp_cl { private: static const edi_field_t fields[]; static const char CodN[]; static const char Name[]; static const char Desc[]; public: rcode init(const u8_t* inst, u32_t orflags, edi_grp_cl* parent); }; //ETM: Estabilished Timings Map class resmap_cl : public edi_grp_cl { private: static const edi_field_t fields[]; static const char CodN[]; static const char Name[]; static const char Desc[]; public: rcode init(const u8_t* inst, u32_t orflags, edi_grp_cl* parent); }; //STI: Std Timing Information Descriptor: EDID_shared.h //DTD: fields indexes enum { DTD_IDX_PIXCLK = 0, DTD_IDX_HAPIX, DTD_IDX_HBPIX, DTD_IDX_VALIN, DTD_IDX_VBLIN, DTD_IDX_HSOFFS, DTD_IDX_HSWIDTH, DTD_IDX_VSOFFS, DTD_IDX_VSWIDTH, DTD_IDX_HSIZE, DTD_IDX_VSIZE, DTD_IDX_HBORD, DTD_IDX_VBORD, DTD_IDX_IL2W, DTD_IDX_HSTYPE, DTD_IDX_VSTYPE, DTD_IDX_SYNCTYP, DTD_IDX_STEREOMD, DTD_IDX_ILACE }; //DTD : detailed timing descriptor class dtd_cl : public edi_grp_cl { private: static const edi_field_t fields[]; static const char CodN[]; static const char Name[]; static const char Desc[]; public: rcode init(const u8_t* inst, u32_t orflags, edi_grp_cl* parent); edi_grp_cl* Clone(rcode& rcd, u32_t flags) {return base_clone(rcd, new dtd_cl(), flags); }; void getGrpName(EDID_cl& EDID, wxString& gp_name); }; //Common class for text descriptors //MSN: Monitor Serial Number Descriptor (type 0xFF) //UTX: UnSpecified Text (type 0xFE) //MND: Monitor Name Descriptor (type 0xFC) class txtd_cl : public edi_grp_cl { private: static const edi_field_t fields[]; static const char CodN_MSN[]; static const char Name_MSN[]; static const char CodN_UTX[]; static const char Name_UTX[]; static const char CodN_MND[]; static const char Name_MND[]; static const char *Desc; static const char fname_msn[]; static const char fname_utx[]; static const char fname_mnd[]; static const char dsc_msn []; static const char dsc_utx []; static const char dsc_mnd []; rcode StrValid(); public: rcode init(const u8_t* inst, u32_t orflags, edi_grp_cl* parent); edi_grp_cl* Clone(rcode& rcd, u32_t flags) {return base_clone(rcd, new txtd_cl(), flags); }; void getGrpName(EDID_cl& EDID, wxString& gp_name); }; //MRL: Monitor Range Limits Descriptor (type 0xFD) class mrl_cl : public edi_grp_cl { private: static const edi_field_t fields[]; static const edi_field_t fields_GTF[]; static const edi_field_t fields_CVT[]; static const char CodN[]; static const char Name[]; static const char Desc[]; rcode gen_data_layout(const u8_t* inst); public: rcode init(const u8_t* inst, u32_t orflags, edi_grp_cl* parent); edi_grp_cl* Clone(rcode& rcd, u32_t flags) {return base_clone(rcd, new mrl_cl(), flags); }; rcode ForcedGrpRefresh(); }; //WPD: White Point Descriptor (type 0xFB) class wpt_cl : public edi_grp_cl { private: static const edi_field_t fields[]; static const char CodN[]; static const char Name[]; static const char Desc[]; public: rcode init(const u8_t* inst, u32_t orflags, edi_grp_cl* parent); edi_grp_cl* Clone(rcode& rcd, u32_t flags) {return base_clone(rcd, new wpt_cl(), flags); }; }; //AST: Additional Standard Timing Identifiers (type 0xFA) class ast_cl : public edi_adsc_cl { private: static const char Desc[]; static const edi_rootgp_dsc_t AST_dsc; static const edi_subg_dsc_t STI_grp[]; public: rcode init(const u8_t* inst, u32_t orflags, edi_grp_cl* parent); edi_grp_cl* Clone(rcode& rcd, u32_t flags) {return base_clone(rcd, new ast_cl(), flags); }; }; //DCM: Display Color Management Data (type 0xF9) class dcm_cl : public edi_grp_cl { private: static const edi_field_t fields[]; static const char CodN []; static const char Name []; static const char Desc []; static const char VerDsc[]; public: rcode init(const u8_t* inst, u32_t orflags, edi_grp_cl* parent); edi_grp_cl* Clone(rcode& rcd, u32_t flags) {return base_clone(rcd, new dcm_cl(), flags); }; }; //CT3: VESA-CVT 3-byte Video Timing Codes (type 0xF8) class ct3_cl : public edi_adsc_cl { private: static const edi_rootgp_dsc_t CT3_dsc; static const edi_subg_dsc_t CVT3_grp[]; static const char Desc []; static const char VerDsc[]; //version field desc public: rcode init(const u8_t* inst, u32_t orflags, edi_grp_cl* parent); edi_grp_cl* Clone(rcode& rcd, u32_t flags) {return base_clone(rcd, new ct3_cl(), flags); }; }; //ET3: ET3: Estabilished Timings 3 Descriptor (type 0xF7) class et3_cl : public edi_grp_cl { private: static const edi_field_t fields[]; static const char CodN []; static const char Name []; static const char Desc []; static const char VerDsc[]; static const char flddsc[]; static const char resvd []; rcode gen_data_fields(); public: rcode init(const u8_t* inst, u32_t orflags, edi_grp_cl* parent); edi_grp_cl* Clone(rcode& rcd, u32_t flags) {return base_clone(rcd, new et3_cl(), flags); }; }; //UNK: Unknown Descriptor (type != 0xFA-0xFF) class unk_cl : public edi_grp_cl { private: static const char CodN_UNK []; static const char Name_UNK []; static const char CodN_VOID[]; static const char Name_VOID[]; static const char *Desc; public: rcode init(const u8_t* inst, u32_t orflags, edi_grp_cl* parent); edi_grp_cl* Clone(rcode& rcd, u32_t flags) {return base_clone(rcd, new unk_cl(), flags); }; }; #endif /* EDID_CLASS_H */ wxedid-0.0.32/src/EDID_shared.h0000644000175000017500000004750014722720160013003 00000000000000/*************************************************************** * Name: EDID_shared.h * Purpose: EDID shared declarations * Author: Tomasz Pawlak (tomasz.pawlak@wp.eu) * Copyright: Tomasz Pawlak (C) 2021-2024 * License: GPLv3+ **************************************************************/ #ifndef EDID_SHARED_H #define EDID_SHARED_H 1 #include #include #include #include #include "def_types.h" #include "id_flags.h" #include "CEA_ET.h" #include "rcode/rcode.h" #include "guilog.h" #define EDI_FIELD_SZ sizeof(edi_field_t) enum { CEA_DBCHDR_FCNT = 2, CEA_ETHDR_FCNT = 3 }; enum { //handler operating modes OP_READ = 0x01, OP_WRSTR = 0x02, OP_WRINT = 0x04 }; enum { //EDID blocks EDI_BLK_SIZE = 128, EDI_BASE_IDX = 0, EDI_EXT0_IDX, EDI_EXT1_IDX, EDI_EXT2_IDX }; typedef u8_t ediblk_t[EDI_BLK_SIZE]; typedef struct __attribute__ ((packed)) { //edi_s edid_t base; ediblk_t ext0; ediblk_t ext1; ediblk_t ext2; } edi_t; typedef union __attribute__ ((packed)) { //edi_buff_u u8_t buff[4* sizeof(edi_t)]; ediblk_t blk[4]; edi_t edi; } edi_buf_t; class EDID_cl; struct edi_dynfld_s; //field handler fn ptr typedef rcode (EDID_cl::*field_fn)(u32_t, wxString&, u32_t&, edi_dynfld_s*); typedef struct edi_field_s { field_fn handlerfn; u32_t vmap_idx; //value selector index, see vmap.h u32_t offs; //offset in data struct - generic/multi-instance functions u32_t shift; //offset in bits u32_t fld_sz; //len in bytes/bits -> depends on flags u32_t flags; u32_t minv; u32_t maxv; const char *name; const char *desc; //if NULL, use name field string } edi_field_t; typedef struct edi_dynfld_s { //__attribute__ ((packed)) edi_field_t field; u8_t *base ; //data pointer (instance) - generic handlers } edi_dynfld_t; //EDID_cl::getValDesc() modes typedef enum { VD_FULL, //return name + description VD_NAME, //name only VD_DESC, //description only } vd_mode; class edi_grp_cl; typedef edi_grp_cl* (*psub_ctor)(); //Field for EDID Root group descriptor typedef struct edi_subg_dsc_s { psub_ctor s_ctor; u32_t inst_cnt; //instance count, (-1) == until data end } edi_subg_dsc_t; //EDID Root group descriptor: typedef struct edi_rootgp_dsc_s { const char *CodN; const char *Name; const char *Desc; const char *PadDsc; u32_t type_id; u32_t grp_offs; u32_t grp_arsz; const edi_subg_dsc_t *grp_ar; } edi_rootgp_dsc_t; //Field for flat group descriptor typedef struct gpfld_dsc_s { u32_t flags; u32_t dat_sz; i32_t inst_cnt; //instance count, (-1) == until data end u32_t fcount; const edi_field_t *fields; } gpfld_dsc_t; //DBC Flat group descriptor: typedef struct dbc_flatgp_dsc_s { const char *CodN; const char *Name; const char *Desc; u32_t type_id; u32_t flags; u32_t min_len; u32_t max_len; u32_t max_fld; u32_t hdr_fcnt; //CEA_DBCHDR_FCNT | CEA_ETHDR_FCNT u32_t hdr_sz; //sizeof(bhdr_t) | //sizeof(ethdr_t) u32_t fld_arsz; const gpfld_dsc_t *fld_ar; } dbc_flatgp_dsc_t; //Sub group descriptor typedef struct subgrp_dsc_s { psub_ctor s_ctor; const char *CodN; const char *Name; const char *Desc; u32_t type_id; u32_t min_len; u32_t fcount; //0: sub-group init generates fields array i32_t inst_cnt; //instance count, (-1) == until data end const edi_field_t *fields; } dbc_subg_dsc_t; //DBC Root group descriptor typedef struct dbc_root_dsc_s { const char *CodN; const char *Name; const char *Desc; u32_t type_id; u32_t flags; u32_t min_len; u32_t max_len; u32_t hdr_fcnt; //CEA_DBCHDR_FCNT || CEA_ETHDR_FCNT u32_t hdr_sz; //sizeof(bhdr_t) || sizeof(ethdr_t) u32_t ahf_sz; //data size of additional header fields u32_t ahf_cnt; //additional root grp fields (exluding header) const edi_field_t *ah_flds; //ahf_cnt == 0, ah_flds == NULL -> DBC hdr only u32_t grp_arsz; const dbc_subg_dsc_t *grp_ar; } dbc_root_dsc_t; WX_DECLARE_OBJARRAY(edi_dynfld_t*, wxArGrpField); #include "grpar.h" class edi_grp_cl : public wxTreeItemData { protected: u8_t inst_data[32]; //local copy of instance data, including sub-groups u32_t dat_sz; //total instance data size u32_t hdr_sz; //hdr data size in inst_data: SpawnInstance() uses this when number of sub-groups is variable u32_t ahf_sz; //root group: size used for additional header fields u32_t subg_sz; //subgroup init: free space left for subgroup gtid_t type_id; u32_t abs_offs; u32_t rel_offs; u32_t grp_idx; //index within the array GroupAr_cl *grp_ar; //array containing *this* group edi_grp_cl *parent_grp; //NULL if not a sub-group //dynamic field array, depends on data layout u32_t dyn_fcnt; edi_field_t *dyn_fldar; void clear_fields(); edi_grp_cl* base_clone(rcode& rcd, edi_grp_cl* grp, u32_t orflags); rcode base_DBC_Init_FlatGrp(const u8_t* inst, const dbc_flatgp_dsc_t *pgdsc, u32_t orflags, edi_grp_cl* parent); rcode base_DBC_Init_GrpFields(const gpfld_dsc_t *pgfld, edi_field_t **pp_fld, u32_t *pdlen, u32_t *poffs); rcode base_DBC_Init_RootGrp(const u8_t* inst, const dbc_root_dsc_t *pGDsc, u32_t orflags, edi_grp_cl* parent); //IFDB: InfoFrame Data Block: common init fn for all sub-groups rcode IFDB_Init_SubGrp(const u8_t* inst, const dbc_subg_dsc_t* pSGDsc, u32_t orflags, edi_grp_cl* parent); public: wxArGrpField FieldsAr; wxString CodeName; wxString GroupName; wxString GroupDesc; virtual void getGrpName(EDID_cl& EDID, wxString& gp_name) {gp_name = GroupName;}; inline void CopyInstData (const u8_t *pinst, u32_t datsz); virtual void SpawnInstance(u8_t *pinst); //copy local data back to EDID buffer rcode AssembleGroup(); //copy sub-group data to parent' group local data buffer inline gtid_t getTypeID () {return type_id;}; inline u32_t getAbsOffs () {return abs_offs;}; inline u32_t getRelOffs () {return rel_offs;}; virtual u32_t getDataSize () {return (hdr_sz == 0) ? dat_sz : (hdr_sz + ahf_sz);}; inline u32_t getHeaderSize() {return hdr_sz;}; inline u32_t getAHF_Size () {return ahf_sz;}; virtual u32_t getTotalSize () {return getDataSize();}; inline u8_t* getInstPtr () {return inst_data;}; inline u32_t getFreeSubgSZ() {return subg_sz;}; inline GroupAr_cl* getParentAr () {return grp_ar ;}; inline u32_t getParentArIdx() {return grp_idx;}; inline void setTypeID (gtid_t tid) {type_id = tid ;}; inline void setAbsOffs (u32_t offs) {abs_offs = offs;}; inline void setRelOffs (u32_t offs) {rel_offs = offs;}; inline void setIndex (u32_t idx ) {grp_idx = idx;}; inline void setArray (GroupAr_cl *p_ar) {grp_ar = p_ar;}; inline void setArrayIdx(GroupAr_cl *p_ar, u32_t idx) {grp_ar = p_ar; grp_idx = idx;}; virtual void setParentAr(GroupAr_cl *) {return;}; virtual void setDataSize(u32_t dsz) {dat_sz = dsz;}; virtual rcode init (const u8_t* inst, u32_t orflags, edi_grp_cl* parent) =0; virtual rcode ForcedGrpRefresh() {rcode rcd; rcd.value=RCD_OK; return rcd;}; virtual u32_t getSubGrpCount () {return 0;}; inline void setParentGrp(edi_grp_cl *parent) {parent_grp = parent;}; inline edi_grp_cl* getParentGrp() {return parent_grp;}; virtual edi_grp_cl* getSubGroup (u32_t ) {return NULL;}; virtual GroupAr_cl* getSubGrpAr () {return NULL;}; virtual void delete_subg () {return;}; virtual rcode Append_UNK_DAT(const u8_t* inst, u32_t dlen, u32_t orflags, u32_t abs_offs, u32_t rel_offs, edi_grp_cl* parent_grp) {rcode rcd; rcd.value=RCD_OK; return rcd;}; virtual edi_grp_cl* Clone(rcode&, u32_t) {return NULL;}; rcode init_fields(const edi_field_t* field_ar, const u8_t* inst, u32_t fcount, bool b_append=false, const char *pname=NULL, const char *pdesc=NULL, const char *pcodn=NULL, i32_t offs=0); //NOTE: def. subg_id.t32 == T_SUB_GRP: needed by SubGrpAr_cl::Paste() edi_grp_cl() : dat_sz(0), hdr_sz(0), ahf_sz(0), subg_sz(0), abs_offs(0), rel_offs(0), grp_idx(0), grp_ar(NULL), parent_grp(NULL), dyn_fcnt(0), dyn_fldar(NULL) { memset(inst_data, 0, 32); type_id.t32 = ID_INVALID; }; ~edi_grp_cl() { if (dyn_fldar != NULL) { free(dyn_fldar); }; clear_fields(); FieldsAr.Clear(); }; }; //copy EDID buffer data to a local buffer void edi_grp_cl::CopyInstData(const u8_t *pinst, u32_t datsz) { memcpy(inst_data, pinst, datsz); dat_sz = datsz; } class dbc_grp_cl : public edi_grp_cl { protected: SubGrpAr_cl subgroups; public: void setDataSize(u32_t blklen) { bhdr_t *phdr; dat_sz = blklen; blklen -= sizeof(bhdr_t); //excluded from DBC block length phdr = reinterpret_cast (inst_data); phdr->tag.blk_len = blklen; }; u32_t getTotalSize(); rcode Append_UNK_DAT(const u8_t* inst, u32_t dlen, u32_t orflags, u32_t abs_offs, u32_t rel_offs, edi_grp_cl* parent_grp); inline void setParentAr(GroupAr_cl *parent_ar) { subgroups.setParentArray(parent_ar); }; inline SubGrpAr_cl* getSubGrpAr () {return &subgroups;}; inline edi_grp_cl* getSubGroup (u32_t idx) {return subgroups.Item(idx);}; inline u32_t getSubGrpCount() {return subgroups.GetCount();}; void delete_subg (); }; //base EDID: alt. descriptor with sub-groups class edi_adsc_cl : public dbc_grp_cl { protected: rcode base_AltDesc_Init_RootGrp(const u8_t* inst, const edi_rootgp_dsc_t *pGDsc, u32_t orflags, edi_grp_cl* parent); public: u32_t getTotalSize() {return dat_sz;}; void setDataSize (u32_t dsz) {dat_sz = dsz;}; }; #define __EDID_HDL_ARGS u32_t op, wxString& sval, u32_t& ival, edi_dynfld_t* p_field class EDID_cl { private: edi_buf_t EDID_buff; guilog_cl *pGLog; wxString tmps; wxString tmps2; u32_t num_valid_blocks; protected: static const wxString val_unit_name []; static const wxString val_type_name []; static const wxString prop_flag_name[]; inline u16_t rdWord16_LE(u8_t* pword); inline void wrWord16_LE(u8_t* pword, u16_t v16); inline u32_t rdWord24_LE(u8_t* pbt); inline void wrWord24_LE(u8_t* pbt, u32_t v32); //Common handlers: helpers inline u32_t calcGroupOffs (void *inst) {return (reinterpret_cast (inst) - EDID_buff.buff);}; inline u8_t* getInstancePtr(edi_dynfld_t* p_field) {return p_field->base;}; inline u8_t* getValPtr (edi_dynfld_t* p_field); rcode getStrUint (wxString& sval, int base, u32_t minv, u32_t maxv, ulong& val); rcode getStrFloat (wxString& sval, float minv, float maxv, float& val); rcode rdByteStr (wxString& sval, u8_t* pstrb, u32_t slen); rcode rdByteStrLE (wxString& sval, u8_t* pstrb, u32_t slen); rcode wrByteStr (wxString& sval, u8_t* pstrb, u32_t slen); rcode wrByteStrLE (wxString& sval, u8_t* pstrb, u32_t slen); public: wxString gp_name; //global for xxx::getGrpName() bool b_RD_Ignore; bool b_ERR_Ignore; bool b_GrpNameDynamic; GroupAr_cl* BlkGroupsAr[4]; EDID_GrpAr_cl EDI_BaseGrpAr; CEA_GrpAr_cl EDI_Ext0GrpAr; GroupAr_cl EDI_Ext1GrpAr; GroupAr_cl EDI_Ext2GrpAr; inline edi_buf_t* getEDID() {return &EDID_buff;}; inline void SetGuiLogPtr(guilog_cl *p_glog) {pGLog = p_glog;}; inline u32_t getNumValidBlocks() {return num_valid_blocks;}; inline void ForceNumValidBlocks(u32_t nblk) {num_valid_blocks = (nblk%5);}; //max 4 u32_t EDID_Get_num_DTD(); void CEA_Set_DTD_Offset(u8_t *pbuf, GroupAr_cl *p_grp_ar); u32_t genChksum(u32_t block); bool VerifyChksum(u32_t block); void Clear(); rcode ParseEDID_Base(u32_t& n_extblk); rcode ParseAltDtor (u8_t *pinst, edi_grp_cl** pp_grp, i32_t offs = -1); rcode ParseEDID_CEA (); rcode ParseCEA_DBC (u8_t *pinst); rcode ParseDBC_TAG (u8_t *pinst, edi_grp_cl** pp_grp); rcode AssembleEDID (); //field properties void getValUnitName (wxString& sval, const u32_t flags); void getValTypeName (wxString& sval, const u32_t flags); void getValFlagsAsString(wxString& sval, const u32_t flags); void getValDesc (wxString &sval, edi_dynfld_t* p_field, u32_t val, vd_mode mode=VD_FULL); //Common handlers rcode FldPadStr (__EDID_HDL_ARGS); rcode ByteStr (__EDID_HDL_ARGS); rcode Word16 (__EDID_HDL_ARGS); rcode Word24 (__EDID_HDL_ARGS); rcode ByteVal (__EDID_HDL_ARGS); rcode BitF8Val (__EDID_HDL_ARGS); rcode BitF16Val (__EDID_HDL_ARGS); rcode BitVal (__EDID_HDL_ARGS); rcode Gamma (__EDID_HDL_ARGS); //BED handlers rcode MfcId (__EDID_HDL_ARGS); rcode ProdSN (__EDID_HDL_ARGS); rcode ProdWk (__EDID_HDL_ARGS); rcode ProdYr (__EDID_HDL_ARGS); //input type : no dedicated handlers //basic display descriptor (old) : no dedicated handlers //Supported features : no dedicated handlers //Chromacity coords rcode ChrXY_getWriteVal(u32_t op, wxString& sval, u32_t& ival); rcode CHredX (__EDID_HDL_ARGS); rcode CHredY (__EDID_HDL_ARGS); rcode CHgrnX (__EDID_HDL_ARGS); rcode CHgrnY (__EDID_HDL_ARGS); rcode CHbluX (__EDID_HDL_ARGS); rcode CHbluY (__EDID_HDL_ARGS); rcode CHwhtX (__EDID_HDL_ARGS); rcode CHwhtY (__EDID_HDL_ARGS); //Resolution map : no dedicated handlers //STI: Std Timing Descriptor rcode STI_Xres (__EDID_HDL_ARGS); rcode STI_Vref (__EDID_HDL_ARGS); void STI_DBN (EDID_cl& EDID, wxString& dyngp_name, wxArGrpField& FieldsAr); //CVT3: VESA-CVT 3-byte Timing Code rcode CVT3_Yres (__EDID_HDL_ARGS); //Alt Descriptor type handler rcode ALT_DType (__EDID_HDL_ARGS); //DTD: Detailed Timing Descriptor rcode DTD_PixClk(__EDID_HDL_ARGS); rcode DTD_HApix (__EDID_HDL_ARGS); rcode DTD_HBpix (__EDID_HDL_ARGS); rcode DTD_VAlin (__EDID_HDL_ARGS); rcode DTD_VBlin (__EDID_HDL_ARGS); rcode DTD_HOsync(__EDID_HDL_ARGS); rcode DTD_VOsync(__EDID_HDL_ARGS); rcode DTD_VsyncW(__EDID_HDL_ARGS); rcode DTD_HsyncW(__EDID_HDL_ARGS); rcode DTD_Hsize (__EDID_HDL_ARGS); rcode DTD_Vsize (__EDID_HDL_ARGS); //MRL handlers rcode MRL_02_GTFM (__EDID_HDL_ARGS); rcode MRL_MaxPixClk(__EDID_HDL_ARGS); rcode MRL_04_PixClk(__EDID_HDL_ARGS); rcode MRL_04_HAlin (__EDID_HDL_ARGS); //WPD handlers rcode WPD_pad (__EDID_HDL_ARGS); //DCM: Display Color Management Data rcode DCM_coef16 (__EDID_HDL_ARGS); //CEA:DBC Block Header rcode CEA_DBC_Len (__EDID_HDL_ARGS); rcode CEA_DBC_Tag (__EDID_HDL_ARGS); rcode CEA_DBC_ExTag(__EDID_HDL_ARGS); //CEA:VDB u32_t CEA_VDB_SVD_decode(u32_t vic, u32_t &native); //CEA:ADB:SAD rcode SAD_LPCM_MC (__EDID_HDL_ARGS); rcode SAD_BitRate (__EDID_HDL_ARGS); //CEA:VSD rcode VSD_ltncy (__EDID_HDL_ARGS); rcode VSD_MaxTMDS (__EDID_HDL_ARGS); //CEA-ET: VDDD rcode VDDD_IF_MaxF (__EDID_HDL_ARGS); rcode VDDD_HVpix_cnt (__EDID_HDL_ARGS); rcode VDDD_AspRatio (__EDID_HDL_ARGS); rcode VDDD_HVpx_pitch(__EDID_HDL_ARGS); rcode VDDD_AudioDelay(__EDID_HDL_ARGS); //CEA-ET: RMCD, SLDB: normalized distances rcode RMCD_NormV(__EDID_HDL_ARGS); //CEA-ET: VFDB u32_t CEA_VFPD_SVR_decode(u32_t svr, u32_t &ndtd); //CEA-ET: T7VTDB rcode T7VTB_PixClk (__EDID_HDL_ARGS); EDID_cl() : num_valid_blocks(0), b_RD_Ignore(false), b_ERR_Ignore(false), b_GrpNameDynamic(true) { BlkGroupsAr[0] = &EDI_BaseGrpAr; BlkGroupsAr[1] = &EDI_Ext0GrpAr; BlkGroupsAr[2] = &EDI_Ext1GrpAr; BlkGroupsAr[3] = &EDI_Ext2GrpAr; }; ~EDID_cl() { EDI_BaseGrpAr.Clear(); EDI_Ext0GrpAr.Clear(); EDI_Ext1GrpAr.Clear(); EDI_Ext2GrpAr.Clear(); }; }; #undef __EDID_HDL_ARGS // rdWordXX_LE(), wrWordXX_LE: // The functions are used independently of platform endianness, // allowing to operate unaligned pointers. u16_t EDID_cl::rdWord16_LE(u8_t* pbt) { u16_t v16; u16_t u8v; u8v = *pbt; //L-byte v16 = u8v; pbt ++ ; u8v = *pbt; //H-byte u8v <<= 8; v16 |= u8v; return v16; }; void EDID_cl::wrWord16_LE(u8_t* pbt, u16_t v16) { *pbt = v16; pbt ++ ; v16 >>= 8; *pbt = v16; }; u32_t EDID_cl::rdWord24_LE(u8_t* pbt) { u32_t v32; v32 = pbt[2]; v32 <<= 8; v32 |= pbt[1]; v32 <<= 8; v32 |= pbt[0]; return v32; }; void EDID_cl::wrWord24_LE(u8_t* pbt, u32_t v32) { *pbt = v32; pbt ++ ; v32 >>= 8; *pbt = v32; pbt ++ ; v32 >>= 8; *pbt = v32; }; u8_t* EDID_cl::getValPtr(edi_dynfld_t* p_field) { u8_t* ptr; ptr = getInstancePtr(p_field); ptr += p_field->field.offs; return ptr; }; //STI: Std Timing Information Descriptor class dmt_std2_cl : public edi_grp_cl { private: static const edi_field_t fields[]; static const char CodN[]; static const char Name[]; static const char Desc[]; public: rcode init(const u8_t* inst, u32_t orflags, edi_grp_cl* parent); edi_grp_cl* Clone(rcode& rcd, u32_t flags) {return base_clone(rcd, new dmt_std2_cl(), flags); }; void getGrpName(EDID_cl& EDID, wxString& gp_name); static edi_grp_cl* group_new() {return new dmt_std2_cl();}; }; //CVT3 VESA-CVT 3-byte Timing Code class dmt_cvt3_cl : public edi_grp_cl { private: static const edi_field_t fields[]; static const char CodN[]; static const char Name[]; static const char Desc[]; public: rcode init(const u8_t* inst, u32_t orflags, edi_grp_cl* parent); edi_grp_cl* Clone(rcode& rcd, u32_t flags) {return base_clone(rcd, new dmt_cvt3_cl(), flags); }; void getGrpName(EDID_cl& EDID, wxString& gp_name); static edi_grp_cl* group_new() {return new dmt_cvt3_cl();}; }; //UNK-DAT Unknown Data bytes, subgroup. class cea_unkdat_cl : public edi_grp_cl { private: static const char CodN[]; static const char Name[]; static const char Desc[]; public: rcode init(const u8_t* inst, u32_t orflags, edi_grp_cl* parent); edi_grp_cl* Clone(rcode& rcd, u32_t flags) {return base_clone(rcd, new cea_unkdat_cl(), flags); }; }; #endif /* EDID_SHARED_H */ wxedid-0.0.32/src/guilog.h0000644000175000017500000000141714722720160012233 00000000000000#ifndef GUI_LOG_H #define GUI_LOG_H 1 /* guilog.h v0.2 Copyright: Tomasz Pawlak (C) 2014-2024 License: GPLv3+ */ #include #include #include "rcode/rcode.h" enum { msg_buf_sz = 1024 }; class guilog_cl { protected: int status; wxLogWindow *logwin; public: wxString slog; char rcd_msg_buff[msg_buf_sz]; inline bool isReady() {return (status>0);}; void RcodeToString(rcode retU, wxString& str); void PrintRcode(rcode retU); void DoLog(); void DoLog(const wxString& msg); rcode Create(wxWindow *parent, int w=640, int h=400); rcode Destroy(); void Show(); void ShowHide(); guilog_cl(); ~guilog_cl() {}; }; #endif /* GUI_LOG_H */ wxedid-0.0.32/cb_project/0000755000175000017500000000000014723073436012204 500000000000000wxedid-0.0.32/cb_project/wxEDID.cbp0000644000175000017500000001114514722720160013670 00000000000000 wxedid-0.0.32/cb_project/wxsmith/0000755000175000017500000000000014722720160013677 500000000000000wxedid-0.0.32/cb_project/wxsmith/wxEDID_frame.wxs0000644000175000017500000011124514722720160016624 00000000000000 wxEDID 1 640,440 0 BlockTree BlockTree 150,-1 TreeDataCtl Default Block Tree 0 0 0 0 Left 0 .TopDockable(false).BottomDockable(false).RightDockable(false) 0 0 0 5 8 Name Type Value Unit Flags 0 GridDataCtl Default Block Data 0 0 0 0 Center 0 .TopDockable(false).BottomDockable(false).LeftDockable(false) 0 0 0 -1,100 InfoCtl Default Info 0 0 0 0 1 Center 0 .TopDockable(false).BottomDockable(false).RightDockable(false) 0 0 0 638,506 wxVERTICAL 2 3 4 4 wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL 5 wxLEFT|wxRIGHT|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL 8 wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL 5 wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL 5 0 1 65535 160,-1 wxRIGHT|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL 3 wxRIGHT|wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL 8 0 70,-1 wxRIGHT|wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL 3 wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL 5 wxTOP|wxBOTTOM|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL 6 wxTOP|wxRIGHT|wxALIGN_RIGHT|wxALIGN_TOP 6 wxEXPAND 4 5 7 1 5 wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL 5 0 1 4095 wxEXPAND 5 wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL 5 0 70,-1 -1,-1 wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL 5 wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL 5 wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL 5 0 255 wxEXPAND 5 wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL 5 wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL 5 wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL 5 wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL 5 0 1 4095 wxEXPAND 5 wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL 5 0 50,22 70,-1 wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL 5 wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL 5 wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL 5 0 1023 wxEXPAND 5 wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL 5 0 50,22 70,-1 wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL 5 wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL 5 wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL 5 0 1 1023 wxEXPAND 5 wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL 5 0 70,-1 wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL 5 wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL 5 wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL 5 0 60,22 80,-1 wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL 5 wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL 5 0 70,-1 wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL 5 wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL 5 wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL 5 0 80,-1 wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL 5 wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL 5 wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL 5 wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL 5 wxLEFT|wxRIGHT|wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL 4 5 6 1 5 wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL 5 0 1 4095 wxEXPAND 5 wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL 5 0 70,-1 wxLEFT|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL 5 wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL 5 wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL 5 0 255 wxEXPAND 5 wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL 5 wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL 5 wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL 5 wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL 5 0 1 4095 wxEXPAND 5 wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL 5 0 70,-1 wxLEFT|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL 5 wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL 5 wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL 5 0 63 wxEXPAND 5 wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL 5 0 70,-1 wxLEFT|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL 5 wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL 5 wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL 5 0 1 63 wxEXPAND 5 wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL 5 0 70,-1 wxLEFT|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL 5 wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL 5 wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL 5 0 70,-1 wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL 5 wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL 5 0 70,-1 wxLEFT|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL 5 wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL 5 wxTOP|wxALIGN_TOP|wxALIGN_CENTER_HORIZONTAL 4 wxLEFT|wxEXPAND 16 wxTOP|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL 8 wxLEFT|wxALIGN_CENTER_VERTICAL 13 wxLEFT|wxRIGHT|wxEXPAND 4 wxTOP|wxBOTTOM|wxLEFT|wxEXPAND 3 wxTOP|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL 4 AUInbook Nbook 0 0 0 0 0 Center 0 0 0 0 0 0 ctrl-O ctrl-S 0 Saves EDID as human readable text file 0 0 Alt-F4 Quit the application Reinterpret EDID data 0 Apply changes, update checksums 0 1 1 1 1 1 1 1 ctrl-L F1 Show info about this application F3 2 -300,400 wxSB_NORMAL,wxSB_NORMAL wxedid-0.0.32/configure0000755000175000017500000047453314722720160011731 00000000000000#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.71 for wxEDID 0.0.32. # # Report bugs to . # # # Copyright (C) 1992-1996, 1998-2017, 2020-2021 Free Software Foundation, # Inc. # # # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. # # Copyright (C) 2014-2024 Tomasz Pawlak, e-mail: tomasz.pawlak@wp.eu ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh as_nop=: if test ${ZSH_VERSION+y} && (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 $as_nop case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi # Reset variables that may have inherited troublesome values from # the environment. # IFS needs to be set, to space, tab, and newline, in precisely that order. # (If _AS_PATH_WALK were called with IFS unset, it would have the # side effect of setting IFS to empty, thus disabling word splitting.) # Quoting is to prevent editors from complaining about space-tab. as_nl=' ' export as_nl IFS=" "" $as_nl" PS1='$ ' PS2='> ' PS4='+ ' # Ensure predictable behavior from utilities with locale-dependent output. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # We cannot yet rely on "unset" to work, but we need these variables # to be unset--not just set to an empty or harmless value--now, to # avoid bugs in old shells (e.g. pre-3.0 UWIN ksh). This construct # also avoids known problems related to "unset" and subshell syntax # in other old shells (e.g. bash 2.01 and pdksh 5.2.14). for as_var in BASH_ENV ENV MAIL MAILPATH CDPATH do eval test \${$as_var+y} \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done # Ensure that fds 0, 1, and 2 are open. if (exec 3>&0) 2>/dev/null; then :; else exec 0&1) 2>/dev/null; then :; else exec 1>/dev/null; fi if (exec 3>&2) ; then :; else exec 2>/dev/null; fi # The user is always right. if ${PATH_SEPARATOR+false} :; 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 # 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 case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac 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 printf "%s\n" "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # 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'. printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2 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="as_nop=: if test \${ZSH_VERSION+y} && (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 \$as_nop case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi " as_required="as_fn_return () { (exit \$1); } as_fn_success () { as_fn_return 0; } as_fn_failure () { as_fn_return 1; } as_fn_ret_success () { return 0; } as_fn_ret_failure () { return 1; } exitcode=0 as_fn_success || { exitcode=1; echo as_fn_success failed.; } as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } if ( set x; as_fn_ret_success y && test x = \"\$1\" ) then : else \$as_nop exitcode=1; echo positional parameters were not saved. fi test x\$exitcode = x0 || exit 1 blah=\$(echo \$(echo blah)) test x\"\$blah\" = xblah || 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'\" && test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1" if (eval "$as_required") 2>/dev/null then : as_have_required=yes else $as_nop as_have_required=no fi if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null then : else $as_nop as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac as_found=: case $as_dir in #( /*) for as_base in sh bash ksh sh5; do # Try only shells that exist, to save several forks. as_shell=$as_dir$as_base if { test -f "$as_shell" || test -f "$as_shell.exe"; } && as_run=a "$as_shell" -c "$as_bourne_compatible""$as_required" 2>/dev/null then : CONFIG_SHELL=$as_shell as_have_required=yes if as_run=a "$as_shell" -c "$as_bourne_compatible""$as_suggested" 2>/dev/null then : break 2 fi fi done;; esac as_found=false done IFS=$as_save_IFS if $as_found then : else $as_nop if { test -f "$SHELL" || test -f "$SHELL.exe"; } && as_run=a "$SHELL" -c "$as_bourne_compatible""$as_required" 2>/dev/null then : CONFIG_SHELL=$SHELL as_have_required=yes fi fi if test "x$CONFIG_SHELL" != x then : 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'. printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi if test x$as_have_required = xno then : printf "%s\n" "$0: This script requires a shell more modern than all" printf "%s\n" "$0: the shells that I found on your system." if test ${ZSH_VERSION+y} ; then printf "%s\n" "$0: In particular, zsh $ZSH_VERSION has bugs and should" printf "%s\n" "$0: be upgraded to zsh 4.3.4 or later." else printf "%s\n" "$0: Please tell bug-autoconf@gnu.org and $0: tomasz.pawlak@wp.eu about your system, including any $0: error possibly output before this message. Then install $0: a modern shell, or manually run the script under such a $0: shell if you do have one." fi exit 1 fi fi fi SHELL=${CONFIG_SHELL-/bin/sh} export SHELL # Unset more variables known to interfere with behavior of common tools. CLICOLOR_FORCE= GREP_OPTIONS= unset CLICOLOR_FORCE GREP_OPTIONS ## --------------------- ## ## M4sh Shell Functions. ## ## --------------------- ## # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # 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_nop # --------- # Do nothing but, unlike ":", preserve the value of $?. as_fn_nop () { return $? } as_nop=as_fn_nop # 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=`printf "%s\n" "$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 || printf "%s\n" 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 # 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 # 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_nop 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_nop as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith # as_fn_nop # --------- # Do nothing but, unlike ":", preserve the value of $?. as_fn_nop () { return $? } as_nop=as_fn_nop # 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 printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi printf "%s\n" "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error 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 || printf "%s\n" 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 as_lineno_1=$LINENO as_lineno_1a=$LINENO as_lineno_2=$LINENO as_lineno_2a=$LINENO eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { printf "%s\n" "$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). . "./$as_me.lineno" # Exit status is that of the last command. exit } # Determine whether it's possible to make 'echo' print without a newline. # These variables are no longer used directly by Autoconf, but are AC_SUBSTed # for compatibility with existing Makefiles. 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 # For backward compatibility with old third-party macros, we provide # the shell variables $as_echo and $as_echo_n. New code should use # AS_ECHO(["message"]) and AS_ECHO_N(["message"]), respectively. as_echo='printf %s\n' as_echo_n='printf %s' 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 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_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'" test -n "$DJDIR" || exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` # # Initializations. # ac_default_prefix=/usr/local ac_clean_files= ac_config_libobj_dir=. LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= # Identity of this package. PACKAGE_NAME='wxEDID' PACKAGE_TARNAME='wxedid' PACKAGE_VERSION='0.0.32' PACKAGE_STRING='wxEDID 0.0.32' PACKAGE_BUGREPORT='tomasz.pawlak@wp.eu' PACKAGE_URL='' ac_unique_file="src/wxEDID.cpp" ac_subst_vars='am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS LIBOBJS WX_VERSION_MICRO WX_VERSION_MINOR WX_VERSION_MAJOR WX_RESCOMP WX_VERSION WX_LIBS_STATIC WX_LIBS WX_CXXFLAGS_ONLY WX_CFLAGS_ONLY WX_CXXFLAGS WX_CFLAGS WX_CPPFLAGS WX_CONFIG_PATH ac_lang_cflags ac_have_bash OBJEXT EXEEXT ac_ct_CXX CPPFLAGS LDFLAGS CXXFLAGS CXX AM_BACKSLASH AM_DEFAULT_VERBOSITY AM_DEFAULT_V AM_V CSCOPE ETAGS CTAGS am__untar am__tar AMTAR am__leading_dot SET_MAKE AWK mkdir_p MKDIR_P INSTALL_STRIP_PROGRAM STRIP install_sh MAKEINFO AUTOHEADER AUTOMAKE AUTOCONF ACLOCAL VERSION PACKAGE CYGPATH_W am__isrc INSTALL_DATA INSTALL_SCRIPT INSTALL_PROGRAM target_alias host_alias build_alias LIBS ECHO_T ECHO_N ECHO_C DEFS mandir localedir libdir psdir pdfdir dvidir htmldir infodir docdir oldincludedir includedir runstatedir localstatedir sharedstatedir sysconfdir datadir datarootdir libexecdir sbindir bindir program_transform_name prefix exec_prefix PACKAGE_URL PACKAGE_BUGREPORT PACKAGE_STRING PACKAGE_VERSION PACKAGE_TARNAME PACKAGE_NAME PATH_SEPARATOR SHELL' ac_subst_files='' ac_user_opts=' enable_option_checking enable_silent_rules enable_rcdgen_mode enable_build_mode ' ac_precious_vars='build_alias host_alias target_alias CXX CXXFLAGS LDFLAGS LIBS CPPFLAGS CCC' # Initialize some variables set by options. ac_init_help= ac_init_version=false ac_unrecognized_opts= ac_unrecognized_sep= # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' runstatedir='${localstatedir}/run' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *=) ac_optarg= ;; *) ac_optarg=yes ;; esac case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: \`$ac_useropt'" ac_useropt_orig=$ac_useropt ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: \`$ac_useropt'" ac_useropt_orig=$ac_useropt ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -runstatedir | --runstatedir | --runstatedi | --runstated \ | --runstate | --runstat | --runsta | --runst | --runs \ | --run | --ru | --r) ac_prev=runstatedir ;; -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \ | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \ | --run=* | --ru=* | --r=*) runstatedir=$ac_optarg ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: \`$ac_useropt'" ac_useropt_orig=$ac_useropt ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=\$ac_optarg ;; -without-* | --without-*) ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: \`$ac_useropt'" ac_useropt_orig=$ac_useropt ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=no ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) as_fn_error $? "unrecognized option: \`$ac_option' Try \`$0 --help' for more information" ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. case $ac_envvar in #( '' | [0-9]* | *[!_$as_cr_alnum]* ) as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. printf "%s\n" "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && printf "%s\n" "$as_me: WARNING: invalid host type: $ac_option" >&2 : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` as_fn_error $? "missing argument to $ac_option" fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; *) printf "%s\n" "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi # Check all directory arguments for consistency. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir runstatedir do eval ac_val=\$$ac_var # Remove trailing slashes. case $ac_val in */ ) ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` eval $ac_var=\$ac_val;; esac # Be sure to have absolute directory names. case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || as_fn_error $? "working directory cannot be determined" test "X$ac_ls_di" = "X$ac_pwd_ls_di" || as_fn_error $? "pwd does not report name of working directory" # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then the parent directory. ac_confdir=`$as_dirname -- "$as_myself" || $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` srcdir=$ac_confdir if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures wxEDID 0.0.32 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking ...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/wxedid] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF Program names: --program-prefix=PREFIX prepend PREFIX to installed program names --program-suffix=SUFFIX append SUFFIX to installed program names --program-transform-name=PROGRAM run sed PROGRAM on installed program names _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in short | recursive ) echo "Configuration of wxEDID 0.0.32:";; esac cat <<\_ACEOF 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] --enable-silent-rules less verbose build output (undo: "make V=1") --disable-silent-rules verbose build output (undo: "make V=0") --enable-rcdgen-mode=[full/basic/dummy/skip/clean] full: generate struct of rcode messages and releated accessor functions code; basic: struct of rcode messages only (+ tiny accessors); dummy: mainly for libs: dummy fuctions only, to keep the interface for linking; skip: do not run the rcd_autogen; clean: remove all rcd_autogen output files. [default=full] --enable-build-mode=[release/debug/none] Use predefined flags for release or debug build, none=no predefined flags. [default=release] Some influential environment variables: CXX C++ compiler command CXXFLAGS C++ compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory LIBS libraries to pass to the linker, e.g. -l CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. Report bugs to . _ACEOF ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`printf "%s\n" "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`printf "%s\n" "$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 cd "$ac_dir" || { ac_status=$?; continue; } # Check for configure.gnu first; this name is used for a wrapper for # Metaconfig's "Configure" on case-insensitive file systems. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive elif test -f "$ac_srcdir/configure"; then echo && $SHELL "$ac_srcdir/configure" --help=recursive else printf "%s\n" "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF wxEDID configure 0.0.32 generated by GNU Autoconf 2.71 Copyright (C) 2021 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. Copyright (C) 2014-2024 Tomasz Pawlak, e-mail: tomasz.pawlak@wp.eu _ACEOF exit fi ## ------------------------ ## ## Autoconf initialization. ## ## ------------------------ ## # ac_fn_cxx_try_compile LINENO # ---------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_cxx_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext conftest.beam if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext then : ac_retval=0 else $as_nop printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_cxx_try_compile ac_configure_args_raw= for ac_arg do case $ac_arg in *\'*) ac_arg=`printf "%s\n" "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac as_fn_append ac_configure_args_raw " '$ac_arg'" done case $ac_configure_args_raw in *$as_nl*) ac_safe_unquote= ;; *) ac_unsafe_z='|&;<>()$`\\"*?[ '' ' # This string ends in space, tab. ac_unsafe_a="$ac_unsafe_z#~" ac_safe_unquote="s/ '\\([^$ac_unsafe_a][^$ac_unsafe_z]*\\)'/ \\1/g" ac_configure_args_raw=` printf "%s\n" "$ac_configure_args_raw" | sed "$ac_safe_unquote"`;; esac cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by wxEDID $as_me 0.0.32, which was generated by GNU Autoconf 2.71. Invocation command line was $ $0$ac_configure_args_raw _ACEOF exec 5>>config.log { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` /usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac printf "%s\n" "PATH: $as_dir" done IFS=$as_save_IFS } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) ac_arg=`printf "%s\n" "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; 2) as_fn_append ac_configure_args1 " '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi as_fn_append ac_configure_args " '$ac_arg'" ;; esac done done { ac_configure_args0=; unset ac_configure_args0;} { ac_configure_args1=; unset ac_configure_args1;} # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Sanitize IFS. IFS=" "" $as_nl" # Save into config.log some information that might help in debugging. { echo printf "%s\n" "## ---------------- ## ## Cache variables. ## ## ---------------- ##" echo # The following way of writing the cache mishandles newlines in values, ( for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 printf "%s\n" "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( *${as_nl}ac_space=\ *) sed -n \ "s/'\''/'\''\\\\'\'''\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" ;; #( *) sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) echo printf "%s\n" "## ----------------- ## ## Output variables. ## ## ----------------- ##" echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`printf "%s\n" "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac printf "%s\n" "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then printf "%s\n" "## ------------------- ## ## File substitutions. ## ## ------------------- ##" echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`printf "%s\n" "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac printf "%s\n" "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then printf "%s\n" "## ----------- ## ## confdefs.h. ## ## ----------- ##" echo cat confdefs.h echo fi test "$ac_signal" != 0 && printf "%s\n" "$as_me: caught signal $ac_signal" printf "%s\n" "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h printf "%s\n" "/* confdefs.h */" > confdefs.h # Predefined preprocessor variables. printf "%s\n" "#define PACKAGE_NAME \"$PACKAGE_NAME\"" >>confdefs.h printf "%s\n" "#define PACKAGE_TARNAME \"$PACKAGE_TARNAME\"" >>confdefs.h printf "%s\n" "#define PACKAGE_VERSION \"$PACKAGE_VERSION\"" >>confdefs.h printf "%s\n" "#define PACKAGE_STRING \"$PACKAGE_STRING\"" >>confdefs.h printf "%s\n" "#define PACKAGE_BUGREPORT \"$PACKAGE_BUGREPORT\"" >>confdefs.h printf "%s\n" "#define PACKAGE_URL \"$PACKAGE_URL\"" >>confdefs.h # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. if test -n "$CONFIG_SITE"; then ac_site_files="$CONFIG_SITE" elif test "x$prefix" != xNONE; then ac_site_files="$prefix/share/config.site $prefix/etc/config.site" else ac_site_files="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" fi for ac_site_file in $ac_site_files do case $ac_site_file in #( */*) : ;; #( *) : ac_site_file=./$ac_site_file ;; esac if test -f "$ac_site_file" && test -r "$ac_site_file"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 printf "%s\n" "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" \ || { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file See \`config.log' for more details" "$LINENO" 5; } fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special files # actually), so we avoid doing that. DJGPP emulates it as a regular file. if test /dev/null != "$cache_file" && test -f "$cache_file"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 printf "%s\n" "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 printf "%s\n" "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Test code for whether the C++ compiler supports C++98 (global declarations) ac_cxx_conftest_cxx98_globals=' // Does the compiler advertise C++98 conformance? #if !defined __cplusplus || __cplusplus < 199711L # error "Compiler does not advertise C++98 conformance" #endif // These inclusions are to reject old compilers that // lack the unsuffixed header files. #include #include // and are *not* freestanding headers in C++98. extern void assert (int); namespace std { extern int strcmp (const char *, const char *); } // Namespaces, exceptions, and templates were all added after "C++ 2.0". using std::exception; using std::strcmp; namespace { void test_exception_syntax() { try { throw "test"; } catch (const char *s) { // Extra parentheses suppress a warning when building autoconf itself, // due to lint rules shared with more typical C programs. assert (!(strcmp) (s, "test")); } } template struct test_template { T const val; explicit test_template(T t) : val(t) {} template T add(U u) { return static_cast(u) + val; } }; } // anonymous namespace ' # Test code for whether the C++ compiler supports C++98 (body of main) ac_cxx_conftest_cxx98_main=' assert (argc); assert (! argv[0]); { test_exception_syntax (); test_template tt (2.0); assert (tt.add (4) == 6.0); assert (true && !false); } ' # Test code for whether the C++ compiler supports C++11 (global declarations) ac_cxx_conftest_cxx11_globals=' // Does the compiler advertise C++ 2011 conformance? #if !defined __cplusplus || __cplusplus < 201103L # error "Compiler does not advertise C++11 conformance" #endif namespace cxx11test { constexpr int get_val() { return 20; } struct testinit { int i; double d; }; class delegate { public: delegate(int n) : n(n) {} delegate(): delegate(2354) {} virtual int getval() { return this->n; }; protected: int n; }; class overridden : public delegate { public: overridden(int n): delegate(n) {} virtual int getval() override final { return this->n * 2; } }; class nocopy { public: nocopy(int i): i(i) {} nocopy() = default; nocopy(const nocopy&) = delete; nocopy & operator=(const nocopy&) = delete; private: int i; }; // for testing lambda expressions template Ret eval(Fn f, Ret v) { return f(v); } // for testing variadic templates and trailing return types template auto sum(V first) -> V { return first; } template auto sum(V first, Args... rest) -> V { return first + sum(rest...); } } ' # Test code for whether the C++ compiler supports C++11 (body of main) ac_cxx_conftest_cxx11_main=' { // Test auto and decltype auto a1 = 6538; auto a2 = 48573953.4; auto a3 = "String literal"; int total = 0; for (auto i = a3; *i; ++i) { total += *i; } decltype(a2) a4 = 34895.034; } { // Test constexpr short sa[cxx11test::get_val()] = { 0 }; } { // Test initializer lists cxx11test::testinit il = { 4323, 435234.23544 }; } { // Test range-based for int array[] = {9, 7, 13, 15, 4, 18, 12, 10, 5, 3, 14, 19, 17, 8, 6, 20, 16, 2, 11, 1}; for (auto &x : array) { x += 23; } } { // Test lambda expressions using cxx11test::eval; assert (eval ([](int x) { return x*2; }, 21) == 42); double d = 2.0; assert (eval ([&](double x) { return d += x; }, 3.0) == 5.0); assert (d == 5.0); assert (eval ([=](double x) mutable { return d += x; }, 4.0) == 9.0); assert (d == 5.0); } { // Test use of variadic templates using cxx11test::sum; auto a = sum(1); auto b = sum(1, 2); auto c = sum(1.0, 2.0, 3.0); } { // Test constructor delegation cxx11test::delegate d1; cxx11test::delegate d2(); cxx11test::delegate d3(45); } { // Test override and final cxx11test::overridden o1(55464); } { // Test nullptr char *c = nullptr; } { // Test template brackets test_template<::test_template> v(test_template(12)); } { // Unicode literals char const *utf8 = u8"UTF-8 string \u2500"; char16_t const *utf16 = u"UTF-8 string \u2500"; char32_t const *utf32 = U"UTF-32 string \u2500"; } ' # Test code for whether the C compiler supports C++11 (complete). ac_cxx_conftest_cxx11_program="${ac_cxx_conftest_cxx98_globals} ${ac_cxx_conftest_cxx11_globals} int main (int argc, char **argv) { int ok = 0; ${ac_cxx_conftest_cxx98_main} ${ac_cxx_conftest_cxx11_main} return ok; } " # Test code for whether the C compiler supports C++98 (complete). ac_cxx_conftest_cxx98_program="${ac_cxx_conftest_cxx98_globals} int main (int argc, char **argv) { int ok = 0; ${ac_cxx_conftest_cxx98_main} return ok; } " # Auxiliary files required by this configure script. ac_aux_files="missing install-sh" # Locations in which to look for auxiliary files. ac_aux_dir_candidates="${srcdir}/build-aux" # Search for a directory containing all of the required auxiliary files, # $ac_aux_files, from the $PATH-style list $ac_aux_dir_candidates. # If we don't find one directory that contains all the files we need, # we report the set of missing files from the *first* directory in # $ac_aux_dir_candidates and give up. ac_missing_aux_files="" ac_first_candidate=: printf "%s\n" "$as_me:${as_lineno-$LINENO}: looking for aux files: $ac_aux_files" >&5 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in $ac_aux_dir_candidates do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac as_found=: printf "%s\n" "$as_me:${as_lineno-$LINENO}: trying $as_dir" >&5 ac_aux_dir_found=yes ac_install_sh= for ac_aux in $ac_aux_files do # As a special case, if "install-sh" is required, that requirement # can be satisfied by any of "install-sh", "install.sh", or "shtool", # and $ac_install_sh is set appropriately for whichever one is found. if test x"$ac_aux" = x"install-sh" then if test -f "${as_dir}install-sh"; then printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}install-sh found" >&5 ac_install_sh="${as_dir}install-sh -c" elif test -f "${as_dir}install.sh"; then printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}install.sh found" >&5 ac_install_sh="${as_dir}install.sh -c" elif test -f "${as_dir}shtool"; then printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}shtool found" >&5 ac_install_sh="${as_dir}shtool install -c" else ac_aux_dir_found=no if $ac_first_candidate; then ac_missing_aux_files="${ac_missing_aux_files} install-sh" else break fi fi else if test -f "${as_dir}${ac_aux}"; then printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}${ac_aux} found" >&5 else ac_aux_dir_found=no if $ac_first_candidate; then ac_missing_aux_files="${ac_missing_aux_files} ${ac_aux}" else break fi fi fi done if test "$ac_aux_dir_found" = yes; then ac_aux_dir="$as_dir" break fi ac_first_candidate=false as_found=false done IFS=$as_save_IFS if $as_found then : else $as_nop as_fn_error $? "cannot find required auxiliary files:$ac_missing_aux_files" "$LINENO" 5 fi # These three variables are undocumented and unsupported, # and are intended to be withdrawn in a future Autoconf release. # They can cause serious problems if a builder's source tree is in a directory # whose full name contains unusual characters. if test -f "${ac_aux_dir}config.guess"; then ac_config_guess="$SHELL ${ac_aux_dir}config.guess" fi if test -f "${ac_aux_dir}config.sub"; then ac_config_sub="$SHELL ${ac_aux_dir}config.sub" fi if test -f "$ac_aux_dir/configure"; then ac_configure="$SHELL ${ac_aux_dir}configure" fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 printf "%s\n" "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 printf "%s\n" "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then # differences in whitespace do not lead to failure. ac_old_val_w=`echo x $ac_old_val` ac_new_val_w=`echo x $ac_new_val` if test "$ac_old_val_w" != "$ac_new_val_w"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 printf "%s\n" "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 printf "%s\n" "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 printf "%s\n" "$as_me: former value: \`$ac_old_val'" >&2;} { printf "%s\n" "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 printf "%s\n" "$as_me: current value: \`$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`printf "%s\n" "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) as_fn_append ac_configure_args " '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 printf "%s\n" "$as_me: error: changes in the environment can compromise the build" >&2;} as_fn_error $? "run \`${MAKE-make} distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 fi ## -------------------- ## ## Main body of script. ## ## -------------------- ## ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_config_headers="$ac_config_headers src/config.h" am__api_version='1.16' # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. # Reject install programs that cannot install multiple files. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 printf %s "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then if test ${ac_cv_path_install+y} then : printf %s "(cached) " >&6 else $as_nop as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac # Account for fact that we put trailing slashes in our PATH walk. case $as_dir in #(( ./ | /[cC]/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if as_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. : elif test $ac_prog = install && grep pwplus "$as_dir$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else rm -rf conftest.one conftest.two conftest.dir echo one > conftest.one echo two > conftest.two mkdir conftest.dir if "$as_dir$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir/" && test -s conftest.one && test -s conftest.two && test -s conftest.dir/conftest.one && test -s conftest.dir/conftest.two then ac_cv_path_install="$as_dir$ac_prog$ac_exec_ext -c" break 3 fi fi fi done done ;; esac done IFS=$as_save_IFS rm -rf conftest.one conftest.two conftest.dir fi if test ${ac_cv_path_install+y}; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. Don't cache a # value for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. INSTALL=$ac_install_sh fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 printf "%s\n" "$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 printf %s "checking whether build environment is sane... " >&6; } # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[\\\"\#\$\&\'\`$am_lf]*) as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; esac case $srcdir in *[\\\"\#\$\&\'\`$am_lf\ \ ]*) as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;; esac # 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 ( 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 # Ok. : else as_fn_error $? "newly created file is older than distributed files! Check your system clock" "$LINENO" 5 fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "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. test "$program_suffix" != NONE && program_transform_name="s&\$&$program_suffix&;$program_transform_name" # Double any \ or $. # By default was `s,x,x', remove it if useless. ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' program_transform_name=`printf "%s\n" "$program_transform_name" | sed "$ac_script"` # Expand $ac_aux_dir to an absolute path. am_aux_dir=`cd "$ac_aux_dir" && pwd` if test x"${MISSING+set}" != xset; then MISSING="\${SHELL} '$am_aux_dir/missing'" fi # Use eval to expand $SHELL if eval "$MISSING --is-lightweight"; then am_missing_run="$MISSING " else am_missing_run= { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5 printf "%s\n" "$as_me: WARNING: 'missing' script is too old or missing" >&2;} fi if test x"${install_sh+set}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi # Installed binaries are usually stripped using 'strip' when the user # run "make install-strip". However 'strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the 'STRIP' environment variable to overrule this program. if test "$cross_compiling" != no; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_STRIP+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 printf "%s\n" "$STRIP" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_STRIP+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 printf "%s\n" "$ac_ct_STRIP" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a race-free mkdir -p" >&5 printf %s "checking for a race-free mkdir -p... " >&6; } if test -z "$MKDIR_P"; then if test ${ac_cv_path_mkdir+y} then : printf %s "(cached) " >&6 else $as_nop as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_prog in mkdir gmkdir; do for ac_exec_ext in '' $ac_executable_extensions; do 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 ('*'coreutils) '* | \ 'BusyBox '* | \ 'mkdir (fileutils) '4.1*) ac_cv_path_mkdir=$as_dir$ac_prog$ac_exec_ext break 3;; esac done done done IFS=$as_save_IFS fi test -d ./--version && rmdir ./--version if test ${ac_cv_path_mkdir+y}; then MKDIR_P="$ac_cv_path_mkdir -p" else # As a last resort, use the slow shell script. Don't cache a # value for MKDIR_P within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. MKDIR_P="$ac_install_sh -d" fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 printf "%s\n" "$MKDIR_P" >&6; } for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_AWK+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_AWK="$ac_prog" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 printf "%s\n" "$AWK" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -n "$AWK" && break done { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 printf %s "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`printf "%s\n" "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if eval test \${ac_cv_prog_make_${ac_make}_set+y} then : printf %s "(cached) " >&6 else $as_nop cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering ...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; *) eval ac_cv_prog_make_${ac_make}_set=no;; esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } SET_MAKE= else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null # Check whether --enable-silent-rules was given. if test ${enable_silent_rules+y} 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} { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 printf %s "checking whether $am_make supports nested variables... " >&6; } if test ${am_cv_make_support_nested_variables+y} then : printf %s "(cached) " >&6 else $as_nop if printf "%s\n" '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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 printf "%s\n" "$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." am__isrc=' -I$(srcdir)' # test to see if srcdir already configured if test -f $srcdir/config.status; then as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi # Define the identity of the package. PACKAGE='wxedid' VERSION='0.0.32' printf "%s\n" "#define PACKAGE \"$PACKAGE\"" >>confdefs.h printf "%s\n" "#define VERSION \"$VERSION\"" >>confdefs.h # Some tools Automake needs. ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} # For better backward compatibility. To be removed once Automake 1.9.x # dies out for good. For more background, see: # # mkdir_p='$(MKDIR_P)' # We need awk for the "check" target (and possibly the TAP driver). The # system "awk" is bad on some platforms. # 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 -' # Variables for tags utilities; see am/tags.am if test -z "$CTAGS"; then CTAGS=ctags fi if test -z "$ETAGS"; then ETAGS=etags fi if test -z "$CSCOPE"; then CSCOPE=cscope fi # 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: 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: . 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 : ${CXXFLAGS=""} : ${CPPFLAGS=""} ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu if test -z "$CXX"; then if test -n "$CCC"; then CXX=$CCC else if test -n "$ac_tool_prefix"; then for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC clang++ do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CXX+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$CXX"; then ac_cv_prog_CXX="$CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CXX=$ac_cv_prog_CXX if test -n "$CXX"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 printf "%s\n" "$CXX" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -n "$CXX" && break done fi if test -z "$CXX"; then ac_ct_CXX=$CXX for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC clang++ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_CXX+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$ac_ct_CXX"; then ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CXX="$ac_prog" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CXX=$ac_cv_prog_ac_ct_CXX if test -n "$ac_ct_CXX"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5 printf "%s\n" "$ac_ct_CXX" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -n "$ac_ct_CXX" && break done if test "x$ac_ct_CXX" = x; then CXX="g++" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CXX=$ac_ct_CXX fi fi fi fi # Provide some information about the compiler. printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the C++ compiler works" >&5 printf %s "checking whether the C++ compiler works... " >&6; } ac_link_default=`printf "%s\n" "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # The possible output files: ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; * ) ac_rmfiles="$ac_rmfiles $ac_file";; esac done rm -f $ac_rmfiles if { { ac_try="$ac_link_default" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link_default") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then : # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, # so that the user can short-circuit this test for compilers unknown to # Autoconf. for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) if test ${ac_cv_exeext+y} && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi # We set ac_cv_exeext here because the later test for it is not # safe: cross compilers may not add the suffix if given an `-o' # argument, so we may need to know it at that point already. # Even if this section looks crufty: it has the advantage of # actually working. break;; * ) break;; esac done test "$ac_cv_exeext" = no && ac_cv_exeext= else $as_nop ac_file='' fi if test -z "$ac_file" then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "C++ compiler cannot create executables See \`config.log' for more details" "$LINENO" 5; } else $as_nop { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C++ compiler default output file name" >&5 printf %s "checking for C++ compiler default output file name... " >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 printf "%s\n" "$ac_file" >&6; } ac_exeext=$ac_cv_exeext rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 printf %s "checking for suffix of executables... " >&6; } if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then : # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else $as_nop { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of executables: cannot compile and link See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest conftest$ac_cv_exeext { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 printf "%s\n" "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main (void) { FILE *f = fopen ("conftest.out", "w"); return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF ac_clean_files="$ac_clean_files conftest.out" # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 printf %s "checking whether we are cross compiling... " >&6; } if test "$cross_compiling" != yes; then { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if { ac_try='./conftest$ac_cv_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "cannot run C++ compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details" "$LINENO" 5; } fi fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 printf "%s\n" "$cross_compiling" >&6; } rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out ac_clean_files=$ac_clean_files_save { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 printf %s "checking for suffix of object files... " >&6; } if test ${ac_cv_objext+y} then : printf %s "(cached) " >&6 else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then : for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else $as_nop printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of object files: cannot compile See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 printf "%s\n" "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports GNU C++" >&5 printf %s "checking whether the compiler supports GNU C++... " >&6; } if test ${ac_cv_cxx_compiler_gnu+y} then : printf %s "(cached) " >&6 else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO" then : ac_compiler_gnu=yes else $as_nop ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_cv_cxx_compiler_gnu=$ac_compiler_gnu fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5 printf "%s\n" "$ac_cv_cxx_compiler_gnu" >&6; } ac_compiler_gnu=$ac_cv_cxx_compiler_gnu if test $ac_compiler_gnu = yes; then GXX=yes else GXX= fi ac_test_CXXFLAGS=${CXXFLAGS+y} ac_save_CXXFLAGS=$CXXFLAGS { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5 printf %s "checking whether $CXX accepts -g... " >&6; } if test ${ac_cv_prog_cxx_g+y} then : printf %s "(cached) " >&6 else $as_nop ac_save_cxx_werror_flag=$ac_cxx_werror_flag ac_cxx_werror_flag=yes ac_cv_prog_cxx_g=no CXXFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO" then : ac_cv_prog_cxx_g=yes else $as_nop CXXFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO" then : else $as_nop ac_cxx_werror_flag=$ac_save_cxx_werror_flag CXXFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO" then : ac_cv_prog_cxx_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_cxx_werror_flag=$ac_save_cxx_werror_flag fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5 printf "%s\n" "$ac_cv_prog_cxx_g" >&6; } if test $ac_test_CXXFLAGS; then CXXFLAGS=$ac_save_CXXFLAGS elif test $ac_cv_prog_cxx_g = yes; then if test "$GXX" = yes; then CXXFLAGS="-g -O2" else CXXFLAGS="-g" fi else if test "$GXX" = yes; then CXXFLAGS="-O2" else CXXFLAGS= fi fi ac_prog_cxx_stdcxx=no if test x$ac_prog_cxx_stdcxx = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CXX option to enable C++11 features" >&5 printf %s "checking for $CXX option to enable C++11 features... " >&6; } if test ${ac_cv_prog_cxx_cxx11+y} then : printf %s "(cached) " >&6 else $as_nop ac_cv_prog_cxx_cxx11=no ac_save_CXX=$CXX cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_cxx_conftest_cxx11_program _ACEOF for ac_arg in '' -std=gnu++11 -std=gnu++0x -std=c++11 -std=c++0x -qlanglvl=extended0x -AA do CXX="$ac_save_CXX $ac_arg" if ac_fn_cxx_try_compile "$LINENO" then : ac_cv_prog_cxx_cxx11=$ac_arg fi rm -f core conftest.err conftest.$ac_objext conftest.beam test "x$ac_cv_prog_cxx_cxx11" != "xno" && break done rm -f conftest.$ac_ext CXX=$ac_save_CXX fi if test "x$ac_cv_prog_cxx_cxx11" = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 printf "%s\n" "unsupported" >&6; } else $as_nop if test "x$ac_cv_prog_cxx_cxx11" = x then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 printf "%s\n" "none needed" >&6; } else $as_nop { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_cxx11" >&5 printf "%s\n" "$ac_cv_prog_cxx_cxx11" >&6; } CXX="$CXX $ac_cv_prog_cxx_cxx11" fi ac_cv_prog_cxx_stdcxx=$ac_cv_prog_cxx_cxx11 ac_prog_cxx_stdcxx=cxx11 fi fi if test x$ac_prog_cxx_stdcxx = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CXX option to enable C++98 features" >&5 printf %s "checking for $CXX option to enable C++98 features... " >&6; } if test ${ac_cv_prog_cxx_cxx98+y} then : printf %s "(cached) " >&6 else $as_nop ac_cv_prog_cxx_cxx98=no ac_save_CXX=$CXX cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_cxx_conftest_cxx98_program _ACEOF for ac_arg in '' -std=gnu++98 -std=c++98 -qlanglvl=extended -AA do CXX="$ac_save_CXX $ac_arg" if ac_fn_cxx_try_compile "$LINENO" then : ac_cv_prog_cxx_cxx98=$ac_arg fi rm -f core conftest.err conftest.$ac_objext conftest.beam test "x$ac_cv_prog_cxx_cxx98" != "xno" && break done rm -f conftest.$ac_ext CXX=$ac_save_CXX fi if test "x$ac_cv_prog_cxx_cxx98" = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 printf "%s\n" "unsupported" >&6; } else $as_nop if test "x$ac_cv_prog_cxx_cxx98" = x then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 printf "%s\n" "none needed" >&6; } else $as_nop { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_cxx98" >&5 printf "%s\n" "$ac_cv_prog_cxx_cxx98" >&6; } CXX="$CXX $ac_cv_prog_cxx_cxx98" fi ac_cv_prog_cxx_stdcxx=$ac_cv_prog_cxx_cxx98 ac_prog_cxx_stdcxx=cxx98 fi fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu ac_lang_cflags=$CFLAGS # Check whether --enable-rcdgen-mode was given. if test ${enable_rcdgen_mode+y} then : enableval=$enable_rcdgen_mode; rcd_mode=$enableval else $as_nop rcd_mode=full fi # Extract the first word of "bash", so it can be a program name with args. set dummy bash; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_have_bash+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$ac_have_bash"; then ac_cv_prog_ac_have_bash="$ac_have_bash" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_have_bash="yes" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_prog_ac_have_bash" && ac_cv_prog_ac_have_bash="no" fi fi ac_have_bash=$ac_cv_prog_ac_have_bash if test -n "$ac_have_bash"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_have_bash" >&5 printf "%s\n" "$ac_have_bash" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "$ac_have_bash" = "yes" then : else $as_nop as_fn_error 1 "(E) Bash is required to run rcd_autogen" "$LINENO" 5 fi { ac_have_bash=; unset ac_have_bash;} { printf "%s\n" "$as_me:${as_lineno-$LINENO}: (i) rcd_autogen mode: $rcd_mode" >&5 printf "%s\n" "$as_me: (i) rcd_autogen mode: $rcd_mode" >&6;} { printf "%s\n" "$as_me:${as_lineno-$LINENO}: (i) rcd_autogen CPP ='$CPP' " >&5 printf "%s\n" "$as_me: (i) rcd_autogen CPP ='$CPP' " >&6;} { printf "%s\n" "$as_me:${as_lineno-$LINENO}: (i) rcd_autogen CXXCPP='$CXXCPP' " >&5 printf "%s\n" "$as_me: (i) rcd_autogen CXXCPP='$CXXCPP' " >&6;} ac_rcd_autogen_path="src/rcode/rcd_autogen" export ac_rcd_autogen_path as_fn_append RCDGEN_PP_ARGS " $CPPFLAGS" as_fn_append CPPFLAGS " -D_USE_RCD_AUTOGEN" if test "pp$CC" != "pp" then : export RCDGEN_CPP=$CPP fi if test "pp$CXXCPP" != "pp" then : export RCDGEN_CXXCPP=$CXXCPP fi if test "$rcd_mode" = "basic" then : export RCDGEN_BASIC=1 fi if test "$rcd_mode" = "dummy" then : export RCDGEN_DUMMY=1 fi if test "$rcd_mode" = "skip" then : { ac_rcd_autogen_path=; unset ac_rcd_autogen_path;}; fi if test "$rcd_mode" = "clean" then : export RCDGEN_CLEAN=1 fi # Check whether --enable-build-mode was given. if test ${enable_build_mode+y} then : enableval=$enable_build_mode; enable_flags=$enableval else $as_nop enable_flags=release fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: (i) Use predefined build flags? ... $enable_flags" >&5 printf "%s\n" "$as_me: (i) Use predefined build flags? ... $enable_flags" >&6;} if test "x$enable_flags" = "xdebug" then : ac_bsw_CXXFLAGS=" -fno-exceptions -g " ac_bsw_CFLAGS=" " ac_bsw_CPPFLAGS=" -Wall -DDBG_LEVEL_1 -DDBG_LEVEL_2 " ac_bsw_LDFLAGS=" " { printf "%s\n" "$as_me:${as_lineno-$LINENO}: (i) Debug CXXFLAGS = ($ac_bsw_CXXFLAGS)" >&5 printf "%s\n" "$as_me: (i) Debug CXXFLAGS = ($ac_bsw_CXXFLAGS)" >&6;} { printf "%s\n" "$as_me:${as_lineno-$LINENO}: (i) Debug CFLAGS = ($ac_bsw_CFLAGS) " >&5 printf "%s\n" "$as_me: (i) Debug CFLAGS = ($ac_bsw_CFLAGS) " >&6;} { printf "%s\n" "$as_me:${as_lineno-$LINENO}: (i) Debug CPPFLAGS = ($ac_bsw_CPPFLAGS)" >&5 printf "%s\n" "$as_me: (i) Debug CPPFLAGS = ($ac_bsw_CPPFLAGS)" >&6;} { printf "%s\n" "$as_me:${as_lineno-$LINENO}: (i) Debug LDFLAGS = ($ac_bsw_LDFLAGS) " >&5 printf "%s\n" "$as_me: (i) Debug LDFLAGS = ($ac_bsw_LDFLAGS) " >&6;} fi if test "x$enable_flags" = "xrelease" then : ac_bsw_CXXFLAGS=" -fno-exceptions -O1 -flto " ac_bsw_CFLAGS=" " ac_bsw_CPPFLAGS=" -Wall -Wfatal-errors " ac_bsw_LDFLAGS=" -Wl,-s " { printf "%s\n" "$as_me:${as_lineno-$LINENO}: (i) Release CXXLAGS = ($ac_bsw_CXXFLAGS)" >&5 printf "%s\n" "$as_me: (i) Release CXXLAGS = ($ac_bsw_CXXFLAGS)" >&6;} { printf "%s\n" "$as_me:${as_lineno-$LINENO}: (i) Release CFLAGS = ($ac_bsw_CFLAGS) " >&5 printf "%s\n" "$as_me: (i) Release CFLAGS = ($ac_bsw_CFLAGS) " >&6;} { printf "%s\n" "$as_me:${as_lineno-$LINENO}: (i) Release CPPFLAGS = ($ac_bsw_CPPFLAGS)" >&5 printf "%s\n" "$as_me: (i) Release CPPFLAGS = ($ac_bsw_CPPFLAGS)" >&6;} { printf "%s\n" "$as_me:${as_lineno-$LINENO}: (i) Release LDFLAGS = ($ac_bsw_LDFLAGS) " >&5 printf "%s\n" "$as_me: (i) Release LDFLAGS = ($ac_bsw_LDFLAGS) " >&6;} fi if test "x$enable_flags" = "xnone" then : ac_bsw_CXXFLAGS=" " ac_bsw_CFLAGS=" " ac_bsw_CPPFLAGS=" " ac_bsw_LDFLAGS=" " fi as_fn_append CXXFLAGS "$ac_bsw_CXXFLAGS" as_fn_append CFLAGS "$ac_bsw_CFLAGS" as_fn_append CPPFLAGS "$ac_bsw_CPPFLAGS" as_fn_append LDFLAGS "$ac_bsw_LDFLAGS" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: (i) Final CXXFLAGS = ($CXXFLAGS)" >&5 printf "%s\n" "$as_me: (i) Final CXXFLAGS = ($CXXFLAGS)" >&6;} { printf "%s\n" "$as_me:${as_lineno-$LINENO}: (i) Final CFLAGS = ($CFLAGS) " >&5 printf "%s\n" "$as_me: (i) Final CFLAGS = ($CFLAGS) " >&6;} { printf "%s\n" "$as_me:${as_lineno-$LINENO}: (i) Final CPPFLAGS = ($CPPFLAGS)" >&5 printf "%s\n" "$as_me: (i) Final CPPFLAGS = ($CPPFLAGS)" >&6;} { printf "%s\n" "$as_me:${as_lineno-$LINENO}: (i) Final LDFLAGS = ($LDFLAGS) " >&5 printf "%s\n" "$as_me: (i) Final LDFLAGS = ($LDFLAGS) " >&6;} { printf "%s\n" "$as_me:${as_lineno-$LINENO}: (i) Final CFLAGS = ($ac_lang_cflags) " >&5 printf "%s\n" "$as_me: (i) Final CFLAGS = ($ac_lang_cflags) " >&6;} { printf "%s\n" "$as_me:${as_lineno-$LINENO}: (i) Final LDFLAGS = ($LDFLAGS) " >&5 printf "%s\n" "$as_me: (i) Final LDFLAGS = ($LDFLAGS) " >&6;} if test x${WX_CONFIG_NAME+set} != xset ; then WX_CONFIG_NAME=wx-config fi if test "x$wx_config_name" != x ; then WX_CONFIG_NAME="$wx_config_name" fi if test x$wx_config_exec_prefix != x ; then wx_config_args="$wx_config_args --exec-prefix=$wx_config_exec_prefix" WX_LOOKUP_PATH="$wx_config_exec_prefix/bin" fi if test x$wx_config_prefix != x ; then wx_config_args="$wx_config_args --prefix=$wx_config_prefix" WX_LOOKUP_PATH="$WX_LOOKUP_PATH:$wx_config_prefix/bin" fi if test "$cross_compiling" = "yes"; then wx_config_args="$wx_config_args --host=$host_alias" fi if test -x "$WX_CONFIG_NAME" ; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for wx-config" >&5 printf %s "checking for wx-config... " >&6; } WX_CONFIG_PATH="$WX_CONFIG_NAME" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $WX_CONFIG_PATH" >&5 printf "%s\n" "$WX_CONFIG_PATH" >&6; } else # Extract the first word of "$WX_CONFIG_NAME", so it can be a program name with args. set dummy $WX_CONFIG_NAME; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_WX_CONFIG_PATH+y} then : printf %s "(cached) " >&6 else $as_nop case $WX_CONFIG_PATH in [\\/]* | ?:[\\/]*) ac_cv_path_WX_CONFIG_PATH="$WX_CONFIG_PATH" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_dummy=""$WX_LOOKUP_PATH:$PATH"" for as_dir in $as_dummy do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac 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_WX_CONFIG_PATH="$as_dir$ac_word$ac_exec_ext" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_WX_CONFIG_PATH" && ac_cv_path_WX_CONFIG_PATH="no" ;; esac fi WX_CONFIG_PATH=$ac_cv_path_WX_CONFIG_PATH if test -n "$WX_CONFIG_PATH"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $WX_CONFIG_PATH" >&5 printf "%s\n" "$WX_CONFIG_PATH" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test "$WX_CONFIG_PATH" != "no" ; then WX_VERSION="" min_wx_version=3.1.0 if test -z "" ; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for wxWidgets version >= $min_wx_version" >&5 printf %s "checking for wxWidgets version >= $min_wx_version... " >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for wxWidgets version >= $min_wx_version ()" >&5 printf %s "checking for wxWidgets version >= $min_wx_version ()... " >&6; } fi WX_CONFIG_WITH_ARGS="$WX_CONFIG_PATH $wx_config_args " WX_VERSION=`$WX_CONFIG_WITH_ARGS --version 2>/dev/null` wx_config_major_version=`echo $WX_VERSION | \ sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\1/'` wx_config_minor_version=`echo $WX_VERSION | \ sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\2/'` wx_config_micro_version=`echo $WX_VERSION | \ sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\3/'` wx_requested_major_version=`echo $min_wx_version | \ sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\1/'` wx_requested_minor_version=`echo $min_wx_version | \ sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\2/'` wx_requested_micro_version=`echo $min_wx_version | \ sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\3/'` wx_ver_ok="" if test "x$WX_VERSION" != x ; then if test $wx_config_major_version -gt $wx_requested_major_version; then wx_ver_ok=yes else if test $wx_config_major_version -eq $wx_requested_major_version; then if test $wx_config_minor_version -gt $wx_requested_minor_version; then wx_ver_ok=yes else if test $wx_config_minor_version -eq $wx_requested_minor_version; then if test $wx_config_micro_version -ge $wx_requested_micro_version; then wx_ver_ok=yes fi fi fi fi fi fi if test -n "$wx_ver_ok"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes (version $WX_VERSION)" >&5 printf "%s\n" "yes (version $WX_VERSION)" >&6; } WX_LIBS=`$WX_CONFIG_WITH_ARGS --libs std,aui` { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for wxWidgets static library" >&5 printf %s "checking for wxWidgets static library... " >&6; } WX_LIBS_STATIC=`$WX_CONFIG_WITH_ARGS --static --libs std,aui 2>/dev/null` if test "x$WX_LIBS_STATIC" = "x"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } fi wx_has_cppflags="" if test $wx_config_major_version -gt 2; then wx_has_cppflags=yes else if test $wx_config_major_version -eq 2; then if test $wx_config_minor_version -gt 2; then wx_has_cppflags=yes else if test $wx_config_minor_version -eq 2; then if test $wx_config_micro_version -ge 6; then wx_has_cppflags=yes fi fi fi fi fi wx_has_rescomp="" if test $wx_config_major_version -gt 2; then wx_has_rescomp=yes else if test $wx_config_major_version -eq 2; then if test $wx_config_minor_version -ge 7; then wx_has_rescomp=yes fi fi fi if test "x$wx_has_rescomp" = x ; then WX_RESCOMP= else WX_RESCOMP=`$WX_CONFIG_WITH_ARGS --rescomp` fi if test "x$wx_has_cppflags" = x ; then WX_CFLAGS=`$WX_CONFIG_WITH_ARGS --cflags std,aui` WX_CPPFLAGS=$WX_CFLAGS WX_CXXFLAGS=$WX_CFLAGS WX_CFLAGS_ONLY=$WX_CFLAGS WX_CXXFLAGS_ONLY=$WX_CFLAGS else WX_CPPFLAGS=`$WX_CONFIG_WITH_ARGS --cppflags std,aui` WX_CXXFLAGS=`$WX_CONFIG_WITH_ARGS --cxxflags std,aui` WX_CFLAGS=`$WX_CONFIG_WITH_ARGS --cflags std,aui` WX_CFLAGS_ONLY=`echo $WX_CFLAGS | sed "s@^$WX_CPPFLAGS *@@"` WX_CXXFLAGS_ONLY=`echo $WX_CXXFLAGS | sed "s@^$WX_CFLAGS *@@"` fi wxWin=1 else if test "x$WX_VERSION" = x; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no (version $WX_VERSION is not new enough)" >&5 printf "%s\n" "no (version $WX_VERSION is not new enough)" >&6; } fi WX_CFLAGS="" WX_CPPFLAGS="" WX_CXXFLAGS="" WX_LIBS="" WX_LIBS_STATIC="" WX_RESCOMP="" if test ! -z ""; then wx_error_message=" The configuration you asked for $PACKAGE_NAME requires a wxWidgets build with the following settings: but such build is not available. To see the wxWidgets builds available on this system, please use 'wx-config --list' command. To use the default build, returned by 'wx-config --selected-config', use the options with their 'auto' default values." fi wx_error_message=" The requested wxWidgets build couldn't be found. $wx_error_message If you still get this error, then check that 'wx-config' is in path, the directory where wxWidgets libraries are installed (returned by 'wx-config --libs' command) is in LD_LIBRARY_PATH or equivalent variable and wxWidgets version is 3.1.0 or above." wxWin=0 fi else WX_CFLAGS="" WX_CPPFLAGS="" WX_CXXFLAGS="" WX_LIBS="" WX_LIBS_STATIC="" WX_RESCOMP="" wxWin=0 fi WX_VERSION_MAJOR="$wx_config_major_version" WX_VERSION_MINOR="$wx_config_minor_version" WX_VERSION_MICRO="$wx_config_micro_version" if test "$wxWin" != 1; then if test x${WX_CONFIG_NAME+set} != xset ; then WX_CONFIG_NAME=wx-config fi if test "x$wx_config_name" != x ; then WX_CONFIG_NAME="$wx_config_name" fi if test x$wx_config_exec_prefix != x ; then wx_config_args="$wx_config_args --exec-prefix=$wx_config_exec_prefix" WX_LOOKUP_PATH="$wx_config_exec_prefix/bin" fi if test x$wx_config_prefix != x ; then wx_config_args="$wx_config_args --prefix=$wx_config_prefix" WX_LOOKUP_PATH="$WX_LOOKUP_PATH:$wx_config_prefix/bin" fi if test "$cross_compiling" = "yes"; then wx_config_args="$wx_config_args --host=$host_alias" fi if test -x "$WX_CONFIG_NAME" ; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for wx-config" >&5 printf %s "checking for wx-config... " >&6; } WX_CONFIG_PATH="$WX_CONFIG_NAME" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $WX_CONFIG_PATH" >&5 printf "%s\n" "$WX_CONFIG_PATH" >&6; } else # Extract the first word of "$WX_CONFIG_NAME", so it can be a program name with args. set dummy $WX_CONFIG_NAME; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_WX_CONFIG_PATH+y} then : printf %s "(cached) " >&6 else $as_nop case $WX_CONFIG_PATH in [\\/]* | ?:[\\/]*) ac_cv_path_WX_CONFIG_PATH="$WX_CONFIG_PATH" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_dummy=""$WX_LOOKUP_PATH:$PATH"" for as_dir in $as_dummy do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac 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_WX_CONFIG_PATH="$as_dir$ac_word$ac_exec_ext" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_WX_CONFIG_PATH" && ac_cv_path_WX_CONFIG_PATH="no" ;; esac fi WX_CONFIG_PATH=$ac_cv_path_WX_CONFIG_PATH if test -n "$WX_CONFIG_PATH"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $WX_CONFIG_PATH" >&5 printf "%s\n" "$WX_CONFIG_PATH" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test "$WX_CONFIG_PATH" != "no" ; then WX_VERSION="" min_wx_version=3.0.0 if test -z "" ; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for wxWidgets version >= $min_wx_version" >&5 printf %s "checking for wxWidgets version >= $min_wx_version... " >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for wxWidgets version >= $min_wx_version ()" >&5 printf %s "checking for wxWidgets version >= $min_wx_version ()... " >&6; } fi WX_CONFIG_WITH_ARGS="$WX_CONFIG_PATH $wx_config_args " WX_VERSION=`$WX_CONFIG_WITH_ARGS --version 2>/dev/null` wx_config_major_version=`echo $WX_VERSION | \ sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\1/'` wx_config_minor_version=`echo $WX_VERSION | \ sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\2/'` wx_config_micro_version=`echo $WX_VERSION | \ sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\3/'` wx_requested_major_version=`echo $min_wx_version | \ sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\1/'` wx_requested_minor_version=`echo $min_wx_version | \ sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\2/'` wx_requested_micro_version=`echo $min_wx_version | \ sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\3/'` wx_ver_ok="" if test "x$WX_VERSION" != x ; then if test $wx_config_major_version -gt $wx_requested_major_version; then wx_ver_ok=yes else if test $wx_config_major_version -eq $wx_requested_major_version; then if test $wx_config_minor_version -gt $wx_requested_minor_version; then wx_ver_ok=yes else if test $wx_config_minor_version -eq $wx_requested_minor_version; then if test $wx_config_micro_version -ge $wx_requested_micro_version; then wx_ver_ok=yes fi fi fi fi fi fi if test -n "$wx_ver_ok"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes (version $WX_VERSION)" >&5 printf "%s\n" "yes (version $WX_VERSION)" >&6; } WX_LIBS=`$WX_CONFIG_WITH_ARGS --libs std,aui` { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for wxWidgets static library" >&5 printf %s "checking for wxWidgets static library... " >&6; } WX_LIBS_STATIC=`$WX_CONFIG_WITH_ARGS --static --libs std,aui 2>/dev/null` if test "x$WX_LIBS_STATIC" = "x"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } fi wx_has_cppflags="" if test $wx_config_major_version -gt 2; then wx_has_cppflags=yes else if test $wx_config_major_version -eq 2; then if test $wx_config_minor_version -gt 2; then wx_has_cppflags=yes else if test $wx_config_minor_version -eq 2; then if test $wx_config_micro_version -ge 6; then wx_has_cppflags=yes fi fi fi fi fi wx_has_rescomp="" if test $wx_config_major_version -gt 2; then wx_has_rescomp=yes else if test $wx_config_major_version -eq 2; then if test $wx_config_minor_version -ge 7; then wx_has_rescomp=yes fi fi fi if test "x$wx_has_rescomp" = x ; then WX_RESCOMP= else WX_RESCOMP=`$WX_CONFIG_WITH_ARGS --rescomp` fi if test "x$wx_has_cppflags" = x ; then WX_CFLAGS=`$WX_CONFIG_WITH_ARGS --cflags std,aui` WX_CPPFLAGS=$WX_CFLAGS WX_CXXFLAGS=$WX_CFLAGS WX_CFLAGS_ONLY=$WX_CFLAGS WX_CXXFLAGS_ONLY=$WX_CFLAGS else WX_CPPFLAGS=`$WX_CONFIG_WITH_ARGS --cppflags std,aui` WX_CXXFLAGS=`$WX_CONFIG_WITH_ARGS --cxxflags std,aui` WX_CFLAGS=`$WX_CONFIG_WITH_ARGS --cflags std,aui` WX_CFLAGS_ONLY=`echo $WX_CFLAGS | sed "s@^$WX_CPPFLAGS *@@"` WX_CXXFLAGS_ONLY=`echo $WX_CXXFLAGS | sed "s@^$WX_CFLAGS *@@"` fi wxWin=1 else if test "x$WX_VERSION" = x; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no (version $WX_VERSION is not new enough)" >&5 printf "%s\n" "no (version $WX_VERSION is not new enough)" >&6; } fi WX_CFLAGS="" WX_CPPFLAGS="" WX_CXXFLAGS="" WX_LIBS="" WX_LIBS_STATIC="" WX_RESCOMP="" if test ! -z ""; then wx_error_message=" The configuration you asked for $PACKAGE_NAME requires a wxWidgets build with the following settings: but such build is not available. To see the wxWidgets builds available on this system, please use 'wx-config --list' command. To use the default build, returned by 'wx-config --selected-config', use the options with their 'auto' default values." fi wx_error_message=" The requested wxWidgets build couldn't be found. $wx_error_message If you still get this error, then check that 'wx-config' is in path, the directory where wxWidgets libraries are installed (returned by 'wx-config --libs' command) is in LD_LIBRARY_PATH or equivalent variable and wxWidgets version is 3.0.0 or above." wxWin=0 fi else WX_CFLAGS="" WX_CPPFLAGS="" WX_CXXFLAGS="" WX_LIBS="" WX_LIBS_STATIC="" WX_RESCOMP="" wxWin=0 fi WX_VERSION_MAJOR="$wx_config_major_version" WX_VERSION_MINOR="$wx_config_minor_version" WX_VERSION_MICRO="$wx_config_micro_version" if test "$wxWin" != 1; then as_fn_error $? " wxWidgets must be installed on your system but wx-config script couldn't be found. Please check that wx-config is in path, the directory where wxWidgets libraries are installed (returned by 'wx-config --libs' command) is in LD_LIBRARY_PATH or equivalent variable and wxWidgets version is 3.0.0 or above. " "$LINENO" 5 fi fi CPPFLAGS="$CPPFLAGS $WX_CPPFLAGS" CXXFLAGS="$CXXFLAGS $WX_CXXFLAGS_ONLY" CFLAGS="$CFLAGS $WX_CFLAGS_ONLY" LIBS="$LIBS $WX_LIBS" as_fn_append RCDGEN_PP_ARGS " $WX_CPPFLAGS" export RCDGEN_PP_ARGS if test "x$ac_rcd_autogen_path" != "x" then : if bash -c "$ac_rcd_autogen_path src/wxedid.rcdgen_cfg" then : else $as_nop as_fn_error 1 "(E) rcd_autogen failed" "$LINENO" 5 fi fi ac_config_files="$ac_config_files Makefile" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 printf "%s\n" "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes: double-quote # substitution turns \\\\ into \\, and sed turns \\ into \. sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test ${\1+y} || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then if test "x$cache_file" != "x/dev/null"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 printf "%s\n" "$as_me: updating cache $cache_file" >&6;} if test ! -f "$cache_file" || test -h "$cache_file"; then cat confcache >"$cache_file" else case $cache_file in #( */* | ?:*) mv -f confcache "$cache_file"$$ && mv -f "$cache_file"$$ "$cache_file" ;; #( *) mv -f confcache "$cache_file" ;; esac fi fi else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 printf "%s\n" "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= U= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`printf "%s\n" "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5 printf %s "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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: done" >&5 printf "%s\n" "done" >&6; } if test -n "$EXEEXT"; then am__EXEEXT_TRUE= am__EXEEXT_FALSE='#' else am__EXEEXT_TRUE='#' am__EXEEXT_FALSE= fi : "${CONFIG_STATUS=./config.status}" ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 printf "%s\n" "$as_me: creating $CONFIG_STATUS" >&6;} as_write_fail=0 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh as_nop=: if test ${ZSH_VERSION+y} && (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 $as_nop case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi # Reset variables that may have inherited troublesome values from # the environment. # IFS needs to be set, to space, tab, and newline, in precisely that order. # (If _AS_PATH_WALK were called with IFS unset, it would have the # side effect of setting IFS to empty, thus disabling word splitting.) # Quoting is to prevent editors from complaining about space-tab. as_nl=' ' export as_nl IFS=" "" $as_nl" PS1='$ ' PS2='> ' PS4='+ ' # Ensure predictable behavior from utilities with locale-dependent output. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # We cannot yet rely on "unset" to work, but we need these variables # to be unset--not just set to an empty or harmless value--now, to # avoid bugs in old shells (e.g. pre-3.0 UWIN ksh). This construct # also avoids known problems related to "unset" and subshell syntax # in other old shells (e.g. bash 2.01 and pdksh 5.2.14). for as_var in BASH_ENV ENV MAIL MAILPATH CDPATH do eval test \${$as_var+y} \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done # Ensure that fds 0, 1, and 2 are open. if (exec 3>&0) 2>/dev/null; then :; else exec 0&1) 2>/dev/null; then :; else exec 1>/dev/null; fi if (exec 3>&2) ; then :; else exec 2>/dev/null; fi # The user is always right. if ${PATH_SEPARATOR+false} :; 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 # 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 case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac 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 printf "%s\n" "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # 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 printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi printf "%s\n" "$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_nop 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_nop 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 || printf "%s\n" 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 # Determine whether it's possible to make 'echo' print without a newline. # These variables are no longer used directly by Autoconf, but are AC_SUBSTed # for compatibility with existing Makefiles. 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 # For backward compatibility with old third-party macros, we provide # the shell variables $as_echo and $as_echo_n. New code should use # AS_ECHO(["message"]) and AS_ECHO_N(["message"]), respectively. as_echo='printf %s\n' as_echo_n='printf %s' 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=`printf "%s\n" "$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 || printf "%s\n" 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. ## ## ----------------------------------- ## _ASEOF test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # 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 wxEDID $as_me 0.0.32, which was generated by GNU Autoconf 2.71. 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` " _ACEOF case $ac_config_files in *" "*) set x $ac_config_files; shift; ac_config_files=$*;; esac case $ac_config_headers in *" "*) set x $ac_config_headers; shift; ac_config_headers=$*;; esac cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. config_files="$ac_config_files" config_headers="$ac_config_headers" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 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 --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration files: $config_files Configuration headers: $config_headers Report bugs to ." _ACEOF ac_cs_config=`printf "%s\n" "$ac_configure_args" | sed "$ac_safe_unquote"` ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\''/g"` cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config='$ac_cs_config_escaped' ac_cs_version="\\ wxEDID config.status 0.0.32 configured by $0, generated by GNU Autoconf 2.71, with options \\"\$ac_cs_config\\" Copyright (C) 2021 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='$ac_pwd' srcdir='$srcdir' INSTALL='$INSTALL' MKDIR_P='$MKDIR_P' AWK='$AWK' test -n "\$AWK" || AWK=awk _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # 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 ) printf "%s\n" "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) printf "%s\n" "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`printf "%s\n" "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`printf "%s\n" "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; esac as_fn_append CONFIG_HEADERS " '$ac_optarg'" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header as_fn_error $? "ambiguous option: \`$1' Try \`$0 --help' for more information.";; --help | --hel | -h ) printf "%s\n" "$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 _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 shift \printf "%s\n" "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX printf "%s\n" "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "src/config.h") CONFIG_HEADERS="$CONFIG_HEADERS src/config.h" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES 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+y} || CONFIG_FILES=$config_files test ${CONFIG_HEADERS+y} || CONFIG_HEADERS=$config_headers 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` 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" && _ACEOF { echo "cat >conf$$subs.awk <<_ACEOF" && echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do . ./conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h s/^/S["/; s/!.*/"]=/ p g s/^[^!]*!// :repl t repl s/'"$ac_delim"'$// t delim :nl h s/\(.\{148\}\)..*/\1/ t more1 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ p n b repl :more1 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t nl :delim h s/\(.\{148\}\)..*/\1/ t more2 s/["\\]/\\&/g; s/^/"/; s/$/"/ p b :more2 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t delim ' >$CONFIG_STATUS || ac_write_fail=1 rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _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 _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 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 _ACEOF # VPATH may cause trouble with some makes, so we remove sole $(srcdir), # ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ h s/// s/^/:/ s/[ ]*$/:/ s/:\$(srcdir):/:/g s/:\${srcdir}:/:/g s/:@srcdir@:/:/g s/^:*// s/:*$// x s/\(=[ ]*\).*/\1/ G s/\n// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 fi # test -n "$CONFIG_FILES" # Set up the scripts for CONFIG_HEADERS section. # No need to generate them if there are no CONFIG_HEADERS. # This happens for instance with `./config.status Makefile'. if test -n "$CONFIG_HEADERS"; then cat >"$ac_tmp/defines.awk" <<\_ACAWK || BEGIN { _ACEOF # Transform confdefs.h into an awk script `defines.awk', embedded as # here-document in config.status, that substitutes the proper values into # config.h.in to produce config.h. # Create a delimiter string that does not exist in confdefs.h, to ease # handling of long lines. ac_delim='%!_!# ' for ac_last_try in false false :; do ac_tt=`sed -n "/$ac_delim/p" confdefs.h` if test -z "$ac_tt"; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done # For the awk script, D is an array of macro values keyed by name, # likewise P contains macro parameters if any. Preserve backslash # newline sequences. ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* sed -n ' s/.\{148\}/&'"$ac_delim"'/g t rset :rset s/^[ ]*#[ ]*define[ ][ ]*/ / t def d :def s/\\$// t bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3"/p s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p d :bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3\\\\\\n"\\/p t cont s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p t cont d :cont n s/.\{148\}/&'"$ac_delim"'/g t clear :clear s/\\$// t bsnlc s/["\\]/\\&/g; s/^/"/; s/$/"/p d :bsnlc s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p b cont ' >$CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 for (key in D) D_is_set[key] = 1 FS = "" } /^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { line = \$ 0 split(line, arg, " ") if (arg[1] == "#") { defundef = arg[2] mac1 = arg[3] } else { defundef = substr(arg[1], 2) mac1 = arg[2] } split(mac1, mac2, "(") #) macro = mac2[1] prefix = substr(line, 1, index(line, defundef) - 1) if (D_is_set[macro]) { # Preserve the white space surrounding the "#". print prefix "define", macro P[macro] D[macro] next } else { # Replace #undef with comments. This is necessary, for example, # in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. if (defundef == "undef") { print "/*", prefix defundef, macro, "*/" next } } } { print } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 fi # test -n "$CONFIG_HEADERS" eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS " 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=`printf "%s\n" "$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 '` printf "%s\n" "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 printf "%s\n" "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) ac_sed_conf_input=`printf "%s\n" "$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 || printf "%s\n" 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=/`printf "%s\n" "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`printf "%s\n" "$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 _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # 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@*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 printf "%s\n" "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_sed_extra="$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 :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"; } && { printf "%s\n" "$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 printf "%s\n" "$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 ;; :H) # # CONFIG_HEADER # if test x"$ac_file" != x-; then { printf "%s\n" "/* $configure_input */" >&1 \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" } >"$ac_tmp/config.h" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 printf "%s\n" "$as_me: $ac_file is unchanged" >&6;} else rm -f "$ac_file" mv "$ac_tmp/config.h" "$ac_file" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 fi else printf "%s\n" "/* $configure_input */" >&1 \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ || as_fn_error $? "could not create -" "$LINENO" 5 fi # Compute "$ac_file"'s index in $config_headers. _am_arg="$ac_file" _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || $as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$_am_arg" : 'X\(//\)[^/]' \| \ X"$_am_arg" : 'X\(//\)$' \| \ X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X"$_am_arg" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'`/stamp-h$_am_stamp_count ;; esac done # for ac_tag as_fn_exit 0 _ACEOF ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || as_fn_exit 1 fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 printf "%s\n" "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi wxedid-0.0.32/aclocal.m40000644000175000017500000007010014722720160011640 00000000000000# generated automatically by aclocal 1.16.5 -*- Autoconf -*- # Copyright (C) 1996-2021 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. 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.71],, [m4_warning([this file was generated for autoconf 2.71. 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'.])]) # Copyright (C) 2002-2021 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_AUTOMAKE_VERSION(VERSION) # ---------------------------- # Automake X.Y traces this macro to ensure aclocal.m4 has been # 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.16' 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.16.5], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) # _AM_AUTOCONF_VERSION(VERSION) # ----------------------------- # aclocal traces this macro to find the Autoconf version. # This is a private macro too. Using m4_define simplifies # the logic in aclocal, which can simply ignore this definition. m4_define([_AM_AUTOCONF_VERSION], []) # AM_SET_CURRENT_AUTOMAKE_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.16.5])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-2021 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/../..'. # # Of course, Automake must honor this variable whenever it calls a # tool from the auxiliary directory. The problem is that $srcdir (and # therefore $ac_aux_dir as well) can be either absolute or relative, # depending on how configure is run. This is pretty annoying, since # it makes $ac_aux_dir quite unusable in subdirectories: in the top # source directory, any form will work fine, but in subdirectories a # relative path needs to be adjusted first. # # $ac_aux_dir/missing # fails when called from a subdirectory if $ac_aux_dir is relative # $top_srcdir/$ac_aux_dir/missing # fails if $ac_aux_dir is absolute, # fails when called from a subdirectory in a VPATH build with # a relative $ac_aux_dir # # The reason of the latter failure is that $top_srcdir and $ac_aux_dir # are both prefixed by $srcdir. In an in-source build this is usually # harmless because $srcdir is '.', but things will broke when you # start a VPATH build or use an absolute $srcdir. # # So we could use something similar to $top_srcdir/$ac_aux_dir/missing, # iff we strip the leading $srcdir from $ac_aux_dir. That would be: # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` # and then we would define $MISSING as # MISSING="\${SHELL} $am_aux_dir/missing" # This will work as long as MISSING is not called from configure, because # unfortunately $(top_srcdir) has no meaning in configure. # However there are other variables, like CC, which are often used in # configure, and could therefore not use this "fixed" $ac_aux_dir. # # Another solution, used here, is to always expand $ac_aux_dir to an # absolute PATH. The drawback is that using absolute paths prevent a # configured tree to be moved without reconfiguration. AC_DEFUN([AM_AUX_DIR_EXPAND], [AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl # Expand $ac_aux_dir to an absolute path. am_aux_dir=`cd "$ac_aux_dir" && pwd` ]) # AM_CONDITIONAL -*- Autoconf -*- # Copyright (C) 1997-2021 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_CONDITIONAL(NAME, SHELL-CONDITION) # ------------------------------------- # Define a conditional. AC_DEFUN([AM_CONDITIONAL], [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 _AM_SUBST_NOTMAKE([$1_FALSE])dnl m4_define([_AM_COND_VALUE_$1], [$2])dnl if $2; then $1_TRUE= $1_FALSE='#' else $1_TRUE='#' $1_FALSE= fi AC_CONFIG_COMMANDS_PRE( [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then AC_MSG_ERROR([[conditional "$1" was never defined. Usually this means the macro was only invoked conditionally.]]) fi])]) # Do all the work for Automake. -*- Autoconf -*- # Copyright (C) 1996-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This 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]) # ----------------------------------------------- # The call with PACKAGE and VERSION arguments is the old style # call (pre autoconf-2.50), which is being phased out. PACKAGE # and VERSION should now be passed to AC_INIT and removed from # the call to AM_INIT_AUTOMAKE. # We support both call styles for the transition. After # the next Automake release, Autoconf can make the AC_INIT # arguments mandatory, and then we can depend on a new Autoconf # release and drop the old call support. AC_DEFUN([AM_INIT_AUTOMAKE], [AC_PREREQ([2.65])dnl m4_ifdef([_$0_ALREADY_INIT], [m4_fatal([$0 expanded multiple times ]m4_defn([_$0_ALREADY_INIT]))], [m4_define([_$0_ALREADY_INIT], m4_expansion_stack)])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 AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl # test to see if srcdir already configured if test -f $srcdir/config.status; then AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi AC_SUBST([CYGPATH_W]) # Define the identity of the package. dnl Distinguish between old-style and new-style calls. m4_ifval([$2], [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_ifset([AC_PACKAGE_NAME], [ok]):m4_ifset([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 # 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]) AC_REQUIRE([AM_PROG_INSTALL_SH])dnl AC_REQUIRE([AM_PROG_INSTALL_STRIP])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: # # AC_SUBST([mkdir_p], ['$(MKDIR_P)']) # We need awk for the "check" target (and possibly the TAP driver). The # system "awk" is bad on some platforms. AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AM_SET_LEADING_DOT])dnl _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], [_AM_PROG_TAR([v7])])]) _AM_IF_OPTION([no-dependencies],, [AC_PROVIDE_IFELSE([AC_PROG_CC], [_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])], [m4_define([AC_PROG_CXX], m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJC], [_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 ]) # Variables for tags utilities; see am/tags.am if test -z "$CTAGS"; then CTAGS=ctags fi AC_SUBST([CTAGS]) if test -z "$ETAGS"; then ETAGS=etags fi AC_SUBST([ETAGS]) if test -z "$CSCOPE"; then CSCOPE=cscope fi AC_SUBST([CSCOPE]) 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 # 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: 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: . 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 The trailing newline in this macro's definition is deliberate, for dnl backward compatibility and to allow trailing 'dnl'-style comments dnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841. ]) 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. # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the # loop where config.status creates the headers, so we can generate # our stamp files there. AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], [# Compute $1's index in $config_headers. _am_arg=$1 _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) # Copyright (C) 2001-2021 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_INSTALL_SH # ------------------ # Define $install_sh. AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl if test x"${install_sh+set}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi AC_SUBST([install_sh])]) # Copyright (C) 2003-2021 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. # Check whether the underlying file-system supports filenames # with a leading dot. For instance MS-DOS doesn't. AC_DEFUN([AM_SET_LEADING_DOT], [rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null AC_SUBST([am__leading_dot])]) # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- # Copyright (C) 1997-2021 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_MISSING_PROG(NAME, PROGRAM) # ------------------------------ AC_DEFUN([AM_MISSING_PROG], [AC_REQUIRE([AM_MISSING_HAS_RUN]) $1=${$1-"${am_missing_run}$2"} AC_SUBST($1)]) # AM_MISSING_HAS_RUN # ------------------ # Define MISSING if not defined so far and test if it 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 if test x"${MISSING+set}" != xset; then MISSING="\${SHELL} '$am_aux_dir/missing'" fi # Use eval to expand $SHELL if eval "$MISSING --is-lightweight"; then am_missing_run="$MISSING " else am_missing_run= AC_MSG_WARN(['missing' script is too old or missing]) fi ]) # Helper functions for option handling. -*- Autoconf -*- # Copyright (C) 2001-2021 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_MANGLE_OPTION(NAME) # ----------------------- AC_DEFUN([_AM_MANGLE_OPTION], [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) # _AM_SET_OPTION(NAME) # -------------------- # Set option NAME. Presently that only means defining a flag for this option. AC_DEFUN([_AM_SET_OPTION], [m4_define(_AM_MANGLE_OPTION([$1]), [1])]) # _AM_SET_OPTIONS(OPTIONS) # ------------------------ # OPTIONS is a space-separated list of Automake options. AC_DEFUN([_AM_SET_OPTIONS], [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) # ------------------------------------------- # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) # Check to make sure that the build environment is sane. -*- Autoconf -*- # Copyright (C) 1996-2021 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]) # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[[\\\"\#\$\&\'\`$am_lf]]*) AC_MSG_ERROR([unsafe absolute working directory name]);; esac case $srcdir in *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);; esac # 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 ( 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 # Ok. : else AC_MSG_ERROR([newly created file is older than distributed files! Check your system clock]) fi 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) 2009-2021 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-2021 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_INSTALL_STRIP # --------------------- # One issue with vendor 'install' (even GNU) is that you can't # specify the program used to strip binaries. This is especially # annoying in cross-compiling environments, where the build's strip # is unlikely to handle the host's binaries. # Fortunately install-sh will honor a STRIPPROG variable, so we # always use install-sh in "make install-strip", and initialize # STRIPPROG with the value of the STRIP variable (set by the user). AC_DEFUN([AM_PROG_INSTALL_STRIP], [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl # Installed binaries are usually stripped using 'strip' when the user # run "make install-strip". However 'strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the 'STRIP' environment variable to overrule this program. dnl Don't test for $cross_compiling = yes, because it might be 'maybe'. if test "$cross_compiling" != no; then AC_CHECK_TOOL([STRIP], [strip], :) fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) # Copyright (C) 2006-2021 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_SUBST_NOTMAKE(VARIABLE) # --------------------------- # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. # This macro is traced by Automake. 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-2021 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_TAR(FORMAT) # -------------------- # Check how to create a tarball in format FORMAT. # 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 # $tardir. # tardir=directory && $(am__tar) > result.tar # # 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. 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' 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 # 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 /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_SUBST([am__tar]) AC_SUBST([am__untar]) ]) # _AM_PROG_TAR m4_include([m4/build_switch.m4]) m4_include([m4/rcd_autoconf.m4]) m4_include([m4/wxwin.m4]) wxedid-0.0.32/man/0000755000175000017500000000000014722720160010635 500000000000000wxedid-0.0.32/man/wxedid.10000644000175000017500000000257314722720160012132 00000000000000.TH wxedid 1 "" "" "wxEDID Manual Page" .SH NAME wxEDID \- Graphical editor for EDID data presented by computer displays .SH SYNOPSIS .B wxedid .RB [\| \-e \|] [\| \-w \|] [\| \-t \|] .IR file .SH DESCRIPTION wxEDID is a wxWidgets based editor for Extended Display Identification Data (EDID). It operates on offline files that can be flashed to a monitor using the technique described .UR https://wiki.debian.org/RepairEDID here .UE . This tool can modify the base EDID v1.3+ structure and the CEA/CTA-861-G, as the first extension block. The program also provides a DTD constructor to aid with the selection of suitable timings. The tool can import and export EDID data in binary blob and in hexadecimal formats. .SH ARGUMENT A \fIfile\fR with EDID information to be edited. .SH OPTIONS .TP .B \-e, \-\-ignore-errors Ignore errors in \fIfile\fR .TP .B \-w, \-\-all-writeable Ignore read-only flags - all EDID fields are writeable. .TP .B \-t, \-\-text Assume the \fIfile\fR argument is a text file containing EDID data bytes in a hexadecimal format (and not binary EDID data). .SH SEE ALSO .UR https://wiki.debian.org/RepairEDID Flashing Instructions .UE .SH BUGS No known bugs. .SH AUTHOR This manual page was written by Felix Lechner for the Debian project, but may be used by anyone under the same license as wxEDID. .sp Updated by Tomasz Pawlak wxedid-0.0.32/AUTHORS0000644000175000017500000000006214722720160011050 00000000000000Developers: Tomasz Pawlak wxedid-0.0.32/build-aux/0000755000175000017500000000000014722720160011754 500000000000000wxedid-0.0.32/build-aux/missing0000755000175000017500000001533614722720160013303 00000000000000#! /bin/sh # Common wrapper for a few potentially missing GNU programs. scriptversion=2018-03-07.03; # UTC # Copyright (C) 1996-2021 Free Software Foundation, Inc. # Originally written by Fran,cois Pinard , 1996. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. if test $# -eq 0; then echo 1>&2 "Try '$0 --help' for more information" exit 1 fi case $1 in --is-lightweight) # Used by our autoconf macros to check whether the available missing # script is modern enough. exit 0 ;; --run) # Back-compat with the calling convention used by older automake. shift ;; -h|--h|--he|--hel|--help) echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due to PROGRAM being missing or too old. Options: -h, --help display this help and exit -v, --version output version information and exit Supported PROGRAM values: aclocal autoconf autoheader autom4te automake makeinfo bison yacc flex lex help2man Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and 'g' are ignored when checking the name. Send bug reports to ." exit $? ;; -v|--v|--ve|--ver|--vers|--versi|--versio|--version) echo "missing $scriptversion (GNU Automake)" exit $? ;; -*) echo 1>&2 "$0: unknown '$1' option" echo 1>&2 "Try '$0 --help' for more information" exit 1 ;; esac # Run the given program, remember its exit status. "$@"; st=$? # If it succeeded, we are done. test $st -eq 0 && exit 0 # Also exit now if we it failed (or wasn't found), and '--version' was # passed; such an option is passed most likely to detect whether the # program is present and works. case $2 in --version|--help) exit $st;; esac # Exit code 63 means version mismatch. This often happens when the user # tries to use an ancient version of a tool on a file that requires a # minimum version. if test $st -eq 63; then msg="probably too old" elif test $st -eq 127; then # Program was missing. msg="missing on your system" else # Program was found and executed, but failed. Give up. exit $st fi perl_URL=https://www.perl.org/ flex_URL=https://github.com/westes/flex gnu_software_URL=https://www.gnu.org/software program_details () { case $1 in aclocal|automake) echo "The '$1' program is part of the GNU Automake package:" echo "<$gnu_software_URL/automake>" echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:" echo "<$gnu_software_URL/autoconf>" echo "<$gnu_software_URL/m4/>" echo "<$perl_URL>" ;; autoconf|autom4te|autoheader) echo "The '$1' program is part of the GNU Autoconf package:" echo "<$gnu_software_URL/autoconf/>" echo "It also requires GNU m4 and Perl in order to run:" echo "<$gnu_software_URL/m4/>" echo "<$perl_URL>" ;; esac } give_advice () { # Normalize program name to check for. normalized_program=`echo "$1" | sed ' s/^gnu-//; t s/^gnu//; t s/^g//; t'` printf '%s\n' "'$1' is $msg." configure_deps="'configure.ac' or m4 files included by 'configure.ac'" case $normalized_program in autoconf*) echo "You should only need it if you modified 'configure.ac'," echo "or m4 files included by it." program_details 'autoconf' ;; autoheader*) echo "You should only need it if you modified 'acconfig.h' or" echo "$configure_deps." program_details 'autoheader' ;; automake*) echo "You should only need it if you modified 'Makefile.am' or" echo "$configure_deps." program_details 'automake' ;; aclocal*) echo "You should only need it if you modified 'acinclude.m4' or" echo "$configure_deps." program_details 'aclocal' ;; autom4te*) echo "You might have modified some maintainer files that require" echo "the 'autom4te' program to be rebuilt." program_details 'autom4te' ;; bison*|yacc*) echo "You should only need it if you modified a '.y' file." echo "You may want to install the GNU Bison package:" echo "<$gnu_software_URL/bison/>" ;; lex*|flex*) echo "You should only need it if you modified a '.l' file." echo "You may want to install the Fast Lexical Analyzer package:" echo "<$flex_URL>" ;; help2man*) echo "You should only need it if you modified a dependency" \ "of a man page." echo "You may want to install the GNU Help2man package:" echo "<$gnu_software_URL/help2man/>" ;; makeinfo*) echo "You should only need it if you modified a '.texi' file, or" echo "any other file indirectly affecting the aspect of the manual." echo "You might want to install the Texinfo package:" echo "<$gnu_software_URL/texinfo/>" echo "The spurious makeinfo call might also be the consequence of" echo "using a buggy 'make' (AIX, DU, IRIX), in which case you might" echo "want to install GNU make:" echo "<$gnu_software_URL/make/>" ;; *) echo "You might have modified some files without having the proper" echo "tools for further handling them. Check the 'README' file, it" echo "often tells you about the needed prerequisites for installing" echo "this package. You may also peek at any GNU archive site, in" echo "case some other package contains this missing '$1' program." ;; esac } give_advice "$1" | sed -e '1s/^/WARNING: /' \ -e '2,$s/^/ /' >&2 # Propagate the correct exit status (expected to be 127 for a program # not found, 63 for a program that failed due to version mismatch). exit $st # Local variables: # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: wxedid-0.0.32/build-aux/config.sub0000644000175000017500000010242514722720160013660 00000000000000#! /bin/sh # Configuration validation subroutine script. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 # Free Software Foundation, Inc. timestamp='2009-06-11' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software # can handle that machine. It does not imply ALL GNU software can. # # This file 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., 51 Franklin Street - Fifth Floor, Boston, MA # 02110-1301, 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. # Please send patches to . Submit a context # diff and a properly formatted ChangeLog entry. # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. # If it is invalid, we print an error message on stderr and exit with code 1. # Otherwise, we print the canonical config type on stdout and succeed. # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases # that are meaningful with *any* GNU software. # Each package is responsible for reporting which valid configurations # it does not support. The user should be able to distinguish # a failure to support a valid configuration from a meaningless # configuration. # The goal of this file is to map all the various variations of a given # machine specification into a single specification in the form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or in some cases, the newer four-part form: # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # It is wrong to echo any other type of specification. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] CPU-MFR-OPSYS $0 [OPTION] ALIAS Canonicalize a configuration name. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.sub ($timestamp) Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" exit 1 ;; *local*) # First pass through any local machine types. echo $1 exit ;; * ) break ;; esac done case $# in 0) echo "$me: missing argument$help" >&2 exit 1;; 1) ;; *) echo "$me: too many arguments$help" >&2 exit 1;; esac # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \ uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \ kopensolaris*-gnu* | \ storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; *) basic_machine=`echo $1 | sed 's/-[^-]*$//'` if [ $basic_machine != $1 ] then os=`echo $1 | sed 's/.*-/-/'` else os=; fi ;; esac ### Let's recognize common machines as not being operating systems so ### that things like config.sub decstation-3100 work. We also ### recognize some manufacturers as not being operating systems, so we ### can provide default operating systems below. case $os in -sun*os*) # Prevent following clause from handling this invalid input. ;; -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ -apple | -axis | -knuth | -cray) os= basic_machine=$1 ;; -bluegene*) os=-cnk ;; -sim | -cisco | -oki | -wec | -winbond) os= basic_machine=$1 ;; -scout) ;; -wrs) os=-vxworks basic_machine=$1 ;; -chorusos*) os=-chorusos basic_machine=$1 ;; -chorusrdb) os=-chorusrdb basic_machine=$1 ;; -hiux*) os=-hiuxwe2 ;; -sco6) os=-sco5v6 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5) os=-sco3.2v5 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco4) os=-sco3.2v4 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2.[4-9]*) os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2v[4-9]*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5v6*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco*) os=-sco3.2v2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -udk*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -isc) os=-isc2.2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -clix*) basic_machine=clipper-intergraph ;; -isc*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -lynx*) os=-lynxos ;; -ptx*) basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` ;; -windowsnt*) os=`echo $os | sed -e 's/windowsnt/winnt/'` ;; -psos*) os=-psos ;; -mint | -mint[0-9]*) basic_machine=m68k-atari os=-mint ;; esac # Decode aliases for certain CPU-COMPANY combinations. case $basic_machine in # Recognize the basic CPU types without company name. # Some are omitted here because they have special meanings below. 1750a | 580 \ | a29k \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | am33_2.0 \ | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \ | bfin \ | c4x | clipper \ | d10v | d30v | dlx | dsp16xx \ | fido | fr30 | frv \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ | lm32 \ | m32c | m32r | m32rle | m68000 | m68k | m88k \ | maxq | mb | microblaze | mcore | mep | metag \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ | mips64octeon | mips64octeonel \ | mips64orion | mips64orionel \ | mips64r5900 | mips64r5900el \ | mips64vr | mips64vrel \ | mips64vr4100 | mips64vr4100el \ | mips64vr4300 | mips64vr4300el \ | mips64vr5000 | mips64vr5000el \ | mips64vr5900 | mips64vr5900el \ | mipsisa32 | mipsisa32el \ | mipsisa32r2 | mipsisa32r2el \ | mipsisa64 | mipsisa64el \ | mipsisa64r2 | mipsisa64r2el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ | moxie \ | mt \ | msp430 \ | nios | nios2 \ | ns16k | ns32k \ | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ | pyramid \ | score \ | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ | spu | strongarm \ | tahoe | thumb | tic4x | tic80 | tron \ | v850 | v850e \ | we32k \ | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \ | z8k | z80) basic_machine=$basic_machine-unknown ;; m6811 | m68hc11 | m6812 | m68hc12) # Motorola 68HC11/12. basic_machine=$basic_machine-unknown os=-none ;; m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) ;; ms1) basic_machine=mt-unknown ;; # We use `pc' rather than `unknown' # because (1) that's what they normally are, and # (2) the word "unknown" tends to confuse beginning users. i*86 | x86_64) basic_machine=$basic_machine-pc ;; # Object if more than one company name word. *-*-*) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; # Recognize the basic CPU types with company name. 580-* \ | a29k-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* | avr32-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \ | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | elxsi-* \ | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* | iq2000-* \ | lm32-* \ | m32c-* | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ | mips64octeon-* | mips64octeonel-* \ | mips64orion-* | mips64orionel-* \ | mips64r5900-* | mips64r5900el-* \ | mips64vr-* | mips64vrel-* \ | mips64vr4100-* | mips64vr4100el-* \ | mips64vr4300-* | mips64vr4300el-* \ | mips64vr5000-* | mips64vr5000el-* \ | mips64vr5900-* | mips64vr5900el-* \ | mipsisa32-* | mipsisa32el-* \ | mipsisa32r2-* | mipsisa32r2el-* \ | mipsisa64-* | mipsisa64el-* \ | mipsisa64r2-* | mipsisa64r2el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipstx39-* | mipstx39el-* \ | mmix-* \ | mt-* \ | msp430-* \ | nios-* | nios2-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ | pyramid-* \ | romp-* | rs6000-* \ | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ | sparclite-* \ | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \ | tahoe-* | thumb-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* | tile-* \ | tron-* \ | v850-* | v850e-* | vax-* \ | we32k-* \ | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \ | xstormy16-* | xtensa*-* \ | ymp-* \ | z8k-* | z80-*) ;; # Recognize the basic CPU types without company name, with glob match. xtensa*) basic_machine=$basic_machine-unknown ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. 386bsd) basic_machine=i386-unknown os=-bsd ;; 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) basic_machine=m68000-att ;; 3b*) basic_machine=we32k-att ;; a29khif) basic_machine=a29k-amd os=-udi ;; abacus) basic_machine=abacus-unknown ;; adobe68k) basic_machine=m68010-adobe os=-scout ;; alliant | fx80) basic_machine=fx80-alliant ;; altos | altos3068) basic_machine=m68k-altos ;; am29k) basic_machine=a29k-none os=-bsd ;; amd64) basic_machine=x86_64-pc ;; amd64-*) basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; amdahl) basic_machine=580-amdahl os=-sysv ;; amiga | amiga-*) basic_machine=m68k-unknown ;; amigaos | amigados) basic_machine=m68k-unknown os=-amigaos ;; amigaunix | amix) basic_machine=m68k-unknown os=-sysv4 ;; apollo68) basic_machine=m68k-apollo os=-sysv ;; apollo68bsd) basic_machine=m68k-apollo os=-bsd ;; aros) basic_machine=i386-pc os=-aros ;; aux) basic_machine=m68k-apple os=-aux ;; balance) basic_machine=ns32k-sequent os=-dynix ;; blackfin) basic_machine=bfin-unknown os=-linux ;; blackfin-*) basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; bluegene*) basic_machine=powerpc-ibm os=-cnk ;; c90) basic_machine=c90-cray os=-unicos ;; cegcc) basic_machine=arm-unknown os=-cegcc ;; convex-c1) basic_machine=c1-convex os=-bsd ;; convex-c2) basic_machine=c2-convex os=-bsd ;; convex-c32) basic_machine=c32-convex os=-bsd ;; convex-c34) basic_machine=c34-convex os=-bsd ;; convex-c38) basic_machine=c38-convex os=-bsd ;; cray | j90) basic_machine=j90-cray os=-unicos ;; craynv) basic_machine=craynv-cray os=-unicosmp ;; cr16) basic_machine=cr16-unknown os=-elf ;; crds | unos) basic_machine=m68k-crds ;; crisv32 | crisv32-* | etraxfs*) basic_machine=crisv32-axis ;; cris | cris-* | etrax*) basic_machine=cris-axis ;; crx) basic_machine=crx-unknown os=-elf ;; da30 | da30-*) basic_machine=m68k-da30 ;; decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) basic_machine=mips-dec ;; decsystem10* | dec10*) basic_machine=pdp10-dec os=-tops10 ;; decsystem20* | dec20*) basic_machine=pdp10-dec os=-tops20 ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) basic_machine=m68k-motorola ;; delta88) basic_machine=m88k-motorola os=-sysv3 ;; dicos) basic_machine=i686-pc os=-dicos ;; djgpp) basic_machine=i586-pc os=-msdosdjgpp ;; dpx20 | dpx20-*) basic_machine=rs6000-bull os=-bosx ;; dpx2* | dpx2*-bull) basic_machine=m68k-bull os=-sysv3 ;; ebmon29k) basic_machine=a29k-amd os=-ebmon ;; elxsi) basic_machine=elxsi-elxsi os=-bsd ;; encore | umax | mmax) basic_machine=ns32k-encore ;; es1800 | OSE68k | ose68k | ose | OSE) basic_machine=m68k-ericsson os=-ose ;; fx2800) basic_machine=i860-alliant ;; genix) basic_machine=ns32k-ns ;; gmicro) basic_machine=tron-gmicro os=-sysv ;; go32) basic_machine=i386-pc os=-go32 ;; h3050r* | hiux*) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; h8300hms) basic_machine=h8300-hitachi os=-hms ;; h8300xray) basic_machine=h8300-hitachi os=-xray ;; h8500hms) basic_machine=h8500-hitachi os=-hms ;; harris) basic_machine=m88k-harris os=-sysv3 ;; hp300-*) basic_machine=m68k-hp ;; hp300bsd) basic_machine=m68k-hp os=-bsd ;; hp300hpux) basic_machine=m68k-hp os=-hpux ;; hp3k9[0-9][0-9] | hp9[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k2[0-9][0-9] | hp9k31[0-9]) basic_machine=m68000-hp ;; hp9k3[2-9][0-9]) basic_machine=m68k-hp ;; hp9k6[0-9][0-9] | hp6[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k7[0-79][0-9] | hp7[0-79][0-9]) basic_machine=hppa1.1-hp ;; hp9k78[0-9] | hp78[0-9]) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[0-9][13679] | hp8[0-9][13679]) basic_machine=hppa1.1-hp ;; hp9k8[0-9][0-9] | hp8[0-9][0-9]) basic_machine=hppa1.0-hp ;; hppa-next) os=-nextstep3 ;; hppaosf) basic_machine=hppa1.1-hp os=-osf ;; hppro) basic_machine=hppa1.1-hp os=-proelf ;; i370-ibm* | ibm*) basic_machine=i370-ibm ;; # I'm not sure what "Sysv32" means. Should this be sysv3.2? i*86v32) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv32 ;; i*86v4*) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv4 ;; i*86v) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv ;; i*86sol2) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-solaris2 ;; i386mach) basic_machine=i386-mach os=-mach ;; i386-vsta | vsta) basic_machine=i386-unknown os=-vsta ;; iris | iris4d) basic_machine=mips-sgi case $os in -irix*) ;; *) os=-irix4 ;; esac ;; isi68 | isi) basic_machine=m68k-isi os=-sysv ;; m68knommu) basic_machine=m68k-unknown os=-linux ;; m68knommu-*) basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; m88k-omron*) basic_machine=m88k-omron ;; magnum | m3230) basic_machine=mips-mips os=-sysv ;; merlin) basic_machine=ns32k-utek os=-sysv ;; mingw32) basic_machine=i386-pc os=-mingw32 ;; mingw32ce) basic_machine=arm-unknown os=-mingw32ce ;; miniframe) basic_machine=m68000-convergent ;; *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) basic_machine=m68k-atari os=-mint ;; mips3*-*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` ;; mips3*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown ;; monitor) basic_machine=m68k-rom68k os=-coff ;; morphos) basic_machine=powerpc-unknown os=-morphos ;; msdos) basic_machine=i386-pc os=-msdos ;; ms1-*) basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` ;; mvs) basic_machine=i370-ibm os=-mvs ;; ncr3000) basic_machine=i486-ncr os=-sysv4 ;; netbsd386) basic_machine=i386-unknown os=-netbsd ;; netwinder) basic_machine=armv4l-rebel os=-linux ;; news | news700 | news800 | news900) basic_machine=m68k-sony os=-newsos ;; news1000) basic_machine=m68030-sony os=-newsos ;; news-3600 | risc-news) basic_machine=mips-sony os=-newsos ;; necv70) basic_machine=v70-nec os=-sysv ;; next | m*-next ) basic_machine=m68k-next case $os in -nextstep* ) ;; -ns2*) os=-nextstep2 ;; *) os=-nextstep3 ;; esac ;; nh3000) basic_machine=m68k-harris os=-cxux ;; nh[45]000) basic_machine=m88k-harris os=-cxux ;; nindy960) basic_machine=i960-intel os=-nindy ;; mon960) basic_machine=i960-intel os=-mon960 ;; nonstopux) basic_machine=mips-compaq os=-nonstopux ;; np1) basic_machine=np1-gould ;; nsr-tandem) basic_machine=nsr-tandem ;; op50n-* | op60c-*) basic_machine=hppa1.1-oki os=-proelf ;; openrisc | openrisc-*) basic_machine=or32-unknown ;; os400) basic_machine=powerpc-ibm os=-os400 ;; OSE68000 | ose68000) basic_machine=m68000-ericsson os=-ose ;; os68k) basic_machine=m68k-none os=-os68k ;; pa-hitachi) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; paragon) basic_machine=i860-intel os=-osf ;; parisc) basic_machine=hppa-unknown os=-linux ;; parisc-*) basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; pbd) basic_machine=sparc-tti ;; pbb) basic_machine=m68k-tti ;; pc532 | pc532-*) basic_machine=ns32k-pc532 ;; pc98) basic_machine=i386-pc ;; pc98-*) basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium | p5 | k5 | k6 | nexgen | viac3) basic_machine=i586-pc ;; pentiumpro | p6 | 6x86 | athlon | athlon_*) basic_machine=i686-pc ;; pentiumii | pentium2 | pentiumiii | pentium3) basic_machine=i686-pc ;; pentium4) basic_machine=i786-pc ;; pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumpro-* | p6-* | 6x86-* | athlon-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium4-*) basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pn) basic_machine=pn-gould ;; power) basic_machine=power-ibm ;; ppc) basic_machine=powerpc-unknown ;; ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppcle | powerpclittle | ppc-le | powerpc-little) basic_machine=powerpcle-unknown ;; ppcle-* | powerpclittle-*) basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64) basic_machine=powerpc64-unknown ;; ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64le | powerpc64little | ppc64-le | powerpc64-little) basic_machine=powerpc64le-unknown ;; ppc64le-* | powerpc64little-*) basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ps2) basic_machine=i386-ibm ;; pw32) basic_machine=i586-unknown os=-pw32 ;; rdos) basic_machine=i386-pc os=-rdos ;; rom68k) basic_machine=m68k-rom68k os=-coff ;; rm[46]00) basic_machine=mips-siemens ;; rtpc | rtpc-*) basic_machine=romp-ibm ;; s390 | s390-*) basic_machine=s390-ibm ;; s390x | s390x-*) basic_machine=s390x-ibm ;; sa29200) basic_machine=a29k-amd os=-udi ;; sb1) basic_machine=mipsisa64sb1-unknown ;; sb1el) basic_machine=mipsisa64sb1el-unknown ;; sde) basic_machine=mipsisa32-sde os=-elf ;; sei) basic_machine=mips-sei os=-seiux ;; sequent) basic_machine=i386-sequent ;; sh) basic_machine=sh-hitachi os=-hms ;; sh5el) basic_machine=sh5le-unknown ;; sh64) basic_machine=sh64-unknown ;; sparclite-wrs | simso-wrs) basic_machine=sparclite-wrs os=-vxworks ;; sps7) basic_machine=m68k-bull os=-sysv2 ;; spur) basic_machine=spur-unknown ;; st2000) basic_machine=m68k-tandem ;; stratus) basic_machine=i860-stratus os=-sysv4 ;; sun2) basic_machine=m68000-sun ;; sun2os3) basic_machine=m68000-sun os=-sunos3 ;; sun2os4) basic_machine=m68000-sun os=-sunos4 ;; sun3os3) basic_machine=m68k-sun os=-sunos3 ;; sun3os4) basic_machine=m68k-sun os=-sunos4 ;; sun4os3) basic_machine=sparc-sun os=-sunos3 ;; sun4os4) basic_machine=sparc-sun os=-sunos4 ;; sun4sol2) basic_machine=sparc-sun os=-solaris2 ;; sun3 | sun3-*) basic_machine=m68k-sun ;; sun4) basic_machine=sparc-sun ;; sun386 | sun386i | roadrunner) basic_machine=i386-sun ;; sv1) basic_machine=sv1-cray os=-unicos ;; symmetry) basic_machine=i386-sequent os=-dynix ;; t3e) basic_machine=alphaev5-cray os=-unicos ;; t90) basic_machine=t90-cray os=-unicos ;; tic54x | c54x*) basic_machine=tic54x-unknown os=-coff ;; tic55x | c55x*) basic_machine=tic55x-unknown os=-coff ;; tic6x | c6x*) basic_machine=tic6x-unknown os=-coff ;; tile*) basic_machine=tile-unknown os=-linux-gnu ;; tx39) basic_machine=mipstx39-unknown ;; tx39el) basic_machine=mipstx39el-unknown ;; toad1) basic_machine=pdp10-xkl os=-tops20 ;; tower | tower-32) basic_machine=m68k-ncr ;; tpf) basic_machine=s390x-ibm os=-tpf ;; udi29k) basic_machine=a29k-amd os=-udi ;; ultra3) basic_machine=a29k-nyu os=-sym1 ;; v810 | necv810) basic_machine=v810-nec os=-none ;; vaxv) basic_machine=vax-dec os=-sysv ;; vms) basic_machine=vax-dec os=-vms ;; vpp*|vx|vx-*) basic_machine=f301-fujitsu ;; vxworks960) basic_machine=i960-wrs os=-vxworks ;; vxworks68) basic_machine=m68k-wrs os=-vxworks ;; vxworks29k) basic_machine=a29k-wrs os=-vxworks ;; w65*) basic_machine=w65-wdc os=-none ;; w89k-*) basic_machine=hppa1.1-winbond os=-proelf ;; xbox) basic_machine=i686-pc os=-mingw32 ;; xps | xps100) basic_machine=xps100-honeywell ;; ymp) basic_machine=ymp-cray os=-unicos ;; z8k-*-coff) basic_machine=z8k-unknown os=-sim ;; z80-*-coff) basic_machine=z80-unknown os=-sim ;; none) basic_machine=none-none os=-none ;; # Here we handle the default manufacturer of certain CPU types. It is in # some cases the only manufacturer, in others, it is the most popular. w89k) basic_machine=hppa1.1-winbond ;; op50n) basic_machine=hppa1.1-oki ;; op60c) basic_machine=hppa1.1-oki ;; romp) basic_machine=romp-ibm ;; mmix) basic_machine=mmix-knuth ;; rs6000) basic_machine=rs6000-ibm ;; vax) basic_machine=vax-dec ;; pdp10) # there are many clones, so DEC is not a safe bet basic_machine=pdp10-unknown ;; pdp11) basic_machine=pdp11-dec ;; we32k) basic_machine=we32k-att ;; sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) basic_machine=sh-unknown ;; sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) basic_machine=sparc-sun ;; cydra) basic_machine=cydra-cydrome ;; orion) basic_machine=orion-highlevel ;; orion105) basic_machine=clipper-highlevel ;; mac | mpw | mac-mpw) basic_machine=m68k-apple ;; pmac | pmac-mpw) basic_machine=powerpc-apple ;; *-unknown) # Make sure to match an already-canonicalized machine name. ;; *) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; esac # Here we canonicalize certain aliases for manufacturers. case $basic_machine in *-digital*) basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` ;; *-commodore*) basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` ;; *) ;; esac # Decode manufacturer-specific aliases for certain operating systems. if [ x"$os" != x"" ] then case $os in # First match some system type aliases # that might get confused with valid system types. # -solaris* is a basic system type, with this one exception. -solaris1 | -solaris1.*) os=`echo $os | sed -e 's|solaris1|sunos4|'` ;; -solaris) os=-solaris2 ;; -svr4*) os=-sysv4 ;; -unixware*) os=-sysv4.2uw ;; -gnu/linux*) os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` ;; # First accept the basic system types. # The portable systems comes first. # Each alternative MUST END IN A *, to match a version number. # -sysv* is not here because it comes later, after sysvr4. -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ | -kopensolaris* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ | -aos* | -aros* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ | -openbsd* | -solidbsd* \ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -chorusos* | -chorusrdb* | -cegcc* \ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \ | -uxpv* | -beos* | -mpeix* | -udk* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ | -skyos* | -haiku* | -rdos* | -toppers* | -drops*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) case $basic_machine in x86-* | i*86-*) ;; *) os=-nto$os ;; esac ;; -nto-qnx*) ;; -nto*) os=`echo $os | sed -e 's|nto|nto-qnx|'` ;; -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) ;; -mac*) os=`echo $os | sed -e 's|mac|macos|'` ;; -linux-dietlibc) os=-linux-dietlibc ;; -linux*) os=`echo $os | sed -e 's|linux|linux-gnu|'` ;; -sunos5*) os=`echo $os | sed -e 's|sunos5|solaris2|'` ;; -sunos6*) os=`echo $os | sed -e 's|sunos6|solaris3|'` ;; -opened*) os=-openedition ;; -os400*) os=-os400 ;; -wince*) os=-wince ;; -osfrose*) os=-osfrose ;; -osf*) os=-osf ;; -utek*) os=-bsd ;; -dynix*) os=-bsd ;; -acis*) os=-aos ;; -atheos*) os=-atheos ;; -syllable*) os=-syllable ;; -386bsd) os=-bsd ;; -ctix* | -uts*) os=-sysv ;; -nova*) os=-rtmk-nova ;; -ns2 ) os=-nextstep2 ;; -nsk*) os=-nsk ;; # Preserve the version number of sinix5. -sinix5.*) os=`echo $os | sed -e 's|sinix|sysv|'` ;; -sinix*) os=-sysv4 ;; -tpf*) os=-tpf ;; -triton*) os=-sysv3 ;; -oss*) os=-sysv3 ;; -svr4) os=-sysv4 ;; -svr3) os=-sysv3 ;; -sysvr4) os=-sysv4 ;; # This must come after -sysvr4. -sysv*) ;; -ose*) os=-ose ;; -es1800*) os=-ose ;; -xenix) os=-xenix ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) os=-mint ;; -aros*) os=-aros ;; -kaos*) os=-kaos ;; -zvmoe) os=-zvmoe ;; -dicos*) os=-dicos ;; -none) ;; *) # Get rid of the `-' at the beginning of $os. os=`echo $os | sed 's/[^-]*-//'` echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 exit 1 ;; esac else # Here we handle the default operating systems that come with various machines. # The value should be what the vendor currently ships out the door with their # machine or put another way, the most popular os provided with the machine. # Note that if you're going to try to match "-MANUFACTURER" here (say, # "-sun"), then you have to tell the case statement up towards the top # that MANUFACTURER isn't an operating system. Otherwise, code above # will signal an error saying that MANUFACTURER isn't an operating # system, and we'll never get to this point. case $basic_machine in score-*) os=-elf ;; spu-*) os=-elf ;; *-acorn) os=-riscix1.2 ;; arm*-rebel) os=-linux ;; arm*-semi) os=-aout ;; c4x-* | tic4x-*) os=-coff ;; # This must come before the *-dec entry. pdp10-*) os=-tops20 ;; pdp11-*) os=-none ;; *-dec | vax-*) os=-ultrix4.2 ;; m68*-apollo) os=-domain ;; i386-sun) os=-sunos4.0.2 ;; m68000-sun) os=-sunos3 # This also exists in the configure program, but was not the # default. # os=-sunos4 ;; m68*-cisco) os=-aout ;; mep-*) os=-elf ;; mips*-cisco) os=-elf ;; mips*-*) os=-elf ;; or32-*) os=-coff ;; *-tti) # must be before sparc entry or we get the wrong os. os=-sysv3 ;; sparc-* | *-sun) os=-sunos4.1.1 ;; *-be) os=-beos ;; *-haiku) os=-haiku ;; *-ibm) os=-aix ;; *-knuth) os=-mmixware ;; *-wec) os=-proelf ;; *-winbond) os=-proelf ;; *-oki) os=-proelf ;; *-hp) os=-hpux ;; *-hitachi) os=-hiux ;; i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) os=-sysv ;; *-cbm) os=-amigaos ;; *-dg) os=-dgux ;; *-dolphin) os=-sysv3 ;; m68k-ccur) os=-rtu ;; m88k-omron*) os=-luna ;; *-next ) os=-nextstep ;; *-sequent) os=-ptx ;; *-crds) os=-unos ;; *-ns) os=-genix ;; i370-*) os=-mvs ;; *-next) os=-nextstep3 ;; *-gould) os=-sysv ;; *-highlevel) os=-bsd ;; *-encore) os=-bsd ;; *-sgi) os=-irix ;; *-siemens) os=-sysv4 ;; *-masscomp) os=-rtu ;; f30[01]-fujitsu | f700-fujitsu) os=-uxpv ;; *-rom68k) os=-coff ;; *-*bug) os=-coff ;; *-apple) os=-macos ;; *-atari*) os=-mint ;; *) os=-none ;; esac fi # Here we handle the case where we know the os, and the CPU type, but not the # manufacturer. We pick the logical manufacturer. vendor=unknown case $basic_machine in *-unknown) case $os in -riscix*) vendor=acorn ;; -sunos*) vendor=sun ;; -cnk*|-aix*) vendor=ibm ;; -beos*) vendor=be ;; -hpux*) vendor=hp ;; -mpeix*) vendor=hp ;; -hiux*) vendor=hitachi ;; -unos*) vendor=crds ;; -dgux*) vendor=dg ;; -luna*) vendor=omron ;; -genix*) vendor=ns ;; -mvs* | -opened*) vendor=ibm ;; -os400*) vendor=ibm ;; -ptx*) vendor=sequent ;; -tpf*) vendor=ibm ;; -vxsim* | -vxworks* | -windiss*) vendor=wrs ;; -aux*) vendor=apple ;; -hms*) vendor=hitachi ;; -mpw* | -macos*) vendor=apple ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) vendor=atari ;; -vos*) vendor=stratus ;; esac basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` ;; esac echo $basic_machine$os exit # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: wxedid-0.0.32/build-aux/config.guess0000755000175000017500000013105414722720160014220 00000000000000#! /bin/sh # Attempt to guess a canonical system name. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 # Free Software Foundation, Inc. timestamp='2009-06-10' # This file 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., 51 Franklin Street - Fifth Floor, Boston, MA # 02110-1301, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Per Bothner . # Please send patches to . Submit a context # diff and a properly formatted ChangeLog entry. # # This script attempts to guess a canonical system name similar to # config.sub. If it succeeds, it prints the system name on stdout, and # exits with 0. Otherwise, it exits with 1. # # The plan is that this can be called by configure scripts if you # don't specify an explicit build system type. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] Output the configuration name of the system \`$me' is run on. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" >&2 exit 1 ;; * ) break ;; esac done if test $# != 0; then echo "$me: too many arguments$help" >&2 exit 1 fi trap 'exit 1' 1 2 15 # CC_FOR_BUILD -- compiler used by this script. Note that the use of a # compiler to aid in system detection is discouraged as it requires # temporary files to be created and, as you can see below, it is a # headache to deal with in a portable fashion. # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still # use `HOST_CC' if defined, but it is deprecated. # Portable tmp directory creation inspired by the Autoconf team. set_cc_for_build=' trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; : ${TMPDIR=/tmp} ; { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; dummy=$tmp/dummy ; tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; case $CC_FOR_BUILD,$HOST_CC,$CC in ,,) echo "int x;" > $dummy.c ; for c in cc gcc c89 c99 ; do if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then CC_FOR_BUILD="$c"; break ; fi ; done ; if test x"$CC_FOR_BUILD" = x ; then CC_FOR_BUILD=no_compiler_found ; fi ;; ,,*) CC_FOR_BUILD=$CC ;; ,*,*) CC_FOR_BUILD=$HOST_CC ;; esac ; set_cc_for_build= ;' # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 1994-08-24) if (test -f /.attbin/uname) >/dev/null 2>&1 ; then PATH=$PATH:/.attbin ; export PATH fi UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown # Note: order is significant - the case branches are not exclusive. case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently # switched to ELF, *-*-netbsd* would select the old # object file format. This provides both forward # compatibility and a consistent mechanism for selecting the # object file format. # # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". sysctl="sysctl -n hw.machine_arch" UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ /usr/sbin/$sysctl 2>/dev/null || echo unknown)` case "${UNAME_MACHINE_ARCH}" in armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; sh5el) machine=sh5le-unknown ;; *) machine=${UNAME_MACHINE_ARCH}-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently, or will in the future. case "${UNAME_MACHINE_ARCH}" in arm*|i386|m68k|ns32k|sh3*|sparc|vax) eval $set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ELF__ then # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). # Return netbsd for either. FIX? os=netbsd else os=netbsdelf fi ;; *) os=netbsd ;; esac # The OS release # Debian GNU/NetBSD machines have a different userland, and # thus, need a distinct triplet. However, they do not need # kernel version information, so it can be replaced with a # suitable tag, in the style of linux-gnu. case "${UNAME_VERSION}" in Debian*) release='-gnu' ;; *) release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. echo "${machine}-${os}${release}" exit ;; *:OpenBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} exit ;; *:ekkoBSD:*:*) echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} exit ;; *:SolidBSD:*:*) echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} exit ;; macppc:MirBSD:*:*) echo powerpc-unknown-mirbsd${UNAME_RELEASE} exit ;; *:MirBSD:*:*) echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} exit ;; alpha:OSF1:*:*) case $UNAME_RELEASE in *4.0) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` ;; *5.*) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` ;; esac # According to Compaq, /usr/sbin/psrinfo has been available on # OSF/1 and Tru64 systems produced since 1995. I hope that # covers most systems running today. This code pipes the CPU # types through head -n 1, so we only detect the type of CPU 0. ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` case "$ALPHA_CPU_TYPE" in "EV4 (21064)") UNAME_MACHINE="alpha" ;; "EV4.5 (21064)") UNAME_MACHINE="alpha" ;; "LCA4 (21066/21068)") UNAME_MACHINE="alpha" ;; "EV5 (21164)") UNAME_MACHINE="alphaev5" ;; "EV5.6 (21164A)") UNAME_MACHINE="alphaev56" ;; "EV5.6 (21164PC)") UNAME_MACHINE="alphapca56" ;; "EV5.7 (21164PC)") UNAME_MACHINE="alphapca57" ;; "EV6 (21264)") UNAME_MACHINE="alphaev6" ;; "EV6.7 (21264A)") UNAME_MACHINE="alphaev67" ;; "EV6.8CB (21264C)") UNAME_MACHINE="alphaev68" ;; "EV6.8AL (21264B)") UNAME_MACHINE="alphaev68" ;; "EV6.8CX (21264D)") UNAME_MACHINE="alphaev68" ;; "EV6.9A (21264/EV69A)") UNAME_MACHINE="alphaev69" ;; "EV7 (21364)") UNAME_MACHINE="alphaev7" ;; "EV7.9 (21364A)") UNAME_MACHINE="alphaev79" ;; esac # A Pn.n version is a patched version. # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` exit ;; Alpha\ *:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # Should we change UNAME_MACHINE based on the output of uname instead # of the specific Alpha model? echo alpha-pc-interix exit ;; 21064:Windows_NT:50:3) echo alpha-dec-winnt3.5 exit ;; Amiga*:UNIX_System_V:4.0:*) echo m68k-unknown-sysv4 exit ;; *:[Aa]miga[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-amigaos exit ;; *:[Mm]orph[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-morphos exit ;; *:OS/390:*:*) echo i370-ibm-openedition exit ;; *:z/VM:*:*) echo s390-ibm-zvmoe exit ;; *:OS400:*:*) echo powerpc-ibm-os400 exit ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} exit ;; arm:riscos:*:*|arm:RISCOS:*:*) echo arm-unknown-riscos exit ;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) echo hppa1.1-hitachi-hiuxmpp exit ;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. if test "`(/bin/universe) 2>/dev/null`" = att ; then echo pyramid-pyramid-sysv3 else echo pyramid-pyramid-bsd fi exit ;; NILE*:*:*:dcosx) echo pyramid-pyramid-svr4 exit ;; DRS?6000:unix:4.0:6*) echo sparc-icl-nx6 exit ;; DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) case `/usr/bin/uname -p` in sparc) echo sparc-icl-nx7; exit ;; esac ;; s390x:SunOS:*:*) echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4H:SunOS:5.*:*) echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) eval $set_cc_for_build SUN_ARCH="i386" # If there is a compiler, see if it is configured for 64-bit objects. # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. # This test works for both compilers. if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then SUN_ARCH="x86_64" fi fi echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:*:*) case "`/usr/bin/arch -k`" in Series*|S4*) UNAME_RELEASE=`uname -v` ;; esac # Japanese Language versions have a version number like `4.1.3-JL'. echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` exit ;; sun3*:SunOS:*:*) echo m68k-sun-sunos${UNAME_RELEASE} exit ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 case "`/bin/arch`" in sun3) echo m68k-sun-sunos${UNAME_RELEASE} ;; sun4) echo sparc-sun-sunos${UNAME_RELEASE} ;; esac exit ;; aushp:SunOS:*:*) echo sparc-auspex-sunos${UNAME_RELEASE} exit ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not # "atarist" or "atariste" at least should have a processor # > m68000). The system name ranges from "MiNT" over "FreeMiNT" # to the lowercase version "mint" (or "freemint"). Finally # the system name "TOS" denotes a system which is actually not # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) echo m68k-milan-mint${UNAME_RELEASE} exit ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) echo m68k-hades-mint${UNAME_RELEASE} exit ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) echo m68k-unknown-mint${UNAME_RELEASE} exit ;; m68k:machten:*:*) echo m68k-apple-machten${UNAME_RELEASE} exit ;; powerpc:machten:*:*) echo powerpc-apple-machten${UNAME_RELEASE} exit ;; RISC*:Mach:*:*) echo mips-dec-mach_bsd4.3 exit ;; RISC*:ULTRIX:*:*) echo mips-dec-ultrix${UNAME_RELEASE} exit ;; VAX*:ULTRIX*:*:*) echo vax-dec-ultrix${UNAME_RELEASE} exit ;; 2020:CLIX:*:* | 2430:CLIX:*:*) echo clipper-intergraph-clix${UNAME_RELEASE} exit ;; mips:*:*:UMIPS | mips:*:*:RISCos) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #ifdef __cplusplus #include /* for printf() prototype */ int main (int argc, char *argv[]) { #else int main (argc, argv) int argc; char *argv[]; { #endif #if defined (host_mips) && defined (MIPSEB) #if defined (SYSTYPE_SYSV) printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_SVR4) printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); #endif #endif exit (-1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && SYSTEM_NAME=`$dummy $dummyarg` && { echo "$SYSTEM_NAME"; exit; } echo mips-mips-riscos${UNAME_RELEASE} exit ;; Motorola:PowerMAX_OS:*:*) echo powerpc-motorola-powermax exit ;; Motorola:*:4.3:PL8-*) echo powerpc-harris-powermax exit ;; Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) echo powerpc-harris-powermax exit ;; Night_Hawk:Power_UNIX:*:*) echo powerpc-harris-powerunix exit ;; m88k:CX/UX:7*:*) echo m88k-harris-cxux7 exit ;; m88k:*:4*:R4*) echo m88k-motorola-sysv4 exit ;; m88k:*:3*:R3*) echo m88k-motorola-sysv3 exit ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] then if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ [ ${TARGET_BINARY_INTERFACE}x = x ] then echo m88k-dg-dgux${UNAME_RELEASE} else echo m88k-dg-dguxbcs${UNAME_RELEASE} fi else echo i586-dg-dgux${UNAME_RELEASE} fi exit ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) echo m88k-dolphin-sysv3 exit ;; M88*:*:R3*:*) # Delta 88k system running SVR3 echo m88k-motorola-sysv3 exit ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) echo m88k-tektronix-sysv3 exit ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) echo m68k-tektronix-bsd exit ;; *:IRIX*:*:*) echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` exit ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i*86:AIX:*:*) echo i386-ibm-aix exit ;; ia64:AIX:*:*) if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} exit ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include main() { if (!__power_pc()) exit(1); puts("powerpc-ibm-aix3.2.5"); exit(0); } EOF if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` then echo "$SYSTEM_NAME" else echo rs6000-ibm-aix3.2.5 fi elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then echo rs6000-ibm-aix3.2.4 else echo rs6000-ibm-aix3.2 fi exit ;; *:AIX:*:[456]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc fi if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${IBM_ARCH}-ibm-aix${IBM_REV} exit ;; *:AIX:*:*) echo rs6000-ibm-aix exit ;; ibmrt:4.4BSD:*|romp-ibm:BSD:*) echo romp-ibm-bsd4.4 exit ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to exit ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) echo rs6000-bull-bosx exit ;; DPX/2?00:B.O.S.:*:*) echo m68k-bull-sysv3 exit ;; 9000/[34]??:4.3bsd:1.*:*) echo m68k-hp-bsd exit ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) echo m68k-hp-bsd4.4 exit ;; 9000/[34678]??:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` case "${UNAME_MACHINE}" in 9000/31? ) HP_ARCH=m68000 ;; 9000/[34]?? ) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) if [ -x /usr/bin/getconf ]; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` case "${sc_cpu_version}" in 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 case "${sc_kernel_bits}" in 32) HP_ARCH="hppa2.0n" ;; 64) HP_ARCH="hppa2.0w" ;; '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 esac ;; esac fi if [ "${HP_ARCH}" = "" ]; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #define _HPUX_SOURCE #include #include int main () { #if defined(_SC_KERNEL_BITS) long bits = sysconf(_SC_KERNEL_BITS); #endif long cpu = sysconf (_SC_CPU_VERSION); switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0"); break; case CPU_PA_RISC1_1: puts ("hppa1.1"); break; case CPU_PA_RISC2_0: #if defined(_SC_KERNEL_BITS) switch (bits) { case 64: puts ("hppa2.0w"); break; case 32: puts ("hppa2.0n"); break; default: puts ("hppa2.0"); break; } break; #else /* !defined(_SC_KERNEL_BITS) */ puts ("hppa2.0"); break; #endif default: puts ("hppa1.0"); break; } exit (0); } EOF (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac if [ ${HP_ARCH} = "hppa2.0w" ] then eval $set_cc_for_build # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler # generating 64-bit code. GNU and HP use different nomenclature: # # $ CC_FOR_BUILD=cc ./config.guess # => hppa2.0w-hp-hpux11.23 # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess # => hppa64-hp-hpux11.23 if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | grep -q __LP64__ then HP_ARCH="hppa2.0w" else HP_ARCH="hppa64" fi fi echo ${HP_ARCH}-hp-hpux${HPUX_REV} exit ;; ia64:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` echo ia64-hp-hpux${HPUX_REV} exit ;; 3050*:HI-UX:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include int main () { long cpu = sysconf (_SC_CPU_VERSION); /* The order matters, because CPU_IS_HP_MC68K erroneously returns true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct results, however. */ if (CPU_IS_PA_RISC (cpu)) { switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; default: puts ("hppa-hitachi-hiuxwe2"); break; } } else if (CPU_IS_HP_MC68K (cpu)) puts ("m68k-hitachi-hiuxwe2"); else puts ("unknown-hitachi-hiuxwe2"); exit (0); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } echo unknown-hitachi-hiuxwe2 exit ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) echo hppa1.1-hp-bsd exit ;; 9000/8??:4.3bsd:*:*) echo hppa1.0-hp-bsd exit ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) echo hppa1.0-hp-mpeix exit ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) echo hppa1.1-hp-osf exit ;; hp8??:OSF1:*:*) echo hppa1.0-hp-osf exit ;; i*86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then echo ${UNAME_MACHINE}-unknown-osf1mk else echo ${UNAME_MACHINE}-unknown-osf1 fi exit ;; parisc*:Lites*:*:*) echo hppa1.1-hp-lites exit ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd exit ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) echo c34-convex-bsd exit ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) echo c38-convex-bsd exit ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd exit ;; CRAY*Y-MP:*:*:*) echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*[A-Z]90:*:*:*) echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ -e 's/\.[^.]*$/.X/' exit ;; CRAY*TS:*:*:*) echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*T3E:*:*:*) echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*SV1:*:*:*) echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; *:UNICOS/mp:*:*) echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; 5000:UNIX_System_V:4.*:*) FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} exit ;; sparc*:BSD/OS:*:*) echo sparc-unknown-bsdi${UNAME_RELEASE} exit ;; *:BSD/OS:*:*) echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} exit ;; *:FreeBSD:*:*) case ${UNAME_MACHINE} in pc98) echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; amd64) echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; *) echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; esac exit ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin exit ;; *:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit ;; i*:windows32*:*) # uname -m includes "-pc" on this system. echo ${UNAME_MACHINE}-mingw32 exit ;; i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit ;; *:Interix*:[3456]*) case ${UNAME_MACHINE} in x86) echo i586-pc-interix${UNAME_RELEASE} exit ;; EM64T | authenticamd | genuineintel) echo x86_64-unknown-interix${UNAME_RELEASE} exit ;; IA64) echo ia64-unknown-interix${UNAME_RELEASE} exit ;; esac ;; [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) echo i${UNAME_MACHINE}-pc-mks exit ;; 8664:Windows_NT:*) echo x86_64-pc-mks exit ;; i*:Windows_NT*:* | Pentium*:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we # UNAME_MACHINE based on the output of uname instead of i386? echo i586-pc-interix exit ;; i*:UWIN*:*) echo ${UNAME_MACHINE}-pc-uwin exit ;; amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) echo x86_64-unknown-cygwin exit ;; p*:CYGWIN*:*) echo powerpcle-unknown-cygwin exit ;; prep*:SunOS:5.*:*) echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; *:GNU:*:*) # the GNU system echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` exit ;; *:GNU/*:*:*) # other systems with GNU libc and userland echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu exit ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit ;; arm*:Linux:*:*) eval $set_cc_for_build if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_EABI__ then echo ${UNAME_MACHINE}-unknown-linux-gnu else echo ${UNAME_MACHINE}-unknown-linux-gnueabi fi exit ;; avr32*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; cris:Linux:*:*) echo cris-axis-linux-gnu exit ;; crisv32:Linux:*:*) echo crisv32-axis-linux-gnu exit ;; frv:Linux:*:*) echo frv-unknown-linux-gnu exit ;; ia64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; m32r*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; m68*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; mips:Linux:*:* | mips64:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef ${UNAME_MACHINE} #undef ${UNAME_MACHINE}el #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=${UNAME_MACHINE}el #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=${UNAME_MACHINE} #else CPU= #endif #endif EOF eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' /^CPU/{ s: ::g p }'`" test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } ;; or32:Linux:*:*) echo or32-unknown-linux-gnu exit ;; ppc:Linux:*:*) echo powerpc-unknown-linux-gnu exit ;; ppc64:Linux:*:*) echo powerpc64-unknown-linux-gnu exit ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in EV5) UNAME_MACHINE=alphaev5 ;; EV56) UNAME_MACHINE=alphaev56 ;; PCA56) UNAME_MACHINE=alphapca56 ;; PCA57) UNAME_MACHINE=alphapca56 ;; EV6) UNAME_MACHINE=alphaev6 ;; EV67) UNAME_MACHINE=alphaev67 ;; EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep -q ld.so.1 if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} exit ;; padre:Linux:*:*) echo sparc-unknown-linux-gnu exit ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in PA7*) echo hppa1.1-unknown-linux-gnu ;; PA8*) echo hppa2.0-unknown-linux-gnu ;; *) echo hppa-unknown-linux-gnu ;; esac exit ;; parisc64:Linux:*:* | hppa64:Linux:*:*) echo hppa64-unknown-linux-gnu exit ;; s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-ibm-linux exit ;; sh64*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; sh*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; sparc:Linux:*:* | sparc64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; vax:Linux:*:*) echo ${UNAME_MACHINE}-dec-linux-gnu exit ;; x86_64:Linux:*:*) echo x86_64-unknown-linux-gnu exit ;; xtensa*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; i*86:Linux:*:*) # The BFD linker knows what the default object file format is, so # first see if it will tell us. cd to the root directory to prevent # problems with other programs or directories called `ld' in the path. # Set LC_ALL=C to ensure ld outputs messages in English. ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \ | sed -ne '/supported targets:/!d s/[ ][ ]*/ /g s/.*supported targets: *// s/ .*// p'` case "$ld_supported_targets" in elf32-i386) TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu" ;; esac # Determine whether the default compiler is a.out or elf eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include #ifdef __ELF__ # ifdef __GLIBC__ # if __GLIBC__ >= 2 LIBC=gnu # else LIBC=gnulibc1 # endif # else LIBC=gnulibc1 # endif #else #if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC) LIBC=gnu #else LIBC=gnuaout #endif #endif #ifdef __dietlibc__ LIBC=dietlibc #endif EOF eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' /^LIBC/{ s: ::g p }'`" test x"${LIBC}" != x && { echo "${UNAME_MACHINE}-pc-linux-${LIBC}" exit } test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; } ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. # earlier versions are messed up and put the nodename in both # sysname and nodename. echo i386-sequent-sysv4 exit ;; i*86:UNIX_SV:4.2MP:2.*) # Unixware is an offshoot of SVR4, but it has its own version # number series starting with 2... # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} exit ;; i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. echo ${UNAME_MACHINE}-pc-os2-emx exit ;; i*86:XTS-300:*:STOP) echo ${UNAME_MACHINE}-unknown-stop exit ;; i*86:atheos:*:*) echo ${UNAME_MACHINE}-unknown-atheos exit ;; i*86:syllable:*:*) echo ${UNAME_MACHINE}-pc-syllable exit ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) echo i386-unknown-lynxos${UNAME_RELEASE} exit ;; i*86:*DOS:*:*) echo ${UNAME_MACHINE}-pc-msdosdjgpp exit ;; i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} else echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} fi exit ;; i*86:*:5:[678]*) # UnixWare 7.x, OpenUNIX and OpenServer 6. case `/bin/uname -X | grep "^Machine"` in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} exit ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ && UNAME_MACHINE=i586 (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ && UNAME_MACHINE=i686 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 echo ${UNAME_MACHINE}-pc-sco$UNAME_REL else echo ${UNAME_MACHINE}-pc-sysv32 fi exit ;; pc:*:*:*) # Left here for compatibility: # uname -m prints for DJGPP always 'pc', but it prints nothing about # the processor, so we play safe by assuming i586. # Note: whatever this is, it MUST be the same as what config.sub # prints for the "djgpp" host, or else GDB configury will decide that # this is a cross-build. echo i586-pc-msdosdjgpp exit ;; Intel:Mach:3*:*) echo i386-pc-mach3 exit ;; paragon:*:*:*) echo i860-intel-osf1 exit ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 fi exit ;; mini*:CTIX:SYS*5:*) # "miniframe" echo m68010-convergent-sysv exit ;; mc68k:UNIX:SYSTEM5:3.51m) echo m68k-convergent-sysv exit ;; M680?0:D-NIX:5.3:*) echo m68k-diab-dnix exit ;; M68*:*:R3V[5678]*:*) test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4; exit; } ;; NCR*:*:4.2:* | MPRAS*:*:4.2:*) OS_REL='.3' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) echo m68k-unknown-lynxos${UNAME_RELEASE} exit ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 exit ;; TSUNAMI:LynxOS:2.*:*) echo sparc-unknown-lynxos${UNAME_RELEASE} exit ;; rs6000:LynxOS:2.*:*) echo rs6000-unknown-lynxos${UNAME_RELEASE} exit ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) echo powerpc-unknown-lynxos${UNAME_RELEASE} exit ;; SM[BE]S:UNIX_SV:*:*) echo mips-dde-sysv${UNAME_RELEASE} exit ;; RM*:ReliantUNIX-*:*:*) echo mips-sni-sysv4 exit ;; RM*:SINIX-*:*:*) echo mips-sni-sysv4 exit ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` echo ${UNAME_MACHINE}-sni-sysv4 else echo ns32k-sni-sysv fi exit ;; PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort # says echo i586-unisys-sysv4 exit ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm echo hppa1.1-stratus-sysv4 exit ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. echo i860-stratus-sysv4 exit ;; i*86:VOS:*:*) # From Paul.Green@stratus.com. echo ${UNAME_MACHINE}-stratus-vos exit ;; *:VOS:*:*) # From Paul.Green@stratus.com. echo hppa1.1-stratus-vos exit ;; mc68*:A/UX:*:*) echo m68k-apple-aux${UNAME_RELEASE} exit ;; news*:NEWS-OS:6*:*) echo mips-sony-newsos6 exit ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if [ -d /usr/nec ]; then echo mips-nec-sysv${UNAME_RELEASE} else echo mips-unknown-sysv${UNAME_RELEASE} fi exit ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. echo powerpc-be-beos exit ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. echo powerpc-apple-beos exit ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. echo i586-pc-beos exit ;; BePC:Haiku:*:*) # Haiku running on Intel PC compatible. echo i586-pc-haiku exit ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux${UNAME_RELEASE} exit ;; SX-5:SUPER-UX:*:*) echo sx5-nec-superux${UNAME_RELEASE} exit ;; SX-6:SUPER-UX:*:*) echo sx6-nec-superux${UNAME_RELEASE} exit ;; SX-7:SUPER-UX:*:*) echo sx7-nec-superux${UNAME_RELEASE} exit ;; SX-8:SUPER-UX:*:*) echo sx8-nec-superux${UNAME_RELEASE} exit ;; SX-8R:SUPER-UX:*:*) echo sx8r-nec-superux${UNAME_RELEASE} exit ;; Power*:Rhapsody:*:*) echo powerpc-apple-rhapsody${UNAME_RELEASE} exit ;; *:Rhapsody:*:*) echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} exit ;; *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown case $UNAME_PROCESSOR in unknown) UNAME_PROCESSOR=powerpc ;; esac echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} exit ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` if test "$UNAME_PROCESSOR" = "x86"; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} exit ;; *:QNX:*:4*) echo i386-pc-qnx exit ;; NSE-?:NONSTOP_KERNEL:*:*) echo nse-tandem-nsk${UNAME_RELEASE} exit ;; NSR-?:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk${UNAME_RELEASE} exit ;; *:NonStop-UX:*:*) echo mips-compaq-nonstopux exit ;; BS2000:POSIX*:*:*) echo bs2000-siemens-sysv exit ;; DS/*:UNIX_System_V:*:*) echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} exit ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems. if test "$cputype" = "386"; then UNAME_MACHINE=i386 else UNAME_MACHINE="$cputype" fi echo ${UNAME_MACHINE}-unknown-plan9 exit ;; *:TOPS-10:*:*) echo pdp10-unknown-tops10 exit ;; *:TENEX:*:*) echo pdp10-unknown-tenex exit ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) echo pdp10-dec-tops20 exit ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) echo pdp10-xkl-tops20 exit ;; *:TOPS-20:*:*) echo pdp10-unknown-tops20 exit ;; *:ITS:*:*) echo pdp10-unknown-its exit ;; SEI:*:*:SEIUX) echo mips-sei-seiux${UNAME_RELEASE} exit ;; *:DragonFly:*:*) echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit ;; *:*VMS:*:*) UNAME_MACHINE=`(uname -p) 2>/dev/null` case "${UNAME_MACHINE}" in A*) echo alpha-dec-vms ; exit ;; I*) echo ia64-dec-vms ; exit ;; V*) echo vax-dec-vms ; exit ;; esac ;; *:XENIX:*:SysV) echo i386-pc-xenix exit ;; i*86:skyos:*:*) echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' exit ;; i*86:rdos:*:*) echo ${UNAME_MACHINE}-pc-rdos exit ;; i*86:AROS:*:*) echo ${UNAME_MACHINE}-pc-aros exit ;; esac #echo '(No uname command or uname output not recognized.)' 1>&2 #echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 eval $set_cc_for_build cat >$dummy.c < # include #endif main () { #if defined (sony) #if defined (MIPSEB) /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, I don't know.... */ printf ("mips-sony-bsd\n"); exit (0); #else #include printf ("m68k-sony-newsos%s\n", #ifdef NEWSOS4 "4" #else "" #endif ); exit (0); #endif #endif #if defined (__arm) && defined (__acorn) && defined (__unix) printf ("arm-acorn-riscix\n"); exit (0); #endif #if defined (hp300) && !defined (hpux) printf ("m68k-hp-bsd\n"); exit (0); #endif #if defined (NeXT) #if !defined (__ARCHITECTURE__) #define __ARCHITECTURE__ "m68k" #endif int version; version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; if (version < 4) printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); else printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); exit (0); #endif #if defined (MULTIMAX) || defined (n16) #if defined (UMAXV) printf ("ns32k-encore-sysv\n"); exit (0); #else #if defined (CMU) printf ("ns32k-encore-mach\n"); exit (0); #else printf ("ns32k-encore-bsd\n"); exit (0); #endif #endif #endif #if defined (__386BSD__) printf ("i386-pc-bsd\n"); exit (0); #endif #if defined (sequent) #if defined (i386) printf ("i386-sequent-dynix\n"); exit (0); #endif #if defined (ns32000) printf ("ns32k-sequent-dynix\n"); exit (0); #endif #endif #if defined (_SEQUENT_) struct utsname un; uname(&un); if (strncmp(un.version, "V2", 2) == 0) { printf ("i386-sequent-ptx2\n"); exit (0); } if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ printf ("i386-sequent-ptx1\n"); exit (0); } printf ("i386-sequent-ptx\n"); exit (0); #endif #if defined (vax) # if !defined (ultrix) # include # if defined (BSD) # if BSD == 43 printf ("vax-dec-bsd4.3\n"); exit (0); # else # if BSD == 199006 printf ("vax-dec-bsd4.3reno\n"); exit (0); # else printf ("vax-dec-bsd\n"); exit (0); # endif # endif # else printf ("vax-dec-bsd\n"); exit (0); # endif # else printf ("vax-dec-ultrix\n"); exit (0); # endif #endif #if defined (alliant) && defined (i860) printf ("i860-alliant-bsd\n"); exit (0); #endif exit (1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } # Apollos put the system type in the environment. test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } # Convex versions that predate uname can use getsysinfo(1) if [ -x /usr/convex/getsysinfo ] then case `getsysinfo -f cpu_type` in c1*) echo c1-convex-bsd exit ;; c2*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; c34*) echo c34-convex-bsd exit ;; c38*) echo c38-convex-bsd exit ;; c4*) echo c4-convex-bsd exit ;; esac fi cat >&2 < in order to provide the needed information to handle your system. config.guess timestamp = $timestamp uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` /bin/uname -X = `(/bin/uname -X) 2>/dev/null` hostinfo = `(hostinfo) 2>/dev/null` /bin/universe = `(/bin/universe) 2>/dev/null` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` /bin/arch = `(/bin/arch) 2>/dev/null` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` UNAME_MACHINE = ${UNAME_MACHINE} UNAME_RELEASE = ${UNAME_RELEASE} UNAME_SYSTEM = ${UNAME_SYSTEM} UNAME_VERSION = ${UNAME_VERSION} EOF exit 1 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: wxedid-0.0.32/build-aux/install-sh0000755000175000017500000003577614722720160013722 00000000000000#!/bin/sh # install - install a program, script, or datafile scriptversion=2020-11-14.01; # UTC # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the # following copyright and license. # # Copyright (C) 1994 X Consortium # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or # sell copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- # TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # # Except as contained in this notice, the name of the X Consortium shall not # be used in advertising or otherwise to promote the sale, use or other deal- # ings in this Software without prior written authorization from the X Consor- # tium. # # # FSF changes to this file are in the public domain. # # Calling this script install-sh is preferred over install.sh, to prevent # 'make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. tab=' ' nl=' ' IFS=" $tab$nl" # Set DOITPROG to "echo" to test this script. doit=${DOITPROG-} doit_exec=${doit:-exec} # Put in absolute file names if you don't have them in your path; # or use environment vars. chgrpprog=${CHGRPPROG-chgrp} chmodprog=${CHMODPROG-chmod} chownprog=${CHOWNPROG-chown} cmpprog=${CMPPROG-cmp} cpprog=${CPPROG-cp} mkdirprog=${MKDIRPROG-mkdir} mvprog=${MVPROG-mv} rmprog=${RMPROG-rm} stripprog=${STRIPPROG-strip} posix_mkdir= # Desired mode of installed file. mode=0755 # Create dirs (including intermediate dirs) using mode 755. # This is like GNU 'install' as of coreutils 8.32 (2020). mkdir_umask=22 backupsuffix= chgrpcmd= chmodcmd=$chmodprog chowncmd= mvcmd=$mvprog rmcmd="$rmprog -f" stripcmd= src= dst= dir_arg= dst_arg= copy_on_change=false is_target_a_directory=possibly usage="\ Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE or: $0 [OPTION]... SRCFILES... DIRECTORY or: $0 [OPTION]... -t DIRECTORY SRCFILES... or: $0 [OPTION]... -d DIRECTORIES... In the 1st form, copy SRCFILE to DSTFILE. In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. In the 4th, create DIRECTORIES. Options: --help display this help and exit. --version display version info and exit. -c (ignored) -C install only if different (preserve data modification time) -d create directories instead of installing files. -g GROUP $chgrpprog installed files to GROUP. -m MODE $chmodprog installed files to MODE. -o USER $chownprog installed files to USER. -p pass -p to $cpprog. -s $stripprog installed files. -S SUFFIX attempt to back up existing files, with suffix SUFFIX. -t DIRECTORY install into DIRECTORY. -T report an error if DSTFILE is a directory. Environment variables override the default commands: CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG By default, rm is invoked with -f; when overridden with RMPROG, it's up to you to specify -f if you want it. If -S is not specified, no backups are attempted. Email bug reports to bug-automake@gnu.org. Automake home page: https://www.gnu.org/software/automake/ " while test $# -ne 0; do case $1 in -c) ;; -C) copy_on_change=true;; -d) dir_arg=true;; -g) chgrpcmd="$chgrpprog $2" shift;; --help) echo "$usage"; exit $?;; -m) mode=$2 case $mode in *' '* | *"$tab"* | *"$nl"* | *'*'* | *'?'* | *'['*) echo "$0: invalid mode: $mode" >&2 exit 1;; esac shift;; -o) chowncmd="$chownprog $2" shift;; -p) cpprog="$cpprog -p";; -s) stripcmd=$stripprog;; -S) backupsuffix="$2" shift;; -t) is_target_a_directory=always dst_arg=$2 # Protect names problematic for 'test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac shift;; -T) is_target_a_directory=never;; --version) echo "$0 $scriptversion"; exit $?;; --) shift break;; -*) echo "$0: invalid option: $1" >&2 exit 1;; *) break;; esac shift done # We allow the use of options -d and -T together, by making -d # take the precedence; this is for compatibility with GNU install. if test -n "$dir_arg"; then if test -n "$dst_arg"; then echo "$0: target directory not allowed when installing a directory." >&2 exit 1 fi fi if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then # When -d is used, all remaining arguments are directories to create. # When -t is used, the destination is already specified. # Otherwise, the last argument is the destination. Remove it from $@. for arg do if test -n "$dst_arg"; then # $@ is not empty: it contains at least $arg. set fnord "$@" "$dst_arg" shift # fnord fi shift # arg dst_arg=$arg # Protect names problematic for 'test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac done fi if test $# -eq 0; then if test -z "$dir_arg"; then echo "$0: no input file specified." >&2 exit 1 fi # It's OK to call 'install-sh -d' without argument. # This can happen when creating conditional directories. exit 0 fi if test -z "$dir_arg"; then if test $# -gt 1 || test "$is_target_a_directory" = always; then if test ! -d "$dst_arg"; then echo "$0: $dst_arg: Is not a directory." >&2 exit 1 fi fi fi if test -z "$dir_arg"; then do_exit='(exit $ret); exit $ret' trap "ret=129; $do_exit" 1 trap "ret=130; $do_exit" 2 trap "ret=141; $do_exit" 13 trap "ret=143; $do_exit" 15 # Set umask so as not to create temps with too-generous modes. # However, 'strip' requires both read and write access to temps. case $mode in # Optimize common cases. *644) cp_umask=133;; *755) cp_umask=22;; *[0-7]) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw='% 200' fi cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; *) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw=,u+rw fi cp_umask=$mode$u_plus_rw;; esac fi for src do # Protect names problematic for 'test' and other utilities. case $src in -* | [=\(\)!]) src=./$src;; esac if test -n "$dir_arg"; then dst=$src dstdir=$dst test -d "$dstdir" dstdir_status=$? # Don't chown directories that already exist. if test $dstdir_status = 0; then chowncmd="" fi else # Waiting for this to be detected by the "$cpprog $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if test ! -f "$src" && test ! -d "$src"; then echo "$0: $src does not exist." >&2 exit 1 fi if test -z "$dst_arg"; then echo "$0: no destination specified." >&2 exit 1 fi dst=$dst_arg # If destination is a directory, append the input filename. if test -d "$dst"; then if test "$is_target_a_directory" = never; then echo "$0: $dst_arg: Is a directory" >&2 exit 1 fi dstdir=$dst dstbase=`basename "$src"` case $dst in */) dst=$dst$dstbase;; *) dst=$dst/$dstbase;; esac dstdir_status=0 else dstdir=`dirname "$dst"` test -d "$dstdir" dstdir_status=$? fi fi case $dstdir in */) dstdirslash=$dstdir;; *) dstdirslash=$dstdir/;; esac obsolete_mkdir_used=false if test $dstdir_status != 0; then case $posix_mkdir in '') # With -d, create the new directory with the user-specified mode. # Otherwise, rely on $mkdir_umask. if test -n "$dir_arg"; then mkdir_mode=-m$mode else mkdir_mode= fi posix_mkdir=false # The $RANDOM variable is not portable (e.g., dash). Use it # here however when possible just to lower collision chance. tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ trap ' ret=$? rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null exit $ret ' 0 # Because "mkdir -p" follows existing symlinks and we likely work # directly in world-writeable /tmp, make sure that the '$tmpdir' # directory is successfully created first before we actually test # 'mkdir -p'. if (umask $mkdir_umask && $mkdirprog $mkdir_mode "$tmpdir" && exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1 then if test -z "$dir_arg" || { # Check for POSIX incompatibilities with -m. # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or # other-writable bit of parent directory when it shouldn't. # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. test_tmpdir="$tmpdir/a" ls_ld_tmpdir=`ls -ld "$test_tmpdir"` case $ls_ld_tmpdir in d????-?r-*) different_mode=700;; d????-?--*) different_mode=755;; *) false;; esac && $mkdirprog -m$different_mode -p -- "$test_tmpdir" && { ls_ld_tmpdir_1=`ls -ld "$test_tmpdir"` test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" } } then posix_mkdir=: fi rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" else # Remove any dirs left behind by ancient mkdir implementations. rmdir ./$mkdir_mode ./-p ./-- "$tmpdir" 2>/dev/null fi trap '' 0;; esac if $posix_mkdir && ( umask $mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" ) then : else # mkdir does not conform to POSIX, # or it failed possibly due to a race condition. Create the # directory the slow way, step by step, checking for races as we go. case $dstdir in /*) prefix='/';; [-=\(\)!]*) prefix='./';; *) prefix='';; esac oIFS=$IFS IFS=/ set -f set fnord $dstdir shift set +f IFS=$oIFS prefixes= for d do test X"$d" = X && continue prefix=$prefix$d if test -d "$prefix"; then prefixes= else if $posix_mkdir; then (umask $mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break # Don't fail if two instances are running concurrently. test -d "$prefix" || exit 1 else case $prefix in *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; *) qprefix=$prefix;; esac prefixes="$prefixes '$qprefix'" fi fi prefix=$prefix/ done if test -n "$prefixes"; then # Don't fail if two instances are running concurrently. (umask $mkdir_umask && eval "\$doit_exec \$mkdirprog $prefixes") || test -d "$dstdir" || exit 1 obsolete_mkdir_used=true fi fi fi if test -n "$dir_arg"; then { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 else # Make a couple of temp file names in the proper directory. dsttmp=${dstdirslash}_inst.$$_ rmtmp=${dstdirslash}_rm.$$_ # Trap to clean up those temp files at exit. trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 # Copy the file name to the temp name. (umask $cp_umask && { test -z "$stripcmd" || { # Create $dsttmp read-write so that cp doesn't create it read-only, # which would cause strip to fail. if test -z "$doit"; then : >"$dsttmp" # No need to fork-exec 'touch'. else $doit touch "$dsttmp" fi } } && $doit_exec $cpprog "$src" "$dsttmp") && # and set any options; do chmod last to preserve setuid bits. # # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $cpprog $src $dsttmp" command. # { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && # If -C, don't bother to copy if it wouldn't change the file. if $copy_on_change && old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && set -f && set X $old && old=:$2:$4:$5:$6 && set X $new && new=:$2:$4:$5:$6 && set +f && test "$old" = "$new" && $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 then rm -f "$dsttmp" else # If $backupsuffix is set, and the file being installed # already exists, attempt a backup. Don't worry if it fails, # e.g., if mv doesn't support -f. if test -n "$backupsuffix" && test -f "$dst"; then $doit $mvcmd -f "$dst" "$dst$backupsuffix" 2>/dev/null fi # Rename the file to the real destination. $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || # The rename failed, perhaps because mv can't rename something else # to itself, or perhaps because mv is so ancient that it does not # support -f. { # Now remove or move aside any old file at destination location. # We try this two ways since rm can't unlink itself on some # systems and the destination file might be busy for other # reasons. In this case, the final cleanup might fail but the new # file should still install successfully. { test ! -f "$dst" || $doit $rmcmd "$dst" 2>/dev/null || { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && { $doit $rmcmd "$rmtmp" 2>/dev/null; :; } } || { echo "$0: cannot unlink or rename $dst" >&2 (exit 1); exit 1 } } && # Now rename the file to the real destination. $doit $mvcmd "$dsttmp" "$dst" } fi || exit 1 trap '' 0 fi done # Local variables: # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: wxedid-0.0.32/build-aux/ltmain.sh0000755000175000017500000073341514722720160013534 00000000000000# Generated from ltmain.m4sh. # ltmain.sh (GNU libtool) 2.2.6b # Written by Gordon Matzigkeit , 1996 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, 2007 2008 Free Software Foundation, Inc. # This is free software; see the source for copying conditions. There is NO # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # GNU Libtool 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. # # As a special exception to the GNU General Public License, # if you distribute this file as part of a program or library that # is built using GNU Libtool, you may include this file under the # same distribution terms that you use for the rest of that program. # # GNU Libtool 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 GNU Libtool; see the file COPYING. If not, a copy # can be downloaded from http://www.gnu.org/licenses/gpl.html, # or obtained by writing to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # Usage: $progname [OPTION]... [MODE-ARG]... # # Provide generalized library-building support services. # # --config show all configuration variables # --debug enable verbose shell tracing # -n, --dry-run display commands without modifying any files # --features display basic configuration information and exit # --mode=MODE use operation mode MODE # --preserve-dup-deps don't remove duplicate dependency libraries # --quiet, --silent don't print informational messages # --tag=TAG use configuration variables from tag TAG # -v, --verbose print informational messages (default) # --version print version information # -h, --help print short or long help message # # MODE must be one of the following: # # clean remove files from the build directory # compile compile a source file into a libtool object # execute automatically set library path, then run a program # finish complete the installation of libtool libraries # install install libraries or executables # link create a library or an executable # uninstall remove libraries from an installed directory # # MODE-ARGS vary depending on the MODE. # Try `$progname --help --mode=MODE' for a more detailed description of MODE. # # When reporting a bug, please describe a test case to reproduce it and # include the following information: # # host-triplet: $host # shell: $SHELL # compiler: $LTCC # compiler flags: $LTCFLAGS # linker: $LD (gnu? $with_gnu_ld) # $progname: (GNU libtool) 2.2.6b Debian-2.2.6b-2ubuntu1 # automake: $automake_version # autoconf: $autoconf_version # # Report bugs to . PROGRAM=ltmain.sh PACKAGE=libtool VERSION="2.2.6b Debian-2.2.6b-2ubuntu1" TIMESTAMP="" package_revision=1.3017 # Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac fi BIN_SH=xpg4; export BIN_SH # for Tru64 DUALCASE=1; export DUALCASE # for MKS sh # NLS nuisances: We save the old values to restore during execute mode. # Only set LANG and LC_ALL to C if already set. # These must not be set unconditionally because not all systems understand # e.g. LANG=C (notably SCO). lt_user_locale= lt_safe_locale= for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES do eval "if test \"\${$lt_var+set}\" = set; then save_$lt_var=\$$lt_var $lt_var=C export $lt_var lt_user_locale=\"$lt_var=\\\$save_\$lt_var; \$lt_user_locale\" lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\" fi" done $lt_unset CDPATH : ${CP="cp -f"} : ${ECHO="echo"} : ${EGREP="/bin/grep -E"} : ${FGREP="/bin/grep -F"} : ${GREP="/bin/grep"} : ${LN_S="ln -s"} : ${MAKE="make"} : ${MKDIR="mkdir"} : ${MV="mv -f"} : ${RM="rm -f"} : ${SED="/bin/sed"} : ${SHELL="${CONFIG_SHELL-/bin/sh}"} : ${Xsed="$SED -e 1s/^X//"} # Global variables: EXIT_SUCCESS=0 EXIT_FAILURE=1 EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing. EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake. exit_status=$EXIT_SUCCESS # Make sure IFS has a sensible default lt_nl=' ' IFS=" $lt_nl" dirname="s,/[^/]*$,," basename="s,^.*/,," # func_dirname_and_basename file append nondir_replacement # perform func_basename and func_dirname in a single function # call: # dirname: Compute the dirname of FILE. If nonempty, # add APPEND to the result, otherwise set result # to NONDIR_REPLACEMENT. # value returned in "$func_dirname_result" # basename: Compute filename of FILE. # value retuned in "$func_basename_result" # Implementation must be kept synchronized with func_dirname # and func_basename. For efficiency, we do not delegate to # those functions but instead duplicate the functionality here. func_dirname_and_basename () { # Extract subdirectory from the argument. func_dirname_result=`$ECHO "X${1}" | $Xsed -e "$dirname"` if test "X$func_dirname_result" = "X${1}"; then func_dirname_result="${3}" else func_dirname_result="$func_dirname_result${2}" fi func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"` } # Generated shell functions inserted here. # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh # is ksh but when the shell is invoked as "sh" and the current value of # the _XPG environment variable is not equal to 1 (one), the special # positional parameter $0, within a function call, is the name of the # function. progpath="$0" # The name of this program: # In the unlikely event $progname began with a '-', it would play havoc with # func_echo (imagine progname=-n), so we prepend ./ in that case: func_dirname_and_basename "$progpath" progname=$func_basename_result case $progname in -*) progname=./$progname ;; esac # Make sure we have an absolute path for reexecution: case $progpath in [\\/]*|[A-Za-z]:\\*) ;; *[\\/]*) progdir=$func_dirname_result progdir=`cd "$progdir" && pwd` progpath="$progdir/$progname" ;; *) save_IFS="$IFS" IFS=: for progdir in $PATH; do IFS="$save_IFS" test -x "$progdir/$progname" && break done IFS="$save_IFS" test -n "$progdir" || progdir=`pwd` progpath="$progdir/$progname" ;; esac # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. Xsed="${SED}"' -e 1s/^X//' sed_quote_subst='s/\([`"$\\]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\(["`\\]\)/\\\1/g' # Re-`\' parameter expansions in output of double_quote_subst that were # `\'-ed in input to the same. If an odd number of `\' preceded a '$' # in input to double_quote_subst, that '$' was protected from expansion. # Since each input `\' is now two `\'s, look for any number of runs of # four `\'s followed by two `\'s and then a '$'. `\' that '$'. bs='\\' bs2='\\\\' bs4='\\\\\\\\' dollar='\$' sed_double_backslash="\ s/$bs4/&\\ /g s/^$bs2$dollar/$bs&/ s/\\([^$bs]\\)$bs2$dollar/\\1$bs2$bs$dollar/g s/\n//g" # Standard options: opt_dry_run=false opt_help=false opt_quiet=false opt_verbose=false opt_warning=: # func_echo arg... # Echo program name prefixed message, along with the current mode # name if it has been set yet. func_echo () { $ECHO "$progname${mode+: }$mode: $*" } # func_verbose arg... # Echo program name prefixed message in verbose mode only. func_verbose () { $opt_verbose && func_echo ${1+"$@"} # A bug in bash halts the script if the last line of a function # fails when set -e is in force, so we need another command to # work around that: : } # func_error arg... # Echo program name prefixed message to standard error. func_error () { $ECHO "$progname${mode+: }$mode: "${1+"$@"} 1>&2 } # func_warning arg... # Echo program name prefixed warning message to standard error. func_warning () { $opt_warning && $ECHO "$progname${mode+: }$mode: warning: "${1+"$@"} 1>&2 # bash bug again: : } # func_fatal_error arg... # Echo program name prefixed message to standard error, and exit. func_fatal_error () { func_error ${1+"$@"} exit $EXIT_FAILURE } # func_fatal_help arg... # Echo program name prefixed message to standard error, followed by # a help hint, and exit. func_fatal_help () { func_error ${1+"$@"} func_fatal_error "$help" } help="Try \`$progname --help' for more information." ## default # func_grep expression filename # Check whether EXPRESSION matches any line of FILENAME, without output. func_grep () { $GREP "$1" "$2" >/dev/null 2>&1 } # func_mkdir_p directory-path # Make sure the entire path to DIRECTORY-PATH is available. func_mkdir_p () { my_directory_path="$1" my_dir_list= if test -n "$my_directory_path" && test "$opt_dry_run" != ":"; then # Protect directory names starting with `-' case $my_directory_path in -*) my_directory_path="./$my_directory_path" ;; esac # While some portion of DIR does not yet exist... while test ! -d "$my_directory_path"; do # ...make a list in topmost first order. Use a colon delimited # list incase some portion of path contains whitespace. my_dir_list="$my_directory_path:$my_dir_list" # If the last portion added has no slash in it, the list is done case $my_directory_path in */*) ;; *) break ;; esac # ...otherwise throw away the child directory and loop my_directory_path=`$ECHO "X$my_directory_path" | $Xsed -e "$dirname"` done my_dir_list=`$ECHO "X$my_dir_list" | $Xsed -e 's,:*$,,'` save_mkdir_p_IFS="$IFS"; IFS=':' for my_dir in $my_dir_list; do IFS="$save_mkdir_p_IFS" # mkdir can fail with a `File exist' error if two processes # try to create one of the directories concurrently. Don't # stop in that case! $MKDIR "$my_dir" 2>/dev/null || : done IFS="$save_mkdir_p_IFS" # Bail out if we (or some other process) failed to create a directory. test -d "$my_directory_path" || \ func_fatal_error "Failed to create \`$1'" fi } # func_mktempdir [string] # Make a temporary directory that won't clash with other running # libtool processes, and avoids race conditions if possible. If # given, STRING is the basename for that directory. func_mktempdir () { my_template="${TMPDIR-/tmp}/${1-$progname}" if test "$opt_dry_run" = ":"; then # Return a directory name, but don't create it in dry-run mode my_tmpdir="${my_template}-$$" else # If mktemp works, use that first and foremost my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null` if test ! -d "$my_tmpdir"; then # Failing that, at least try and use $RANDOM to avoid a race my_tmpdir="${my_template}-${RANDOM-0}$$" save_mktempdir_umask=`umask` umask 0077 $MKDIR "$my_tmpdir" umask $save_mktempdir_umask fi # If we're not in dry-run mode, bomb out on failure test -d "$my_tmpdir" || \ func_fatal_error "cannot create temporary directory \`$my_tmpdir'" fi $ECHO "X$my_tmpdir" | $Xsed } # func_quote_for_eval arg # Aesthetically quote ARG to be evaled later. # This function returns two values: FUNC_QUOTE_FOR_EVAL_RESULT # is double-quoted, suitable for a subsequent eval, whereas # FUNC_QUOTE_FOR_EVAL_UNQUOTED_RESULT has merely all characters # which are still active within double quotes backslashified. func_quote_for_eval () { case $1 in *[\\\`\"\$]*) func_quote_for_eval_unquoted_result=`$ECHO "X$1" | $Xsed -e "$sed_quote_subst"` ;; *) func_quote_for_eval_unquoted_result="$1" ;; esac case $func_quote_for_eval_unquoted_result in # Double-quote args containing shell metacharacters to delay # word splitting, command substitution and and variable # expansion for a subsequent eval. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") func_quote_for_eval_result="\"$func_quote_for_eval_unquoted_result\"" ;; *) func_quote_for_eval_result="$func_quote_for_eval_unquoted_result" esac } # func_quote_for_expand arg # Aesthetically quote ARG to be evaled later; same as above, # but do not quote variable references. func_quote_for_expand () { case $1 in *[\\\`\"]*) my_arg=`$ECHO "X$1" | $Xsed \ -e "$double_quote_subst" -e "$sed_double_backslash"` ;; *) my_arg="$1" ;; esac case $my_arg in # Double-quote args containing shell metacharacters to delay # word splitting and command substitution for a subsequent eval. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") my_arg="\"$my_arg\"" ;; esac func_quote_for_expand_result="$my_arg" } # func_show_eval cmd [fail_exp] # Unless opt_silent is true, then output CMD. Then, if opt_dryrun is # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP # is given, then evaluate it. func_show_eval () { my_cmd="$1" my_fail_exp="${2-:}" ${opt_silent-false} || { func_quote_for_expand "$my_cmd" eval "func_echo $func_quote_for_expand_result" } if ${opt_dry_run-false}; then :; else eval "$my_cmd" my_status=$? if test "$my_status" -eq 0; then :; else eval "(exit $my_status); $my_fail_exp" fi fi } # func_show_eval_locale cmd [fail_exp] # Unless opt_silent is true, then output CMD. Then, if opt_dryrun is # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP # is given, then evaluate it. Use the saved locale for evaluation. func_show_eval_locale () { my_cmd="$1" my_fail_exp="${2-:}" ${opt_silent-false} || { func_quote_for_expand "$my_cmd" eval "func_echo $func_quote_for_expand_result" } if ${opt_dry_run-false}; then :; else eval "$lt_user_locale $my_cmd" my_status=$? eval "$lt_safe_locale" if test "$my_status" -eq 0; then :; else eval "(exit $my_status); $my_fail_exp" fi fi } # func_version # Echo version message to standard output and exit. func_version () { $SED -n '/^# '$PROGRAM' (GNU /,/# warranty; / { s/^# // s/^# *$// s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/ p }' < "$progpath" exit $? } # func_usage # Echo short help message to standard output and exit. func_usage () { $SED -n '/^# Usage:/,/# -h/ { s/^# // s/^# *$// s/\$progname/'$progname'/ p }' < "$progpath" $ECHO $ECHO "run \`$progname --help | more' for full usage" exit $? } # func_help # Echo long help message to standard output and exit. func_help () { $SED -n '/^# Usage:/,/# Report bugs to/ { s/^# // s/^# *$// s*\$progname*'$progname'* s*\$host*'"$host"'* s*\$SHELL*'"$SHELL"'* s*\$LTCC*'"$LTCC"'* s*\$LTCFLAGS*'"$LTCFLAGS"'* s*\$LD*'"$LD"'* s/\$with_gnu_ld/'"$with_gnu_ld"'/ s/\$automake_version/'"`(automake --version) 2>/dev/null |$SED 1q`"'/ s/\$autoconf_version/'"`(autoconf --version) 2>/dev/null |$SED 1q`"'/ p }' < "$progpath" exit $? } # func_missing_arg argname # Echo program name prefixed message to standard error and set global # exit_cmd. func_missing_arg () { func_error "missing argument for $1" exit_cmd=exit } exit_cmd=: # Check that we have a working $ECHO. if test "X$1" = X--no-reexec; then # Discard the --no-reexec flag, and continue. shift elif test "X$1" = X--fallback-echo; then # Avoid inline document here, it may be left over : elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t'; then # Yippee, $ECHO works! : else # Restart under the correct shell, and then maybe $ECHO will work. exec $SHELL "$progpath" --no-reexec ${1+"$@"} fi if test "X$1" = X--fallback-echo; then # used as fallback echo shift cat </dev/null 2>&1; then taglist="$taglist $tagname" # Evaluate the configuration. Be careful to quote the path # and the sed script, to avoid splitting on whitespace, but # also don't use non-portable quotes within backquotes within # quotes we have to do it in 2 steps: extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"` eval "$extractedcf" else func_error "ignoring unknown tag $tagname" fi ;; esac } # Parse options once, thoroughly. This comes as soon as possible in # the script to make things like `libtool --version' happen quickly. { # Shorthand for --mode=foo, only valid as the first argument case $1 in clean|clea|cle|cl) shift; set dummy --mode clean ${1+"$@"}; shift ;; compile|compil|compi|comp|com|co|c) shift; set dummy --mode compile ${1+"$@"}; shift ;; execute|execut|execu|exec|exe|ex|e) shift; set dummy --mode execute ${1+"$@"}; shift ;; finish|finis|fini|fin|fi|f) shift; set dummy --mode finish ${1+"$@"}; shift ;; install|instal|insta|inst|ins|in|i) shift; set dummy --mode install ${1+"$@"}; shift ;; link|lin|li|l) shift; set dummy --mode link ${1+"$@"}; shift ;; uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u) shift; set dummy --mode uninstall ${1+"$@"}; shift ;; esac # Parse non-mode specific arguments: while test "$#" -gt 0; do opt="$1" shift case $opt in --config) func_config ;; --debug) preserve_args="$preserve_args $opt" func_echo "enabling shell trace mode" opt_debug='set -x' $opt_debug ;; -dlopen) test "$#" -eq 0 && func_missing_arg "$opt" && break execute_dlfiles="$execute_dlfiles $1" shift ;; --dry-run | -n) opt_dry_run=: ;; --features) func_features ;; --finish) mode="finish" ;; --mode) test "$#" -eq 0 && func_missing_arg "$opt" && break case $1 in # Valid mode arguments: clean) ;; compile) ;; execute) ;; finish) ;; install) ;; link) ;; relink) ;; uninstall) ;; # Catch anything else as an error *) func_error "invalid argument for $opt" exit_cmd=exit break ;; esac mode="$1" shift ;; --preserve-dup-deps) opt_duplicate_deps=: ;; --quiet|--silent) preserve_args="$preserve_args $opt" opt_silent=: ;; --verbose| -v) preserve_args="$preserve_args $opt" opt_silent=false ;; --tag) test "$#" -eq 0 && func_missing_arg "$opt" && break preserve_args="$preserve_args $opt $1" func_enable_tag "$1" # tagname is set here shift ;; # Separate optargs to long options: -dlopen=*|--mode=*|--tag=*) func_opt_split "$opt" set dummy "$func_opt_split_opt" "$func_opt_split_arg" ${1+"$@"} shift ;; -\?|-h) func_usage ;; --help) opt_help=: ;; --version) func_version ;; -*) func_fatal_help "unrecognized option \`$opt'" ;; *) nonopt="$opt" break ;; esac done case $host in *cygwin* | *mingw* | *pw32* | *cegcc*) # don't eliminate duplications in $postdeps and $predeps opt_duplicate_compiler_generated_deps=: ;; *) opt_duplicate_compiler_generated_deps=$opt_duplicate_deps ;; esac # Having warned about all mis-specified options, bail out if # anything was wrong. $exit_cmd $EXIT_FAILURE } # func_check_version_match # Ensure that we are using m4 macros, and libtool script from the same # release of libtool. func_check_version_match () { if test "$package_revision" != "$macro_revision"; then if test "$VERSION" != "$macro_version"; then if test -z "$macro_version"; then cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, but the $progname: definition of this LT_INIT comes from an older release. $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION $progname: and run autoconf again. _LT_EOF else cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, but the $progname: definition of this LT_INIT comes from $PACKAGE $macro_version. $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION $progname: and run autoconf again. _LT_EOF fi else cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision, $progname: but the definition of this LT_INIT comes from revision $macro_revision. $progname: You should recreate aclocal.m4 with macros from revision $package_revision $progname: of $PACKAGE $VERSION and run autoconf again. _LT_EOF fi exit $EXIT_MISMATCH fi } ## ----------- ## ## Main. ## ## ----------- ## $opt_help || { # Sanity checks first: func_check_version_match if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then func_fatal_configuration "not configured to build any kind of library" fi test -z "$mode" && func_fatal_error "error: you must specify a MODE." # Darwin sucks eval std_shrext=\"$shrext_cmds\" # Only execute mode is allowed to have -dlopen flags. if test -n "$execute_dlfiles" && test "$mode" != execute; then func_error "unrecognized option \`-dlopen'" $ECHO "$help" 1>&2 exit $EXIT_FAILURE fi # Change the help message to a mode-specific one. generic_help="$help" help="Try \`$progname --help --mode=$mode' for more information." } # func_lalib_p file # True iff FILE is a libtool `.la' library or `.lo' object file. # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_lalib_p () { test -f "$1" && $SED -e 4q "$1" 2>/dev/null \ | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1 } # func_lalib_unsafe_p file # True iff FILE is a libtool `.la' library or `.lo' object file. # This function implements the same check as func_lalib_p without # resorting to external programs. To this end, it redirects stdin and # closes it afterwards, without saving the original file descriptor. # As a safety measure, use it only where a negative result would be # fatal anyway. Works if `file' does not exist. func_lalib_unsafe_p () { lalib_p=no if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then for lalib_p_l in 1 2 3 4 do read lalib_p_line case "$lalib_p_line" in \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;; esac done exec 0<&5 5<&- fi test "$lalib_p" = yes } # func_ltwrapper_script_p file # True iff FILE is a libtool wrapper script # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_script_p () { func_lalib_p "$1" } # func_ltwrapper_executable_p file # True iff FILE is a libtool wrapper executable # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_executable_p () { func_ltwrapper_exec_suffix= case $1 in *.exe) ;; *) func_ltwrapper_exec_suffix=.exe ;; esac $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1 } # func_ltwrapper_scriptname file # Assumes file is an ltwrapper_executable # uses $file to determine the appropriate filename for a # temporary ltwrapper_script. func_ltwrapper_scriptname () { func_ltwrapper_scriptname_result="" if func_ltwrapper_executable_p "$1"; then func_dirname_and_basename "$1" "" "." func_stripname '' '.exe' "$func_basename_result" func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper" fi } # func_ltwrapper_p file # True iff FILE is a libtool wrapper script or wrapper executable # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_p () { func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1" } # func_execute_cmds commands fail_cmd # Execute tilde-delimited COMMANDS. # If FAIL_CMD is given, eval that upon failure. # FAIL_CMD may read-access the current command in variable CMD! func_execute_cmds () { $opt_debug save_ifs=$IFS; IFS='~' for cmd in $1; do IFS=$save_ifs eval cmd=\"$cmd\" func_show_eval "$cmd" "${2-:}" done IFS=$save_ifs } # func_source file # Source FILE, adding directory component if necessary. # Note that it is not necessary on cygwin/mingw to append a dot to # FILE even if both FILE and FILE.exe exist: automatic-append-.exe # behavior happens only for exec(3), not for open(2)! Also, sourcing # `FILE.' does not work on cygwin managed mounts. func_source () { $opt_debug case $1 in */* | *\\*) . "$1" ;; *) . "./$1" ;; esac } # func_infer_tag arg # Infer tagged configuration to use if any are available and # if one wasn't chosen via the "--tag" command line option. # Only attempt this if the compiler in the base compile # command doesn't match the default compiler. # arg is usually of the form 'gcc ...' func_infer_tag () { $opt_debug if test -n "$available_tags" && test -z "$tagname"; then CC_quoted= for arg in $CC; do func_quote_for_eval "$arg" CC_quoted="$CC_quoted $func_quote_for_eval_result" done case $@ in # Blanks in the command may have been stripped by the calling shell, # but not from the CC environment variable when configure was run. " $CC "* | "$CC "* | " `$ECHO $CC` "* | "`$ECHO $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$ECHO $CC_quoted` "* | "`$ECHO $CC_quoted` "*) ;; # Blanks at the start of $base_compile will cause this to fail # if we don't check for them as well. *) for z in $available_tags; do if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then # Evaluate the configuration. eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" CC_quoted= for arg in $CC; do # Double-quote args containing other shell metacharacters. func_quote_for_eval "$arg" CC_quoted="$CC_quoted $func_quote_for_eval_result" done case "$@ " in " $CC "* | "$CC "* | " `$ECHO $CC` "* | "`$ECHO $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$ECHO $CC_quoted` "* | "`$ECHO $CC_quoted` "*) # The compiler in the base compile command matches # the one in the tagged configuration. # Assume this is the tagged configuration we want. tagname=$z break ;; esac fi done # If $tagname still isn't set, then no tagged configuration # was found and let the user know that the "--tag" command # line option must be used. if test -z "$tagname"; then func_echo "unable to infer tagged configuration" func_fatal_error "specify a tag with \`--tag'" # else # func_verbose "using $tagname tagged configuration" fi ;; esac fi } # func_write_libtool_object output_name pic_name nonpic_name # Create a libtool object file (analogous to a ".la" file), # but don't create it if we're doing a dry run. func_write_libtool_object () { write_libobj=${1} if test "$build_libtool_libs" = yes; then write_lobj=\'${2}\' else write_lobj=none fi if test "$build_old_libs" = yes; then write_oldobj=\'${3}\' else write_oldobj=none fi $opt_dry_run || { cat >${write_libobj}T <?"'"'"' &()|`$[]' \ && func_warning "libobj name \`$libobj' may not contain shell special characters." func_dirname_and_basename "$obj" "/" "" objname="$func_basename_result" xdir="$func_dirname_result" lobj=${xdir}$objdir/$objname test -z "$base_compile" && \ func_fatal_help "you must specify a compilation command" # Delete any leftover library objects. if test "$build_old_libs" = yes; then removelist="$obj $lobj $libobj ${libobj}T" else removelist="$lobj $libobj ${libobj}T" fi # On Cygwin there's no "real" PIC flag so we must build both object types case $host_os in cygwin* | mingw* | pw32* | os2* | cegcc*) pic_mode=default ;; esac if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then # non-PIC code in shared libraries is not supported pic_mode=default fi # Calculate the filename of the output object if compiler does # not support -o with -c if test "$compiler_c_o" = no; then output_obj=`$ECHO "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext} lockfile="$output_obj.lock" else output_obj= need_locks=no lockfile= fi # Lock this critical section if it is needed # We use this script file to make the link, it avoids creating a new file if test "$need_locks" = yes; then until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do func_echo "Waiting for $lockfile to be removed" sleep 2 done elif test "$need_locks" = warn; then if test -f "$lockfile"; then $ECHO "\ *** ERROR, $lockfile exists and contains: `cat $lockfile 2>/dev/null` This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi removelist="$removelist $output_obj" $ECHO "$srcfile" > "$lockfile" fi $opt_dry_run || $RM $removelist removelist="$removelist $lockfile" trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15 if test -n "$fix_srcfile_path"; then eval srcfile=\"$fix_srcfile_path\" fi func_quote_for_eval "$srcfile" qsrcfile=$func_quote_for_eval_result # Only build a PIC object if we are building libtool libraries. if test "$build_libtool_libs" = yes; then # Without this assignment, base_compile gets emptied. fbsd_hideous_sh_bug=$base_compile if test "$pic_mode" != no; then command="$base_compile $qsrcfile $pic_flag" else # Don't build PIC code command="$base_compile $qsrcfile" fi func_mkdir_p "$xdir$objdir" if test -z "$output_obj"; then # Place PIC objects in $objdir command="$command -o $lobj" fi func_show_eval_locale "$command" \ 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE' if test "$need_locks" = warn && test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then $ECHO "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi # Just move the object if needed, then go on to compile the next one if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then func_show_eval '$MV "$output_obj" "$lobj"' \ 'error=$?; $opt_dry_run || $RM $removelist; exit $error' fi # Allow error messages only from the first compilation. if test "$suppress_opt" = yes; then suppress_output=' >/dev/null 2>&1' fi fi # Only build a position-dependent object if we build old libraries. if test "$build_old_libs" = yes; then if test "$pic_mode" != yes; then # Don't build PIC code command="$base_compile $qsrcfile$pie_flag" else command="$base_compile $qsrcfile $pic_flag" fi if test "$compiler_c_o" = yes; then command="$command -o $obj" fi # Suppress compiler output if we already did a PIC compilation. command="$command$suppress_output" func_show_eval_locale "$command" \ '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' if test "$need_locks" = warn && test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then $ECHO "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi # Just move the object if needed if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then func_show_eval '$MV "$output_obj" "$obj"' \ 'error=$?; $opt_dry_run || $RM $removelist; exit $error' fi fi $opt_dry_run || { func_write_libtool_object "$libobj" "$objdir/$objname" "$objname" # Unlock the critical section if it was locked if test "$need_locks" != no; then removelist=$lockfile $RM "$lockfile" fi } exit $EXIT_SUCCESS } $opt_help || { test "$mode" = compile && func_mode_compile ${1+"$@"} } func_mode_help () { # We need to display help for each of the modes. case $mode in "") # Generic help is extracted from the usage comments # at the start of this file. func_help ;; clean) $ECHO \ "Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE... Remove files from the build directory. RM is the name of the program to use to delete files associated with each FILE (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed to RM. If FILE is a libtool library, object or program, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; compile) $ECHO \ "Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE Compile a source file into a libtool library object. This mode accepts the following additional options: -o OUTPUT-FILE set the output file name to OUTPUT-FILE -no-suppress do not suppress compiler output for multiple passes -prefer-pic try to building PIC objects only -prefer-non-pic try to building non-PIC objects only -shared do not build a \`.o' file suitable for static linking -static only build a \`.o' file suitable for static linking COMPILE-COMMAND is a command to be used in creating a \`standard' object file from the given SOURCEFILE. The output file name is determined by removing the directory component from SOURCEFILE, then substituting the C source code suffix \`.c' with the library object suffix, \`.lo'." ;; execute) $ECHO \ "Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]... Automatically set library path, then run a program. This mode accepts the following additional options: -dlopen FILE add the directory containing FILE to the library path This mode sets the library path environment variable according to \`-dlopen' flags. If any of the ARGS are libtool executable wrappers, then they are translated into their corresponding uninstalled binary, and any of their required library directories are added to the library path. Then, COMMAND is executed, with ARGS as arguments." ;; finish) $ECHO \ "Usage: $progname [OPTION]... --mode=finish [LIBDIR]... Complete the installation of libtool libraries. Each LIBDIR is a directory that contains libtool libraries. The commands that this mode executes may require superuser privileges. Use the \`--dry-run' option if you just want to see what would be executed." ;; install) $ECHO \ "Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND... Install executables or libraries. INSTALL-COMMAND is the installation command. The first component should be either the \`install' or \`cp' program. The following components of INSTALL-COMMAND are treated specially: -inst-prefix PREFIX-DIR Use PREFIX-DIR as a staging area for installation The rest of the components are interpreted as arguments to that command (only BSD-compatible install options are recognized)." ;; link) $ECHO \ "Usage: $progname [OPTION]... --mode=link LINK-COMMAND... Link object files or libraries together to form another library, or to create an executable program. LINK-COMMAND is a command using the C compiler that you would use to create a program from several object files. The following components of LINK-COMMAND are treated specially: -all-static do not do any dynamic linking at all -avoid-version do not add a version suffix if possible -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) -export-symbols SYMFILE try to export only the symbols listed in SYMFILE -export-symbols-regex REGEX try to export only the symbols matching REGEX -LLIBDIR search LIBDIR for required installed libraries -lNAME OUTPUT-FILE requires the installed library libNAME -module build a library that can dlopened -no-fast-install disable the fast-install mode -no-install link a not-installable executable -no-undefined declare that a library does not refer to external symbols -o OUTPUT-FILE create OUTPUT-FILE from the specified objects -objectlist FILE Use a list of object files found in FILE to specify objects -precious-files-regex REGEX don't remove output files matching REGEX -release RELEASE specify package release information -rpath LIBDIR the created library will eventually be installed in LIBDIR -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries -shared only do dynamic linking of libtool libraries -shrext SUFFIX override the standard shared library file extension -static do not do any dynamic linking of uninstalled libtool libraries -static-libtool-libs do not do any dynamic linking of libtool libraries -version-info CURRENT[:REVISION[:AGE]] specify library version info [each variable defaults to 0] -weak LIBNAME declare that the target provides the LIBNAME interface All other options (arguments beginning with \`-') are ignored. Every other argument is treated as a filename. Files ending in \`.la' are treated as uninstalled libtool libraries, other files are standard or library object files. If the OUTPUT-FILE ends in \`.la', then a libtool library is created, only library objects (\`.lo' files) may be specified, and \`-rpath' is required, except when creating a convenience library. If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created using \`ar' and \`ranlib', or on Windows using \`lib'. If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file is created, otherwise an executable program is created." ;; uninstall) $ECHO \ "Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... Remove libraries from an installation directory. RM is the name of the program to use to delete files associated with each FILE (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed to RM. If FILE is a libtool library, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; *) func_fatal_help "invalid operation mode \`$mode'" ;; esac $ECHO $ECHO "Try \`$progname --help' for more information about other modes." exit $? } # Now that we've collected a possible --mode arg, show help if necessary $opt_help && func_mode_help # func_mode_execute arg... func_mode_execute () { $opt_debug # The first argument is the command name. cmd="$nonopt" test -z "$cmd" && \ func_fatal_help "you must specify a COMMAND" # Handle -dlopen flags immediately. for file in $execute_dlfiles; do test -f "$file" \ || func_fatal_help "\`$file' is not a file" dir= case $file in *.la) # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$file" \ || func_fatal_help "\`$lib' is not a valid libtool archive" # Read the libtool library. dlname= library_names= func_source "$file" # Skip this library if it cannot be dlopened. if test -z "$dlname"; then # Warn if it was a shared library. test -n "$library_names" && \ func_warning "\`$file' was not linked with \`-export-dynamic'" continue fi func_dirname "$file" "" "." dir="$func_dirname_result" if test -f "$dir/$objdir/$dlname"; then dir="$dir/$objdir" else if test ! -f "$dir/$dlname"; then func_fatal_error "cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" fi fi ;; *.lo) # Just add the directory containing the .lo file. func_dirname "$file" "" "." dir="$func_dirname_result" ;; *) func_warning "\`-dlopen' is ignored for non-libtool libraries and objects" continue ;; esac # Get the absolute pathname. absdir=`cd "$dir" && pwd` test -n "$absdir" && dir="$absdir" # Now add the directory to shlibpath_var. if eval "test -z \"\$$shlibpath_var\""; then eval "$shlibpath_var=\"\$dir\"" else eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" fi done # This variable tells wrapper scripts just to set shlibpath_var # rather than running their programs. libtool_execute_magic="$magic" # Check if any of the arguments is a wrapper script. args= for file do case $file in -*) ;; *) # Do a test to see if this is really a libtool program. if func_ltwrapper_script_p "$file"; then func_source "$file" # Transform arg to wrapped name. file="$progdir/$program" elif func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" func_source "$func_ltwrapper_scriptname_result" # Transform arg to wrapped name. file="$progdir/$program" fi ;; esac # Quote arguments (to preserve shell metacharacters). func_quote_for_eval "$file" args="$args $func_quote_for_eval_result" done if test "X$opt_dry_run" = Xfalse; then if test -n "$shlibpath_var"; then # Export the shlibpath_var. eval "export $shlibpath_var" fi # Restore saved environment variables for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES do eval "if test \"\${save_$lt_var+set}\" = set; then $lt_var=\$save_$lt_var; export $lt_var else $lt_unset $lt_var fi" done # Now prepare to actually exec the command. exec_cmd="\$cmd$args" else # Display what would be done. if test -n "$shlibpath_var"; then eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\"" $ECHO "export $shlibpath_var" fi $ECHO "$cmd$args" exit $EXIT_SUCCESS fi } test "$mode" = execute && func_mode_execute ${1+"$@"} # func_mode_finish arg... func_mode_finish () { $opt_debug libdirs="$nonopt" admincmds= if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then for dir do libdirs="$libdirs $dir" done for libdir in $libdirs; do if test -n "$finish_cmds"; then # Do each command in the finish commands. func_execute_cmds "$finish_cmds" 'admincmds="$admincmds '"$cmd"'"' fi if test -n "$finish_eval"; then # Do the single finish_eval. eval cmds=\"$finish_eval\" $opt_dry_run || eval "$cmds" || admincmds="$admincmds $cmds" fi done fi # Exit here if they wanted silent mode. $opt_silent && exit $EXIT_SUCCESS $ECHO "X----------------------------------------------------------------------" | $Xsed $ECHO "Libraries have been installed in:" for libdir in $libdirs; do $ECHO " $libdir" done $ECHO $ECHO "If you ever happen to want to link against installed libraries" $ECHO "in a given directory, LIBDIR, you must either use libtool, and" $ECHO "specify the full pathname of the library, or use the \`-LLIBDIR'" $ECHO "flag during linking and do at least one of the following:" if test -n "$shlibpath_var"; then $ECHO " - add LIBDIR to the \`$shlibpath_var' environment variable" $ECHO " during execution" fi if test -n "$runpath_var"; then $ECHO " - add LIBDIR to the \`$runpath_var' environment variable" $ECHO " during linking" fi if test -n "$hardcode_libdir_flag_spec"; then libdir=LIBDIR eval flag=\"$hardcode_libdir_flag_spec\" $ECHO " - use the \`$flag' linker flag" fi if test -n "$admincmds"; then $ECHO " - have your system administrator run these commands:$admincmds" fi if test -f /etc/ld.so.conf; then $ECHO " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'" fi $ECHO $ECHO "See any operating system documentation about shared libraries for" case $host in solaris2.[6789]|solaris2.1[0-9]) $ECHO "more information, such as the ld(1), crle(1) and ld.so(8) manual" $ECHO "pages." ;; *) $ECHO "more information, such as the ld(1) and ld.so(8) manual pages." ;; esac $ECHO "X----------------------------------------------------------------------" | $Xsed exit $EXIT_SUCCESS } test "$mode" = finish && func_mode_finish ${1+"$@"} # func_mode_install arg... func_mode_install () { $opt_debug # There may be an optional sh(1) argument at the beginning of # install_prog (especially on Windows NT). if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh || # Allow the use of GNU shtool's install command. $ECHO "X$nonopt" | $GREP shtool >/dev/null; then # Aesthetically quote it. func_quote_for_eval "$nonopt" install_prog="$func_quote_for_eval_result " arg=$1 shift else install_prog= arg=$nonopt fi # The real first argument should be the name of the installation program. # Aesthetically quote it. func_quote_for_eval "$arg" install_prog="$install_prog$func_quote_for_eval_result" # We need to accept at least all the BSD install flags. dest= files= opts= prev= install_type= isdir=no stripme= for arg do if test -n "$dest"; then files="$files $dest" dest=$arg continue fi case $arg in -d) isdir=yes ;; -f) case " $install_prog " in *[\\\ /]cp\ *) ;; *) prev=$arg ;; esac ;; -g | -m | -o) prev=$arg ;; -s) stripme=" -s" continue ;; -*) ;; *) # If the previous option needed an argument, then skip it. if test -n "$prev"; then prev= else dest=$arg continue fi ;; esac # Aesthetically quote the argument. func_quote_for_eval "$arg" install_prog="$install_prog $func_quote_for_eval_result" done test -z "$install_prog" && \ func_fatal_help "you must specify an install program" test -n "$prev" && \ func_fatal_help "the \`$prev' option requires an argument" if test -z "$files"; then if test -z "$dest"; then func_fatal_help "no file or destination specified" else func_fatal_help "you must specify a destination" fi fi # Strip any trailing slash from the destination. func_stripname '' '/' "$dest" dest=$func_stripname_result # Check to see that the destination is a directory. test -d "$dest" && isdir=yes if test "$isdir" = yes; then destdir="$dest" destname= else func_dirname_and_basename "$dest" "" "." destdir="$func_dirname_result" destname="$func_basename_result" # Not a directory, so check to see that there is only one file specified. set dummy $files; shift test "$#" -gt 1 && \ func_fatal_help "\`$dest' is not a directory" fi case $destdir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) for file in $files; do case $file in *.lo) ;; *) func_fatal_help "\`$destdir' must be an absolute directory name" ;; esac done ;; esac # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic="$magic" staticlibs= future_libdirs= current_libdirs= for file in $files; do # Do each installation. case $file in *.$libext) # Do the static libraries later. staticlibs="$staticlibs $file" ;; *.la) # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$file" \ || func_fatal_help "\`$file' is not a valid libtool archive" library_names= old_library= relink_command= func_source "$file" # Add the libdir to current_libdirs if it is the destination. if test "X$destdir" = "X$libdir"; then case "$current_libdirs " in *" $libdir "*) ;; *) current_libdirs="$current_libdirs $libdir" ;; esac else # Note the libdir as a future libdir. case "$future_libdirs " in *" $libdir "*) ;; *) future_libdirs="$future_libdirs $libdir" ;; esac fi func_dirname "$file" "/" "" dir="$func_dirname_result" dir="$dir$objdir" if test -n "$relink_command"; then # Determine the prefix the user has applied to our future dir. inst_prefix_dir=`$ECHO "X$destdir" | $Xsed -e "s%$libdir\$%%"` # Don't allow the user to place us outside of our expected # location b/c this prevents finding dependent libraries that # are installed to the same prefix. # At present, this check doesn't affect windows .dll's that # are installed into $libdir/../bin (currently, that works fine) # but it's something to keep an eye on. test "$inst_prefix_dir" = "$destdir" && \ func_fatal_error "error: cannot install \`$file' to a directory not ending in $libdir" if test -n "$inst_prefix_dir"; then # Stick the inst_prefix_dir data into the link command. relink_command=`$ECHO "X$relink_command" | $Xsed -e "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` else relink_command=`$ECHO "X$relink_command" | $Xsed -e "s%@inst_prefix_dir@%%"` fi func_warning "relinking \`$file'" func_show_eval "$relink_command" \ 'func_fatal_error "error: relink \`$file'\'' with the above command before installing it"' fi # See the names of the shared library. set dummy $library_names; shift if test -n "$1"; then realname="$1" shift srcname="$realname" test -n "$relink_command" && srcname="$realname"T # Install the shared library and build the symlinks. func_show_eval "$install_prog $dir/$srcname $destdir/$realname" \ 'exit $?' tstripme="$stripme" case $host_os in cygwin* | mingw* | pw32* | cegcc*) case $realname in *.dll.a) tstripme="" ;; esac ;; esac if test -n "$tstripme" && test -n "$striplib"; then func_show_eval "$striplib $destdir/$realname" 'exit $?' fi if test "$#" -gt 0; then # Delete the old symlinks, and create new ones. # Try `ln -sf' first, because the `ln' binary might depend on # the symlink we replace! Solaris /bin/ln does not understand -f, # so we also need to try rm && ln -s. for linkname do test "$linkname" != "$realname" \ && func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })" done fi # Do each command in the postinstall commands. lib="$destdir/$realname" func_execute_cmds "$postinstall_cmds" 'exit $?' fi # Install the pseudo-library for information purposes. func_basename "$file" name="$func_basename_result" instname="$dir/$name"i func_show_eval "$install_prog $instname $destdir/$name" 'exit $?' # Maybe install the static library, too. test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library" ;; *.lo) # Install (i.e. copy) a libtool object. # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile="$destdir/$destname" else func_basename "$file" destfile="$func_basename_result" destfile="$destdir/$destfile" fi # Deduce the name of the destination old-style object file. case $destfile in *.lo) func_lo2o "$destfile" staticdest=$func_lo2o_result ;; *.$objext) staticdest="$destfile" destfile= ;; *) func_fatal_help "cannot copy a libtool object to \`$destfile'" ;; esac # Install the libtool object if requested. test -n "$destfile" && \ func_show_eval "$install_prog $file $destfile" 'exit $?' # Install the old object if enabled. if test "$build_old_libs" = yes; then # Deduce the name of the old-style object file. func_lo2o "$file" staticobj=$func_lo2o_result func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?' fi exit $EXIT_SUCCESS ;; *) # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile="$destdir/$destname" else func_basename "$file" destfile="$func_basename_result" destfile="$destdir/$destfile" fi # If the file is missing, and there is a .exe on the end, strip it # because it is most likely a libtool script we actually want to # install stripped_ext="" case $file in *.exe) if test ! -f "$file"; then func_stripname '' '.exe' "$file" file=$func_stripname_result stripped_ext=".exe" fi ;; esac # Do a test to see if this is really a libtool program. case $host in *cygwin* | *mingw*) if func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" wrapper=$func_ltwrapper_scriptname_result else func_stripname '' '.exe' "$file" wrapper=$func_stripname_result fi ;; *) wrapper=$file ;; esac if func_ltwrapper_script_p "$wrapper"; then notinst_deplibs= relink_command= func_source "$wrapper" # Check the variables that should have been set. test -z "$generated_by_libtool_version" && \ func_fatal_error "invalid libtool wrapper script \`$wrapper'" finalize=yes for lib in $notinst_deplibs; do # Check to see that each library is installed. libdir= if test -f "$lib"; then func_source "$lib" fi libfile="$libdir/"`$ECHO "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test if test -n "$libdir" && test ! -f "$libfile"; then func_warning "\`$lib' has not been installed in \`$libdir'" finalize=no fi done relink_command= func_source "$wrapper" outputname= if test "$fast_install" = no && test -n "$relink_command"; then $opt_dry_run || { if test "$finalize" = yes; then tmpdir=`func_mktempdir` func_basename "$file$stripped_ext" file="$func_basename_result" outputname="$tmpdir/$file" # Replace the output file specification. relink_command=`$ECHO "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'` $opt_silent || { func_quote_for_expand "$relink_command" eval "func_echo $func_quote_for_expand_result" } if eval "$relink_command"; then : else func_error "error: relink \`$file' with the above command before installing it" $opt_dry_run || ${RM}r "$tmpdir" continue fi file="$outputname" else func_warning "cannot relink \`$file'" fi } else # Install the binary that we compiled earlier. file=`$ECHO "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"` fi fi # remove .exe since cygwin /usr/bin/install will append another # one anyway case $install_prog,$host in */usr/bin/install*,*cygwin*) case $file:$destfile in *.exe:*.exe) # this is ok ;; *.exe:*) destfile=$destfile.exe ;; *:*.exe) func_stripname '' '.exe' "$destfile" destfile=$func_stripname_result ;; esac ;; esac func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?' $opt_dry_run || if test -n "$outputname"; then ${RM}r "$tmpdir" fi ;; esac done for file in $staticlibs; do func_basename "$file" name="$func_basename_result" # Set up the ranlib parameters. oldlib="$destdir/$name" func_show_eval "$install_prog \$file \$oldlib" 'exit $?' if test -n "$stripme" && test -n "$old_striplib"; then func_show_eval "$old_striplib $oldlib" 'exit $?' fi # Do each command in the postinstall commands. func_execute_cmds "$old_postinstall_cmds" 'exit $?' done test -n "$future_libdirs" && \ func_warning "remember to run \`$progname --finish$future_libdirs'" if test -n "$current_libdirs"; then # Maybe just do a dry run. $opt_dry_run && current_libdirs=" -n$current_libdirs" exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs' else exit $EXIT_SUCCESS fi } test "$mode" = install && func_mode_install ${1+"$@"} # func_generate_dlsyms outputname originator pic_p # Extract symbols from dlprefiles and create ${outputname}S.o with # a dlpreopen symbol table. func_generate_dlsyms () { $opt_debug my_outputname="$1" my_originator="$2" my_pic_p="${3-no}" my_prefix=`$ECHO "$my_originator" | sed 's%[^a-zA-Z0-9]%_%g'` my_dlsyms= if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then if test -n "$NM" && test -n "$global_symbol_pipe"; then my_dlsyms="${my_outputname}S.c" else func_error "not configured to extract global symbols from dlpreopened files" fi fi if test -n "$my_dlsyms"; then case $my_dlsyms in "") ;; *.c) # Discover the nlist of each of the dlfiles. nlist="$output_objdir/${my_outputname}.nm" func_show_eval "$RM $nlist ${nlist}S ${nlist}T" # Parse the name list into a source file. func_verbose "creating $output_objdir/$my_dlsyms" $opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\ /* $my_dlsyms - symbol resolution table for \`$my_outputname' dlsym emulation. */ /* Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION */ #ifdef __cplusplus extern \"C\" { #endif /* External symbol declarations for the compiler. */\ " if test "$dlself" = yes; then func_verbose "generating symbol list for \`$output'" $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist" # Add our own program objects to the symbol list. progfiles=`$ECHO "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` for progfile in $progfiles; do func_verbose "extracting global C symbols from \`$progfile'" $opt_dry_run || eval "$NM $progfile | $global_symbol_pipe >> '$nlist'" done if test -n "$exclude_expsyms"; then $opt_dry_run || { eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' } fi if test -n "$export_symbols_regex"; then $opt_dry_run || { eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' } fi # Prepare the list of exported symbols if test -z "$export_symbols"; then export_symbols="$output_objdir/$outputname.exp" $opt_dry_run || { $RM $export_symbols eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' case $host in *cygwin* | *mingw* | *cegcc* ) eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"' ;; esac } else $opt_dry_run || { eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"' eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' case $host in *cygwin | *mingw* | *cegcc* ) eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' eval 'cat "$nlist" >> "$output_objdir/$outputname.def"' ;; esac } fi fi for dlprefile in $dlprefiles; do func_verbose "extracting global C symbols from \`$dlprefile'" func_basename "$dlprefile" name="$func_basename_result" $opt_dry_run || { eval '$ECHO ": $name " >> "$nlist"' eval "$NM $dlprefile 2>/dev/null | $global_symbol_pipe >> '$nlist'" } done $opt_dry_run || { # Make sure we have at least an empty file. test -f "$nlist" || : > "$nlist" if test -n "$exclude_expsyms"; then $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T $MV "$nlist"T "$nlist" fi # Try sorting and uniquifying the output. if $GREP -v "^: " < "$nlist" | if sort -k 3 /dev/null 2>&1; then sort -k 3 else sort +2 fi | uniq > "$nlist"S; then : else $GREP -v "^: " < "$nlist" > "$nlist"S fi if test -f "$nlist"S; then eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"' else $ECHO '/* NONE */' >> "$output_objdir/$my_dlsyms" fi $ECHO >> "$output_objdir/$my_dlsyms" "\ /* The mapping between symbol names and symbols. */ typedef struct { const char *name; void *address; } lt_dlsymlist; " case $host in *cygwin* | *mingw* | *cegcc* ) $ECHO >> "$output_objdir/$my_dlsyms" "\ /* DATA imports from DLLs on WIN32 con't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */" lt_dlsym_const= ;; *osf5*) echo >> "$output_objdir/$my_dlsyms" "\ /* This system does not cope well with relocations in const data */" lt_dlsym_const= ;; *) lt_dlsym_const=const ;; esac $ECHO >> "$output_objdir/$my_dlsyms" "\ extern $lt_dlsym_const lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[]; $lt_dlsym_const lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[] = {\ { \"$my_originator\", (void *) 0 }," case $need_lib_prefix in no) eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms" ;; *) eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms" ;; esac $ECHO >> "$output_objdir/$my_dlsyms" "\ {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt_${my_prefix}_LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif\ " } # !$opt_dry_run pic_flag_for_symtable= case "$compile_command " in *" -static "*) ;; *) case $host in # compiling the symbol table file with pic_flag works around # a FreeBSD bug that causes programs to crash when -lm is # linked before any other PIC object. But we must not use # pic_flag when linking with -static. The problem exists in # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;; *-*-hpux*) pic_flag_for_symtable=" $pic_flag" ;; *) if test "X$my_pic_p" != Xno; then pic_flag_for_symtable=" $pic_flag" fi ;; esac ;; esac symtab_cflags= for arg in $LTCFLAGS; do case $arg in -pie | -fpie | -fPIE) ;; *) symtab_cflags="$symtab_cflags $arg" ;; esac done # Now compile the dynamic symbol file. func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?' # Clean up the generated files. func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T"' # Transform the symbol file into the correct name. symfileobj="$output_objdir/${my_outputname}S.$objext" case $host in *cygwin* | *mingw* | *cegcc* ) if test -f "$output_objdir/$my_outputname.def"; then compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` else compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"` finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"` fi ;; *) compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"` finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"` ;; esac ;; *) func_fatal_error "unknown suffix for \`$my_dlsyms'" ;; esac else # We keep going just in case the user didn't refer to # lt_preloaded_symbols. The linker will fail if global_symbol_pipe # really was required. # Nullify the symbol file. compile_command=`$ECHO "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"` finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"` fi } # func_win32_libid arg # return the library type of file 'arg' # # Need a lot of goo to handle *both* DLLs and import libs # Has to be a shell function in order to 'eat' the argument # that is supplied when $file_magic_command is called. func_win32_libid () { $opt_debug win32_libid_type="unknown" win32_fileres=`file -L $1 2>/dev/null` case $win32_fileres in *ar\ archive\ import\ library*) # definitely import win32_libid_type="x86 archive import" ;; *ar\ archive*) # could be an import, or static if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | $EGREP 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then win32_nmres=`eval $NM -f posix -A $1 | $SED -n -e ' 1,100{ / I /{ s,.*,import, p q } }'` case $win32_nmres in import*) win32_libid_type="x86 archive import";; *) win32_libid_type="x86 archive static";; esac fi ;; *DLL*) win32_libid_type="x86 DLL" ;; *executable*) # but shell scripts are "executable" too... case $win32_fileres in *MS\ Windows\ PE\ Intel*) win32_libid_type="x86 DLL" ;; esac ;; esac $ECHO "$win32_libid_type" } # func_extract_an_archive dir oldlib func_extract_an_archive () { $opt_debug f_ex_an_ar_dir="$1"; shift f_ex_an_ar_oldlib="$1" func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" 'exit $?' if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then : else func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" fi } # func_extract_archives gentop oldlib ... func_extract_archives () { $opt_debug my_gentop="$1"; shift my_oldlibs=${1+"$@"} my_oldobjs="" my_xlib="" my_xabs="" my_xdir="" for my_xlib in $my_oldlibs; do # Extract the objects. case $my_xlib in [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;; *) my_xabs=`pwd`"/$my_xlib" ;; esac func_basename "$my_xlib" my_xlib="$func_basename_result" my_xlib_u=$my_xlib while :; do case " $extracted_archives " in *" $my_xlib_u "*) func_arith $extracted_serial + 1 extracted_serial=$func_arith_result my_xlib_u=lt$extracted_serial-$my_xlib ;; *) break ;; esac done extracted_archives="$extracted_archives $my_xlib_u" my_xdir="$my_gentop/$my_xlib_u" func_mkdir_p "$my_xdir" case $host in *-darwin*) func_verbose "Extracting $my_xabs" # Do not bother doing anything if just a dry run $opt_dry_run || { darwin_orig_dir=`pwd` cd $my_xdir || exit $? darwin_archive=$my_xabs darwin_curdir=`pwd` darwin_base_archive=`basename "$darwin_archive"` darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true` if test -n "$darwin_arches"; then darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'` darwin_arch= func_verbose "$darwin_base_archive has multiple architectures $darwin_arches" for darwin_arch in $darwin_arches ; do func_mkdir_p "unfat-$$/${darwin_base_archive}-${darwin_arch}" $LIPO -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}" cd "unfat-$$/${darwin_base_archive}-${darwin_arch}" func_extract_an_archive "`pwd`" "${darwin_base_archive}" cd "$darwin_curdir" $RM "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" done # $darwin_arches ## Okay now we've a bunch of thin objects, gotta fatten them up :) darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$basename" | sort -u` darwin_file= darwin_files= for darwin_file in $darwin_filelist; do darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP` $LIPO -create -output "$darwin_file" $darwin_files done # $darwin_filelist $RM -rf unfat-$$ cd "$darwin_orig_dir" else cd $darwin_orig_dir func_extract_an_archive "$my_xdir" "$my_xabs" fi # $darwin_arches } # !$opt_dry_run ;; *) func_extract_an_archive "$my_xdir" "$my_xabs" ;; esac my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP` done func_extract_archives_result="$my_oldobjs" } # func_emit_wrapper_part1 [arg=no] # # Emit the first part of a libtool wrapper script on stdout. # For more information, see the description associated with # func_emit_wrapper(), below. func_emit_wrapper_part1 () { func_emit_wrapper_part1_arg1=no if test -n "$1" ; then func_emit_wrapper_part1_arg1=$1 fi $ECHO "\ #! $SHELL # $output - temporary wrapper script for $objdir/$outputname # Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION # # The $output program cannot be directly executed until all the libtool # libraries that it depends on are installed. # # This wrapper script should never be moved out of the build directory. # If it is, it will not operate correctly. # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. Xsed='${SED} -e 1s/^X//' sed_quote_subst='$sed_quote_subst' # Be Bourne compatible if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac fi BIN_SH=xpg4; export BIN_SH # for Tru64 DUALCASE=1; export DUALCASE # for MKS sh # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH relink_command=\"$relink_command\" # This environment variable determines our operation mode. if test \"\$libtool_install_magic\" = \"$magic\"; then # install mode needs the following variables: generated_by_libtool_version='$macro_version' notinst_deplibs='$notinst_deplibs' else # When we are sourced in execute mode, \$file and \$ECHO are already set. if test \"\$libtool_execute_magic\" != \"$magic\"; then ECHO=\"$qecho\" file=\"\$0\" # Make sure echo works. if test \"X\$1\" = X--no-reexec; then # Discard the --no-reexec flag, and continue. shift elif test \"X\`{ \$ECHO '\t'; } 2>/dev/null\`\" = 'X\t'; then # Yippee, \$ECHO works! : else # Restart under the correct shell, and then maybe \$ECHO will work. exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"} fi fi\ " $ECHO "\ # Find the directory that this script lives in. thisdir=\`\$ECHO \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\` test \"x\$thisdir\" = \"x\$file\" && thisdir=. # Follow symbolic links until we get to the real thisdir. file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\` while test -n \"\$file\"; do destdir=\`\$ECHO \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\` # If there was a directory component, then change thisdir. if test \"x\$destdir\" != \"x\$file\"; then case \"\$destdir\" in [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; *) thisdir=\"\$thisdir/\$destdir\" ;; esac fi file=\`\$ECHO \"X\$file\" | \$Xsed -e 's%^.*/%%'\` file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\` done " } # end: func_emit_wrapper_part1 # func_emit_wrapper_part2 [arg=no] # # Emit the second part of a libtool wrapper script on stdout. # For more information, see the description associated with # func_emit_wrapper(), below. func_emit_wrapper_part2 () { func_emit_wrapper_part2_arg1=no if test -n "$1" ; then func_emit_wrapper_part2_arg1=$1 fi $ECHO "\ # Usually 'no', except on cygwin/mingw when embedded into # the cwrapper. WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_part2_arg1 if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then # special case for '.' if test \"\$thisdir\" = \".\"; then thisdir=\`pwd\` fi # remove .libs from thisdir case \"\$thisdir\" in *[\\\\/]$objdir ) thisdir=\`\$ECHO \"X\$thisdir\" | \$Xsed -e 's%[\\\\/][^\\\\/]*$%%'\` ;; $objdir ) thisdir=. ;; esac fi # Try to get the absolute directory name. absdir=\`cd \"\$thisdir\" && pwd\` test -n \"\$absdir\" && thisdir=\"\$absdir\" " if test "$fast_install" = yes; then $ECHO "\ program=lt-'$outputname'$exeext progdir=\"\$thisdir/$objdir\" if test ! -f \"\$progdir/\$program\" || { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\ test \"X\$file\" != \"X\$progdir/\$program\"; }; then file=\"\$\$-\$program\" if test ! -d \"\$progdir\"; then $MKDIR \"\$progdir\" else $RM \"\$progdir/\$file\" fi" $ECHO "\ # relink executable if necessary if test -n \"\$relink_command\"; then if relink_command_output=\`eval \$relink_command 2>&1\`; then : else $ECHO \"\$relink_command_output\" >&2 $RM \"\$progdir/\$file\" exit 1 fi fi $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || { $RM \"\$progdir/\$program\"; $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; } $RM \"\$progdir/\$file\" fi" else $ECHO "\ program='$outputname' progdir=\"\$thisdir/$objdir\" " fi $ECHO "\ if test -f \"\$progdir/\$program\"; then" # Export our shlibpath_var if we have one. if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then $ECHO "\ # Add our own library path to $shlibpath_var $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" # Some systems cannot cope with colon-terminated $shlibpath_var # The second colon is a workaround for a bug in BeOS R4 sed $shlibpath_var=\`\$ECHO \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\` export $shlibpath_var " fi # fixup the dll searchpath if we need to. if test -n "$dllsearchpath"; then $ECHO "\ # Add the dll search path components to the executable PATH PATH=$dllsearchpath:\$PATH " fi $ECHO "\ if test \"\$libtool_execute_magic\" != \"$magic\"; then # Run the actual program with our arguments. " case $host in # Backslashes separate directories on plain windows *-*-mingw | *-*-os2* | *-cegcc*) $ECHO "\ exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} " ;; *) $ECHO "\ exec \"\$progdir/\$program\" \${1+\"\$@\"} " ;; esac $ECHO "\ \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2 exit 1 fi else # The program doesn't exist. \$ECHO \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2 \$ECHO \"This script is just a wrapper for \$program.\" 1>&2 $ECHO \"See the $PACKAGE documentation for more information.\" 1>&2 exit 1 fi fi\ " } # end: func_emit_wrapper_part2 # func_emit_wrapper [arg=no] # # Emit a libtool wrapper script on stdout. # Don't directly open a file because we may want to # incorporate the script contents within a cygwin/mingw # wrapper executable. Must ONLY be called from within # func_mode_link because it depends on a number of variables # set therein. # # ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR # variable will take. If 'yes', then the emitted script # will assume that the directory in which it is stored is # the $objdir directory. This is a cygwin/mingw-specific # behavior. func_emit_wrapper () { func_emit_wrapper_arg1=no if test -n "$1" ; then func_emit_wrapper_arg1=$1 fi # split this up so that func_emit_cwrapperexe_src # can call each part independently. func_emit_wrapper_part1 "${func_emit_wrapper_arg1}" func_emit_wrapper_part2 "${func_emit_wrapper_arg1}" } # func_to_host_path arg # # Convert paths to host format when used with build tools. # Intended for use with "native" mingw (where libtool itself # is running under the msys shell), or in the following cross- # build environments: # $build $host # mingw (msys) mingw [e.g. native] # cygwin mingw # *nix + wine mingw # where wine is equipped with the `winepath' executable. # In the native mingw case, the (msys) shell automatically # converts paths for any non-msys applications it launches, # but that facility isn't available from inside the cwrapper. # Similar accommodations are necessary for $host mingw and # $build cygwin. Calling this function does no harm for other # $host/$build combinations not listed above. # # ARG is the path (on $build) that should be converted to # the proper representation for $host. The result is stored # in $func_to_host_path_result. func_to_host_path () { func_to_host_path_result="$1" if test -n "$1" ; then case $host in *mingw* ) lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' case $build in *mingw* ) # actually, msys # awkward: cmd appends spaces to result lt_sed_strip_trailing_spaces="s/[ ]*\$//" func_to_host_path_tmp1=`( cmd //c echo "$1" |\ $SED -e "$lt_sed_strip_trailing_spaces" ) 2>/dev/null || echo ""` func_to_host_path_result=`echo "$func_to_host_path_tmp1" |\ $SED -e "$lt_sed_naive_backslashify"` ;; *cygwin* ) func_to_host_path_tmp1=`cygpath -w "$1"` func_to_host_path_result=`echo "$func_to_host_path_tmp1" |\ $SED -e "$lt_sed_naive_backslashify"` ;; * ) # Unfortunately, winepath does not exit with a non-zero # error code, so we are forced to check the contents of # stdout. On the other hand, if the command is not # found, the shell will set an exit code of 127 and print # *an error message* to stdout. So we must check for both # error code of zero AND non-empty stdout, which explains # the odd construction: func_to_host_path_tmp1=`winepath -w "$1" 2>/dev/null` if test "$?" -eq 0 && test -n "${func_to_host_path_tmp1}"; then func_to_host_path_result=`echo "$func_to_host_path_tmp1" |\ $SED -e "$lt_sed_naive_backslashify"` else # Allow warning below. func_to_host_path_result="" fi ;; esac if test -z "$func_to_host_path_result" ; then func_error "Could not determine host path corresponding to" func_error " '$1'" func_error "Continuing, but uninstalled executables may not work." # Fallback: func_to_host_path_result="$1" fi ;; esac fi } # end: func_to_host_path # func_to_host_pathlist arg # # Convert pathlists to host format when used with build tools. # See func_to_host_path(), above. This function supports the # following $build/$host combinations (but does no harm for # combinations not listed here): # $build $host # mingw (msys) mingw [e.g. native] # cygwin mingw # *nix + wine mingw # # Path separators are also converted from $build format to # $host format. If ARG begins or ends with a path separator # character, it is preserved (but converted to $host format) # on output. # # ARG is a pathlist (on $build) that should be converted to # the proper representation on $host. The result is stored # in $func_to_host_pathlist_result. func_to_host_pathlist () { func_to_host_pathlist_result="$1" if test -n "$1" ; then case $host in *mingw* ) lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' # Remove leading and trailing path separator characters from # ARG. msys behavior is inconsistent here, cygpath turns them # into '.;' and ';.', and winepath ignores them completely. func_to_host_pathlist_tmp2="$1" # Once set for this call, this variable should not be # reassigned. It is used in tha fallback case. func_to_host_pathlist_tmp1=`echo "$func_to_host_pathlist_tmp2" |\ $SED -e 's|^:*||' -e 's|:*$||'` case $build in *mingw* ) # Actually, msys. # Awkward: cmd appends spaces to result. lt_sed_strip_trailing_spaces="s/[ ]*\$//" func_to_host_pathlist_tmp2=`( cmd //c echo "$func_to_host_pathlist_tmp1" |\ $SED -e "$lt_sed_strip_trailing_spaces" ) 2>/dev/null || echo ""` func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp2" |\ $SED -e "$lt_sed_naive_backslashify"` ;; *cygwin* ) func_to_host_pathlist_tmp2=`cygpath -w -p "$func_to_host_pathlist_tmp1"` func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp2" |\ $SED -e "$lt_sed_naive_backslashify"` ;; * ) # unfortunately, winepath doesn't convert pathlists func_to_host_pathlist_result="" func_to_host_pathlist_oldIFS=$IFS IFS=: for func_to_host_pathlist_f in $func_to_host_pathlist_tmp1 ; do IFS=$func_to_host_pathlist_oldIFS if test -n "$func_to_host_pathlist_f" ; then func_to_host_path "$func_to_host_pathlist_f" if test -n "$func_to_host_path_result" ; then if test -z "$func_to_host_pathlist_result" ; then func_to_host_pathlist_result="$func_to_host_path_result" else func_to_host_pathlist_result="$func_to_host_pathlist_result;$func_to_host_path_result" fi fi fi IFS=: done IFS=$func_to_host_pathlist_oldIFS ;; esac if test -z "$func_to_host_pathlist_result" ; then func_error "Could not determine the host path(s) corresponding to" func_error " '$1'" func_error "Continuing, but uninstalled executables may not work." # Fallback. This may break if $1 contains DOS-style drive # specifications. The fix is not to complicate the expression # below, but for the user to provide a working wine installation # with winepath so that path translation in the cross-to-mingw # case works properly. lt_replace_pathsep_nix_to_dos="s|:|;|g" func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp1" |\ $SED -e "$lt_replace_pathsep_nix_to_dos"` fi # Now, add the leading and trailing path separators back case "$1" in :* ) func_to_host_pathlist_result=";$func_to_host_pathlist_result" ;; esac case "$1" in *: ) func_to_host_pathlist_result="$func_to_host_pathlist_result;" ;; esac ;; esac fi } # end: func_to_host_pathlist # func_emit_cwrapperexe_src # emit the source code for a wrapper executable on stdout # Must ONLY be called from within func_mode_link because # it depends on a number of variable set therein. func_emit_cwrapperexe_src () { cat < #include #ifdef _MSC_VER # include # include # include # define setmode _setmode #else # include # include # ifdef __CYGWIN__ # include # define HAVE_SETENV # ifdef __STRICT_ANSI__ char *realpath (const char *, char *); int putenv (char *); int setenv (const char *, const char *, int); # endif # endif #endif #include #include #include #include #include #include #include #include #if defined(PATH_MAX) # define LT_PATHMAX PATH_MAX #elif defined(MAXPATHLEN) # define LT_PATHMAX MAXPATHLEN #else # define LT_PATHMAX 1024 #endif #ifndef S_IXOTH # define S_IXOTH 0 #endif #ifndef S_IXGRP # define S_IXGRP 0 #endif #ifdef _MSC_VER # define S_IXUSR _S_IEXEC # define stat _stat # ifndef _INTPTR_T_DEFINED # define intptr_t int # endif #endif #ifndef DIR_SEPARATOR # define DIR_SEPARATOR '/' # define PATH_SEPARATOR ':' #endif #if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \ defined (__OS2__) # define HAVE_DOS_BASED_FILE_SYSTEM # define FOPEN_WB "wb" # ifndef DIR_SEPARATOR_2 # define DIR_SEPARATOR_2 '\\' # endif # ifndef PATH_SEPARATOR_2 # define PATH_SEPARATOR_2 ';' # endif #endif #ifndef DIR_SEPARATOR_2 # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR) #else /* DIR_SEPARATOR_2 */ # define IS_DIR_SEPARATOR(ch) \ (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2)) #endif /* DIR_SEPARATOR_2 */ #ifndef PATH_SEPARATOR_2 # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR) #else /* PATH_SEPARATOR_2 */ # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2) #endif /* PATH_SEPARATOR_2 */ #ifdef __CYGWIN__ # define FOPEN_WB "wb" #endif #ifndef FOPEN_WB # define FOPEN_WB "w" #endif #ifndef _O_BINARY # define _O_BINARY 0 #endif #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) #define XFREE(stale) do { \ if (stale) { free ((void *) stale); stale = 0; } \ } while (0) #undef LTWRAPPER_DEBUGPRINTF #if defined DEBUGWRAPPER # define LTWRAPPER_DEBUGPRINTF(args) ltwrapper_debugprintf args static void ltwrapper_debugprintf (const char *fmt, ...) { va_list args; va_start (args, fmt); (void) vfprintf (stderr, fmt, args); va_end (args); } #else # define LTWRAPPER_DEBUGPRINTF(args) #endif const char *program_name = NULL; void *xmalloc (size_t num); char *xstrdup (const char *string); const char *base_name (const char *name); char *find_executable (const char *wrapper); char *chase_symlinks (const char *pathspec); int make_executable (const char *path); int check_executable (const char *path); char *strendzap (char *str, const char *pat); void lt_fatal (const char *message, ...); void lt_setenv (const char *name, const char *value); char *lt_extend_str (const char *orig_value, const char *add, int to_end); void lt_opt_process_env_set (const char *arg); void lt_opt_process_env_prepend (const char *arg); void lt_opt_process_env_append (const char *arg); int lt_split_name_value (const char *arg, char** name, char** value); void lt_update_exe_path (const char *name, const char *value); void lt_update_lib_path (const char *name, const char *value); static const char *script_text_part1 = EOF func_emit_wrapper_part1 yes | $SED -e 's/\([\\"]\)/\\\1/g' \ -e 's/^/ "/' -e 's/$/\\n"/' echo ";" cat <"))); for (i = 0; i < newargc; i++) { LTWRAPPER_DEBUGPRINTF (("(main) newargz[%d] : %s\n", i, (newargz[i] ? newargz[i] : ""))); } EOF case $host_os in mingw*) cat <<"EOF" /* execv doesn't actually work on mingw as expected on unix */ rval = _spawnv (_P_WAIT, lt_argv_zero, (const char * const *) newargz); if (rval == -1) { /* failed to start process */ LTWRAPPER_DEBUGPRINTF (("(main) failed to launch target \"%s\": errno = %d\n", lt_argv_zero, errno)); return 127; } return rval; EOF ;; *) cat <<"EOF" execv (lt_argv_zero, newargz); return rval; /* =127, but avoids unused variable warning */ EOF ;; esac cat <<"EOF" } void * xmalloc (size_t num) { void *p = (void *) malloc (num); if (!p) lt_fatal ("Memory exhausted"); return p; } char * xstrdup (const char *string) { return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL; } const char * base_name (const char *name) { const char *base; #if defined (HAVE_DOS_BASED_FILE_SYSTEM) /* Skip over the disk name in MSDOS pathnames. */ if (isalpha ((unsigned char) name[0]) && name[1] == ':') name += 2; #endif for (base = name; *name; name++) if (IS_DIR_SEPARATOR (*name)) base = name + 1; return base; } int check_executable (const char *path) { struct stat st; LTWRAPPER_DEBUGPRINTF (("(check_executable) : %s\n", path ? (*path ? path : "EMPTY!") : "NULL!")); if ((!path) || (!*path)) return 0; if ((stat (path, &st) >= 0) && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH))) return 1; else return 0; } int make_executable (const char *path) { int rval = 0; struct stat st; LTWRAPPER_DEBUGPRINTF (("(make_executable) : %s\n", path ? (*path ? path : "EMPTY!") : "NULL!")); if ((!path) || (!*path)) return 0; if (stat (path, &st) >= 0) { rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR); } return rval; } /* Searches for the full path of the wrapper. Returns newly allocated full path name if found, NULL otherwise Does not chase symlinks, even on platforms that support them. */ char * find_executable (const char *wrapper) { int has_slash = 0; const char *p; const char *p_next; /* static buffer for getcwd */ char tmp[LT_PATHMAX + 1]; int tmp_len; char *concat_name; LTWRAPPER_DEBUGPRINTF (("(find_executable) : %s\n", wrapper ? (*wrapper ? wrapper : "EMPTY!") : "NULL!")); if ((wrapper == NULL) || (*wrapper == '\0')) return NULL; /* Absolute path? */ #if defined (HAVE_DOS_BASED_FILE_SYSTEM) if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':') { concat_name = xstrdup (wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } else { #endif if (IS_DIR_SEPARATOR (wrapper[0])) { concat_name = xstrdup (wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } #if defined (HAVE_DOS_BASED_FILE_SYSTEM) } #endif for (p = wrapper; *p; p++) if (*p == '/') { has_slash = 1; break; } if (!has_slash) { /* no slashes; search PATH */ const char *path = getenv ("PATH"); if (path != NULL) { for (p = path; *p; p = p_next) { const char *q; size_t p_len; for (q = p; *q; q++) if (IS_PATH_SEPARATOR (*q)) break; p_len = q - p; p_next = (*q == '\0' ? q : q + 1); if (p_len == 0) { /* empty path: current directory */ if (getcwd (tmp, LT_PATHMAX) == NULL) lt_fatal ("getcwd failed"); tmp_len = strlen (tmp); concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, tmp, tmp_len); concat_name[tmp_len] = '/'; strcpy (concat_name + tmp_len + 1, wrapper); } else { concat_name = XMALLOC (char, p_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, p, p_len); concat_name[p_len] = '/'; strcpy (concat_name + p_len + 1, wrapper); } if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } } /* not found in PATH; assume curdir */ } /* Relative path | not found in path: prepend cwd */ if (getcwd (tmp, LT_PATHMAX) == NULL) lt_fatal ("getcwd failed"); tmp_len = strlen (tmp); concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, tmp, tmp_len); concat_name[tmp_len] = '/'; strcpy (concat_name + tmp_len + 1, wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); return NULL; } char * chase_symlinks (const char *pathspec) { #ifndef S_ISLNK return xstrdup (pathspec); #else char buf[LT_PATHMAX]; struct stat s; char *tmp_pathspec = xstrdup (pathspec); char *p; int has_symlinks = 0; while (strlen (tmp_pathspec) && !has_symlinks) { LTWRAPPER_DEBUGPRINTF (("checking path component for symlinks: %s\n", tmp_pathspec)); if (lstat (tmp_pathspec, &s) == 0) { if (S_ISLNK (s.st_mode) != 0) { has_symlinks = 1; break; } /* search backwards for last DIR_SEPARATOR */ p = tmp_pathspec + strlen (tmp_pathspec) - 1; while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) p--; if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) { /* no more DIR_SEPARATORS left */ break; } *p = '\0'; } else { char *errstr = strerror (errno); lt_fatal ("Error accessing file %s (%s)", tmp_pathspec, errstr); } } XFREE (tmp_pathspec); if (!has_symlinks) { return xstrdup (pathspec); } tmp_pathspec = realpath (pathspec, buf); if (tmp_pathspec == 0) { lt_fatal ("Could not follow symlinks for %s", pathspec); } return xstrdup (tmp_pathspec); #endif } char * strendzap (char *str, const char *pat) { size_t len, patlen; assert (str != NULL); assert (pat != NULL); len = strlen (str); patlen = strlen (pat); if (patlen <= len) { str += len - patlen; if (strcmp (str, pat) == 0) *str = '\0'; } return str; } static void lt_error_core (int exit_status, const char *mode, const char *message, va_list ap) { fprintf (stderr, "%s: %s: ", program_name, mode); vfprintf (stderr, message, ap); fprintf (stderr, ".\n"); if (exit_status >= 0) exit (exit_status); } void lt_fatal (const char *message, ...) { va_list ap; va_start (ap, message); lt_error_core (EXIT_FAILURE, "FATAL", message, ap); va_end (ap); } void lt_setenv (const char *name, const char *value) { LTWRAPPER_DEBUGPRINTF (("(lt_setenv) setting '%s' to '%s'\n", (name ? name : ""), (value ? value : ""))); { #ifdef HAVE_SETENV /* always make a copy, for consistency with !HAVE_SETENV */ char *str = xstrdup (value); setenv (name, str, 1); #else int len = strlen (name) + 1 + strlen (value) + 1; char *str = XMALLOC (char, len); sprintf (str, "%s=%s", name, value); if (putenv (str) != EXIT_SUCCESS) { XFREE (str); } #endif } } char * lt_extend_str (const char *orig_value, const char *add, int to_end) { char *new_value; if (orig_value && *orig_value) { int orig_value_len = strlen (orig_value); int add_len = strlen (add); new_value = XMALLOC (char, add_len + orig_value_len + 1); if (to_end) { strcpy (new_value, orig_value); strcpy (new_value + orig_value_len, add); } else { strcpy (new_value, add); strcpy (new_value + add_len, orig_value); } } else { new_value = xstrdup (add); } return new_value; } int lt_split_name_value (const char *arg, char** name, char** value) { const char *p; int len; if (!arg || !*arg) return 1; p = strchr (arg, (int)'='); if (!p) return 1; *value = xstrdup (++p); len = strlen (arg) - strlen (*value); *name = XMALLOC (char, len); strncpy (*name, arg, len-1); (*name)[len - 1] = '\0'; return 0; } void lt_opt_process_env_set (const char *arg) { char *name = NULL; char *value = NULL; if (lt_split_name_value (arg, &name, &value) != 0) { XFREE (name); XFREE (value); lt_fatal ("bad argument for %s: '%s'", env_set_opt, arg); } lt_setenv (name, value); XFREE (name); XFREE (value); } void lt_opt_process_env_prepend (const char *arg) { char *name = NULL; char *value = NULL; char *new_value = NULL; if (lt_split_name_value (arg, &name, &value) != 0) { XFREE (name); XFREE (value); lt_fatal ("bad argument for %s: '%s'", env_prepend_opt, arg); } new_value = lt_extend_str (getenv (name), value, 0); lt_setenv (name, new_value); XFREE (new_value); XFREE (name); XFREE (value); } void lt_opt_process_env_append (const char *arg) { char *name = NULL; char *value = NULL; char *new_value = NULL; if (lt_split_name_value (arg, &name, &value) != 0) { XFREE (name); XFREE (value); lt_fatal ("bad argument for %s: '%s'", env_append_opt, arg); } new_value = lt_extend_str (getenv (name), value, 1); lt_setenv (name, new_value); XFREE (new_value); XFREE (name); XFREE (value); } void lt_update_exe_path (const char *name, const char *value) { LTWRAPPER_DEBUGPRINTF (("(lt_update_exe_path) modifying '%s' by prepending '%s'\n", (name ? name : ""), (value ? value : ""))); if (name && *name && value && *value) { char *new_value = lt_extend_str (getenv (name), value, 0); /* some systems can't cope with a ':'-terminated path #' */ int len = strlen (new_value); while (((len = strlen (new_value)) > 0) && IS_PATH_SEPARATOR (new_value[len-1])) { new_value[len-1] = '\0'; } lt_setenv (name, new_value); XFREE (new_value); } } void lt_update_lib_path (const char *name, const char *value) { LTWRAPPER_DEBUGPRINTF (("(lt_update_lib_path) modifying '%s' by prepending '%s'\n", (name ? name : ""), (value ? value : ""))); if (name && *name && value && *value) { char *new_value = lt_extend_str (getenv (name), value, 0); lt_setenv (name, new_value); XFREE (new_value); } } EOF } # end: func_emit_cwrapperexe_src # func_mode_link arg... func_mode_link () { $opt_debug case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) # It is impossible to link a dll without this setting, and # we shouldn't force the makefile maintainer to figure out # which system we are compiling for in order to pass an extra # flag for every libtool invocation. # allow_undefined=no # FIXME: Unfortunately, there are problems with the above when trying # to make a dll which has undefined symbols, in which case not # even a static library is built. For now, we need to specify # -no-undefined on the libtool link line when we can be certain # that all symbols are satisfied, otherwise we get a static library. allow_undefined=yes ;; *) allow_undefined=yes ;; esac libtool_args=$nonopt base_compile="$nonopt $@" compile_command=$nonopt finalize_command=$nonopt compile_rpath= finalize_rpath= compile_shlibpath= finalize_shlibpath= convenience= old_convenience= deplibs= old_deplibs= compiler_flags= linker_flags= dllsearchpath= lib_search_path=`pwd` inst_prefix_dir= new_inherited_linker_flags= avoid_version=no dlfiles= dlprefiles= dlself=no export_dynamic=no export_symbols= export_symbols_regex= generated= libobjs= ltlibs= module=no no_install=no objs= non_pic_objects= precious_files_regex= prefer_static_libs=no preload=no prev= prevarg= release= rpath= xrpath= perm_rpath= temp_rpath= thread_safe=no vinfo= vinfo_number=no weak_libs= single_module="${wl}-single_module" func_infer_tag $base_compile # We need to know -static, to get the right output filenames. for arg do case $arg in -shared) test "$build_libtool_libs" != yes && \ func_fatal_configuration "can not build a shared library" build_old_libs=no break ;; -all-static | -static | -static-libtool-libs) case $arg in -all-static) if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then func_warning "complete static linking is impossible in this configuration" fi if test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=yes ;; -static) if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=built ;; -static-libtool-libs) if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=yes ;; esac build_libtool_libs=no build_old_libs=yes break ;; esac done # See if our shared archives depend on static archives. test -n "$old_archive_from_new_cmds" && build_old_libs=yes # Go through the arguments, transforming them on the way. while test "$#" -gt 0; do arg="$1" shift func_quote_for_eval "$arg" qarg=$func_quote_for_eval_unquoted_result func_append libtool_args " $func_quote_for_eval_result" # If the previous option needs an argument, assign it. if test -n "$prev"; then case $prev in output) func_append compile_command " @OUTPUT@" func_append finalize_command " @OUTPUT@" ;; esac case $prev in dlfiles|dlprefiles) if test "$preload" = no; then # Add the symbol object into the linking commands. func_append compile_command " @SYMFILE@" func_append finalize_command " @SYMFILE@" preload=yes fi case $arg in *.la | *.lo) ;; # We handle these cases below. force) if test "$dlself" = no; then dlself=needless export_dynamic=yes fi prev= continue ;; self) if test "$prev" = dlprefiles; then dlself=yes elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then dlself=yes else dlself=needless export_dynamic=yes fi prev= continue ;; *) if test "$prev" = dlfiles; then dlfiles="$dlfiles $arg" else dlprefiles="$dlprefiles $arg" fi prev= continue ;; esac ;; expsyms) export_symbols="$arg" test -f "$arg" \ || func_fatal_error "symbol file \`$arg' does not exist" prev= continue ;; expsyms_regex) export_symbols_regex="$arg" prev= continue ;; framework) case $host in *-*-darwin*) case "$deplibs " in *" $qarg.ltframework "*) ;; *) deplibs="$deplibs $qarg.ltframework" # this is fixed later ;; esac ;; esac prev= continue ;; inst_prefix) inst_prefix_dir="$arg" prev= continue ;; objectlist) if test -f "$arg"; then save_arg=$arg moreargs= for fil in `cat "$save_arg"` do # moreargs="$moreargs $fil" arg=$fil # A libtool-controlled object. # Check to see that this really is a libtool object. if func_lalib_unsafe_p "$arg"; then pic_object= non_pic_object= # Read the .lo file func_source "$arg" if test -z "$pic_object" || test -z "$non_pic_object" || test "$pic_object" = none && test "$non_pic_object" = none; then func_fatal_error "cannot find name of object for \`$arg'" fi # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" if test "$pic_object" != none; then # Prepend the subdirectory the object is found in. pic_object="$xdir$pic_object" if test "$prev" = dlfiles; then if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then dlfiles="$dlfiles $pic_object" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi # CHECK ME: I think I busted this. -Ossama if test "$prev" = dlprefiles; then # Preload the old-style object. dlprefiles="$dlprefiles $pic_object" prev= fi # A PIC object. func_append libobjs " $pic_object" arg="$pic_object" fi # Non-PIC object. if test "$non_pic_object" != none; then # Prepend the subdirectory the object is found in. non_pic_object="$xdir$non_pic_object" # A standard non-PIC object func_append non_pic_objects " $non_pic_object" if test -z "$pic_object" || test "$pic_object" = none ; then arg="$non_pic_object" fi else # If the PIC object exists, use it instead. # $xdir was prepended to $pic_object above. non_pic_object="$pic_object" func_append non_pic_objects " $non_pic_object" fi else # Only an error if not doing a dry-run. if $opt_dry_run; then # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" func_lo2o "$arg" pic_object=$xdir$objdir/$func_lo2o_result non_pic_object=$xdir$func_lo2o_result func_append libobjs " $pic_object" func_append non_pic_objects " $non_pic_object" else func_fatal_error "\`$arg' is not a valid libtool object" fi fi done else func_fatal_error "link input file \`$arg' does not exist" fi arg=$save_arg prev= continue ;; precious_regex) precious_files_regex="$arg" prev= continue ;; release) release="-$arg" prev= continue ;; rpath | xrpath) # We need an absolute path. case $arg in [\\/]* | [A-Za-z]:[\\/]*) ;; *) func_fatal_error "only absolute run-paths are allowed" ;; esac if test "$prev" = rpath; then case "$rpath " in *" $arg "*) ;; *) rpath="$rpath $arg" ;; esac else case "$xrpath " in *" $arg "*) ;; *) xrpath="$xrpath $arg" ;; esac fi prev= continue ;; shrext) shrext_cmds="$arg" prev= continue ;; weak) weak_libs="$weak_libs $arg" prev= continue ;; xcclinker) linker_flags="$linker_flags $qarg" compiler_flags="$compiler_flags $qarg" prev= func_append compile_command " $qarg" func_append finalize_command " $qarg" continue ;; xcompiler) compiler_flags="$compiler_flags $qarg" prev= func_append compile_command " $qarg" func_append finalize_command " $qarg" continue ;; xlinker) linker_flags="$linker_flags $qarg" compiler_flags="$compiler_flags $wl$qarg" prev= func_append compile_command " $wl$qarg" func_append finalize_command " $wl$qarg" continue ;; *) eval "$prev=\"\$arg\"" prev= continue ;; esac fi # test -n "$prev" prevarg="$arg" case $arg in -all-static) if test -n "$link_static_flag"; then # See comment for -static flag below, for more details. func_append compile_command " $link_static_flag" func_append finalize_command " $link_static_flag" fi continue ;; -allow-undefined) # FIXME: remove this flag sometime in the future. func_fatal_error "\`-allow-undefined' must not be used because it is the default" ;; -avoid-version) avoid_version=yes continue ;; -dlopen) prev=dlfiles continue ;; -dlpreopen) prev=dlprefiles continue ;; -export-dynamic) export_dynamic=yes continue ;; -export-symbols | -export-symbols-regex) if test -n "$export_symbols" || test -n "$export_symbols_regex"; then func_fatal_error "more than one -exported-symbols argument is not allowed" fi if test "X$arg" = "X-export-symbols"; then prev=expsyms else prev=expsyms_regex fi continue ;; -framework) prev=framework continue ;; -inst-prefix-dir) prev=inst_prefix continue ;; # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* # so, if we see these flags be careful not to treat them like -L -L[A-Z][A-Z]*:*) case $with_gcc/$host in no/*-*-irix* | /*-*-irix*) func_append compile_command " $arg" func_append finalize_command " $arg" ;; esac continue ;; -L*) func_stripname '-L' '' "$arg" dir=$func_stripname_result if test -z "$dir"; then if test "$#" -gt 0; then func_fatal_error "require no space between \`-L' and \`$1'" else func_fatal_error "need path for \`-L' option" fi fi # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) absdir=`cd "$dir" && pwd` test -z "$absdir" && \ func_fatal_error "cannot determine absolute directory name of \`$dir'" dir="$absdir" ;; esac case "$deplibs " in *" -L$dir "*) ;; *) deplibs="$deplibs -L$dir" lib_search_path="$lib_search_path $dir" ;; esac case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) testbindir=`$ECHO "X$dir" | $Xsed -e 's*/lib$*/bin*'` case :$dllsearchpath: in *":$dir:"*) ;; ::) dllsearchpath=$dir;; *) dllsearchpath="$dllsearchpath:$dir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; ::) dllsearchpath=$testbindir;; *) dllsearchpath="$dllsearchpath:$testbindir";; esac ;; esac continue ;; -l*) if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc*) # These systems don't actually have a C or math library (as such) continue ;; *-*-os2*) # These systems don't actually have a C library (as such) test "X$arg" = "X-lc" && continue ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc due to us having libc/libc_r. test "X$arg" = "X-lc" && continue ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C and math libraries are in the System framework deplibs="$deplibs System.ltframework" continue ;; *-*-sco3.2v5* | *-*-sco5v6*) # Causes problems with __ctype test "X$arg" = "X-lc" && continue ;; *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) # Compiler inserts libc in the correct place for threads to work test "X$arg" = "X-lc" && continue ;; esac elif test "X$arg" = "X-lc_r"; then case $host in *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc_r directly, use -pthread flag. continue ;; esac fi deplibs="$deplibs $arg" continue ;; -module) module=yes continue ;; # Tru64 UNIX uses -model [arg] to determine the layout of C++ # classes, name mangling, and exception handling. # Darwin uses the -arch flag to determine output architecture. -model|-arch|-isysroot) compiler_flags="$compiler_flags $arg" func_append compile_command " $arg" func_append finalize_command " $arg" prev=xcompiler continue ;; -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads) compiler_flags="$compiler_flags $arg" func_append compile_command " $arg" func_append finalize_command " $arg" case "$new_inherited_linker_flags " in *" $arg "*) ;; * ) new_inherited_linker_flags="$new_inherited_linker_flags $arg" ;; esac continue ;; -multi_module) single_module="${wl}-multi_module" continue ;; -no-fast-install) fast_install=no continue ;; -no-install) case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*) # The PATH hackery in wrapper scripts is required on Windows # and Darwin in order for the loader to find any dlls it needs. func_warning "\`-no-install' is ignored for $host" func_warning "assuming \`-no-fast-install' instead" fast_install=no ;; *) no_install=yes ;; esac continue ;; -no-undefined) allow_undefined=no continue ;; -objectlist) prev=objectlist continue ;; -o) prev=output ;; -precious-files-regex) prev=precious_regex continue ;; -release) prev=release continue ;; -rpath) prev=rpath continue ;; -R) prev=xrpath continue ;; -R*) func_stripname '-R' '' "$arg" dir=$func_stripname_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) func_fatal_error "only absolute run-paths are allowed" ;; esac case "$xrpath " in *" $dir "*) ;; *) xrpath="$xrpath $dir" ;; esac continue ;; -shared) # The effects of -shared are defined in a previous loop. continue ;; -shrext) prev=shrext continue ;; -static | -static-libtool-libs) # The effects of -static are defined in a previous loop. # We used to do the same as -all-static on platforms that # didn't have a PIC flag, but the assumption that the effects # would be equivalent was wrong. It would break on at least # Digital Unix and AIX. continue ;; -thread-safe) thread_safe=yes continue ;; -version-info) prev=vinfo continue ;; -version-number) prev=vinfo vinfo_number=yes continue ;; -weak) prev=weak continue ;; -Wc,*) func_stripname '-Wc,' '' "$arg" args=$func_stripname_result arg= save_ifs="$IFS"; IFS=',' for flag in $args; do IFS="$save_ifs" func_quote_for_eval "$flag" arg="$arg $wl$func_quote_for_eval_result" compiler_flags="$compiler_flags $func_quote_for_eval_result" done IFS="$save_ifs" func_stripname ' ' '' "$arg" arg=$func_stripname_result ;; -Wl,*) func_stripname '-Wl,' '' "$arg" args=$func_stripname_result arg= save_ifs="$IFS"; IFS=',' for flag in $args; do IFS="$save_ifs" func_quote_for_eval "$flag" arg="$arg $wl$func_quote_for_eval_result" compiler_flags="$compiler_flags $wl$func_quote_for_eval_result" linker_flags="$linker_flags $func_quote_for_eval_result" done IFS="$save_ifs" func_stripname ' ' '' "$arg" arg=$func_stripname_result ;; -Xcompiler) prev=xcompiler continue ;; -Xlinker) prev=xlinker continue ;; -XCClinker) prev=xcclinker continue ;; # -msg_* for osf cc -msg_*) func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" ;; # -64, -mips[0-9] enable 64-bit mode on the SGI compiler # -r[0-9][0-9]* specifies the processor on the SGI compiler # -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler # +DA*, +DD* enable 64-bit mode on the HP compiler # -q* pass through compiler args for the IBM compiler # -m*, -t[45]*, -txscale* pass through architecture-specific # compiler args for GCC # -F/path gives path to uninstalled frameworks, gcc on darwin # -p, -pg, --coverage, -fprofile-* pass through profiling flag for GCC # @file GCC response files -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*) func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" func_append compile_command " $arg" func_append finalize_command " $arg" compiler_flags="$compiler_flags $arg" continue ;; # Some other compiler flag. -* | +*) func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" ;; *.$objext) # A standard object. objs="$objs $arg" ;; *.lo) # A libtool-controlled object. # Check to see that this really is a libtool object. if func_lalib_unsafe_p "$arg"; then pic_object= non_pic_object= # Read the .lo file func_source "$arg" if test -z "$pic_object" || test -z "$non_pic_object" || test "$pic_object" = none && test "$non_pic_object" = none; then func_fatal_error "cannot find name of object for \`$arg'" fi # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" if test "$pic_object" != none; then # Prepend the subdirectory the object is found in. pic_object="$xdir$pic_object" if test "$prev" = dlfiles; then if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then dlfiles="$dlfiles $pic_object" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi # CHECK ME: I think I busted this. -Ossama if test "$prev" = dlprefiles; then # Preload the old-style object. dlprefiles="$dlprefiles $pic_object" prev= fi # A PIC object. func_append libobjs " $pic_object" arg="$pic_object" fi # Non-PIC object. if test "$non_pic_object" != none; then # Prepend the subdirectory the object is found in. non_pic_object="$xdir$non_pic_object" # A standard non-PIC object func_append non_pic_objects " $non_pic_object" if test -z "$pic_object" || test "$pic_object" = none ; then arg="$non_pic_object" fi else # If the PIC object exists, use it instead. # $xdir was prepended to $pic_object above. non_pic_object="$pic_object" func_append non_pic_objects " $non_pic_object" fi else # Only an error if not doing a dry-run. if $opt_dry_run; then # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" func_lo2o "$arg" pic_object=$xdir$objdir/$func_lo2o_result non_pic_object=$xdir$func_lo2o_result func_append libobjs " $pic_object" func_append non_pic_objects " $non_pic_object" else func_fatal_error "\`$arg' is not a valid libtool object" fi fi ;; *.$libext) # An archive. deplibs="$deplibs $arg" old_deplibs="$old_deplibs $arg" continue ;; *.la) # A libtool-controlled library. if test "$prev" = dlfiles; then # This library was specified with -dlopen. dlfiles="$dlfiles $arg" prev= elif test "$prev" = dlprefiles; then # The library was specified with -dlpreopen. dlprefiles="$dlprefiles $arg" prev= else deplibs="$deplibs $arg" fi continue ;; # Some other compiler argument. *) # Unknown arguments in both finalize_command and compile_command need # to be aesthetically quoted because they are evaled later. func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" ;; esac # arg # Now actually substitute the argument into the commands. if test -n "$arg"; then func_append compile_command " $arg" func_append finalize_command " $arg" fi done # argument parsing loop test -n "$prev" && \ func_fatal_help "the \`$prevarg' option requires an argument" if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then eval arg=\"$export_dynamic_flag_spec\" func_append compile_command " $arg" func_append finalize_command " $arg" fi oldlibs= # calculate the name of the file, without its directory func_basename "$output" outputname="$func_basename_result" libobjs_save="$libobjs" if test -n "$shlibpath_var"; then # get the directories listed in $shlibpath_var eval shlib_search_path=\`\$ECHO \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\` else shlib_search_path= fi eval sys_lib_search_path=\"$sys_lib_search_path_spec\" eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" func_dirname "$output" "/" "" output_objdir="$func_dirname_result$objdir" # Create the object directory. func_mkdir_p "$output_objdir" # Determine the type of output case $output in "") func_fatal_help "you must specify an output file" ;; *.$libext) linkmode=oldlib ;; *.lo | *.$objext) linkmode=obj ;; *.la) linkmode=lib ;; *) linkmode=prog ;; # Anything else should be a program. esac specialdeplibs= libs= # Find all interdependent deplibs by searching for libraries # that are linked more than once (e.g. -la -lb -la) for deplib in $deplibs; do if $opt_duplicate_deps ; then case "$libs " in *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; esac fi libs="$libs $deplib" done if test "$linkmode" = lib; then libs="$predeps $libs $compiler_lib_search_path $postdeps" # Compute libraries that are listed more than once in $predeps # $postdeps and mark them as special (i.e., whose duplicates are # not to be eliminated). pre_post_deps= if $opt_duplicate_compiler_generated_deps; then for pre_post_dep in $predeps $postdeps; do case "$pre_post_deps " in *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;; esac pre_post_deps="$pre_post_deps $pre_post_dep" done fi pre_post_deps= fi deplibs= newdependency_libs= newlib_search_path= need_relink=no # whether we're linking any uninstalled libtool libraries notinst_deplibs= # not-installed libtool libraries notinst_path= # paths that contain not-installed libtool libraries case $linkmode in lib) passes="conv dlpreopen link" for file in $dlfiles $dlprefiles; do case $file in *.la) ;; *) func_fatal_help "libraries can \`-dlopen' only libtool libraries: $file" ;; esac done ;; prog) compile_deplibs= finalize_deplibs= alldeplibs=no newdlfiles= newdlprefiles= passes="conv scan dlopen dlpreopen link" ;; *) passes="conv" ;; esac for pass in $passes; do # The preopen pass in lib mode reverses $deplibs; put it back here # so that -L comes before libs that need it for instance... if test "$linkmode,$pass" = "lib,link"; then ## FIXME: Find the place where the list is rebuilt in the wrong ## order, and fix it there properly tmp_deplibs= for deplib in $deplibs; do tmp_deplibs="$deplib $tmp_deplibs" done deplibs="$tmp_deplibs" fi if test "$linkmode,$pass" = "lib,link" || test "$linkmode,$pass" = "prog,scan"; then libs="$deplibs" deplibs= fi if test "$linkmode" = prog; then case $pass in dlopen) libs="$dlfiles" ;; dlpreopen) libs="$dlprefiles" ;; link) libs="$deplibs %DEPLIBS%" test "X$link_all_deplibs" != Xno && libs="$libs $dependency_libs" ;; esac fi if test "$linkmode,$pass" = "lib,dlpreopen"; then # Collect and forward deplibs of preopened libtool libs for lib in $dlprefiles; do # Ignore non-libtool-libs dependency_libs= case $lib in *.la) func_source "$lib" ;; esac # Collect preopened libtool deplibs, except any this library # has declared as weak libs for deplib in $dependency_libs; do deplib_base=`$ECHO "X$deplib" | $Xsed -e "$basename"` case " $weak_libs " in *" $deplib_base "*) ;; *) deplibs="$deplibs $deplib" ;; esac done done libs="$dlprefiles" fi if test "$pass" = dlopen; then # Collect dlpreopened libraries save_deplibs="$deplibs" deplibs= fi for deplib in $libs; do lib= found=no case $deplib in -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads) if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else compiler_flags="$compiler_flags $deplib" if test "$linkmode" = lib ; then case "$new_inherited_linker_flags " in *" $deplib "*) ;; * ) new_inherited_linker_flags="$new_inherited_linker_flags $deplib" ;; esac fi fi continue ;; -l*) if test "$linkmode" != lib && test "$linkmode" != prog; then func_warning "\`-l' is ignored for archives/objects" continue fi func_stripname '-l' '' "$deplib" name=$func_stripname_result if test "$linkmode" = lib; then searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path" else searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path" fi for searchdir in $searchdirs; do for search_ext in .la $std_shrext .so .a; do # Search the libtool library lib="$searchdir/lib${name}${search_ext}" if test -f "$lib"; then if test "$search_ext" = ".la"; then found=yes else found=no fi break 2 fi done done if test "$found" != yes; then # deplib doesn't seem to be a libtool library if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" fi continue else # deplib is a libtool library # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib, # We need to do some special things here, and not later. if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $deplib "*) if func_lalib_p "$lib"; then library_names= old_library= func_source "$lib" for l in $old_library $library_names; do ll="$l" done if test "X$ll" = "X$old_library" ; then # only static version available found=no func_dirname "$lib" "" "." ladir="$func_dirname_result" lib=$ladir/$old_library if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" fi continue fi fi ;; *) ;; esac fi fi ;; # -l *.ltframework) if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" if test "$linkmode" = lib ; then case "$new_inherited_linker_flags " in *" $deplib "*) ;; * ) new_inherited_linker_flags="$new_inherited_linker_flags $deplib" ;; esac fi fi continue ;; -L*) case $linkmode in lib) deplibs="$deplib $deplibs" test "$pass" = conv && continue newdependency_libs="$deplib $newdependency_libs" func_stripname '-L' '' "$deplib" newlib_search_path="$newlib_search_path $func_stripname_result" ;; prog) if test "$pass" = conv; then deplibs="$deplib $deplibs" continue fi if test "$pass" = scan; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi func_stripname '-L' '' "$deplib" newlib_search_path="$newlib_search_path $func_stripname_result" ;; *) func_warning "\`-L' is ignored for archives/objects" ;; esac # linkmode continue ;; # -L -R*) if test "$pass" = link; then func_stripname '-R' '' "$deplib" dir=$func_stripname_result # Make sure the xrpath contains only unique directories. case "$xrpath " in *" $dir "*) ;; *) xrpath="$xrpath $dir" ;; esac fi deplibs="$deplib $deplibs" continue ;; *.la) lib="$deplib" ;; *.$libext) if test "$pass" = conv; then deplibs="$deplib $deplibs" continue fi case $linkmode in lib) # Linking convenience modules into shared libraries is allowed, # but linking other static libraries is non-portable. case " $dlpreconveniencelibs " in *" $deplib "*) ;; *) valid_a_lib=no case $deplibs_check_method in match_pattern*) set dummy $deplibs_check_method; shift match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` if eval "\$ECHO \"X$deplib\"" 2>/dev/null | $Xsed -e 10q \ | $EGREP "$match_pattern_regex" > /dev/null; then valid_a_lib=yes fi ;; pass_all) valid_a_lib=yes ;; esac if test "$valid_a_lib" != yes; then $ECHO $ECHO "*** Warning: Trying to link with static lib archive $deplib." $ECHO "*** I have the capability to make that library automatically link in when" $ECHO "*** you link to this library. But I can only do this if you have a" $ECHO "*** shared version of the library, which you do not appear to have" $ECHO "*** because the file extensions .$libext of this argument makes me believe" $ECHO "*** that it is just a static archive that I should not use here." else $ECHO $ECHO "*** Warning: Linking the shared library $output against the" $ECHO "*** static library $deplib is not portable!" deplibs="$deplib $deplibs" fi ;; esac continue ;; prog) if test "$pass" != link; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi continue ;; esac # linkmode ;; # *.$libext *.lo | *.$objext) if test "$pass" = conv; then deplibs="$deplib $deplibs" elif test "$linkmode" = prog; then if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then # If there is no dlopen support or we're linking statically, # we need to preload. newdlprefiles="$newdlprefiles $deplib" compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else newdlfiles="$newdlfiles $deplib" fi fi continue ;; %DEPLIBS%) alldeplibs=yes continue ;; esac # case $deplib if test "$found" = yes || test -f "$lib"; then : else func_fatal_error "cannot find the library \`$lib' or unhandled argument \`$deplib'" fi # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$lib" \ || func_fatal_error "\`$lib' is not a valid libtool archive" func_dirname "$lib" "" "." ladir="$func_dirname_result" dlname= dlopen= dlpreopen= libdir= library_names= old_library= inherited_linker_flags= # If the library was installed with an old release of libtool, # it will not redefine variables installed, or shouldnotlink installed=yes shouldnotlink=no avoidtemprpath= # Read the .la file func_source "$lib" # Convert "-framework foo" to "foo.ltframework" if test -n "$inherited_linker_flags"; then tmp_inherited_linker_flags=`$ECHO "X$inherited_linker_flags" | $Xsed -e 's/-framework \([^ $]*\)/\1.ltframework/g'` for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do case " $new_inherited_linker_flags " in *" $tmp_inherited_linker_flag "*) ;; *) new_inherited_linker_flags="$new_inherited_linker_flags $tmp_inherited_linker_flag";; esac done fi dependency_libs=`$ECHO "X $dependency_libs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'` if test "$linkmode,$pass" = "lib,link" || test "$linkmode,$pass" = "prog,scan" || { test "$linkmode" != prog && test "$linkmode" != lib; }; then test -n "$dlopen" && dlfiles="$dlfiles $dlopen" test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen" fi if test "$pass" = conv; then # Only check for convenience libraries deplibs="$lib $deplibs" if test -z "$libdir"; then if test -z "$old_library"; then func_fatal_error "cannot find name of link library for \`$lib'" fi # It is a libtool convenience library, so add in its objects. convenience="$convenience $ladir/$objdir/$old_library" old_convenience="$old_convenience $ladir/$objdir/$old_library" tmp_libs= for deplib in $dependency_libs; do deplibs="$deplib $deplibs" if $opt_duplicate_deps ; then case "$tmp_libs " in *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; esac fi tmp_libs="$tmp_libs $deplib" done elif test "$linkmode" != prog && test "$linkmode" != lib; then func_fatal_error "\`$lib' is not a convenience library" fi continue fi # $pass = conv # Get the name of the library we link against. linklib= for l in $old_library $library_names; do linklib="$l" done if test -z "$linklib"; then func_fatal_error "cannot find name of link library for \`$lib'" fi # This library was specified with -dlopen. if test "$pass" = dlopen; then if test -z "$libdir"; then func_fatal_error "cannot -dlopen a convenience library: \`$lib'" fi if test -z "$dlname" || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then # If there is no dlname, no dlopen support or we're linking # statically, we need to preload. We also need to preload any # dependent libraries so libltdl's deplib preloader doesn't # bomb out in the load deplibs phase. dlprefiles="$dlprefiles $lib $dependency_libs" else newdlfiles="$newdlfiles $lib" fi continue fi # $pass = dlopen # We need an absolute path. case $ladir in [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;; *) abs_ladir=`cd "$ladir" && pwd` if test -z "$abs_ladir"; then func_warning "cannot determine absolute directory name of \`$ladir'" func_warning "passing it literally to the linker, although it might fail" abs_ladir="$ladir" fi ;; esac func_basename "$lib" laname="$func_basename_result" # Find the relevant object directory and library name. if test "X$installed" = Xyes; then if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then func_warning "library \`$lib' was moved." dir="$ladir" absdir="$abs_ladir" libdir="$abs_ladir" else dir="$libdir" absdir="$libdir" fi test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes else if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then dir="$ladir" absdir="$abs_ladir" # Remove this search path later notinst_path="$notinst_path $abs_ladir" else dir="$ladir/$objdir" absdir="$abs_ladir/$objdir" # Remove this search path later notinst_path="$notinst_path $abs_ladir" fi fi # $installed = yes func_stripname 'lib' '.la' "$laname" name=$func_stripname_result # This library was specified with -dlpreopen. if test "$pass" = dlpreopen; then if test -z "$libdir" && test "$linkmode" = prog; then func_fatal_error "only libraries may -dlpreopen a convenience library: \`$lib'" fi # Prefer using a static library (so that no silly _DYNAMIC symbols # are required to link). if test -n "$old_library"; then newdlprefiles="$newdlprefiles $dir/$old_library" # Keep a list of preopened convenience libraries to check # that they are being used correctly in the link pass. test -z "$libdir" && \ dlpreconveniencelibs="$dlpreconveniencelibs $dir/$old_library" # Otherwise, use the dlname, so that lt_dlopen finds it. elif test -n "$dlname"; then newdlprefiles="$newdlprefiles $dir/$dlname" else newdlprefiles="$newdlprefiles $dir/$linklib" fi fi # $pass = dlpreopen if test -z "$libdir"; then # Link the convenience library if test "$linkmode" = lib; then deplibs="$dir/$old_library $deplibs" elif test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$dir/$old_library $compile_deplibs" finalize_deplibs="$dir/$old_library $finalize_deplibs" else deplibs="$lib $deplibs" # used for prog,scan pass fi continue fi if test "$linkmode" = prog && test "$pass" != link; then newlib_search_path="$newlib_search_path $ladir" deplibs="$lib $deplibs" linkalldeplibs=no if test "$link_all_deplibs" != no || test -z "$library_names" || test "$build_libtool_libs" = no; then linkalldeplibs=yes fi tmp_libs= for deplib in $dependency_libs; do case $deplib in -L*) func_stripname '-L' '' "$deplib" newlib_search_path="$newlib_search_path $func_stripname_result" ;; esac # Need to link against all dependency_libs? if test "$linkalldeplibs" = yes; then deplibs="$deplib $deplibs" else # Need to hardcode shared library paths # or/and link against static libraries newdependency_libs="$deplib $newdependency_libs" fi if $opt_duplicate_deps ; then case "$tmp_libs " in *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; esac fi tmp_libs="$tmp_libs $deplib" done # for deplib continue fi # $linkmode = prog... if test "$linkmode,$pass" = "prog,link"; then if test -n "$library_names" && { { test "$prefer_static_libs" = no || test "$prefer_static_libs,$installed" = "built,yes"; } || test -z "$old_library"; }; then # We need to hardcode the library path if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then # Make sure the rpath contains only unique directories. case "$temp_rpath:" in *"$absdir:"*) ;; *) temp_rpath="$temp_rpath$absdir:" ;; esac fi # Hardcode the library path. # Skip directories that are in the system default run-time # search path. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) compile_rpath="$compile_rpath $absdir" esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) finalize_rpath="$finalize_rpath $libdir" esac ;; esac fi # $linkmode,$pass = prog,link... if test "$alldeplibs" = yes && { test "$deplibs_check_method" = pass_all || { test "$build_libtool_libs" = yes && test -n "$library_names"; }; }; then # We only need to search for static libraries continue fi fi link_static=no # Whether the deplib will be linked statically use_static_libs=$prefer_static_libs if test "$use_static_libs" = built && test "$installed" = yes; then use_static_libs=no fi if test -n "$library_names" && { test "$use_static_libs" = no || test -z "$old_library"; }; then case $host in *cygwin* | *mingw* | *cegcc*) # No point in relinking DLLs because paths are not encoded notinst_deplibs="$notinst_deplibs $lib" need_relink=no ;; *) if test "$installed" = no; then notinst_deplibs="$notinst_deplibs $lib" need_relink=yes fi ;; esac # This is a shared library # Warn about portability, can't link against -module's on some # systems (darwin). Don't bleat about dlopened modules though! dlopenmodule="" for dlpremoduletest in $dlprefiles; do if test "X$dlpremoduletest" = "X$lib"; then dlopenmodule="$dlpremoduletest" break fi done if test -z "$dlopenmodule" && test "$shouldnotlink" = yes && test "$pass" = link; then $ECHO if test "$linkmode" = prog; then $ECHO "*** Warning: Linking the executable $output against the loadable module" else $ECHO "*** Warning: Linking the shared library $output against the loadable module" fi $ECHO "*** $linklib is not portable!" fi if test "$linkmode" = lib && test "$hardcode_into_libs" = yes; then # Hardcode the library path. # Skip directories that are in the system default run-time # search path. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) compile_rpath="$compile_rpath $absdir" esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) finalize_rpath="$finalize_rpath $libdir" esac ;; esac fi if test -n "$old_archive_from_expsyms_cmds"; then # figure out the soname set dummy $library_names shift realname="$1" shift libname=`eval "\\$ECHO \"$libname_spec\""` # use dlname if we got it. it's perfectly good, no? if test -n "$dlname"; then soname="$dlname" elif test -n "$soname_spec"; then # bleh windows case $host in *cygwin* | mingw* | *cegcc*) func_arith $current - $age major=$func_arith_result versuffix="-$major" ;; esac eval soname=\"$soname_spec\" else soname="$realname" fi # Make a new name for the extract_expsyms_cmds to use soroot="$soname" func_basename "$soroot" soname="$func_basename_result" func_stripname 'lib' '.dll' "$soname" newlib=libimp-$func_stripname_result.a # If the library has no export list, then create one now if test -f "$output_objdir/$soname-def"; then : else func_verbose "extracting exported symbol list from \`$soname'" func_execute_cmds "$extract_expsyms_cmds" 'exit $?' fi # Create $newlib if test -f "$output_objdir/$newlib"; then :; else func_verbose "generating import library for \`$soname'" func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?' fi # make sure the library variables are pointing to the new library dir=$output_objdir linklib=$newlib fi # test -n "$old_archive_from_expsyms_cmds" if test "$linkmode" = prog || test "$mode" != relink; then add_shlibpath= add_dir= add= lib_linked=yes case $hardcode_action in immediate | unsupported) if test "$hardcode_direct" = no; then add="$dir/$linklib" case $host in *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;; *-*-sysv4*uw2*) add_dir="-L$dir" ;; *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \ *-*-unixware7*) add_dir="-L$dir" ;; *-*-darwin* ) # if the lib is a (non-dlopened) module then we can not # link against it, someone is ignoring the earlier warnings if /usr/bin/file -L $add 2> /dev/null | $GREP ": [^:]* bundle" >/dev/null ; then if test "X$dlopenmodule" != "X$lib"; then $ECHO "*** Warning: lib $linklib is a module, not a shared library" if test -z "$old_library" ; then $ECHO $ECHO "*** And there doesn't seem to be a static archive available" $ECHO "*** The link will probably fail, sorry" else add="$dir/$old_library" fi elif test -n "$old_library"; then add="$dir/$old_library" fi fi esac elif test "$hardcode_minus_L" = no; then case $host in *-*-sunos*) add_shlibpath="$dir" ;; esac add_dir="-L$dir" add="-l$name" elif test "$hardcode_shlibpath_var" = no; then add_shlibpath="$dir" add="-l$name" else lib_linked=no fi ;; relink) if test "$hardcode_direct" = yes && test "$hardcode_direct_absolute" = no; then add="$dir/$linklib" elif test "$hardcode_minus_L" = yes; then add_dir="-L$dir" # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in [\\/]*) add_dir="$add_dir -L$inst_prefix_dir$libdir" ;; esac fi add="-l$name" elif test "$hardcode_shlibpath_var" = yes; then add_shlibpath="$dir" add="-l$name" else lib_linked=no fi ;; *) lib_linked=no ;; esac if test "$lib_linked" != yes; then func_fatal_configuration "unsupported hardcode properties" fi if test -n "$add_shlibpath"; then case :$compile_shlibpath: in *":$add_shlibpath:"*) ;; *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;; esac fi if test "$linkmode" = prog; then test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" test -n "$add" && compile_deplibs="$add $compile_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" if test "$hardcode_direct" != yes && test "$hardcode_minus_L" != yes && test "$hardcode_shlibpath_var" = yes; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; esac fi fi fi if test "$linkmode" = prog || test "$mode" = relink; then add_shlibpath= add_dir= add= # Finalize command for both is simple: just hardcode it. if test "$hardcode_direct" = yes && test "$hardcode_direct_absolute" = no; then add="$libdir/$linklib" elif test "$hardcode_minus_L" = yes; then add_dir="-L$libdir" add="-l$name" elif test "$hardcode_shlibpath_var" = yes; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; esac add="-l$name" elif test "$hardcode_automatic" = yes; then if test -n "$inst_prefix_dir" && test -f "$inst_prefix_dir$libdir/$linklib" ; then add="$inst_prefix_dir$libdir/$linklib" else add="$libdir/$linklib" fi else # We cannot seem to hardcode it, guess we'll fake it. add_dir="-L$libdir" # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in [\\/]*) add_dir="$add_dir -L$inst_prefix_dir$libdir" ;; esac fi add="-l$name" fi if test "$linkmode" = prog; then test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" test -n "$add" && finalize_deplibs="$add $finalize_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" fi fi elif test "$linkmode" = prog; then # Here we assume that one of hardcode_direct or hardcode_minus_L # is not unsupported. This is valid on all known static and # shared platforms. if test "$hardcode_direct" != unsupported; then test -n "$old_library" && linklib="$old_library" compile_deplibs="$dir/$linklib $compile_deplibs" finalize_deplibs="$dir/$linklib $finalize_deplibs" else compile_deplibs="-l$name -L$dir $compile_deplibs" finalize_deplibs="-l$name -L$dir $finalize_deplibs" fi elif test "$build_libtool_libs" = yes; then # Not a shared library if test "$deplibs_check_method" != pass_all; then # We're trying link a shared library against a static one # but the system doesn't support it. # Just print a warning and add the library to dependency_libs so # that the program can be linked against the static library. $ECHO $ECHO "*** Warning: This system can not link to static lib archive $lib." $ECHO "*** I have the capability to make that library automatically link in when" $ECHO "*** you link to this library. But I can only do this if you have a" $ECHO "*** shared version of the library, which you do not appear to have." if test "$module" = yes; then $ECHO "*** But as you try to build a module library, libtool will still create " $ECHO "*** a static module, that should work as long as the dlopening application" $ECHO "*** is linked with the -dlopen flag to resolve symbols at runtime." if test -z "$global_symbol_pipe"; then $ECHO $ECHO "*** However, this would only work if libtool was able to extract symbol" $ECHO "*** lists from a program, using \`nm' or equivalent, but libtool could" $ECHO "*** not find such a program. So, this module is probably useless." $ECHO "*** \`nm' from GNU binutils and a full rebuild may help." fi if test "$build_old_libs" = no; then build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi else deplibs="$dir/$old_library $deplibs" link_static=yes fi fi # link shared/static library? if test "$linkmode" = lib; then if test -n "$dependency_libs" && { test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes || test "$link_static" = yes; }; then # Extract -R from dependency_libs temp_deplibs= for libdir in $dependency_libs; do case $libdir in -R*) func_stripname '-R' '' "$libdir" temp_xrpath=$func_stripname_result case " $xrpath " in *" $temp_xrpath "*) ;; *) xrpath="$xrpath $temp_xrpath";; esac;; *) temp_deplibs="$temp_deplibs $libdir";; esac done dependency_libs="$temp_deplibs" fi newlib_search_path="$newlib_search_path $absdir" # Link against this library test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs" # ... and its dependency_libs tmp_libs= for deplib in $dependency_libs; do newdependency_libs="$deplib $newdependency_libs" if $opt_duplicate_deps ; then case "$tmp_libs " in *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; esac fi tmp_libs="$tmp_libs $deplib" done if test "$link_all_deplibs" != no; then # Add the search paths of all dependency libraries for deplib in $dependency_libs; do path= case $deplib in -L*) path="$deplib" ;; *.la) func_dirname "$deplib" "" "." dir="$func_dirname_result" # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;; *) absdir=`cd "$dir" && pwd` if test -z "$absdir"; then func_warning "cannot determine absolute directory name of \`$dir'" absdir="$dir" fi ;; esac if $GREP "^installed=no" $deplib > /dev/null; then case $host in *-*-darwin*) depdepl= eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib` if test -n "$deplibrary_names" ; then for tmp in $deplibrary_names ; do depdepl=$tmp done if test -f "$absdir/$objdir/$depdepl" ; then depdepl="$absdir/$objdir/$depdepl" darwin_install_name=`${OTOOL} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` if test -z "$darwin_install_name"; then darwin_install_name=`${OTOOL64} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` fi compiler_flags="$compiler_flags ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}" linker_flags="$linker_flags -dylib_file ${darwin_install_name}:${depdepl}" path= fi fi ;; *) path="-L$absdir/$objdir" ;; esac else eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` test -z "$libdir" && \ func_fatal_error "\`$deplib' is not a valid libtool archive" test "$absdir" != "$libdir" && \ func_warning "\`$deplib' seems to be moved" path="-L$absdir" fi ;; esac case " $deplibs " in *" $path "*) ;; *) deplibs="$path $deplibs" ;; esac done fi # link_all_deplibs != no fi # linkmode = lib done # for deplib in $libs if test "$pass" = link; then if test "$linkmode" = "prog"; then compile_deplibs="$new_inherited_linker_flags $compile_deplibs" finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs" else compiler_flags="$compiler_flags "`$ECHO "X $new_inherited_linker_flags" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'` fi fi dependency_libs="$newdependency_libs" if test "$pass" = dlpreopen; then # Link the dlpreopened libraries before other libraries for deplib in $save_deplibs; do deplibs="$deplib $deplibs" done fi if test "$pass" != dlopen; then if test "$pass" != conv; then # Make sure lib_search_path contains only unique directories. lib_search_path= for dir in $newlib_search_path; do case "$lib_search_path " in *" $dir "*) ;; *) lib_search_path="$lib_search_path $dir" ;; esac done newlib_search_path= fi if test "$linkmode,$pass" != "prog,link"; then vars="deplibs" else vars="compile_deplibs finalize_deplibs" fi for var in $vars dependency_libs; do # Add libraries to $var in reverse order eval tmp_libs=\"\$$var\" new_libs= for deplib in $tmp_libs; do # FIXME: Pedantically, this is the right thing to do, so # that some nasty dependency loop isn't accidentally # broken: #new_libs="$deplib $new_libs" # Pragmatically, this seems to cause very few problems in # practice: case $deplib in -L*) new_libs="$deplib $new_libs" ;; -R*) ;; *) # And here is the reason: when a library appears more # than once as an explicit dependence of a library, or # is implicitly linked in more than once by the # compiler, it is considered special, and multiple # occurrences thereof are not removed. Compare this # with having the same library being listed as a # dependency of multiple other libraries: in this case, # we know (pedantically, we assume) the library does not # need to be listed more than once, so we keep only the # last copy. This is not always right, but it is rare # enough that we require users that really mean to play # such unportable linking tricks to link the library # using -Wl,-lname, so that libtool does not consider it # for duplicate removal. case " $specialdeplibs " in *" $deplib "*) new_libs="$deplib $new_libs" ;; *) case " $new_libs " in *" $deplib "*) ;; *) new_libs="$deplib $new_libs" ;; esac ;; esac ;; esac done tmp_libs= for deplib in $new_libs; do case $deplib in -L*) case " $tmp_libs " in *" $deplib "*) ;; *) tmp_libs="$tmp_libs $deplib" ;; esac ;; *) tmp_libs="$tmp_libs $deplib" ;; esac done eval $var=\"$tmp_libs\" done # for var fi # Last step: remove runtime libs from dependency_libs # (they stay in deplibs) tmp_libs= for i in $dependency_libs ; do case " $predeps $postdeps $compiler_lib_search_path " in *" $i "*) i="" ;; esac if test -n "$i" ; then tmp_libs="$tmp_libs $i" fi done dependency_libs=$tmp_libs done # for pass if test "$linkmode" = prog; then dlfiles="$newdlfiles" fi if test "$linkmode" = prog || test "$linkmode" = lib; then dlprefiles="$newdlprefiles" fi case $linkmode in oldlib) if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then func_warning "\`-dlopen' is ignored for archives" fi case " $deplibs" in *\ -l* | *\ -L*) func_warning "\`-l' and \`-L' are ignored for archives" ;; esac test -n "$rpath" && \ func_warning "\`-rpath' is ignored for archives" test -n "$xrpath" && \ func_warning "\`-R' is ignored for archives" test -n "$vinfo" && \ func_warning "\`-version-info/-version-number' is ignored for archives" test -n "$release" && \ func_warning "\`-release' is ignored for archives" test -n "$export_symbols$export_symbols_regex" && \ func_warning "\`-export-symbols' is ignored for archives" # Now set the variables for building old libraries. build_libtool_libs=no oldlibs="$output" objs="$objs$old_deplibs" ;; lib) # Make sure we only generate libraries of the form `libNAME.la'. case $outputname in lib*) func_stripname 'lib' '.la' "$outputname" name=$func_stripname_result eval shared_ext=\"$shrext_cmds\" eval libname=\"$libname_spec\" ;; *) test "$module" = no && \ func_fatal_help "libtool library \`$output' must begin with \`lib'" if test "$need_lib_prefix" != no; then # Add the "lib" prefix for modules if required func_stripname '' '.la' "$outputname" name=$func_stripname_result eval shared_ext=\"$shrext_cmds\" eval libname=\"$libname_spec\" else func_stripname '' '.la' "$outputname" libname=$func_stripname_result fi ;; esac if test -n "$objs"; then if test "$deplibs_check_method" != pass_all; then func_fatal_error "cannot build libtool library \`$output' from non-libtool objects on this host:$objs" else $ECHO $ECHO "*** Warning: Linking the shared library $output against the non-libtool" $ECHO "*** objects $objs is not portable!" libobjs="$libobjs $objs" fi fi test "$dlself" != no && \ func_warning "\`-dlopen self' is ignored for libtool libraries" set dummy $rpath shift test "$#" -gt 1 && \ func_warning "ignoring multiple \`-rpath's for a libtool library" install_libdir="$1" oldlibs= if test -z "$rpath"; then if test "$build_libtool_libs" = yes; then # Building a libtool convenience library. # Some compilers have problems with a `.al' extension so # convenience libraries should have the same extension an # archive normally would. oldlibs="$output_objdir/$libname.$libext $oldlibs" build_libtool_libs=convenience build_old_libs=yes fi test -n "$vinfo" && \ func_warning "\`-version-info/-version-number' is ignored for convenience libraries" test -n "$release" && \ func_warning "\`-release' is ignored for convenience libraries" else # Parse the version information argument. save_ifs="$IFS"; IFS=':' set dummy $vinfo 0 0 0 shift IFS="$save_ifs" test -n "$7" && \ func_fatal_help "too many parameters to \`-version-info'" # convert absolute version numbers to libtool ages # this retains compatibility with .la files and attempts # to make the code below a bit more comprehensible case $vinfo_number in yes) number_major="$1" number_minor="$2" number_revision="$3" # # There are really only two kinds -- those that # use the current revision as the major version # and those that subtract age and use age as # a minor version. But, then there is irix # which has an extra 1 added just for fun # case $version_type in darwin|linux|osf|windows|none) func_arith $number_major + $number_minor current=$func_arith_result age="$number_minor" revision="$number_revision" ;; freebsd-aout|freebsd-elf|sunos) current="$number_major" revision="$number_minor" age="0" ;; irix|nonstopux) func_arith $number_major + $number_minor current=$func_arith_result age="$number_minor" revision="$number_minor" lt_irix_increment=no ;; *) func_fatal_configuration "$modename: unknown library version type \`$version_type'" ;; esac ;; no) current="$1" revision="$2" age="$3" ;; esac # Check that each of the things are valid numbers. case $current in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "CURRENT \`$current' must be a nonnegative integer" func_fatal_error "\`$vinfo' is not valid version information" ;; esac case $revision in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "REVISION \`$revision' must be a nonnegative integer" func_fatal_error "\`$vinfo' is not valid version information" ;; esac case $age in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "AGE \`$age' must be a nonnegative integer" func_fatal_error "\`$vinfo' is not valid version information" ;; esac if test "$age" -gt "$current"; then func_error "AGE \`$age' is greater than the current interface number \`$current'" func_fatal_error "\`$vinfo' is not valid version information" fi # Calculate the version variables. major= versuffix= verstring= case $version_type in none) ;; darwin) # Like Linux, but with the current version available in # verstring for coding it into the library header func_arith $current - $age major=.$func_arith_result versuffix="$major.$age.$revision" # Darwin ld doesn't like 0 for these options... func_arith $current + 1 minor_current=$func_arith_result xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision" verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" ;; freebsd-aout) major=".$current" versuffix=".$current.$revision"; ;; freebsd-elf) major=".$current" versuffix=".$current" ;; irix | nonstopux) if test "X$lt_irix_increment" = "Xno"; then func_arith $current - $age else func_arith $current - $age + 1 fi major=$func_arith_result case $version_type in nonstopux) verstring_prefix=nonstopux ;; *) verstring_prefix=sgi ;; esac verstring="$verstring_prefix$major.$revision" # Add in all the interfaces that we are compatible with. loop=$revision while test "$loop" -ne 0; do func_arith $revision - $loop iface=$func_arith_result func_arith $loop - 1 loop=$func_arith_result verstring="$verstring_prefix$major.$iface:$verstring" done # Before this point, $major must not contain `.'. major=.$major versuffix="$major.$revision" ;; linux) func_arith $current - $age major=.$func_arith_result versuffix="$major.$age.$revision" ;; osf) func_arith $current - $age major=.$func_arith_result versuffix=".$current.$age.$revision" verstring="$current.$age.$revision" # Add in all the interfaces that we are compatible with. loop=$age while test "$loop" -ne 0; do func_arith $current - $loop iface=$func_arith_result func_arith $loop - 1 loop=$func_arith_result verstring="$verstring:${iface}.0" done # Make executables depend on our current version. verstring="$verstring:${current}.0" ;; qnx) major=".$current" versuffix=".$current" ;; sunos) major=".$current" versuffix=".$current.$revision" ;; windows) # Use '-' rather than '.', since we only want one # extension on DOS 8.3 filesystems. func_arith $current - $age major=$func_arith_result versuffix="-$major" ;; *) func_fatal_configuration "unknown library version type \`$version_type'" ;; esac # Clear the version info if we defaulted, and they specified a release. if test -z "$vinfo" && test -n "$release"; then major= case $version_type in darwin) # we can't check for "0.0" in archive_cmds due to quoting # problems, so we reset it completely verstring= ;; *) verstring="0.0" ;; esac if test "$need_version" = no; then versuffix= else versuffix=".0.0" fi fi # Remove version info from name if versioning should be avoided if test "$avoid_version" = yes && test "$need_version" = no; then major= versuffix= verstring="" fi # Check to see if the archive will have undefined symbols. if test "$allow_undefined" = yes; then if test "$allow_undefined_flag" = unsupported; then func_warning "undefined symbols not allowed in $host shared libraries" build_libtool_libs=no build_old_libs=yes fi else # Don't allow undefined symbols. allow_undefined_flag="$no_undefined_flag" fi fi func_generate_dlsyms "$libname" "$libname" "yes" libobjs="$libobjs $symfileobj" test "X$libobjs" = "X " && libobjs= if test "$mode" != relink; then # Remove our outputs, but don't remove object files since they # may have been created when compiling PIC objects. removelist= tempremovelist=`$ECHO "$output_objdir/*"` for p in $tempremovelist; do case $p in *.$objext | *.gcno) ;; $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*) if test "X$precious_files_regex" != "X"; then if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1 then continue fi fi removelist="$removelist $p" ;; *) ;; esac done test -n "$removelist" && \ func_show_eval "${RM}r \$removelist" fi # Now set the variables for building old libraries. if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then oldlibs="$oldlibs $output_objdir/$libname.$libext" # Transform .lo files to .o files. oldobjs="$objs "`$ECHO "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP` fi # Eliminate all temporary directories. #for path in $notinst_path; do # lib_search_path=`$ECHO "X$lib_search_path " | $Xsed -e "s% $path % %g"` # deplibs=`$ECHO "X$deplibs " | $Xsed -e "s% -L$path % %g"` # dependency_libs=`$ECHO "X$dependency_libs " | $Xsed -e "s% -L$path % %g"` #done if test -n "$xrpath"; then # If the user specified any rpath flags, then add them. temp_xrpath= for libdir in $xrpath; do temp_xrpath="$temp_xrpath -R$libdir" case "$finalize_rpath " in *" $libdir "*) ;; *) finalize_rpath="$finalize_rpath $libdir" ;; esac done if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then dependency_libs="$temp_xrpath $dependency_libs" fi fi # Make sure dlfiles contains only unique files that won't be dlpreopened old_dlfiles="$dlfiles" dlfiles= for lib in $old_dlfiles; do case " $dlprefiles $dlfiles " in *" $lib "*) ;; *) dlfiles="$dlfiles $lib" ;; esac done # Make sure dlprefiles contains only unique files old_dlprefiles="$dlprefiles" dlprefiles= for lib in $old_dlprefiles; do case "$dlprefiles " in *" $lib "*) ;; *) dlprefiles="$dlprefiles $lib" ;; esac done if test "$build_libtool_libs" = yes; then if test -n "$rpath"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc*) # these systems don't actually have a c library (as such)! ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C library is in the System framework deplibs="$deplibs System.ltframework" ;; *-*-netbsd*) # Don't link with libc until the a.out ld.so is fixed. ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc due to us having libc/libc_r. ;; *-*-sco3.2v5* | *-*-sco5v6*) # Causes problems with __ctype ;; *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) # Compiler inserts libc in the correct place for threads to work ;; *) # Add libc to deplibs on all other systems if necessary. if test "$build_libtool_need_lc" = "yes"; then deplibs="$deplibs -lc" fi ;; esac fi # Transform deplibs into only deplibs that can be linked in shared. name_save=$name libname_save=$libname release_save=$release versuffix_save=$versuffix major_save=$major # I'm not sure if I'm treating the release correctly. I think # release should show up in the -l (ie -lgmp5) so we don't want to # add it in twice. Is that correct? release="" versuffix="" major="" newdeplibs= droppeddeps=no case $deplibs_check_method in pass_all) # Don't check for shared/static. Everything works. # This might be a little naive. We might want to check # whether the library exists or not. But this is on # osf3 & osf4 and I'm not really sure... Just # implementing what was already the behavior. newdeplibs=$deplibs ;; test_compile) # This code stresses the "libraries are programs" paradigm to its # limits. Maybe even breaks it. We compile a program, linking it # against the deplibs as a proxy for the library. Then we can check # whether they linked in statically or dynamically with ldd. $opt_dry_run || $RM conftest.c cat > conftest.c </dev/null` for potent_lib in $potential_libs; do # Follow soft links. if ls -lLd "$potent_lib" 2>/dev/null | $GREP " -> " >/dev/null; then continue fi # The statement above tries to avoid entering an # endless loop below, in case of cyclic links. # We might still enter an endless loop, since a link # loop can be closed while we follow links, # but so what? potlib="$potent_lib" while test -h "$potlib" 2>/dev/null; do potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'` case $potliblink in [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";; *) potlib=`$ECHO "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";; esac done if eval $file_magic_cmd \"\$potlib\" 2>/dev/null | $SED -e 10q | $EGREP "$file_magic_regex" > /dev/null; then newdeplibs="$newdeplibs $a_deplib" a_deplib="" break 2 fi done done fi if test -n "$a_deplib" ; then droppeddeps=yes $ECHO $ECHO "*** Warning: linker path does not have real file for library $a_deplib." $ECHO "*** I have the capability to make that library automatically link in when" $ECHO "*** you link to this library. But I can only do this if you have a" $ECHO "*** shared version of the library, which you do not appear to have" $ECHO "*** because I did check the linker path looking for a file starting" if test -z "$potlib" ; then $ECHO "*** with $libname but no candidates were found. (...for file magic test)" else $ECHO "*** with $libname and none of the candidates passed a file format test" $ECHO "*** using a file magic. Last file checked: $potlib" fi fi ;; *) # Add a -L argument. newdeplibs="$newdeplibs $a_deplib" ;; esac done # Gone through all deplibs. ;; match_pattern*) set dummy $deplibs_check_method; shift match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` for a_deplib in $deplibs; do case $a_deplib in -l*) func_stripname -l '' "$a_deplib" name=$func_stripname_result if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $a_deplib "*) newdeplibs="$newdeplibs $a_deplib" a_deplib="" ;; esac fi if test -n "$a_deplib" ; then libname=`eval "\\$ECHO \"$libname_spec\""` for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do potential_libs=`ls $i/$libname[.-]* 2>/dev/null` for potent_lib in $potential_libs; do potlib="$potent_lib" # see symlink-check above in file_magic test if eval "\$ECHO \"X$potent_lib\"" 2>/dev/null | $Xsed -e 10q | \ $EGREP "$match_pattern_regex" > /dev/null; then newdeplibs="$newdeplibs $a_deplib" a_deplib="" break 2 fi done done fi if test -n "$a_deplib" ; then droppeddeps=yes $ECHO $ECHO "*** Warning: linker path does not have real file for library $a_deplib." $ECHO "*** I have the capability to make that library automatically link in when" $ECHO "*** you link to this library. But I can only do this if you have a" $ECHO "*** shared version of the library, which you do not appear to have" $ECHO "*** because I did check the linker path looking for a file starting" if test -z "$potlib" ; then $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)" else $ECHO "*** with $libname and none of the candidates passed a file format test" $ECHO "*** using a regex pattern. Last file checked: $potlib" fi fi ;; *) # Add a -L argument. newdeplibs="$newdeplibs $a_deplib" ;; esac done # Gone through all deplibs. ;; none | unknown | *) newdeplibs="" tmp_deplibs=`$ECHO "X $deplibs" | $Xsed \ -e 's/ -lc$//' -e 's/ -[LR][^ ]*//g'` if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then for i in $predeps $postdeps ; do # can't use Xsed below, because $i might contain '/' tmp_deplibs=`$ECHO "X $tmp_deplibs" | $Xsed -e "s,$i,,"` done fi if $ECHO "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' | $GREP . >/dev/null; then $ECHO if test "X$deplibs_check_method" = "Xnone"; then $ECHO "*** Warning: inter-library dependencies are not supported in this platform." else $ECHO "*** Warning: inter-library dependencies are not known to be supported." fi $ECHO "*** All declared inter-library dependencies are being dropped." droppeddeps=yes fi ;; esac versuffix=$versuffix_save major=$major_save release=$release_save libname=$libname_save name=$name_save case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library with the System framework newdeplibs=`$ECHO "X $newdeplibs" | $Xsed -e 's/ -lc / System.ltframework /'` ;; esac if test "$droppeddeps" = yes; then if test "$module" = yes; then $ECHO $ECHO "*** Warning: libtool could not satisfy all declared inter-library" $ECHO "*** dependencies of module $libname. Therefore, libtool will create" $ECHO "*** a static module, that should work as long as the dlopening" $ECHO "*** application is linked with the -dlopen flag." if test -z "$global_symbol_pipe"; then $ECHO $ECHO "*** However, this would only work if libtool was able to extract symbol" $ECHO "*** lists from a program, using \`nm' or equivalent, but libtool could" $ECHO "*** not find such a program. So, this module is probably useless." $ECHO "*** \`nm' from GNU binutils and a full rebuild may help." fi if test "$build_old_libs" = no; then oldlibs="$output_objdir/$libname.$libext" build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi else $ECHO "*** The inter-library dependencies that have been dropped here will be" $ECHO "*** automatically added whenever a program is linked with this library" $ECHO "*** or is declared to -dlopen it." if test "$allow_undefined" = no; then $ECHO $ECHO "*** Since this library must not contain undefined symbols," $ECHO "*** because either the platform does not support them or" $ECHO "*** it was explicitly requested with -no-undefined," $ECHO "*** libtool will only create a static version of it." if test "$build_old_libs" = no; then oldlibs="$output_objdir/$libname.$libext" build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi fi fi # Done checking deplibs! deplibs=$newdeplibs fi # Time to change all our "foo.ltframework" stuff back to "-framework foo" case $host in *-*-darwin*) newdeplibs=`$ECHO "X $newdeplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'` new_inherited_linker_flags=`$ECHO "X $new_inherited_linker_flags" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'` deplibs=`$ECHO "X $deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'` ;; esac # move library search paths that coincide with paths to not yet # installed libraries to the beginning of the library search list new_libs= for path in $notinst_path; do case " $new_libs " in *" -L$path/$objdir "*) ;; *) case " $deplibs " in *" -L$path/$objdir "*) new_libs="$new_libs -L$path/$objdir" ;; esac ;; esac done for deplib in $deplibs; do case $deplib in -L*) case " $new_libs " in *" $deplib "*) ;; *) new_libs="$new_libs $deplib" ;; esac ;; *) new_libs="$new_libs $deplib" ;; esac done deplibs="$new_libs" # All the library-specific variables (install_libdir is set above). library_names= old_library= dlname= # Test again, we may have decided not to build it any more if test "$build_libtool_libs" = yes; then if test "$hardcode_into_libs" = yes; then # Hardcode the library paths hardcode_libdirs= dep_rpath= rpath="$finalize_rpath" test "$mode" != relink && rpath="$compile_rpath$rpath" for libdir in $rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" dep_rpath="$dep_rpath $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) perm_rpath="$perm_rpath $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" if test -n "$hardcode_libdir_flag_spec_ld"; then eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\" else eval dep_rpath=\"$hardcode_libdir_flag_spec\" fi fi if test -n "$runpath_var" && test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do rpath="$rpath$dir:" done eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" fi test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" fi shlibpath="$finalize_shlibpath" test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath" if test -n "$shlibpath"; then eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" fi # Get the real and link names of the library. eval shared_ext=\"$shrext_cmds\" eval library_names=\"$library_names_spec\" set dummy $library_names shift realname="$1" shift if test -n "$soname_spec"; then eval soname=\"$soname_spec\" else soname="$realname" fi if test -z "$dlname"; then dlname=$soname fi lib="$output_objdir/$realname" linknames= for link do linknames="$linknames $link" done # Use standard objects if they are pic test -z "$pic_flag" && libobjs=`$ECHO "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` test "X$libobjs" = "X " && libobjs= delfiles= if test -n "$export_symbols" && test -n "$include_expsyms"; then $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp" export_symbols="$output_objdir/$libname.uexp" delfiles="$delfiles $export_symbols" fi orig_export_symbols= case $host_os in cygwin* | mingw* | cegcc*) if test -n "$export_symbols" && test -z "$export_symbols_regex"; then # exporting using user supplied symfile if test "x`$SED 1q $export_symbols`" != xEXPORTS; then # and it's NOT already a .def file. Must figure out # which of the given symbols are data symbols and tag # them as such. So, trigger use of export_symbols_cmds. # export_symbols gets reassigned inside the "prepare # the list of exported symbols" if statement, so the # include_expsyms logic still works. orig_export_symbols="$export_symbols" export_symbols= always_export_symbols=yes fi fi ;; esac # Prepare the list of exported symbols if test -z "$export_symbols"; then if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then func_verbose "generating symbol list for \`$libname.la'" export_symbols="$output_objdir/$libname.exp" $opt_dry_run || $RM $export_symbols cmds=$export_symbols_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" func_len " $cmd" len=$func_len_result if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then func_show_eval "$cmd" 'exit $?' skipped_export=false else # The command line is too long to execute in one step. func_verbose "using reloadable object file for export list..." skipped_export=: # Break out early, otherwise skipped_export may be # set to false by a later but shorter cmd. break fi done IFS="$save_ifs" if test -n "$export_symbols_regex" && test "X$skipped_export" != "X:"; then func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' func_show_eval '$MV "${export_symbols}T" "$export_symbols"' fi fi fi if test -n "$export_symbols" && test -n "$include_expsyms"; then tmp_export_symbols="$export_symbols" test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols" $opt_dry_run || eval '$ECHO "X$include_expsyms" | $Xsed | $SP2NL >> "$tmp_export_symbols"' fi if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then # The given exports_symbols file has to be filtered, so filter it. func_verbose "filter symbol list for \`$libname.la' to tag DATA exports" # FIXME: $output_objdir/$libname.filter potentially contains lots of # 's' commands which not all seds can handle. GNU sed should be fine # though. Also, the filter scales superlinearly with the number of # global variables. join(1) would be nice here, but unfortunately # isn't a blessed tool. $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter delfiles="$delfiles $export_symbols $output_objdir/$libname.filter" export_symbols=$output_objdir/$libname.def $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols fi tmp_deplibs= for test_deplib in $deplibs; do case " $convenience " in *" $test_deplib "*) ;; *) tmp_deplibs="$tmp_deplibs $test_deplib" ;; esac done deplibs="$tmp_deplibs" if test -n "$convenience"; then if test -n "$whole_archive_flag_spec" && test "$compiler_needs_object" = yes && test -z "$libobjs"; then # extract the archives, so we have objects to list. # TODO: could optimize this to just extract one archive. whole_archive_flag_spec= fi if test -n "$whole_archive_flag_spec"; then save_libobjs=$libobjs eval libobjs=\"\$libobjs $whole_archive_flag_spec\" test "X$libobjs" = "X " && libobjs= else gentop="$output_objdir/${outputname}x" generated="$generated $gentop" func_extract_archives $gentop $convenience libobjs="$libobjs $func_extract_archives_result" test "X$libobjs" = "X " && libobjs= fi fi if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then eval flag=\"$thread_safe_flag_spec\" linker_flags="$linker_flags $flag" fi # Make a backup of the uninstalled library when relinking if test "$mode" = relink; then $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $? fi # Do each of the archive commands. if test "$module" = yes && test -n "$module_cmds" ; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then eval test_cmds=\"$module_expsym_cmds\" cmds=$module_expsym_cmds else eval test_cmds=\"$module_cmds\" cmds=$module_cmds fi else if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then eval test_cmds=\"$archive_expsym_cmds\" cmds=$archive_expsym_cmds else eval test_cmds=\"$archive_cmds\" cmds=$archive_cmds fi fi if test "X$skipped_export" != "X:" && func_len " $test_cmds" && len=$func_len_result && test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then : else # The command line is too long to link in one step, link piecewise # or, if using GNU ld and skipped_export is not :, use a linker # script. # Save the value of $output and $libobjs because we want to # use them later. If we have whole_archive_flag_spec, we # want to use save_libobjs as it was before # whole_archive_flag_spec was expanded, because we can't # assume the linker understands whole_archive_flag_spec. # This may have to be revisited, in case too many # convenience libraries get linked in and end up exceeding # the spec. if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then save_libobjs=$libobjs fi save_output=$output output_la=`$ECHO "X$output" | $Xsed -e "$basename"` # Clear the reloadable object creation command queue and # initialize k to one. test_cmds= concat_cmds= objlist= last_robj= k=1 if test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "$with_gnu_ld" = yes; then output=${output_objdir}/${output_la}.lnkscript func_verbose "creating GNU ld script: $output" $ECHO 'INPUT (' > $output for obj in $save_libobjs do $ECHO "$obj" >> $output done $ECHO ')' >> $output delfiles="$delfiles $output" elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then output=${output_objdir}/${output_la}.lnk func_verbose "creating linker input file list: $output" : > $output set x $save_libobjs shift firstobj= if test "$compiler_needs_object" = yes; then firstobj="$1 " shift fi for obj do $ECHO "$obj" >> $output done delfiles="$delfiles $output" output=$firstobj\"$file_list_spec$output\" else if test -n "$save_libobjs"; then func_verbose "creating reloadable object files..." output=$output_objdir/$output_la-${k}.$objext eval test_cmds=\"$reload_cmds\" func_len " $test_cmds" len0=$func_len_result len=$len0 # Loop over the list of objects to be linked. for obj in $save_libobjs do func_len " $obj" func_arith $len + $func_len_result len=$func_arith_result if test "X$objlist" = X || test "$len" -lt "$max_cmd_len"; then func_append objlist " $obj" else # The command $test_cmds is almost too long, add a # command to the queue. if test "$k" -eq 1 ; then # The first file doesn't have a previous command to add. eval concat_cmds=\"$reload_cmds $objlist $last_robj\" else # All subsequent reloadable object files will link in # the last one created. eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj~\$RM $last_robj\" fi last_robj=$output_objdir/$output_la-${k}.$objext func_arith $k + 1 k=$func_arith_result output=$output_objdir/$output_la-${k}.$objext objlist=$obj func_len " $last_robj" func_arith $len0 + $func_len_result len=$func_arith_result fi done # Handle the remaining objects by creating one last # reloadable object file. All subsequent reloadable object # files will link in the last one created. test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\" if test -n "$last_robj"; then eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\" fi delfiles="$delfiles $output" else output= fi if ${skipped_export-false}; then func_verbose "generating symbol list for \`$libname.la'" export_symbols="$output_objdir/$libname.exp" $opt_dry_run || $RM $export_symbols libobjs=$output # Append the command to create the export file. test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\" if test -n "$last_robj"; then eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\" fi fi test -n "$save_libobjs" && func_verbose "creating a temporary reloadable object file: $output" # Loop through the commands generated above and execute them. save_ifs="$IFS"; IFS='~' for cmd in $concat_cmds; do IFS="$save_ifs" $opt_silent || { func_quote_for_expand "$cmd" eval "func_echo $func_quote_for_expand_result" } $opt_dry_run || eval "$cmd" || { lt_exit=$? # Restore the uninstalled library and exit if test "$mode" = relink; then ( cd "$output_objdir" && \ $RM "${realname}T" && \ $MV "${realname}U" "$realname" ) fi exit $lt_exit } done IFS="$save_ifs" if test -n "$export_symbols_regex" && ${skipped_export-false}; then func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' func_show_eval '$MV "${export_symbols}T" "$export_symbols"' fi fi if ${skipped_export-false}; then if test -n "$export_symbols" && test -n "$include_expsyms"; then tmp_export_symbols="$export_symbols" test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols" $opt_dry_run || eval '$ECHO "X$include_expsyms" | $Xsed | $SP2NL >> "$tmp_export_symbols"' fi if test -n "$orig_export_symbols"; then # The given exports_symbols file has to be filtered, so filter it. func_verbose "filter symbol list for \`$libname.la' to tag DATA exports" # FIXME: $output_objdir/$libname.filter potentially contains lots of # 's' commands which not all seds can handle. GNU sed should be fine # though. Also, the filter scales superlinearly with the number of # global variables. join(1) would be nice here, but unfortunately # isn't a blessed tool. $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter delfiles="$delfiles $export_symbols $output_objdir/$libname.filter" export_symbols=$output_objdir/$libname.def $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols fi fi libobjs=$output # Restore the value of output. output=$save_output if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then eval libobjs=\"\$libobjs $whole_archive_flag_spec\" test "X$libobjs" = "X " && libobjs= fi # Expand the library linking commands again to reset the # value of $libobjs for piecewise linking. # Do each of the archive commands. if test "$module" = yes && test -n "$module_cmds" ; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then cmds=$module_expsym_cmds else cmds=$module_cmds fi else if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then cmds=$archive_expsym_cmds else cmds=$archive_cmds fi fi fi if test -n "$delfiles"; then # Append the command to remove temporary files to $cmds. eval cmds=\"\$cmds~\$RM $delfiles\" fi # Add any objects from preloaded convenience libraries if test -n "$dlprefiles"; then gentop="$output_objdir/${outputname}x" generated="$generated $gentop" func_extract_archives $gentop $dlprefiles libobjs="$libobjs $func_extract_archives_result" test "X$libobjs" = "X " && libobjs= fi save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $opt_silent || { func_quote_for_expand "$cmd" eval "func_echo $func_quote_for_expand_result" } $opt_dry_run || eval "$cmd" || { lt_exit=$? # Restore the uninstalled library and exit if test "$mode" = relink; then ( cd "$output_objdir" && \ $RM "${realname}T" && \ $MV "${realname}U" "$realname" ) fi exit $lt_exit } done IFS="$save_ifs" # Restore the uninstalled library and exit if test "$mode" = relink; then $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $? if test -n "$convenience"; then if test -z "$whole_archive_flag_spec"; then func_show_eval '${RM}r "$gentop"' fi fi exit $EXIT_SUCCESS fi # Create links to the real library. for linkname in $linknames; do if test "$realname" != "$linkname"; then func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?' fi done # If -module or -export-dynamic was specified, set the dlname. if test "$module" = yes || test "$export_dynamic" = yes; then # On all known operating systems, these are identical. dlname="$soname" fi fi ;; obj) if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then func_warning "\`-dlopen' is ignored for objects" fi case " $deplibs" in *\ -l* | *\ -L*) func_warning "\`-l' and \`-L' are ignored for objects" ;; esac test -n "$rpath" && \ func_warning "\`-rpath' is ignored for objects" test -n "$xrpath" && \ func_warning "\`-R' is ignored for objects" test -n "$vinfo" && \ func_warning "\`-version-info' is ignored for objects" test -n "$release" && \ func_warning "\`-release' is ignored for objects" case $output in *.lo) test -n "$objs$old_deplibs" && \ func_fatal_error "cannot build library object \`$output' from non-libtool objects" libobj=$output func_lo2o "$libobj" obj=$func_lo2o_result ;; *) libobj= obj="$output" ;; esac # Delete the old objects. $opt_dry_run || $RM $obj $libobj # Objects from convenience libraries. This assumes # single-version convenience libraries. Whenever we create # different ones for PIC/non-PIC, this we'll have to duplicate # the extraction. reload_conv_objs= gentop= # reload_cmds runs $LD directly, so let us get rid of # -Wl from whole_archive_flag_spec and hope we can get by with # turning comma into space.. wl= if test -n "$convenience"; then if test -n "$whole_archive_flag_spec"; then eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\" reload_conv_objs=$reload_objs\ `$ECHO "X$tmp_whole_archive_flags" | $Xsed -e 's|,| |g'` else gentop="$output_objdir/${obj}x" generated="$generated $gentop" func_extract_archives $gentop $convenience reload_conv_objs="$reload_objs $func_extract_archives_result" fi fi # Create the old-style object. reload_objs="$objs$old_deplibs "`$ECHO "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test output="$obj" func_execute_cmds "$reload_cmds" 'exit $?' # Exit if we aren't doing a library object file. if test -z "$libobj"; then if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi exit $EXIT_SUCCESS fi if test "$build_libtool_libs" != yes; then if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi # Create an invalid libtool object if no PIC, so that we don't # accidentally link it into a program. # $show "echo timestamp > $libobj" # $opt_dry_run || eval "echo timestamp > $libobj" || exit $? exit $EXIT_SUCCESS fi if test -n "$pic_flag" || test "$pic_mode" != default; then # Only do commands if we really have different PIC objects. reload_objs="$libobjs $reload_conv_objs" output="$libobj" func_execute_cmds "$reload_cmds" 'exit $?' fi if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi exit $EXIT_SUCCESS ;; prog) case $host in *cygwin*) func_stripname '' '.exe' "$output" output=$func_stripname_result.exe;; esac test -n "$vinfo" && \ func_warning "\`-version-info' is ignored for programs" test -n "$release" && \ func_warning "\`-release' is ignored for programs" test "$preload" = yes \ && test "$dlopen_support" = unknown \ && test "$dlopen_self" = unknown \ && test "$dlopen_self_static" = unknown && \ func_warning "\`LT_INIT([dlopen])' not used. Assuming no dlopen support." case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library is the System framework compile_deplibs=`$ECHO "X $compile_deplibs" | $Xsed -e 's/ -lc / System.ltframework /'` finalize_deplibs=`$ECHO "X $finalize_deplibs" | $Xsed -e 's/ -lc / System.ltframework /'` ;; esac case $host in *-*-darwin*) # Don't allow lazy linking, it breaks C++ global constructors # But is supposedly fixed on 10.4 or later (yay!). if test "$tagname" = CXX ; then case ${MACOSX_DEPLOYMENT_TARGET-10.0} in 10.[0123]) compile_command="$compile_command ${wl}-bind_at_load" finalize_command="$finalize_command ${wl}-bind_at_load" ;; esac fi # Time to change all our "foo.ltframework" stuff back to "-framework foo" compile_deplibs=`$ECHO "X $compile_deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'` finalize_deplibs=`$ECHO "X $finalize_deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'` ;; esac # move library search paths that coincide with paths to not yet # installed libraries to the beginning of the library search list new_libs= for path in $notinst_path; do case " $new_libs " in *" -L$path/$objdir "*) ;; *) case " $compile_deplibs " in *" -L$path/$objdir "*) new_libs="$new_libs -L$path/$objdir" ;; esac ;; esac done for deplib in $compile_deplibs; do case $deplib in -L*) case " $new_libs " in *" $deplib "*) ;; *) new_libs="$new_libs $deplib" ;; esac ;; *) new_libs="$new_libs $deplib" ;; esac done compile_deplibs="$new_libs" compile_command="$compile_command $compile_deplibs" finalize_command="$finalize_command $finalize_deplibs" if test -n "$rpath$xrpath"; then # If the user specified any rpath flags, then add them. for libdir in $rpath $xrpath; do # This is the magic to use -rpath. case "$finalize_rpath " in *" $libdir "*) ;; *) finalize_rpath="$finalize_rpath $libdir" ;; esac done fi # Now hardcode the library paths rpath= hardcode_libdirs= for libdir in $compile_rpath $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" rpath="$rpath $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) perm_rpath="$perm_rpath $libdir" ;; esac fi case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) testbindir=`${ECHO} "$libdir" | ${SED} -e 's*/lib$*/bin*'` case :$dllsearchpath: in *":$libdir:"*) ;; ::) dllsearchpath=$libdir;; *) dllsearchpath="$dllsearchpath:$libdir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; ::) dllsearchpath=$testbindir;; *) dllsearchpath="$dllsearchpath:$testbindir";; esac ;; esac done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval rpath=\" $hardcode_libdir_flag_spec\" fi compile_rpath="$rpath" rpath= hardcode_libdirs= for libdir in $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" rpath="$rpath $flag" fi elif test -n "$runpath_var"; then case "$finalize_perm_rpath " in *" $libdir "*) ;; *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval rpath=\" $hardcode_libdir_flag_spec\" fi finalize_rpath="$rpath" if test -n "$libobjs" && test "$build_old_libs" = yes; then # Transform all the library objects into standard objects. compile_command=`$ECHO "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` finalize_command=`$ECHO "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` fi func_generate_dlsyms "$outputname" "@PROGRAM@" "no" # template prelinking step if test -n "$prelink_cmds"; then func_execute_cmds "$prelink_cmds" 'exit $?' fi wrappers_required=yes case $host in *cygwin* | *mingw* ) if test "$build_libtool_libs" != yes; then wrappers_required=no fi ;; *cegcc) # Disable wrappers for cegcc, we are cross compiling anyway. wrappers_required=no ;; *) if test "$need_relink" = no || test "$build_libtool_libs" != yes; then wrappers_required=no fi ;; esac if test "$wrappers_required" = no; then # Replace the output file specification. compile_command=`$ECHO "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` link_command="$compile_command$compile_rpath" # We have no uninstalled library dependencies, so finalize right now. exit_status=0 func_show_eval "$link_command" 'exit_status=$?' # Delete the generated files. if test -f "$output_objdir/${outputname}S.${objext}"; then func_show_eval '$RM "$output_objdir/${outputname}S.${objext}"' fi exit $exit_status fi if test -n "$compile_shlibpath$finalize_shlibpath"; then compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command" fi if test -n "$finalize_shlibpath"; then finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command" fi compile_var= finalize_var= if test -n "$runpath_var"; then if test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do rpath="$rpath$dir:" done compile_var="$runpath_var=\"$rpath\$$runpath_var\" " fi if test -n "$finalize_perm_rpath"; then # We should set the runpath_var. rpath= for dir in $finalize_perm_rpath; do rpath="$rpath$dir:" done finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " fi fi if test "$no_install" = yes; then # We don't need to create a wrapper script. link_command="$compile_var$compile_command$compile_rpath" # Replace the output file specification. link_command=`$ECHO "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` # Delete the old output file. $opt_dry_run || $RM $output # Link the executable and exit func_show_eval "$link_command" 'exit $?' exit $EXIT_SUCCESS fi if test "$hardcode_action" = relink; then # Fast installation is not supported link_command="$compile_var$compile_command$compile_rpath" relink_command="$finalize_var$finalize_command$finalize_rpath" func_warning "this platform does not like uninstalled shared libraries" func_warning "\`$output' will be relinked during installation" else if test "$fast_install" != no; then link_command="$finalize_var$compile_command$finalize_rpath" if test "$fast_install" = yes; then relink_command=`$ECHO "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'` else # fast_install is set to needless relink_command= fi else link_command="$compile_var$compile_command$compile_rpath" relink_command="$finalize_var$finalize_command$finalize_rpath" fi fi # Replace the output file specification. link_command=`$ECHO "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` # Delete the old output files. $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname func_show_eval "$link_command" 'exit $?' # Now create the wrapper script. func_verbose "creating $output" # Quote the relink command for shipping. if test -n "$relink_command"; then # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else func_quote_for_eval "$var_value" relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" fi done relink_command="(cd `pwd`; $relink_command)" relink_command=`$ECHO "X$relink_command" | $Xsed -e "$sed_quote_subst"` fi # Quote $ECHO for shipping. if test "X$ECHO" = "X$SHELL $progpath --fallback-echo"; then case $progpath in [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";; *) qecho="$SHELL `pwd`/$progpath --fallback-echo";; esac qecho=`$ECHO "X$qecho" | $Xsed -e "$sed_quote_subst"` else qecho=`$ECHO "X$ECHO" | $Xsed -e "$sed_quote_subst"` fi # Only actually do things if not in dry run mode. $opt_dry_run || { # win32 will think the script is a binary if it has # a .exe suffix, so we strip it off here. case $output in *.exe) func_stripname '' '.exe' "$output" output=$func_stripname_result ;; esac # test for cygwin because mv fails w/o .exe extensions case $host in *cygwin*) exeext=.exe func_stripname '' '.exe' "$outputname" outputname=$func_stripname_result ;; *) exeext= ;; esac case $host in *cygwin* | *mingw* ) func_dirname_and_basename "$output" "" "." output_name=$func_basename_result output_path=$func_dirname_result cwrappersource="$output_path/$objdir/lt-$output_name.c" cwrapper="$output_path/$output_name.exe" $RM $cwrappersource $cwrapper trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15 func_emit_cwrapperexe_src > $cwrappersource # The wrapper executable is built using the $host compiler, # because it contains $host paths and files. If cross- # compiling, it, like the target executable, must be # executed on the $host or under an emulation environment. $opt_dry_run || { $LTCC $LTCFLAGS -o $cwrapper $cwrappersource $STRIP $cwrapper } # Now, create the wrapper script for func_source use: func_ltwrapper_scriptname $cwrapper $RM $func_ltwrapper_scriptname_result trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15 $opt_dry_run || { # note: this script will not be executed, so do not chmod. if test "x$build" = "x$host" ; then $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result else func_emit_wrapper no > $func_ltwrapper_scriptname_result fi } ;; * ) $RM $output trap "$RM $output; exit $EXIT_FAILURE" 1 2 15 func_emit_wrapper no > $output chmod +x $output ;; esac } exit $EXIT_SUCCESS ;; esac # See if we need to build an old-fashioned archive. for oldlib in $oldlibs; do if test "$build_libtool_libs" = convenience; then oldobjs="$libobjs_save $symfileobj" addlibs="$convenience" build_libtool_libs=no else if test "$build_libtool_libs" = module; then oldobjs="$libobjs_save" build_libtool_libs=no else oldobjs="$old_deplibs $non_pic_objects" if test "$preload" = yes && test -f "$symfileobj"; then oldobjs="$oldobjs $symfileobj" fi fi addlibs="$old_convenience" fi if test -n "$addlibs"; then gentop="$output_objdir/${outputname}x" generated="$generated $gentop" func_extract_archives $gentop $addlibs oldobjs="$oldobjs $func_extract_archives_result" fi # Do each command in the archive commands. if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then cmds=$old_archive_from_new_cmds else # Add any objects from preloaded convenience libraries if test -n "$dlprefiles"; then gentop="$output_objdir/${outputname}x" generated="$generated $gentop" func_extract_archives $gentop $dlprefiles oldobjs="$oldobjs $func_extract_archives_result" fi # POSIX demands no paths to be encoded in archives. We have # to avoid creating archives with duplicate basenames if we # might have to extract them afterwards, e.g., when creating a # static archive out of a convenience library, or when linking # the entirety of a libtool archive into another (currently # not supported by libtool). if (for obj in $oldobjs do func_basename "$obj" $ECHO "$func_basename_result" done | sort | sort -uc >/dev/null 2>&1); then : else $ECHO "copying selected object files to avoid basename conflicts..." gentop="$output_objdir/${outputname}x" generated="$generated $gentop" func_mkdir_p "$gentop" save_oldobjs=$oldobjs oldobjs= counter=1 for obj in $save_oldobjs do func_basename "$obj" objbase="$func_basename_result" case " $oldobjs " in " ") oldobjs=$obj ;; *[\ /]"$objbase "*) while :; do # Make sure we don't pick an alternate name that also # overlaps. newobj=lt$counter-$objbase func_arith $counter + 1 counter=$func_arith_result case " $oldobjs " in *[\ /]"$newobj "*) ;; *) if test ! -f "$gentop/$newobj"; then break; fi ;; esac done func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj" oldobjs="$oldobjs $gentop/$newobj" ;; *) oldobjs="$oldobjs $obj" ;; esac done fi eval cmds=\"$old_archive_cmds\" func_len " $cmds" len=$func_len_result if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then cmds=$old_archive_cmds else # the command line is too long to link in one step, link in parts func_verbose "using piecewise archive linking..." save_RANLIB=$RANLIB RANLIB=: objlist= concat_cmds= save_oldobjs=$oldobjs oldobjs= # Is there a better way of finding the last object in the list? for obj in $save_oldobjs do last_oldobj=$obj done eval test_cmds=\"$old_archive_cmds\" func_len " $test_cmds" len0=$func_len_result len=$len0 for obj in $save_oldobjs do func_len " $obj" func_arith $len + $func_len_result len=$func_arith_result func_append objlist " $obj" if test "$len" -lt "$max_cmd_len"; then : else # the above command should be used before it gets too long oldobjs=$objlist if test "$obj" = "$last_oldobj" ; then RANLIB=$save_RANLIB fi test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\" objlist= len=$len0 fi done RANLIB=$save_RANLIB oldobjs=$objlist if test "X$oldobjs" = "X" ; then eval cmds=\"\$concat_cmds\" else eval cmds=\"\$concat_cmds~\$old_archive_cmds\" fi fi fi func_execute_cmds "$cmds" 'exit $?' done test -n "$generated" && \ func_show_eval "${RM}r$generated" # Now create the libtool archive. case $output in *.la) old_library= test "$build_old_libs" = yes && old_library="$libname.$libext" func_verbose "creating $output" # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else func_quote_for_eval "$var_value" relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" fi done # Quote the link command for shipping. relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" relink_command=`$ECHO "X$relink_command" | $Xsed -e "$sed_quote_subst"` if test "$hardcode_automatic" = yes ; then relink_command= fi # Only create the output if not a dry run. $opt_dry_run || { for installed in no yes; do if test "$installed" = yes; then if test -z "$install_libdir"; then break fi output="$output_objdir/$outputname"i # Replace all uninstalled libtool libraries with the installed ones newdependency_libs= for deplib in $dependency_libs; do case $deplib in *.la) func_basename "$deplib" name="$func_basename_result" eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` test -z "$libdir" && \ func_fatal_error "\`$deplib' is not a valid libtool archive" newdependency_libs="$newdependency_libs $libdir/$name" ;; *) newdependency_libs="$newdependency_libs $deplib" ;; esac done dependency_libs="$newdependency_libs" newdlfiles= for lib in $dlfiles; do case $lib in *.la) func_basename "$lib" name="$func_basename_result" eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` test -z "$libdir" && \ func_fatal_error "\`$lib' is not a valid libtool archive" newdlfiles="$newdlfiles $libdir/$name" ;; *) newdlfiles="$newdlfiles $lib" ;; esac done dlfiles="$newdlfiles" newdlprefiles= for lib in $dlprefiles; do case $lib in *.la) # Only pass preopened files to the pseudo-archive (for # eventual linking with the app. that links it) if we # didn't already link the preopened objects directly into # the library: func_basename "$lib" name="$func_basename_result" eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` test -z "$libdir" && \ func_fatal_error "\`$lib' is not a valid libtool archive" newdlprefiles="$newdlprefiles $libdir/$name" ;; esac done dlprefiles="$newdlprefiles" else newdlfiles= for lib in $dlfiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; *) abs=`pwd`"/$lib" ;; esac newdlfiles="$newdlfiles $abs" done dlfiles="$newdlfiles" newdlprefiles= for lib in $dlprefiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; *) abs=`pwd`"/$lib" ;; esac newdlprefiles="$newdlprefiles $abs" done dlprefiles="$newdlprefiles" fi $RM $output # place dlname in correct position for cygwin tdlname=$dlname case $host,$output,$installed,$module,$dlname in *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;; esac $ECHO > $output "\ # $outputname - a libtool library file # Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION # # Please DO NOT delete this file! # It is necessary for linking the library. # The name that we can dlopen(3). dlname='$tdlname' # Names of this library. library_names='$library_names' # The name of the static archive. old_library='$old_library' # Linker flags that can not go in dependency_libs. inherited_linker_flags='$new_inherited_linker_flags' # Libraries that this one depends upon. dependency_libs='$dependency_libs' # Names of additional weak libraries provided by this library weak_library_names='$weak_libs' # Version information for $libname. current=$current age=$age revision=$revision # Is this an already installed library? installed=$installed # Should we warn about portability when linking against -modules? shouldnotlink=$module # Files to dlopen/dlpreopen dlopen='$dlfiles' dlpreopen='$dlprefiles' # Directory that this library needs to be installed in: libdir='$install_libdir'" if test "$installed" = no && test "$need_relink" = yes; then $ECHO >> $output "\ relink_command=\"$relink_command\"" fi done } # Do a symbolic link so that the libtool archive can be found in # LD_LIBRARY_PATH before the program is installed. func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?' ;; esac exit $EXIT_SUCCESS } { test "$mode" = link || test "$mode" = relink; } && func_mode_link ${1+"$@"} # func_mode_uninstall arg... func_mode_uninstall () { $opt_debug RM="$nonopt" files= rmforce= exit_status=0 # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic="$magic" for arg do case $arg in -f) RM="$RM $arg"; rmforce=yes ;; -*) RM="$RM $arg" ;; *) files="$files $arg" ;; esac done test -z "$RM" && \ func_fatal_help "you must specify an RM program" rmdirs= origobjdir="$objdir" for file in $files; do func_dirname "$file" "" "." dir="$func_dirname_result" if test "X$dir" = X.; then objdir="$origobjdir" else objdir="$dir/$origobjdir" fi func_basename "$file" name="$func_basename_result" test "$mode" = uninstall && objdir="$dir" # Remember objdir for removal later, being careful to avoid duplicates if test "$mode" = clean; then case " $rmdirs " in *" $objdir "*) ;; *) rmdirs="$rmdirs $objdir" ;; esac fi # Don't error if the file doesn't exist and rm -f was used. if { test -L "$file"; } >/dev/null 2>&1 || { test -h "$file"; } >/dev/null 2>&1 || test -f "$file"; then : elif test -d "$file"; then exit_status=1 continue elif test "$rmforce" = yes; then continue fi rmfiles="$file" case $name in *.la) # Possibly a libtool archive, so verify it. if func_lalib_p "$file"; then func_source $dir/$name # Delete the libtool libraries and symlinks. for n in $library_names; do rmfiles="$rmfiles $objdir/$n" done test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library" case "$mode" in clean) case " $library_names " in # " " in the beginning catches empty $dlname *" $dlname "*) ;; *) rmfiles="$rmfiles $objdir/$dlname" ;; esac test -n "$libdir" && rmfiles="$rmfiles $objdir/$name $objdir/${name}i" ;; uninstall) if test -n "$library_names"; then # Do each command in the postuninstall commands. func_execute_cmds "$postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1' fi if test -n "$old_library"; then # Do each command in the old_postuninstall commands. func_execute_cmds "$old_postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1' fi # FIXME: should reinstall the best remaining shared library. ;; esac fi ;; *.lo) # Possibly a libtool object, so verify it. if func_lalib_p "$file"; then # Read the .lo file func_source $dir/$name # Add PIC object to the list of files to remove. if test -n "$pic_object" && test "$pic_object" != none; then rmfiles="$rmfiles $dir/$pic_object" fi # Add non-PIC object to the list of files to remove. if test -n "$non_pic_object" && test "$non_pic_object" != none; then rmfiles="$rmfiles $dir/$non_pic_object" fi fi ;; *) if test "$mode" = clean ; then noexename=$name case $file in *.exe) func_stripname '' '.exe' "$file" file=$func_stripname_result func_stripname '' '.exe' "$name" noexename=$func_stripname_result # $file with .exe has already been added to rmfiles, # add $file without .exe rmfiles="$rmfiles $file" ;; esac # Do a test to see if this is a libtool program. if func_ltwrapper_p "$file"; then if func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" relink_command= func_source $func_ltwrapper_scriptname_result rmfiles="$rmfiles $func_ltwrapper_scriptname_result" else relink_command= func_source $dir/$noexename fi # note $name still contains .exe if it was in $file originally # as does the version of $file that was added into $rmfiles rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}" if test "$fast_install" = yes && test -n "$relink_command"; then rmfiles="$rmfiles $objdir/lt-$name" fi if test "X$noexename" != "X$name" ; then rmfiles="$rmfiles $objdir/lt-${noexename}.c" fi fi fi ;; esac func_show_eval "$RM $rmfiles" 'exit_status=1' done objdir="$origobjdir" # Try to remove the ${objdir}s in the directories where we deleted files for dir in $rmdirs; do if test -d "$dir"; then func_show_eval "rmdir $dir >/dev/null 2>&1" fi done exit $exit_status } { test "$mode" = uninstall || test "$mode" = clean; } && func_mode_uninstall ${1+"$@"} test -z "$mode" && { help="$generic_help" func_fatal_help "you must specify a MODE" } test -z "$exec_cmd" && \ func_fatal_help "invalid operation mode \`$mode'" if test -n "$exec_cmd"; then eval exec "$exec_cmd" exit $EXIT_FAILURE fi exit $exit_status # The TAGs below are defined such that we never get into a situation # in which we disable both kinds of libraries. Given conflicting # choices, we go for a static library, that is the most portable, # since we can't tell whether shared libraries were disabled because # the user asked for that or because the platform doesn't support # them. This is particularly important on AIX, because we don't # support having both static and shared libraries enabled at the same # time on that platform, so we default to a shared-only configuration. # If a disable-shared tag is given, we'll fallback to a static-only # configuration. But we'll never go from static-only to shared-only. # ### BEGIN LIBTOOL TAG CONFIG: disable-shared build_libtool_libs=no build_old_libs=yes # ### END LIBTOOL TAG CONFIG: disable-shared # ### BEGIN LIBTOOL TAG CONFIG: disable-static build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac` # ### END LIBTOOL TAG CONFIG: disable-static # Local Variables: # mode:shell-script # sh-indentation:2 # End: # vi:sw=2 wxedid-0.0.32/m4/0000755000175000017500000000000014722720160010402 500000000000000wxedid-0.0.32/m4/libtool.m40000755000175000017500000077464714722720160012264 00000000000000# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, # 2006, 2007, 2008 Free Software Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # 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. m4_define([_LT_COPYING], [dnl # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, # 2006, 2007, 2008 Free Software Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is part of GNU Libtool. # # GNU Libtool 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. # # As a special exception to the GNU General Public License, # if you distribute this file as part of a program or library that # is built using GNU Libtool, you may include this file under the # same distribution terms that you use for the rest of that program. # # GNU Libtool 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 GNU Libtool; see the file COPYING. If not, a copy # can be downloaded from http://www.gnu.org/licenses/gpl.html, or # obtained by writing to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ]) # serial 56 LT_INIT # LT_PREREQ(VERSION) # ------------------ # Complain and exit if this libtool version is less that VERSION. m4_defun([LT_PREREQ], [m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1, [m4_default([$3], [m4_fatal([Libtool version $1 or higher is required], 63)])], [$2])]) # _LT_CHECK_BUILDDIR # ------------------ # Complain if the absolute build directory name contains unusual characters m4_defun([_LT_CHECK_BUILDDIR], [case `pwd` in *\ * | *\ *) AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;; esac ]) # LT_INIT([OPTIONS]) # ------------------ AC_DEFUN([LT_INIT], [AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT AC_BEFORE([$0], [LT_LANG])dnl AC_BEFORE([$0], [LT_OUTPUT])dnl AC_BEFORE([$0], [LTDL_INIT])dnl m4_require([_LT_CHECK_BUILDDIR])dnl dnl Autoconf doesn't catch unexpanded LT_ macros by default: m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4 dnl unless we require an AC_DEFUNed macro: AC_REQUIRE([LTOPTIONS_VERSION])dnl AC_REQUIRE([LTSUGAR_VERSION])dnl AC_REQUIRE([LTVERSION_VERSION])dnl AC_REQUIRE([LTOBSOLETE_VERSION])dnl m4_require([_LT_PROG_LTMAIN])dnl dnl Parse OPTIONS _LT_SET_OPTIONS([$0], [$1]) # This can be used to rebuild libtool when needed LIBTOOL_DEPS="$ltmain" # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' AC_SUBST(LIBTOOL)dnl _LT_SETUP # Only expand once: m4_define([LT_INIT]) ])# LT_INIT # Old names: AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT]) AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_PROG_LIBTOOL], []) dnl AC_DEFUN([AM_PROG_LIBTOOL], []) # _LT_CC_BASENAME(CC) # ------------------- # Calculate cc_basename. Skip known compiler wrappers and cross-prefix. m4_defun([_LT_CC_BASENAME], [for cc_temp in $1""; do case $cc_temp in compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$ECHO "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` ]) # _LT_FILEUTILS_DEFAULTS # ---------------------- # It is okay to use these file commands and assume they have been set # sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'. m4_defun([_LT_FILEUTILS_DEFAULTS], [: ${CP="cp -f"} : ${MV="mv -f"} : ${RM="rm -f"} ])# _LT_FILEUTILS_DEFAULTS # _LT_SETUP # --------- m4_defun([_LT_SETUP], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl _LT_DECL([], [host_alias], [0], [The host system])dnl _LT_DECL([], [host], [0])dnl _LT_DECL([], [host_os], [0])dnl dnl _LT_DECL([], [build_alias], [0], [The build system])dnl _LT_DECL([], [build], [0])dnl _LT_DECL([], [build_os], [0])dnl dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([LT_PATH_LD])dnl AC_REQUIRE([LT_PATH_NM])dnl dnl AC_REQUIRE([AC_PROG_LN_S])dnl test -z "$LN_S" && LN_S="ln -s" _LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl dnl AC_REQUIRE([LT_CMD_MAX_LEN])dnl _LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl _LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_CHECK_SHELL_FEATURES])dnl m4_require([_LT_CMD_RELOAD])dnl m4_require([_LT_CHECK_MAGIC_METHOD])dnl m4_require([_LT_CMD_OLD_ARCHIVE])dnl m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl _LT_CONFIG_LIBTOOL_INIT([ # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes INIT. if test -n "\${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi ]) if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi _LT_CHECK_OBJDIR m4_require([_LT_TAG_COMPILER])dnl _LT_PROG_ECHO_BACKSLASH case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. sed_quote_subst='s/\([["`$\\]]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\([["`\\]]\)/\\\1/g' # Sed substitution to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # Sed substitution to delay expansion of an escaped single quote. delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' # Sed substitution to avoid accidental globbing in evaled expressions no_glob_subst='s/\*/\\\*/g' # Global variables: ofile=libtool can_build_shared=yes # All known linkers require a `.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a with_gnu_ld="$lt_cv_prog_gnu_ld" old_CC="$CC" old_CFLAGS="$CFLAGS" # Set sane defaults for various variables test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS test -z "$LD" && LD=ld test -z "$ac_objext" && ac_objext=o _LT_CC_BASENAME([$compiler]) # Only perform the check for file, if the check method requires it test -z "$MAGIC_CMD" && MAGIC_CMD=file case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then _LT_PATH_MAGIC fi ;; esac # Use C for the default configuration in the libtool script LT_SUPPORTED_TAG([CC]) _LT_LANG_C_CONFIG _LT_LANG_DEFAULT_CONFIG _LT_CONFIG_COMMANDS ])# _LT_SETUP # _LT_PROG_LTMAIN # --------------- # Note that this code is called both from `configure', and `config.status' # now that we use AC_CONFIG_COMMANDS to generate libtool. Notably, # `config.status' has no value for ac_aux_dir unless we are using Automake, # so we pass a copy along to make sure it has a sensible value anyway. m4_defun([_LT_PROG_LTMAIN], [m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl _LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir']) ltmain="$ac_aux_dir/ltmain.sh" ])# _LT_PROG_LTMAIN ## ------------------------------------- ## ## Accumulate code for creating libtool. ## ## ------------------------------------- ## # So that we can recreate a full libtool script including additional # tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS # in macros and then make a single call at the end using the `libtool' # label. # _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS]) # ---------------------------------------- # Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later. m4_define([_LT_CONFIG_LIBTOOL_INIT], [m4_ifval([$1], [m4_append([_LT_OUTPUT_LIBTOOL_INIT], [$1 ])])]) # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_INIT]) # _LT_CONFIG_LIBTOOL([COMMANDS]) # ------------------------------ # Register COMMANDS to be passed to AC_CONFIG_COMMANDS later. m4_define([_LT_CONFIG_LIBTOOL], [m4_ifval([$1], [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS], [$1 ])])]) # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS]) # _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS]) # ----------------------------------------------------- m4_defun([_LT_CONFIG_SAVE_COMMANDS], [_LT_CONFIG_LIBTOOL([$1]) _LT_CONFIG_LIBTOOL_INIT([$2]) ]) # _LT_FORMAT_COMMENT([COMMENT]) # ----------------------------- # Add leading comment marks to the start of each line, and a trailing # full-stop to the whole comment if one is not present already. m4_define([_LT_FORMAT_COMMENT], [m4_ifval([$1], [ m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])], [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.]) )]) ## ------------------------ ## ## FIXME: Eliminate VARNAME ## ## ------------------------ ## # _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?]) # ------------------------------------------------------------------- # CONFIGNAME is the name given to the value in the libtool script. # VARNAME is the (base) name used in the configure script. # VALUE may be 0, 1 or 2 for a computed quote escaped value based on # VARNAME. Any other value will be used directly. m4_define([_LT_DECL], [lt_if_append_uniq([lt_decl_varnames], [$2], [, ], [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name], [m4_ifval([$1], [$1], [$2])]) lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3]) m4_ifval([$4], [lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])]) lt_dict_add_subkey([lt_decl_dict], [$2], [tagged?], [m4_ifval([$5], [yes], [no])])]) ]) # _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION]) # -------------------------------------------------------- m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])]) # lt_decl_tag_varnames([SEPARATOR], [VARNAME1...]) # ------------------------------------------------ m4_define([lt_decl_tag_varnames], [_lt_decl_filter([tagged?], [yes], $@)]) # _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..]) # --------------------------------------------------------- m4_define([_lt_decl_filter], [m4_case([$#], [0], [m4_fatal([$0: too few arguments: $#])], [1], [m4_fatal([$0: too few arguments: $#: $1])], [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)], [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)], [lt_dict_filter([lt_decl_dict], $@)])[]dnl ]) # lt_decl_quote_varnames([SEPARATOR], [VARNAME1...]) # -------------------------------------------------- m4_define([lt_decl_quote_varnames], [_lt_decl_filter([value], [1], $@)]) # lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...]) # --------------------------------------------------- m4_define([lt_decl_dquote_varnames], [_lt_decl_filter([value], [2], $@)]) # lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...]) # --------------------------------------------------- m4_define([lt_decl_varnames_tagged], [m4_assert([$# <= 2])dnl _$0(m4_quote(m4_default([$1], [[, ]])), m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]), m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))]) m4_define([_lt_decl_varnames_tagged], [m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])]) # lt_decl_all_varnames([SEPARATOR], [VARNAME1...]) # ------------------------------------------------ m4_define([lt_decl_all_varnames], [_$0(m4_quote(m4_default([$1], [[, ]])), m4_if([$2], [], m4_quote(lt_decl_varnames), m4_quote(m4_shift($@))))[]dnl ]) m4_define([_lt_decl_all_varnames], [lt_join($@, lt_decl_varnames_tagged([$1], lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl ]) # _LT_CONFIG_STATUS_DECLARE([VARNAME]) # ------------------------------------ # Quote a variable value, and forward it to `config.status' so that its # declaration there will have the same value as in `configure'. VARNAME # must have a single quote delimited value for this to work. m4_define([_LT_CONFIG_STATUS_DECLARE], [$1='`$ECHO "X$][$1" | $Xsed -e "$delay_single_quote_subst"`']) # _LT_CONFIG_STATUS_DECLARATIONS # ------------------------------ # We delimit libtool config variables with single quotes, so when # we write them to config.status, we have to be sure to quote all # embedded single quotes properly. In configure, this macro expands # each variable declared with _LT_DECL (and _LT_TAGDECL) into: # # ='`$ECHO "X$" | $Xsed -e "$delay_single_quote_subst"`' m4_defun([_LT_CONFIG_STATUS_DECLARATIONS], [m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames), [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])]) # _LT_LIBTOOL_TAGS # ---------------- # Output comment and list of tags supported by the script m4_defun([_LT_LIBTOOL_TAGS], [_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl available_tags="_LT_TAGS"dnl ]) # _LT_LIBTOOL_DECLARE(VARNAME, [TAG]) # ----------------------------------- # Extract the dictionary values for VARNAME (optionally with TAG) and # expand to a commented shell variable setting: # # # Some comment about what VAR is for. # visible_name=$lt_internal_name m4_define([_LT_LIBTOOL_DECLARE], [_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [description])))[]dnl m4_pushdef([_libtool_name], m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])), [0], [_libtool_name=[$]$1], [1], [_libtool_name=$lt_[]$1], [2], [_libtool_name=$lt_[]$1], [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl ]) # _LT_LIBTOOL_CONFIG_VARS # ----------------------- # Produce commented declarations of non-tagged libtool config variables # suitable for insertion in the LIBTOOL CONFIG section of the `libtool' # script. Tagged libtool config variables (even for the LIBTOOL CONFIG # section) are produced by _LT_LIBTOOL_TAG_VARS. m4_defun([_LT_LIBTOOL_CONFIG_VARS], [m4_foreach([_lt_var], m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)), [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])]) # _LT_LIBTOOL_TAG_VARS(TAG) # ------------------------- m4_define([_LT_LIBTOOL_TAG_VARS], [m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames), [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])]) # _LT_TAGVAR(VARNAME, [TAGNAME]) # ------------------------------ m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])]) # _LT_CONFIG_COMMANDS # ------------------- # Send accumulated output to $CONFIG_STATUS. Thanks to the lists of # variables for single and double quote escaping we saved from calls # to _LT_DECL, we can put quote escaped variables declarations # into `config.status', and then the shell code to quote escape them in # for loops in `config.status'. Finally, any additional code accumulated # from calls to _LT_CONFIG_LIBTOOL_INIT is expanded. m4_defun([_LT_CONFIG_COMMANDS], [AC_PROVIDE_IFELSE([LT_OUTPUT], dnl If the libtool generation code has been placed in $CONFIG_LT, dnl instead of duplicating it all over again into config.status, dnl then we will have config.status run $CONFIG_LT later, so it dnl needs to know what name is stored there: [AC_CONFIG_COMMANDS([libtool], [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])], dnl If the libtool generation code is destined for config.status, dnl expand the accumulated commands and init code now: [AC_CONFIG_COMMANDS([libtool], [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])]) ])#_LT_CONFIG_COMMANDS # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT], [ # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH sed_quote_subst='$sed_quote_subst' double_quote_subst='$double_quote_subst' delay_variable_subst='$delay_variable_subst' _LT_CONFIG_STATUS_DECLARATIONS LTCC='$LTCC' LTCFLAGS='$LTCFLAGS' compiler='$compiler_DEFAULT' # Quote evaled strings. for var in lt_decl_all_varnames([[ \ ]], lt_decl_quote_varnames); do case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in *[[\\\\\\\`\\"\\\$]]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done # Double-quote double-evaled strings. for var in lt_decl_all_varnames([[ \ ]], lt_decl_dquote_varnames); do case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in *[[\\\\\\\`\\"\\\$]]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done # Fix-up fallback echo if it was mangled by the above quoting rules. case \$lt_ECHO in *'\\\[$]0 --fallback-echo"')dnl " lt_ECHO=\`\$ECHO "X\$lt_ECHO" | \$Xsed -e 's/\\\\\\\\\\\\\\\[$]0 --fallback-echo"\[$]/\[$]0 --fallback-echo"/'\` ;; esac _LT_OUTPUT_LIBTOOL_INIT ]) # LT_OUTPUT # --------- # This macro allows early generation of the libtool script (before # AC_OUTPUT is called), incase it is used in configure for compilation # tests. AC_DEFUN([LT_OUTPUT], [: ${CONFIG_LT=./config.lt} AC_MSG_NOTICE([creating $CONFIG_LT]) cat >"$CONFIG_LT" <<_LTEOF #! $SHELL # Generated by $as_me. # Run this file to recreate a libtool stub with the current configuration. lt_cl_silent=false SHELL=\${CONFIG_SHELL-$SHELL} _LTEOF cat >>"$CONFIG_LT" <<\_LTEOF AS_SHELL_SANITIZE _AS_PREPARE exec AS_MESSAGE_FD>&1 exec AS_MESSAGE_LOG_FD>>config.log { echo AS_BOX([Running $as_me.]) } >&AS_MESSAGE_LOG_FD lt_cl_help="\ \`$as_me' creates a local libtool stub from the current configuration, for use in further configure time tests before the real libtool is generated. Usage: $[0] [[OPTIONS]] -h, --help print this help, then exit -V, --version print version number, then exit -q, --quiet do not print progress messages -d, --debug don't remove temporary files Report bugs to ." lt_cl_version="\ m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION]) configured by $[0], generated by m4_PACKAGE_STRING. Copyright (C) 2008 Free Software Foundation, Inc. This config.lt script is free software; the Free Software Foundation gives unlimited permision to copy, distribute and modify it." while test $[#] != 0 do case $[1] in --version | --v* | -V ) echo "$lt_cl_version"; exit 0 ;; --help | --h* | -h ) echo "$lt_cl_help"; exit 0 ;; --debug | --d* | -d ) debug=: ;; --quiet | --q* | --silent | --s* | -q ) lt_cl_silent=: ;; -*) AC_MSG_ERROR([unrecognized option: $[1] Try \`$[0] --help' for more information.]) ;; *) AC_MSG_ERROR([unrecognized argument: $[1] Try \`$[0] --help' for more information.]) ;; esac shift done if $lt_cl_silent; then exec AS_MESSAGE_FD>/dev/null fi _LTEOF cat >>"$CONFIG_LT" <<_LTEOF _LT_OUTPUT_LIBTOOL_COMMANDS_INIT _LTEOF cat >>"$CONFIG_LT" <<\_LTEOF AC_MSG_NOTICE([creating $ofile]) _LT_OUTPUT_LIBTOOL_COMMANDS AS_EXIT(0) _LTEOF chmod +x "$CONFIG_LT" # configure is writing to config.log, but config.lt does its own redirection, # appending to config.log, which fails on DOS, as config.log is still kept # open by configure. Here we exec the FD to /dev/null, effectively closing # config.log, so it can be properly (re)opened and appended to by config.lt. if test "$no_create" != yes; then lt_cl_success=: test "$silent" = yes && lt_config_lt_args="$lt_config_lt_args --quiet" exec AS_MESSAGE_LOG_FD>/dev/null $SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false exec AS_MESSAGE_LOG_FD>>config.log $lt_cl_success || AS_EXIT(1) fi ])# LT_OUTPUT # _LT_CONFIG(TAG) # --------------- # If TAG is the built-in tag, create an initial libtool script with a # default configuration from the untagged config vars. Otherwise add code # to config.status for appending the configuration named by TAG from the # matching tagged config vars. m4_defun([_LT_CONFIG], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl _LT_CONFIG_SAVE_COMMANDS([ m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl m4_if(_LT_TAG, [C], [ # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi cfgfile="${ofile}T" trap "$RM \"$cfgfile\"; exit 1" 1 2 15 $RM "$cfgfile" cat <<_LT_EOF >> "$cfgfile" #! $SHELL # `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. # Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # NOTE: Changes made to this file will be lost: look at ltmain.sh. # _LT_COPYING _LT_LIBTOOL_TAGS # ### BEGIN LIBTOOL CONFIG _LT_LIBTOOL_CONFIG_VARS _LT_LIBTOOL_TAG_VARS # ### END LIBTOOL CONFIG _LT_EOF case $host_os in aix3*) cat <<\_LT_EOF >> "$cfgfile" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi _LT_EOF ;; esac _LT_PROG_LTMAIN # We use sed instead of cat because bash on DJGPP gets confused if # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? sed '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) _LT_PROG_XSI_SHELLFNS sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" ], [cat <<_LT_EOF >> "$ofile" dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded dnl in a comment (ie after a #). # ### BEGIN LIBTOOL TAG CONFIG: $1 _LT_LIBTOOL_TAG_VARS(_LT_TAG) # ### END LIBTOOL TAG CONFIG: $1 _LT_EOF ])dnl /m4_if ], [m4_if([$1], [], [ PACKAGE='$PACKAGE' VERSION='$VERSION' TIMESTAMP='$TIMESTAMP' RM='$RM' ofile='$ofile'], []) ])dnl /_LT_CONFIG_SAVE_COMMANDS ])# _LT_CONFIG # LT_SUPPORTED_TAG(TAG) # --------------------- # Trace this macro to discover what tags are supported by the libtool # --tag option, using: # autoconf --trace 'LT_SUPPORTED_TAG:$1' AC_DEFUN([LT_SUPPORTED_TAG], []) # C support is built-in for now m4_define([_LT_LANG_C_enabled], []) m4_define([_LT_TAGS], []) # LT_LANG(LANG) # ------------- # Enable libtool support for the given language if not already enabled. AC_DEFUN([LT_LANG], [AC_BEFORE([$0], [LT_OUTPUT])dnl m4_case([$1], [C], [_LT_LANG(C)], [C++], [_LT_LANG(CXX)], [Java], [_LT_LANG(GCJ)], [Fortran 77], [_LT_LANG(F77)], [Fortran], [_LT_LANG(FC)], [Windows Resource], [_LT_LANG(RC)], [m4_ifdef([_LT_LANG_]$1[_CONFIG], [_LT_LANG($1)], [m4_fatal([$0: unsupported language: "$1"])])])dnl ])# LT_LANG # _LT_LANG(LANGNAME) # ------------------ m4_defun([_LT_LANG], [m4_ifdef([_LT_LANG_]$1[_enabled], [], [LT_SUPPORTED_TAG([$1])dnl m4_append([_LT_TAGS], [$1 ])dnl m4_define([_LT_LANG_]$1[_enabled], [])dnl _LT_LANG_$1_CONFIG($1)])dnl ])# _LT_LANG # _LT_LANG_DEFAULT_CONFIG # ----------------------- m4_defun([_LT_LANG_DEFAULT_CONFIG], [AC_PROVIDE_IFELSE([AC_PROG_CXX], [LT_LANG(CXX)], [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])]) AC_PROVIDE_IFELSE([AC_PROG_F77], [LT_LANG(F77)], [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])]) AC_PROVIDE_IFELSE([AC_PROG_FC], [LT_LANG(FC)], [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])]) dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal dnl pulling things in needlessly. AC_PROVIDE_IFELSE([AC_PROG_GCJ], [LT_LANG(GCJ)], [AC_PROVIDE_IFELSE([A][M_PROG_GCJ], [LT_LANG(GCJ)], [AC_PROVIDE_IFELSE([LT_PROG_GCJ], [LT_LANG(GCJ)], [m4_ifdef([AC_PROG_GCJ], [m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])]) m4_ifdef([A][M_PROG_GCJ], [m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])]) m4_ifdef([LT_PROG_GCJ], [m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])]) AC_PROVIDE_IFELSE([LT_PROG_RC], [LT_LANG(RC)], [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])]) ])# _LT_LANG_DEFAULT_CONFIG # Obsolete macros: AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)]) AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)]) AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)]) AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_CXX], []) dnl AC_DEFUN([AC_LIBTOOL_F77], []) dnl AC_DEFUN([AC_LIBTOOL_FC], []) dnl AC_DEFUN([AC_LIBTOOL_GCJ], []) # _LT_TAG_COMPILER # ---------------- m4_defun([_LT_TAG_COMPILER], [AC_REQUIRE([AC_PROG_CC])dnl _LT_DECL([LTCC], [CC], [1], [A C compiler])dnl _LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl _LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl _LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC ])# _LT_TAG_COMPILER # _LT_COMPILER_BOILERPLATE # ------------------------ # Check for compiler boilerplate output or warnings with # the simple compiler test code. m4_defun([_LT_COMPILER_BOILERPLATE], [m4_require([_LT_DECL_SED])dnl ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $RM conftest* ])# _LT_COMPILER_BOILERPLATE # _LT_LINKER_BOILERPLATE # ---------------------- # Check for linker boilerplate output or warnings with # the simple link test code. m4_defun([_LT_LINKER_BOILERPLATE], [m4_require([_LT_DECL_SED])dnl ac_outfile=conftest.$ac_objext echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $RM -r conftest* ])# _LT_LINKER_BOILERPLATE # _LT_REQUIRED_DARWIN_CHECKS # ------------------------- m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[ case $host_os in rhapsody* | darwin*) AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:]) AC_CHECK_TOOL([NMEDIT], [nmedit], [:]) AC_CHECK_TOOL([LIPO], [lipo], [:]) AC_CHECK_TOOL([OTOOL], [otool], [:]) AC_CHECK_TOOL([OTOOL64], [otool64], [:]) _LT_DECL([], [DSYMUTIL], [1], [Tool to manipulate archived DWARF debug symbol files on Mac OS X]) _LT_DECL([], [NMEDIT], [1], [Tool to change global to local symbols on Mac OS X]) _LT_DECL([], [LIPO], [1], [Tool to manipulate fat objects and archives on Mac OS X]) _LT_DECL([], [OTOOL], [1], [ldd/readelf like tool for Mach-O binaries on Mac OS X]) _LT_DECL([], [OTOOL64], [1], [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4]) AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod], [lt_cv_apple_cc_single_mod=no if test -z "${LT_MULTI_MODULE}"; then # By default we will add the -single_module flag. You can override # by either setting the environment variable LT_MULTI_MODULE # non-empty at configure time, or by adding -multi_module to the # link flags. rm -rf libconftest.dylib* echo "int foo(void){return 1;}" > conftest.c echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err _lt_result=$? if test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 0; then lt_cv_apple_cc_single_mod=yes else cat conftest.err >&AS_MESSAGE_LOG_FD fi rm -rf libconftest.dylib* rm -f conftest.* fi]) AC_CACHE_CHECK([for -exported_symbols_list linker flag], [lt_cv_ld_exported_symbols_list], [lt_cv_ld_exported_symbols_list=no save_LDFLAGS=$LDFLAGS echo "_main" > conftest.sym LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], [lt_cv_ld_exported_symbols_list=yes], [lt_cv_ld_exported_symbols_list=no]) LDFLAGS="$save_LDFLAGS" ]) case $host_os in rhapsody* | darwin1.[[012]]) _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; darwin1.*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; darwin*) # darwin 5.x on # if running on 10.5 or later, the deployment target defaults # to the OS version, if on x86, and 10.4, the deployment # target defaults to 10.4. Don't you love it? case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in 10.0,*86*-darwin8*|10.0,*-darwin[[91]]*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; 10.[[012]]*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; esac ;; esac if test "$lt_cv_apple_cc_single_mod" = "yes"; then _lt_dar_single_mod='$single_module' fi if test "$lt_cv_ld_exported_symbols_list" = "yes"; then _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' else _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' fi if test "$DSYMUTIL" != ":"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= fi ;; esac ]) # _LT_DARWIN_LINKER_FEATURES # -------------------------- # Checks for linker and compiler features on darwin m4_defun([_LT_DARWIN_LINKER_FEATURES], [ m4_require([_LT_REQUIRED_DARWIN_CHECKS]) _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_TAGVAR(whole_archive_flag_spec, $1)='' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined" case $cc_basename in ifort*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test "$_lt_dar_can_shared" = "yes"; then output_verbose_link_cmd=echo _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" m4_if([$1], [CXX], [ if test "$lt_cv_apple_cc_single_mod" != "yes"; then _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}" _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}" fi ],[]) else _LT_TAGVAR(ld_shlibs, $1)=no fi ]) # _LT_SYS_MODULE_PATH_AIX # ----------------------- # Links a minimal program and checks the executable # for the system default hardcoded library path. In most cases, # this is /usr/lib:/lib, but when the MPI compilers are used # the location of the communication and MPI libs are included too. # If we don't find anything, use the default library path according # to the aix ld manual. m4_defun([_LT_SYS_MODULE_PATH_AIX], [m4_require([_LT_DECL_SED])dnl AC_LINK_IFELSE(AC_LANG_PROGRAM,[ lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/ p } }' aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi],[]) if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi ])# _LT_SYS_MODULE_PATH_AIX # _LT_SHELL_INIT(ARG) # ------------------- m4_define([_LT_SHELL_INIT], [ifdef([AC_DIVERSION_NOTICE], [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)], [AC_DIVERT_PUSH(NOTICE)]) $1 AC_DIVERT_POP ])# _LT_SHELL_INIT # _LT_PROG_ECHO_BACKSLASH # ----------------------- # Add some code to the start of the generated configure script which # will find an echo command which doesn't interpret backslashes. m4_defun([_LT_PROG_ECHO_BACKSLASH], [_LT_SHELL_INIT([ # Check that we are running under the correct shell. SHELL=${CONFIG_SHELL-/bin/sh} case X$lt_ECHO in X*--fallback-echo) # Remove one level of quotation (which was required for Make). ECHO=`echo "$lt_ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','` ;; esac ECHO=${lt_ECHO-echo} if test "X[$]1" = X--no-reexec; then # Discard the --no-reexec flag, and continue. shift elif test "X[$]1" = X--fallback-echo; then # Avoid inline document here, it may be left over : elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' ; then # Yippee, $ECHO works! : else # Restart under the correct shell. exec $SHELL "[$]0" --no-reexec ${1+"[$]@"} fi if test "X[$]1" = X--fallback-echo; then # used as fallback echo shift cat <<_LT_EOF [$]* _LT_EOF exit 0 fi # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH if test -z "$lt_ECHO"; then if test "X${echo_test_string+set}" != Xset; then # find a string as large as possible, as long as the shell can cope with it for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ... if { echo_test_string=`eval $cmd`; } 2>/dev/null && { test "X$echo_test_string" = "X$echo_test_string"; } 2>/dev/null then break fi done fi if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' && echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then : else # The Solaris, AIX, and Digital Unix default echo programs unquote # backslashes. This makes it impossible to quote backslashes using # echo "$something" | sed 's/\\/\\\\/g' # # So, first we look for a working echo in the user's PATH. lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for dir in $PATH /usr/ucb; do IFS="$lt_save_ifs" if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then ECHO="$dir/echo" break fi done IFS="$lt_save_ifs" if test "X$ECHO" = Xecho; then # We didn't find a better echo, so look for alternatives. if test "X`{ print -r '\t'; } 2>/dev/null`" = 'X\t' && echo_testing_string=`{ print -r "$echo_test_string"; } 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then # This shell has a builtin print -r that does the trick. ECHO='print -r' elif { test -f /bin/ksh || test -f /bin/ksh$ac_exeext; } && test "X$CONFIG_SHELL" != X/bin/ksh; then # If we have ksh, try running configure again with it. ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} export ORIGINAL_CONFIG_SHELL CONFIG_SHELL=/bin/ksh export CONFIG_SHELL exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"} else # Try using printf. ECHO='printf %s\n' if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' && echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then # Cool, printf works : elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && test "X$echo_testing_string" = 'X\t' && echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL export CONFIG_SHELL SHELL="$CONFIG_SHELL" export SHELL ECHO="$CONFIG_SHELL [$]0 --fallback-echo" elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && test "X$echo_testing_string" = 'X\t' && echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then ECHO="$CONFIG_SHELL [$]0 --fallback-echo" else # maybe with a smaller string... prev=: for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do if { test "X$echo_test_string" = "X`eval $cmd`"; } 2>/dev/null then break fi prev="$cmd" done if test "$prev" != 'sed 50q "[$]0"'; then echo_test_string=`eval $prev` export echo_test_string exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"} else # Oops. We lost completely, so just stick with echo. ECHO=echo fi fi fi fi fi fi # Copy echo and quote the copy suitably for passing to libtool from # the Makefile, instead of quoting the original, which is used later. lt_ECHO=$ECHO if test "X$lt_ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then lt_ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo" fi AC_SUBST(lt_ECHO) ]) _LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts]) _LT_DECL([], [ECHO], [1], [An echo program that does not interpret backslashes]) ])# _LT_PROG_ECHO_BACKSLASH # _LT_ENABLE_LOCK # --------------- m4_defun([_LT_ENABLE_LOCK], [AC_ARG_ENABLE([libtool-lock], [AS_HELP_STRING([--disable-libtool-lock], [avoid locking (might break parallel builds)])]) test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in ia64-*-hpux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE="32" ;; *ELF-64*) HPUX_IA64_MODE="64" ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out which ABI we are using. echo '[#]line __oline__ "configure"' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then if test "$lt_cv_prog_gnu_ld" = yes; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; *N32*) LD="${LD-ld} -melf32bmipn32" ;; *64-bit*) LD="${LD-ld} -melf64bmip" ;; esac else case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi fi rm -rf conftest* ;; x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.o` in *32-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_i386" ;; ppc64-*linux*|powerpc64-*linux*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) LD="${LD-ld} -m elf_s390" ;; sparc64-*linux*) LD="${LD-ld} -m elf32_sparc" ;; esac ;; *64-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_x86_64_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; ppc*-*linux*|powerpc*-*linux*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*|s390*-*tpf*) LD="${LD-ld} -m elf64_s390" ;; sparc*-*linux*) LD="${LD-ld} -m elf64_sparc" ;; esac ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, [AC_LANG_PUSH(C) AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) AC_LANG_POP]) if test x"$lt_cv_cc_needs_belf" != x"yes"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS="$SAVE_CFLAGS" fi ;; sparc*-*solaris*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) LD="${LD-ld} -m elf64_sparc" ;; *) if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then LD="${LD-ld} -64" fi ;; esac ;; esac fi rm -rf conftest* ;; esac need_locks="$enable_libtool_lock" ])# _LT_ENABLE_LOCK # _LT_CMD_OLD_ARCHIVE # ------------------- m4_defun([_LT_CMD_OLD_ARCHIVE], [AC_CHECK_TOOL(AR, ar, false) test -z "$AR" && AR=ar test -z "$AR_FLAGS" && AR_FLAGS=cru _LT_DECL([], [AR], [1], [The archiver]) _LT_DECL([], [AR_FLAGS], [1]) AC_CHECK_TOOL(STRIP, strip, :) test -z "$STRIP" && STRIP=: _LT_DECL([], [STRIP], [1], [A symbol stripping program]) AC_CHECK_TOOL(RANLIB, ranlib, :) test -z "$RANLIB" && RANLIB=: _LT_DECL([], [RANLIB], [1], [Commands used to install an old-style archive]) # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in openbsd*) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib" ;; *) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" fi _LT_DECL([], [old_postinstall_cmds], [2]) _LT_DECL([], [old_postuninstall_cmds], [2]) _LT_TAGDECL([], [old_archive_cmds], [2], [Commands used to build an old-style archive]) ])# _LT_CMD_OLD_ARCHIVE # _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE]) # ---------------------------------------------------------------- # Check whether the given compiler option works AC_DEFUN([_LT_COMPILER_OPTION], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_SED])dnl AC_CACHE_CHECK([$1], [$2], [$2=no m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$3" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then $2=yes fi fi $RM conftest* ]) if test x"[$]$2" = xyes; then m4_if([$5], , :, [$5]) else m4_if([$6], , :, [$6]) fi ])# _LT_COMPILER_OPTION # Old name: AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], []) # _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [ACTION-SUCCESS], [ACTION-FAILURE]) # ---------------------------------------------------- # Check whether the given linker option works AC_DEFUN([_LT_LINKER_OPTION], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_SED])dnl AC_CACHE_CHECK([$1], [$2], [$2=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $3" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&AS_MESSAGE_LOG_FD $ECHO "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then $2=yes fi else $2=yes fi fi $RM -r conftest* LDFLAGS="$save_LDFLAGS" ]) if test x"[$]$2" = xyes; then m4_if([$4], , :, [$4]) else m4_if([$5], , :, [$5]) fi ])# _LT_LINKER_OPTION # Old name: AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], []) # LT_CMD_MAX_LEN #--------------- AC_DEFUN([LT_CMD_MAX_LEN], [AC_REQUIRE([AC_CANONICAL_HOST])dnl # find the maximum length of command line arguments AC_MSG_CHECKING([the maximum length of command line arguments]) AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl i=0 teststring="ABCD" case $build_os in msdosdjgpp*) # On DJGPP, this test can blow up pretty badly due to problems in libc # (any single argument exceeding 2000 bytes causes a buffer overrun # during glob expansion). Even if it were fixed, the result of this # check would be larger than it should be. lt_cv_sys_max_cmd_len=12288; # 12K is about right ;; gnu*) # Under GNU Hurd, this test is not required because there is # no limit to the length of command line arguments. # Libtool will interpret -1 as no limit whatsoever lt_cv_sys_max_cmd_len=-1; ;; cygwin* | mingw* | cegcc*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, # you end up with a "frozen" computer, even though with patience # the test eventually succeeds (with a max line length of 256k). # Instead, let's just punt: use the minimum linelength reported by # all of the supported platforms: 8192 (on NT/2K/XP). lt_cv_sys_max_cmd_len=8192; ;; amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. lt_cv_sys_max_cmd_len=8192; ;; netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` elif test -x /usr/sbin/sysctl; then lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` else lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs fi # And add a safety zone lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` ;; interix*) # We know the value 262144 and hardcode it with a safety zone (like BSD) lt_cv_sys_max_cmd_len=196608 ;; osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not # nice to cause kernel panics so lets avoid the loop below. # First set a reasonable default. lt_cv_sys_max_cmd_len=16384 # if test -x /sbin/sysconfig; then case `/sbin/sysconfig -q proc exec_disable_arg_limit` in *1*) lt_cv_sys_max_cmd_len=-1 ;; esac fi ;; sco3.2v5*) lt_cv_sys_max_cmd_len=102400 ;; sysv5* | sco5v6* | sysv4.2uw2*) kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` if test -n "$kargmax"; then lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'` else lt_cv_sys_max_cmd_len=32768 fi ;; *) lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` if test -n "$lt_cv_sys_max_cmd_len"; then lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` else # Make teststring a little bigger before we do anything with it. # a 1K string should be a reasonable start. for i in 1 2 3 4 5 6 7 8 ; do teststring=$teststring$teststring done SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. while { test "X"`$SHELL [$]0 --fallback-echo "X$teststring$teststring" 2>/dev/null` \ = "XX$teststring$teststring"; } >/dev/null 2>&1 && test $i != 17 # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring done # Only check the string length outside the loop. lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` teststring= # Add a significant safety factor because C++ compilers can tack on # massive amounts of additional arguments before passing them to the # linker. It appears as though 1/2 is a usable value. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` fi ;; esac ]) if test -n $lt_cv_sys_max_cmd_len ; then AC_MSG_RESULT($lt_cv_sys_max_cmd_len) else AC_MSG_RESULT(none) fi max_cmd_len=$lt_cv_sys_max_cmd_len _LT_DECL([], [max_cmd_len], [0], [What is the maximum length of a command?]) ])# LT_CMD_MAX_LEN # Old name: AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], []) # _LT_HEADER_DLFCN # ---------------- m4_defun([_LT_HEADER_DLFCN], [AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl ])# _LT_HEADER_DLFCN # _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, # ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) # ---------------------------------------------------------------- m4_defun([_LT_TRY_DLOPEN_SELF], [m4_require([_LT_HEADER_DLFCN])dnl if test "$cross_compiling" = yes; then : [$4] else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF [#line __oline__ "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif void fnord() { int i=42;} int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; /* dlclose (self); */ } else puts (dlerror ()); return status; }] _LT_EOF if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) $1 ;; x$lt_dlneed_uscore) $2 ;; x$lt_dlunknown|x*) $3 ;; esac else : # compilation failed $3 fi fi rm -fr conftest* ])# _LT_TRY_DLOPEN_SELF # LT_SYS_DLOPEN_SELF # ------------------ AC_DEFUN([LT_SYS_DLOPEN_SELF], [m4_require([_LT_HEADER_DLFCN])dnl if test "x$enable_dlopen" != xyes; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen="load_add_on" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32* | cegcc*) lt_cv_dlopen="LoadLibrary" lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen="dlopen" lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it AC_CHECK_LIB([dl], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[ lt_cv_dlopen="dyld" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ]) ;; *) AC_CHECK_FUNC([shl_load], [lt_cv_dlopen="shl_load"], [AC_CHECK_LIB([dld], [shl_load], [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"], [AC_CHECK_FUNC([dlopen], [lt_cv_dlopen="dlopen"], [AC_CHECK_LIB([dl], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"], [AC_CHECK_LIB([svld], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"], [AC_CHECK_LIB([dld], [dld_link], [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"]) ]) ]) ]) ]) ]) ;; esac if test "x$lt_cv_dlopen" != xno; then enable_dlopen=yes else enable_dlopen=no fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS="$CPPFLAGS" test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS="$LDFLAGS" wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS="$LIBS" LIBS="$lt_cv_dlopen_libs $LIBS" AC_CACHE_CHECK([whether a program can dlopen itself], lt_cv_dlopen_self, [dnl _LT_TRY_DLOPEN_SELF( lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes, lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) ]) if test "x$lt_cv_dlopen_self" = xyes; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" AC_CACHE_CHECK([whether a statically linked program can dlopen itself], lt_cv_dlopen_self_static, [dnl _LT_TRY_DLOPEN_SELF( lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross) ]) fi CPPFLAGS="$save_CPPFLAGS" LDFLAGS="$save_LDFLAGS" LIBS="$save_LIBS" ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi _LT_DECL([dlopen_support], [enable_dlopen], [0], [Whether dlopen is supported]) _LT_DECL([dlopen_self], [enable_dlopen_self], [0], [Whether dlopen of programs is supported]) _LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0], [Whether dlopen of statically linked programs is supported]) ])# LT_SYS_DLOPEN_SELF # Old name: AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], []) # _LT_COMPILER_C_O([TAGNAME]) # --------------------------- # Check to see if options -c and -o are simultaneously supported by compiler. # This macro does not hard code the compiler like AC_PROG_CC_C_O. m4_defun([_LT_COMPILER_C_O], [m4_require([_LT_DECL_SED])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_TAG_COMPILER])dnl AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)], [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes fi fi chmod u+w . 2>&AS_MESSAGE_LOG_FD $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* ]) _LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1], [Does compiler simultaneously support -c and -o options?]) ])# _LT_COMPILER_C_O # _LT_COMPILER_FILE_LOCKS([TAGNAME]) # ---------------------------------- # Check to see if we can do hard links to lock some files if needed m4_defun([_LT_COMPILER_FILE_LOCKS], [m4_require([_LT_ENABLE_LOCK])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl _LT_COMPILER_C_O([$1]) hard_links="nottested" if test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user AC_MSG_CHECKING([if we can lock with hard links]) hard_links=yes $RM conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no AC_MSG_RESULT([$hard_links]) if test "$hard_links" = no; then AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe]) need_locks=warn fi else need_locks=no fi _LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?]) ])# _LT_COMPILER_FILE_LOCKS # _LT_CHECK_OBJDIR # ---------------- m4_defun([_LT_CHECK_OBJDIR], [AC_CACHE_CHECK([for objdir], [lt_cv_objdir], [rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then lt_cv_objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. lt_cv_objdir=_libs fi rmdir .libs 2>/dev/null]) objdir=$lt_cv_objdir _LT_DECL([], [objdir], [0], [The name of the directory that contains temporary libtool files])dnl m4_pattern_allow([LT_OBJDIR])dnl AC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/", [Define to the sub-directory in which libtool stores uninstalled libraries.]) ])# _LT_CHECK_OBJDIR # _LT_LINKER_HARDCODE_LIBPATH([TAGNAME]) # -------------------------------------- # Check hardcoding attributes. m4_defun([_LT_LINKER_HARDCODE_LIBPATH], [AC_MSG_CHECKING([how to hardcode library paths into programs]) _LT_TAGVAR(hardcode_action, $1)= if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" || test -n "$_LT_TAGVAR(runpath_var, $1)" || test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then # We can hardcode non-existent directories. if test "$_LT_TAGVAR(hardcode_direct, $1)" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" != no && test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then # Linking always hardcodes the temporary library directory. _LT_TAGVAR(hardcode_action, $1)=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. _LT_TAGVAR(hardcode_action, $1)=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. _LT_TAGVAR(hardcode_action, $1)=unsupported fi AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)]) if test "$_LT_TAGVAR(hardcode_action, $1)" = relink || test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi _LT_TAGDECL([], [hardcode_action], [0], [How to hardcode a shared library path into an executable]) ])# _LT_LINKER_HARDCODE_LIBPATH # _LT_CMD_STRIPLIB # ---------------- m4_defun([_LT_CMD_STRIPLIB], [m4_require([_LT_DECL_EGREP]) striplib= old_striplib= AC_MSG_CHECKING([whether stripping libraries is possible]) if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" AC_MSG_RESULT([yes]) else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP" ; then striplib="$STRIP -x" old_striplib="$STRIP -S" AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) fi ;; *) AC_MSG_RESULT([no]) ;; esac fi _LT_DECL([], [old_striplib], [1], [Commands to strip libraries]) _LT_DECL([], [striplib], [1]) ])# _LT_CMD_STRIPLIB # _LT_SYS_DYNAMIC_LINKER([TAG]) # ----------------------------- # PORTME Fill in your ld.so characteristics m4_defun([_LT_SYS_DYNAMIC_LINKER], [AC_REQUIRE([AC_CANONICAL_HOST])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_OBJDUMP])dnl m4_require([_LT_DECL_SED])dnl AC_MSG_CHECKING([dynamic linker characteristics]) m4_if([$1], [], [ if test "$GCC" = yes; then case $host_os in darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; *) lt_awk_arg="/^libraries:/" ;; esac lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e "s,=/,/,g"` if $ECHO "$lt_search_path_spec" | $GREP ';' >/dev/null ; then # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e 's/;/ /g'` else lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi # Ok, now we have the path, separated by spaces, we can step through it # and add multilib dir if necessary. lt_tmp_lt_search_path_spec= lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` for lt_sys_path in $lt_search_path_spec; do if test -d "$lt_sys_path/$lt_multi_os_dir"; then lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" else test -d "$lt_sys_path" && \ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" fi done lt_search_path_spec=`$ECHO $lt_tmp_lt_search_path_spec | awk ' BEGIN {RS=" "; FS="/|\n";} { lt_foo=""; lt_count=0; for (lt_i = NF; lt_i > 0; lt_i--) { if ($lt_i != "" && $lt_i != ".") { if ($lt_i == "..") { lt_count++; } else { if (lt_count == 0) { lt_foo="/" $lt_i lt_foo; } else { lt_count--; } } } } if (lt_foo != "") { lt_freq[[lt_foo]]++; } if (lt_freq[[lt_foo]] == 1) { print lt_foo; } }'` sys_lib_search_path_spec=`$ECHO $lt_search_path_spec` else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi]) library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix[[4-9]]*) version_type=linux need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[[01]] | aix4.[[01]].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) case $host_cpu in powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' ;; m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$ECHO "X$lib" | $Xsed -e '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[[45]]*) version_type=linux need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32* | cegcc*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$host_os in yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*) library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec=`$CC -print-search-dirs | $GREP "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then # It is most probably a Windows format PATH printed by # mingw gcc, but we are running on Cygwin. Gcc prints its search # path with ; separators, and with drive letters. We can handle the # drive letters (cygwin fileutils understands them), so leave them, # especially as we might pass files found there to a mingw objdump, # which wouldn't understand a cygwinified path. Ahh. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' ;; esac ;; *) library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib' ;; esac dynamic_linker='Win32 ld.exe' # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' m4_if([$1], [],[ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"]) sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd1*) dynamic_linker=no ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[[123]]*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2*) shlibpath_overrides_runpath=yes ;; freebsd3.[[01]]* | freebsdelf3.[[01]]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \ freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; gnu*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555. postinstall_cmds='chmod 555 $lib' ;; interix[[3-9]]*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be Linux ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # Some binutils ld are patched to set DT_RUNPATH save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \ LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\"" AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null], [shlibpath_overrides_runpath=yes])]) LDFLAGS=$save_LDFLAGS libdir=$save_libdir # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsdelf*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='NetBSD ld.elf_so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; *nto* | *qnx*) version_type=qnx need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='ldqnx.so' ;; openbsd*) version_type=sunos sys_lib_dlsearch_path_spec="/usr/lib" need_lib_prefix=no # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. case $host_os in openbsd3.3 | openbsd3.3.*) need_version=yes ;; *) need_version=no ;; esac library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[[89]] | openbsd2.[[89]].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; rdos*) dynamic_linker=no ;; solaris*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=freebsd-elf need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes if test "$with_gnu_ld" = yes; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; uts4*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac AC_MSG_RESULT([$dynamic_linker]) test "$dynamic_linker" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" fi if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" fi _LT_DECL([], [variables_saved_for_relink], [1], [Variables whose values should be saved in libtool wrapper scripts and restored at link time]) _LT_DECL([], [need_lib_prefix], [0], [Do we need the "lib" prefix for modules?]) _LT_DECL([], [need_version], [0], [Do we need a version for libraries?]) _LT_DECL([], [version_type], [0], [Library versioning type]) _LT_DECL([], [runpath_var], [0], [Shared library runtime path variable]) _LT_DECL([], [shlibpath_var], [0],[Shared library path variable]) _LT_DECL([], [shlibpath_overrides_runpath], [0], [Is shlibpath searched before the hard-coded library search path?]) _LT_DECL([], [libname_spec], [1], [Format of library name prefix]) _LT_DECL([], [library_names_spec], [1], [[List of archive names. First name is the real one, the rest are links. The last name is the one that the linker finds with -lNAME]]) _LT_DECL([], [soname_spec], [1], [[The coded name of the library, if different from the real name]]) _LT_DECL([], [postinstall_cmds], [2], [Command to use after installation of a shared archive]) _LT_DECL([], [postuninstall_cmds], [2], [Command to use after uninstallation of a shared archive]) _LT_DECL([], [finish_cmds], [2], [Commands used to finish a libtool library installation in a directory]) _LT_DECL([], [finish_eval], [1], [[As "finish_cmds", except a single script fragment to be evaled but not shown]]) _LT_DECL([], [hardcode_into_libs], [0], [Whether we should hardcode library paths into libraries]) _LT_DECL([], [sys_lib_search_path_spec], [2], [Compile-time system search path for libraries]) _LT_DECL([], [sys_lib_dlsearch_path_spec], [2], [Run-time system search path for libraries]) ])# _LT_SYS_DYNAMIC_LINKER # _LT_PATH_TOOL_PREFIX(TOOL) # -------------------------- # find a file program which can recognize shared library AC_DEFUN([_LT_PATH_TOOL_PREFIX], [m4_require([_LT_DECL_EGREP])dnl AC_MSG_CHECKING([for $1]) AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, [case $MAGIC_CMD in [[\\/*] | ?:[\\/]*]) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD="$MAGIC_CMD" lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR dnl $ac_dummy forces splitting on constant user-supplied paths. dnl POSIX.2 word splitting is done only on the output of word expansions, dnl not every word. This closes a longstanding sh security hole. ac_dummy="m4_if([$2], , $PATH, [$2])" for ac_dir in $ac_dummy; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$1; then lt_cv_path_MAGIC_CMD="$ac_dir/$1" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS="$lt_save_ifs" MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac]) MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then AC_MSG_RESULT($MAGIC_CMD) else AC_MSG_RESULT(no) fi _LT_DECL([], [MAGIC_CMD], [0], [Used to examine libraries when file_magic_cmd begins with "file"])dnl ])# _LT_PATH_TOOL_PREFIX # Old name: AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], []) # _LT_PATH_MAGIC # -------------- # find a file program which can recognize a shared library m4_defun([_LT_PATH_MAGIC], [_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH) if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH) else MAGIC_CMD=: fi fi ])# _LT_PATH_MAGIC # LT_PATH_LD # ---------- # find the pathname to the GNU or non-GNU linker AC_DEFUN([LT_PATH_LD], [AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_DECL_EGREP])dnl AC_ARG_WITH([gnu-ld], [AS_HELP_STRING([--with-gnu-ld], [assume the C compiler uses GNU ld @<:@default=no@:>@])], [test "$withval" = no || with_gnu_ld=yes], [with_gnu_ld=no])dnl ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. AC_MSG_CHECKING([for ld used by $CC]) case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [[\\/]]* | ?:[[\\/]]*) re_direlt='/[[^/]][[^/]]*/\.\./' # Canonicalize the pathname of ld ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then AC_MSG_CHECKING([for GNU ld]) else AC_MSG_CHECKING([for non-GNU ld]) fi AC_CACHE_VAL(lt_cv_path_LD, [if test -z "$LD"; then lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &1 /dev/null 2>&1; then lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' else lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' lt_cv_file_magic_cmd='$OBJDUMP -f' fi ;; cegcc) # use the weaker test based on 'objdump'. See mingw*. lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' lt_cv_file_magic_cmd='$OBJDUMP -f' ;; darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; freebsd* | dragonfly*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; gnu*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64' lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]'] lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac ;; interix[[3-9]]*) # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$' ;; irix5* | irix6* | nonstopux*) case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac lt_cv_deplibs_check_method=pass_all ;; # This must be Linux ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu) lt_cv_deplibs_check_method=pass_all ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$' fi ;; newos6*) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; *nto* | *qnx*) lt_cv_deplibs_check_method=pass_all ;; openbsd*) if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' fi ;; osf3* | osf4* | osf5*) lt_cv_deplibs_check_method=pass_all ;; rdos*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; sysv4 | sysv4.3*) case $host_vendor in motorola) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]' lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; ncr) lt_cv_deplibs_check_method=pass_all ;; sequent) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' ;; sni) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib" lt_cv_file_magic_test_file=/lib/libc.so ;; siemens) lt_cv_deplibs_check_method=pass_all ;; pc) lt_cv_deplibs_check_method=pass_all ;; esac ;; tpf*) lt_cv_deplibs_check_method=pass_all ;; esac ]) file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown _LT_DECL([], [deplibs_check_method], [1], [Method to check whether dependent libraries are shared objects]) _LT_DECL([], [file_magic_cmd], [1], [Command to use when deplibs_check_method == "file_magic"]) ])# _LT_CHECK_MAGIC_METHOD # LT_PATH_NM # ---------- # find the pathname to a BSD- or MS-compatible name lister AC_DEFUN([LT_PATH_NM], [AC_REQUIRE([AC_PROG_CC])dnl AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM, [if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM="$NM" else lt_nm_to_check="${ac_tool_prefix}nm" if test -n "$ac_tool_prefix" && test "$build" = "$host"; then lt_nm_to_check="$lt_nm_to_check nm" fi for lt_tmp_nm in $lt_nm_to_check; do lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. tmp_nm="$ac_dir/$lt_tmp_nm" if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then # Check to see if the nm accepts a BSD-compat flag. # Adding the `sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in */dev/null* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break ;; *) lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags ;; esac ;; esac fi done IFS="$lt_save_ifs" done : ${lt_cv_path_NM=no} fi]) if test "$lt_cv_path_NM" != "no"; then NM="$lt_cv_path_NM" else # Didn't find any BSD compatible name lister, look for dumpbin. AC_CHECK_TOOLS(DUMPBIN, ["dumpbin -symbols" "link -dump -symbols"], :) AC_SUBST([DUMPBIN]) if test "$DUMPBIN" != ":"; then NM="$DUMPBIN" fi fi test -z "$NM" && NM=nm AC_SUBST([NM]) _LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface], [lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext (eval echo "\"\$as_me:__oline__: $ac_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&AS_MESSAGE_LOG_FD (eval echo "\"\$as_me:__oline__: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&AS_MESSAGE_LOG_FD (eval echo "\"\$as_me:__oline__: output\"" >&AS_MESSAGE_LOG_FD) cat conftest.out >&AS_MESSAGE_LOG_FD if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" fi rm -f conftest*]) ])# LT_PATH_NM # Old names: AU_ALIAS([AM_PROG_NM], [LT_PATH_NM]) AU_ALIAS([AC_PROG_NM], [LT_PATH_NM]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_PROG_NM], []) dnl AC_DEFUN([AC_PROG_NM], []) # LT_LIB_M # -------- # check for math library AC_DEFUN([LT_LIB_M], [AC_REQUIRE([AC_CANONICAL_HOST])dnl LIBM= case $host in *-*-beos* | *-*-cygwin* | *-*-pw32* | *-*-darwin*) # These system don't have libm, or don't need it ;; *-ncr-sysv4.3*) AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw") AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm") ;; *) AC_CHECK_LIB(m, cos, LIBM="-lm") ;; esac AC_SUBST([LIBM]) ])# LT_LIB_M # Old name: AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_CHECK_LIBM], []) # _LT_COMPILER_NO_RTTI([TAGNAME]) # ------------------------------- m4_defun([_LT_COMPILER_NO_RTTI], [m4_require([_LT_TAG_COMPILER])dnl _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= if test "$GCC" = yes; then _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], lt_cv_prog_compiler_rtti_exceptions, [-fno-rtti -fno-exceptions], [], [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"]) fi _LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1], [Compiler flag to turn off builtin functions]) ])# _LT_COMPILER_NO_RTTI # _LT_CMD_GLOBAL_SYMBOLS # ---------------------- m4_defun([_LT_CMD_GLOBAL_SYMBOLS], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([LT_PATH_NM])dnl AC_REQUIRE([LT_PATH_LD])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_TAG_COMPILER])dnl # Check for command to grab the raw symbol name followed by C symbol from nm. AC_MSG_CHECKING([command to parse $NM output from $compiler object]) AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], [ # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. symcode='[[BCDEGRST]]' # Regexp to match symbols that can be accessed directly from C. sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)' # Define system-specific variables. case $host_os in aix*) symcode='[[BCDT]]' ;; cygwin* | mingw* | pw32* | cegcc*) symcode='[[ABCDGISTW]]' ;; hpux*) if test "$host_cpu" = ia64; then symcode='[[ABCDEGRST]]' fi ;; irix* | nonstopux*) symcode='[[BCDEGRST]]' ;; osf*) symcode='[[BCDEGQRST]]' ;; solaris*) symcode='[[BDRT]]' ;; sco3.2v5*) symcode='[[DT]]' ;; sysv4.2uw2*) symcode='[[DT]]' ;; sysv5* | sco5v6* | unixware* | OpenUNIX*) symcode='[[ABDT]]' ;; sysv4) symcode='[[DFNSTU]]' ;; esac # If we're using GNU nm, then use its standard symbol codes. case `$NM -V 2>&1` in *GNU* | *'with BFD'*) symcode='[[ABCDGIRSTW]]' ;; esac # Transform an extracted symbol line into a proper C declaration. # Some systems (esp. on ia64) link data and code symbols differently, # so use this general approach. lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p'" lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"lib\2\", (void *) \&\2},/p'" # Handle CRLF in mingw tool chain opt_cr= case $build_os in mingw*) opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac # Try without a prefix underscore, then with it. for ac_symprfx in "" "_"; do # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. symxfrm="\\1 $ac_symprfx\\2 \\2" # Write the raw and C identifiers. if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Fake it for dumpbin and say T for any non-static function # and D for any global variable. # Also find C++ and __fastcall symbols from MSVC++, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK ['"\ " {last_section=section; section=\$ 3};"\ " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ " {if(hide[section]) next};"\ " {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\ " {split(\$ 0, a, /\||\r/); split(a[2], s)};"\ " s[1]~/^[@?]/{print s[1], s[1]; next};"\ " s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\ " ' prfx=^$ac_symprfx]" else lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext <<_LT_EOF #ifdef __cplusplus extern "C" { #endif char nm_test_var; void nm_test_func(void); void nm_test_func(void){} #ifdef __cplusplus } #endif int main(){nm_test_var='a';nm_test_func();return(0);} _LT_EOF if AC_TRY_EVAL(ac_compile); then # Now try to grab the symbols. nlist=conftest.nm if AC_TRY_EVAL(NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if $GREP ' nm_test_var$' "$nlist" >/dev/null; then if $GREP ' nm_test_func$' "$nlist" >/dev/null; then cat <<_LT_EOF > conftest.$ac_ext #ifdef __cplusplus extern "C" { #endif _LT_EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' cat <<_LT_EOF >> conftest.$ac_ext /* The mapping between symbol names and symbols. */ const struct { const char *name; void *address; } lt__PROGRAM__LTX_preloaded_symbols[[]] = { { "@PROGRAM@", (void *) 0 }, _LT_EOF $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext cat <<\_LT_EOF >> conftest.$ac_ext {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt__PROGRAM__LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif _LT_EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext lt_save_LIBS="$LIBS" lt_save_CFLAGS="$CFLAGS" LIBS="conftstm.$ac_objext" CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)" if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then pipe_works=yes fi LIBS="$lt_save_LIBS" CFLAGS="$lt_save_CFLAGS" else echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD fi else echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD fi else echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD cat conftest.$ac_ext >&5 fi rm -rf conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test "$pipe_works" = yes; then break else lt_cv_sys_global_symbol_pipe= fi done ]) if test -z "$lt_cv_sys_global_symbol_pipe"; then lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then AC_MSG_RESULT(failed) else AC_MSG_RESULT(ok) fi _LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1], [Take the output of nm and produce a listing of raw symbols and C names]) _LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1], [Transform the output of nm in a proper C declaration]) _LT_DECL([global_symbol_to_c_name_address], [lt_cv_sys_global_symbol_to_c_name_address], [1], [Transform the output of nm in a C name address pair]) _LT_DECL([global_symbol_to_c_name_address_lib_prefix], [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1], [Transform the output of nm in a C name address pair when lib prefix is needed]) ]) # _LT_CMD_GLOBAL_SYMBOLS # _LT_COMPILER_PIC([TAGNAME]) # --------------------------- m4_defun([_LT_COMPILER_PIC], [m4_require([_LT_TAG_COMPILER])dnl _LT_TAGVAR(lt_prog_compiler_wl, $1)= _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)= AC_MSG_CHECKING([for $compiler option to produce PIC]) m4_if([$1], [CXX], [ # C++ specific cases for pic, static, wl, etc. if test "$GXX" = yes; then _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; *djgpp*) # DJGPP does not support shared libraries at all _LT_TAGVAR(lt_prog_compiler_pic, $1)= ;; interix[[3-9]]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac else case $host_os in aix[[4-9]]*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; chorus*) case $cc_basename in cxch68*) # Green Hills C++ Compiler # _LT_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" ;; esac ;; dgux*) case $cc_basename in ec++*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; ghcx*) # Green Hills C++ Compiler _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; freebsd* | dragonfly*) # FreeBSD uses GNU C++ ;; hpux9* | hpux10* | hpux11*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' if test "$host_cpu" != ia64; then _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' fi ;; aCC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ;; esac ;; *) ;; esac ;; interix*) # This is c89, which is MS Visual C++ (no shared libs) # Anyone wants to do a port? ;; irix5* | irix6* | nonstopux*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' # CC pic flag -KPIC is the default. ;; *) ;; esac ;; linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in KCC*) # KAI C++ Compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; ecpc* ) # old Intel C++ for x86_64 which still supported -KPIC. _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; icpc* ) # Intel C++, used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; pgCC* | pgcpp*) # Portland Group C++ compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; cxx*) # Compaq C++ # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; xlc* | xlC*) # IBM XL 8.0 on PPC _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; esac ;; esac ;; lynxos*) ;; m88k*) ;; mvs*) case $cc_basename in cxx*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall' ;; *) ;; esac ;; netbsd* | netbsdelf*-gnu) ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' ;; RCC*) # Rational C++ 2.4.1 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; cxx*) # Digital/Compaq C++ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; *) ;; esac ;; psos*) ;; solaris*) case $cc_basename in CC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; gcx*) # Green Hills C++ Compiler _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' ;; *) ;; esac ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; lcc*) # Lucid _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; *) ;; esac ;; vxworks*) ;; *) _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ], [ if test "$GCC" = yes; then _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; interix[[3-9]]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no enable_shared=no ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; hpux9* | hpux10* | hpux11*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # PIC (with -KPIC) is the default. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in # old Intel for x86_64 which still supported -KPIC. ecc*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; # icc used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. icc* | ifort*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; # Lahey Fortran 8.1. lf95*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared' _LT_TAGVAR(lt_prog_compiler_static, $1)='--static' ;; pgcc* | pgf77* | pgf90* | pgf95*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; ccc*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All Alpha code is PIC. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; xl*) # IBM XL C 8.0/Fortran 10.1 on PPC _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' ;; *Sun\ F*) # Sun Fortran 8.3 passes all unrecognized flags to the linker _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='' ;; esac ;; esac ;; newsos6) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; osf3* | osf4* | osf5*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All OSF/1 code is PIC. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; rdos*) _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; solaris*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' case $cc_basename in f77* | f90* | f95*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';; *) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';; esac ;; sunos4*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; unicos*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; uts4*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; *) _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ]) case $host_os in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) _LT_TAGVAR(lt_prog_compiler_pic, $1)= ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])" ;; esac AC_MSG_RESULT([$_LT_TAGVAR(lt_prog_compiler_pic, $1)]) _LT_TAGDECL([wl], [lt_prog_compiler_wl], [1], [How to pass a linker flag through the compiler]) # # Check to make sure the PIC flag actually works. # if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works], [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)], [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [], [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in "" | " "*) ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;; esac], [_LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no]) fi _LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1], [Additional compiler flags for building library objects]) # # Check to make sure the static flag actually works. # wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\" _LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works], _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1), $lt_tmp_static_flag, [], [_LT_TAGVAR(lt_prog_compiler_static, $1)=]) _LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1], [Compiler flag to prevent dynamic linking]) ])# _LT_COMPILER_PIC # _LT_LINKER_SHLIBS([TAGNAME]) # ---------------------------- # See if the linker supports building shared libraries. m4_defun([_LT_LINKER_SHLIBS], [AC_REQUIRE([LT_PATH_LD])dnl AC_REQUIRE([LT_PATH_NM])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl m4_require([_LT_TAG_COMPILER])dnl AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) m4_if([$1], [CXX], [ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' case $host_os in aix[[4-9]]*) # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi ;; pw32*) _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds" ;; cygwin* | mingw* | cegcc*) _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;/^.*[[ ]]__nm__/s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' ;; linux* | k*bsd*-gnu) _LT_TAGVAR(link_all_deplibs, $1)=no ;; *) _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ;; esac _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] ], [ runpath_var= _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_cmds, $1)= _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(compiler_needs_object, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(old_archive_from_new_cmds, $1)= _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)= _LT_TAGVAR(thread_safe_flag_spec, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list _LT_TAGVAR(include_expsyms, $1)= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ` (' and `)$', so one must not match beginning or # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', # as well as any symbol that contains `d'. _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. # Exclude shared library initialization/finalization symbols. dnl Note also adjust exclude_expsyms for C++ above. extract_expsyms_cmds= case $host_os in cygwin* | mingw* | pw32* | cegcc*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd*) with_gnu_ld=no ;; linux* | k*bsd*-gnu) _LT_TAGVAR(link_all_deplibs, $1)=no ;; esac _LT_TAGVAR(ld_shlibs, $1)=yes if test "$with_gnu_ld" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else _LT_TAGVAR(whole_archive_flag_spec, $1)= fi supports_anon_versioning=no case `$LD -v 2>&1` in *GNU\ gold*) supports_anon_versioning=yes ;; *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix[[3-9]]*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: the GNU linker, at least up to release 2.9.1, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to modify your PATH *** so that a non-GNU linker is found, and then restart. _LT_EOF fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='' ;; m68k) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; cygwin* | mingw* | pw32* | cegcc*) # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols' if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; interix[[3-9]]*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) tmp_diet=no if test "$host_os" = linux-dietlibc; then case $cc_basename in diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) esac fi if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ && test "$tmp_diet" = no then tmp_addflag= tmp_sharedflag='-shared' case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; lf95*) # Lahey Fortran 8.1 _LT_TAGVAR(whole_archive_flag_spec, $1)= tmp_sharedflag='--shared' ;; xl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; esac case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; esac _LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test "x$supports_anon_versioning" = xyes; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi case $cc_basename in xlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir' _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $compiler_flags -soname $soname -o $lib' if test "x$supports_anon_versioning" = xyes; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $LD -shared $libobjs $deplibs $compiler_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris*) if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*) _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF ;; *) # For security reasons, it is highly recommended that you always # use absolute paths for naming shared libraries, and exclude the # DT_RUNPATH tag from executables and libraries. But doing so # requires that you compile everything twice, which is a pain. if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; sunos4*) _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then runpath_var= _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. _LT_TAGVAR(hardcode_minus_L, $1)=yes if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. _LT_TAGVAR(hardcode_direct, $1)=unsupported fi ;; aix[[4-9]]*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. _LT_TAGVAR(archive_cmds, $1)='' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(file_list_spec, $1)='${wl}-f,' if test "$GCC" = yes; then case $host_os in aix4.[[012]]|aix4.[[012]].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 _LT_TAGVAR(hardcode_direct, $1)=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)= fi ;; esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi _LT_TAGVAR(link_all_deplibs, $1)=no else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. _LT_TAGVAR(always_export_symbols, $1)=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. _LT_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' # Exported symbols can be pulled into shared objects from archives _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' _LT_TAGVAR(archive_cmds_need_lc, $1)=yes # This is similar to how AIX traditionally builds its shared libraries. _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='' ;; m68k) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac ;; bsdi[[45]]*) _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic ;; cygwin* | mingw* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `$ECHO "X$deplibs" | $Xsed -e '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' # FIXME: Should let the user specify the lib program. _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs' _LT_TAGVAR(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes ;; darwin* | rhapsody*) _LT_DARWIN_LINKER_FEATURES($1) ;; dgux*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; freebsd1*) _LT_TAGVAR(ld_shlibs, $1)=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; hpux9*) if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_direct, $1)=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' ;; hpux10*) if test "$GCC" = yes -a "$with_gnu_ld" = no; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test "$with_gnu_ld" = no; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes fi ;; hpux11*) if test "$GCC" = yes -a "$with_gnu_ld" = no; then case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac fi if test "$with_gnu_ld" = no; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in hppa*64*|ia64*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' # Try to use the -exported_symbol ld option, if it does not # work, assume that -exports_file does not work either and # implicitly export all symbols. save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" AC_LINK_IFELSE(int foo(void) {}, _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' ) LDFLAGS="$save_LDFLAGS" else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(inherit_rpath, $1)=yes _LT_TAGVAR(link_all_deplibs, $1)=yes ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else _LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; newsos6) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *nto* | *qnx*) ;; openbsd*) if test -f /usr/libexec/ld.so; then _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=yes if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' else case $host_os in openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' ;; esac fi else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; os2*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$ECHO DATA >> $output_objdir/$libname.def~$ECHO " SINGLE NONSHARED" >> $output_objdir/$libname.def~$ECHO EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' else _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' # Both c and cxx compiler support -rpath directly _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_separator, $1)=: ;; solaris*) _LT_TAGVAR(no_undefined_flag, $1)=' -z defs' if test "$GCC" = yes; then wlarc='${wl}' _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' else case `$CC -V 2>&1` in *"Compilers 5.0"*) wlarc='' _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' ;; *) wlarc='${wl}' _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' ;; esac fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands `-z linker_flag'. GCC discards it without `$wl', # but is careful enough not to reorder. # Supported since Solaris 2.6 (maybe 2.5.1?) if test "$GCC" = yes; then _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' else _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' fi ;; esac _LT_TAGVAR(link_all_deplibs, $1)=yes ;; sunos4*) if test "x$host_vendor" = xsequent; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4) case $host_vendor in sni) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs' _LT_TAGVAR(hardcode_direct, $1)=no ;; motorola) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4.3*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes _LT_TAGVAR(ld_shlibs, $1)=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(ld_shlibs, $1)=no ;; esac if test x$host_vendor = xsni; then case $host in sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym' ;; esac fi fi ]) AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no _LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld _LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl _LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl _LT_DECL([], [extract_expsyms_cmds], [2], [The commands to extract the exported symbol list from a shared archive]) # # Do we need to explicitly link libc? # case "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in x|xyes) # Assume -lc should be added _LT_TAGVAR(archive_cmds_need_lc, $1)=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $_LT_TAGVAR(archive_cmds, $1) in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. AC_MSG_CHECKING([whether -lc should be explicitly linked in]) $RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if AC_TRY_EVAL(ac_compile) 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1) compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1) _LT_TAGVAR(allow_undefined_flag, $1)= if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) then _LT_TAGVAR(archive_cmds_need_lc, $1)=no else _LT_TAGVAR(archive_cmds_need_lc, $1)=yes fi _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $RM conftest* AC_MSG_RESULT([$_LT_TAGVAR(archive_cmds_need_lc, $1)]) ;; esac fi ;; esac _LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0], [Whether or not to add -lc for building shared libraries]) _LT_TAGDECL([allow_libtool_libs_with_static_runtimes], [enable_shared_with_static_runtimes], [0], [Whether or not to disallow shared libs when runtime libs are static]) _LT_TAGDECL([], [export_dynamic_flag_spec], [1], [Compiler flag to allow reflexive dlopens]) _LT_TAGDECL([], [whole_archive_flag_spec], [1], [Compiler flag to generate shared objects directly from archives]) _LT_TAGDECL([], [compiler_needs_object], [1], [Whether the compiler copes with passing no objects directly]) _LT_TAGDECL([], [old_archive_from_new_cmds], [2], [Create an old-style archive from a shared archive]) _LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2], [Create a temporary old-style archive to link instead of a shared archive]) _LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive]) _LT_TAGDECL([], [archive_expsym_cmds], [2]) _LT_TAGDECL([], [module_cmds], [2], [Commands used to build a loadable module if different from building a shared archive.]) _LT_TAGDECL([], [module_expsym_cmds], [2]) _LT_TAGDECL([], [with_gnu_ld], [1], [Whether we are building with GNU ld or not]) _LT_TAGDECL([], [allow_undefined_flag], [1], [Flag that allows shared libraries with undefined symbols to be built]) _LT_TAGDECL([], [no_undefined_flag], [1], [Flag that enforces no undefined symbols]) _LT_TAGDECL([], [hardcode_libdir_flag_spec], [1], [Flag to hardcode $libdir into a binary during linking. This must work even if $libdir does not exist]) _LT_TAGDECL([], [hardcode_libdir_flag_spec_ld], [1], [[If ld is used when linking, flag to hardcode $libdir into a binary during linking. This must work even if $libdir does not exist]]) _LT_TAGDECL([], [hardcode_libdir_separator], [1], [Whether we need a single "-rpath" flag with a separated argument]) _LT_TAGDECL([], [hardcode_direct], [0], [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_direct_absolute], [0], [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the resulting binary and the resulting library dependency is "absolute", i.e impossible to change by setting ${shlibpath_var} if the library is relocated]) _LT_TAGDECL([], [hardcode_minus_L], [0], [Set to "yes" if using the -LDIR flag during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_shlibpath_var], [0], [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_automatic], [0], [Set to "yes" if building a shared library automatically hardcodes DIR into the library and all subsequent libraries and executables linked against it]) _LT_TAGDECL([], [inherit_rpath], [0], [Set to yes if linker adds runtime paths of dependent libraries to runtime path list]) _LT_TAGDECL([], [link_all_deplibs], [0], [Whether libtool must link a program against all its dependency libraries]) _LT_TAGDECL([], [fix_srcfile_path], [1], [Fix the shell variable $srcfile for the compiler]) _LT_TAGDECL([], [always_export_symbols], [0], [Set to "yes" if exported symbols are required]) _LT_TAGDECL([], [export_symbols_cmds], [2], [The commands to list exported symbols]) _LT_TAGDECL([], [exclude_expsyms], [1], [Symbols that should not be listed in the preloaded symbols]) _LT_TAGDECL([], [include_expsyms], [1], [Symbols that must always be exported]) _LT_TAGDECL([], [prelink_cmds], [2], [Commands necessary for linking programs (against libraries) with templates]) _LT_TAGDECL([], [file_list_spec], [1], [Specify filename containing input files]) dnl FIXME: Not yet implemented dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1], dnl [Compiler flag to generate thread safe objects]) ])# _LT_LINKER_SHLIBS # _LT_LANG_C_CONFIG([TAG]) # ------------------------ # Ensure that the configuration variables for a C compiler are suitably # defined. These variables are subsequently used by _LT_CONFIG to write # the compiler configuration to `libtool'. m4_defun([_LT_LANG_C_CONFIG], [m4_require([_LT_DECL_EGREP])dnl lt_save_CC="$CC" AC_LANG_PUSH(C) # Source file extension for C test sources. ac_ext=c # Object file extension for compiled C test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(){return(0);}' _LT_TAG_COMPILER # Save the default compiler, since it gets overwritten when the other # tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. compiler_DEFAULT=$CC # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) LT_SYS_DLOPEN_SELF _LT_CMD_STRIPLIB # Report which library types will actually be built AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_CONFIG($1) fi AC_LANG_POP CC="$lt_save_CC" ])# _LT_LANG_C_CONFIG # _LT_PROG_CXX # ------------ # Since AC_PROG_CXX is broken, in that it returns g++ if there is no c++ # compiler, we have our own version here. m4_defun([_LT_PROG_CXX], [ pushdef([AC_MSG_ERROR], [_lt_caught_CXX_error=yes]) AC_PROG_CXX if test -n "$CXX" && ( test "X$CXX" != "Xno" && ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || (test "X$CXX" != "Xg++"))) ; then AC_PROG_CXXCPP else _lt_caught_CXX_error=yes fi popdef([AC_MSG_ERROR]) ])# _LT_PROG_CXX dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([_LT_PROG_CXX], []) # _LT_LANG_CXX_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for a C++ compiler are suitably # defined. These variables are subsequently used by _LT_CONFIG to write # the compiler configuration to `libtool'. m4_defun([_LT_LANG_CXX_CONFIG], [AC_REQUIRE([_LT_PROG_CXX])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_EGREP])dnl AC_LANG_PUSH(C++) _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(compiler_needs_object, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for C++ test sources. ac_ext=cpp # Object file extension for compiled C++ test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the CXX compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test "$_lt_caught_CXX_error" != yes; then # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_LD=$LD lt_save_GCC=$GCC GCC=$GXX lt_save_with_gnu_ld=$with_gnu_ld lt_save_path_LD=$lt_cv_path_LD if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx else $as_unset lt_cv_prog_gnu_ld fi if test -n "${lt_cv_path_LDCXX+set}"; then lt_cv_path_LD=$lt_cv_path_LDCXX else $as_unset lt_cv_path_LD fi test -z "${LDCXX+set}" || LD=$LDCXX CC=${CXX-"c++"} compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) if test -n "$compiler"; then # We don't want -fno-exception when compiling C++ code, so set the # no_builtin_flag separately if test "$GXX" = yes; then _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' else _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= fi if test "$GXX" = yes; then # Set up default GNU C++ configuration LT_PATH_LD # Check if GNU C++ uses GNU ld as the underlying linker, since the # archiving commands below assume that GNU ld is being used. if test "$with_gnu_ld" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # If archive_cmds runs LD, not CC, wlarc should be empty # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to # investigate it a little bit more. (MM) wlarc='${wl}' # ancient GNU ld didn't support --whole-archive et. al. if eval "`$CC -print-prog-name=ld` --help 2>&1" | $GREP 'no-whole-archive' > /dev/null; then _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else _LT_TAGVAR(whole_archive_flag_spec, $1)= fi else with_gnu_ld=no wlarc= # A generic and very simple default shared library creation # command for GNU C++ for the case where it uses the native # linker, instead of GNU ld. If possible, this setting should # overridden to take advantage of the native linker features on # the platform it is being used on. _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' fi # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"' else GXX=no with_gnu_ld=no wlarc= fi # PORTME: fill in a description of your system's C++ link characteristics AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) _LT_TAGVAR(ld_shlibs, $1)=yes case $host_os in aix3*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aix[[4-9]]*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) for ld_flag in $LDFLAGS; do case $ld_flag in *-brtl*) aix_use_runtimelinking=yes break ;; esac done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. _LT_TAGVAR(archive_cmds, $1)='' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(file_list_spec, $1)='${wl}-f,' if test "$GXX" = yes; then case $host_os in aix4.[[012]]|aix4.[[012]].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 _LT_TAGVAR(hardcode_direct, $1)=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)= fi esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to # export. _LT_TAGVAR(always_export_symbols, $1)=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. _LT_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an empty # executable. _LT_SYS_MODULE_PATH_AIX _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' # Exported symbols can be pulled into shared objects from archives _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' _LT_TAGVAR(archive_cmds_need_lc, $1)=yes # This is similar to how AIX traditionally builds its shared # libraries. _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; chorus*) case $cc_basename in *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; cygwin* | mingw* | pw32* | cegcc*) # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; darwin* | rhapsody*) _LT_DARWIN_LINKER_FEATURES($1) ;; dgux*) case $cc_basename in ec++*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; ghcx*) # Green Hills C++ Compiler # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; freebsd[[12]]*) # C++ shared libraries reported to be fairly broken before # switch to ELF _LT_TAGVAR(ld_shlibs, $1)=no ;; freebsd-elf*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; freebsd* | dragonfly*) # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF # conventions _LT_TAGVAR(ld_shlibs, $1)=yes ;; gnu*) ;; hpux9*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default # location of the library. case $cc_basename in CC*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aCC*) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' ;; *) if test "$GXX" = yes; then _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; hpux10*|hpux11*) if test $with_gnu_ld = no; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in hppa*64*|ia64*) ;; *) _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' ;; esac fi case $host_cpu in hppa*64*|ia64*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default # location of the library. ;; esac case $cc_basename in CC*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aCC*) case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' ;; *) if test "$GXX" = yes; then if test $with_gnu_ld = no; then case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac fi else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; interix[[3-9]]*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; irix5* | irix6*) case $cc_basename in CC*) # SGI C++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' # Archives containing C++ object files must be created using # "CC -ar", where "CC" is the IRIX C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs' ;; *) if test "$GXX" = yes; then if test "$with_gnu_ld" = no; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` -o $lib' fi fi _LT_TAGVAR(link_all_deplibs, $1)=yes ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(inherit_rpath, $1)=yes ;; linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; icpc* | ecpc* ) # Intel C++ with_gnu_ld=yes # version 8.0 and above of icpc choke on multiply defined symbols # if we add $predep_objects and $postdep_objects, however 7.1 and # earlier do not add the objects themselves. case `$CC -V 2>&1` in *"Version 7."*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ;; *) # Version 8.0 or newer tmp_idyn= case $host_cpu in ia64*) tmp_idyn=' -i_dynamic';; esac _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ;; esac _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' ;; pgCC* | pgcpp*) # Portland Group C++ compiler case `$CC -V` in *pgCC\ [[1-5]]* | *pgcpp\ [[1-5]]*) _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ compile_command="$compile_command `find $tpldir -name \*.o | $NL2SP`"' _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | $NL2SP`~ $RANLIB $oldlib' _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' ;; *) # Version 6 will use weak symbols _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' ;; cxx*) # Compaq C++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' runpath_var=LD_RUN_PATH _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`$ECHO "X$templist" | $Xsed -e "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' ;; xl*) # IBM XL 8.0 on PPC, with GNU ld _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test "x$supports_anon_versioning" = xyes; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes # Not sure whether something based on # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 # would be better. output_verbose_link_cmd='echo' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' ;; esac ;; esac ;; lynxos*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; m88k*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; mvs*) case $cc_basename in cxx*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' wlarc= _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no fi # Workaround some broken pre-1.5 toolchains output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' ;; *nto* | *qnx*) _LT_TAGVAR(ld_shlibs, $1)=yes ;; openbsd2*) # C++ shared libraries are fairly broken _LT_TAGVAR(ld_shlibs, $1)=no ;; openbsd*) if test -f /usr/libexec/ld.so; then _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' fi output_verbose_link_cmd=echo else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Archives containing C++ object files must be created using # the KAI C++ compiler. case $host in osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;; esac ;; RCC*) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; cxx*) case $host in osf3*) _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && $ECHO "X${wl}-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' ;; *) _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ echo "-hidden">> $lib.exp~ $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~ $RM $lib.exp' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' ;; esac _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`$ECHO "X$templist" | $Xsed -e "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' ;; *) if test "$GXX" = yes && test "$with_gnu_ld" = no; then _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' case $host in osf3*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"' else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; psos*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; lcc*) # Lucid # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; solaris*) case $cc_basename in CC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_TAGVAR(archive_cmds_need_lc,$1)=yes _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands `-z linker_flag'. # Supported since Solaris 2.6 (maybe 2.5.1?) _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;; esac _LT_TAGVAR(link_all_deplibs, $1)=yes output_verbose_link_cmd='echo' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' ;; gcx*) # Green Hills C++ Compiler _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' # The C++ compiler must be used to create the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs' ;; *) # GNU C++ compiler with Solaris linker if test "$GXX" = yes && test "$with_gnu_ld" = no; then _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs' if $CC --version | $GREP -v '^2\.7' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"' else # g++ 2.7 appears to require `-G' NOT `-shared' on this # platform. _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir' case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' ;; esac fi ;; esac ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' case $cc_basename in CC*) _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' runpath_var='LD_RUN_PATH' case $cc_basename in CC*) _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; vxworks*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no _LT_TAGVAR(GCC, $1)="$GXX" _LT_TAGVAR(LD, $1)="$LD" ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_SYS_HIDDEN_LIBDEPS($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" CC=$lt_save_CC LDCXX=$LD LD=$lt_save_LD GCC=$lt_save_GCC with_gnu_ld=$lt_save_with_gnu_ld lt_cv_path_LDCXX=$lt_cv_path_LD lt_cv_path_LD=$lt_save_path_LD lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld fi # test "$_lt_caught_CXX_error" != yes AC_LANG_POP ])# _LT_LANG_CXX_CONFIG # _LT_SYS_HIDDEN_LIBDEPS([TAGNAME]) # --------------------------------- # Figure out "hidden" library dependencies from verbose # compiler output when linking a shared library. # Parse the compiler output and extract the necessary # objects, libraries and library flags. m4_defun([_LT_SYS_HIDDEN_LIBDEPS], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl # Dependencies to place before and after the object being linked: _LT_TAGVAR(predep_objects, $1)= _LT_TAGVAR(postdep_objects, $1)= _LT_TAGVAR(predeps, $1)= _LT_TAGVAR(postdeps, $1)= _LT_TAGVAR(compiler_lib_search_path, $1)= dnl we can't use the lt_simple_compile_test_code here, dnl because it contains code intended for an executable, dnl not a library. It's possible we should let each dnl tag define a new lt_????_link_test_code variable, dnl but it's only used here... m4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF int a; void foo (void) { a = 0; } _LT_EOF ], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF class Foo { public: Foo (void) { a = 0; } private: int a; }; _LT_EOF ], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF subroutine foo implicit none integer*4 a a=0 return end _LT_EOF ], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF subroutine foo implicit none integer a a=0 return end _LT_EOF ], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF public class foo { private int a; public void bar (void) { a = 0; } }; _LT_EOF ]) dnl Parse the compiler output and extract the necessary dnl objects, libraries and library flags. if AC_TRY_EVAL(ac_compile); then # Parse the compiler output and extract the necessary # objects, libraries and library flags. # Sentinel used to keep track of whether or not we are before # the conftest object file. pre_test_object_deps_done=no for p in `eval "$output_verbose_link_cmd"`; do case $p in -L* | -R* | -l*) # Some compilers place space between "-{L,R}" and the path. # Remove the space. if test $p = "-L" || test $p = "-R"; then prev=$p continue else prev= fi if test "$pre_test_object_deps_done" = no; then case $p in -L* | -R*) # Internal compiler library paths should come after those # provided the user. The postdeps already come after the # user supplied libs so there is no need to process them. if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}" else _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}" fi ;; # The "-l" case would never come before the object being # linked, so don't bother handling this case. esac else if test -z "$_LT_TAGVAR(postdeps, $1)"; then _LT_TAGVAR(postdeps, $1)="${prev}${p}" else _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}" fi fi ;; *.$objext) # This assumes that the test object file only shows up # once in the compiler output. if test "$p" = "conftest.$objext"; then pre_test_object_deps_done=yes continue fi if test "$pre_test_object_deps_done" = no; then if test -z "$_LT_TAGVAR(predep_objects, $1)"; then _LT_TAGVAR(predep_objects, $1)="$p" else _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p" fi else if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then _LT_TAGVAR(postdep_objects, $1)="$p" else _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p" fi fi ;; *) ;; # Ignore the rest. esac done # Clean up. rm -f a.out a.exe else echo "libtool.m4: error: problem compiling $1 test program" fi $RM -f confest.$objext # PORTME: override above test on systems where it is broken m4_if([$1], [CXX], [case $host_os in interix[[3-9]]*) # Interix 3.5 installs completely hosed .la files for C++, so rather than # hack all around it, let's just trust "g++" to DTRT. _LT_TAGVAR(predep_objects,$1)= _LT_TAGVAR(postdep_objects,$1)= _LT_TAGVAR(postdeps,$1)= ;; linux*) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 # The more standards-conforming stlport4 library is # incompatible with the Cstd library. Avoid specifying # it if it's in CXXFLAGS. Ignore libCrun as # -library=stlport4 depends on it. case " $CXX $CXXFLAGS " in *" -library=stlport4 "*) solaris_use_stlport4=yes ;; esac if test "$solaris_use_stlport4" != yes; then _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' fi ;; esac ;; solaris*) case $cc_basename in CC*) # The more standards-conforming stlport4 library is # incompatible with the Cstd library. Avoid specifying # it if it's in CXXFLAGS. Ignore libCrun as # -library=stlport4 depends on it. case " $CXX $CXXFLAGS " in *" -library=stlport4 "*) solaris_use_stlport4=yes ;; esac # Adding this requires a known-good setup of shared libraries for # Sun compiler versions before 5.6, else PIC objects from an old # archive will be linked into the output, leading to subtle bugs. if test "$solaris_use_stlport4" != yes; then _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' fi ;; esac ;; esac ]) case " $_LT_TAGVAR(postdeps, $1) " in *" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; esac _LT_TAGVAR(compiler_lib_search_dirs, $1)= if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'` fi _LT_TAGDECL([], [compiler_lib_search_dirs], [1], [The directories searched by this compiler when creating a shared library]) _LT_TAGDECL([], [predep_objects], [1], [Dependencies to place before and after the objects being linked to create a shared library]) _LT_TAGDECL([], [postdep_objects], [1]) _LT_TAGDECL([], [predeps], [1]) _LT_TAGDECL([], [postdeps], [1]) _LT_TAGDECL([], [compiler_lib_search_path], [1], [The library search path used internally by the compiler when linking a shared library]) ])# _LT_SYS_HIDDEN_LIBDEPS # _LT_PROG_F77 # ------------ # Since AC_PROG_F77 is broken, in that it returns the empty string # if there is no fortran compiler, we have our own version here. m4_defun([_LT_PROG_F77], [ pushdef([AC_MSG_ERROR], [_lt_disable_F77=yes]) AC_PROG_F77 if test -z "$F77" || test "X$F77" = "Xno"; then _lt_disable_F77=yes fi popdef([AC_MSG_ERROR]) ])# _LT_PROG_F77 dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([_LT_PROG_F77], []) # _LT_LANG_F77_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for a Fortran 77 compiler are # suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_F77_CONFIG], [AC_REQUIRE([_LT_PROG_F77])dnl AC_LANG_PUSH(Fortran 77) _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for f77 test sources. ac_ext=f # Object file extension for compiled f77 test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the F77 compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test "$_lt_disable_F77" != yes; then # Code to be used in simple compile tests lt_simple_compile_test_code="\ subroutine t return end " # Code to be used in simple link tests lt_simple_link_test_code="\ program t end " # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC="$CC" lt_save_GCC=$GCC CC=${F77-"f77"} compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) GCC=$G77 if test -n "$compiler"; then AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_TAGVAR(GCC, $1)="$G77" _LT_TAGVAR(LD, $1)="$LD" ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" GCC=$lt_save_GCC CC="$lt_save_CC" fi # test "$_lt_disable_F77" != yes AC_LANG_POP ])# _LT_LANG_F77_CONFIG # _LT_PROG_FC # ----------- # Since AC_PROG_FC is broken, in that it returns the empty string # if there is no fortran compiler, we have our own version here. m4_defun([_LT_PROG_FC], [ pushdef([AC_MSG_ERROR], [_lt_disable_FC=yes]) AC_PROG_FC if test -z "$FC" || test "X$FC" = "Xno"; then _lt_disable_FC=yes fi popdef([AC_MSG_ERROR]) ])# _LT_PROG_FC dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([_LT_PROG_FC], []) # _LT_LANG_FC_CONFIG([TAG]) # ------------------------- # Ensure that the configuration variables for a Fortran compiler are # suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_FC_CONFIG], [AC_REQUIRE([_LT_PROG_FC])dnl AC_LANG_PUSH(Fortran) _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for fc test sources. ac_ext=${ac_fc_srcext-f} # Object file extension for compiled fc test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the FC compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test "$_lt_disable_FC" != yes; then # Code to be used in simple compile tests lt_simple_compile_test_code="\ subroutine t return end " # Code to be used in simple link tests lt_simple_link_test_code="\ program t end " # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC="$CC" lt_save_GCC=$GCC CC=${FC-"f95"} compiler=$CC GCC=$ac_cv_fc_compiler_gnu _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) if test -n "$compiler"; then AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu" _LT_TAGVAR(LD, $1)="$LD" ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_SYS_HIDDEN_LIBDEPS($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" GCC=$lt_save_GCC CC="$lt_save_CC" fi # test "$_lt_disable_FC" != yes AC_LANG_POP ])# _LT_LANG_FC_CONFIG # _LT_LANG_GCJ_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for the GNU Java Compiler compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_GCJ_CONFIG], [AC_REQUIRE([LT_PROG_GCJ])dnl AC_LANG_SAVE # Source file extension for Java test sources. ac_ext=java # Object file extension for compiled Java test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="class foo {}" # Code to be used in simple link tests lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC="$CC" lt_save_GCC=$GCC GCC=yes CC=${GCJ-"gcj"} compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_TAGVAR(LD, $1)="$LD" _LT_CC_BASENAME([$compiler]) # GCJ did not exist at the time GCC didn't implicitly link libc in. _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi AC_LANG_RESTORE GCC=$lt_save_GCC CC="$lt_save_CC" ])# _LT_LANG_GCJ_CONFIG # _LT_LANG_RC_CONFIG([TAG]) # ------------------------- # Ensure that the configuration variables for the Windows resource compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_RC_CONFIG], [AC_REQUIRE([LT_PROG_RC])dnl AC_LANG_SAVE # Source file extension for RC test sources. ac_ext=rc # Object file extension for compiled RC test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }' # Code to be used in simple link tests lt_simple_link_test_code="$lt_simple_compile_test_code" # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC="$CC" lt_save_GCC=$GCC GCC= CC=${RC-"windres"} compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes if test -n "$compiler"; then : _LT_CONFIG($1) fi GCC=$lt_save_GCC AC_LANG_RESTORE CC="$lt_save_CC" ])# _LT_LANG_RC_CONFIG # LT_PROG_GCJ # ----------- AC_DEFUN([LT_PROG_GCJ], [m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ], [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ], [AC_CHECK_TOOL(GCJ, gcj,) test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2" AC_SUBST(GCJFLAGS)])])[]dnl ]) # Old name: AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_GCJ], []) # LT_PROG_RC # ---------- AC_DEFUN([LT_PROG_RC], [AC_CHECK_TOOL(RC, windres,) ]) # Old name: AU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_RC], []) # _LT_DECL_EGREP # -------------- # If we don't have a new enough Autoconf to choose the best grep # available, choose the one first in the user's PATH. m4_defun([_LT_DECL_EGREP], [AC_REQUIRE([AC_PROG_EGREP])dnl AC_REQUIRE([AC_PROG_FGREP])dnl test -z "$GREP" && GREP=grep _LT_DECL([], [GREP], [1], [A grep program that handles long lines]) _LT_DECL([], [EGREP], [1], [An ERE matcher]) _LT_DECL([], [FGREP], [1], [A literal string matcher]) dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too AC_SUBST([GREP]) ]) # _LT_DECL_OBJDUMP # -------------- # If we don't have a new enough Autoconf to choose the best objdump # available, choose the one first in the user's PATH. m4_defun([_LT_DECL_OBJDUMP], [AC_CHECK_TOOL(OBJDUMP, objdump, false) test -z "$OBJDUMP" && OBJDUMP=objdump _LT_DECL([], [OBJDUMP], [1], [An object symbol dumper]) AC_SUBST([OBJDUMP]) ]) # _LT_DECL_SED # ------------ # Check for a fully-functional sed program, that truncates # as few characters as possible. Prefer GNU sed if found. m4_defun([_LT_DECL_SED], [AC_PROG_SED test -z "$SED" && SED=sed Xsed="$SED -e 1s/^X//" _LT_DECL([], [SED], [1], [A sed program that does not truncate output]) _LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"], [Sed that helps us avoid accidentally triggering echo(1) options like -n]) ])# _LT_DECL_SED m4_ifndef([AC_PROG_SED], [ ############################################################ # NOTE: This macro has been submitted for inclusion into # # GNU Autoconf as AC_PROG_SED. When it is available in # # a released version of Autoconf we should remove this # # macro and use it instead. # ############################################################ m4_defun([AC_PROG_SED], [AC_MSG_CHECKING([for a sed that does not truncate output]) AC_CACHE_VAL(lt_cv_path_SED, [# Loop through the user's path and test for sed and gsed. # Then use that list of sed's as ones to test for truncation. as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for lt_ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" fi done done done IFS=$as_save_IFS lt_ac_max=0 lt_ac_count=0 # Add /usr/xpg4/bin/sed as it is typically found on Solaris # along with /bin/sed that truncates output. for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do test ! -f $lt_ac_sed && continue cat /dev/null > conftest.in lt_ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >conftest.in # Check for GNU sed and select it if it is found. if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then lt_cv_path_SED=$lt_ac_sed break fi while true; do cat conftest.in conftest.in >conftest.tmp mv conftest.tmp conftest.in cp conftest.in conftest.nl echo >>conftest.nl $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break cmp -s conftest.out conftest.nl || break # 10000 chars as input seems more than enough test $lt_ac_count -gt 10 && break lt_ac_count=`expr $lt_ac_count + 1` if test $lt_ac_count -gt $lt_ac_max; then lt_ac_max=$lt_ac_count lt_cv_path_SED=$lt_ac_sed fi done done ]) SED=$lt_cv_path_SED AC_SUBST([SED]) AC_MSG_RESULT([$SED]) ])#AC_PROG_SED ])#m4_ifndef # Old name: AU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_SED], []) # _LT_CHECK_SHELL_FEATURES # ------------------------ # Find out whether the shell is Bourne or XSI compatible, # or has some other useful features. m4_defun([_LT_CHECK_SHELL_FEATURES], [AC_MSG_CHECKING([whether the shell understands some XSI constructs]) # Try some XSI features xsi_shell=no ( _lt_dummy="a/b/c" test "${_lt_dummy##*/},${_lt_dummy%/*},"${_lt_dummy%"$_lt_dummy"}, \ = c,a/b,, \ && eval 'test $(( 1 + 1 )) -eq 2 \ && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ && xsi_shell=yes AC_MSG_RESULT([$xsi_shell]) _LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell']) AC_MSG_CHECKING([whether the shell understands "+="]) lt_shell_append=no ( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \ >/dev/null 2>&1 \ && lt_shell_append=yes AC_MSG_RESULT([$lt_shell_append]) _LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append']) if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then lt_unset=unset else lt_unset=false fi _LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl # test EBCDIC or ASCII case `echo X|tr X '\101'` in A) # ASCII based system # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr lt_SP2NL='tr \040 \012' lt_NL2SP='tr \015\012 \040\040' ;; *) # EBCDIC based system lt_SP2NL='tr \100 \n' lt_NL2SP='tr \r\n \100\100' ;; esac _LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl _LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl ])# _LT_CHECK_SHELL_FEATURES # _LT_PROG_XSI_SHELLFNS # --------------------- # Bourne and XSI compatible variants of some useful shell functions. m4_defun([_LT_PROG_XSI_SHELLFNS], [case $xsi_shell in yes) cat << \_LT_EOF >> "$cfgfile" # func_dirname file append nondir_replacement # Compute the dirname of FILE. If nonempty, add APPEND to the result, # otherwise set result to NONDIR_REPLACEMENT. func_dirname () { case ${1} in */*) func_dirname_result="${1%/*}${2}" ;; * ) func_dirname_result="${3}" ;; esac } # func_basename file func_basename () { func_basename_result="${1##*/}" } # func_dirname_and_basename file append nondir_replacement # perform func_basename and func_dirname in a single function # call: # dirname: Compute the dirname of FILE. If nonempty, # add APPEND to the result, otherwise set result # to NONDIR_REPLACEMENT. # value returned in "$func_dirname_result" # basename: Compute filename of FILE. # value retuned in "$func_basename_result" # Implementation must be kept synchronized with func_dirname # and func_basename. For efficiency, we do not delegate to # those functions but instead duplicate the functionality here. func_dirname_and_basename () { case ${1} in */*) func_dirname_result="${1%/*}${2}" ;; * ) func_dirname_result="${3}" ;; esac func_basename_result="${1##*/}" } # func_stripname prefix suffix name # strip PREFIX and SUFFIX off of NAME. # PREFIX and SUFFIX must not contain globbing or regex special # characters, hashes, percent signs, but SUFFIX may contain a leading # dot (in which case that matches only a dot). func_stripname () { # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are # positional parameters, so assign one to ordinary parameter first. func_stripname_result=${3} func_stripname_result=${func_stripname_result#"${1}"} func_stripname_result=${func_stripname_result%"${2}"} } # func_opt_split func_opt_split () { func_opt_split_opt=${1%%=*} func_opt_split_arg=${1#*=} } # func_lo2o object func_lo2o () { case ${1} in *.lo) func_lo2o_result=${1%.lo}.${objext} ;; *) func_lo2o_result=${1} ;; esac } # func_xform libobj-or-source func_xform () { func_xform_result=${1%.*}.lo } # func_arith arithmetic-term... func_arith () { func_arith_result=$(( $[*] )) } # func_len string # STRING may not start with a hyphen. func_len () { func_len_result=${#1} } _LT_EOF ;; *) # Bourne compatible functions. cat << \_LT_EOF >> "$cfgfile" # func_dirname file append nondir_replacement # Compute the dirname of FILE. If nonempty, add APPEND to the result, # otherwise set result to NONDIR_REPLACEMENT. func_dirname () { # Extract subdirectory from the argument. func_dirname_result=`$ECHO "X${1}" | $Xsed -e "$dirname"` if test "X$func_dirname_result" = "X${1}"; then func_dirname_result="${3}" else func_dirname_result="$func_dirname_result${2}" fi } # func_basename file func_basename () { func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"` } dnl func_dirname_and_basename dnl A portable version of this function is already defined in general.m4sh dnl so there is no need for it here. # func_stripname prefix suffix name # strip PREFIX and SUFFIX off of NAME. # PREFIX and SUFFIX must not contain globbing or regex special # characters, hashes, percent signs, but SUFFIX may contain a leading # dot (in which case that matches only a dot). # func_strip_suffix prefix name func_stripname () { case ${2} in .*) func_stripname_result=`$ECHO "X${3}" \ | $Xsed -e "s%^${1}%%" -e "s%\\\\${2}\$%%"`;; *) func_stripname_result=`$ECHO "X${3}" \ | $Xsed -e "s%^${1}%%" -e "s%${2}\$%%"`;; esac } # sed scripts: my_sed_long_opt='1s/^\(-[[^=]]*\)=.*/\1/;q' my_sed_long_arg='1s/^-[[^=]]*=//' # func_opt_split func_opt_split () { func_opt_split_opt=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_opt"` func_opt_split_arg=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_arg"` } # func_lo2o object func_lo2o () { func_lo2o_result=`$ECHO "X${1}" | $Xsed -e "$lo2o"` } # func_xform libobj-or-source func_xform () { func_xform_result=`$ECHO "X${1}" | $Xsed -e 's/\.[[^.]]*$/.lo/'` } # func_arith arithmetic-term... func_arith () { func_arith_result=`expr "$[@]"` } # func_len string # STRING may not start with a hyphen. func_len () { func_len_result=`expr "$[1]" : ".*" 2>/dev/null || echo $max_cmd_len` } _LT_EOF esac case $lt_shell_append in yes) cat << \_LT_EOF >> "$cfgfile" # func_append var value # Append VALUE to the end of shell variable VAR. func_append () { eval "$[1]+=\$[2]" } _LT_EOF ;; *) cat << \_LT_EOF >> "$cfgfile" # func_append var value # Append VALUE to the end of shell variable VAR. func_append () { eval "$[1]=\$$[1]\$[2]" } _LT_EOF ;; esac ]) wxedid-0.0.32/m4/ltversion.m40000755000175000017500000000127714722720160012623 00000000000000# ltversion.m4 -- version numbers -*- Autoconf -*- # # Copyright (C) 2004 Free Software Foundation, Inc. # Written by Scott James Remnant, 2004 # # 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. # Generated from ltversion.in. # serial 3017 ltversion.m4 # This file is part of GNU Libtool m4_define([LT_PACKAGE_VERSION], [2.2.6b]) m4_define([LT_PACKAGE_REVISION], [1.3017]) AC_DEFUN([LTVERSION_VERSION], [macro_version='2.2.6b' macro_revision='1.3017' _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) _LT_DECL(, macro_revision, 0) ]) wxedid-0.0.32/m4/rcd_autoconf.m40000644000175000017500000000602014722720160013230 00000000000000dnl serial 6 dnl dnl extension for autoconf: integration with rcd_autogen dnl dnl rcd_autoconf.m4 dnl version: 3.0 dnl dnl Copyright (C) 2019-2024 Tomasz Pawlak dnl e-mail: tomasz.pawlak@wp.eu dnl dnl Usage: dnl AC_OPT_RCD_AUTOGEN([ path/to/rcd_autogen ]) dnl AC_DEFUN_ONCE([AC_OPT_RCD_AUTOGEN],[ AC_ARG_ENABLE([rcdgen-mode], AS_HELP_STRING([--enable-rcdgen-mode=@<:@full/basic/dummy/skip/clean@:>@], [ full: generate struct of rcode messages and releated accessor functions code; basic: struct of rcode messages only (+ tiny accessors); dummy: mainly for libs: dummy fuctions only, to keep the interface for linking; skip: do not run the rcd_autogen; clean: remove all rcd_autogen output files. [default=full] ]), [rcd_mode=$enableval], [rcd_mode=full]) AC_CHECK_PROG(ac_have_bash, bash, yes, no) AS_IF([test "$ac_have_bash" = "yes"], [], [AC_MSG_ERROR((E) Bash is required to run rcd_autogen, 1)]) AS_UNSET(ac_have_bash) AS_MESSAGE([(i) rcd_autogen mode: $rcd_mode]) AS_MESSAGE([(i) rcd_autogen CPP ='$CPP' ]) AS_MESSAGE([(i) rcd_autogen CXXCPP='$CXXCPP' ]) AS_VAR_SET([ac_rcd_autogen_path], ["$1"]) export ac_rcd_autogen_path dnl NOTE: It's possible to export RCDGEN_PP_ARGS= dnl before invoking configure script AS_VAR_APPEND([RCDGEN_PP_ARGS], [[" $CPPFLAGS"]]) AS_VAR_APPEND([CPPFLAGS], [[" -D_USE_RCD_AUTOGEN"]])dnl see rcode.h dnl NOTE: preprocessor command defined by configure overrides dnl the --preproc|-pp setting in rcd_autogen, but dnl the --pp-args|-pa are always appended to PP arg list. AS_IF([test "pp$CC" != "pp"], [ export RCDGEN_CPP=$CPP ],[]) AS_IF([test "pp$CXXCPP" != "pp"], [ export RCDGEN_CXXCPP=$CXXCPP ],[]) dnl NOTE: Modes: full/basic/dummy can be overridden by rcd_autogen dnl option: --run-mode|-md, if it's set. dnl This allows to have per-target modes defined (in multi-target projects) dnl Modes: skip/clean are never overridden. dnl There's no 'RCDGEN_FULL', because 'full' is the default mode. AS_IF([test "$rcd_mode" = "basic"], [ export RCDGEN_BASIC=1 ],[]) AS_IF([test "$rcd_mode" = "dummy"], [ export RCDGEN_DUMMY=1 ],[]) AS_IF([test "$rcd_mode" = "skip"], [ AS_UNSET(ac_rcd_autogen_path); ],[]) AS_IF([test "$rcd_mode" = "clean"], [ export RCDGEN_CLEAN=1 ],[]) ])dnl AC_OPT_RCD_AUTOGEN dnl run the rcd_autogen against given target dnl dnl Usage: dnl 1. Pass the arguments directly to rcd_autogen: dnl AC_RCODE_AUTOGEN_TARGET([ -l=C -pa='-Wfatal-errors' -rd=. -st=/src ]) dnl 2. Use a file with arguments for rcd_autogen: (.rcdgen_cfg extension is mandatory) dnl AC_RCODE_AUTOGEN_TARGET([ src/target_name.rcdgen_cfg ]) AC_DEFUN([AC_RCD_AUTOGEN_TARGET],[ AS_IF([test "x$ac_rcd_autogen_path" != "x"], dnl mode=skip [ AS_IF([bash -c "$ac_rcd_autogen_path $1"], [], [AC_MSG_ERROR((E) rcd_autogen failed, 1)]) ] []) ])dnl AC_RCD_AUTOGEN_TARGET wxedid-0.0.32/m4/missing0000755000175000017500000001533614722720160011731 00000000000000#! /bin/sh # Common wrapper for a few potentially missing GNU programs. scriptversion=2018-03-07.03; # UTC # Copyright (C) 1996-2021 Free Software Foundation, Inc. # Originally written by Fran,cois Pinard , 1996. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. if test $# -eq 0; then echo 1>&2 "Try '$0 --help' for more information" exit 1 fi case $1 in --is-lightweight) # Used by our autoconf macros to check whether the available missing # script is modern enough. exit 0 ;; --run) # Back-compat with the calling convention used by older automake. shift ;; -h|--h|--he|--hel|--help) echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due to PROGRAM being missing or too old. Options: -h, --help display this help and exit -v, --version output version information and exit Supported PROGRAM values: aclocal autoconf autoheader autom4te automake makeinfo bison yacc flex lex help2man Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and 'g' are ignored when checking the name. Send bug reports to ." exit $? ;; -v|--v|--ve|--ver|--vers|--versi|--versio|--version) echo "missing $scriptversion (GNU Automake)" exit $? ;; -*) echo 1>&2 "$0: unknown '$1' option" echo 1>&2 "Try '$0 --help' for more information" exit 1 ;; esac # Run the given program, remember its exit status. "$@"; st=$? # If it succeeded, we are done. test $st -eq 0 && exit 0 # Also exit now if we it failed (or wasn't found), and '--version' was # passed; such an option is passed most likely to detect whether the # program is present and works. case $2 in --version|--help) exit $st;; esac # Exit code 63 means version mismatch. This often happens when the user # tries to use an ancient version of a tool on a file that requires a # minimum version. if test $st -eq 63; then msg="probably too old" elif test $st -eq 127; then # Program was missing. msg="missing on your system" else # Program was found and executed, but failed. Give up. exit $st fi perl_URL=https://www.perl.org/ flex_URL=https://github.com/westes/flex gnu_software_URL=https://www.gnu.org/software program_details () { case $1 in aclocal|automake) echo "The '$1' program is part of the GNU Automake package:" echo "<$gnu_software_URL/automake>" echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:" echo "<$gnu_software_URL/autoconf>" echo "<$gnu_software_URL/m4/>" echo "<$perl_URL>" ;; autoconf|autom4te|autoheader) echo "The '$1' program is part of the GNU Autoconf package:" echo "<$gnu_software_URL/autoconf/>" echo "It also requires GNU m4 and Perl in order to run:" echo "<$gnu_software_URL/m4/>" echo "<$perl_URL>" ;; esac } give_advice () { # Normalize program name to check for. normalized_program=`echo "$1" | sed ' s/^gnu-//; t s/^gnu//; t s/^g//; t'` printf '%s\n' "'$1' is $msg." configure_deps="'configure.ac' or m4 files included by 'configure.ac'" case $normalized_program in autoconf*) echo "You should only need it if you modified 'configure.ac'," echo "or m4 files included by it." program_details 'autoconf' ;; autoheader*) echo "You should only need it if you modified 'acconfig.h' or" echo "$configure_deps." program_details 'autoheader' ;; automake*) echo "You should only need it if you modified 'Makefile.am' or" echo "$configure_deps." program_details 'automake' ;; aclocal*) echo "You should only need it if you modified 'acinclude.m4' or" echo "$configure_deps." program_details 'aclocal' ;; autom4te*) echo "You might have modified some maintainer files that require" echo "the 'autom4te' program to be rebuilt." program_details 'autom4te' ;; bison*|yacc*) echo "You should only need it if you modified a '.y' file." echo "You may want to install the GNU Bison package:" echo "<$gnu_software_URL/bison/>" ;; lex*|flex*) echo "You should only need it if you modified a '.l' file." echo "You may want to install the Fast Lexical Analyzer package:" echo "<$flex_URL>" ;; help2man*) echo "You should only need it if you modified a dependency" \ "of a man page." echo "You may want to install the GNU Help2man package:" echo "<$gnu_software_URL/help2man/>" ;; makeinfo*) echo "You should only need it if you modified a '.texi' file, or" echo "any other file indirectly affecting the aspect of the manual." echo "You might want to install the Texinfo package:" echo "<$gnu_software_URL/texinfo/>" echo "The spurious makeinfo call might also be the consequence of" echo "using a buggy 'make' (AIX, DU, IRIX), in which case you might" echo "want to install GNU make:" echo "<$gnu_software_URL/make/>" ;; *) echo "You might have modified some files without having the proper" echo "tools for further handling them. Check the 'README' file, it" echo "often tells you about the needed prerequisites for installing" echo "this package. You may also peek at any GNU archive site, in" echo "case some other package contains this missing '$1' program." ;; esac } give_advice "$1" | sed -e '1s/^/WARNING: /' \ -e '2,$s/^/ /' >&2 # Propagate the correct exit status (expected to be 127 for a program # not found, 63 for a program that failed due to version mismatch). exit $st # Local variables: # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: wxedid-0.0.32/m4/wxwin.m40000644000175000017500000011716114722720160011747 00000000000000dnl --------------------------------------------------------------------------- dnl Author: wxWidgets development team, dnl Francesco Montorsi, dnl Bob McCown (Mac-testing) dnl Creation date: 24/11/2001 dnl --------------------------------------------------------------------------- dnl =========================================================================== dnl Table of Contents of this macro file: dnl ------------------------------------- dnl dnl SECTION A: wxWidgets main macros dnl - WX_CONFIG_OPTIONS dnl - WX_CONFIG_CHECK dnl - WXRC_CHECK dnl - WX_STANDARD_OPTIONS dnl - WX_CONVERT_STANDARD_OPTIONS_TO_WXCONFIG_FLAGS dnl - WX_DETECT_STANDARD_OPTION_VALUES dnl dnl SECTION B: wxWidgets-related utilities dnl - WX_LIKE_LIBNAME dnl - WX_ARG_ENABLE_YESNOAUTO dnl - WX_ARG_WITH_YESNOAUTO dnl dnl SECTION C: messages to the user dnl - WX_STANDARD_OPTIONS_SUMMARY_MSG dnl - WX_STANDARD_OPTIONS_SUMMARY_MSG_BEGIN dnl - WX_STANDARD_OPTIONS_SUMMARY_MSG_END dnl - WX_BOOLOPT_SUMMARY dnl dnl The special "WX_DEBUG_CONFIGURE" variable can be set to 1 to enable extra dnl debug output on stdout from these macros. dnl =========================================================================== dnl --------------------------------------------------------------------------- dnl Macros for wxWidgets detection. Typically used in configure.in as: dnl dnl AC_ARG_ENABLE(...) dnl AC_ARG_WITH(...) dnl ... dnl WX_CONFIG_OPTIONS dnl ... dnl ... dnl WX_CONFIG_CHECK([2.6.0], [wxWin=1]) dnl if test "$wxWin" != 1; then dnl AC_MSG_ERROR([ dnl wxWidgets must be installed on your system dnl but wx-config script couldn't be found. dnl dnl Please check that wx-config is in path, the directory dnl where wxWidgets libraries are installed (returned by dnl 'wx-config --libs' command) is in LD_LIBRARY_PATH or dnl equivalent variable and wxWidgets version is 2.3.4 or above. dnl ]) dnl fi dnl CPPFLAGS="$CPPFLAGS $WX_CPPFLAGS" dnl CXXFLAGS="$CXXFLAGS $WX_CXXFLAGS_ONLY" dnl CFLAGS="$CFLAGS $WX_CFLAGS_ONLY" dnl dnl LIBS="$LIBS $WX_LIBS" dnl dnl If you want to support standard --enable-debug/unicode/shared options, you dnl may do the following: dnl dnl ... dnl AC_CANONICAL_SYSTEM dnl dnl # define configure options dnl WX_CONFIG_OPTIONS dnl WX_STANDARD_OPTIONS([debug,unicode,shared,toolkit,wxshared]) dnl dnl # basic configure checks dnl ... dnl dnl # we want to always have DEBUG==WX_DEBUG and UNICODE==WX_UNICODE dnl WX_DEBUG=$DEBUG dnl WX_UNICODE=$UNICODE dnl dnl WX_CONVERT_STANDARD_OPTIONS_TO_WXCONFIG_FLAGS dnl WX_CONFIG_CHECK([2.8.0], [wxWin=1],,[html,core,net,base],[$WXCONFIG_FLAGS]) dnl WX_DETECT_STANDARD_OPTION_VALUES dnl dnl # write the output files dnl AC_CONFIG_FILES([Makefile ...]) dnl AC_OUTPUT dnl dnl # optional: just to show a message to the user dnl WX_STANDARD_OPTIONS_SUMMARY_MSG dnl dnl --------------------------------------------------------------------------- dnl --------------------------------------------------------------------------- dnl WX_CONFIG_OPTIONS dnl dnl adds support for --wx-prefix, --wx-exec-prefix, --with-wxdir and dnl --wx-config command line options dnl --------------------------------------------------------------------------- AC_DEFUN([WX_CONFIG_OPTIONS], [ AC_ARG_WITH(wxdir, [ --with-wxdir=PATH Use uninstalled version of wxWidgets in PATH], [ wx_config_name="$withval/wx-config" wx_config_args="--inplace"]) AC_ARG_WITH(wx-config, [ --with-wx-config=CONFIG wx-config script to use (optional)], wx_config_name="$withval" ) AC_ARG_WITH(wx-prefix, [ --with-wx-prefix=PREFIX Prefix where wxWidgets is installed (optional)], wx_config_prefix="$withval", wx_config_prefix="") AC_ARG_WITH(wx-exec-prefix, [ --with-wx-exec-prefix=PREFIX Exec prefix where wxWidgets is installed (optional)], wx_config_exec_prefix="$withval", wx_config_exec_prefix="") ]) dnl Helper macro for checking if wx version is at least $1.$2.$3, set's dnl wx_ver_ok=yes if it is: AC_DEFUN([_WX_PRIVATE_CHECK_VERSION], [ wx_ver_ok="" if test "x$WX_VERSION" != x ; then if test $wx_config_major_version -gt $1; then wx_ver_ok=yes else if test $wx_config_major_version -eq $1; then if test $wx_config_minor_version -gt $2; then wx_ver_ok=yes else if test $wx_config_minor_version -eq $2; then if test $wx_config_micro_version -ge $3; then wx_ver_ok=yes fi fi fi fi fi fi ]) dnl --------------------------------------------------------------------------- dnl WX_CONFIG_CHECK(VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND dnl [, WX-LIBS [, ADDITIONAL-WX-CONFIG-FLAGS]]]]) dnl dnl Test for wxWidgets, and define WX_C*FLAGS, WX_LIBS and WX_LIBS_STATIC dnl (the latter is for static linking against wxWidgets). Set WX_CONFIG_NAME dnl environment variable to override the default name of the wx-config script dnl to use. Set WX_CONFIG_PATH to specify the full path to wx-config - in this dnl case the macro won't even waste time on tests for its existence. dnl dnl Optional WX-LIBS argument contains comma- or space-separated list of dnl wxWidgets libraries to link against. If it is not specified then WX_LIBS dnl and WX_LIBS_STATIC will contain flags to link with all of the core dnl wxWidgets libraries. dnl dnl Optional ADDITIONAL-WX-CONFIG-FLAGS argument is appended to wx-config dnl invocation command in present. It can be used to fine-tune lookup of dnl best wxWidgets build available. dnl dnl Example use: dnl WX_CONFIG_CHECK([2.6.0], [wxWin=1], [wxWin=0], [html,core,net] dnl [--unicode --debug]) dnl --------------------------------------------------------------------------- dnl dnl Get the cflags and libraries from the wx-config script dnl AC_DEFUN([WX_CONFIG_CHECK], [ dnl do we have wx-config name: it can be wx-config or wxd-config or ... if test x${WX_CONFIG_NAME+set} != xset ; then WX_CONFIG_NAME=wx-config fi if test "x$wx_config_name" != x ; then WX_CONFIG_NAME="$wx_config_name" fi dnl deal with optional prefixes if test x$wx_config_exec_prefix != x ; then wx_config_args="$wx_config_args --exec-prefix=$wx_config_exec_prefix" WX_LOOKUP_PATH="$wx_config_exec_prefix/bin" fi if test x$wx_config_prefix != x ; then wx_config_args="$wx_config_args --prefix=$wx_config_prefix" WX_LOOKUP_PATH="$WX_LOOKUP_PATH:$wx_config_prefix/bin" fi if test "$cross_compiling" = "yes"; then wx_config_args="$wx_config_args --host=$host_alias" fi dnl don't search the PATH if WX_CONFIG_NAME is absolute filename if test -x "$WX_CONFIG_NAME" ; then AC_MSG_CHECKING(for wx-config) WX_CONFIG_PATH="$WX_CONFIG_NAME" AC_MSG_RESULT($WX_CONFIG_PATH) else AC_PATH_PROG(WX_CONFIG_PATH, $WX_CONFIG_NAME, no, "$WX_LOOKUP_PATH:$PATH") fi if test "$WX_CONFIG_PATH" != "no" ; then WX_VERSION="" min_wx_version=ifelse([$1], ,2.2.1,$1) if test -z "$5" ; then AC_MSG_CHECKING([for wxWidgets version >= $min_wx_version]) else AC_MSG_CHECKING([for wxWidgets version >= $min_wx_version ($5)]) fi dnl don't add the libraries ($4) to this variable as this would result in dnl an error when it's used with --version below WX_CONFIG_WITH_ARGS="$WX_CONFIG_PATH $wx_config_args $5" WX_VERSION=`$WX_CONFIG_WITH_ARGS --version 2>/dev/null` wx_config_major_version=`echo $WX_VERSION | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` wx_config_minor_version=`echo $WX_VERSION | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` wx_config_micro_version=`echo $WX_VERSION | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` wx_requested_major_version=`echo $min_wx_version | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` wx_requested_minor_version=`echo $min_wx_version | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` wx_requested_micro_version=`echo $min_wx_version | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` _WX_PRIVATE_CHECK_VERSION([$wx_requested_major_version], [$wx_requested_minor_version], [$wx_requested_micro_version]) if test -n "$wx_ver_ok"; then AC_MSG_RESULT(yes (version $WX_VERSION)) WX_LIBS=`$WX_CONFIG_WITH_ARGS --libs $4` dnl is this even still appropriate? --static is a real option now dnl and WX_CONFIG_WITH_ARGS is likely to contain it if that is dnl what the user actually wants, making this redundant at best. dnl For now keep it in case anyone actually used it in the past. AC_MSG_CHECKING([for wxWidgets static library]) WX_LIBS_STATIC=`$WX_CONFIG_WITH_ARGS --static --libs $4 2>/dev/null` if test "x$WX_LIBS_STATIC" = "x"; then AC_MSG_RESULT(no) else AC_MSG_RESULT(yes) fi dnl starting with version 2.2.6 wx-config has --cppflags argument wx_has_cppflags="" if test $wx_config_major_version -gt 2; then wx_has_cppflags=yes else if test $wx_config_major_version -eq 2; then if test $wx_config_minor_version -gt 2; then wx_has_cppflags=yes else if test $wx_config_minor_version -eq 2; then if test $wx_config_micro_version -ge 6; then wx_has_cppflags=yes fi fi fi fi fi dnl starting with version 2.7.0 wx-config has --rescomp option wx_has_rescomp="" if test $wx_config_major_version -gt 2; then wx_has_rescomp=yes else if test $wx_config_major_version -eq 2; then if test $wx_config_minor_version -ge 7; then wx_has_rescomp=yes fi fi fi if test "x$wx_has_rescomp" = x ; then dnl cannot give any useful info for resource compiler WX_RESCOMP= else WX_RESCOMP=`$WX_CONFIG_WITH_ARGS --rescomp` fi if test "x$wx_has_cppflags" = x ; then dnl no choice but to define all flags like CFLAGS WX_CFLAGS=`$WX_CONFIG_WITH_ARGS --cflags $4` WX_CPPFLAGS=$WX_CFLAGS WX_CXXFLAGS=$WX_CFLAGS WX_CFLAGS_ONLY=$WX_CFLAGS WX_CXXFLAGS_ONLY=$WX_CFLAGS else dnl we have CPPFLAGS included in CFLAGS included in CXXFLAGS WX_CPPFLAGS=`$WX_CONFIG_WITH_ARGS --cppflags $4` WX_CXXFLAGS=`$WX_CONFIG_WITH_ARGS --cxxflags $4` WX_CFLAGS=`$WX_CONFIG_WITH_ARGS --cflags $4` WX_CFLAGS_ONLY=`echo $WX_CFLAGS | sed "s@^$WX_CPPFLAGS *@@"` WX_CXXFLAGS_ONLY=`echo $WX_CXXFLAGS | sed "s@^$WX_CFLAGS *@@"` fi ifelse([$2], , :, [$2]) else if test "x$WX_VERSION" = x; then dnl no wx-config at all AC_MSG_RESULT(no) else AC_MSG_RESULT(no (version $WX_VERSION is not new enough)) fi WX_CFLAGS="" WX_CPPFLAGS="" WX_CXXFLAGS="" WX_LIBS="" WX_LIBS_STATIC="" WX_RESCOMP="" if test ! -z "$5"; then wx_error_message=" The configuration you asked for $PACKAGE_NAME requires a wxWidgets build with the following settings: $5 but such build is not available. To see the wxWidgets builds available on this system, please use 'wx-config --list' command. To use the default build, returned by 'wx-config --selected-config', use the options with their 'auto' default values." fi wx_error_message=" The requested wxWidgets build couldn't be found. $wx_error_message If you still get this error, then check that 'wx-config' is in path, the directory where wxWidgets libraries are installed (returned by 'wx-config --libs' command) is in LD_LIBRARY_PATH or equivalent variable and wxWidgets version is $1 or above." ifelse([$3], , AC_MSG_ERROR([$wx_error_message]), [$3]) fi else WX_CFLAGS="" WX_CPPFLAGS="" WX_CXXFLAGS="" WX_LIBS="" WX_LIBS_STATIC="" WX_RESCOMP="" ifelse([$3], , :, [$3]) fi AC_SUBST(WX_CPPFLAGS) AC_SUBST(WX_CFLAGS) AC_SUBST(WX_CXXFLAGS) AC_SUBST(WX_CFLAGS_ONLY) AC_SUBST(WX_CXXFLAGS_ONLY) AC_SUBST(WX_LIBS) AC_SUBST(WX_LIBS_STATIC) AC_SUBST(WX_VERSION) AC_SUBST(WX_RESCOMP) dnl need to export also WX_VERSION_MINOR and WX_VERSION_MAJOR symbols dnl to support wxpresets bakefiles (we export also WX_VERSION_MICRO for completeness): WX_VERSION_MAJOR="$wx_config_major_version" WX_VERSION_MINOR="$wx_config_minor_version" WX_VERSION_MICRO="$wx_config_micro_version" AC_SUBST(WX_VERSION_MAJOR) AC_SUBST(WX_VERSION_MINOR) AC_SUBST(WX_VERSION_MICRO) ]) dnl --------------------------------------------------------------------------- dnl Get information on the wxrc program for making C++, Python and xrs dnl resource files. dnl dnl AC_ARG_ENABLE(...) dnl AC_ARG_WITH(...) dnl ... dnl WX_CONFIG_OPTIONS dnl ... dnl WX_CONFIG_CHECK(2.6.0, wxWin=1) dnl if test "$wxWin" != 1; then dnl AC_MSG_ERROR([ dnl wxWidgets must be installed on your system dnl but wx-config script couldn't be found. dnl dnl Please check that wx-config is in path, the directory dnl where wxWidgets libraries are installed (returned by dnl 'wx-config --libs' command) is in LD_LIBRARY_PATH or dnl equivalent variable and wxWidgets version is 2.6.0 or above. dnl ]) dnl fi dnl dnl WXRC_CHECK([HAVE_WXRC=1], [HAVE_WXRC=0]) dnl if test "x$HAVE_WXRC" != x1; then dnl AC_MSG_ERROR([ dnl The wxrc program was not installed or not found. dnl dnl Please check the wxWidgets installation. dnl ]) dnl fi dnl dnl CPPFLAGS="$CPPFLAGS $WX_CPPFLAGS" dnl CXXFLAGS="$CXXFLAGS $WX_CXXFLAGS_ONLY" dnl CFLAGS="$CFLAGS $WX_CFLAGS_ONLY" dnl dnl LDFLAGS="$LDFLAGS $WX_LIBS" dnl --------------------------------------------------------------------------- dnl --------------------------------------------------------------------------- dnl WXRC_CHECK([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]) dnl dnl Test for wxWidgets' wxrc program for creating either C++, Python or XRS dnl resources. The variable WXRC will be set and substituted in the configure dnl script and Makefiles. dnl dnl Example use: dnl WXRC_CHECK([wxrc=1], [wxrc=0]) dnl --------------------------------------------------------------------------- dnl dnl wxrc program from the wx-config script dnl AC_DEFUN([WXRC_CHECK], [ AC_ARG_VAR([WXRC], [Path to wxWidget's wxrc resource compiler]) if test "x$WX_CONFIG_NAME" = x; then AC_MSG_ERROR([The wxrc tests must run after wxWidgets test.]) else AC_MSG_CHECKING([for wxrc]) if test "x$WXRC" = x ; then dnl wx-config --utility is a new addition to wxWidgets: _WX_PRIVATE_CHECK_VERSION(2,5,3) if test -n "$wx_ver_ok"; then WXRC=`$WX_CONFIG_WITH_ARGS --utility=wxrc` fi fi if test "x$WXRC" = x ; then AC_MSG_RESULT([not found]) ifelse([$2], , :, [$2]) else AC_MSG_RESULT([$WXRC]) ifelse([$1], , :, [$1]) fi AC_SUBST(WXRC) fi ]) dnl --------------------------------------------------------------------------- dnl WX_LIKE_LIBNAME([output-var] [prefix], [name]) dnl dnl Sets the "output-var" variable to the name of a library named with same dnl wxWidgets rule. dnl E.g. for output-var=='lib', name=='test', prefix='mine', sets dnl the $lib variable to: dnl 'mine_gtk2ud_test-2.8' dnl if WX_PORT=gtk2, WX_UNICODE=1, WX_DEBUG=1 and WX_RELEASE=28 dnl --------------------------------------------------------------------------- AC_DEFUN([WX_LIKE_LIBNAME], [ wx_temp="$2""_""$WX_PORT" dnl add the [u][d] string if test "$WX_UNICODE" = "1"; then wx_temp="$wx_temp""u" fi if test "$WX_DEBUG" = "1"; then wx_temp="$wx_temp""d" fi dnl complete the name of the lib wx_temp="$wx_temp""_""$3""-$WX_VERSION_MAJOR.$WX_VERSION_MINOR" dnl save it in the user's variable $1=$wx_temp ]) dnl --------------------------------------------------------------------------- dnl WX_ARG_ENABLE_YESNOAUTO/WX_ARG_WITH_YESNOAUTO dnl dnl Two little custom macros which define the ENABLE/WITH configure arguments. dnl Macro arguments: dnl $1 = the name of the --enable / --with feature dnl $2 = the name of the variable associated dnl $3 = the description of that feature dnl $4 = the default value for that feature dnl $5 = additional action to do in case option is given with "yes" value dnl --------------------------------------------------------------------------- AC_DEFUN([WX_ARG_ENABLE_YESNOAUTO], [AC_ARG_ENABLE($1, AC_HELP_STRING([--enable-$1], [$3 (default is $4)]), [], [enableval="$4"]) dnl Show a message to the user about this option AC_MSG_CHECKING([for the --enable-$1 option]) if test "$enableval" = "yes" ; then AC_MSG_RESULT([yes]) $2=1 $5 elif test "$enableval" = "no" ; then AC_MSG_RESULT([no]) $2=0 elif test "$enableval" = "auto" ; then AC_MSG_RESULT([will be automatically detected]) $2="auto" else AC_MSG_ERROR([ Unrecognized option value (allowed values: yes, no, auto) ]) fi ]) AC_DEFUN([WX_ARG_WITH_YESNOAUTO], [AC_ARG_WITH($1, AC_HELP_STRING([--with-$1], [$3 (default is $4)]), [], [withval="$4"]) dnl Show a message to the user about this option AC_MSG_CHECKING([for the --with-$1 option]) if test "$withval" = "yes" ; then AC_MSG_RESULT([yes]) $2=1 $5 dnl NB: by default we don't allow --with-$1=no option dnl since it does not make much sense ! elif test "$6" = "1" -a "$withval" = "no" ; then AC_MSG_RESULT([no]) $2=0 elif test "$withval" = "auto" ; then AC_MSG_RESULT([will be automatically detected]) $2="auto" else AC_MSG_ERROR([ Unrecognized option value (allowed values: yes, auto) ]) fi ]) dnl --------------------------------------------------------------------------- dnl WX_STANDARD_OPTIONS([options-to-add]) dnl dnl Adds to the configure script one or more of the following options: dnl --enable-[debug|unicode|shared|wxshared|wxdebug] dnl --with-[gtk|msw|motif|x11|mac|dfb] dnl --with-wxversion dnl Then checks for their presence and eventually set the DEBUG, UNICODE, SHARED, dnl PORT, WX_SHARED, WX_DEBUG, variables to one of the "yes", "no", "auto" values. dnl dnl Note that e.g. UNICODE != WX_UNICODE; the first is the value of the dnl --enable-unicode option (in boolean format) while the second indicates dnl if wxWidgets was built in Unicode mode (and still is in boolean format). dnl --------------------------------------------------------------------------- AC_DEFUN([WX_STANDARD_OPTIONS], [ dnl the following lines will expand to WX_ARG_ENABLE_YESNOAUTO calls if and only if dnl the $1 argument contains respectively the debug,unicode or shared options. dnl be careful here not to set debug flag if only "wxdebug" was specified ifelse(regexp([$1], [\bdebug]), [-1],, [WX_ARG_ENABLE_YESNOAUTO([debug], [DEBUG], [Build in debug mode], [auto])]) ifelse(index([$1], [unicode]), [-1],, [WX_ARG_ENABLE_YESNOAUTO([unicode], [UNICODE], [Build in Unicode mode], [auto])]) ifelse(regexp([$1], [\bshared]), [-1],, [WX_ARG_ENABLE_YESNOAUTO([shared], [SHARED], [Build as shared library], [auto])]) dnl WX_ARG_WITH_YESNOAUTO cannot be used for --with-toolkit since it's an option dnl which must be able to accept the auto|gtk1|gtk2|msw|... values ifelse(index([$1], [toolkit]), [-1],, [ AC_ARG_WITH([toolkit], AC_HELP_STRING([--with-toolkit], [Build against a specific wxWidgets toolkit (default is auto)]), [], [withval="auto"]) dnl Show a message to the user about this option AC_MSG_CHECKING([for the --with-toolkit option]) if test "$withval" = "auto" ; then AC_MSG_RESULT([will be automatically detected]) TOOLKIT="auto" else TOOLKIT="$withval" dnl PORT must be one of the allowed values if test "$TOOLKIT" != "gtk1" -a "$TOOLKIT" != "gtk2" -a \ "$TOOLKIT" != "msw" -a "$TOOLKIT" != "motif" -a \ "$TOOLKIT" != "osx_carbon" -a "$TOOLKIT" != "osx_cocoa" -a \ "$TOOLKIT" != "dfb" -a "$TOOLKIT" != "x11"; then AC_MSG_ERROR([ Unrecognized option value (allowed values: auto, gtk1, gtk2, msw, motif, osx_carbon, osx_cocoa, dfb, x11) ]) fi AC_MSG_RESULT([$TOOLKIT]) fi ]) dnl ****** IMPORTANT ******* dnl Unlike for the UNICODE setting, you can build your program in dnl shared mode against a static build of wxWidgets. Thus we have the dnl following option which allows these mixtures. E.g. dnl dnl ./configure --disable-shared --with-wxshared dnl dnl will build your library in static mode against the first available dnl shared build of wxWidgets. dnl dnl Note that's not possible to do the viceversa: dnl dnl ./configure --enable-shared --without-wxshared dnl dnl Doing so you would try to build your library in shared mode against a static dnl build of wxWidgets. This is not possible (you would mix PIC and non PIC code) ! dnl A check for this combination of options is in WX_DETECT_STANDARD_OPTION_VALUES dnl (where we know what 'auto' should be expanded to). dnl dnl If you try to build something in ANSI mode against a UNICODE build dnl of wxWidgets or in RELEASE mode against a DEBUG build of wxWidgets, dnl then at best you'll get ton of linking errors ! dnl ************************ ifelse(index([$1], [wxshared]), [-1],, [ WX_ARG_WITH_YESNOAUTO( [wxshared], [WX_SHARED], [Force building against a shared build of wxWidgets, even if --disable-shared is given], [auto], [], [1]) ]) dnl Just like for SHARED and WX_SHARED it may happen that some adventurous dnl peoples will want to mix a wxWidgets release build with a debug build of dnl his app/lib. So, we have both DEBUG and WX_DEBUG variables. ifelse(index([$1], [wxdebug]), [-1],, [ WX_ARG_WITH_YESNOAUTO( [wxdebug], [WX_DEBUG], [Force building against a debug build of wxWidgets, even if --disable-debug is given], [auto], [], [1]) ]) dnl WX_ARG_WITH_YESNOAUTO cannot be used for --with-wxversion since it's an option dnl which accepts the "auto|2.6|2.7|2.8|2.9|3.0" etc etc values ifelse(index([$1], [wxversion]), [-1],, [ AC_ARG_WITH([wxversion], AC_HELP_STRING([--with-wxversion], [Build against a specific version of wxWidgets (default is auto)]), [], [withval="auto"]) dnl Show a message to the user about this option AC_MSG_CHECKING([for the --with-wxversion option]) if test "$withval" = "auto" ; then AC_MSG_RESULT([will be automatically detected]) WX_RELEASE="auto" else wx_requested_major_version=`echo $withval | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).*/\1/'` wx_requested_minor_version=`echo $withval | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).*/\2/'` dnl both vars above must be exactly 1 digit if test "${#wx_requested_major_version}" != "1" -o \ "${#wx_requested_minor_version}" != "1" ; then AC_MSG_ERROR([ Unrecognized option value (allowed values: auto, 2.6, 2.7, 2.8, 2.9, 3.0) ]) fi WX_RELEASE="$wx_requested_major_version"".""$wx_requested_minor_version" AC_MSG_RESULT([$WX_RELEASE]) fi ]) if test "$WX_DEBUG_CONFIGURE" = "1"; then echo "[[dbg]] DEBUG: $DEBUG, WX_DEBUG: $WX_DEBUG" echo "[[dbg]] UNICODE: $UNICODE, WX_UNICODE: $WX_UNICODE" echo "[[dbg]] SHARED: $SHARED, WX_SHARED: $WX_SHARED" echo "[[dbg]] TOOLKIT: $TOOLKIT, WX_TOOLKIT: $WX_TOOLKIT" echo "[[dbg]] VERSION: $VERSION, WX_RELEASE: $WX_RELEASE" fi ]) dnl --------------------------------------------------------------------------- dnl WX_CONVERT_STANDARD_OPTIONS_TO_WXCONFIG_FLAGS dnl dnl Sets the WXCONFIG_FLAGS string using the SHARED,DEBUG,UNICODE variable values dnl which are different from "auto". dnl Thus this macro needs to be called only once all options have been set. dnl --------------------------------------------------------------------------- AC_DEFUN([WX_CONVERT_STANDARD_OPTIONS_TO_WXCONFIG_FLAGS], [ if test "$WX_SHARED" = "1" ; then WXCONFIG_FLAGS="--static=no " elif test "$WX_SHARED" = "0" ; then WXCONFIG_FLAGS="--static=yes " fi if test "$WX_DEBUG" = "1" ; then WXCONFIG_FLAGS="$WXCONFIG_FLAGS""--debug=yes " elif test "$WX_DEBUG" = "0" ; then WXCONFIG_FLAGS="$WXCONFIG_FLAGS""--debug=no " fi dnl The user should have set WX_UNICODE=UNICODE if test "$WX_UNICODE" = "1" ; then WXCONFIG_FLAGS="$WXCONFIG_FLAGS""--unicode=yes " elif test "$WX_UNICODE" = "0" ; then WXCONFIG_FLAGS="$WXCONFIG_FLAGS""--unicode=no " fi if test "$TOOLKIT" != "auto" ; then WXCONFIG_FLAGS="$WXCONFIG_FLAGS""--toolkit=$TOOLKIT " fi if test "$WX_RELEASE" != "auto" ; then WXCONFIG_FLAGS="$WXCONFIG_FLAGS""--version=$WX_RELEASE " fi dnl strip out the last space of the string WXCONFIG_FLAGS=${WXCONFIG_FLAGS% } if test "$WX_DEBUG_CONFIGURE" = "1"; then echo "[[dbg]] WXCONFIG_FLAGS: $WXCONFIG_FLAGS" fi ]) dnl --------------------------------------------------------------------------- dnl _WX_SELECTEDCONFIG_CHECKFOR([RESULTVAR], [STRING], [MSG] dnl [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]) dnl dnl Outputs the given MSG. Then searches the given STRING in the wxWidgets dnl additional CPP flags and put the result of the search in WX_$RESULTVAR dnl also adding the "yes" or "no" message result to MSG. dnl --------------------------------------------------------------------------- AC_DEFUN([_WX_SELECTEDCONFIG_CHECKFOR], [ if test "$$1" = "auto" ; then dnl The user does not have particular preferences for this option; dnl so we will detect the wxWidgets relative build setting and use it AC_MSG_CHECKING([$3]) dnl set WX_$1 variable to 1 if the $WX_SELECTEDCONFIG contains the $2 dnl string or to 0 otherwise. dnl NOTE: 'expr match STRING REGEXP' cannot be used since on Mac it dnl doesn't work; we use 'expr STRING : REGEXP' instead WX_$1=$(expr "$WX_SELECTEDCONFIG" : ".*$2.*") if test "$WX_$1" != "0"; then WX_$1=1 AC_MSG_RESULT([yes]) ifelse([$4], , :, [$4]) else WX_$1=0 AC_MSG_RESULT([no]) ifelse([$5], , :, [$5]) fi else dnl Use the setting given by the user WX_$1=$$1 fi ]) dnl --------------------------------------------------------------------------- dnl WX_DETECT_STANDARD_OPTION_VALUES dnl dnl Detects the values of the following variables: dnl 1) WX_RELEASE dnl 2) WX_UNICODE dnl 3) WX_DEBUG dnl 4) WX_SHARED (and also WX_STATIC) dnl 5) WX_PORT dnl from the previously selected wxWidgets build; this macro in fact must be dnl called *after* calling the WX_CONFIG_CHECK macro. dnl dnl Note that the WX_VERSION_MAJOR, WX_VERSION_MINOR symbols are already set dnl by WX_CONFIG_CHECK macro dnl --------------------------------------------------------------------------- AC_DEFUN([WX_DETECT_STANDARD_OPTION_VALUES], [ dnl IMPORTANT: WX_VERSION contains all three major.minor.micro digits, dnl while WX_RELEASE only the major.minor ones. WX_RELEASE="$WX_VERSION_MAJOR""$WX_VERSION_MINOR" if test $WX_RELEASE -lt 26 ; then AC_MSG_ERROR([ Cannot detect the wxWidgets configuration for the selected wxWidgets build since its version is $WX_VERSION < 2.6.0; please install a newer version of wxWidgets. ]) fi dnl The wx-config we are using understands the "--selected_config" dnl option which returns an easy-parseable string ! WX_SELECTEDCONFIG=$($WX_CONFIG_WITH_ARGS --selected_config) if test "$WX_DEBUG_CONFIGURE" = "1"; then echo "[[dbg]] Using wx-config --selected-config" echo "[[dbg]] WX_SELECTEDCONFIG: $WX_SELECTEDCONFIG" fi dnl we could test directly for WX_SHARED with a line like: dnl _WX_SELECTEDCONFIG_CHECKFOR([SHARED], [shared], dnl [if wxWidgets was built in SHARED mode]) dnl but wx-config --selected-config DOES NOT outputs the 'shared' dnl word when wx was built in shared mode; it rather outputs the dnl 'static' word when built in static mode. if test $WX_SHARED = "1"; then STATIC=0 elif test $WX_SHARED = "0"; then STATIC=1 elif test $WX_SHARED = "auto"; then STATIC="auto" fi dnl Now set the WX_UNICODE, WX_DEBUG, WX_STATIC variables _WX_SELECTEDCONFIG_CHECKFOR([UNICODE], [unicode], [if wxWidgets was built with UNICODE enabled]) _WX_SELECTEDCONFIG_CHECKFOR([DEBUG], [debug], [if wxWidgets was built in DEBUG mode]) _WX_SELECTEDCONFIG_CHECKFOR([STATIC], [static], [if wxWidgets was built in STATIC mode]) dnl init WX_SHARED from WX_STATIC if test "$WX_STATIC" != "0"; then WX_SHARED=0 else WX_SHARED=1 fi AC_SUBST(WX_UNICODE) AC_SUBST(WX_DEBUG) AC_SUBST(WX_SHARED) dnl detect the WX_PORT to use if test "$TOOLKIT" = "auto" ; then dnl The user does not have particular preferences for this option; dnl so we will detect the wxWidgets relative build setting and use it AC_MSG_CHECKING([which wxWidgets toolkit was selected]) WX_GTKPORT1=$(expr "$WX_SELECTEDCONFIG" : ".*gtk1.*") WX_GTKPORT2=$(expr "$WX_SELECTEDCONFIG" : ".*gtk2.*") WX_MSWPORT=$(expr "$WX_SELECTEDCONFIG" : ".*msw.*") WX_MOTIFPORT=$(expr "$WX_SELECTEDCONFIG" : ".*motif.*") WX_OSXCOCOAPORT=$(expr "$WX_SELECTEDCONFIG" : ".*osx_cocoa.*") WX_OSXCARBONPORT=$(expr "$WX_SELECTEDCONFIG" : ".*osx_carbon.*") WX_X11PORT=$(expr "$WX_SELECTEDCONFIG" : ".*x11.*") WX_DFBPORT=$(expr "$WX_SELECTEDCONFIG" : ".*dfb.*") WX_PORT="unknown" if test "$WX_GTKPORT1" != "0"; then WX_PORT="gtk1"; fi if test "$WX_GTKPORT2" != "0"; then WX_PORT="gtk2"; fi if test "$WX_MSWPORT" != "0"; then WX_PORT="msw"; fi if test "$WX_MOTIFPORT" != "0"; then WX_PORT="motif"; fi if test "$WX_OSXCOCOAPORT" != "0"; then WX_PORT="osx_cocoa"; fi if test "$WX_OSXCARBONPORT" != "0"; then WX_PORT="osx_carbon"; fi if test "$WX_X11PORT" != "0"; then WX_PORT="x11"; fi if test "$WX_DFBPORT" != "0"; then WX_PORT="dfb"; fi dnl NOTE: backward-compatible check for wx2.8; in wx2.9 the mac dnl ports are called 'osx_cocoa' and 'osx_carbon' (see above) WX_MACPORT=$(expr "$WX_SELECTEDCONFIG" : ".*mac.*") if test "$WX_MACPORT" != "0"; then WX_PORT="mac"; fi dnl check at least one of the WX_*PORT has been set ! if test "$WX_PORT" = "unknown" ; then AC_MSG_ERROR([ Cannot detect the currently installed wxWidgets port ! Please check your 'wx-config --cxxflags'... ]) fi AC_MSG_RESULT([$WX_PORT]) else dnl Use the setting given by the user if test -z "$TOOLKIT" ; then WX_PORT=$TOOLKIT else dnl try with PORT WX_PORT=$PORT fi fi AC_SUBST(WX_PORT) if test "$WX_DEBUG_CONFIGURE" = "1"; then echo "[[dbg]] Values of all WX_* options after final detection:" echo "[[dbg]] WX_DEBUG: $WX_DEBUG" echo "[[dbg]] WX_UNICODE: $WX_UNICODE" echo "[[dbg]] WX_SHARED: $WX_SHARED" echo "[[dbg]] WX_RELEASE: $WX_RELEASE" echo "[[dbg]] WX_PORT: $WX_PORT" fi dnl Avoid problem described in the WX_STANDARD_OPTIONS which happens when dnl the user gives the options: dnl ./configure --enable-shared --without-wxshared dnl or just do dnl ./configure --enable-shared dnl but there is only a static build of wxWidgets available. if test "$WX_SHARED" = "0" -a "$SHARED" = "1"; then AC_MSG_ERROR([ Cannot build shared library against a static build of wxWidgets ! This error happens because the wxWidgets build which was selected has been detected as static while you asked to build $PACKAGE_NAME as shared library and this is not possible. Use the '--disable-shared' option to build $PACKAGE_NAME as static library or '--with-wxshared' to use wxWidgets as shared library. ]) fi dnl now we can finally update the DEBUG,UNICODE,SHARED options dnl to their final values if they were set to 'auto' if test "$DEBUG" = "auto"; then DEBUG=$WX_DEBUG fi if test "$UNICODE" = "auto"; then UNICODE=$WX_UNICODE fi if test "$SHARED" = "auto"; then SHARED=$WX_SHARED fi if test "$TOOLKIT" = "auto"; then TOOLKIT=$WX_PORT fi dnl in case the user needs a BUILD=debug/release var... if test "$DEBUG" = "1"; then BUILD="debug" elif test "$DEBUG" = "0" -o "$DEBUG" = ""; then BUILD="release" fi dnl respect the DEBUG variable adding the optimize/debug flags dnl NOTE: the CXXFLAGS are merged together with the CPPFLAGS so we dnl don't need to set them, too if test "$DEBUG" = "1"; then CXXFLAGS="$CXXFLAGS -g -O0" CFLAGS="$CFLAGS -g -O0" else CXXFLAGS="$CXXFLAGS -O2" CFLAGS="$CFLAGS -O2" fi ]) dnl --------------------------------------------------------------------------- dnl WX_BOOLOPT_SUMMARY([name of the boolean variable to show summary for], dnl [what to print when var is 1], dnl [what to print when var is 0]) dnl dnl Prints $2 when variable $1 == 1 and prints $3 when variable $1 == 0. dnl This macro mainly exists just to make configure.ac scripts more readable. dnl dnl NOTE: you need to use the [" my message"] syntax for 2nd and 3rd arguments dnl if you want that m4 avoid to throw away the spaces prefixed to the dnl argument value. dnl --------------------------------------------------------------------------- AC_DEFUN([WX_BOOLOPT_SUMMARY], [ if test "x$$1" = "x1" ; then echo $2 elif test "x$$1" = "x0" ; then echo $3 else echo "$1 is $$1" fi ]) dnl --------------------------------------------------------------------------- dnl WX_STANDARD_OPTIONS_SUMMARY_MSG dnl dnl Shows a summary message to the user about the WX_* variable contents. dnl This macro is used typically at the end of the configure script. dnl --------------------------------------------------------------------------- AC_DEFUN([WX_STANDARD_OPTIONS_SUMMARY_MSG], [ echo echo " The wxWidgets build which will be used by $PACKAGE_NAME $PACKAGE_VERSION" echo " has the following settings:" WX_BOOLOPT_SUMMARY([WX_DEBUG], [" - DEBUG build"], [" - RELEASE build"]) WX_BOOLOPT_SUMMARY([WX_UNICODE], [" - UNICODE mode"], [" - ANSI mode"]) WX_BOOLOPT_SUMMARY([WX_SHARED], [" - SHARED mode"], [" - STATIC mode"]) echo " - VERSION: $WX_VERSION" echo " - PORT: $WX_PORT" ]) dnl --------------------------------------------------------------------------- dnl WX_STANDARD_OPTIONS_SUMMARY_MSG_BEGIN, WX_STANDARD_OPTIONS_SUMMARY_MSG_END dnl dnl Like WX_STANDARD_OPTIONS_SUMMARY_MSG macro but these two macros also gives info dnl about the configuration of the package which used the wxpresets. dnl dnl Typical usage: dnl WX_STANDARD_OPTIONS_SUMMARY_MSG_BEGIN dnl echo " - Package setting 1: $SETTING1" dnl echo " - Package setting 2: $SETTING1" dnl ... dnl WX_STANDARD_OPTIONS_SUMMARY_MSG_END dnl dnl --------------------------------------------------------------------------- AC_DEFUN([WX_STANDARD_OPTIONS_SUMMARY_MSG_BEGIN], [ echo echo " ----------------------------------------------------------------" echo " Configuration for $PACKAGE_NAME $PACKAGE_VERSION successfully completed." echo " Summary of main configuration settings for $PACKAGE_NAME:" WX_BOOLOPT_SUMMARY([DEBUG], [" - DEBUG build"], [" - RELEASE build"]) WX_BOOLOPT_SUMMARY([UNICODE], [" - UNICODE mode"], [" - ANSI mode"]) WX_BOOLOPT_SUMMARY([SHARED], [" - SHARED mode"], [" - STATIC mode"]) ]) AC_DEFUN([WX_STANDARD_OPTIONS_SUMMARY_MSG_END], [ WX_STANDARD_OPTIONS_SUMMARY_MSG echo echo " Now, just run make." echo " ----------------------------------------------------------------" echo ]) dnl --------------------------------------------------------------------------- dnl Deprecated macro wrappers dnl --------------------------------------------------------------------------- AC_DEFUN([AM_OPTIONS_WXCONFIG], [WX_CONFIG_OPTIONS]) AC_DEFUN([AM_PATH_WXCONFIG], [ WX_CONFIG_CHECK([$1],[$2],[$3],[$4],[$5]) ]) AC_DEFUN([AM_PATH_WXRC], [WXRC_CHECK([$1],[$2])]) wxedid-0.0.32/m4/build_switch.m40000644000175000017500000000454114722720160013250 00000000000000dnl serial 4 dnl dnl author: Tomasz Pawlak dnl e-mail: tomasz.pawlak@wp.eu dnl dnl AC_BUILD_SWITCH v2.2 (2020.11.21) dnl extension for autoconf: dnl Implementation of Debug/Release build model. dnl dnl AC_BUILD_SWITCH( dnl [CXXFLAGS], [CFLAGS], [CPPFLAGS], [LDFLAGS], dnl [CXXFLAGS], [CFLAGS], [CPPFLAGS], [LDFLAGS] dnl ) AC_DEFUN_ONCE([AC_BUILD_SWITCH], [ AC_ARG_ENABLE([build-mode], AS_HELP_STRING([--enable-build-mode=@<:@release/debug/none@:>@], [ Use predefined flags for release or debug build, none=no predefined flags. [default=release] ]), [enable_flags=$enableval], [enable_flags=release]) AS_MESSAGE([(i) Use predefined build flags? ... $enable_flags]) AS_IF([test "x$enable_flags" = "xdebug"], [ AS_VAR_SET([ac_bsw_CXXFLAGS], [" $1 "]) AS_VAR_SET([ac_bsw_CFLAGS], [" $2 "]) AS_VAR_SET([ac_bsw_CPPFLAGS], [" $3 "]) AS_VAR_SET([ac_bsw_LDFLAGS], [" $4 "]) AS_MESSAGE([(i) Debug CXXFLAGS = ($ac_bsw_CXXFLAGS)]) AS_MESSAGE([(i) Debug CFLAGS = ($ac_bsw_CFLAGS) ]) AS_MESSAGE([(i) Debug CPPFLAGS = ($ac_bsw_CPPFLAGS)]) AS_MESSAGE([(i) Debug LDFLAGS = ($ac_bsw_LDFLAGS) ]) ]) AS_IF([test "x$enable_flags" = "xrelease"], [ AS_VAR_SET([ac_bsw_CXXFLAGS], [" $5 "]) AS_VAR_SET([ac_bsw_CFLAGS], [" $6 "]) AS_VAR_SET([ac_bsw_CPPFLAGS], [" $7 "]) AS_VAR_SET([ac_bsw_LDFLAGS], [" $8 "]) AS_MESSAGE([(i) Release CXXLAGS = ($ac_bsw_CXXFLAGS)]) AS_MESSAGE([(i) Release CFLAGS = ($ac_bsw_CFLAGS) ]) AS_MESSAGE([(i) Release CPPFLAGS = ($ac_bsw_CPPFLAGS)]) AS_MESSAGE([(i) Release LDFLAGS = ($ac_bsw_LDFLAGS) ]) ]) AS_IF([test "x$enable_flags" = "xnone"], [ AS_VAR_SET([ac_bsw_CXXFLAGS], [" "]) AS_VAR_SET([ac_bsw_CFLAGS], [" "]) AS_VAR_SET([ac_bsw_CPPFLAGS], [" "]) AS_VAR_SET([ac_bsw_LDFLAGS], [" "]) ]) AS_VAR_APPEND([CXXFLAGS], ["$ac_bsw_CXXFLAGS"]) AS_VAR_APPEND([CFLAGS], ["$ac_bsw_CFLAGS" ]) AS_VAR_APPEND([CPPFLAGS], ["$ac_bsw_CPPFLAGS"]) AS_VAR_APPEND([LDFLAGS], ["$ac_bsw_LDFLAGS" ]) AS_MESSAGE([(i) Final CXXFLAGS = ($CXXFLAGS)]) AS_MESSAGE([(i) Final CFLAGS = ($CFLAGS) ]) AS_MESSAGE([(i) Final CPPFLAGS = ($CPPFLAGS)]) AS_MESSAGE([(i) Final LDFLAGS = ($LDFLAGS) ]) ])dnl AC_BUILD_SWITCH wxedid-0.0.32/m4/install-sh0000755000175000017500000003253714722720160012340 00000000000000#!/bin/sh # install - install a program, script, or datafile scriptversion=2009-04-28.21; # UTC # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the # following copyright and license. # # Copyright (C) 1994 X Consortium # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or # sell copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- # TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # # Except as contained in this notice, the name of the X Consortium shall not # be used in advertising or otherwise to promote the sale, use or other deal- # ings in this Software without prior written authorization from the X Consor- # tium. # # # FSF changes to this file are in the public domain. # # Calling this script install-sh is preferred over install.sh, to prevent # `make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. nl=' ' IFS=" "" $nl" # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit=${DOITPROG-} if test -z "$doit"; then doit_exec=exec else doit_exec=$doit fi # Put in absolute file names if you don't have them in your path; # or use environment vars. chgrpprog=${CHGRPPROG-chgrp} chmodprog=${CHMODPROG-chmod} chownprog=${CHOWNPROG-chown} cmpprog=${CMPPROG-cmp} cpprog=${CPPROG-cp} mkdirprog=${MKDIRPROG-mkdir} mvprog=${MVPROG-mv} rmprog=${RMPROG-rm} stripprog=${STRIPPROG-strip} posix_glob='?' initialize_posix_glob=' test "$posix_glob" != "?" || { if (set -f) 2>/dev/null; then posix_glob= else posix_glob=: fi } ' posix_mkdir= # Desired mode of installed file. mode=0755 chgrpcmd= chmodcmd=$chmodprog chowncmd= mvcmd=$mvprog rmcmd="$rmprog -f" stripcmd= src= dst= dir_arg= dst_arg= copy_on_change=false no_target_directory= usage="\ Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE or: $0 [OPTION]... SRCFILES... DIRECTORY or: $0 [OPTION]... -t DIRECTORY SRCFILES... or: $0 [OPTION]... -d DIRECTORIES... In the 1st form, copy SRCFILE to DSTFILE. In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. In the 4th, create DIRECTORIES. Options: --help display this help and exit. --version display version info and exit. -c (ignored) -C install only if different (preserve the last data modification time) -d create directories instead of installing files. -g GROUP $chgrpprog installed files to GROUP. -m MODE $chmodprog installed files to MODE. -o USER $chownprog installed files to USER. -s $stripprog installed files. -t DIRECTORY install into DIRECTORY. -T report an error if DSTFILE is a directory. Environment variables override the default commands: CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG " while test $# -ne 0; do case $1 in -c) ;; -C) copy_on_change=true;; -d) dir_arg=true;; -g) chgrpcmd="$chgrpprog $2" shift;; --help) echo "$usage"; exit $?;; -m) mode=$2 case $mode in *' '* | *' '* | *' '* | *'*'* | *'?'* | *'['*) echo "$0: invalid mode: $mode" >&2 exit 1;; esac shift;; -o) chowncmd="$chownprog $2" shift;; -s) stripcmd=$stripprog;; -t) dst_arg=$2 shift;; -T) no_target_directory=true;; --version) echo "$0 $scriptversion"; exit $?;; --) shift break;; -*) echo "$0: invalid option: $1" >&2 exit 1;; *) break;; esac shift done if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then # When -d is used, all remaining arguments are directories to create. # When -t is used, the destination is already specified. # Otherwise, the last argument is the destination. Remove it from $@. for arg do if test -n "$dst_arg"; then # $@ is not empty: it contains at least $arg. set fnord "$@" "$dst_arg" shift # fnord fi shift # arg dst_arg=$arg done fi if test $# -eq 0; then if test -z "$dir_arg"; then echo "$0: no input file specified." >&2 exit 1 fi # It's OK to call `install-sh -d' without argument. # This can happen when creating conditional directories. exit 0 fi if test -z "$dir_arg"; then trap '(exit $?); exit' 1 2 13 15 # Set umask so as not to create temps with too-generous modes. # However, 'strip' requires both read and write access to temps. case $mode in # Optimize common cases. *644) cp_umask=133;; *755) cp_umask=22;; *[0-7]) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw='% 200' fi cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; *) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw=,u+rw fi cp_umask=$mode$u_plus_rw;; esac fi for src do # Protect names starting with `-'. case $src in -*) src=./$src;; esac if test -n "$dir_arg"; then dst=$src dstdir=$dst test -d "$dstdir" dstdir_status=$? else # Waiting for this to be detected by the "$cpprog $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if test ! -f "$src" && test ! -d "$src"; then echo "$0: $src does not exist." >&2 exit 1 fi if test -z "$dst_arg"; then echo "$0: no destination specified." >&2 exit 1 fi dst=$dst_arg # Protect names starting with `-'. case $dst in -*) dst=./$dst;; esac # If destination is a directory, append the input filename; won't work # if double slashes aren't ignored. if test -d "$dst"; then if test -n "$no_target_directory"; then echo "$0: $dst_arg: Is a directory" >&2 exit 1 fi dstdir=$dst dst=$dstdir/`basename "$src"` dstdir_status=0 else # Prefer dirname, but fall back on a substitute if dirname fails. dstdir=` (dirname "$dst") 2>/dev/null || expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$dst" : 'X\(//\)[^/]' \| \ X"$dst" : 'X\(//\)$' \| \ X"$dst" : 'X\(/\)' \| . 2>/dev/null || echo X"$dst" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q' ` test -d "$dstdir" dstdir_status=$? fi fi obsolete_mkdir_used=false if test $dstdir_status != 0; then case $posix_mkdir in '') # Create intermediate dirs using mode 755 as modified by the umask. # This is like FreeBSD 'install' as of 1997-10-28. umask=`umask` case $stripcmd.$umask in # Optimize common cases. *[2367][2367]) mkdir_umask=$umask;; .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; *[0-7]) mkdir_umask=`expr $umask + 22 \ - $umask % 100 % 40 + $umask % 20 \ - $umask % 10 % 4 + $umask % 2 `;; *) mkdir_umask=$umask,go-w;; esac # With -d, create the new directory with the user-specified mode. # Otherwise, rely on $mkdir_umask. if test -n "$dir_arg"; then mkdir_mode=-m$mode else mkdir_mode= fi posix_mkdir=false case $umask in *[123567][0-7][0-7]) # POSIX mkdir -p sets u+wx bits regardless of umask, which # is incompatible with FreeBSD 'install' when (umask & 300) != 0. ;; *) tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 if (umask $mkdir_umask && exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 then if test -z "$dir_arg" || { # Check for POSIX incompatibilities with -m. # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or # other-writeable bit of parent directory when it shouldn't. # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. ls_ld_tmpdir=`ls -ld "$tmpdir"` case $ls_ld_tmpdir in d????-?r-*) different_mode=700;; d????-?--*) different_mode=755;; *) false;; esac && $mkdirprog -m$different_mode -p -- "$tmpdir" && { ls_ld_tmpdir_1=`ls -ld "$tmpdir"` test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" } } then posix_mkdir=: fi rmdir "$tmpdir/d" "$tmpdir" else # Remove any dirs left behind by ancient mkdir implementations. rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null fi trap '' 0;; esac;; esac if $posix_mkdir && ( umask $mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" ) then : else # The umask is ridiculous, or mkdir does not conform to POSIX, # or it failed possibly due to a race condition. Create the # directory the slow way, step by step, checking for races as we go. case $dstdir in /*) prefix='/';; -*) prefix='./';; *) prefix='';; esac eval "$initialize_posix_glob" oIFS=$IFS IFS=/ $posix_glob set -f set fnord $dstdir shift $posix_glob set +f IFS=$oIFS prefixes= for d do test -z "$d" && continue prefix=$prefix$d if test -d "$prefix"; then prefixes= else if $posix_mkdir; then (umask=$mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break # Don't fail if two instances are running concurrently. test -d "$prefix" || exit 1 else case $prefix in *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; *) qprefix=$prefix;; esac prefixes="$prefixes '$qprefix'" fi fi prefix=$prefix/ done if test -n "$prefixes"; then # Don't fail if two instances are running concurrently. (umask $mkdir_umask && eval "\$doit_exec \$mkdirprog $prefixes") || test -d "$dstdir" || exit 1 obsolete_mkdir_used=true fi fi fi if test -n "$dir_arg"; then { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 else # Make a couple of temp file names in the proper directory. dsttmp=$dstdir/_inst.$$_ rmtmp=$dstdir/_rm.$$_ # Trap to clean up those temp files at exit. trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 # Copy the file name to the temp name. (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && # and set any options; do chmod last to preserve setuid bits. # # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $cpprog $src $dsttmp" command. # { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && # If -C, don't bother to copy if it wouldn't change the file. if $copy_on_change && old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && eval "$initialize_posix_glob" && $posix_glob set -f && set X $old && old=:$2:$4:$5:$6 && set X $new && new=:$2:$4:$5:$6 && $posix_glob set +f && test "$old" = "$new" && $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 then rm -f "$dsttmp" else # Rename the file to the real destination. $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || # The rename failed, perhaps because mv can't rename something else # to itself, or perhaps because mv is so ancient that it does not # support -f. { # Now remove or move aside any old file at destination location. # We try this two ways since rm can't unlink itself on some # systems and the destination file might be busy for other # reasons. In this case, the final cleanup might fail but the new # file should still install successfully. { test ! -f "$dst" || $doit $rmcmd -f "$dst" 2>/dev/null || { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } } || { echo "$0: cannot unlink or rename $dst" >&2 (exit 1); exit 1 } } && # Now rename the file to the real destination. $doit $mvcmd "$dsttmp" "$dst" } fi || exit 1 trap '' 0 fi done # Local variables: # 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: wxedid-0.0.32/m4/lt~obsolete.m40000755000175000017500000001311314722720160013140 00000000000000# lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*- # # Copyright (C) 2004, 2005, 2007 Free Software Foundation, Inc. # Written by Scott James Remnant, 2004. # # 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 lt~obsolete.m4 # These exist entirely to fool aclocal when bootstrapping libtool. # # In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN) # which have later been changed to m4_define as they aren't part of the # exported API, or moved to Autoconf or Automake where they belong. # # The trouble is, aclocal is a bit thick. It'll see the old AC_DEFUN # in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us # using a macro with the same name in our local m4/libtool.m4 it'll # pull the old libtool.m4 in (it doesn't see our shiny new m4_define # and doesn't know about Autoconf macros at all.) # # So we provide this file, which has a silly filename so it's always # included after everything else. This provides aclocal with the # AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything # because those macros already exist, or will be overwritten later. # We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. # # Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here. # Yes, that means every name once taken will need to remain here until # we give up compatibility with versions before 1.7, at which point # we need to keep only those names which we still refer to. # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])]) m4_ifndef([AC_LIBTOOL_LINKER_OPTION], [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])]) m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP])]) m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])]) m4_ifndef([_LT_AC_SHELL_INIT], [AC_DEFUN([_LT_AC_SHELL_INIT])]) m4_ifndef([_LT_AC_SYS_LIBPATH_AIX], [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])]) m4_ifndef([_LT_PROG_LTMAIN], [AC_DEFUN([_LT_PROG_LTMAIN])]) m4_ifndef([_LT_AC_TAGVAR], [AC_DEFUN([_LT_AC_TAGVAR])]) m4_ifndef([AC_LTDL_ENABLE_INSTALL], [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])]) m4_ifndef([AC_LTDL_PREOPEN], [AC_DEFUN([AC_LTDL_PREOPEN])]) m4_ifndef([_LT_AC_SYS_COMPILER], [AC_DEFUN([_LT_AC_SYS_COMPILER])]) m4_ifndef([_LT_AC_LOCK], [AC_DEFUN([_LT_AC_LOCK])]) m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE], [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])]) m4_ifndef([_LT_AC_TRY_DLOPEN_SELF], [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])]) m4_ifndef([AC_LIBTOOL_PROG_CC_C_O], [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])]) m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])]) m4_ifndef([AC_LIBTOOL_OBJDIR], [AC_DEFUN([AC_LIBTOOL_OBJDIR])]) m4_ifndef([AC_LTDL_OBJDIR], [AC_DEFUN([AC_LTDL_OBJDIR])]) m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])]) m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP], [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])]) m4_ifndef([AC_PATH_MAGIC], [AC_DEFUN([AC_PATH_MAGIC])]) m4_ifndef([AC_PROG_LD_GNU], [AC_DEFUN([AC_PROG_LD_GNU])]) m4_ifndef([AC_PROG_LD_RELOAD_FLAG], [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])]) m4_ifndef([AC_DEPLIBS_CHECK_METHOD], [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])]) m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])]) m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])]) m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])]) m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])]) m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])]) m4_ifndef([LT_AC_PROG_EGREP], [AC_DEFUN([LT_AC_PROG_EGREP])]) m4_ifndef([LT_AC_PROG_SED], [AC_DEFUN([LT_AC_PROG_SED])]) m4_ifndef([_LT_CC_BASENAME], [AC_DEFUN([_LT_CC_BASENAME])]) m4_ifndef([_LT_COMPILER_BOILERPLATE], [AC_DEFUN([_LT_COMPILER_BOILERPLATE])]) m4_ifndef([_LT_LINKER_BOILERPLATE], [AC_DEFUN([_LT_LINKER_BOILERPLATE])]) m4_ifndef([_AC_PROG_LIBTOOL], [AC_DEFUN([_AC_PROG_LIBTOOL])]) m4_ifndef([AC_LIBTOOL_SETUP], [AC_DEFUN([AC_LIBTOOL_SETUP])]) m4_ifndef([_LT_AC_CHECK_DLFCN], [AC_DEFUN([_LT_AC_CHECK_DLFCN])]) m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])]) m4_ifndef([_LT_AC_TAGCONFIG], [AC_DEFUN([_LT_AC_TAGCONFIG])]) m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])]) m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])]) m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])]) m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])]) m4_ifndef([AC_LIBTOOL_RC], [AC_DEFUN([AC_LIBTOOL_RC])]) m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])]) m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])]) m4_ifndef([_LT_AC_LANG_CXX_CONFIG], [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])]) m4_ifndef([_LT_AC_LANG_F77_CONFIG], [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])]) m4_ifndef([_LT_AC_LANG_GCJ_CONFIG], [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])]) m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])]) m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])]) m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])]) wxedid-0.0.32/m4/ltoptions.m40000755000175000017500000002724214722720160012631 00000000000000# Helper functions for option handling. -*- Autoconf -*- # # Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc. # Written by Gary V. Vaughan, 2004 # # 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 ltoptions.m4 # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])]) # _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME) # ------------------------------------------ m4_define([_LT_MANGLE_OPTION], [[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])]) # _LT_SET_OPTION(MACRO-NAME, OPTION-NAME) # --------------------------------------- # Set option OPTION-NAME for macro MACRO-NAME, and if there is a # matching handler defined, dispatch to it. Other OPTION-NAMEs are # saved as a flag. m4_define([_LT_SET_OPTION], [m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]), _LT_MANGLE_DEFUN([$1], [$2]), [m4_warning([Unknown $1 option `$2'])])[]dnl ]) # _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET]) # ------------------------------------------------------------ # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. m4_define([_LT_IF_OPTION], [m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])]) # _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET) # ------------------------------------------------------- # Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME # are set. m4_define([_LT_UNLESS_OPTIONS], [m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option), [m4_define([$0_found])])])[]dnl m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3 ])[]dnl ]) # _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST) # ---------------------------------------- # OPTION-LIST is a space-separated list of Libtool options associated # with MACRO-NAME. If any OPTION has a matching handler declared with # LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about # the unknown option and exit. m4_defun([_LT_SET_OPTIONS], [# Set options m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), [_LT_SET_OPTION([$1], _LT_Option)]) m4_if([$1],[LT_INIT],[ dnl dnl Simply set some default values (i.e off) if boolean options were not dnl specified: _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no ]) _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no ]) dnl dnl If no reference was made to various pairs of opposing options, then dnl we run the default mode handler for the pair. For example, if neither dnl `shared' nor `disable-shared' was passed, we enable building of shared dnl archives by default: _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED]) _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC]) _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC]) _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install], [_LT_ENABLE_FAST_INSTALL]) ]) ])# _LT_SET_OPTIONS ## --------------------------------- ## ## Macros to handle LT_INIT options. ## ## --------------------------------- ## # _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME) # ----------------------------------------- m4_define([_LT_MANGLE_DEFUN], [[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])]) # LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE) # ----------------------------------------------- m4_define([LT_OPTION_DEFINE], [m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl ])# LT_OPTION_DEFINE # dlopen # ------ LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes ]) AU_DEFUN([AC_LIBTOOL_DLOPEN], [_LT_SET_OPTION([LT_INIT], [dlopen]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `dlopen' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], []) # win32-dll # --------- # Declare package support for building win32 dll's. LT_OPTION_DEFINE([LT_INIT], [win32-dll], [enable_win32_dll=yes case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-cegcc*) AC_CHECK_TOOL(AS, as, false) AC_CHECK_TOOL(DLLTOOL, dlltool, false) AC_CHECK_TOOL(OBJDUMP, objdump, false) ;; esac test -z "$AS" && AS=as _LT_DECL([], [AS], [0], [Assembler program])dnl test -z "$DLLTOOL" && DLLTOOL=dlltool _LT_DECL([], [DLLTOOL], [0], [DLL creation program])dnl test -z "$OBJDUMP" && OBJDUMP=objdump _LT_DECL([], [OBJDUMP], [0], [Object dumper program])dnl ])# win32-dll AU_DEFUN([AC_LIBTOOL_WIN32_DLL], [AC_REQUIRE([AC_CANONICAL_HOST])dnl _LT_SET_OPTION([LT_INIT], [win32-dll]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `win32-dll' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], []) # _LT_ENABLE_SHARED([DEFAULT]) # ---------------------------- # implement the --enable-shared flag, and supports the `shared' and # `disable-shared' LT_INIT options. # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. m4_define([_LT_ENABLE_SHARED], [m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([shared], [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@], [build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_shared=yes ;; no) enable_shared=no ;; *) enable_shared=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_shared=yes fi done IFS="$lt_save_ifs" ;; esac], [enable_shared=]_LT_ENABLE_SHARED_DEFAULT) _LT_DECL([build_libtool_libs], [enable_shared], [0], [Whether or not to build shared libraries]) ])# _LT_ENABLE_SHARED LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])]) # Old names: AC_DEFUN([AC_ENABLE_SHARED], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared]) ]) AC_DEFUN([AC_DISABLE_SHARED], [_LT_SET_OPTION([LT_INIT], [disable-shared]) ]) AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_ENABLE_SHARED], []) dnl AC_DEFUN([AM_DISABLE_SHARED], []) # _LT_ENABLE_STATIC([DEFAULT]) # ---------------------------- # implement the --enable-static flag, and support the `static' and # `disable-static' LT_INIT options. # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. m4_define([_LT_ENABLE_STATIC], [m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([static], [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@], [build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; no) enable_static=no ;; *) enable_static=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_static=yes fi done IFS="$lt_save_ifs" ;; esac], [enable_static=]_LT_ENABLE_STATIC_DEFAULT) _LT_DECL([build_old_libs], [enable_static], [0], [Whether or not to build static libraries]) ])# _LT_ENABLE_STATIC LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])]) # Old names: AC_DEFUN([AC_ENABLE_STATIC], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static]) ]) AC_DEFUN([AC_DISABLE_STATIC], [_LT_SET_OPTION([LT_INIT], [disable-static]) ]) AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_ENABLE_STATIC], []) dnl AC_DEFUN([AM_DISABLE_STATIC], []) # _LT_ENABLE_FAST_INSTALL([DEFAULT]) # ---------------------------------- # implement the --enable-fast-install flag, and support the `fast-install' # and `disable-fast-install' LT_INIT options. # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. m4_define([_LT_ENABLE_FAST_INSTALL], [m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([fast-install], [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@], [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_fast_install=yes ;; no) enable_fast_install=no ;; *) enable_fast_install=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done IFS="$lt_save_ifs" ;; esac], [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT) _LT_DECL([fast_install], [enable_fast_install], [0], [Whether or not to optimize for fast installation])dnl ])# _LT_ENABLE_FAST_INSTALL LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])]) # Old names: AU_DEFUN([AC_ENABLE_FAST_INSTALL], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `fast-install' option into LT_INIT's first parameter.]) ]) AU_DEFUN([AC_DISABLE_FAST_INSTALL], [_LT_SET_OPTION([LT_INIT], [disable-fast-install]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `disable-fast-install' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], []) dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], []) # _LT_WITH_PIC([MODE]) # -------------------- # implement the --with-pic flag, and support the `pic-only' and `no-pic' # LT_INIT options. # MODE is either `yes' or `no'. If omitted, it defaults to `both'. m4_define([_LT_WITH_PIC], [AC_ARG_WITH([pic], [AS_HELP_STRING([--with-pic], [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], [pic_mode="$withval"], [pic_mode=default]) test -z "$pic_mode" && pic_mode=m4_default([$1], [default]) _LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl ])# _LT_WITH_PIC LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])]) LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])]) # Old name: AU_DEFUN([AC_LIBTOOL_PICMODE], [_LT_SET_OPTION([LT_INIT], [pic-only]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `pic-only' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_PICMODE], []) ## ----------------- ## ## LTDL_INIT Options ## ## ----------------- ## m4_define([_LTDL_MODE], []) LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive], [m4_define([_LTDL_MODE], [nonrecursive])]) LT_OPTION_DEFINE([LTDL_INIT], [recursive], [m4_define([_LTDL_MODE], [recursive])]) LT_OPTION_DEFINE([LTDL_INIT], [subproject], [m4_define([_LTDL_MODE], [subproject])]) m4_define([_LTDL_TYPE], []) LT_OPTION_DEFINE([LTDL_INIT], [installable], [m4_define([_LTDL_TYPE], [installable])]) LT_OPTION_DEFINE([LTDL_INIT], [convenience], [m4_define([_LTDL_TYPE], [convenience])]) wxedid-0.0.32/m4/ltsugar.m40000755000175000017500000001042414722720160012251 00000000000000# ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*- # # Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc. # Written by Gary V. Vaughan, 2004 # # 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 ltsugar.m4 # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])]) # lt_join(SEP, ARG1, [ARG2...]) # ----------------------------- # Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their # associated separator. # Needed until we can rely on m4_join from Autoconf 2.62, since all earlier # versions in m4sugar had bugs. m4_define([lt_join], [m4_if([$#], [1], [], [$#], [2], [[$2]], [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])]) m4_define([_lt_join], [m4_if([$#$2], [2], [], [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])]) # lt_car(LIST) # lt_cdr(LIST) # ------------ # Manipulate m4 lists. # These macros are necessary as long as will still need to support # Autoconf-2.59 which quotes differently. m4_define([lt_car], [[$1]]) m4_define([lt_cdr], [m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])], [$#], 1, [], [m4_dquote(m4_shift($@))])]) m4_define([lt_unquote], $1) # lt_append(MACRO-NAME, STRING, [SEPARATOR]) # ------------------------------------------ # Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'. # Note that neither SEPARATOR nor STRING are expanded; they are appended # to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked). # No SEPARATOR is output if MACRO-NAME was previously undefined (different # than defined and empty). # # This macro is needed until we can rely on Autoconf 2.62, since earlier # versions of m4sugar mistakenly expanded SEPARATOR but not STRING. m4_define([lt_append], [m4_define([$1], m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])]) # lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...]) # ---------------------------------------------------------- # Produce a SEP delimited list of all paired combinations of elements of # PREFIX-LIST with SUFFIX1 through SUFFIXn. Each element of the list # has the form PREFIXmINFIXSUFFIXn. # Needed until we can rely on m4_combine added in Autoconf 2.62. m4_define([lt_combine], [m4_if(m4_eval([$# > 3]), [1], [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl [[m4_foreach([_Lt_prefix], [$2], [m4_foreach([_Lt_suffix], ]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[, [_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])]) # lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ]) # ----------------------------------------------------------------------- # Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited # by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ. m4_define([lt_if_append_uniq], [m4_ifdef([$1], [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1], [lt_append([$1], [$2], [$3])$4], [$5])], [lt_append([$1], [$2], [$3])$4])]) # lt_dict_add(DICT, KEY, VALUE) # ----------------------------- m4_define([lt_dict_add], [m4_define([$1($2)], [$3])]) # lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE) # -------------------------------------------- m4_define([lt_dict_add_subkey], [m4_define([$1($2:$3)], [$4])]) # lt_dict_fetch(DICT, KEY, [SUBKEY]) # ---------------------------------- m4_define([lt_dict_fetch], [m4_ifval([$3], m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]), m4_ifdef([$1($2)], [m4_defn([$1($2)])]))]) # lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE]) # ----------------------------------------------------------------- m4_define([lt_if_dict_fetch], [m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4], [$5], [$6])]) # lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...]) # -------------------------------------------------------------- m4_define([lt_dict_filter], [m4_if([$5], [], [], [lt_join(m4_quote(m4_default([$4], [[, ]])), lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]), [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl ]) wxedid-0.0.32/configure.ac0000644000175000017500000000413314722720160012271 00000000000000dnl -*- Autoconf -*- dnl Process this file with autoconf to produce a configure script. dnl wxEDID - Extended Display Identification Data editor AC_PREREQ([2.65]) AC_INIT([wxEDID], [0.0.32], [tomasz.pawlak@wp.eu]) AC_COPYRIGHT([Copyright (C) 2014-2024 Tomasz Pawlak, e-mail: tomasz.pawlak@wp.eu]) AC_CONFIG_SRCDIR([src/wxEDID.cpp]) AC_CONFIG_HEADERS([src/config.h]) AC_CONFIG_MACRO_DIR([m4]) AC_CONFIG_AUX_DIR([build-aux]) AM_INIT_AUTOMAKE([subdir-objects no-dependencies foreign nostdinc silent-rules]) dnl disable the default "-g -O2" flags. (after AC_INIT, before AC_PROG_CXX) : ${CXXFLAGS=""} : ${CPPFLAGS=""} AC_PROG_CXX AC_LANG([C++]) AS_VAR_SET([ac_lang_cflags], [$CFLAGS]) AC_OPT_RCD_AUTOGEN([src/rcode/rcd_autogen]) dnl AC_BUILD_SWITCH( dnl [CXXFLAGS], [CFLAGS], [CPPFLAGS], [LDFLAGS], dnl [CXXFLAGS], [CFLAGS], [CPPFLAGS], [LDFLAGS] dnl ) AC_BUILD_SWITCH( [ -fno-exceptions -g ], [], [ -Wall -DDBG_LEVEL_1 -DDBG_LEVEL_2], [], [ -fno-exceptions -O1 -flto], [], [ -Wall -Wfatal-errors], [ -Wl,-s]) AC_SUBST([ac_lang_cflags]) AS_MESSAGE([(i) Final CFLAGS = ($ac_lang_cflags) ]) AS_MESSAGE([(i) Final LDFLAGS = ($LDFLAGS) ]) dnl Checks for libraries. WX_CONFIG_CHECK([3.1.0], [wxWin=1], [wxWin=0], [std,aui]) if test "$wxWin" != 1; then WX_CONFIG_CHECK([3.0.0], [wxWin=1], [wxWin=0], [std,aui]) if test "$wxWin" != 1; then AC_MSG_ERROR([ wxWidgets must be installed on your system but wx-config script couldn't be found. Please check that wx-config is in path, the directory where wxWidgets libraries are installed (returned by 'wx-config --libs' command) is in LD_LIBRARY_PATH or equivalent variable and wxWidgets version is 3.0.0 or above. ]) fi fi CPPFLAGS="$CPPFLAGS $WX_CPPFLAGS" CXXFLAGS="$CXXFLAGS $WX_CXXFLAGS_ONLY" CFLAGS="$CFLAGS $WX_CFLAGS_ONLY" LIBS="$LIBS $WX_LIBS" AS_VAR_APPEND([RCDGEN_PP_ARGS], [" $WX_CPPFLAGS"]) export RCDGEN_PP_ARGS AC_RCD_AUTOGEN_TARGET([src/wxedid.rcdgen_cfg]) AC_CONFIG_FILES([ Makefile ]) AC_OUTPUT wxedid-0.0.32/README0000644000175000017500000000650614722720160010671 00000000000000 CTA-861 version: CTA-861-H Standard from January 2021 +---------------+ | KNOWN ISSUES: | +---------------+ 1. CEA/CTA-861: Data Block Collection (DBC): The data structures in DBC are variable, and their layout depends on complex combinations of various fields values. Changing a single value (even a single bit) can change the whole layout of the block. In many cases, more than one value has to be changed to obtain a valid structure of different type, f.e.: changing ADB.SAD.AFC value to 15 (ACE: Audio Coding Extension Type Code) will cause error, because AFC=15 in byte 1 requires also a valid ACE value in byte 3. In such cases the editor will switch to a fallback mode, and the data structures will be displayed as "unknown/damaged". wxEDID Solution: (not yet implemented): A set of constructors which will immediately initialize the required block data fields, depending on selected type. The constructors could be invoked from contextual menus, by right-clicking on particular block in the block tree structure. 2. SVD: Short Video Descriptor: The data layout for this block depends on: a) CEA-861 header revision b) Video ID Code (VIC) wxEDID will always show the "native_mode" bit7 and the VIC as 8-bit value at the same time. This means, that changing "native_mode" bit can also change the VIC value. 3. VDDDB: VESA Display Device Data Block: VESA DDDB Standard, Version 1; September 25, 2006, section 2.7: Device Native Pixel Format. A bug in the specification: The STD defines stored 16-bit H/V pixel count as (pix_count-1), (what gives the effective range of 1-65536 for 0x0-0xFFFF), but the Std says that thanks to (pix_count-1) formula the maximum is 65535x65535, which is not true. wxEDID will use range of 1-65536. 4. CEA::VDB: The pseudo-code for VIC values decoding treats VIC range 193..253 as valid, while the max Video ID value in Table 3 (Video Formats) is 219. wxEDID will report VIC values in range 220..255 as reserved. 5. T10VTDB: unit for V-Refresh rate is not explicitly defined: assuming [Hz] V-refresh range depnds on layout type: T10_M=0: 0..255Hz, T10_M=1: 0..1023Hz 6. Discrepancy in block length handling: a) CEA-DBC: Extended Tag Code=32: section 7.5.9 IFDB: InfoFrame Data Block: InfoFrame Type Code != 0x01 || 0x00: Short InfoFrame Descriptor Header: The payload length is counted from the first byte after the header b) CEA-DBC: Extended Tag Code=32: 7.5.9 IFDB: InfoFrame Data Block: InfoFrame Type Code = 0x01: Short Vendor-Specific InfoFrame Descriptor Header: The payload length excludes the first 3 bytes of IEEE OUI. This means that the length of header depends on InfoFrame Type Code. 7. For any block type, the payload data which is not strictly defined by the CTA-861-H is displayed as "unknown". 8. SLDB, SAB: Some speakers used in CTA-861-G are removed in CTA-861-H 9. VSD: The payload is interpreted as for 00-0C-03 "HDMI Licensing, LLC", what means that for other IEEE-OUI codes the interpretation is incorrect. 10. RMCD::SPKD: CTA-861-H essentially agrees with G-spec, but (apparentl erroneously) defines default values for X/Y/Zmax, saying that f.e. 0x10 (16 dec) corresponds to 32 decimeters. If You'll find any bugs, please don't hesitate to contact me: tomasz.pawlak@wp.eu wxedid-0.0.32/COPYING0000644000175000017500000000137014722720160011036 00000000000000wxEDID, Extended Display Identification Data (EDID) editor. Copyright (C) 2014-2024 Tomasz Pawlak, e-mail: tomasz.pawlak@wp.eu License: GNU General Public License version 3 (GPLv3) The wxEDID 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 3 of the License, or (at your option) any later version. The wxEDID 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 version 3 for more details. Full text of GNU General Public License version 3 is available at: http://www.gnu.org/licenses wxedid-0.0.32/ChangeLog0000644000175000017500000006231214722720160011560 00000000000000#Change log for wxEDID NOTE: All data groups are operating on local data buffers. Reparse() restores the loaded EDID state, reverting all the changes - unless AssembleEDID() or Save/Export is executed. From this point Reparse() restores the saved/assembled state. TODO: VSD: dynamic data layout depends on IEEE-OUI code - currently only 00-0C-03 is supported. (partially fixed). TODO: Constructors for changing block type: in particular, some DBC blocks require to change more than one value at once to get a valid block of different type. (partially done). TODO: DataGrid: Add option to hide/grey-out reserved fields. TODO: Validation: Value ranges, reserved fields, field relations TODO: add handler opcode: OP_VALIDATE. TODO: add rule descriptors for fields. TODO: HDRD: dynamic HMTD names TODO: Handle copying of sub-grps with T_NO_COPY flag (HDRD::HMTD, SLDB::SPKLD, ..): deferred call to init(), which needs access to parent grp data - i.e. on Paste(). TODO: Support for HDMI Forum blocks: TODO: DBC_ET_HEOVR : HDMI Forum EDID Extension Override Data Block TODO: DBC_ET_HSCDB : HDMI Forum Sink Capability Data Block ____ BUGS: ____ 2024.12.01 2024.11.30 - Fixed: UNK-DAT sub-grp: added type flag T_NO_MOVE: can't be moved. - Fixed: EDID_cl::STI_DBN(): use std name from VS if found - it can contain RB flag, which is not encoded directly in the structure. - Cleanup: edi_grp_cl::init_fields(): removed unused arg 'orflags' - Change: H-spec: SLDB::SPKD X/Y/Zmax distances have defined default values. - Change: H-spec: SLDB::DSPC DisplayX/Y/Z fields have defined default values. - Added: SLDB::SPKLD: value selector for Speaker_ID. - Added: EDID_cl::RMCD_NormV(): new handler to support normalized distance values in SLDB::DSPC and SLDB::SPKLD - Added: SLDB::SPKLD support for dynamic group name, based on spk ID, chn number and X/Y/Z coordinates 2024.11.27 - Fixed: (BUG::regression) SVD: No dynamic name generated for VIC==0 (reserved). - Fixed: (BUG) edi_grp_cl::base_clone(): missing call to AssembleGroup(): changes made in sub-groups were not included in cloned group. - Fixed: wxEDID_Frame::evt_blktr_paste(): keep expanded state of target group. - Adedd: EDID_cl::AssembleEDID(): automatically inject missing descriptors of type 0x01 (VOID) in base EDID block, if ignoring of EDID errors is enabled. - Added: StatusBar: display total group size in bytes. 2024.11.25 - Fixed: (BUG::wxWidgets::GTK) missing icons in wxMessageBox(): using custom wxDialog: dlg::MessageBox() - Fixed: Event logic race: changing BlkTree group selection whith DataGrid selection active: description displayed in Info panel comes from field of newly generated grid insted from newly slected group. - Fixed: Some errors logged twice for Reparse(). - Cleanup: Removed code for evt nesting prevention - no longer needed. - Cleanup: wxEDID_Frame::evt_dgrid_write(): removed Show/HideCellEditControl() - no longer needed. - Change: ADB: ACE_TC field moved to pos. 3, rigth after AFC row. - Change: Removed edi_grp_cl::subg_id: use type_id.subg_id >> root grps need to have this value set correctly, to support insert_into(). - Change: EDID_base.cpp: main funtions and common field handlers moved to EDID_main.cpp 2024.11.24 - Fixed: (BUG): UpdateDataGrid(): special case: assertion failure: (row_idx the index of selected row becomes out of range -> SelectRow() fails. - Fixed: (BUG::regression): RMCD: payload data interpreted as UNK-DAT. - Change: RMCD: removed DHDR sub-grp, using AHF now. - Change: SAB3D: ACAT fields moved to top of the field list. - Cleanup: HDRD: EDID_cl::HDRD_mtd_type() removed, using general-purpose EDID_cl::Word16() handler. - Change: H-spec: ADB: AFC=15, ACE=4,5,6, SAD byte2.bit0 is now "SysH_22_2" (reserved in G) - Change: H-spec: ADB: AFC=15, ACE=11, SAD byte0.bits0-2 field is now "MPEG-H 3D Audio Level" (reserved in G) - Change: H-spec: ADB: AFC=15, ACE=11, SAD byte2.bit0 is now "LCP" (reserved in G) - Change: H-spec: ADB: AFC=15, ACE=11, SAD byte2.bit1 is now "BP" (reserved in G) - Added: ADB::SAD: ACE_TC value selector. - Added: ADB::SAD: support for dynamic group names, based on SAD.ACE_TC code (if AFC==15) 2024.11.23 - Fixed: (BUG::regression) base_DBC_Init_RootGrp() insert UNK-DAT group if block length is too short to show AHF fields. - Fixed: (BUG) BlkTreeChangeGrpType()->EDID.ParseAltDtor() needs grp offset, because instance data is in local data buffer -> for UNK type, the error message contains invalid group offset. - Change: MRL-CVT: CVT version byte split into major:minor bitfields. - Change: H-spec: SAB: byte0.bit6 is now reserved, was RLC/RRC: Rear Left/Right of Center - Change: H-spec: SAB: byte2.bit3 is now reserved, was TpLS/TpRS Top Left/Right Surround. However, in HADB this bit is used for LSd/RSd: Left/Right Surround direct - Added: H-spec: Support for HADB: HDMI Audio Data Block. 2024.11.21 - Fixed: (BUG::old) ParseEDID_CEA() incorrect calculation of num_dtd: std says it's a total number of native DTDs, including Block0, but only DTDs in the CEA block were counted. - Fixed: (BUG::old) value of BED.num_extblk is now properly handled: num_extblk==0: only base EDID is saved, regardless of whether extension was loaded or not. num_extblk==1: wxedid reports error on Save/Export if the extension block is not present. num_extblk>1: error: only 1 extension block is currently supported (CTA-861). - Fixed: (BUG::wxWidgets::undocumented) ImportEDID_hex(): wxFileDialog: wilcard selector is showing empty string if path contains file extension that doesn't match the wilcard. - Fixed: ParseEDID_CEA(): added checking of 18-byte desc. type @ dtd_offs: must be a DTD. Currently it is possible to change the DTD into alt. desc. type by setting the PixClk to 0. - Change: ExportEDID_hex(), ImportEDID_hex(): default file name extension is '*.hex', so it is different from EDID structures saved as text. 2024.11.18 - Fixed: T10VTDB, ADB, VDB: missing initialization of edi_grp_cl::subg_id: doInsert() did not set type_id for inserted groups. - Fixed: UNK-DAT sub-grps can only be deleted - or re-interpreted when group type or length is changed. - Fixed: GroupAr_cl::base_Paste() pasted group must inherit T_P_HOLDER flag (currently only for STI) - Added: blktree_cl::evt_mouse_leftup(): sending wxEVT_TREE_SEL_CHANGED evt -> allows to re-select currently selected item -> display group decription again. - Added: blktree_cl::evt_Lmouse_dclick(): sending WXK_RETURN key events for selected tree items. - Added: wxEDID_Frame::evt_blktr_key() handling of WXK_RETURN key events: switch to DTD constructor if selected item is of type DTD or T7VTDB. 2024.11.17 - Change: Added -llto flag to release build flags (link-time optimization) - Change: MRL: variable data layout, depending on byte10 value (modes 0x00, 0x01, 0x02, 0x04) - Added: MRL: support for CVT support information data layout (mode 0x04). - Change: MRL: EDID_cl::MRL_MaxPixClk() takes additional PixClk precision bits into account if CVT support information is available (mode 0x04). - Change: txtd_cl: dynamic blk name: display for invalid data, which otherwise could trigger changing of tree item spacing. - Added: txtd_cl: "hex_text" field: hexadecimal representation of the text string. 2024.11.16 - Change: UTX, MSN, MND: single txtd_cl class: switching ID, text field name and description depending on descriptor type. - Change: EDID: UNK descriptor handles type 0x10 as "VOID: Unused Data" - Added: EDID descriptor: DCM: Display Color Management (type 0xF9). - Added: EDID descriptor: CT3: CVT 3-Byte Timing Codes (type 0xF8). - Added: EDID descriptor: ET3: Estabilished Timings 3 (type 0xF7) - Added: VESA STD2, CVT3 non-std codes: "(!std)" appended to dynamic group name. 2024.11.13 - Fixed: (BUG::old) wxEDID_Frame::BlkTreeChangeGrpType(), BlkTreeUpdateGrp(): assertion failure (invalid idx) when changing type of last group in the GroupAr_cl. - Update: grpar: changed rules for operating groups/sub-groups: - base EDID & AST: STI can be moved/copied/pasted, - added support for new type_id format & flags. - Added: Support for LE<->BE byte swapping, depending on platform endianness: EDID_cl::Word16(), BitF16Val(), MfcId(), ProdSN(), DTD_PixClk(), ParseEDID_Base(hdr_magic). 2024.11.09 - Added: DTD_constructor: support for T7VTDB - Change: EDID_class.cpp split into EDID_base.cpp and EDID_dsc.cpp - Change: AST: Additional Standard Timings (type 0xFA) uses STI sub-groups, what allows to show dynamic timing names and use value selector menu. - Change: Base_EDID::Alt Descriptors are now sharing header fields: using edi_grp_cl::init_fields() in append mode. - Change: T8VTDB: TSC=1 layout: using STI sub-groups, exchangeable with AST descriptor. - Change: Files generated by rcd_autogen are removed by "distclean" target, and not by "clean-local". This allows to re-build the package after 'make clean' without invoking the rcd_autogen again. 2024.11.08 - Change: edi_grp_cl::type_id type changed to gtid_t -> alternative way for referencing type flags. - Change: (Paste/Insert): always create copy of source group -> no need to handle special cases. - Added: EDID_cl::ParseEDID_Base(), ParseEDID_CEA() logging details of the parsing process. - Added: EDID_cl::AssembleEDID(): logging details of the assembling process. 2024.11.05 - Fixed: (BUG) BlkTreeChangeGrpType(): missing initialization of parent array: grp_new->setParentAr() - Added: ADB::SAD: support for dynamic group names, based on SAD.AFC code. - Added: T8VTDB: dynamic type ID, based on TSC bit value: verifying layout type for Insert operation. - Added: T8VTDB: dynamic VTC sub-groups base names: T8VTC_T0/STI, depending on TSC bit value. - Added: T10VTDB: dynamic type ID, based on T10_M bit value: verifying layout type for Insert operation. - Added: T10VTDB: dynamic VTD sub-groups base names: T10VTD_M0/T10VTD_M1, depending on T10_M value. - Added: H-spec: Support for T10VTDB. 2024.11.03 - Fixed: (BUG) removed invalid "code page 437" references from field descriptions. - Fixed: (BUG::old) EDID_cl::FldPadStr()-> wxString::FromAscii(): assertion failure if UTX, MND or MSN descriptors contain non-ascii values. Now using wxString::From8BitData() / wxString::To8BitData(), what allows to handle invalid EDID data. - Change: CEA-DBC IDs shifted 1 bit left to make space for new Alternative Descriptors IDs. - Change: DTD can be transformed into alternative descriptor type by setting PixClk to ZERO. - Change: Alternative descriptors can be transformed to DTD by changing "zero_hdr" field to a non-zero value. - Added: EDID_cl::ALT_DType(): dedicated handler for alt. desc. type field: triggers reparsing of descriptor data. - Added: Support for changing descriptor types in base EDID block. 2024.11.02 - Fixed: (BUG::old::mislooked): wxEDID_Frame::WriteField(): invalid access to freed data field buffer after DBC Tag or ETag values are changed. This could trigger repersing of invalid data from deleted block. - Fixed: (BUG::LEAK::old): wxEDID_Frame::BlkTreeDelGrp(), wxEDID_Frame::evt_blktr_copy(): deletion of sub-groups not performed -> LEAK. - Change: Added DMT video codes table: vid_fmt.cpp::dmt_table[]. The table is used for generating value selectors for DMT-ID, STD2 and CVT3 codes. - Cleanup: Removed redundand checking for NULL instance ponter in some field handlers. - Added: H-spec: Support for T8VTDB. 2024.10.27 - Added: dbc_root_dsc_t.fields, dbc_root_dsc_t.fcount and dbc_root_dsc_t.ahf_sz: support for additional fields in root group (besides the DBC header), needed for T8VTDB and T10VTDB - Change: edi_grp_cl::base_DBC_Init_RootGrp(), SubGrpAr_cl::CalcDataSZ(), GroupAr_cl::base_CalcDataSZ(): added support for additional header fields in dbc_root_dsc_t. 2024.10.26 - Fixed: (BUG::old::mislooked): AST: Additional Standard Timings descriptor: incorrect description for desc_type field. - Fixed: STI, AST: 'pix_ratio' field should be 'asp_ratio': image aspect ratio. - Fixed: (BUG::regression): SaveRep(): TagCode 7 and T7VTDB ETag descriptions not printed. - Change: EDID_cl::getVidDesc() -> EDID_cl::getValDesc(): general-purpose fn. - Added: vmap_ent_t.flags: additional flags for modifying value selector behaviour. Currently used only with F_HEX for VESA DMT 2 byte codes - Added: STI: 'DMT_2' field which allows to select standardised VESA video code using value selector menu. - Change: The DMT codes values are exceeding the range allowed for wxMenuItem ID (0x0..0x7FFF), so a new method for encoding menu item values is used: If (new) F_VSVM s set in edi_field_t.flags, the the value is stored from vmap_ent_t.val instead of item ID. - Added: H-spec: Support for T7VTDB. 2024.10.13 - Change: Added vmap.cpp: global array of value maps and selector menus. Now the vmaps are referenced by edi_field_t.vmap_idx and can be shared among many fields. Value selector menus are created only on first use: wxEDID_Frame::evt_dgrid_vsel()->vmap_GetSelector() Removed: edi_dynfld_t.selector and edi_grp_cl.create_selector() 2024.10.12 - Fixed: SaveEDID(): update BlockTree root node label and config.last_used_fname. - Change: edi_grp_cl::base_DBC_Init_FlatGrp() adopted to work as init() for T7VTDB. - Change: EDID_cl::ParseDBC_TAG(): create unknown type data blocks also for reserved ETags. This allows to freely change ETags and generates correct error messages. 2024.10.08 - Added: T7VTDB: value selectors for 3D mode and aspect ratio. - Added: T7VTDB: getGrpName(): support for dynamic block name 2024.10.03 - Fixed: (BUG::typo::old): mrl_cl::Clone(): base_clone() invoked with new dtd_cl, should be mrl_cl. - Fixed: EDID_cl::DTD_PixClk() now uses rdWord16_LE() and wrWord16_LE(), what allows to correctly handle unaligned 16bit fields in CEA block. Besides that, those functions allow to operate unaligned fields in T7VTDB. - Added: EDID_cl::T7VTB_PixClk() and T7VTB_W15_LE() dedicated field handlers for T7VTDB. - Added: EDID_cl::Word16(): unaligned u16_t opperations, LE. 2024.09.28 - Started: updates for CTA-861-H - Added: New Extended Tag Codes definitions: DBC_ET_T7VTB : DisplayID Type VII Video Timing Data Block, DBC_ET_T8VTB : DisplayID Type VIII Video Timing Data Block DBC_ET_T10VTB: DisplayID Type X Video Timing Data Block Not in CTA-861-H spec: DBC_ET_HEOVR : HDMI Forum EDID Extension Override Data Block DBC_ET_HSCDB : HDMI Forum Sink Capability Data Block DBC_ET_HADB : HDMI Audio Data Block - Change: vmap_t structures replaced with const std::map. This was necessary because new ETags have high values like "DBC_ET_HEOVR" == 120, so the old vmap_t would need to contain a lot of NULL entries. 2024.06.30 - Update: rcode v3.2 2024.03.16 2024.03.15 - Fixed: (BUG) wxEDID_Frame::evt_ntbook_page() was invoked during frame construction with uninitialized wxEDID_Frame::flags & wxEDID_Frame::edigrp_sel, what could lead to a segfault. 2024.01.08 2024.01.06 - Added: Support for Dark Mode in Block Data grid. NOTE: wxGrid does not fully support dynamic theme switching in wxWidgets v3.2.x, so the application has to be restarted to use new theme. - Fixed: DTD panel: fixed alignment of "X11 mode line". 2024.01.05 - Fixed: Option "Assemble EDID" now updates also the CHD::DTD_offset field in Block Data grid. NOTE: The value is computed by EDID_cl::CEA_Set_DTD_Offset(). - Fixed: wxEDID_Frame::AssembleEDID_main(): the EDID.BASE.BED could be refreshed twice if the CEA extension is not present. 2024.01.04 - Fixed: Auto-select the BED block also after "Reparse EDID buffer" is executed: wxEDID_Frame::Reparse()->AutoSelectBED() - Fixed: mrl_cl::fields: misleading field description: GTF J, GTF C: "xxx value, multiplied by 2: 0...255 -> 0...127.5" changed to: "xxx value, multiplied by 2: 0...127.5 -> 0...255" - Fixed: MRL::resvd field should have the F_HEX flag. - Fixed: BED: fields ProdYr and ProdWk should not have the F_DN flag set. - Fixed: BED: ProdWk: added information that week==0 means that the field is not used. - Change: F_NI "NI" flag is no longer displayed in BlockData::"Flags" column. - Update: rcode v3.0: structure changed: RCD_UNIT_MAX=65535, RCD_LINE_MAX=16383 2023.05.22 - Fixed: (BUG::regression) EDID_cl::getVidDesc(): missing space between aspect ratio and screen resolution: incorrect SVD description in text output mode (Save_As_Text). - Fixed: Using global strings where possible: cheaper, faster. xxx::getGrpName() -> global EDID_cl::gp_name wxEDID_Frame::SaveRep_SubGrps(), WriteField(), GetFullGroupName() -> wxEDID_Frame::sval EDID_cl::getStrUint() -> EDID_cl::tmps2 - Change: BED: dynamic name: displays only MFC and product ID (removed prod. year and week) - Change: VDB::SVD: append "[Native]" if native resolution flag is set. 2023.05.21 2023.05.19 - Fixed: STI: removed unused F_FR flag, removed useless code for setting NU flag. - Added: STI: use screen resolution as dynamic block name or set "not used" if both bytes are 0x1. - Added: BED: display MFC code, year, week, prod ID as dynamic block name. - Added: VID: display input type as dynamic block name. - Added: BDD: display image size as dynamic block name. - Fixed: EDID_cl::FldPadStr(OP_READ): return string without padding bytes. - Added: MND: display monitor name as dynamic block name. 2023.05.18 - Added: edi_grp_cl::getGrpName(): support for dynamic block names. - Added: BlkTreeSwitchDynamicNames(): update block names from evt_dyn_blk_names handler. - Added: config option: blk_dynamic_names. - Added: DTD and VDB::SVD: use screen resolution as dynamic block name. 2023.03.08 - Cleanup: EDID_cl::getValUnitName(), getValTypeName(), getValFlagsAsString(): removed useless error checking. - Update: rcd_autogen v2.9: Fixed: misuse of VMSG TLS pointer, race possible. No influence on wxEDID behaviour, just update. 2023.03.07 - Added: Automatic selection of BED block after the EDID file is loaded/imported. 2022.12.20 - Fixed: DTD panel: sct_vsoffs, sct_vswidth controls: value range should be 0..63, not 0..1023 - Fixed: DTD panel: sct_pixclk control: value range should be 0..65535 (655.35MHz), not 0..655350 - Fixed: wxWidgets v3.2 : wxEDID_App::CmdLineArgs() "wxPATH_NORM_ALL" is deprecated, now the fn uses: (wxPATH_NORM_DOTS|wxPATH_NORM_TILDE|wxPATH_NORM_ABSOLUTE). 2022.11.12 - Change: Default colors for all controls: allows to work with different window themes: wxWidgets 3.0.x: not working for wxAUI windows, wxTreeCtrl and wxGrid wxWidgets 3.2.x: not working for wxGrid 2022.11.10 - Update: rcd_autogen v2.7 :: fixed: malformed licensing info in generated header files 2022.04.02 - Fixed: (BUG::regression::old) rcd_autoconf.m4: changing rcd_autogen run mode at configure time didn't work. 2022.02.20 2022.02.19 - Cleanup: Removed most of calls to wxT macro - except those generated by wxSmith. - Change: ExportEDID_hex(): do not append wxEDID version and the source file name at the end of output file: this causes errors when the file needs to be imported back (unless ignoring errors is enabled). 2022.02.14 - Change: VFPD: Video Format Preference Data Block is now root group for array of SVRs - Change: CEA-EXT::VFPD:SVR: added vmap: CEA_vidm_map, same as for SVD: this allows to show meaning of SVR values when the EDID structure is saved as text. - Added: wxEDID_Frame::SaveRep_SubGrps(): decoding of VFPD:SVR values. 2022.02.13 - Fixed: The checksum values shown in BlockData grid for EDID.BASE.BED or EDID.CEA.CHD were not refreshed after AssembleEDID/Save/Export. To refresh those cells, it was necessary to Reparse() the EDID buffer. Now the checksums are automatically updated in wxEDID_Frame::AssembleEDID_main(), invoked from wxEDID_Frame::SaveEDID(), ExportEDID_hex(), SaveReport() and evt_assemble_edid(). - Change: wxEDID_Frame::OpenEDID(), ImportEDID_hex(): always try to Reparse() faulty EDID structure when "Ignore EDID errors" is enabled. wxEDID_Frame::Reparse() is now returning fault even when ignoring errors is enabled. - Fixed: (BUG::leak) wxEDID_Frame::ImportEDID_hex(): memory leak possible when the hex->bin conversion fails. 2022.02.09 - Fixed: (BUG::wxWidgets3.x ::wxAUI) AUI managed panel gets refreshed even when it's invisible, what can cause horrible flickering during window resizing. wxEDID_Frame::evt_ntbook_page(): disable the EvtHandler in AUI Manager when the panel is invisible. 2022.02.06 - Fixed: (BUG: Regression in v0.0.23) The functions EDID_cl::MfcId(), ProdSN(), ProdWk(), ProdYr() were not updated to work with local data buffers: the respective fields in EDID.BASE.BED could not be changed. 2022.02.05 - Fixed: wxEDID_Frame::SaveRep_SubGrps(): Video Data Block: VIC values were not really decoded, so for SVD values > 127 the descriptions were incorrect. - Fixed: (BUG::old::mislooked) wxEDID_Frame::SaveRep_SubGrps() uses value descriptions from vmap_t->vname_map_t, but reserved values were not included in some cases -> incorrect (shifted) descriptions in the output file. Now all the reserved values are included with value description set to NULL. edi_grp_cl::create_selector() ignores values with NULL name ptr. wxEDID_Frame::SaveRep_SubGrps() prints "" for NULL name ptr. 2021.10.04 < released v0.0.26 > 2021.09.30 - Cleanup: dtd_screen_cl: removed unused code for background erase event. - Fixed: GCC v10.x :: -Wextra can generate tons of warnings, mostly false-positives: disabled in debug builds. - Change: wxEDID_Frame::evt_blktr_key():: use keycodes instead of Unicodes to identify character keys. 2021.09.29 - Fixed: (BUG) CEA::VSD incorrect bit offset for DVI_Dual field. - Fixed: (BUG) reparsing of CEA-header group should not be possible (returned uninitialized rcode). - Update: rcd_autogen v2.6 :: size of array of units in now fixed, type declaration is variable. 2021.03.27 < released v0.0.25 > - Change: default size for all spin controls on DTD_Constructor panel. Looks ugly, but works with wxWidgets compiled against GTK3. 2021.03.26 - Fixed: Build fails with Clang: unlike GCC, Clang does not support static initialization of flexible arrays in C++ mode: removed flex arrays from all field groups descriptors. - Update: rcd_autogen v2.4 :: removed flexible array of units in rcd_scope_t. 2021.03.24 - Fixed: :: in case of error, always return error message, not just the rcode. Some function were returning the message only if "Ignore Errors" mode was enabled. 2021.03.21 < released v0.0.24 > 2021.03.18 - Fixed: Menu "Options": "Reparse EDID buffer" and "AssembleEDID" options are disabled until EDID data is loaded/imported. - Fixed: (BUG::regression) wxEDID_Frame::CreateBlockTree(): the BlockTree was not expanded automatically when opened file contains only the base EDID block (no extensions). - Added: wxEDID_Frame::ImportEDID_hex(): report source file byte offset if conversion fails. 2021.03.17 - Fixed: wxEDID_Frame::UpdateDataGrid(): missing auto-resizing of row labels width: BlkDataGrid->SetRowLabelSize(wxGRID_AUTOSIZE). - Fixed: (old mislooked BUG): STI: Standard Timing Information: NU flag was not set for unused fields. - Fixed: (BUG::regression): edi_grp_cl::init_fields(): a call to FieldsAr.Empty() is necessary for ForcedGrpRefresh() functions. - Added: VID: Video Input Descriptor: support for field definitions introduced in EDID v1.4 2021.03.16 - Change: EDID base block: UNK: Unknown Descriptor, unk_cl::init(): insert unknown byte fields instead of single byte string (easier to view and edit). 2021.03.14 - Change: EDID_class.h: CEA-specific classes moved to dedicated headers: CEA.h, CEA_ET_class.h - Change: EDID_class.h: shared declarations moved to EDID_shared.h 2021.03.13 < released v0.0.23 > < removed old entries > wxedid-0.0.32/Makefile.am0000644000175000017500000000161714722720160012043 00000000000000ACLOCAL_AMFLAGS = -I m4 AM_CPPFLAGS = @ac_lang_cflags@ wxedid_LDADD = @LIBS@ bin_PROGRAMS = wxedid wxedid_SOURCES = \ src/wxEDID_App.cpp \ src/wxEDID.cpp \ src/EDID_main.cpp \ src/EDID_base.cpp \ src/EDID_dsc.cpp \ src/CEA.cpp \ src/CEA_ET.cpp \ src/grpar.cpp \ src/vid_fmt.cpp \ src/vmap.cpp \ src/guilog.cpp \ src/wxEDID_App.h \ src/wxEDID.h \ src/EDID.h \ src/EDID_shared.h \ src/EDID_class.h \ src/CEA_class.h \ src/CEA_ET_class.h \ src/CEA.h \ src/CEA_ET.h \ src/grpar.h \ src/id_flags.h \ src/vmap.h \ src/guilog.h \ src/rcdunits.h \ src/def_types.h \ src/debug.h #files generated by rcd_autogen nodist_wxedid_SOURCES = \ src/wxedid_rcd_scope.cpp \ src/wxedid_rcd_scope.h EXTRA_DIST = build-aux m4 man EXTRA_DIST += src/rcode EXTRA_DIST += src/wxedid.rcdgen_cfg EXTRA_DIST += cb_project/wxEDID.cbp EXTRA_DIST += cb_project/wxsmith distclean: rm -f src/*_rcd_scope.*